diff --git a/24_10_22/24_10_22 - Frontend.pptx b/24_10_22/24_10_22 - Frontend.pptx new file mode 100644 index 0000000..b4569a6 Binary files /dev/null and b/24_10_22/24_10_22 - Frontend.pptx differ diff --git a/24_10_22/node_modules/.package-lock.json b/24_10_22/node_modules/.package-lock.json new file mode 100644 index 0000000..d44af17 --- /dev/null +++ b/24_10_22/node_modules/.package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "24_10_22", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/gayszi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gayszi/-/gayszi-1.0.0.tgz", + "integrity": "sha512-DSb532QJeK21A+evYv0YgWN4mSndwnHU52Rfo3sdkpSjXLdyJBWHXt9bJvhn6W8BfrVazSognM1yD7FkkKNQNw==", + "license": "ISC" + } + } +} diff --git a/24_10_22/node_modules/gayszi/index.js b/24_10_22/node_modules/gayszi/index.js new file mode 100644 index 0000000..ae8a0ab --- /dev/null +++ b/24_10_22/node_modules/gayszi/index.js @@ -0,0 +1,6 @@ + +function helloNpm() { + return "hello NPM" +} + +module.exports = helloNpm diff --git a/24_10_22/node_modules/gayszi/package.json b/24_10_22/node_modules/gayszi/package.json new file mode 100644 index 0000000..dd0bb39 --- /dev/null +++ b/24_10_22/node_modules/gayszi/package.json @@ -0,0 +1,19 @@ +{ + "name": "gayszi", + "version": "1.0.0", + "description": "gayszi", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/PlayerMarci/gayszi.git" + }, + "author": "PlayerMarci", + "license": "ISC", + "bugs": { + "url": "https://github.com/PlayerMarci/gayszi/issues" + }, + "homepage": "https://github.com/PlayerMarci/gayszi#readme" +} diff --git a/24_10_22/package-lock.json b/24_10_22/package-lock.json new file mode 100644 index 0000000..e91bf8b --- /dev/null +++ b/24_10_22/package-lock.json @@ -0,0 +1,22 @@ +{ + "name": "24_10_22", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "24_10_22", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "gayszi": "^1.0.0" + } + }, + "node_modules/gayszi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gayszi/-/gayszi-1.0.0.tgz", + "integrity": "sha512-DSb532QJeK21A+evYv0YgWN4mSndwnHU52Rfo3sdkpSjXLdyJBWHXt9bJvhn6W8BfrVazSognM1yD7FkkKNQNw==", + "license": "ISC" + } + } +} diff --git a/24_10_22/package.json b/24_10_22/package.json new file mode 100644 index 0000000..bc819c0 --- /dev/null +++ b/24_10_22/package.json @@ -0,0 +1,16 @@ +{ + "dependencies": { + "gayszi": "^1.0.0" + }, + "name": "24_10_22", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "sosincsvege": "echo SOSINCS VÉGE" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "" +} diff --git a/24_10_22_faktorialis/factorial.mjs b/24_10_22_faktorialis/factorial.mjs new file mode 100644 index 0000000..281f8cd --- /dev/null +++ b/24_10_22_faktorialis/factorial.mjs @@ -0,0 +1,7 @@ +function factorial(number){ + if (number == 1){ + return 1; + } + return number * factorial(number - 1); +}; +export {factorial}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/.bin/mathjs b/24_10_22_faktorialis/node_modules/.bin/mathjs new file mode 100644 index 0000000..302bad5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/.bin/mathjs @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mathjs/bin/cli.js" "$@" +else + exec node "$basedir/../mathjs/bin/cli.js" "$@" +fi diff --git a/24_10_22_faktorialis/node_modules/.bin/mathjs.cmd b/24_10_22_faktorialis/node_modules/.bin/mathjs.cmd new file mode 100644 index 0000000..b8c2962 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/.bin/mathjs.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mathjs\bin\cli.js" %* diff --git a/24_10_22_faktorialis/node_modules/.bin/mathjs.ps1 b/24_10_22_faktorialis/node_modules/.bin/mathjs.ps1 new file mode 100644 index 0000000..98edaeb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/.bin/mathjs.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mathjs/bin/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mathjs/bin/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mathjs/bin/cli.js" $args + } else { + & "node$exe" "$basedir/../mathjs/bin/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/24_10_22_faktorialis/node_modules/.package-lock.json b/24_10_22_faktorialis/node_modules/.package-lock.json new file mode 100644 index 0000000..1c2c499 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/.package-lock.json @@ -0,0 +1,114 @@ +{ + "name": "24_10_22_faktorialis", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@babel/runtime": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/complex.js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.3.0.tgz", + "integrity": "sha512-wWHzifVdUPbPBhh+ObvpVGIzrAQjTvmnnEJKBfLW5YbyAB6OXQ0r+Q92fByMIrSSlxUuCujqxriJSR6R/kVxPA==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "license": "MIT" + }, + "node_modules/escape-latex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", + "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", + "license": "MIT" + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "license": "MIT" + }, + "node_modules/mathjs": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-13.2.0.tgz", + "integrity": "sha512-P5PZoiUX2Tkghkv3tsSqlK0B9My/ErKapv1j6wdxd0MOrYQ30cnGE4LH/kzYB2gA5rN46Njqc4cFgJjaxgijoQ==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.25.6", + "complex.js": "^2.1.1", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^4.3.7", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "bin": { + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, + "node_modules/seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", + "license": "MIT" + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "license": "MIT" + }, + "node_modules/typed-function": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz", + "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + } + } +} diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/LICENSE b/24_10_22_faktorialis/node_modules/@babel/runtime/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/README.md b/24_10_22_faktorialis/node_modules/@babel/runtime/README.md new file mode 100644 index 0000000..2f3368e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/README.md @@ -0,0 +1,19 @@ +# @babel/runtime + +> babel's modular runtime helpers + +See our website [@babel/runtime](https://babeljs.io/docs/babel-runtime) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/runtime +``` + +or using yarn: + +```sh +yarn add @babel/runtime +``` diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/AwaitValue.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/AwaitValue.js new file mode 100644 index 0000000..52a7e69 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/AwaitValue.js @@ -0,0 +1,4 @@ +function _AwaitValue(t) { + this.wrapped = t; +} +module.exports = _AwaitValue, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/OverloadYield.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/OverloadYield.js new file mode 100644 index 0000000..0eca88c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/OverloadYield.js @@ -0,0 +1,4 @@ +function _OverloadYield(e, d) { + this.v = e, this.k = d; +} +module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js new file mode 100644 index 0000000..0ff780e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js @@ -0,0 +1,9 @@ +function _applyDecoratedDescriptor(i, e, r, n, l) { + var a = {}; + return Object.keys(n).forEach(function (i) { + a[i] = n[i]; + }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { + return n(i, e, r) || r; + }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; +} +module.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs.js new file mode 100644 index 0000000..3770c5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs.js @@ -0,0 +1,236 @@ +var _typeof = require("./typeof.js")["default"]; +var setFunctionName = require("./setFunctionName.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function old_createMetadataMethodsForProperty(e, t, a, r) { + return { + getMetadata: function getMetadata(o) { + old_assertNotFinished(r, "getMetadata"), old_assertMetadataKey(o); + var i = e[o]; + if (void 0 !== i) if (1 === t) { + var n = i["public"]; + if (void 0 !== n) return n[a]; + } else if (2 === t) { + var l = i["private"]; + if (void 0 !== l) return l.get(a); + } else if (Object.hasOwnProperty.call(i, "constructor")) return i.constructor; + }, + setMetadata: function setMetadata(o, i) { + old_assertNotFinished(r, "setMetadata"), old_assertMetadataKey(o); + var n = e[o]; + if (void 0 === n && (n = e[o] = {}), 1 === t) { + var l = n["public"]; + void 0 === l && (l = n["public"] = {}), l[a] = i; + } else if (2 === t) { + var s = n.priv; + void 0 === s && (s = n["private"] = new Map()), s.set(a, i); + } else n.constructor = i; + } + }; +} +function old_convertMetadataMapToFinal(e, t) { + var a = e[Symbol.metadata || Symbol["for"]("Symbol.metadata")], + r = Object.getOwnPropertySymbols(t); + if (0 !== r.length) { + for (var o = 0; o < r.length; o++) { + var i = r[o], + n = t[i], + l = a ? a[i] : null, + s = n["public"], + c = l ? l["public"] : null; + s && c && Object.setPrototypeOf(s, c); + var d = n["private"]; + if (d) { + var u = Array.from(d.values()), + f = l ? l["private"] : null; + f && (u = u.concat(f)), n["private"] = u; + } + l && Object.setPrototypeOf(n, l); + } + a && Object.setPrototypeOf(t, a), e[Symbol.metadata || Symbol["for"]("Symbol.metadata")] = t; + } +} +function old_createAddInitializerMethod(e, t) { + return function (a) { + old_assertNotFinished(t, "addInitializer"), old_assertCallable(a, "An initializer"), e.push(a); + }; +} +function old_memberDec(e, t, a, r, o, i, n, l, s) { + var c; + switch (i) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var d, + u, + f = { + kind: c, + name: l ? "#" + t : toPropertyKey(t), + isStatic: n, + isPrivate: l + }, + p = { + v: !1 + }; + if (0 !== i && (f.addInitializer = old_createAddInitializerMethod(o, p)), l) { + d = 2, u = Symbol(t); + var v = {}; + 0 === i ? (v.get = a.get, v.set = a.set) : 2 === i ? v.get = function () { + return a.value; + } : (1 !== i && 3 !== i || (v.get = function () { + return a.get.call(this); + }), 1 !== i && 4 !== i || (v.set = function (e) { + a.set.call(this, e); + })), f.access = v; + } else d = 1, u = t; + try { + return e(s, Object.assign(f, old_createMetadataMethodsForProperty(r, d, u, p))); + } finally { + p.v = !0; + } +} +function old_assertNotFinished(e, t) { + if (e.v) throw Error("attempted to call " + t + " after decoration was finished"); +} +function old_assertMetadataKey(e) { + if ("symbol" != _typeof(e)) throw new TypeError("Metadata keys must be symbols, received: " + e); +} +function old_assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); +} +function old_assertValidReturnValue(e, t) { + var a = _typeof(t); + if (1 === e) { + if ("object" !== a || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && old_assertCallable(t.get, "accessor.get"), void 0 !== t.set && old_assertCallable(t.set, "accessor.set"), void 0 !== t.init && old_assertCallable(t.init, "accessor.init"), void 0 !== t.initializer && old_assertCallable(t.initializer, "accessor.initializer"); + } else if ("function" !== a) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); +} +function old_getInit(e) { + var t; + return null == (t = e.init) && (t = e.initializer) && void 0 !== console && console.warn(".initializer has been renamed to .init as of March 2022"), t; +} +function old_applyMemberDec(e, t, a, r, o, i, n, l, s) { + var c, + d, + u, + f, + p, + v, + y, + h = a[0]; + if (n ? (0 === o || 1 === o ? (c = { + get: a[3], + set: a[4] + }, u = "get") : 3 === o ? (c = { + get: a[3] + }, u = "get") : 4 === o ? (c = { + set: a[3] + }, u = "set") : c = { + value: a[3] + }, 0 !== o && (1 === o && setFunctionName(a[4], "#" + r, "set"), setFunctionName(a[3], "#" + r, u))) : 0 !== o && (c = Object.getOwnPropertyDescriptor(t, r)), 1 === o ? f = { + get: c.get, + set: c.set + } : 2 === o ? f = c.value : 3 === o ? f = c.get : 4 === o && (f = c.set), "function" == typeof h) void 0 !== (p = old_memberDec(h, r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? d = p : 1 === o ? (d = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = { + get: v, + set: y + }) : f = p);else for (var m = h.length - 1; m >= 0; m--) { + var b; + void 0 !== (p = old_memberDec(h[m], r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? b = p : 1 === o ? (b = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = { + get: v, + set: y + }) : f = p, void 0 !== b && (void 0 === d ? d = b : "function" == typeof d ? d = [d, b] : d.push(b))); + } + if (0 === o || 1 === o) { + if (void 0 === d) d = function d(e, t) { + return t; + };else if ("function" != typeof d) { + var g = d; + d = function d(e, t) { + for (var a = t, r = 0; r < g.length; r++) a = g[r].call(e, a); + return a; + }; + } else { + var _ = d; + d = function d(e, t) { + return _.call(e, t); + }; + } + e.push(d); + } + 0 !== o && (1 === o ? (c.get = f.get, c.set = f.set) : 2 === o ? c.value = f : 3 === o ? c.get = f : 4 === o && (c.set = f), n ? 1 === o ? (e.push(function (e, t) { + return f.get.call(e, t); + }), e.push(function (e, t) { + return f.set.call(e, t); + })) : 2 === o ? e.push(f) : e.push(function (e, t) { + return f.call(e, t); + }) : Object.defineProperty(t, r, c)); +} +function old_applyMemberDecs(e, t, a, r, o) { + for (var i, n, l = new Map(), s = new Map(), c = 0; c < o.length; c++) { + var d = o[c]; + if (Array.isArray(d)) { + var u, + f, + p, + v = d[1], + y = d[2], + h = d.length > 3, + m = v >= 5; + if (m ? (u = t, f = r, 0 != (v -= 5) && (p = n = n || [])) : (u = t.prototype, f = a, 0 !== v && (p = i = i || [])), 0 !== v && !h) { + var b = m ? s : l, + g = b.get(y) || 0; + if (!0 === g || 3 === g && 4 !== v || 4 === g && 3 !== v) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + y); + !g && v > 2 ? b.set(y, v) : b.set(y, !0); + } + old_applyMemberDec(e, u, d, y, v, m, h, f, p); + } + } + old_pushInitializers(e, i), old_pushInitializers(e, n); +} +function old_pushInitializers(e, t) { + t && e.push(function (e) { + for (var a = 0; a < t.length; a++) t[a].call(e); + return e; + }); +} +function old_applyClassDecs(e, t, a, r) { + if (r.length > 0) { + for (var o = [], i = t, n = t.name, l = r.length - 1; l >= 0; l--) { + var s = { + v: !1 + }; + try { + var c = Object.assign({ + kind: "class", + name: n, + addInitializer: old_createAddInitializerMethod(o, s) + }, old_createMetadataMethodsForProperty(a, 0, n, s)), + d = r[l](i, c); + } finally { + s.v = !0; + } + void 0 !== d && (old_assertValidReturnValue(10, d), i = d); + } + e.push(i, function () { + for (var e = 0; e < o.length; e++) o[e].call(i); + }); + } +} +function applyDecs(e, t, a) { + var r = [], + o = {}, + i = {}; + return old_applyMemberDecs(r, e, i, o, t), old_convertMetadataMapToFinal(e.prototype, i), old_applyClassDecs(r, e, o, a), old_convertMetadataMapToFinal(e, o), r; +} +module.exports = applyDecs, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203.js new file mode 100644 index 0000000..d3da333 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203.js @@ -0,0 +1,184 @@ +var _typeof = require("./typeof.js")["default"]; +function applyDecs2203Factory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function memberDec(e, t, r, a, n, i, s, o) { + var c; + switch (n) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var l, + u, + f = { + kind: c, + name: s ? "#" + t : t, + "static": i, + "private": s + }, + p = { + v: !1 + }; + 0 !== n && (f.addInitializer = createAddInitializerMethod(a, p)), 0 === n ? s ? (l = r.get, u = r.set) : (l = function l() { + return this[t]; + }, u = function u(e) { + this[t] = e; + }) : 2 === n ? l = function l() { + return r.value; + } : (1 !== n && 3 !== n || (l = function l() { + return r.get.call(this); + }), 1 !== n && 4 !== n || (u = function u(e) { + r.set.call(this, e); + })), f.access = l && u ? { + get: l, + set: u + } : l ? { + get: l + } : { + set: u + }; + try { + return e(o, f); + } finally { + p.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function applyMemberDec(e, t, r, a, n, i, s, o) { + var c, + l, + u, + f, + p, + d, + h = r[0]; + if (s ? c = 0 === n || 1 === n ? { + get: r[3], + set: r[4] + } : 3 === n ? { + get: r[3] + } : 4 === n ? { + set: r[3] + } : { + value: r[3] + } : 0 !== n && (c = Object.getOwnPropertyDescriptor(t, a)), 1 === n ? u = { + get: c.get, + set: c.set + } : 2 === n ? u = c.value : 3 === n ? u = c.get : 4 === n && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, a, c, o, n, i, s, u)) && (assertValidReturnValue(n, f), 0 === n ? l = f : 1 === n ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = { + get: p, + set: d + }) : u = f);else for (var v = h.length - 1; v >= 0; v--) { + var g; + void 0 !== (f = memberDec(h[v], a, c, o, n, i, s, u)) && (assertValidReturnValue(n, f), 0 === n ? g = f : 1 === n ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = { + get: p, + set: d + }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g))); + } + if (0 === n || 1 === n) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var y = l; + l = function l(e, t) { + for (var r = t, a = 0; a < y.length; a++) r = y[a].call(e, r); + return r; + }; + } else { + var m = l; + l = function l(e, t) { + return m.call(e, t); + }; + } + e.push(l); + } + 0 !== n && (1 === n ? (c.get = u.get, c.set = u.set) : 2 === n ? c.value = u : 3 === n ? c.get = u : 4 === n && (c.set = u), s ? 1 === n ? (e.push(function (e, t) { + return u.get.call(e, t); + }), e.push(function (e, t) { + return u.set.call(e, t); + })) : 2 === n ? e.push(u) : e.push(function (e, t) { + return u.call(e, t); + }) : Object.defineProperty(t, a, c)); + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r) { + var a = []; + return function (e, t, r) { + for (var a, n, i = new Map(), s = new Map(), o = 0; o < r.length; o++) { + var c = r[o]; + if (Array.isArray(c)) { + var l, + u, + f = c[1], + p = c[2], + d = c.length > 3, + h = f >= 5; + if (h ? (l = t, 0 != (f -= 5) && (u = n = n || [])) : (l = t.prototype, 0 !== f && (u = a = a || [])), 0 !== f && !d) { + var v = h ? s : i, + g = v.get(p) || 0; + if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); + !g && f > 2 ? v.set(p, f) : v.set(p, !0); + } + applyMemberDec(e, l, c, p, f, h, d, u); + } + } + pushInitializers(e, a), pushInitializers(e, n); + }(a, e, t), function (e, t, r) { + if (r.length > 0) { + for (var a = [], n = t, i = t.name, s = r.length - 1; s >= 0; s--) { + var o = { + v: !1 + }; + try { + var c = r[s](n, { + kind: "class", + name: i, + addInitializer: createAddInitializerMethod(a, o) + }); + } finally { + o.v = !0; + } + void 0 !== c && (assertValidReturnValue(10, c), n = c); + } + e.push(n, function () { + for (var e = 0; e < a.length; e++) a[e].call(n); + }); + } + }(a, e, r), a; + }; +} +var applyDecs2203Impl; +function applyDecs2203(e, t, r) { + return (applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory())(e, t, r); +} +module.exports = applyDecs2203, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203R.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203R.js new file mode 100644 index 0000000..725419b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2203R.js @@ -0,0 +1,191 @@ +var _typeof = require("./typeof.js")["default"]; +var setFunctionName = require("./setFunctionName.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2203RFactory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function memberDec(e, t, r, n, a, i, o, s) { + var c; + switch (a) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var l, + u, + f = { + kind: c, + name: o ? "#" + t : toPropertyKey(t), + "static": i, + "private": o + }, + p = { + v: !1 + }; + 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? o ? (l = r.get, u = r.set) : (l = function l() { + return this[t]; + }, u = function u(e) { + this[t] = e; + }) : 2 === a ? l = function l() { + return r.value; + } : (1 !== a && 3 !== a || (l = function l() { + return r.get.call(this); + }), 1 !== a && 4 !== a || (u = function u(e) { + r.set.call(this, e); + })), f.access = l && u ? { + get: l, + set: u + } : l ? { + get: l + } : { + set: u + }; + try { + return e(s, f); + } finally { + p.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function applyMemberDec(e, t, r, n, a, i, o, s) { + var c, + l, + u, + f, + p, + d, + h, + v = r[0]; + if (o ? (0 === a || 1 === a ? (c = { + get: r[3], + set: r[4] + }, u = "get") : 3 === a ? (c = { + get: r[3] + }, u = "get") : 4 === a ? (c = { + set: r[3] + }, u = "set") : c = { + value: r[3] + }, 0 !== a && (1 === a && setFunctionName(r[4], "#" + n, "set"), setFunctionName(r[3], "#" + n, u))) : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? f = { + get: c.get, + set: c.set + } : 2 === a ? f = c.value : 3 === a ? f = c.get : 4 === a && (f = c.set), "function" == typeof v) void 0 !== (p = memberDec(v, n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? l = p : 1 === a ? (l = p.init, d = p.get || f.get, h = p.set || f.set, f = { + get: d, + set: h + }) : f = p);else for (var g = v.length - 1; g >= 0; g--) { + var y; + void 0 !== (p = memberDec(v[g], n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? y = p : 1 === a ? (y = p.init, d = p.get || f.get, h = p.set || f.set, f = { + get: d, + set: h + }) : f = p, void 0 !== y && (void 0 === l ? l = y : "function" == typeof l ? l = [l, y] : l.push(y))); + } + if (0 === a || 1 === a) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var m = l; + l = function l(e, t) { + for (var r = t, n = 0; n < m.length; n++) r = m[n].call(e, r); + return r; + }; + } else { + var b = l; + l = function l(e, t) { + return b.call(e, t); + }; + } + e.push(l); + } + 0 !== a && (1 === a ? (c.get = f.get, c.set = f.set) : 2 === a ? c.value = f : 3 === a ? c.get = f : 4 === a && (c.set = f), o ? 1 === a ? (e.push(function (e, t) { + return f.get.call(e, t); + }), e.push(function (e, t) { + return f.set.call(e, t); + })) : 2 === a ? e.push(f) : e.push(function (e, t) { + return f.call(e, t); + }) : Object.defineProperty(t, n, c)); + } + function applyMemberDecs(e, t) { + for (var r, n, a = [], i = new Map(), o = new Map(), s = 0; s < t.length; s++) { + var c = t[s]; + if (Array.isArray(c)) { + var l, + u, + f = c[1], + p = c[2], + d = c.length > 3, + h = f >= 5; + if (h ? (l = e, 0 != (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) { + var v = h ? o : i, + g = v.get(p) || 0; + if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); + !g && f > 2 ? v.set(p, f) : v.set(p, !0); + } + applyMemberDec(a, l, c, p, f, h, d, u); + } + } + return pushInitializers(a, r), pushInitializers(a, n), a; + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r) { + return { + e: applyMemberDecs(e, t), + get c() { + return function (e, t) { + if (t.length > 0) { + for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { + var o = { + v: !1 + }; + try { + var s = t[i](n, { + kind: "class", + name: a, + addInitializer: createAddInitializerMethod(r, o) + }); + } finally { + o.v = !0; + } + void 0 !== s && (assertValidReturnValue(10, s), n = s); + } + return [n, function () { + for (var e = 0; e < r.length; e++) r[e].call(n); + }]; + } + }(e, r); + } + }; + }; +} +function applyDecs2203R(e, t, r) { + return (module.exports = applyDecs2203R = applyDecs2203RFactory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(e, t, r); +} +module.exports = applyDecs2203R, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2301.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2301.js new file mode 100644 index 0000000..fc2c130 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2301.js @@ -0,0 +1,222 @@ +var _typeof = require("./typeof.js")["default"]; +var checkInRHS = require("./checkInRHS.js"); +var setFunctionName = require("./setFunctionName.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2301Factory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function assertInstanceIfPrivate(e, t) { + if (!e(t)) throw new TypeError("Attempted to access private element on non-instance"); + } + function memberDec(e, t, r, n, a, i, s, o, c) { + var u; + switch (a) { + case 1: + u = "accessor"; + break; + case 2: + u = "method"; + break; + case 3: + u = "getter"; + break; + case 4: + u = "setter"; + break; + default: + u = "field"; + } + var l, + f, + p = { + kind: u, + name: s ? "#" + t : toPropertyKey(t), + "static": i, + "private": s + }, + d = { + v: !1 + }; + if (0 !== a && (p.addInitializer = createAddInitializerMethod(n, d)), s || 0 !== a && 2 !== a) { + if (2 === a) l = function l(e) { + return assertInstanceIfPrivate(c, e), r.value; + };else { + var h = 0 === a || 1 === a; + (h || 3 === a) && (l = s ? function (e) { + return assertInstanceIfPrivate(c, e), r.get.call(e); + } : function (e) { + return r.get.call(e); + }), (h || 4 === a) && (f = s ? function (e, t) { + assertInstanceIfPrivate(c, e), r.set.call(e, t); + } : function (e, t) { + r.set.call(e, t); + }); + } + } else l = function l(e) { + return e[t]; + }, 0 === a && (f = function f(e, r) { + e[t] = r; + }); + var v = s ? c.bind() : function (e) { + return t in e; + }; + p.access = l && f ? { + get: l, + set: f, + has: v + } : l ? { + get: l, + has: v + } : { + set: f, + has: v + }; + try { + return e(o, p); + } finally { + d.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function curryThis2(e) { + return function (t) { + e(this, t); + }; + } + function applyMemberDec(e, t, r, n, a, i, s, o, c) { + var u, + l, + f, + p, + d, + h, + v, + y, + g = r[0]; + if (s ? (0 === a || 1 === a ? (u = { + get: (d = r[3], function () { + return d(this); + }), + set: curryThis2(r[4]) + }, f = "get") : 3 === a ? (u = { + get: r[3] + }, f = "get") : 4 === a ? (u = { + set: r[3] + }, f = "set") : u = { + value: r[3] + }, 0 !== a && (1 === a && setFunctionName(u.set, "#" + n, "set"), setFunctionName(u[f || "value"], "#" + n, f))) : 0 !== a && (u = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? p = { + get: u.get, + set: u.set + } : 2 === a ? p = u.value : 3 === a ? p = u.get : 4 === a && (p = u.set), "function" == typeof g) void 0 !== (h = memberDec(g, n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? l = h : 1 === a ? (l = h.init, v = h.get || p.get, y = h.set || p.set, p = { + get: v, + set: y + }) : p = h);else for (var m = g.length - 1; m >= 0; m--) { + var b; + void 0 !== (h = memberDec(g[m], n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? b = h : 1 === a ? (b = h.init, v = h.get || p.get, y = h.set || p.set, p = { + get: v, + set: y + }) : p = h, void 0 !== b && (void 0 === l ? l = b : "function" == typeof l ? l = [l, b] : l.push(b))); + } + if (0 === a || 1 === a) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var I = l; + l = function l(e, t) { + for (var r = t, n = 0; n < I.length; n++) r = I[n].call(e, r); + return r; + }; + } else { + var w = l; + l = function l(e, t) { + return w.call(e, t); + }; + } + e.push(l); + } + 0 !== a && (1 === a ? (u.get = p.get, u.set = p.set) : 2 === a ? u.value = p : 3 === a ? u.get = p : 4 === a && (u.set = p), s ? 1 === a ? (e.push(function (e, t) { + return p.get.call(e, t); + }), e.push(function (e, t) { + return p.set.call(e, t); + })) : 2 === a ? e.push(p) : e.push(function (e, t) { + return p.call(e, t); + }) : Object.defineProperty(t, n, u)); + } + function applyMemberDecs(e, t, r) { + for (var n, a, i, s = [], o = new Map(), c = new Map(), u = 0; u < t.length; u++) { + var l = t[u]; + if (Array.isArray(l)) { + var f, + p, + d = l[1], + h = l[2], + v = l.length > 3, + y = d >= 5, + g = r; + if (y ? (f = e, 0 != (d -= 5) && (p = a = a || []), v && !i && (i = function i(t) { + return checkInRHS(t) === e; + }), g = i) : (f = e.prototype, 0 !== d && (p = n = n || [])), 0 !== d && !v) { + var m = y ? c : o, + b = m.get(h) || 0; + if (!0 === b || 3 === b && 4 !== d || 4 === b && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); + !b && d > 2 ? m.set(h, d) : m.set(h, !0); + } + applyMemberDec(s, f, l, h, d, y, v, p, g); + } + } + return pushInitializers(s, n), pushInitializers(s, a), s; + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r, n) { + return { + e: applyMemberDecs(e, t, n), + get c() { + return function (e, t) { + if (t.length > 0) { + for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { + var s = { + v: !1 + }; + try { + var o = t[i](n, { + kind: "class", + name: a, + addInitializer: createAddInitializerMethod(r, s) + }); + } finally { + s.v = !0; + } + void 0 !== o && (assertValidReturnValue(10, o), n = o); + } + return [n, function () { + for (var e = 0; e < r.length; e++) r[e].call(n); + }]; + } + }(e, r); + } + }; + }; +} +function applyDecs2301(e, t, r, n) { + return (module.exports = applyDecs2301 = applyDecs2301Factory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(e, t, r, n); +} +module.exports = applyDecs2301, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2305.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2305.js new file mode 100644 index 0000000..744c352 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2305.js @@ -0,0 +1,133 @@ +var _typeof = require("./typeof.js")["default"]; +var checkInRHS = require("./checkInRHS.js"); +var setFunctionName = require("./setFunctionName.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2305(e, t, r, n, o, a) { + function i(e, t, r) { + return function (n, o) { + return r && r(n), e[t].call(n, o); + }; + } + function c(e, t) { + for (var r = 0; r < e.length; r++) e[r].call(t); + return t; + } + function s(e, t, r, n) { + if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); + return e; + } + function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { + function m(e) { + if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); + } + var y, + v = t[0], + g = t[3], + b = !u; + if (!b) { + r || Array.isArray(v) || (v = [v]); + var w = {}, + S = [], + A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; + f ? (p || d ? w = { + get: setFunctionName(function () { + return g(this); + }, n, "get"), + set: function set(e) { + t[4](this, e); + } + } : w[A] = g, p || setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); + } + for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { + var D = v[j], + E = r ? v[j - 1] : void 0, + I = {}, + O = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][o], + name: n, + metadata: a, + addInitializer: function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + s(t, "An initializer", "be", !0), c.push(t); + }.bind(null, I) + }; + try { + if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { + var k, F; + O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { + return m(e), w.value; + } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { + return e[n]; + }, (o < 2 || 4 === o) && (F = function F(e, t) { + e[n] = t; + })); + var N = O.access = { + has: f ? h.bind() : function (e) { + return n in e; + } + }; + if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { + get: w.get, + set: w.set + } : w[A], O), d) { + if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); + } + } finally { + I.v = !0; + } + } + return (p || d) && u.push(function (e, t) { + for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); + return t; + }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; + } + function u(e, t) { + return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { + configurable: !0, + enumerable: !0, + value: t + }); + } + if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; + var f = Object.create(null == l ? null : l), + p = function (e, t, r, n) { + var o, + a, + i = [], + s = function s(t) { + return checkInRHS(t) === e; + }, + u = new Map(); + function l(e) { + e && i.push(c.bind(null, e)); + } + for (var f = 0; f < t.length; f++) { + var p = t[f]; + if (Array.isArray(p)) { + var d = p[1], + h = p[2], + m = p.length > 3, + y = 16 & d, + v = !!(8 & d), + g = 0 == (d &= 7), + b = h + "/" + v; + if (!g && !m) { + var w = u.get(b); + if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); + u.set(b, !(d > 2) || d); + } + applyDec(v ? e : e.prototype, p, y, m ? "#" + h : toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); + } + } + return l(o), l(a), i; + }(e, t, o, f); + return r.length || u(e, f), { + e: p, + get c() { + var t = []; + return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; + } + }; +} +module.exports = applyDecs2305, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2311.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2311.js new file mode 100644 index 0000000..5f00a31 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/applyDecs2311.js @@ -0,0 +1,124 @@ +var _typeof = require("./typeof.js")["default"]; +var checkInRHS = require("./checkInRHS.js"); +var setFunctionName = require("./setFunctionName.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2311(e, t, n, r, o, i) { + var a, + c, + u, + s, + f, + l, + p, + d = Symbol.metadata || Symbol["for"]("Symbol.metadata"), + m = Object.defineProperty, + h = Object.create, + y = [h(null), h(null)], + v = t.length; + function g(t, n, r) { + return function (o, i) { + n && (i = o, o = e); + for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); + return r ? i : o; + }; + } + function b(e, t, n, r) { + if ("function" != typeof e && (r || void 0 !== e)) throw new TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined")); + return e; + } + function applyDec(e, t, n, r, o, i, u, s, f, l, p) { + function d(e) { + if (!p(e)) throw new TypeError("Attempted to access private element on non-instance"); + } + var h = [].concat(t[0]), + v = t[3], + w = !u, + D = 1 === o, + S = 3 === o, + j = 4 === o, + E = 2 === o; + function I(t, n, r) { + return function (o, i) { + return n && (i = o, o = e), r && r(o), P[t].call(o, i); + }; + } + if (!w) { + var P = {}, + k = [], + F = S ? "get" : j || D ? "set" : "value"; + if (f ? (l || D ? P = { + get: setFunctionName(function () { + return v(this); + }, r, "get"), + set: function set(e) { + t[4](this, e); + } + } : P[F] = v, l || setFunctionName(P[F], r, E ? "" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { + if ((c = y[+s][r]) && 7 != (c ^ o)) throw Error("Decorating two elements with the same name (" + P[F].name + ") is not supported yet"); + y[+s][r] = o < 3 ? 1 : o; + } + } + for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { + var T = b(h[O], "A decorator", "be", !0), + z = n ? h[O - 1] : void 0, + A = {}, + H = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][o], + name: r, + metadata: a, + addInitializer: function (e, t) { + if (e.v) throw new TypeError("attempted to call addInitializer after decoration was finished"); + b(t, "An initializer", "be", !0), i.push(t); + }.bind(null, A) + }; + if (w) c = T.call(z, N, H), A.v = 1, b(c, "class decorators", "return") && (N = c);else if (H["static"] = s, H["private"] = f, c = H.access = { + has: f ? p.bind() : function (e) { + return r in e; + } + }, j || (c.get = f ? E ? function (e) { + return d(e), P.value; + } : I("get", 0, d) : function (e) { + return e[r]; + }), E || S || (c.set = f ? I("set", 0, d) : function (e, t) { + e[r] = t; + }), N = T.call(z, D ? { + get: P.get, + set: P.set + } : P[F], H), A.v = 1, D) { + if ("object" == _typeof(N) && N) (c = b(N.get, "accessor.get")) && (P.get = c), (c = b(N.set, "accessor.set")) && (P.set = c), (c = b(N.init, "accessor.init")) && k.unshift(c);else if (void 0 !== N) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined"); + } else b(N, (l ? "field" : "method") + " decorators", "return") && (l ? k.unshift(N) : P[F] = N); + } + return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I("get", s), I("set", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; + } + function w(e) { + return m(e, d, { + configurable: !0, + enumerable: !0, + value: a + }); + } + return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function l(e) { + e && f.push(g(e)); + }, p = function p(t, r) { + for (var i = 0; i < n.length; i++) { + var a = n[i], + c = a[1], + l = 7 & c; + if ((8 & c) == t && !l == r) { + var p = a[2], + d = !!a[3], + m = 16 & c; + applyDec(t ? e : e.prototype, a, m, d ? "#" + p : toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { + return checkInRHS(t) === e; + } : o); + } + } + }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { + e: c, + get c() { + var n = []; + return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; + } + }; +} +module.exports = applyDecs2311, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayLikeToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayLikeToArray.js new file mode 100644 index 0000000..19787e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayLikeToArray.js @@ -0,0 +1,6 @@ +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithHoles.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithHoles.js new file mode 100644 index 0000000..78bdd93 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithHoles.js @@ -0,0 +1,4 @@ +function _arrayWithHoles(r) { + if (Array.isArray(r)) return r; +} +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js new file mode 100644 index 0000000..42218f5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js @@ -0,0 +1,5 @@ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return arrayLikeToArray(r); +} +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertClassBrand.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertClassBrand.js new file mode 100644 index 0000000..e63ed8f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertClassBrand.js @@ -0,0 +1,5 @@ +function _assertClassBrand(e, t, n) { + if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; + throw new TypeError("Private element is not present on this object"); +} +module.exports = _assertClassBrand, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertThisInitialized.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertThisInitialized.js new file mode 100644 index 0000000..02594fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/assertThisInitialized.js @@ -0,0 +1,5 @@ +function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; +} +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js new file mode 100644 index 0000000..023568e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js @@ -0,0 +1,24 @@ +var OverloadYield = require("./OverloadYield.js"); +function _asyncGeneratorDelegate(t) { + var e = {}, + n = !1; + function pump(e, r) { + return n = !0, r = new Promise(function (n) { + n(t[e](r)); + }), { + done: !1, + value: new OverloadYield(r, 1) + }; + } + return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { + return this; + }, e.next = function (t) { + return n ? (n = !1, t) : pump("next", t); + }, "function" == typeof t["throw"] && (e["throw"] = function (t) { + if (n) throw n = !1, t; + return pump("throw", t); + }), "function" == typeof t["return"] && (e["return"] = function (t) { + return n ? (n = !1, t) : pump("return", t); + }), e; +} +module.exports = _asyncGeneratorDelegate, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncIterator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncIterator.js new file mode 100644 index 0000000..9c0c95c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncIterator.js @@ -0,0 +1,45 @@ +function _asyncIterator(r) { + var n, + t, + o, + e = 2; + for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { + if (t && null != (n = r[t])) return n.call(r); + if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); + t = "@@asyncIterator", o = "@@iterator"; + } + throw new TypeError("Object is not async iterable"); +} +function AsyncFromSyncIterator(r) { + function AsyncFromSyncIteratorContinuation(r) { + if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); + var n = r.done; + return Promise.resolve(r.value).then(function (r) { + return { + value: r, + done: n + }; + }); + } + return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { + this.s = r, this.n = r.next; + }, AsyncFromSyncIterator.prototype = { + s: null, + n: null, + next: function next() { + return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); + }, + "return": function _return(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.resolve({ + value: r, + done: !0 + }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + }, + "throw": function _throw(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + } + }, new AsyncFromSyncIterator(r); +} +module.exports = _asyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncToGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncToGenerator.js new file mode 100644 index 0000000..a080339 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/asyncToGenerator.js @@ -0,0 +1,26 @@ +function asyncGeneratorStep(n, t, e, r, o, a, c) { + try { + var i = n[a](c), + u = i.value; + } catch (n) { + return void e(n); + } + i.done ? t(u) : Promise.resolve(u).then(r, o); +} +function _asyncToGenerator(n) { + return function () { + var t = this, + e = arguments; + return new Promise(function (r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); + } + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); + } + _next(void 0); + }); + }; +} +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js new file mode 100644 index 0000000..2d6fab9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js @@ -0,0 +1,5 @@ +var OverloadYield = require("./OverloadYield.js"); +function _awaitAsyncGenerator(e) { + return new OverloadYield(e, 0); +} +module.exports = _awaitAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/callSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/callSuper.js new file mode 100644 index 0000000..38eaf7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/callSuper.js @@ -0,0 +1,7 @@ +var getPrototypeOf = require("./getPrototypeOf.js"); +var isNativeReflectConstruct = require("./isNativeReflectConstruct.js"); +var possibleConstructorReturn = require("./possibleConstructorReturn.js"); +function _callSuper(t, o, e) { + return o = getPrototypeOf(o), possibleConstructorReturn(t, isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf(t).constructor) : o.apply(t, e)); +} +module.exports = _callSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkInRHS.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkInRHS.js new file mode 100644 index 0000000..4eea13d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkInRHS.js @@ -0,0 +1,6 @@ +var _typeof = require("./typeof.js")["default"]; +function _checkInRHS(e) { + if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); + return e; +} +module.exports = _checkInRHS, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js new file mode 100644 index 0000000..33ad54c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js @@ -0,0 +1,4 @@ +function _checkPrivateRedeclaration(e, t) { + if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); +} +module.exports = _checkPrivateRedeclaration, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js new file mode 100644 index 0000000..9998b83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js @@ -0,0 +1,10 @@ +function _classApplyDescriptorDestructureSet(e, t) { + if (t.set) return "__destrObj" in t || (t.__destrObj = { + set value(r) { + t.set.call(e, r); + } + }), t.__destrObj; + if (!t.writable) throw new TypeError("attempted to set read only private field"); + return t; +} +module.exports = _classApplyDescriptorDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js new file mode 100644 index 0000000..ab62724 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js @@ -0,0 +1,4 @@ +function _classApplyDescriptorGet(e, t) { + return t.get ? t.get.call(e) : t.value; +} +module.exports = _classApplyDescriptorGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js new file mode 100644 index 0000000..0975f95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js @@ -0,0 +1,7 @@ +function _classApplyDescriptorSet(e, t, l) { + if (t.set) t.set.call(e, l);else { + if (!t.writable) throw new TypeError("attempted to set read only private field"); + t.value = l; + } +} +module.exports = _classApplyDescriptorSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCallCheck.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCallCheck.js new file mode 100644 index 0000000..21b8390 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCallCheck.js @@ -0,0 +1,4 @@ +function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); +} +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js new file mode 100644 index 0000000..7520f74 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classCheckPrivateStaticAccess(s, a, r) { + return assertClassBrand(a, s, r); +} +module.exports = _classCheckPrivateStaticAccess, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js new file mode 100644 index 0000000..7f70395 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js @@ -0,0 +1,4 @@ +function _classCheckPrivateStaticFieldDescriptor(t, e) { + if (void 0 === t) throw new TypeError("attempted to " + e + " private static field before its declaration"); +} +module.exports = _classCheckPrivateStaticFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js new file mode 100644 index 0000000..be855be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js @@ -0,0 +1,5 @@ +var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js"); +function _classExtractFieldDescriptor(e, t) { + return classPrivateFieldGet2(t, e); +} +module.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classNameTDZError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classNameTDZError.js new file mode 100644 index 0000000..8141ff8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classNameTDZError.js @@ -0,0 +1,4 @@ +function _classNameTDZError(e) { + throw new ReferenceError('Class "' + e + '" cannot be referenced in computed property keys.'); +} +module.exports = _classNameTDZError, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js new file mode 100644 index 0000000..97c764d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js"); +var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js"); +function _classPrivateFieldDestructureSet(e, t) { + var r = classPrivateFieldGet2(t, e); + return classApplyDescriptorDestructureSet(e, r); +} +module.exports = _classPrivateFieldDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js new file mode 100644 index 0000000..bbee142 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorGet = require("./classApplyDescriptorGet.js"); +var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js"); +function _classPrivateFieldGet(e, t) { + var r = classPrivateFieldGet2(t, e); + return classApplyDescriptorGet(e, r); +} +module.exports = _classPrivateFieldGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js new file mode 100644 index 0000000..d4c271c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateFieldGet2(s, a) { + return s.get(assertClassBrand(s, a)); +} +module.exports = _classPrivateFieldGet2, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js new file mode 100644 index 0000000..a290c19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js @@ -0,0 +1,5 @@ +var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js"); +function _classPrivateFieldInitSpec(e, t, a) { + checkPrivateRedeclaration(e, t), t.set(e, a); +} +module.exports = _classPrivateFieldInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js new file mode 100644 index 0000000..f9e46f2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js @@ -0,0 +1,5 @@ +function _classPrivateFieldBase(e, t) { + if (!{}.hasOwnProperty.call(e, t)) throw new TypeError("attempted to use private field on non-instance"); + return e; +} +module.exports = _classPrivateFieldBase, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js new file mode 100644 index 0000000..5dc687f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js @@ -0,0 +1,5 @@ +var id = 0; +function _classPrivateFieldKey(e) { + return "__private_" + id++ + "_" + e; +} +module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js new file mode 100644 index 0000000..f3746e7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorSet = require("./classApplyDescriptorSet.js"); +var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js"); +function _classPrivateFieldSet(e, t, r) { + var s = classPrivateFieldGet2(t, e); + return classApplyDescriptorSet(e, s, r), r; +} +module.exports = _classPrivateFieldSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js new file mode 100644 index 0000000..25c60ca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateFieldSet2(s, a, r) { + return s.set(assertClassBrand(s, a), r), r; +} +module.exports = _classPrivateFieldSet2, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateGetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateGetter.js new file mode 100644 index 0000000..1b3cf30 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateGetter.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateGetter(s, r, a) { + return a(assertClassBrand(s, r)); +} +module.exports = _classPrivateGetter, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js new file mode 100644 index 0000000..e4af387 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateMethodGet(s, a, r) { + return assertClassBrand(a, s), r; +} +module.exports = _classPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js new file mode 100644 index 0000000..821c8ed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js @@ -0,0 +1,5 @@ +var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js"); +function _classPrivateMethodInitSpec(e, a) { + checkPrivateRedeclaration(e, a), a.add(e); +} +module.exports = _classPrivateMethodInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js new file mode 100644 index 0000000..a44fd78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js @@ -0,0 +1,4 @@ +function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); +} +module.exports = _classPrivateMethodSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateSetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateSetter.js new file mode 100644 index 0000000..494f81f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classPrivateSetter.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateSetter(s, r, a, t) { + return r(assertClassBrand(s, a), t), t; +} +module.exports = _classPrivateSetter, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js new file mode 100644 index 0000000..2bb6e8b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js"); +var assertClassBrand = require("./assertClassBrand.js"); +var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js"); +function _classStaticPrivateFieldDestructureSet(t, r, s) { + return assertClassBrand(r, t), classCheckPrivateStaticFieldDescriptor(s, "set"), classApplyDescriptorDestructureSet(t, s); +} +module.exports = _classStaticPrivateFieldDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js new file mode 100644 index 0000000..eb2365f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorGet = require("./classApplyDescriptorGet.js"); +var assertClassBrand = require("./assertClassBrand.js"); +var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js"); +function _classStaticPrivateFieldSpecGet(t, s, r) { + return assertClassBrand(s, t), classCheckPrivateStaticFieldDescriptor(r, "get"), classApplyDescriptorGet(t, r); +} +module.exports = _classStaticPrivateFieldSpecGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js new file mode 100644 index 0000000..7783cd8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js @@ -0,0 +1,7 @@ +var classApplyDescriptorSet = require("./classApplyDescriptorSet.js"); +var assertClassBrand = require("./assertClassBrand.js"); +var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js"); +function _classStaticPrivateFieldSpecSet(s, t, r, e) { + return assertClassBrand(t, s), classCheckPrivateStaticFieldDescriptor(r, "set"), classApplyDescriptorSet(s, r, e), e; +} +module.exports = _classStaticPrivateFieldSpecSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js new file mode 100644 index 0000000..c895be5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js @@ -0,0 +1,5 @@ +var assertClassBrand = require("./assertClassBrand.js"); +function _classStaticPrivateMethodGet(s, a, t) { + return assertClassBrand(a, s), t; +} +module.exports = _classStaticPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js new file mode 100644 index 0000000..72560e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js @@ -0,0 +1,4 @@ +function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); +} +module.exports = _classStaticPrivateMethodSet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/construct.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/construct.js new file mode 100644 index 0000000..aee8e70 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/construct.js @@ -0,0 +1,10 @@ +var isNativeReflectConstruct = require("./isNativeReflectConstruct.js"); +var setPrototypeOf = require("./setPrototypeOf.js"); +function _construct(t, e, r) { + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && setPrototypeOf(p, r.prototype), p; +} +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createClass.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createClass.js new file mode 100644 index 0000000..8757f9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createClass.js @@ -0,0 +1,13 @@ +var toPropertyKey = require("./toPropertyKey.js"); +function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); + } +} +function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; +} +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js new file mode 100644 index 0000000..2778307 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js @@ -0,0 +1,50 @@ +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { + t && (r = t); + var _n = 0, + F = function F() {}; + return { + s: F, + n: function n() { + return _n >= r.length ? { + done: !0 + } : { + done: !1, + value: r[_n++] + }; + }, + e: function e(r) { + throw r; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, + a = !0, + u = !1; + return { + s: function s() { + t = t.call(r); + }, + n: function n() { + var r = t.next(); + return a = r.done, r; + }, + e: function e(r) { + u = !0, o = r; + }, + f: function f() { + try { + a || null == t["return"] || t["return"](); + } finally { + if (u) throw o; + } + } + }; +} +module.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js new file mode 100644 index 0000000..bc81b1c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js @@ -0,0 +1,19 @@ +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +function _createForOfIteratorHelperLoose(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (t) return (t = t.call(r)).next.bind(t); + if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { + t && (r = t); + var o = 0; + return function () { + return o >= r.length ? { + done: !0 + } : { + done: !1, + value: r[o++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +module.exports = _createForOfIteratorHelperLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createSuper.js new file mode 100644 index 0000000..b1869e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/createSuper.js @@ -0,0 +1,16 @@ +var getPrototypeOf = require("./getPrototypeOf.js"); +var isNativeReflectConstruct = require("./isNativeReflectConstruct.js"); +var possibleConstructorReturn = require("./possibleConstructorReturn.js"); +function _createSuper(t) { + var r = isNativeReflectConstruct(); + return function () { + var e, + o = getPrototypeOf(t); + if (r) { + var s = getPrototypeOf(this).constructor; + e = Reflect.construct(o, arguments, s); + } else e = o.apply(this, arguments); + return possibleConstructorReturn(this, e); + }; +} +module.exports = _createSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/decorate.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/decorate.js new file mode 100644 index 0000000..bc22acf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/decorate.js @@ -0,0 +1,250 @@ +var toArray = require("./toArray.js"); +var toPropertyKey = require("./toPropertyKey.js"); +function _decorate(e, r, t, i) { + var o = _getDecoratorsApi(); + if (i) for (var n = 0; n < i.length; n++) o = i[n](o); + var s = r(function (e) { + o.initializeInstanceElements(e, a.elements); + }, t), + a = o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)), e); + return o.initializeClassElements(s.F, a.elements), o.runClassFinishers(s.F, a.finishers); +} +function _getDecoratorsApi() { + _getDecoratorsApi = function _getDecoratorsApi() { + return e; + }; + var e = { + elementsDefinitionOrder: [["method"], ["field"]], + initializeInstanceElements: function initializeInstanceElements(e, r) { + ["method", "field"].forEach(function (t) { + r.forEach(function (r) { + r.kind === t && "own" === r.placement && this.defineClassElement(e, r); + }, this); + }, this); + }, + initializeClassElements: function initializeClassElements(e, r) { + var t = e.prototype; + ["method", "field"].forEach(function (i) { + r.forEach(function (r) { + var o = r.placement; + if (r.kind === i && ("static" === o || "prototype" === o)) { + var n = "static" === o ? e : t; + this.defineClassElement(n, r); + } + }, this); + }, this); + }, + defineClassElement: function defineClassElement(e, r) { + var t = r.descriptor; + if ("field" === r.kind) { + var i = r.initializer; + t = { + enumerable: t.enumerable, + writable: t.writable, + configurable: t.configurable, + value: void 0 === i ? void 0 : i.call(e) + }; + } + Object.defineProperty(e, r.key, t); + }, + decorateClass: function decorateClass(e, r) { + var t = [], + i = [], + o = { + "static": [], + prototype: [], + own: [] + }; + if (e.forEach(function (e) { + this.addElementPlacement(e, o); + }, this), e.forEach(function (e) { + if (!_hasDecorators(e)) return t.push(e); + var r = this.decorateElement(e, o); + t.push(r.element), t.push.apply(t, r.extras), i.push.apply(i, r.finishers); + }, this), !r) return { + elements: t, + finishers: i + }; + var n = this.decorateConstructor(t, r); + return i.push.apply(i, n.finishers), n.finishers = i, n; + }, + addElementPlacement: function addElementPlacement(e, r, t) { + var i = r[e.placement]; + if (!t && -1 !== i.indexOf(e.key)) throw new TypeError("Duplicated element (" + e.key + ")"); + i.push(e.key); + }, + decorateElement: function decorateElement(e, r) { + for (var t = [], i = [], o = e.decorators, n = o.length - 1; n >= 0; n--) { + var s = r[e.placement]; + s.splice(s.indexOf(e.key), 1); + var a = this.fromElementDescriptor(e), + l = this.toElementFinisherExtras((0, o[n])(a) || a); + e = l.element, this.addElementPlacement(e, r), l.finisher && i.push(l.finisher); + var c = l.extras; + if (c) { + for (var p = 0; p < c.length; p++) this.addElementPlacement(c[p], r); + t.push.apply(t, c); + } + } + return { + element: e, + finishers: i, + extras: t + }; + }, + decorateConstructor: function decorateConstructor(e, r) { + for (var t = [], i = r.length - 1; i >= 0; i--) { + var o = this.fromClassDescriptor(e), + n = this.toClassDescriptor((0, r[i])(o) || o); + if (void 0 !== n.finisher && t.push(n.finisher), void 0 !== n.elements) { + e = n.elements; + for (var s = 0; s < e.length - 1; s++) for (var a = s + 1; a < e.length; a++) if (e[s].key === e[a].key && e[s].placement === e[a].placement) throw new TypeError("Duplicated element (" + e[s].key + ")"); + } + } + return { + elements: e, + finishers: t + }; + }, + fromElementDescriptor: function fromElementDescriptor(e) { + var r = { + kind: e.kind, + key: e.key, + placement: e.placement, + descriptor: e.descriptor + }; + return Object.defineProperty(r, Symbol.toStringTag, { + value: "Descriptor", + configurable: !0 + }), "field" === e.kind && (r.initializer = e.initializer), r; + }, + toElementDescriptors: function toElementDescriptors(e) { + if (void 0 !== e) return toArray(e).map(function (e) { + var r = this.toElementDescriptor(e); + return this.disallowProperty(e, "finisher", "An element descriptor"), this.disallowProperty(e, "extras", "An element descriptor"), r; + }, this); + }, + toElementDescriptor: function toElementDescriptor(e) { + var r = e.kind + ""; + if ("method" !== r && "field" !== r) throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "' + r + '"'); + var t = toPropertyKey(e.key), + i = e.placement + ""; + if ("static" !== i && "prototype" !== i && "own" !== i) throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "' + i + '"'); + var o = e.descriptor; + this.disallowProperty(e, "elements", "An element descriptor"); + var n = { + kind: r, + key: t, + placement: i, + descriptor: Object.assign({}, o) + }; + return "field" !== r ? this.disallowProperty(e, "initializer", "A method descriptor") : (this.disallowProperty(o, "get", "The property descriptor of a field descriptor"), this.disallowProperty(o, "set", "The property descriptor of a field descriptor"), this.disallowProperty(o, "value", "The property descriptor of a field descriptor"), n.initializer = e.initializer), n; + }, + toElementFinisherExtras: function toElementFinisherExtras(e) { + return { + element: this.toElementDescriptor(e), + finisher: _optionalCallableProperty(e, "finisher"), + extras: this.toElementDescriptors(e.extras) + }; + }, + fromClassDescriptor: function fromClassDescriptor(e) { + var r = { + kind: "class", + elements: e.map(this.fromElementDescriptor, this) + }; + return Object.defineProperty(r, Symbol.toStringTag, { + value: "Descriptor", + configurable: !0 + }), r; + }, + toClassDescriptor: function toClassDescriptor(e) { + var r = e.kind + ""; + if ("class" !== r) throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "' + r + '"'); + this.disallowProperty(e, "key", "A class descriptor"), this.disallowProperty(e, "placement", "A class descriptor"), this.disallowProperty(e, "descriptor", "A class descriptor"), this.disallowProperty(e, "initializer", "A class descriptor"), this.disallowProperty(e, "extras", "A class descriptor"); + var t = _optionalCallableProperty(e, "finisher"); + return { + elements: this.toElementDescriptors(e.elements), + finisher: t + }; + }, + runClassFinishers: function runClassFinishers(e, r) { + for (var t = 0; t < r.length; t++) { + var i = (0, r[t])(e); + if (void 0 !== i) { + if ("function" != typeof i) throw new TypeError("Finishers must return a constructor."); + e = i; + } + } + return e; + }, + disallowProperty: function disallowProperty(e, r, t) { + if (void 0 !== e[r]) throw new TypeError(t + " can't have a ." + r + " property."); + } + }; + return e; +} +function _createElementDescriptor(e) { + var r, + t = toPropertyKey(e.key); + "method" === e.kind ? r = { + value: e.value, + writable: !0, + configurable: !0, + enumerable: !1 + } : "get" === e.kind ? r = { + get: e.value, + configurable: !0, + enumerable: !1 + } : "set" === e.kind ? r = { + set: e.value, + configurable: !0, + enumerable: !1 + } : "field" === e.kind && (r = { + configurable: !0, + writable: !0, + enumerable: !0 + }); + var i = { + kind: "field" === e.kind ? "field" : "method", + key: t, + placement: e["static"] ? "static" : "field" === e.kind ? "own" : "prototype", + descriptor: r + }; + return e.decorators && (i.decorators = e.decorators), "field" === e.kind && (i.initializer = e.value), i; +} +function _coalesceGetterSetter(e, r) { + void 0 !== e.descriptor.get ? r.descriptor.get = e.descriptor.get : r.descriptor.set = e.descriptor.set; +} +function _coalesceClassElements(e) { + for (var r = [], isSameElement = function isSameElement(e) { + return "method" === e.kind && e.key === o.key && e.placement === o.placement; + }, t = 0; t < e.length; t++) { + var i, + o = e[t]; + if ("method" === o.kind && (i = r.find(isSameElement))) { + if (_isDataDescriptor(o.descriptor) || _isDataDescriptor(i.descriptor)) { + if (_hasDecorators(o) || _hasDecorators(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated."); + i.descriptor = o.descriptor; + } else { + if (_hasDecorators(o)) { + if (_hasDecorators(i)) throw new ReferenceError("Decorators can't be placed on different accessors with for the same property (" + o.key + ")."); + i.decorators = o.decorators; + } + _coalesceGetterSetter(o, i); + } + } else r.push(o); + } + return r; +} +function _hasDecorators(e) { + return e.decorators && e.decorators.length; +} +function _isDataDescriptor(e) { + return void 0 !== e && !(void 0 === e.value && void 0 === e.writable); +} +function _optionalCallableProperty(e, r) { + var t = e[r]; + if (void 0 !== t && "function" != typeof t) throw new TypeError("Expected '" + r + "' to be a function"); + return t; +} +module.exports = _decorate, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defaults.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defaults.js new file mode 100644 index 0000000..dfdbbb0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defaults.js @@ -0,0 +1,9 @@ +function _defaults(e, r) { + for (var t = Object.getOwnPropertyNames(r), o = 0; o < t.length; o++) { + var n = t[o], + a = Object.getOwnPropertyDescriptor(r, n); + a && a.configurable && void 0 === e[n] && Object.defineProperty(e, n, a); + } + return e; +} +module.exports = _defaults, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineAccessor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineAccessor.js new file mode 100644 index 0000000..dc065f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineAccessor.js @@ -0,0 +1,8 @@ +function _defineAccessor(e, r, n, t) { + var c = { + configurable: !0, + enumerable: !0 + }; + return c[e] = t, Object.defineProperty(r, n, c); +} +module.exports = _defineAccessor, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js new file mode 100644 index 0000000..ab9f43c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js @@ -0,0 +1,12 @@ +function _defineEnumerableProperties(e, r) { + for (var t in r) { + var n = r[t]; + n.configurable = n.enumerable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, t, n); + } + if (Object.getOwnPropertySymbols) for (var a = Object.getOwnPropertySymbols(r), b = 0; b < a.length; b++) { + var i = a[b]; + (n = r[i]).configurable = n.enumerable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, i, n); + } + return e; +} +module.exports = _defineEnumerableProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineProperty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineProperty.js new file mode 100644 index 0000000..2c2ff1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/defineProperty.js @@ -0,0 +1,10 @@ +var toPropertyKey = require("./toPropertyKey.js"); +function _defineProperty(e, r, t) { + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; +} +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/dispose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/dispose.js new file mode 100644 index 0000000..c20193c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/dispose.js @@ -0,0 +1,28 @@ +function dispose_SuppressedError(r, e) { + return "undefined" != typeof SuppressedError ? dispose_SuppressedError = SuppressedError : (dispose_SuppressedError = function dispose_SuppressedError(r, e) { + this.suppressed = e, this.error = r, this.stack = Error().stack; + }, dispose_SuppressedError.prototype = Object.create(Error.prototype, { + constructor: { + value: dispose_SuppressedError, + writable: !0, + configurable: !0 + } + })), new dispose_SuppressedError(r, e); +} +function _dispose(r, e, s) { + function next() { + for (; r.length > 0;) try { + var o = r.pop(), + p = o.d.call(o.v); + if (o.a) return Promise.resolve(p).then(next, err); + } catch (r) { + return err(r); + } + if (s) throw e; + } + function err(r) { + return e = s ? new dispose_SuppressedError(e, r) : r, s = !0, next(); + } + return next(); +} +module.exports = _dispose, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/AwaitValue.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/AwaitValue.js new file mode 100644 index 0000000..6f210c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/AwaitValue.js @@ -0,0 +1,4 @@ +function _AwaitValue(t) { + this.wrapped = t; +} +export { _AwaitValue as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/OverloadYield.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/OverloadYield.js new file mode 100644 index 0000000..d7753a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/OverloadYield.js @@ -0,0 +1,4 @@ +function _OverloadYield(e, d) { + this.v = e, this.k = d; +} +export { _OverloadYield as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js new file mode 100644 index 0000000..0f33483 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js @@ -0,0 +1,9 @@ +function _applyDecoratedDescriptor(i, e, r, n, l) { + var a = {}; + return Object.keys(n).forEach(function (i) { + a[i] = n[i]; + }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { + return n(i, e, r) || r; + }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; +} +export { _applyDecoratedDescriptor as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs.js new file mode 100644 index 0000000..2b75dfd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs.js @@ -0,0 +1,236 @@ +import _typeof from "./typeof.js"; +import setFunctionName from "./setFunctionName.js"; +import toPropertyKey from "./toPropertyKey.js"; +function old_createMetadataMethodsForProperty(e, t, a, r) { + return { + getMetadata: function getMetadata(o) { + old_assertNotFinished(r, "getMetadata"), old_assertMetadataKey(o); + var i = e[o]; + if (void 0 !== i) if (1 === t) { + var n = i["public"]; + if (void 0 !== n) return n[a]; + } else if (2 === t) { + var l = i["private"]; + if (void 0 !== l) return l.get(a); + } else if (Object.hasOwnProperty.call(i, "constructor")) return i.constructor; + }, + setMetadata: function setMetadata(o, i) { + old_assertNotFinished(r, "setMetadata"), old_assertMetadataKey(o); + var n = e[o]; + if (void 0 === n && (n = e[o] = {}), 1 === t) { + var l = n["public"]; + void 0 === l && (l = n["public"] = {}), l[a] = i; + } else if (2 === t) { + var s = n.priv; + void 0 === s && (s = n["private"] = new Map()), s.set(a, i); + } else n.constructor = i; + } + }; +} +function old_convertMetadataMapToFinal(e, t) { + var a = e[Symbol.metadata || Symbol["for"]("Symbol.metadata")], + r = Object.getOwnPropertySymbols(t); + if (0 !== r.length) { + for (var o = 0; o < r.length; o++) { + var i = r[o], + n = t[i], + l = a ? a[i] : null, + s = n["public"], + c = l ? l["public"] : null; + s && c && Object.setPrototypeOf(s, c); + var d = n["private"]; + if (d) { + var u = Array.from(d.values()), + f = l ? l["private"] : null; + f && (u = u.concat(f)), n["private"] = u; + } + l && Object.setPrototypeOf(n, l); + } + a && Object.setPrototypeOf(t, a), e[Symbol.metadata || Symbol["for"]("Symbol.metadata")] = t; + } +} +function old_createAddInitializerMethod(e, t) { + return function (a) { + old_assertNotFinished(t, "addInitializer"), old_assertCallable(a, "An initializer"), e.push(a); + }; +} +function old_memberDec(e, t, a, r, o, i, n, l, s) { + var c; + switch (i) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var d, + u, + f = { + kind: c, + name: l ? "#" + t : toPropertyKey(t), + isStatic: n, + isPrivate: l + }, + p = { + v: !1 + }; + if (0 !== i && (f.addInitializer = old_createAddInitializerMethod(o, p)), l) { + d = 2, u = Symbol(t); + var v = {}; + 0 === i ? (v.get = a.get, v.set = a.set) : 2 === i ? v.get = function () { + return a.value; + } : (1 !== i && 3 !== i || (v.get = function () { + return a.get.call(this); + }), 1 !== i && 4 !== i || (v.set = function (e) { + a.set.call(this, e); + })), f.access = v; + } else d = 1, u = t; + try { + return e(s, Object.assign(f, old_createMetadataMethodsForProperty(r, d, u, p))); + } finally { + p.v = !0; + } +} +function old_assertNotFinished(e, t) { + if (e.v) throw Error("attempted to call " + t + " after decoration was finished"); +} +function old_assertMetadataKey(e) { + if ("symbol" != _typeof(e)) throw new TypeError("Metadata keys must be symbols, received: " + e); +} +function old_assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); +} +function old_assertValidReturnValue(e, t) { + var a = _typeof(t); + if (1 === e) { + if ("object" !== a || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && old_assertCallable(t.get, "accessor.get"), void 0 !== t.set && old_assertCallable(t.set, "accessor.set"), void 0 !== t.init && old_assertCallable(t.init, "accessor.init"), void 0 !== t.initializer && old_assertCallable(t.initializer, "accessor.initializer"); + } else if ("function" !== a) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); +} +function old_getInit(e) { + var t; + return null == (t = e.init) && (t = e.initializer) && void 0 !== console && console.warn(".initializer has been renamed to .init as of March 2022"), t; +} +function old_applyMemberDec(e, t, a, r, o, i, n, l, s) { + var c, + d, + u, + f, + p, + v, + y, + h = a[0]; + if (n ? (0 === o || 1 === o ? (c = { + get: a[3], + set: a[4] + }, u = "get") : 3 === o ? (c = { + get: a[3] + }, u = "get") : 4 === o ? (c = { + set: a[3] + }, u = "set") : c = { + value: a[3] + }, 0 !== o && (1 === o && setFunctionName(a[4], "#" + r, "set"), setFunctionName(a[3], "#" + r, u))) : 0 !== o && (c = Object.getOwnPropertyDescriptor(t, r)), 1 === o ? f = { + get: c.get, + set: c.set + } : 2 === o ? f = c.value : 3 === o ? f = c.get : 4 === o && (f = c.set), "function" == typeof h) void 0 !== (p = old_memberDec(h, r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? d = p : 1 === o ? (d = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = { + get: v, + set: y + }) : f = p);else for (var m = h.length - 1; m >= 0; m--) { + var b; + void 0 !== (p = old_memberDec(h[m], r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? b = p : 1 === o ? (b = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = { + get: v, + set: y + }) : f = p, void 0 !== b && (void 0 === d ? d = b : "function" == typeof d ? d = [d, b] : d.push(b))); + } + if (0 === o || 1 === o) { + if (void 0 === d) d = function d(e, t) { + return t; + };else if ("function" != typeof d) { + var g = d; + d = function d(e, t) { + for (var a = t, r = 0; r < g.length; r++) a = g[r].call(e, a); + return a; + }; + } else { + var _ = d; + d = function d(e, t) { + return _.call(e, t); + }; + } + e.push(d); + } + 0 !== o && (1 === o ? (c.get = f.get, c.set = f.set) : 2 === o ? c.value = f : 3 === o ? c.get = f : 4 === o && (c.set = f), n ? 1 === o ? (e.push(function (e, t) { + return f.get.call(e, t); + }), e.push(function (e, t) { + return f.set.call(e, t); + })) : 2 === o ? e.push(f) : e.push(function (e, t) { + return f.call(e, t); + }) : Object.defineProperty(t, r, c)); +} +function old_applyMemberDecs(e, t, a, r, o) { + for (var i, n, l = new Map(), s = new Map(), c = 0; c < o.length; c++) { + var d = o[c]; + if (Array.isArray(d)) { + var u, + f, + p, + v = d[1], + y = d[2], + h = d.length > 3, + m = v >= 5; + if (m ? (u = t, f = r, 0 != (v -= 5) && (p = n = n || [])) : (u = t.prototype, f = a, 0 !== v && (p = i = i || [])), 0 !== v && !h) { + var b = m ? s : l, + g = b.get(y) || 0; + if (!0 === g || 3 === g && 4 !== v || 4 === g && 3 !== v) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + y); + !g && v > 2 ? b.set(y, v) : b.set(y, !0); + } + old_applyMemberDec(e, u, d, y, v, m, h, f, p); + } + } + old_pushInitializers(e, i), old_pushInitializers(e, n); +} +function old_pushInitializers(e, t) { + t && e.push(function (e) { + for (var a = 0; a < t.length; a++) t[a].call(e); + return e; + }); +} +function old_applyClassDecs(e, t, a, r) { + if (r.length > 0) { + for (var o = [], i = t, n = t.name, l = r.length - 1; l >= 0; l--) { + var s = { + v: !1 + }; + try { + var c = Object.assign({ + kind: "class", + name: n, + addInitializer: old_createAddInitializerMethod(o, s) + }, old_createMetadataMethodsForProperty(a, 0, n, s)), + d = r[l](i, c); + } finally { + s.v = !0; + } + void 0 !== d && (old_assertValidReturnValue(10, d), i = d); + } + e.push(i, function () { + for (var e = 0; e < o.length; e++) o[e].call(i); + }); + } +} +function applyDecs(e, t, a) { + var r = [], + o = {}, + i = {}; + return old_applyMemberDecs(r, e, i, o, t), old_convertMetadataMapToFinal(e.prototype, i), old_applyClassDecs(r, e, o, a), old_convertMetadataMapToFinal(e, o), r; +} +export { applyDecs as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js new file mode 100644 index 0000000..bddb51d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js @@ -0,0 +1,184 @@ +import _typeof from "./typeof.js"; +function applyDecs2203Factory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function memberDec(e, t, r, a, n, i, s, o) { + var c; + switch (n) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var l, + u, + f = { + kind: c, + name: s ? "#" + t : t, + "static": i, + "private": s + }, + p = { + v: !1 + }; + 0 !== n && (f.addInitializer = createAddInitializerMethod(a, p)), 0 === n ? s ? (l = r.get, u = r.set) : (l = function l() { + return this[t]; + }, u = function u(e) { + this[t] = e; + }) : 2 === n ? l = function l() { + return r.value; + } : (1 !== n && 3 !== n || (l = function l() { + return r.get.call(this); + }), 1 !== n && 4 !== n || (u = function u(e) { + r.set.call(this, e); + })), f.access = l && u ? { + get: l, + set: u + } : l ? { + get: l + } : { + set: u + }; + try { + return e(o, f); + } finally { + p.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function applyMemberDec(e, t, r, a, n, i, s, o) { + var c, + l, + u, + f, + p, + d, + h = r[0]; + if (s ? c = 0 === n || 1 === n ? { + get: r[3], + set: r[4] + } : 3 === n ? { + get: r[3] + } : 4 === n ? { + set: r[3] + } : { + value: r[3] + } : 0 !== n && (c = Object.getOwnPropertyDescriptor(t, a)), 1 === n ? u = { + get: c.get, + set: c.set + } : 2 === n ? u = c.value : 3 === n ? u = c.get : 4 === n && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, a, c, o, n, i, s, u)) && (assertValidReturnValue(n, f), 0 === n ? l = f : 1 === n ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = { + get: p, + set: d + }) : u = f);else for (var v = h.length - 1; v >= 0; v--) { + var g; + void 0 !== (f = memberDec(h[v], a, c, o, n, i, s, u)) && (assertValidReturnValue(n, f), 0 === n ? g = f : 1 === n ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = { + get: p, + set: d + }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g))); + } + if (0 === n || 1 === n) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var y = l; + l = function l(e, t) { + for (var r = t, a = 0; a < y.length; a++) r = y[a].call(e, r); + return r; + }; + } else { + var m = l; + l = function l(e, t) { + return m.call(e, t); + }; + } + e.push(l); + } + 0 !== n && (1 === n ? (c.get = u.get, c.set = u.set) : 2 === n ? c.value = u : 3 === n ? c.get = u : 4 === n && (c.set = u), s ? 1 === n ? (e.push(function (e, t) { + return u.get.call(e, t); + }), e.push(function (e, t) { + return u.set.call(e, t); + })) : 2 === n ? e.push(u) : e.push(function (e, t) { + return u.call(e, t); + }) : Object.defineProperty(t, a, c)); + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r) { + var a = []; + return function (e, t, r) { + for (var a, n, i = new Map(), s = new Map(), o = 0; o < r.length; o++) { + var c = r[o]; + if (Array.isArray(c)) { + var l, + u, + f = c[1], + p = c[2], + d = c.length > 3, + h = f >= 5; + if (h ? (l = t, 0 != (f -= 5) && (u = n = n || [])) : (l = t.prototype, 0 !== f && (u = a = a || [])), 0 !== f && !d) { + var v = h ? s : i, + g = v.get(p) || 0; + if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); + !g && f > 2 ? v.set(p, f) : v.set(p, !0); + } + applyMemberDec(e, l, c, p, f, h, d, u); + } + } + pushInitializers(e, a), pushInitializers(e, n); + }(a, e, t), function (e, t, r) { + if (r.length > 0) { + for (var a = [], n = t, i = t.name, s = r.length - 1; s >= 0; s--) { + var o = { + v: !1 + }; + try { + var c = r[s](n, { + kind: "class", + name: i, + addInitializer: createAddInitializerMethod(a, o) + }); + } finally { + o.v = !0; + } + void 0 !== c && (assertValidReturnValue(10, c), n = c); + } + e.push(n, function () { + for (var e = 0; e < a.length; e++) a[e].call(n); + }); + } + }(a, e, r), a; + }; +} +var applyDecs2203Impl; +function applyDecs2203(e, t, r) { + return (applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory())(e, t, r); +} +export { applyDecs2203 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js new file mode 100644 index 0000000..3944bf4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js @@ -0,0 +1,191 @@ +import _typeof from "./typeof.js"; +import setFunctionName from "./setFunctionName.js"; +import toPropertyKey from "./toPropertyKey.js"; +function applyDecs2203RFactory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function memberDec(e, t, r, n, a, i, o, s) { + var c; + switch (a) { + case 1: + c = "accessor"; + break; + case 2: + c = "method"; + break; + case 3: + c = "getter"; + break; + case 4: + c = "setter"; + break; + default: + c = "field"; + } + var l, + u, + f = { + kind: c, + name: o ? "#" + t : toPropertyKey(t), + "static": i, + "private": o + }, + p = { + v: !1 + }; + 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? o ? (l = r.get, u = r.set) : (l = function l() { + return this[t]; + }, u = function u(e) { + this[t] = e; + }) : 2 === a ? l = function l() { + return r.value; + } : (1 !== a && 3 !== a || (l = function l() { + return r.get.call(this); + }), 1 !== a && 4 !== a || (u = function u(e) { + r.set.call(this, e); + })), f.access = l && u ? { + get: l, + set: u + } : l ? { + get: l + } : { + set: u + }; + try { + return e(s, f); + } finally { + p.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function applyMemberDec(e, t, r, n, a, i, o, s) { + var c, + l, + u, + f, + p, + d, + h, + v = r[0]; + if (o ? (0 === a || 1 === a ? (c = { + get: r[3], + set: r[4] + }, u = "get") : 3 === a ? (c = { + get: r[3] + }, u = "get") : 4 === a ? (c = { + set: r[3] + }, u = "set") : c = { + value: r[3] + }, 0 !== a && (1 === a && setFunctionName(r[4], "#" + n, "set"), setFunctionName(r[3], "#" + n, u))) : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? f = { + get: c.get, + set: c.set + } : 2 === a ? f = c.value : 3 === a ? f = c.get : 4 === a && (f = c.set), "function" == typeof v) void 0 !== (p = memberDec(v, n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? l = p : 1 === a ? (l = p.init, d = p.get || f.get, h = p.set || f.set, f = { + get: d, + set: h + }) : f = p);else for (var g = v.length - 1; g >= 0; g--) { + var y; + void 0 !== (p = memberDec(v[g], n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? y = p : 1 === a ? (y = p.init, d = p.get || f.get, h = p.set || f.set, f = { + get: d, + set: h + }) : f = p, void 0 !== y && (void 0 === l ? l = y : "function" == typeof l ? l = [l, y] : l.push(y))); + } + if (0 === a || 1 === a) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var m = l; + l = function l(e, t) { + for (var r = t, n = 0; n < m.length; n++) r = m[n].call(e, r); + return r; + }; + } else { + var b = l; + l = function l(e, t) { + return b.call(e, t); + }; + } + e.push(l); + } + 0 !== a && (1 === a ? (c.get = f.get, c.set = f.set) : 2 === a ? c.value = f : 3 === a ? c.get = f : 4 === a && (c.set = f), o ? 1 === a ? (e.push(function (e, t) { + return f.get.call(e, t); + }), e.push(function (e, t) { + return f.set.call(e, t); + })) : 2 === a ? e.push(f) : e.push(function (e, t) { + return f.call(e, t); + }) : Object.defineProperty(t, n, c)); + } + function applyMemberDecs(e, t) { + for (var r, n, a = [], i = new Map(), o = new Map(), s = 0; s < t.length; s++) { + var c = t[s]; + if (Array.isArray(c)) { + var l, + u, + f = c[1], + p = c[2], + d = c.length > 3, + h = f >= 5; + if (h ? (l = e, 0 != (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) { + var v = h ? o : i, + g = v.get(p) || 0; + if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); + !g && f > 2 ? v.set(p, f) : v.set(p, !0); + } + applyMemberDec(a, l, c, p, f, h, d, u); + } + } + return pushInitializers(a, r), pushInitializers(a, n), a; + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r) { + return { + e: applyMemberDecs(e, t), + get c() { + return function (e, t) { + if (t.length > 0) { + for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { + var o = { + v: !1 + }; + try { + var s = t[i](n, { + kind: "class", + name: a, + addInitializer: createAddInitializerMethod(r, o) + }); + } finally { + o.v = !0; + } + void 0 !== s && (assertValidReturnValue(10, s), n = s); + } + return [n, function () { + for (var e = 0; e < r.length; e++) r[e].call(n); + }]; + } + }(e, r); + } + }; + }; +} +function applyDecs2203R(e, t, r) { + return (applyDecs2203R = applyDecs2203RFactory())(e, t, r); +} +export { applyDecs2203R as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js new file mode 100644 index 0000000..bb4fbe6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js @@ -0,0 +1,222 @@ +import _typeof from "./typeof.js"; +import checkInRHS from "./checkInRHS.js"; +import setFunctionName from "./setFunctionName.js"; +import toPropertyKey from "./toPropertyKey.js"; +function applyDecs2301Factory() { + function createAddInitializerMethod(e, t) { + return function (r) { + !function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + }(t), assertCallable(r, "An initializer"), e.push(r); + }; + } + function assertInstanceIfPrivate(e, t) { + if (!e(t)) throw new TypeError("Attempted to access private element on non-instance"); + } + function memberDec(e, t, r, n, a, i, s, o, c) { + var u; + switch (a) { + case 1: + u = "accessor"; + break; + case 2: + u = "method"; + break; + case 3: + u = "getter"; + break; + case 4: + u = "setter"; + break; + default: + u = "field"; + } + var l, + f, + p = { + kind: u, + name: s ? "#" + t : toPropertyKey(t), + "static": i, + "private": s + }, + d = { + v: !1 + }; + if (0 !== a && (p.addInitializer = createAddInitializerMethod(n, d)), s || 0 !== a && 2 !== a) { + if (2 === a) l = function l(e) { + return assertInstanceIfPrivate(c, e), r.value; + };else { + var h = 0 === a || 1 === a; + (h || 3 === a) && (l = s ? function (e) { + return assertInstanceIfPrivate(c, e), r.get.call(e); + } : function (e) { + return r.get.call(e); + }), (h || 4 === a) && (f = s ? function (e, t) { + assertInstanceIfPrivate(c, e), r.set.call(e, t); + } : function (e, t) { + r.set.call(e, t); + }); + } + } else l = function l(e) { + return e[t]; + }, 0 === a && (f = function f(e, r) { + e[t] = r; + }); + var v = s ? c.bind() : function (e) { + return t in e; + }; + p.access = l && f ? { + get: l, + set: f, + has: v + } : l ? { + get: l, + has: v + } : { + set: f, + has: v + }; + try { + return e(o, p); + } finally { + d.v = !0; + } + } + function assertCallable(e, t) { + if ("function" != typeof e) throw new TypeError(t + " must be a function"); + } + function assertValidReturnValue(e, t) { + var r = _typeof(t); + if (1 === e) { + if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); + } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0"); + } + function curryThis2(e) { + return function (t) { + e(this, t); + }; + } + function applyMemberDec(e, t, r, n, a, i, s, o, c) { + var u, + l, + f, + p, + d, + h, + v, + y, + g = r[0]; + if (s ? (0 === a || 1 === a ? (u = { + get: (d = r[3], function () { + return d(this); + }), + set: curryThis2(r[4]) + }, f = "get") : 3 === a ? (u = { + get: r[3] + }, f = "get") : 4 === a ? (u = { + set: r[3] + }, f = "set") : u = { + value: r[3] + }, 0 !== a && (1 === a && setFunctionName(u.set, "#" + n, "set"), setFunctionName(u[f || "value"], "#" + n, f))) : 0 !== a && (u = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? p = { + get: u.get, + set: u.set + } : 2 === a ? p = u.value : 3 === a ? p = u.get : 4 === a && (p = u.set), "function" == typeof g) void 0 !== (h = memberDec(g, n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? l = h : 1 === a ? (l = h.init, v = h.get || p.get, y = h.set || p.set, p = { + get: v, + set: y + }) : p = h);else for (var m = g.length - 1; m >= 0; m--) { + var b; + void 0 !== (h = memberDec(g[m], n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? b = h : 1 === a ? (b = h.init, v = h.get || p.get, y = h.set || p.set, p = { + get: v, + set: y + }) : p = h, void 0 !== b && (void 0 === l ? l = b : "function" == typeof l ? l = [l, b] : l.push(b))); + } + if (0 === a || 1 === a) { + if (void 0 === l) l = function l(e, t) { + return t; + };else if ("function" != typeof l) { + var I = l; + l = function l(e, t) { + for (var r = t, n = 0; n < I.length; n++) r = I[n].call(e, r); + return r; + }; + } else { + var w = l; + l = function l(e, t) { + return w.call(e, t); + }; + } + e.push(l); + } + 0 !== a && (1 === a ? (u.get = p.get, u.set = p.set) : 2 === a ? u.value = p : 3 === a ? u.get = p : 4 === a && (u.set = p), s ? 1 === a ? (e.push(function (e, t) { + return p.get.call(e, t); + }), e.push(function (e, t) { + return p.set.call(e, t); + })) : 2 === a ? e.push(p) : e.push(function (e, t) { + return p.call(e, t); + }) : Object.defineProperty(t, n, u)); + } + function applyMemberDecs(e, t, r) { + for (var n, a, i, s = [], o = new Map(), c = new Map(), u = 0; u < t.length; u++) { + var l = t[u]; + if (Array.isArray(l)) { + var f, + p, + d = l[1], + h = l[2], + v = l.length > 3, + y = d >= 5, + g = r; + if (y ? (f = e, 0 != (d -= 5) && (p = a = a || []), v && !i && (i = function i(t) { + return checkInRHS(t) === e; + }), g = i) : (f = e.prototype, 0 !== d && (p = n = n || [])), 0 !== d && !v) { + var m = y ? c : o, + b = m.get(h) || 0; + if (!0 === b || 3 === b && 4 !== d || 4 === b && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); + !b && d > 2 ? m.set(h, d) : m.set(h, !0); + } + applyMemberDec(s, f, l, h, d, y, v, p, g); + } + } + return pushInitializers(s, n), pushInitializers(s, a), s; + } + function pushInitializers(e, t) { + t && e.push(function (e) { + for (var r = 0; r < t.length; r++) t[r].call(e); + return e; + }); + } + return function (e, t, r, n) { + return { + e: applyMemberDecs(e, t, n), + get c() { + return function (e, t) { + if (t.length > 0) { + for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { + var s = { + v: !1 + }; + try { + var o = t[i](n, { + kind: "class", + name: a, + addInitializer: createAddInitializerMethod(r, s) + }); + } finally { + s.v = !0; + } + void 0 !== o && (assertValidReturnValue(10, o), n = o); + } + return [n, function () { + for (var e = 0; e < r.length; e++) r[e].call(n); + }]; + } + }(e, r); + } + }; + }; +} +function applyDecs2301(e, t, r, n) { + return (applyDecs2301 = applyDecs2301Factory())(e, t, r, n); +} +export { applyDecs2301 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js new file mode 100644 index 0000000..a11b2b9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js @@ -0,0 +1,133 @@ +import _typeof from "./typeof.js"; +import checkInRHS from "./checkInRHS.js"; +import setFunctionName from "./setFunctionName.js"; +import toPropertyKey from "./toPropertyKey.js"; +function applyDecs2305(e, t, r, n, o, a) { + function i(e, t, r) { + return function (n, o) { + return r && r(n), e[t].call(n, o); + }; + } + function c(e, t) { + for (var r = 0; r < e.length; r++) e[r].call(t); + return t; + } + function s(e, t, r, n) { + if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); + return e; + } + function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { + function m(e) { + if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); + } + var y, + v = t[0], + g = t[3], + b = !u; + if (!b) { + r || Array.isArray(v) || (v = [v]); + var w = {}, + S = [], + A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; + f ? (p || d ? w = { + get: setFunctionName(function () { + return g(this); + }, n, "get"), + set: function set(e) { + t[4](this, e); + } + } : w[A] = g, p || setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); + } + for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { + var D = v[j], + E = r ? v[j - 1] : void 0, + I = {}, + O = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][o], + name: n, + metadata: a, + addInitializer: function (e, t) { + if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); + s(t, "An initializer", "be", !0), c.push(t); + }.bind(null, I) + }; + try { + if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { + var k, F; + O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { + return m(e), w.value; + } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { + return e[n]; + }, (o < 2 || 4 === o) && (F = function F(e, t) { + e[n] = t; + })); + var N = O.access = { + has: f ? h.bind() : function (e) { + return n in e; + } + }; + if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { + get: w.get, + set: w.set + } : w[A], O), d) { + if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); + } + } finally { + I.v = !0; + } + } + return (p || d) && u.push(function (e, t) { + for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); + return t; + }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; + } + function u(e, t) { + return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { + configurable: !0, + enumerable: !0, + value: t + }); + } + if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; + var f = Object.create(null == l ? null : l), + p = function (e, t, r, n) { + var o, + a, + i = [], + s = function s(t) { + return checkInRHS(t) === e; + }, + u = new Map(); + function l(e) { + e && i.push(c.bind(null, e)); + } + for (var f = 0; f < t.length; f++) { + var p = t[f]; + if (Array.isArray(p)) { + var d = p[1], + h = p[2], + m = p.length > 3, + y = 16 & d, + v = !!(8 & d), + g = 0 == (d &= 7), + b = h + "/" + v; + if (!g && !m) { + var w = u.get(b); + if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); + u.set(b, !(d > 2) || d); + } + applyDec(v ? e : e.prototype, p, y, m ? "#" + h : toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); + } + } + return l(o), l(a), i; + }(e, t, o, f); + return r.length || u(e, f), { + e: p, + get c() { + var t = []; + return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; + } + }; +} +export { applyDecs2305 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js new file mode 100644 index 0000000..41b2c48 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js @@ -0,0 +1,124 @@ +import _typeof from "./typeof.js"; +import checkInRHS from "./checkInRHS.js"; +import setFunctionName from "./setFunctionName.js"; +import toPropertyKey from "./toPropertyKey.js"; +function applyDecs2311(e, t, n, r, o, i) { + var a, + c, + u, + s, + f, + l, + p, + d = Symbol.metadata || Symbol["for"]("Symbol.metadata"), + m = Object.defineProperty, + h = Object.create, + y = [h(null), h(null)], + v = t.length; + function g(t, n, r) { + return function (o, i) { + n && (i = o, o = e); + for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); + return r ? i : o; + }; + } + function b(e, t, n, r) { + if ("function" != typeof e && (r || void 0 !== e)) throw new TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined")); + return e; + } + function applyDec(e, t, n, r, o, i, u, s, f, l, p) { + function d(e) { + if (!p(e)) throw new TypeError("Attempted to access private element on non-instance"); + } + var h = [].concat(t[0]), + v = t[3], + w = !u, + D = 1 === o, + S = 3 === o, + j = 4 === o, + E = 2 === o; + function I(t, n, r) { + return function (o, i) { + return n && (i = o, o = e), r && r(o), P[t].call(o, i); + }; + } + if (!w) { + var P = {}, + k = [], + F = S ? "get" : j || D ? "set" : "value"; + if (f ? (l || D ? P = { + get: setFunctionName(function () { + return v(this); + }, r, "get"), + set: function set(e) { + t[4](this, e); + } + } : P[F] = v, l || setFunctionName(P[F], r, E ? "" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { + if ((c = y[+s][r]) && 7 != (c ^ o)) throw Error("Decorating two elements with the same name (" + P[F].name + ") is not supported yet"); + y[+s][r] = o < 3 ? 1 : o; + } + } + for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { + var T = b(h[O], "A decorator", "be", !0), + z = n ? h[O - 1] : void 0, + A = {}, + H = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][o], + name: r, + metadata: a, + addInitializer: function (e, t) { + if (e.v) throw new TypeError("attempted to call addInitializer after decoration was finished"); + b(t, "An initializer", "be", !0), i.push(t); + }.bind(null, A) + }; + if (w) c = T.call(z, N, H), A.v = 1, b(c, "class decorators", "return") && (N = c);else if (H["static"] = s, H["private"] = f, c = H.access = { + has: f ? p.bind() : function (e) { + return r in e; + } + }, j || (c.get = f ? E ? function (e) { + return d(e), P.value; + } : I("get", 0, d) : function (e) { + return e[r]; + }), E || S || (c.set = f ? I("set", 0, d) : function (e, t) { + e[r] = t; + }), N = T.call(z, D ? { + get: P.get, + set: P.set + } : P[F], H), A.v = 1, D) { + if ("object" == _typeof(N) && N) (c = b(N.get, "accessor.get")) && (P.get = c), (c = b(N.set, "accessor.set")) && (P.set = c), (c = b(N.init, "accessor.init")) && k.unshift(c);else if (void 0 !== N) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined"); + } else b(N, (l ? "field" : "method") + " decorators", "return") && (l ? k.unshift(N) : P[F] = N); + } + return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I("get", s), I("set", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; + } + function w(e) { + return m(e, d, { + configurable: !0, + enumerable: !0, + value: a + }); + } + return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function l(e) { + e && f.push(g(e)); + }, p = function p(t, r) { + for (var i = 0; i < n.length; i++) { + var a = n[i], + c = a[1], + l = 7 & c; + if ((8 & c) == t && !l == r) { + var p = a[2], + d = !!a[3], + m = 16 & c; + applyDec(t ? e : e.prototype, a, m, d ? "#" + p : toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { + return checkInRHS(t) === e; + } : o); + } + } + }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { + e: c, + get c() { + var n = []; + return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; + } + }; +} +export { applyDecs2311 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js new file mode 100644 index 0000000..9ace772 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js @@ -0,0 +1,6 @@ +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +export { _arrayLikeToArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js new file mode 100644 index 0000000..99fa715 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js @@ -0,0 +1,4 @@ +function _arrayWithHoles(r) { + if (Array.isArray(r)) return r; +} +export { _arrayWithHoles as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js new file mode 100644 index 0000000..1ce6f21 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js @@ -0,0 +1,5 @@ +import arrayLikeToArray from "./arrayLikeToArray.js"; +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return arrayLikeToArray(r); +} +export { _arrayWithoutHoles as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js new file mode 100644 index 0000000..ae7b712 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js @@ -0,0 +1,5 @@ +function _assertClassBrand(e, t, n) { + if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; + throw new TypeError("Private element is not present on this object"); +} +export { _assertClassBrand as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js new file mode 100644 index 0000000..4a41bde --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js @@ -0,0 +1,5 @@ +function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; +} +export { _assertThisInitialized as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js new file mode 100644 index 0000000..e026689 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js @@ -0,0 +1,24 @@ +import OverloadYield from "./OverloadYield.js"; +function _asyncGeneratorDelegate(t) { + var e = {}, + n = !1; + function pump(e, r) { + return n = !0, r = new Promise(function (n) { + n(t[e](r)); + }), { + done: !1, + value: new OverloadYield(r, 1) + }; + } + return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { + return this; + }, e.next = function (t) { + return n ? (n = !1, t) : pump("next", t); + }, "function" == typeof t["throw"] && (e["throw"] = function (t) { + if (n) throw n = !1, t; + return pump("throw", t); + }), "function" == typeof t["return"] && (e["return"] = function (t) { + return n ? (n = !1, t) : pump("return", t); + }), e; +} +export { _asyncGeneratorDelegate as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncIterator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncIterator.js new file mode 100644 index 0000000..2ed00b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncIterator.js @@ -0,0 +1,45 @@ +function _asyncIterator(r) { + var n, + t, + o, + e = 2; + for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { + if (t && null != (n = r[t])) return n.call(r); + if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); + t = "@@asyncIterator", o = "@@iterator"; + } + throw new TypeError("Object is not async iterable"); +} +function AsyncFromSyncIterator(r) { + function AsyncFromSyncIteratorContinuation(r) { + if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); + var n = r.done; + return Promise.resolve(r.value).then(function (r) { + return { + value: r, + done: n + }; + }); + } + return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { + this.s = r, this.n = r.next; + }, AsyncFromSyncIterator.prototype = { + s: null, + n: null, + next: function next() { + return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); + }, + "return": function _return(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.resolve({ + value: r, + done: !0 + }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + }, + "throw": function _throw(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + } + }, new AsyncFromSyncIterator(r); +} +export { _asyncIterator as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js new file mode 100644 index 0000000..00f29b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js @@ -0,0 +1,26 @@ +function asyncGeneratorStep(n, t, e, r, o, a, c) { + try { + var i = n[a](c), + u = i.value; + } catch (n) { + return void e(n); + } + i.done ? t(u) : Promise.resolve(u).then(r, o); +} +function _asyncToGenerator(n) { + return function () { + var t = this, + e = arguments; + return new Promise(function (r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); + } + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); + } + _next(void 0); + }); + }; +} +export { _asyncToGenerator as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js new file mode 100644 index 0000000..097c88c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js @@ -0,0 +1,5 @@ +import OverloadYield from "./OverloadYield.js"; +function _awaitAsyncGenerator(e) { + return new OverloadYield(e, 0); +} +export { _awaitAsyncGenerator as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/callSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/callSuper.js new file mode 100644 index 0000000..6d17a4e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/callSuper.js @@ -0,0 +1,7 @@ +import getPrototypeOf from "./getPrototypeOf.js"; +import isNativeReflectConstruct from "./isNativeReflectConstruct.js"; +import possibleConstructorReturn from "./possibleConstructorReturn.js"; +function _callSuper(t, o, e) { + return o = getPrototypeOf(o), possibleConstructorReturn(t, isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf(t).constructor) : o.apply(t, e)); +} +export { _callSuper as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkInRHS.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkInRHS.js new file mode 100644 index 0000000..12f59b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkInRHS.js @@ -0,0 +1,6 @@ +import _typeof from "./typeof.js"; +function _checkInRHS(e) { + if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); + return e; +} +export { _checkInRHS as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js new file mode 100644 index 0000000..e9e6b3b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js @@ -0,0 +1,4 @@ +function _checkPrivateRedeclaration(e, t) { + if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); +} +export { _checkPrivateRedeclaration as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js new file mode 100644 index 0000000..5623419 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js @@ -0,0 +1,10 @@ +function _classApplyDescriptorDestructureSet(e, t) { + if (t.set) return "__destrObj" in t || (t.__destrObj = { + set value(r) { + t.set.call(e, r); + } + }), t.__destrObj; + if (!t.writable) throw new TypeError("attempted to set read only private field"); + return t; +} +export { _classApplyDescriptorDestructureSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js new file mode 100644 index 0000000..b9259d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js @@ -0,0 +1,4 @@ +function _classApplyDescriptorGet(e, t) { + return t.get ? t.get.call(e) : t.value; +} +export { _classApplyDescriptorGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js new file mode 100644 index 0000000..d9c4fbd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js @@ -0,0 +1,7 @@ +function _classApplyDescriptorSet(e, t, l) { + if (t.set) t.set.call(e, l);else { + if (!t.writable) throw new TypeError("attempted to set read only private field"); + t.value = l; + } +} +export { _classApplyDescriptorSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCallCheck.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCallCheck.js new file mode 100644 index 0000000..bf97219 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCallCheck.js @@ -0,0 +1,4 @@ +function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); +} +export { _classCallCheck as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js new file mode 100644 index 0000000..366ed05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classCheckPrivateStaticAccess(s, a, r) { + return assertClassBrand(a, s, r); +} +export { _classCheckPrivateStaticAccess as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js new file mode 100644 index 0000000..844be91 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js @@ -0,0 +1,4 @@ +function _classCheckPrivateStaticFieldDescriptor(t, e) { + if (void 0 === t) throw new TypeError("attempted to " + e + " private static field before its declaration"); +} +export { _classCheckPrivateStaticFieldDescriptor as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js new file mode 100644 index 0000000..652689d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js @@ -0,0 +1,5 @@ +import classPrivateFieldGet2 from "./classPrivateFieldGet2.js"; +function _classExtractFieldDescriptor(e, t) { + return classPrivateFieldGet2(t, e); +} +export { _classExtractFieldDescriptor as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js new file mode 100644 index 0000000..68e76ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js @@ -0,0 +1,4 @@ +function _classNameTDZError(e) { + throw new ReferenceError('Class "' + e + '" cannot be referenced in computed property keys.'); +} +export { _classNameTDZError as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js new file mode 100644 index 0000000..9303366 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorDestructureSet from "./classApplyDescriptorDestructureSet.js"; +import classPrivateFieldGet2 from "./classPrivateFieldGet2.js"; +function _classPrivateFieldDestructureSet(e, t) { + var r = classPrivateFieldGet2(t, e); + return classApplyDescriptorDestructureSet(e, r); +} +export { _classPrivateFieldDestructureSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js new file mode 100644 index 0000000..ce7ebcb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorGet from "./classApplyDescriptorGet.js"; +import classPrivateFieldGet2 from "./classPrivateFieldGet2.js"; +function _classPrivateFieldGet(e, t) { + var r = classPrivateFieldGet2(t, e); + return classApplyDescriptorGet(e, r); +} +export { _classPrivateFieldGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js new file mode 100644 index 0000000..4aa3da6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classPrivateFieldGet2(s, a) { + return s.get(assertClassBrand(s, a)); +} +export { _classPrivateFieldGet2 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js new file mode 100644 index 0000000..5dcdbe0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js @@ -0,0 +1,5 @@ +import checkPrivateRedeclaration from "./checkPrivateRedeclaration.js"; +function _classPrivateFieldInitSpec(e, t, a) { + checkPrivateRedeclaration(e, t), t.set(e, a); +} +export { _classPrivateFieldInitSpec as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js new file mode 100644 index 0000000..4bd662c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js @@ -0,0 +1,5 @@ +function _classPrivateFieldBase(e, t) { + if (!{}.hasOwnProperty.call(e, t)) throw new TypeError("attempted to use private field on non-instance"); + return e; +} +export { _classPrivateFieldBase as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js new file mode 100644 index 0000000..90d2193 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js @@ -0,0 +1,5 @@ +var id = 0; +function _classPrivateFieldKey(e) { + return "__private_" + id++ + "_" + e; +} +export { _classPrivateFieldKey as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js new file mode 100644 index 0000000..b5161bd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorSet from "./classApplyDescriptorSet.js"; +import classPrivateFieldGet2 from "./classPrivateFieldGet2.js"; +function _classPrivateFieldSet(e, t, r) { + var s = classPrivateFieldGet2(t, e); + return classApplyDescriptorSet(e, s, r), r; +} +export { _classPrivateFieldSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js new file mode 100644 index 0000000..337b01a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classPrivateFieldSet2(s, a, r) { + return s.set(assertClassBrand(s, a), r), r; +} +export { _classPrivateFieldSet2 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js new file mode 100644 index 0000000..ff3e985 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classPrivateGetter(s, r, a) { + return a(assertClassBrand(s, r)); +} +export { _classPrivateGetter as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js new file mode 100644 index 0000000..4832fc6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classPrivateMethodGet(s, a, r) { + return assertClassBrand(a, s), r; +} +export { _classPrivateMethodGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js new file mode 100644 index 0000000..61e23e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js @@ -0,0 +1,5 @@ +import checkPrivateRedeclaration from "./checkPrivateRedeclaration.js"; +function _classPrivateMethodInitSpec(e, a) { + checkPrivateRedeclaration(e, a), a.add(e); +} +export { _classPrivateMethodInitSpec as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js new file mode 100644 index 0000000..d181b51 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js @@ -0,0 +1,4 @@ +function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); +} +export { _classPrivateMethodSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js new file mode 100644 index 0000000..9a80d59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classPrivateSetter(s, r, a, t) { + return r(assertClassBrand(s, a), t), t; +} +export { _classPrivateSetter as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js new file mode 100644 index 0000000..747e639 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorDestructureSet from "./classApplyDescriptorDestructureSet.js"; +import assertClassBrand from "./assertClassBrand.js"; +import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js"; +function _classStaticPrivateFieldDestructureSet(t, r, s) { + return assertClassBrand(r, t), classCheckPrivateStaticFieldDescriptor(s, "set"), classApplyDescriptorDestructureSet(t, s); +} +export { _classStaticPrivateFieldDestructureSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js new file mode 100644 index 0000000..23684b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorGet from "./classApplyDescriptorGet.js"; +import assertClassBrand from "./assertClassBrand.js"; +import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js"; +function _classStaticPrivateFieldSpecGet(t, s, r) { + return assertClassBrand(s, t), classCheckPrivateStaticFieldDescriptor(r, "get"), classApplyDescriptorGet(t, r); +} +export { _classStaticPrivateFieldSpecGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js new file mode 100644 index 0000000..3a31468 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js @@ -0,0 +1,7 @@ +import classApplyDescriptorSet from "./classApplyDescriptorSet.js"; +import assertClassBrand from "./assertClassBrand.js"; +import classCheckPrivateStaticFieldDescriptor from "./classCheckPrivateStaticFieldDescriptor.js"; +function _classStaticPrivateFieldSpecSet(s, t, r, e) { + return assertClassBrand(t, s), classCheckPrivateStaticFieldDescriptor(r, "set"), classApplyDescriptorSet(s, r, e), e; +} +export { _classStaticPrivateFieldSpecSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js new file mode 100644 index 0000000..047b177 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js @@ -0,0 +1,5 @@ +import assertClassBrand from "./assertClassBrand.js"; +function _classStaticPrivateMethodGet(s, a, t) { + return assertClassBrand(a, s), t; +} +export { _classStaticPrivateMethodGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js new file mode 100644 index 0000000..a61ae63 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js @@ -0,0 +1,4 @@ +function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); +} +export { _classStaticPrivateMethodSet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/construct.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/construct.js new file mode 100644 index 0000000..91609ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/construct.js @@ -0,0 +1,10 @@ +import isNativeReflectConstruct from "./isNativeReflectConstruct.js"; +import setPrototypeOf from "./setPrototypeOf.js"; +function _construct(t, e, r) { + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && setPrototypeOf(p, r.prototype), p; +} +export { _construct as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createClass.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createClass.js new file mode 100644 index 0000000..9b17851 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createClass.js @@ -0,0 +1,13 @@ +import toPropertyKey from "./toPropertyKey.js"; +function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); + } +} +function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; +} +export { _createClass as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js new file mode 100644 index 0000000..93b97f9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js @@ -0,0 +1,50 @@ +import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; +function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { + t && (r = t); + var _n = 0, + F = function F() {}; + return { + s: F, + n: function n() { + return _n >= r.length ? { + done: !0 + } : { + done: !1, + value: r[_n++] + }; + }, + e: function e(r) { + throw r; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, + a = !0, + u = !1; + return { + s: function s() { + t = t.call(r); + }, + n: function n() { + var r = t.next(); + return a = r.done, r; + }, + e: function e(r) { + u = !0, o = r; + }, + f: function f() { + try { + a || null == t["return"] || t["return"](); + } finally { + if (u) throw o; + } + } + }; +} +export { _createForOfIteratorHelper as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js new file mode 100644 index 0000000..3deaae4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js @@ -0,0 +1,19 @@ +import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; +function _createForOfIteratorHelperLoose(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (t) return (t = t.call(r)).next.bind(t); + if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { + t && (r = t); + var o = 0; + return function () { + return o >= r.length ? { + done: !0 + } : { + done: !1, + value: r[o++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +export { _createForOfIteratorHelperLoose as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createSuper.js new file mode 100644 index 0000000..dfabf71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/createSuper.js @@ -0,0 +1,16 @@ +import getPrototypeOf from "./getPrototypeOf.js"; +import isNativeReflectConstruct from "./isNativeReflectConstruct.js"; +import possibleConstructorReturn from "./possibleConstructorReturn.js"; +function _createSuper(t) { + var r = isNativeReflectConstruct(); + return function () { + var e, + o = getPrototypeOf(t); + if (r) { + var s = getPrototypeOf(this).constructor; + e = Reflect.construct(o, arguments, s); + } else e = o.apply(this, arguments); + return possibleConstructorReturn(this, e); + }; +} +export { _createSuper as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/decorate.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/decorate.js new file mode 100644 index 0000000..f76b6a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/decorate.js @@ -0,0 +1,250 @@ +import toArray from "./toArray.js"; +import toPropertyKey from "./toPropertyKey.js"; +function _decorate(e, r, t, i) { + var o = _getDecoratorsApi(); + if (i) for (var n = 0; n < i.length; n++) o = i[n](o); + var s = r(function (e) { + o.initializeInstanceElements(e, a.elements); + }, t), + a = o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)), e); + return o.initializeClassElements(s.F, a.elements), o.runClassFinishers(s.F, a.finishers); +} +function _getDecoratorsApi() { + _getDecoratorsApi = function _getDecoratorsApi() { + return e; + }; + var e = { + elementsDefinitionOrder: [["method"], ["field"]], + initializeInstanceElements: function initializeInstanceElements(e, r) { + ["method", "field"].forEach(function (t) { + r.forEach(function (r) { + r.kind === t && "own" === r.placement && this.defineClassElement(e, r); + }, this); + }, this); + }, + initializeClassElements: function initializeClassElements(e, r) { + var t = e.prototype; + ["method", "field"].forEach(function (i) { + r.forEach(function (r) { + var o = r.placement; + if (r.kind === i && ("static" === o || "prototype" === o)) { + var n = "static" === o ? e : t; + this.defineClassElement(n, r); + } + }, this); + }, this); + }, + defineClassElement: function defineClassElement(e, r) { + var t = r.descriptor; + if ("field" === r.kind) { + var i = r.initializer; + t = { + enumerable: t.enumerable, + writable: t.writable, + configurable: t.configurable, + value: void 0 === i ? void 0 : i.call(e) + }; + } + Object.defineProperty(e, r.key, t); + }, + decorateClass: function decorateClass(e, r) { + var t = [], + i = [], + o = { + "static": [], + prototype: [], + own: [] + }; + if (e.forEach(function (e) { + this.addElementPlacement(e, o); + }, this), e.forEach(function (e) { + if (!_hasDecorators(e)) return t.push(e); + var r = this.decorateElement(e, o); + t.push(r.element), t.push.apply(t, r.extras), i.push.apply(i, r.finishers); + }, this), !r) return { + elements: t, + finishers: i + }; + var n = this.decorateConstructor(t, r); + return i.push.apply(i, n.finishers), n.finishers = i, n; + }, + addElementPlacement: function addElementPlacement(e, r, t) { + var i = r[e.placement]; + if (!t && -1 !== i.indexOf(e.key)) throw new TypeError("Duplicated element (" + e.key + ")"); + i.push(e.key); + }, + decorateElement: function decorateElement(e, r) { + for (var t = [], i = [], o = e.decorators, n = o.length - 1; n >= 0; n--) { + var s = r[e.placement]; + s.splice(s.indexOf(e.key), 1); + var a = this.fromElementDescriptor(e), + l = this.toElementFinisherExtras((0, o[n])(a) || a); + e = l.element, this.addElementPlacement(e, r), l.finisher && i.push(l.finisher); + var c = l.extras; + if (c) { + for (var p = 0; p < c.length; p++) this.addElementPlacement(c[p], r); + t.push.apply(t, c); + } + } + return { + element: e, + finishers: i, + extras: t + }; + }, + decorateConstructor: function decorateConstructor(e, r) { + for (var t = [], i = r.length - 1; i >= 0; i--) { + var o = this.fromClassDescriptor(e), + n = this.toClassDescriptor((0, r[i])(o) || o); + if (void 0 !== n.finisher && t.push(n.finisher), void 0 !== n.elements) { + e = n.elements; + for (var s = 0; s < e.length - 1; s++) for (var a = s + 1; a < e.length; a++) if (e[s].key === e[a].key && e[s].placement === e[a].placement) throw new TypeError("Duplicated element (" + e[s].key + ")"); + } + } + return { + elements: e, + finishers: t + }; + }, + fromElementDescriptor: function fromElementDescriptor(e) { + var r = { + kind: e.kind, + key: e.key, + placement: e.placement, + descriptor: e.descriptor + }; + return Object.defineProperty(r, Symbol.toStringTag, { + value: "Descriptor", + configurable: !0 + }), "field" === e.kind && (r.initializer = e.initializer), r; + }, + toElementDescriptors: function toElementDescriptors(e) { + if (void 0 !== e) return toArray(e).map(function (e) { + var r = this.toElementDescriptor(e); + return this.disallowProperty(e, "finisher", "An element descriptor"), this.disallowProperty(e, "extras", "An element descriptor"), r; + }, this); + }, + toElementDescriptor: function toElementDescriptor(e) { + var r = e.kind + ""; + if ("method" !== r && "field" !== r) throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "' + r + '"'); + var t = toPropertyKey(e.key), + i = e.placement + ""; + if ("static" !== i && "prototype" !== i && "own" !== i) throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "' + i + '"'); + var o = e.descriptor; + this.disallowProperty(e, "elements", "An element descriptor"); + var n = { + kind: r, + key: t, + placement: i, + descriptor: Object.assign({}, o) + }; + return "field" !== r ? this.disallowProperty(e, "initializer", "A method descriptor") : (this.disallowProperty(o, "get", "The property descriptor of a field descriptor"), this.disallowProperty(o, "set", "The property descriptor of a field descriptor"), this.disallowProperty(o, "value", "The property descriptor of a field descriptor"), n.initializer = e.initializer), n; + }, + toElementFinisherExtras: function toElementFinisherExtras(e) { + return { + element: this.toElementDescriptor(e), + finisher: _optionalCallableProperty(e, "finisher"), + extras: this.toElementDescriptors(e.extras) + }; + }, + fromClassDescriptor: function fromClassDescriptor(e) { + var r = { + kind: "class", + elements: e.map(this.fromElementDescriptor, this) + }; + return Object.defineProperty(r, Symbol.toStringTag, { + value: "Descriptor", + configurable: !0 + }), r; + }, + toClassDescriptor: function toClassDescriptor(e) { + var r = e.kind + ""; + if ("class" !== r) throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "' + r + '"'); + this.disallowProperty(e, "key", "A class descriptor"), this.disallowProperty(e, "placement", "A class descriptor"), this.disallowProperty(e, "descriptor", "A class descriptor"), this.disallowProperty(e, "initializer", "A class descriptor"), this.disallowProperty(e, "extras", "A class descriptor"); + var t = _optionalCallableProperty(e, "finisher"); + return { + elements: this.toElementDescriptors(e.elements), + finisher: t + }; + }, + runClassFinishers: function runClassFinishers(e, r) { + for (var t = 0; t < r.length; t++) { + var i = (0, r[t])(e); + if (void 0 !== i) { + if ("function" != typeof i) throw new TypeError("Finishers must return a constructor."); + e = i; + } + } + return e; + }, + disallowProperty: function disallowProperty(e, r, t) { + if (void 0 !== e[r]) throw new TypeError(t + " can't have a ." + r + " property."); + } + }; + return e; +} +function _createElementDescriptor(e) { + var r, + t = toPropertyKey(e.key); + "method" === e.kind ? r = { + value: e.value, + writable: !0, + configurable: !0, + enumerable: !1 + } : "get" === e.kind ? r = { + get: e.value, + configurable: !0, + enumerable: !1 + } : "set" === e.kind ? r = { + set: e.value, + configurable: !0, + enumerable: !1 + } : "field" === e.kind && (r = { + configurable: !0, + writable: !0, + enumerable: !0 + }); + var i = { + kind: "field" === e.kind ? "field" : "method", + key: t, + placement: e["static"] ? "static" : "field" === e.kind ? "own" : "prototype", + descriptor: r + }; + return e.decorators && (i.decorators = e.decorators), "field" === e.kind && (i.initializer = e.value), i; +} +function _coalesceGetterSetter(e, r) { + void 0 !== e.descriptor.get ? r.descriptor.get = e.descriptor.get : r.descriptor.set = e.descriptor.set; +} +function _coalesceClassElements(e) { + for (var r = [], isSameElement = function isSameElement(e) { + return "method" === e.kind && e.key === o.key && e.placement === o.placement; + }, t = 0; t < e.length; t++) { + var i, + o = e[t]; + if ("method" === o.kind && (i = r.find(isSameElement))) { + if (_isDataDescriptor(o.descriptor) || _isDataDescriptor(i.descriptor)) { + if (_hasDecorators(o) || _hasDecorators(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated."); + i.descriptor = o.descriptor; + } else { + if (_hasDecorators(o)) { + if (_hasDecorators(i)) throw new ReferenceError("Decorators can't be placed on different accessors with for the same property (" + o.key + ")."); + i.decorators = o.decorators; + } + _coalesceGetterSetter(o, i); + } + } else r.push(o); + } + return r; +} +function _hasDecorators(e) { + return e.decorators && e.decorators.length; +} +function _isDataDescriptor(e) { + return void 0 !== e && !(void 0 === e.value && void 0 === e.writable); +} +function _optionalCallableProperty(e, r) { + var t = e[r]; + if (void 0 !== t && "function" != typeof t) throw new TypeError("Expected '" + r + "' to be a function"); + return t; +} +export { _decorate as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defaults.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defaults.js new file mode 100644 index 0000000..d3041a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defaults.js @@ -0,0 +1,9 @@ +function _defaults(e, r) { + for (var t = Object.getOwnPropertyNames(r), o = 0; o < t.length; o++) { + var n = t[o], + a = Object.getOwnPropertyDescriptor(r, n); + a && a.configurable && void 0 === e[n] && Object.defineProperty(e, n, a); + } + return e; +} +export { _defaults as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineAccessor.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineAccessor.js new file mode 100644 index 0000000..a8292de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineAccessor.js @@ -0,0 +1,8 @@ +function _defineAccessor(e, r, n, t) { + var c = { + configurable: !0, + enumerable: !0 + }; + return c[e] = t, Object.defineProperty(r, n, c); +} +export { _defineAccessor as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js new file mode 100644 index 0000000..3d31d98 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js @@ -0,0 +1,12 @@ +function _defineEnumerableProperties(e, r) { + for (var t in r) { + var n = r[t]; + n.configurable = n.enumerable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, t, n); + } + if (Object.getOwnPropertySymbols) for (var a = Object.getOwnPropertySymbols(r), b = 0; b < a.length; b++) { + var i = a[b]; + (n = r[i]).configurable = n.enumerable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, i, n); + } + return e; +} +export { _defineEnumerableProperties as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineProperty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineProperty.js new file mode 100644 index 0000000..05ec32b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/defineProperty.js @@ -0,0 +1,10 @@ +import toPropertyKey from "./toPropertyKey.js"; +function _defineProperty(e, r, t) { + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; +} +export { _defineProperty as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/dispose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/dispose.js new file mode 100644 index 0000000..a87ab20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/dispose.js @@ -0,0 +1,28 @@ +function dispose_SuppressedError(r, e) { + return "undefined" != typeof SuppressedError ? dispose_SuppressedError = SuppressedError : (dispose_SuppressedError = function dispose_SuppressedError(r, e) { + this.suppressed = e, this.error = r, this.stack = Error().stack; + }, dispose_SuppressedError.prototype = Object.create(Error.prototype, { + constructor: { + value: dispose_SuppressedError, + writable: !0, + configurable: !0 + } + })), new dispose_SuppressedError(r, e); +} +function _dispose(r, e, s) { + function next() { + for (; r.length > 0;) try { + var o = r.pop(), + p = o.d.call(o.v); + if (o.a) return Promise.resolve(p).then(next, err); + } catch (r) { + return err(r); + } + if (s) throw e; + } + function err(r) { + return e = s ? new dispose_SuppressedError(e, r) : r, s = !0, next(); + } + return next(); +} +export { _dispose as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/extends.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/extends.js new file mode 100644 index 0000000..53f118c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/extends.js @@ -0,0 +1,10 @@ +function _extends() { + return _extends = Object.assign ? Object.assign.bind() : function (n) { + for (var e = 1; e < arguments.length; e++) { + var t = arguments[e]; + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); + } + return n; + }, _extends.apply(null, arguments); +} +export { _extends as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/get.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/get.js new file mode 100644 index 0000000..8124bc0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/get.js @@ -0,0 +1,11 @@ +import superPropBase from "./superPropBase.js"; +function _get() { + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, _get.apply(null, arguments); +} +export { _get as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js new file mode 100644 index 0000000..9073c45 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js @@ -0,0 +1,6 @@ +function _getPrototypeOf(t) { + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, _getPrototypeOf(t); +} +export { _getPrototypeOf as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/identity.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/identity.js new file mode 100644 index 0000000..6b564ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/identity.js @@ -0,0 +1,4 @@ +function _identity(t) { + return t; +} +export { _identity as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js new file mode 100644 index 0000000..6d35b52 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js @@ -0,0 +1,27 @@ +function _importDeferProxy(e) { + var t = null, + constValue = function constValue(e) { + return function () { + return e; + }; + }, + proxy = function proxy(r) { + return function (n, o, f) { + return null === t && (t = e()), r(t, o, f); + }; + }; + return new Proxy({}, { + defineProperty: constValue(!1), + deleteProperty: constValue(!1), + get: proxy(Reflect.get), + getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor), + getPrototypeOf: constValue(null), + isExtensible: constValue(!1), + has: proxy(Reflect.has), + ownKeys: proxy(Reflect.ownKeys), + preventExtensions: constValue(!0), + set: constValue(!1), + setPrototypeOf: constValue(!1) + }); +} +export { _importDeferProxy as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inherits.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inherits.js new file mode 100644 index 0000000..78f6e4e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inherits.js @@ -0,0 +1,14 @@ +import setPrototypeOf from "./setPrototypeOf.js"; +function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && setPrototypeOf(t, e); +} +export { _inherits as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js new file mode 100644 index 0000000..0bd1330 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js @@ -0,0 +1,5 @@ +import setPrototypeOf from "./setPrototypeOf.js"; +function _inheritsLoose(t, o) { + t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o); +} +export { _inheritsLoose as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js new file mode 100644 index 0000000..68bcc2c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js @@ -0,0 +1,9 @@ +function _initializerDefineProperty(e, i, r, l) { + r && Object.defineProperty(e, i, { + enumerable: r.enumerable, + configurable: r.configurable, + writable: r.writable, + value: r.initializer ? r.initializer.call(l) : void 0 + }); +} +export { _initializerDefineProperty as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js new file mode 100644 index 0000000..0a658e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js @@ -0,0 +1,4 @@ +function _initializerWarningHelper(r, e) { + throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); +} +export { _initializerWarningHelper as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/instanceof.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/instanceof.js new file mode 100644 index 0000000..316539e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/instanceof.js @@ -0,0 +1,4 @@ +function _instanceof(n, e) { + return null != e && "undefined" != typeof Symbol && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](n) : n instanceof e; +} +export { _instanceof as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js new file mode 100644 index 0000000..365d248 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js @@ -0,0 +1,6 @@ +function _interopRequireDefault(e) { + return e && e.__esModule ? e : { + "default": e + }; +} +export { _interopRequireDefault as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js new file mode 100644 index 0000000..e190f1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js @@ -0,0 +1,27 @@ +import _typeof from "./typeof.js"; +function _getRequireWildcardCache(e) { + if ("function" != typeof WeakMap) return null; + var r = new WeakMap(), + t = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { + return e ? t : r; + })(e); +} +function _interopRequireWildcard(e, r) { + if (!r && e && e.__esModule) return e; + if (null === e || "object" != _typeof(e) && "function" != typeof e) return { + "default": e + }; + var t = _getRequireWildcardCache(r); + if (t && t.has(e)) return t.get(e); + var n = { + __proto__: null + }, + a = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { + var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; + i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; + } + return n["default"] = e, t && t.set(e, n), n; +} +export { _interopRequireWildcard as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js new file mode 100644 index 0000000..0cfe276 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js @@ -0,0 +1,8 @@ +function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } +} +export { _isNativeFunction as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js new file mode 100644 index 0000000..0eb5e39 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js @@ -0,0 +1,9 @@ +function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { + return !!t; + })(); +} +export { _isNativeReflectConstruct as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArray.js new file mode 100644 index 0000000..b7de339 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArray.js @@ -0,0 +1,4 @@ +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +export { _iterableToArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js new file mode 100644 index 0000000..473f067 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js @@ -0,0 +1,28 @@ +function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} +export { _iterableToArrayLimit as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/jsx.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/jsx.js new file mode 100644 index 0000000..a120e5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/jsx.js @@ -0,0 +1,22 @@ +var REACT_ELEMENT_TYPE; +function _createRawReactElement(e, r, E, l) { + REACT_ELEMENT_TYPE || (REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol["for"] && Symbol["for"]("react.element") || 60103); + var o = e && e.defaultProps, + n = arguments.length - 3; + if (r || 0 === n || (r = { + children: void 0 + }), 1 === n) r.children = l;else if (n > 1) { + for (var t = Array(n), f = 0; f < n; f++) t[f] = arguments[f + 3]; + r.children = t; + } + if (r && o) for (var i in o) void 0 === r[i] && (r[i] = o[i]);else r || (r = o || {}); + return { + $$typeof: REACT_ELEMENT_TYPE, + type: e, + key: void 0 === E ? null : "" + E, + ref: null, + props: r, + _owner: null + }; +} +export { _createRawReactElement as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js new file mode 100644 index 0000000..527c682 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js @@ -0,0 +1,9 @@ +import arrayLikeToArray from "./arrayLikeToArray.js"; +function _maybeArrayLike(r, a, e) { + if (a && !Array.isArray(a) && "number" == typeof a.length) { + var y = a.length; + return arrayLikeToArray(a, void 0 !== e && e < y ? e : y); + } + return r(a, e); +} +export { _maybeArrayLike as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js new file mode 100644 index 0000000..5f70e0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js @@ -0,0 +1,4 @@ +function _newArrowCheck(n, r) { + if (n !== r) throw new TypeError("Cannot instantiate an arrow function"); +} +export { _newArrowCheck as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js new file mode 100644 index 0000000..9050250 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js @@ -0,0 +1,4 @@ +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +export { _nonIterableRest as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js new file mode 100644 index 0000000..fb03235 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js @@ -0,0 +1,4 @@ +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +export { _nonIterableSpread as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js new file mode 100644 index 0000000..d8c3060 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js @@ -0,0 +1,4 @@ +function _nullishReceiverError(r) { + throw new TypeError("Cannot set property of null or undefined."); +} +export { _nullishReceiverError as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js new file mode 100644 index 0000000..a92eac8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js @@ -0,0 +1,4 @@ +function _objectDestructuringEmpty(t) { + if (null == t) throw new TypeError("Cannot destructure " + t); +} +export { _objectDestructuringEmpty as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread.js new file mode 100644 index 0000000..0f82f06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread.js @@ -0,0 +1,14 @@ +import defineProperty from "./defineProperty.js"; +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? Object(arguments[r]) : {}, + o = Object.keys(t); + "function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), o.forEach(function (r) { + defineProperty(e, r, t[r]); + }); + } + return e; +} +export { _objectSpread as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread2.js new file mode 100644 index 0000000..0035bc7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectSpread2.js @@ -0,0 +1,23 @@ +import defineProperty from "./defineProperty.js"; +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; +} +export { _objectSpread2 as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js new file mode 100644 index 0000000..c5e7cf2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js @@ -0,0 +1,13 @@ +import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js"; +function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, + r, + i = objectWithoutPropertiesLoose(e, t); + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); + } + return i; +} +export { _objectWithoutProperties as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js new file mode 100644 index 0000000..b203b43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js @@ -0,0 +1,10 @@ +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; +} +export { _objectWithoutPropertiesLoose as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/package.json b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/package.json new file mode 100644 index 0000000..aead43d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js new file mode 100644 index 0000000..d84e1e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js @@ -0,0 +1,8 @@ +import _typeof from "./typeof.js"; +import assertThisInitialized from "./assertThisInitialized.js"; +function _possibleConstructorReturn(t, e) { + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return assertThisInitialized(t); +} +export { _possibleConstructorReturn as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/readOnlyError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/readOnlyError.js new file mode 100644 index 0000000..fcc3e33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/readOnlyError.js @@ -0,0 +1,4 @@ +function _readOnlyError(r) { + throw new TypeError('"' + r + '" is read-only'); +} +export { _readOnlyError as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js new file mode 100644 index 0000000..19c78cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js @@ -0,0 +1,304 @@ +import _typeof from "./typeof.js"; +function _regeneratorRuntime() { + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ + _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} +export { _regeneratorRuntime as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/set.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/set.js new file mode 100644 index 0000000..ed0a803 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/set.js @@ -0,0 +1,22 @@ +import superPropBase from "./superPropBase.js"; +import defineProperty from "./defineProperty.js"; +function set(e, r, t, o) { + return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { + var f, + i = superPropBase(e, r); + if (i) { + if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; + if (!f.writable) return !1; + } + if (f = Object.getOwnPropertyDescriptor(o, r)) { + if (!f.writable) return !1; + f.value = t, Object.defineProperty(o, r, f); + } else defineProperty(o, r, t); + return !0; + }, set(e, r, t, o); +} +function _set(e, r, t, o, f) { + if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); + return t; +} +export { _set as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setFunctionName.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setFunctionName.js new file mode 100644 index 0000000..82213ce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setFunctionName.js @@ -0,0 +1,12 @@ +import _typeof from "./typeof.js"; +function setFunctionName(e, t, n) { + "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); + try { + Object.defineProperty(e, "name", { + configurable: !0, + value: n ? n + " " + t : t + }); + } catch (e) {} + return e; +} +export { setFunctionName as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js new file mode 100644 index 0000000..c30983c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js @@ -0,0 +1,6 @@ +function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); +} +export { _setPrototypeOf as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js new file mode 100644 index 0000000..41d5738 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js @@ -0,0 +1,7 @@ +function _skipFirstGeneratorNext(t) { + return function () { + var r = t.apply(this, arguments); + return r.next(), r; + }; +} +export { _skipFirstGeneratorNext as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/slicedToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/slicedToArray.js new file mode 100644 index 0000000..c044c2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/slicedToArray.js @@ -0,0 +1,8 @@ +import arrayWithHoles from "./arrayWithHoles.js"; +import iterableToArrayLimit from "./iterableToArrayLimit.js"; +import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; +import nonIterableRest from "./nonIterableRest.js"; +function _slicedToArray(r, e) { + return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); +} +export { _slicedToArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropBase.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropBase.js new file mode 100644 index 0000000..a5fa386 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropBase.js @@ -0,0 +1,6 @@ +import getPrototypeOf from "./getPrototypeOf.js"; +function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); + return t; +} +export { _superPropBase as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropGet.js new file mode 100644 index 0000000..26ae709 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropGet.js @@ -0,0 +1,9 @@ +import get from "./get.js"; +import getPrototypeOf from "./getPrototypeOf.js"; +function _superPropertyGet(t, e, o, r) { + var p = get(getPrototypeOf(1 & r ? t.prototype : t), e, o); + return 2 & r && "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; +} +export { _superPropertyGet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropSet.js new file mode 100644 index 0000000..86badc9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/superPropSet.js @@ -0,0 +1,6 @@ +import set from "./set.js"; +import getPrototypeOf from "./getPrototypeOf.js"; +function _superPropertySet(t, e, o, r, p, f) { + return set(getPrototypeOf(f ? t.prototype : t), e, o, r, p); +} +export { _superPropertySet as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js new file mode 100644 index 0000000..3d842cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js @@ -0,0 +1,8 @@ +function _taggedTemplateLiteral(e, t) { + return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { + raw: { + value: Object.freeze(t) + } + })); +} +export { _taggedTemplateLiteral as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js new file mode 100644 index 0000000..741aeb8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js @@ -0,0 +1,4 @@ +function _taggedTemplateLiteralLoose(e, t) { + return t || (t = e.slice(0)), e.raw = t, e; +} +export { _taggedTemplateLiteralLoose as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/tdz.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/tdz.js new file mode 100644 index 0000000..58df493 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/tdz.js @@ -0,0 +1,4 @@ +function _tdzError(e) { + throw new ReferenceError(e + " is not defined - temporal dead zone"); +} +export { _tdzError as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalRef.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalRef.js new file mode 100644 index 0000000..8dbf014 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalRef.js @@ -0,0 +1,6 @@ +import temporalUndefined from "./temporalUndefined.js"; +import tdz from "./tdz.js"; +function _temporalRef(r, e) { + return r === temporalUndefined ? tdz(e) : r; +} +export { _temporalRef as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js new file mode 100644 index 0000000..2ec0b0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js @@ -0,0 +1,2 @@ +function _temporalUndefined() {} +export { _temporalUndefined as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toArray.js new file mode 100644 index 0000000..e5f0f52 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toArray.js @@ -0,0 +1,8 @@ +import arrayWithHoles from "./arrayWithHoles.js"; +import iterableToArray from "./iterableToArray.js"; +import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; +import nonIterableRest from "./nonIterableRest.js"; +function _toArray(r) { + return arrayWithHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableRest(); +} +export { _toArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js new file mode 100644 index 0000000..f7338e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js @@ -0,0 +1,8 @@ +import arrayWithoutHoles from "./arrayWithoutHoles.js"; +import iterableToArray from "./iterableToArray.js"; +import unsupportedIterableToArray from "./unsupportedIterableToArray.js"; +import nonIterableSpread from "./nonIterableSpread.js"; +function _toConsumableArray(r) { + return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread(); +} +export { _toConsumableArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPrimitive.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPrimitive.js new file mode 100644 index 0000000..9a3de46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPrimitive.js @@ -0,0 +1,12 @@ +import _typeof from "./typeof.js"; +function toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +export { toPrimitive as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js new file mode 100644 index 0000000..b3274d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js @@ -0,0 +1,7 @@ +import _typeof from "./typeof.js"; +import toPrimitive from "./toPrimitive.js"; +function toPropertyKey(t) { + var i = toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +export { toPropertyKey as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toSetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toSetter.js new file mode 100644 index 0000000..b1dbf7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/toSetter.js @@ -0,0 +1,10 @@ +function _toSetter(t, e, n) { + e || (e = []); + var r = e.length++; + return Object.defineProperty({}, "_", { + set: function set(o) { + e[r] = o, t.apply(n, e); + } + }); +} +export { _toSetter as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/typeof.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/typeof.js new file mode 100644 index 0000000..5b0bc9b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/typeof.js @@ -0,0 +1,10 @@ +function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); +} +export { _typeof as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js new file mode 100644 index 0000000..33adc49 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js @@ -0,0 +1,9 @@ +import arrayLikeToArray from "./arrayLikeToArray.js"; +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; + } +} +export { _unsupportedIterableToArray as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/using.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/using.js new file mode 100644 index 0000000..9bda17b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/using.js @@ -0,0 +1,12 @@ +function _using(o, n, e) { + if (null == n) return n; + if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + if (e) var r = n[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; + if (null == r && (r = n[Symbol.dispose || Symbol["for"]("Symbol.dispose")]), "function" != typeof r) throw new TypeError("Property [Symbol.dispose] is not a function."); + return o.push({ + v: n, + d: r, + a: e + }), n; +} +export { _using as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/usingCtx.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/usingCtx.js new file mode 100644 index 0000000..1464379 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/usingCtx.js @@ -0,0 +1,59 @@ +function _usingCtx() { + var r = "function" == typeof SuppressedError ? SuppressedError : function (r, e) { + var n = Error(); + return n.name = "SuppressedError", n.error = r, n.suppressed = e, n; + }, + e = {}, + n = []; + function using(r, e) { + if (null != e) { + if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; + if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o; + if ("function" != typeof o) throw new TypeError("Object is not disposable."); + t && (o = function o() { + try { + t.call(e); + } catch (r) { + return Promise.reject(r); + } + }), n.push({ + v: e, + d: o, + a: r + }); + } else r && n.push({ + d: e, + a: r + }); + return e; + } + return { + e: e, + u: using.bind(null, !1), + a: using.bind(null, !0), + d: function d() { + var o, + t = this.e, + s = 0; + function next() { + for (; o = n.pop();) try { + if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next); + if (o.d) { + var r = o.d.call(o.v); + if (o.a) return s |= 2, Promise.resolve(r).then(next, err); + } else s |= 1; + } catch (r) { + return err(r); + } + if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve(); + if (t !== e) throw t; + } + function err(n) { + return t = t !== e ? new r(n, t) : n, next(); + } + return next(); + } + }; +} +export { _usingCtx as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js new file mode 100644 index 0000000..ffeea5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js @@ -0,0 +1,69 @@ +import OverloadYield from "./OverloadYield.js"; +function _wrapAsyncGenerator(e) { + return function () { + return new AsyncGenerator(e.apply(this, arguments)); + }; +} +function AsyncGenerator(e) { + var r, t; + function resume(r, t) { + try { + var n = e[r](t), + o = n.value, + u = o instanceof OverloadYield; + Promise.resolve(u ? o.v : o).then(function (t) { + if (u) { + var i = "return" === r ? "return" : "next"; + if (!o.k || t.done) return resume(i, t); + t = e[i](t).value; + } + settle(n.done ? "return" : "normal", t); + }, function (e) { + resume("throw", e); + }); + } catch (e) { + settle("throw", e); + } + } + function settle(e, n) { + switch (e) { + case "return": + r.resolve({ + value: n, + done: !0 + }); + break; + case "throw": + r.reject(n); + break; + default: + r.resolve({ + value: n, + done: !1 + }); + } + (r = r.next) ? resume(r.key, r.arg) : t = null; + } + this._invoke = function (e, n) { + return new Promise(function (o, u) { + var i = { + key: e, + arg: n, + resolve: o, + reject: u, + next: null + }; + t ? t = t.next = i : (r = t = i, resume(e, n)); + }); + }, "function" != typeof e["return"] && (this["return"] = void 0); +} +AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { + return this; +}, AsyncGenerator.prototype.next = function (e) { + return this._invoke("next", e); +}, AsyncGenerator.prototype["throw"] = function (e) { + return this._invoke("throw", e); +}, AsyncGenerator.prototype["return"] = function (e) { + return this._invoke("return", e); +}; +export { _wrapAsyncGenerator as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js new file mode 100644 index 0000000..15bf78f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js @@ -0,0 +1,27 @@ +import getPrototypeOf from "./getPrototypeOf.js"; +import setPrototypeOf from "./setPrototypeOf.js"; +import isNativeFunction from "./isNativeFunction.js"; +import construct from "./construct.js"; +function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return _wrapNativeSuper = function _wrapNativeSuper(t) { + if (null === t || !isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return construct(t, arguments, getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), setPrototypeOf(Wrapper, t); + }, _wrapNativeSuper(t); +} +export { _wrapNativeSuper as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js new file mode 100644 index 0000000..ecf821e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js @@ -0,0 +1,51 @@ +import _typeof from "./typeof.js"; +import setPrototypeOf from "./setPrototypeOf.js"; +import inherits from "./inherits.js"; +function _wrapRegExp() { + _wrapRegExp = function _wrapRegExp(e, r) { + return new BabelRegExp(e, void 0, r); + }; + var e = RegExp.prototype, + r = new WeakMap(); + function BabelRegExp(e, t, p) { + var o = RegExp(e, t); + return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype); + } + function buildGroups(e, t) { + var p = r.get(t); + return Object.keys(p).reduce(function (r, t) { + var o = p[t]; + if ("number" == typeof o) r[t] = e[o];else { + for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; + r[t] = e[o[i]]; + } + return r; + }, Object.create(null)); + } + return inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { + var t = e.exec.call(this, r); + if (t) { + t.groups = buildGroups(t, this); + var p = t.indices; + p && (p.groups = buildGroups(p, this)); + } + return t; + }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { + if ("string" == typeof p) { + var o = r.get(this); + return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { + var t = o[r]; + return "$" + (Array.isArray(t) ? t.join("$") : t); + })); + } + if ("function" == typeof p) { + var i = this; + return e[Symbol.replace].call(this, t, function () { + var e = arguments; + return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); + }); + } + return e[Symbol.replace].call(this, t, p); + }, _wrapRegExp.apply(this, arguments); +} +export { _wrapRegExp as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js new file mode 100644 index 0000000..250c286 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js @@ -0,0 +1,4 @@ +function _writeOnlyError(r) { + throw new TypeError('"' + r + '" is write-only'); +} +export { _writeOnlyError as default }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/extends.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/extends.js new file mode 100644 index 0000000..eee4a1f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/extends.js @@ -0,0 +1,10 @@ +function _extends() { + return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) { + for (var e = 1; e < arguments.length; e++) { + var t = arguments[e]; + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); + } + return n; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments); +} +module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/get.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/get.js new file mode 100644 index 0000000..15428de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/get.js @@ -0,0 +1,11 @@ +var superPropBase = require("./superPropBase.js"); +function _get() { + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); +} +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/getPrototypeOf.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/getPrototypeOf.js new file mode 100644 index 0000000..9070748 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/getPrototypeOf.js @@ -0,0 +1,6 @@ +function _getPrototypeOf(t) { + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); +} +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/identity.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/identity.js new file mode 100644 index 0000000..54de5b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/identity.js @@ -0,0 +1,4 @@ +function _identity(t) { + return t; +} +module.exports = _identity, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/importDeferProxy.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/importDeferProxy.js new file mode 100644 index 0000000..cffaae6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/importDeferProxy.js @@ -0,0 +1,27 @@ +function _importDeferProxy(e) { + var t = null, + constValue = function constValue(e) { + return function () { + return e; + }; + }, + proxy = function proxy(r) { + return function (n, o, f) { + return null === t && (t = e()), r(t, o, f); + }; + }; + return new Proxy({}, { + defineProperty: constValue(!1), + deleteProperty: constValue(!1), + get: proxy(Reflect.get), + getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor), + getPrototypeOf: constValue(null), + isExtensible: constValue(!1), + has: proxy(Reflect.has), + ownKeys: proxy(Reflect.ownKeys), + preventExtensions: constValue(!0), + set: constValue(!1), + setPrototypeOf: constValue(!1) + }); +} +module.exports = _importDeferProxy, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inherits.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inherits.js new file mode 100644 index 0000000..715a78e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inherits.js @@ -0,0 +1,14 @@ +var setPrototypeOf = require("./setPrototypeOf.js"); +function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && setPrototypeOf(t, e); +} +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inheritsLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inheritsLoose.js new file mode 100644 index 0000000..a27baf0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/inheritsLoose.js @@ -0,0 +1,5 @@ +var setPrototypeOf = require("./setPrototypeOf.js"); +function _inheritsLoose(t, o) { + t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o); +} +module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerDefineProperty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerDefineProperty.js new file mode 100644 index 0000000..f9fa317 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerDefineProperty.js @@ -0,0 +1,9 @@ +function _initializerDefineProperty(e, i, r, l) { + r && Object.defineProperty(e, i, { + enumerable: r.enumerable, + configurable: r.configurable, + writable: r.writable, + value: r.initializer ? r.initializer.call(l) : void 0 + }); +} +module.exports = _initializerDefineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerWarningHelper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerWarningHelper.js new file mode 100644 index 0000000..e14ce59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/initializerWarningHelper.js @@ -0,0 +1,4 @@ +function _initializerWarningHelper(r, e) { + throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); +} +module.exports = _initializerWarningHelper, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/instanceof.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/instanceof.js new file mode 100644 index 0000000..9952301 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/instanceof.js @@ -0,0 +1,4 @@ +function _instanceof(n, e) { + return null != e && "undefined" != typeof Symbol && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](n) : n instanceof e; +} +module.exports = _instanceof, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireDefault.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireDefault.js new file mode 100644 index 0000000..6944715 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireDefault.js @@ -0,0 +1,6 @@ +function _interopRequireDefault(e) { + return e && e.__esModule ? e : { + "default": e + }; +} +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireWildcard.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireWildcard.js new file mode 100644 index 0000000..41411cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/interopRequireWildcard.js @@ -0,0 +1,27 @@ +var _typeof = require("./typeof.js")["default"]; +function _getRequireWildcardCache(e) { + if ("function" != typeof WeakMap) return null; + var r = new WeakMap(), + t = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { + return e ? t : r; + })(e); +} +function _interopRequireWildcard(e, r) { + if (!r && e && e.__esModule) return e; + if (null === e || "object" != _typeof(e) && "function" != typeof e) return { + "default": e + }; + var t = _getRequireWildcardCache(r); + if (t && t.has(e)) return t.get(e); + var n = { + __proto__: null + }, + a = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { + var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; + i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; + } + return n["default"] = e, t && t.set(e, n), n; +} +module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeFunction.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeFunction.js new file mode 100644 index 0000000..f0eb49e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeFunction.js @@ -0,0 +1,8 @@ +function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } +} +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js new file mode 100644 index 0000000..b677e10 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js @@ -0,0 +1,9 @@ +function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() { + return !!t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); +} +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArray.js new file mode 100644 index 0000000..c839a32 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArray.js @@ -0,0 +1,4 @@ +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js new file mode 100644 index 0000000..2671778 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js @@ -0,0 +1,28 @@ +function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/jsx.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/jsx.js new file mode 100644 index 0000000..3415eea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/jsx.js @@ -0,0 +1,22 @@ +var REACT_ELEMENT_TYPE; +function _createRawReactElement(e, r, E, l) { + REACT_ELEMENT_TYPE || (REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol["for"] && Symbol["for"]("react.element") || 60103); + var o = e && e.defaultProps, + n = arguments.length - 3; + if (r || 0 === n || (r = { + children: void 0 + }), 1 === n) r.children = l;else if (n > 1) { + for (var t = Array(n), f = 0; f < n; f++) t[f] = arguments[f + 3]; + r.children = t; + } + if (r && o) for (var i in o) void 0 === r[i] && (r[i] = o[i]);else r || (r = o || {}); + return { + $$typeof: REACT_ELEMENT_TYPE, + type: e, + key: void 0 === E ? null : "" + E, + ref: null, + props: r, + _owner: null + }; +} +module.exports = _createRawReactElement, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/maybeArrayLike.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/maybeArrayLike.js new file mode 100644 index 0000000..9873cc7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/maybeArrayLike.js @@ -0,0 +1,9 @@ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _maybeArrayLike(r, a, e) { + if (a && !Array.isArray(a) && "number" == typeof a.length) { + var y = a.length; + return arrayLikeToArray(a, void 0 !== e && e < y ? e : y); + } + return r(a, e); +} +module.exports = _maybeArrayLike, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/newArrowCheck.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/newArrowCheck.js new file mode 100644 index 0000000..8e74d99 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/newArrowCheck.js @@ -0,0 +1,4 @@ +function _newArrowCheck(n, r) { + if (n !== r) throw new TypeError("Cannot instantiate an arrow function"); +} +module.exports = _newArrowCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableRest.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableRest.js new file mode 100644 index 0000000..95265ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableRest.js @@ -0,0 +1,4 @@ +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableSpread.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableSpread.js new file mode 100644 index 0000000..3fcf23f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nonIterableSpread.js @@ -0,0 +1,4 @@ +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nullishReceiverError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nullishReceiverError.js new file mode 100644 index 0000000..970e023 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/nullishReceiverError.js @@ -0,0 +1,4 @@ +function _nullishReceiverError(r) { + throw new TypeError("Cannot set property of null or undefined."); +} +module.exports = _nullishReceiverError, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js new file mode 100644 index 0000000..9f62a1b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js @@ -0,0 +1,4 @@ +function _objectDestructuringEmpty(t) { + if (null == t) throw new TypeError("Cannot destructure " + t); +} +module.exports = _objectDestructuringEmpty, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread.js new file mode 100644 index 0000000..a367643 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread.js @@ -0,0 +1,14 @@ +var defineProperty = require("./defineProperty.js"); +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? Object(arguments[r]) : {}, + o = Object.keys(t); + "function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), o.forEach(function (r) { + defineProperty(e, r, t[r]); + }); + } + return e; +} +module.exports = _objectSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread2.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread2.js new file mode 100644 index 0000000..4f3b9fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectSpread2.js @@ -0,0 +1,23 @@ +var defineProperty = require("./defineProperty.js"); +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; +} +module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutProperties.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutProperties.js new file mode 100644 index 0000000..6482b98 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutProperties.js @@ -0,0 +1,13 @@ +var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js"); +function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, + r, + i = objectWithoutPropertiesLoose(e, t); + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); + } + return i; +} +module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js new file mode 100644 index 0000000..2465e3b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js @@ -0,0 +1,10 @@ +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; +} +module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js new file mode 100644 index 0000000..06e6e6d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js @@ -0,0 +1,8 @@ +var _typeof = require("./typeof.js")["default"]; +var assertThisInitialized = require("./assertThisInitialized.js"); +function _possibleConstructorReturn(t, e) { + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return assertThisInitialized(t); +} +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/readOnlyError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/readOnlyError.js new file mode 100644 index 0000000..1bf3e09 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/readOnlyError.js @@ -0,0 +1,4 @@ +function _readOnlyError(r) { + throw new TypeError('"' + r + '" is read-only'); +} +module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/regeneratorRuntime.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/regeneratorRuntime.js new file mode 100644 index 0000000..f33e494 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/regeneratorRuntime.js @@ -0,0 +1,304 @@ +var _typeof = require("./typeof.js")["default"]; +function _regeneratorRuntime() { + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/set.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/set.js new file mode 100644 index 0000000..6421470 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/set.js @@ -0,0 +1,22 @@ +var superPropBase = require("./superPropBase.js"); +var defineProperty = require("./defineProperty.js"); +function set(e, r, t, o) { + return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { + var f, + i = superPropBase(e, r); + if (i) { + if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; + if (!f.writable) return !1; + } + if (f = Object.getOwnPropertyDescriptor(o, r)) { + if (!f.writable) return !1; + f.value = t, Object.defineProperty(o, r, f); + } else defineProperty(o, r, t); + return !0; + }, set(e, r, t, o); +} +function _set(e, r, t, o, f) { + if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); + return t; +} +module.exports = _set, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setFunctionName.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setFunctionName.js new file mode 100644 index 0000000..9664076 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setFunctionName.js @@ -0,0 +1,12 @@ +var _typeof = require("./typeof.js")["default"]; +function setFunctionName(e, t, n) { + "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); + try { + Object.defineProperty(e, "name", { + configurable: !0, + value: n ? n + " " + t : t + }); + } catch (e) {} + return e; +} +module.exports = setFunctionName, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setPrototypeOf.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setPrototypeOf.js new file mode 100644 index 0000000..7d991ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/setPrototypeOf.js @@ -0,0 +1,6 @@ +function _setPrototypeOf(t, e) { + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); +} +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js new file mode 100644 index 0000000..2aed548 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js @@ -0,0 +1,7 @@ +function _skipFirstGeneratorNext(t) { + return function () { + var r = t.apply(this, arguments); + return r.next(), r; + }; +} +module.exports = _skipFirstGeneratorNext, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/slicedToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/slicedToArray.js new file mode 100644 index 0000000..3d752c4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/slicedToArray.js @@ -0,0 +1,8 @@ +var arrayWithHoles = require("./arrayWithHoles.js"); +var iterableToArrayLimit = require("./iterableToArrayLimit.js"); +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var nonIterableRest = require("./nonIterableRest.js"); +function _slicedToArray(r, e) { + return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); +} +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropBase.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropBase.js new file mode 100644 index 0000000..5cad459 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropBase.js @@ -0,0 +1,6 @@ +var getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); + return t; +} +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropGet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropGet.js new file mode 100644 index 0000000..a2b4a5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropGet.js @@ -0,0 +1,9 @@ +var get = require("./get.js"); +var getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropertyGet(t, e, o, r) { + var p = get(getPrototypeOf(1 & r ? t.prototype : t), e, o); + return 2 & r && "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; +} +module.exports = _superPropertyGet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropSet.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropSet.js new file mode 100644 index 0000000..e8494e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/superPropSet.js @@ -0,0 +1,6 @@ +var set = require("./set.js"); +var getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropertySet(t, e, o, r, p, f) { + return set(getPrototypeOf(f ? t.prototype : t), e, o, r, p); +} +module.exports = _superPropertySet, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js new file mode 100644 index 0000000..38d6065 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js @@ -0,0 +1,8 @@ +function _taggedTemplateLiteral(e, t) { + return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { + raw: { + value: Object.freeze(t) + } + })); +} +module.exports = _taggedTemplateLiteral, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js new file mode 100644 index 0000000..2f8c146 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js @@ -0,0 +1,4 @@ +function _taggedTemplateLiteralLoose(e, t) { + return t || (t = e.slice(0)), e.raw = t, e; +} +module.exports = _taggedTemplateLiteralLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/tdz.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/tdz.js new file mode 100644 index 0000000..c66f476 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/tdz.js @@ -0,0 +1,4 @@ +function _tdzError(e) { + throw new ReferenceError(e + " is not defined - temporal dead zone"); +} +module.exports = _tdzError, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalRef.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalRef.js new file mode 100644 index 0000000..54c9190 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalRef.js @@ -0,0 +1,6 @@ +var temporalUndefined = require("./temporalUndefined.js"); +var tdz = require("./tdz.js"); +function _temporalRef(r, e) { + return r === temporalUndefined ? tdz(e) : r; +} +module.exports = _temporalRef, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalUndefined.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalUndefined.js new file mode 100644 index 0000000..f8def80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/temporalUndefined.js @@ -0,0 +1,2 @@ +function _temporalUndefined() {} +module.exports = _temporalUndefined, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toArray.js new file mode 100644 index 0000000..2be1d2b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toArray.js @@ -0,0 +1,8 @@ +var arrayWithHoles = require("./arrayWithHoles.js"); +var iterableToArray = require("./iterableToArray.js"); +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var nonIterableRest = require("./nonIterableRest.js"); +function _toArray(r) { + return arrayWithHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableRest(); +} +module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toConsumableArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toConsumableArray.js new file mode 100644 index 0000000..698f9c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toConsumableArray.js @@ -0,0 +1,8 @@ +var arrayWithoutHoles = require("./arrayWithoutHoles.js"); +var iterableToArray = require("./iterableToArray.js"); +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var nonIterableSpread = require("./nonIterableSpread.js"); +function _toConsumableArray(r) { + return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread(); +} +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPrimitive.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPrimitive.js new file mode 100644 index 0000000..ef9d249 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPrimitive.js @@ -0,0 +1,12 @@ +var _typeof = require("./typeof.js")["default"]; +function toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPropertyKey.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPropertyKey.js new file mode 100644 index 0000000..3ca3d4f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toPropertyKey.js @@ -0,0 +1,7 @@ +var _typeof = require("./typeof.js")["default"]; +var toPrimitive = require("./toPrimitive.js"); +function toPropertyKey(t) { + var i = toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toSetter.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toSetter.js new file mode 100644 index 0000000..e0012a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/toSetter.js @@ -0,0 +1,10 @@ +function _toSetter(t, e, n) { + e || (e = []); + var r = e.length++; + return Object.defineProperty({}, "_", { + set: function set(o) { + e[r] = o, t.apply(n, e); + } + }); +} +module.exports = _toSetter, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/typeof.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/typeof.js new file mode 100644 index 0000000..b6fbfaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/typeof.js @@ -0,0 +1,10 @@ +function _typeof(o) { + "@babel/helpers - typeof"; + + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); +} +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js new file mode 100644 index 0000000..8fb1a71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js @@ -0,0 +1,9 @@ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; + } +} +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/using.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/using.js new file mode 100644 index 0000000..37c79e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/using.js @@ -0,0 +1,12 @@ +function _using(o, n, e) { + if (null == n) return n; + if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + if (e) var r = n[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; + if (null == r && (r = n[Symbol.dispose || Symbol["for"]("Symbol.dispose")]), "function" != typeof r) throw new TypeError("Property [Symbol.dispose] is not a function."); + return o.push({ + v: n, + d: r, + a: e + }), n; +} +module.exports = _using, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/usingCtx.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/usingCtx.js new file mode 100644 index 0000000..652ab15 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/usingCtx.js @@ -0,0 +1,59 @@ +function _usingCtx() { + var r = "function" == typeof SuppressedError ? SuppressedError : function (r, e) { + var n = Error(); + return n.name = "SuppressedError", n.error = r, n.suppressed = e, n; + }, + e = {}, + n = []; + function using(r, e) { + if (null != e) { + if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; + if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o; + if ("function" != typeof o) throw new TypeError("Object is not disposable."); + t && (o = function o() { + try { + t.call(e); + } catch (r) { + return Promise.reject(r); + } + }), n.push({ + v: e, + d: o, + a: r + }); + } else r && n.push({ + d: e, + a: r + }); + return e; + } + return { + e: e, + u: using.bind(null, !1), + a: using.bind(null, !0), + d: function d() { + var o, + t = this.e, + s = 0; + function next() { + for (; o = n.pop();) try { + if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next); + if (o.d) { + var r = o.d.call(o.v); + if (o.a) return s |= 2, Promise.resolve(r).then(next, err); + } else s |= 1; + } catch (r) { + return err(r); + } + if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve(); + if (t !== e) throw t; + } + function err(n) { + return t = t !== e ? new r(n, t) : n, next(); + } + return next(); + } + }; +} +module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js new file mode 100644 index 0000000..b818e2e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js @@ -0,0 +1,69 @@ +var OverloadYield = require("./OverloadYield.js"); +function _wrapAsyncGenerator(e) { + return function () { + return new AsyncGenerator(e.apply(this, arguments)); + }; +} +function AsyncGenerator(e) { + var r, t; + function resume(r, t) { + try { + var n = e[r](t), + o = n.value, + u = o instanceof OverloadYield; + Promise.resolve(u ? o.v : o).then(function (t) { + if (u) { + var i = "return" === r ? "return" : "next"; + if (!o.k || t.done) return resume(i, t); + t = e[i](t).value; + } + settle(n.done ? "return" : "normal", t); + }, function (e) { + resume("throw", e); + }); + } catch (e) { + settle("throw", e); + } + } + function settle(e, n) { + switch (e) { + case "return": + r.resolve({ + value: n, + done: !0 + }); + break; + case "throw": + r.reject(n); + break; + default: + r.resolve({ + value: n, + done: !1 + }); + } + (r = r.next) ? resume(r.key, r.arg) : t = null; + } + this._invoke = function (e, n) { + return new Promise(function (o, u) { + var i = { + key: e, + arg: n, + resolve: o, + reject: u, + next: null + }; + t ? t = t.next = i : (r = t = i, resume(e, n)); + }); + }, "function" != typeof e["return"] && (this["return"] = void 0); +} +AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { + return this; +}, AsyncGenerator.prototype.next = function (e) { + return this._invoke("next", e); +}, AsyncGenerator.prototype["throw"] = function (e) { + return this._invoke("throw", e); +}, AsyncGenerator.prototype["return"] = function (e) { + return this._invoke("return", e); +}; +module.exports = _wrapAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapNativeSuper.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapNativeSuper.js new file mode 100644 index 0000000..acd87ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapNativeSuper.js @@ -0,0 +1,27 @@ +var getPrototypeOf = require("./getPrototypeOf.js"); +var setPrototypeOf = require("./setPrototypeOf.js"); +var isNativeFunction = require("./isNativeFunction.js"); +var construct = require("./construct.js"); +function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) { + if (null === t || !isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return construct(t, arguments, getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), setPrototypeOf(Wrapper, t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t); +} +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapRegExp.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapRegExp.js new file mode 100644 index 0000000..c527168 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/wrapRegExp.js @@ -0,0 +1,51 @@ +var _typeof = require("./typeof.js")["default"]; +var setPrototypeOf = require("./setPrototypeOf.js"); +var inherits = require("./inherits.js"); +function _wrapRegExp() { + module.exports = _wrapRegExp = function _wrapRegExp(e, r) { + return new BabelRegExp(e, void 0, r); + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + var e = RegExp.prototype, + r = new WeakMap(); + function BabelRegExp(e, t, p) { + var o = RegExp(e, t); + return r.set(o, p || r.get(e)), setPrototypeOf(o, BabelRegExp.prototype); + } + function buildGroups(e, t) { + var p = r.get(t); + return Object.keys(p).reduce(function (r, t) { + var o = p[t]; + if ("number" == typeof o) r[t] = e[o];else { + for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; + r[t] = e[o[i]]; + } + return r; + }, Object.create(null)); + } + return inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { + var t = e.exec.call(this, r); + if (t) { + t.groups = buildGroups(t, this); + var p = t.indices; + p && (p.groups = buildGroups(p, this)); + } + return t; + }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { + if ("string" == typeof p) { + var o = r.get(this); + return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { + var t = o[r]; + return "$" + (Array.isArray(t) ? t.join("$") : t); + })); + } + if ("function" == typeof p) { + var i = this; + return e[Symbol.replace].call(this, t, function () { + var e = arguments; + return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); + }); + } + return e[Symbol.replace].call(this, t, p); + }, _wrapRegExp.apply(this, arguments); +} +module.exports = _wrapRegExp, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/writeOnlyError.js b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/writeOnlyError.js new file mode 100644 index 0000000..c98ee82 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/helpers/writeOnlyError.js @@ -0,0 +1,4 @@ +function _writeOnlyError(r) { + throw new TypeError('"' + r + '" is write-only'); +} +module.exports = _writeOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/package.json b/24_10_22_faktorialis/node_modules/@babel/runtime/package.json new file mode 100644 index 0000000..96390f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/package.json @@ -0,0 +1,1056 @@ +{ + "name": "@babel/runtime", + "version": "7.25.7", + "description": "babel's modular runtime helpers", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-runtime" + }, + "homepage": "https://babel.dev/docs/en/next/babel-runtime", + "author": "The Babel Team (https://babel.dev/team)", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "exports": { + "./helpers/OverloadYield": [ + { + "node": "./helpers/OverloadYield.js", + "import": "./helpers/esm/OverloadYield.js", + "default": "./helpers/OverloadYield.js" + }, + "./helpers/OverloadYield.js" + ], + "./helpers/esm/OverloadYield": "./helpers/esm/OverloadYield.js", + "./helpers/applyDecoratedDescriptor": [ + { + "node": "./helpers/applyDecoratedDescriptor.js", + "import": "./helpers/esm/applyDecoratedDescriptor.js", + "default": "./helpers/applyDecoratedDescriptor.js" + }, + "./helpers/applyDecoratedDescriptor.js" + ], + "./helpers/esm/applyDecoratedDescriptor": "./helpers/esm/applyDecoratedDescriptor.js", + "./helpers/applyDecs2311": [ + { + "node": "./helpers/applyDecs2311.js", + "import": "./helpers/esm/applyDecs2311.js", + "default": "./helpers/applyDecs2311.js" + }, + "./helpers/applyDecs2311.js" + ], + "./helpers/esm/applyDecs2311": "./helpers/esm/applyDecs2311.js", + "./helpers/arrayLikeToArray": [ + { + "node": "./helpers/arrayLikeToArray.js", + "import": "./helpers/esm/arrayLikeToArray.js", + "default": "./helpers/arrayLikeToArray.js" + }, + "./helpers/arrayLikeToArray.js" + ], + "./helpers/esm/arrayLikeToArray": "./helpers/esm/arrayLikeToArray.js", + "./helpers/arrayWithHoles": [ + { + "node": "./helpers/arrayWithHoles.js", + "import": "./helpers/esm/arrayWithHoles.js", + "default": "./helpers/arrayWithHoles.js" + }, + "./helpers/arrayWithHoles.js" + ], + "./helpers/esm/arrayWithHoles": "./helpers/esm/arrayWithHoles.js", + "./helpers/arrayWithoutHoles": [ + { + "node": "./helpers/arrayWithoutHoles.js", + "import": "./helpers/esm/arrayWithoutHoles.js", + "default": "./helpers/arrayWithoutHoles.js" + }, + "./helpers/arrayWithoutHoles.js" + ], + "./helpers/esm/arrayWithoutHoles": "./helpers/esm/arrayWithoutHoles.js", + "./helpers/assertClassBrand": [ + { + "node": "./helpers/assertClassBrand.js", + "import": "./helpers/esm/assertClassBrand.js", + "default": "./helpers/assertClassBrand.js" + }, + "./helpers/assertClassBrand.js" + ], + "./helpers/esm/assertClassBrand": "./helpers/esm/assertClassBrand.js", + "./helpers/assertThisInitialized": [ + { + "node": "./helpers/assertThisInitialized.js", + "import": "./helpers/esm/assertThisInitialized.js", + "default": "./helpers/assertThisInitialized.js" + }, + "./helpers/assertThisInitialized.js" + ], + "./helpers/esm/assertThisInitialized": "./helpers/esm/assertThisInitialized.js", + "./helpers/asyncGeneratorDelegate": [ + { + "node": "./helpers/asyncGeneratorDelegate.js", + "import": "./helpers/esm/asyncGeneratorDelegate.js", + "default": "./helpers/asyncGeneratorDelegate.js" + }, + "./helpers/asyncGeneratorDelegate.js" + ], + "./helpers/esm/asyncGeneratorDelegate": "./helpers/esm/asyncGeneratorDelegate.js", + "./helpers/asyncIterator": [ + { + "node": "./helpers/asyncIterator.js", + "import": "./helpers/esm/asyncIterator.js", + "default": "./helpers/asyncIterator.js" + }, + "./helpers/asyncIterator.js" + ], + "./helpers/esm/asyncIterator": "./helpers/esm/asyncIterator.js", + "./helpers/asyncToGenerator": [ + { + "node": "./helpers/asyncToGenerator.js", + "import": "./helpers/esm/asyncToGenerator.js", + "default": "./helpers/asyncToGenerator.js" + }, + "./helpers/asyncToGenerator.js" + ], + "./helpers/esm/asyncToGenerator": "./helpers/esm/asyncToGenerator.js", + "./helpers/awaitAsyncGenerator": [ + { + "node": "./helpers/awaitAsyncGenerator.js", + "import": "./helpers/esm/awaitAsyncGenerator.js", + "default": "./helpers/awaitAsyncGenerator.js" + }, + "./helpers/awaitAsyncGenerator.js" + ], + "./helpers/esm/awaitAsyncGenerator": "./helpers/esm/awaitAsyncGenerator.js", + "./helpers/callSuper": [ + { + "node": "./helpers/callSuper.js", + "import": "./helpers/esm/callSuper.js", + "default": "./helpers/callSuper.js" + }, + "./helpers/callSuper.js" + ], + "./helpers/esm/callSuper": "./helpers/esm/callSuper.js", + "./helpers/checkInRHS": [ + { + "node": "./helpers/checkInRHS.js", + "import": "./helpers/esm/checkInRHS.js", + "default": "./helpers/checkInRHS.js" + }, + "./helpers/checkInRHS.js" + ], + "./helpers/esm/checkInRHS": "./helpers/esm/checkInRHS.js", + "./helpers/checkPrivateRedeclaration": [ + { + "node": "./helpers/checkPrivateRedeclaration.js", + "import": "./helpers/esm/checkPrivateRedeclaration.js", + "default": "./helpers/checkPrivateRedeclaration.js" + }, + "./helpers/checkPrivateRedeclaration.js" + ], + "./helpers/esm/checkPrivateRedeclaration": "./helpers/esm/checkPrivateRedeclaration.js", + "./helpers/classCallCheck": [ + { + "node": "./helpers/classCallCheck.js", + "import": "./helpers/esm/classCallCheck.js", + "default": "./helpers/classCallCheck.js" + }, + "./helpers/classCallCheck.js" + ], + "./helpers/esm/classCallCheck": "./helpers/esm/classCallCheck.js", + "./helpers/classNameTDZError": [ + { + "node": "./helpers/classNameTDZError.js", + "import": "./helpers/esm/classNameTDZError.js", + "default": "./helpers/classNameTDZError.js" + }, + "./helpers/classNameTDZError.js" + ], + "./helpers/esm/classNameTDZError": "./helpers/esm/classNameTDZError.js", + "./helpers/classPrivateFieldGet2": [ + { + "node": "./helpers/classPrivateFieldGet2.js", + "import": "./helpers/esm/classPrivateFieldGet2.js", + "default": "./helpers/classPrivateFieldGet2.js" + }, + "./helpers/classPrivateFieldGet2.js" + ], + "./helpers/esm/classPrivateFieldGet2": "./helpers/esm/classPrivateFieldGet2.js", + "./helpers/classPrivateFieldInitSpec": [ + { + "node": "./helpers/classPrivateFieldInitSpec.js", + "import": "./helpers/esm/classPrivateFieldInitSpec.js", + "default": "./helpers/classPrivateFieldInitSpec.js" + }, + "./helpers/classPrivateFieldInitSpec.js" + ], + "./helpers/esm/classPrivateFieldInitSpec": "./helpers/esm/classPrivateFieldInitSpec.js", + "./helpers/classPrivateFieldLooseBase": [ + { + "node": "./helpers/classPrivateFieldLooseBase.js", + "import": "./helpers/esm/classPrivateFieldLooseBase.js", + "default": "./helpers/classPrivateFieldLooseBase.js" + }, + "./helpers/classPrivateFieldLooseBase.js" + ], + "./helpers/esm/classPrivateFieldLooseBase": "./helpers/esm/classPrivateFieldLooseBase.js", + "./helpers/classPrivateFieldLooseKey": [ + { + "node": "./helpers/classPrivateFieldLooseKey.js", + "import": "./helpers/esm/classPrivateFieldLooseKey.js", + "default": "./helpers/classPrivateFieldLooseKey.js" + }, + "./helpers/classPrivateFieldLooseKey.js" + ], + "./helpers/esm/classPrivateFieldLooseKey": "./helpers/esm/classPrivateFieldLooseKey.js", + "./helpers/classPrivateFieldSet2": [ + { + "node": "./helpers/classPrivateFieldSet2.js", + "import": "./helpers/esm/classPrivateFieldSet2.js", + "default": "./helpers/classPrivateFieldSet2.js" + }, + "./helpers/classPrivateFieldSet2.js" + ], + "./helpers/esm/classPrivateFieldSet2": "./helpers/esm/classPrivateFieldSet2.js", + "./helpers/classPrivateGetter": [ + { + "node": "./helpers/classPrivateGetter.js", + "import": "./helpers/esm/classPrivateGetter.js", + "default": "./helpers/classPrivateGetter.js" + }, + "./helpers/classPrivateGetter.js" + ], + "./helpers/esm/classPrivateGetter": "./helpers/esm/classPrivateGetter.js", + "./helpers/classPrivateMethodInitSpec": [ + { + "node": "./helpers/classPrivateMethodInitSpec.js", + "import": "./helpers/esm/classPrivateMethodInitSpec.js", + "default": "./helpers/classPrivateMethodInitSpec.js" + }, + "./helpers/classPrivateMethodInitSpec.js" + ], + "./helpers/esm/classPrivateMethodInitSpec": "./helpers/esm/classPrivateMethodInitSpec.js", + "./helpers/classPrivateSetter": [ + { + "node": "./helpers/classPrivateSetter.js", + "import": "./helpers/esm/classPrivateSetter.js", + "default": "./helpers/classPrivateSetter.js" + }, + "./helpers/classPrivateSetter.js" + ], + "./helpers/esm/classPrivateSetter": "./helpers/esm/classPrivateSetter.js", + "./helpers/classStaticPrivateMethodGet": [ + { + "node": "./helpers/classStaticPrivateMethodGet.js", + "import": "./helpers/esm/classStaticPrivateMethodGet.js", + "default": "./helpers/classStaticPrivateMethodGet.js" + }, + "./helpers/classStaticPrivateMethodGet.js" + ], + "./helpers/esm/classStaticPrivateMethodGet": "./helpers/esm/classStaticPrivateMethodGet.js", + "./helpers/construct": [ + { + "node": "./helpers/construct.js", + "import": "./helpers/esm/construct.js", + "default": "./helpers/construct.js" + }, + "./helpers/construct.js" + ], + "./helpers/esm/construct": "./helpers/esm/construct.js", + "./helpers/createClass": [ + { + "node": "./helpers/createClass.js", + "import": "./helpers/esm/createClass.js", + "default": "./helpers/createClass.js" + }, + "./helpers/createClass.js" + ], + "./helpers/esm/createClass": "./helpers/esm/createClass.js", + "./helpers/createForOfIteratorHelper": [ + { + "node": "./helpers/createForOfIteratorHelper.js", + "import": "./helpers/esm/createForOfIteratorHelper.js", + "default": "./helpers/createForOfIteratorHelper.js" + }, + "./helpers/createForOfIteratorHelper.js" + ], + "./helpers/esm/createForOfIteratorHelper": "./helpers/esm/createForOfIteratorHelper.js", + "./helpers/createForOfIteratorHelperLoose": [ + { + "node": "./helpers/createForOfIteratorHelperLoose.js", + "import": "./helpers/esm/createForOfIteratorHelperLoose.js", + "default": "./helpers/createForOfIteratorHelperLoose.js" + }, + "./helpers/createForOfIteratorHelperLoose.js" + ], + "./helpers/esm/createForOfIteratorHelperLoose": "./helpers/esm/createForOfIteratorHelperLoose.js", + "./helpers/createSuper": [ + { + "node": "./helpers/createSuper.js", + "import": "./helpers/esm/createSuper.js", + "default": "./helpers/createSuper.js" + }, + "./helpers/createSuper.js" + ], + "./helpers/esm/createSuper": "./helpers/esm/createSuper.js", + "./helpers/decorate": [ + { + "node": "./helpers/decorate.js", + "import": "./helpers/esm/decorate.js", + "default": "./helpers/decorate.js" + }, + "./helpers/decorate.js" + ], + "./helpers/esm/decorate": "./helpers/esm/decorate.js", + "./helpers/defaults": [ + { + "node": "./helpers/defaults.js", + "import": "./helpers/esm/defaults.js", + "default": "./helpers/defaults.js" + }, + "./helpers/defaults.js" + ], + "./helpers/esm/defaults": "./helpers/esm/defaults.js", + "./helpers/defineAccessor": [ + { + "node": "./helpers/defineAccessor.js", + "import": "./helpers/esm/defineAccessor.js", + "default": "./helpers/defineAccessor.js" + }, + "./helpers/defineAccessor.js" + ], + "./helpers/esm/defineAccessor": "./helpers/esm/defineAccessor.js", + "./helpers/defineProperty": [ + { + "node": "./helpers/defineProperty.js", + "import": "./helpers/esm/defineProperty.js", + "default": "./helpers/defineProperty.js" + }, + "./helpers/defineProperty.js" + ], + "./helpers/esm/defineProperty": "./helpers/esm/defineProperty.js", + "./helpers/extends": [ + { + "node": "./helpers/extends.js", + "import": "./helpers/esm/extends.js", + "default": "./helpers/extends.js" + }, + "./helpers/extends.js" + ], + "./helpers/esm/extends": "./helpers/esm/extends.js", + "./helpers/get": [ + { + "node": "./helpers/get.js", + "import": "./helpers/esm/get.js", + "default": "./helpers/get.js" + }, + "./helpers/get.js" + ], + "./helpers/esm/get": "./helpers/esm/get.js", + "./helpers/getPrototypeOf": [ + { + "node": "./helpers/getPrototypeOf.js", + "import": "./helpers/esm/getPrototypeOf.js", + "default": "./helpers/getPrototypeOf.js" + }, + "./helpers/getPrototypeOf.js" + ], + "./helpers/esm/getPrototypeOf": "./helpers/esm/getPrototypeOf.js", + "./helpers/identity": [ + { + "node": "./helpers/identity.js", + "import": "./helpers/esm/identity.js", + "default": "./helpers/identity.js" + }, + "./helpers/identity.js" + ], + "./helpers/esm/identity": "./helpers/esm/identity.js", + "./helpers/importDeferProxy": [ + { + "node": "./helpers/importDeferProxy.js", + "import": "./helpers/esm/importDeferProxy.js", + "default": "./helpers/importDeferProxy.js" + }, + "./helpers/importDeferProxy.js" + ], + "./helpers/esm/importDeferProxy": "./helpers/esm/importDeferProxy.js", + "./helpers/inherits": [ + { + "node": "./helpers/inherits.js", + "import": "./helpers/esm/inherits.js", + "default": "./helpers/inherits.js" + }, + "./helpers/inherits.js" + ], + "./helpers/esm/inherits": "./helpers/esm/inherits.js", + "./helpers/inheritsLoose": [ + { + "node": "./helpers/inheritsLoose.js", + "import": "./helpers/esm/inheritsLoose.js", + "default": "./helpers/inheritsLoose.js" + }, + "./helpers/inheritsLoose.js" + ], + "./helpers/esm/inheritsLoose": "./helpers/esm/inheritsLoose.js", + "./helpers/initializerDefineProperty": [ + { + "node": "./helpers/initializerDefineProperty.js", + "import": "./helpers/esm/initializerDefineProperty.js", + "default": "./helpers/initializerDefineProperty.js" + }, + "./helpers/initializerDefineProperty.js" + ], + "./helpers/esm/initializerDefineProperty": "./helpers/esm/initializerDefineProperty.js", + "./helpers/initializerWarningHelper": [ + { + "node": "./helpers/initializerWarningHelper.js", + "import": "./helpers/esm/initializerWarningHelper.js", + "default": "./helpers/initializerWarningHelper.js" + }, + "./helpers/initializerWarningHelper.js" + ], + "./helpers/esm/initializerWarningHelper": "./helpers/esm/initializerWarningHelper.js", + "./helpers/instanceof": [ + { + "node": "./helpers/instanceof.js", + "import": "./helpers/esm/instanceof.js", + "default": "./helpers/instanceof.js" + }, + "./helpers/instanceof.js" + ], + "./helpers/esm/instanceof": "./helpers/esm/instanceof.js", + "./helpers/interopRequireDefault": [ + { + "node": "./helpers/interopRequireDefault.js", + "import": "./helpers/esm/interopRequireDefault.js", + "default": "./helpers/interopRequireDefault.js" + }, + "./helpers/interopRequireDefault.js" + ], + "./helpers/esm/interopRequireDefault": "./helpers/esm/interopRequireDefault.js", + "./helpers/interopRequireWildcard": [ + { + "node": "./helpers/interopRequireWildcard.js", + "import": "./helpers/esm/interopRequireWildcard.js", + "default": "./helpers/interopRequireWildcard.js" + }, + "./helpers/interopRequireWildcard.js" + ], + "./helpers/esm/interopRequireWildcard": "./helpers/esm/interopRequireWildcard.js", + "./helpers/isNativeFunction": [ + { + "node": "./helpers/isNativeFunction.js", + "import": "./helpers/esm/isNativeFunction.js", + "default": "./helpers/isNativeFunction.js" + }, + "./helpers/isNativeFunction.js" + ], + "./helpers/esm/isNativeFunction": "./helpers/esm/isNativeFunction.js", + "./helpers/isNativeReflectConstruct": [ + { + "node": "./helpers/isNativeReflectConstruct.js", + "import": "./helpers/esm/isNativeReflectConstruct.js", + "default": "./helpers/isNativeReflectConstruct.js" + }, + "./helpers/isNativeReflectConstruct.js" + ], + "./helpers/esm/isNativeReflectConstruct": "./helpers/esm/isNativeReflectConstruct.js", + "./helpers/iterableToArray": [ + { + "node": "./helpers/iterableToArray.js", + "import": "./helpers/esm/iterableToArray.js", + "default": "./helpers/iterableToArray.js" + }, + "./helpers/iterableToArray.js" + ], + "./helpers/esm/iterableToArray": "./helpers/esm/iterableToArray.js", + "./helpers/iterableToArrayLimit": [ + { + "node": "./helpers/iterableToArrayLimit.js", + "import": "./helpers/esm/iterableToArrayLimit.js", + "default": "./helpers/iterableToArrayLimit.js" + }, + "./helpers/iterableToArrayLimit.js" + ], + "./helpers/esm/iterableToArrayLimit": "./helpers/esm/iterableToArrayLimit.js", + "./helpers/jsx": [ + { + "node": "./helpers/jsx.js", + "import": "./helpers/esm/jsx.js", + "default": "./helpers/jsx.js" + }, + "./helpers/jsx.js" + ], + "./helpers/esm/jsx": "./helpers/esm/jsx.js", + "./helpers/maybeArrayLike": [ + { + "node": "./helpers/maybeArrayLike.js", + "import": "./helpers/esm/maybeArrayLike.js", + "default": "./helpers/maybeArrayLike.js" + }, + "./helpers/maybeArrayLike.js" + ], + "./helpers/esm/maybeArrayLike": "./helpers/esm/maybeArrayLike.js", + "./helpers/newArrowCheck": [ + { + "node": "./helpers/newArrowCheck.js", + "import": "./helpers/esm/newArrowCheck.js", + "default": "./helpers/newArrowCheck.js" + }, + "./helpers/newArrowCheck.js" + ], + "./helpers/esm/newArrowCheck": "./helpers/esm/newArrowCheck.js", + "./helpers/nonIterableRest": [ + { + "node": "./helpers/nonIterableRest.js", + "import": "./helpers/esm/nonIterableRest.js", + "default": "./helpers/nonIterableRest.js" + }, + "./helpers/nonIterableRest.js" + ], + "./helpers/esm/nonIterableRest": "./helpers/esm/nonIterableRest.js", + "./helpers/nonIterableSpread": [ + { + "node": "./helpers/nonIterableSpread.js", + "import": "./helpers/esm/nonIterableSpread.js", + "default": "./helpers/nonIterableSpread.js" + }, + "./helpers/nonIterableSpread.js" + ], + "./helpers/esm/nonIterableSpread": "./helpers/esm/nonIterableSpread.js", + "./helpers/nullishReceiverError": [ + { + "node": "./helpers/nullishReceiverError.js", + "import": "./helpers/esm/nullishReceiverError.js", + "default": "./helpers/nullishReceiverError.js" + }, + "./helpers/nullishReceiverError.js" + ], + "./helpers/esm/nullishReceiverError": "./helpers/esm/nullishReceiverError.js", + "./helpers/objectDestructuringEmpty": [ + { + "node": "./helpers/objectDestructuringEmpty.js", + "import": "./helpers/esm/objectDestructuringEmpty.js", + "default": "./helpers/objectDestructuringEmpty.js" + }, + "./helpers/objectDestructuringEmpty.js" + ], + "./helpers/esm/objectDestructuringEmpty": "./helpers/esm/objectDestructuringEmpty.js", + "./helpers/objectSpread2": [ + { + "node": "./helpers/objectSpread2.js", + "import": "./helpers/esm/objectSpread2.js", + "default": "./helpers/objectSpread2.js" + }, + "./helpers/objectSpread2.js" + ], + "./helpers/esm/objectSpread2": "./helpers/esm/objectSpread2.js", + "./helpers/objectWithoutProperties": [ + { + "node": "./helpers/objectWithoutProperties.js", + "import": "./helpers/esm/objectWithoutProperties.js", + "default": "./helpers/objectWithoutProperties.js" + }, + "./helpers/objectWithoutProperties.js" + ], + "./helpers/esm/objectWithoutProperties": "./helpers/esm/objectWithoutProperties.js", + "./helpers/objectWithoutPropertiesLoose": [ + { + "node": "./helpers/objectWithoutPropertiesLoose.js", + "import": "./helpers/esm/objectWithoutPropertiesLoose.js", + "default": "./helpers/objectWithoutPropertiesLoose.js" + }, + "./helpers/objectWithoutPropertiesLoose.js" + ], + "./helpers/esm/objectWithoutPropertiesLoose": "./helpers/esm/objectWithoutPropertiesLoose.js", + "./helpers/possibleConstructorReturn": [ + { + "node": "./helpers/possibleConstructorReturn.js", + "import": "./helpers/esm/possibleConstructorReturn.js", + "default": "./helpers/possibleConstructorReturn.js" + }, + "./helpers/possibleConstructorReturn.js" + ], + "./helpers/esm/possibleConstructorReturn": "./helpers/esm/possibleConstructorReturn.js", + "./helpers/readOnlyError": [ + { + "node": "./helpers/readOnlyError.js", + "import": "./helpers/esm/readOnlyError.js", + "default": "./helpers/readOnlyError.js" + }, + "./helpers/readOnlyError.js" + ], + "./helpers/esm/readOnlyError": "./helpers/esm/readOnlyError.js", + "./helpers/regeneratorRuntime": [ + { + "node": "./helpers/regeneratorRuntime.js", + "import": "./helpers/esm/regeneratorRuntime.js", + "default": "./helpers/regeneratorRuntime.js" + }, + "./helpers/regeneratorRuntime.js" + ], + "./helpers/esm/regeneratorRuntime": "./helpers/esm/regeneratorRuntime.js", + "./helpers/set": [ + { + "node": "./helpers/set.js", + "import": "./helpers/esm/set.js", + "default": "./helpers/set.js" + }, + "./helpers/set.js" + ], + "./helpers/esm/set": "./helpers/esm/set.js", + "./helpers/setFunctionName": [ + { + "node": "./helpers/setFunctionName.js", + "import": "./helpers/esm/setFunctionName.js", + "default": "./helpers/setFunctionName.js" + }, + "./helpers/setFunctionName.js" + ], + "./helpers/esm/setFunctionName": "./helpers/esm/setFunctionName.js", + "./helpers/setPrototypeOf": [ + { + "node": "./helpers/setPrototypeOf.js", + "import": "./helpers/esm/setPrototypeOf.js", + "default": "./helpers/setPrototypeOf.js" + }, + "./helpers/setPrototypeOf.js" + ], + "./helpers/esm/setPrototypeOf": "./helpers/esm/setPrototypeOf.js", + "./helpers/skipFirstGeneratorNext": [ + { + "node": "./helpers/skipFirstGeneratorNext.js", + "import": "./helpers/esm/skipFirstGeneratorNext.js", + "default": "./helpers/skipFirstGeneratorNext.js" + }, + "./helpers/skipFirstGeneratorNext.js" + ], + "./helpers/esm/skipFirstGeneratorNext": "./helpers/esm/skipFirstGeneratorNext.js", + "./helpers/slicedToArray": [ + { + "node": "./helpers/slicedToArray.js", + "import": "./helpers/esm/slicedToArray.js", + "default": "./helpers/slicedToArray.js" + }, + "./helpers/slicedToArray.js" + ], + "./helpers/esm/slicedToArray": "./helpers/esm/slicedToArray.js", + "./helpers/superPropBase": [ + { + "node": "./helpers/superPropBase.js", + "import": "./helpers/esm/superPropBase.js", + "default": "./helpers/superPropBase.js" + }, + "./helpers/superPropBase.js" + ], + "./helpers/esm/superPropBase": "./helpers/esm/superPropBase.js", + "./helpers/superPropGet": [ + { + "node": "./helpers/superPropGet.js", + "import": "./helpers/esm/superPropGet.js", + "default": "./helpers/superPropGet.js" + }, + "./helpers/superPropGet.js" + ], + "./helpers/esm/superPropGet": "./helpers/esm/superPropGet.js", + "./helpers/superPropSet": [ + { + "node": "./helpers/superPropSet.js", + "import": "./helpers/esm/superPropSet.js", + "default": "./helpers/superPropSet.js" + }, + "./helpers/superPropSet.js" + ], + "./helpers/esm/superPropSet": "./helpers/esm/superPropSet.js", + "./helpers/taggedTemplateLiteral": [ + { + "node": "./helpers/taggedTemplateLiteral.js", + "import": "./helpers/esm/taggedTemplateLiteral.js", + "default": "./helpers/taggedTemplateLiteral.js" + }, + "./helpers/taggedTemplateLiteral.js" + ], + "./helpers/esm/taggedTemplateLiteral": "./helpers/esm/taggedTemplateLiteral.js", + "./helpers/taggedTemplateLiteralLoose": [ + { + "node": "./helpers/taggedTemplateLiteralLoose.js", + "import": "./helpers/esm/taggedTemplateLiteralLoose.js", + "default": "./helpers/taggedTemplateLiteralLoose.js" + }, + "./helpers/taggedTemplateLiteralLoose.js" + ], + "./helpers/esm/taggedTemplateLiteralLoose": "./helpers/esm/taggedTemplateLiteralLoose.js", + "./helpers/tdz": [ + { + "node": "./helpers/tdz.js", + "import": "./helpers/esm/tdz.js", + "default": "./helpers/tdz.js" + }, + "./helpers/tdz.js" + ], + "./helpers/esm/tdz": "./helpers/esm/tdz.js", + "./helpers/temporalRef": [ + { + "node": "./helpers/temporalRef.js", + "import": "./helpers/esm/temporalRef.js", + "default": "./helpers/temporalRef.js" + }, + "./helpers/temporalRef.js" + ], + "./helpers/esm/temporalRef": "./helpers/esm/temporalRef.js", + "./helpers/temporalUndefined": [ + { + "node": "./helpers/temporalUndefined.js", + "import": "./helpers/esm/temporalUndefined.js", + "default": "./helpers/temporalUndefined.js" + }, + "./helpers/temporalUndefined.js" + ], + "./helpers/esm/temporalUndefined": "./helpers/esm/temporalUndefined.js", + "./helpers/toArray": [ + { + "node": "./helpers/toArray.js", + "import": "./helpers/esm/toArray.js", + "default": "./helpers/toArray.js" + }, + "./helpers/toArray.js" + ], + "./helpers/esm/toArray": "./helpers/esm/toArray.js", + "./helpers/toConsumableArray": [ + { + "node": "./helpers/toConsumableArray.js", + "import": "./helpers/esm/toConsumableArray.js", + "default": "./helpers/toConsumableArray.js" + }, + "./helpers/toConsumableArray.js" + ], + "./helpers/esm/toConsumableArray": "./helpers/esm/toConsumableArray.js", + "./helpers/toPrimitive": [ + { + "node": "./helpers/toPrimitive.js", + "import": "./helpers/esm/toPrimitive.js", + "default": "./helpers/toPrimitive.js" + }, + "./helpers/toPrimitive.js" + ], + "./helpers/esm/toPrimitive": "./helpers/esm/toPrimitive.js", + "./helpers/toPropertyKey": [ + { + "node": "./helpers/toPropertyKey.js", + "import": "./helpers/esm/toPropertyKey.js", + "default": "./helpers/toPropertyKey.js" + }, + "./helpers/toPropertyKey.js" + ], + "./helpers/esm/toPropertyKey": "./helpers/esm/toPropertyKey.js", + "./helpers/toSetter": [ + { + "node": "./helpers/toSetter.js", + "import": "./helpers/esm/toSetter.js", + "default": "./helpers/toSetter.js" + }, + "./helpers/toSetter.js" + ], + "./helpers/esm/toSetter": "./helpers/esm/toSetter.js", + "./helpers/typeof": [ + { + "node": "./helpers/typeof.js", + "import": "./helpers/esm/typeof.js", + "default": "./helpers/typeof.js" + }, + "./helpers/typeof.js" + ], + "./helpers/esm/typeof": "./helpers/esm/typeof.js", + "./helpers/unsupportedIterableToArray": [ + { + "node": "./helpers/unsupportedIterableToArray.js", + "import": "./helpers/esm/unsupportedIterableToArray.js", + "default": "./helpers/unsupportedIterableToArray.js" + }, + "./helpers/unsupportedIterableToArray.js" + ], + "./helpers/esm/unsupportedIterableToArray": "./helpers/esm/unsupportedIterableToArray.js", + "./helpers/usingCtx": [ + { + "node": "./helpers/usingCtx.js", + "import": "./helpers/esm/usingCtx.js", + "default": "./helpers/usingCtx.js" + }, + "./helpers/usingCtx.js" + ], + "./helpers/esm/usingCtx": "./helpers/esm/usingCtx.js", + "./helpers/wrapAsyncGenerator": [ + { + "node": "./helpers/wrapAsyncGenerator.js", + "import": "./helpers/esm/wrapAsyncGenerator.js", + "default": "./helpers/wrapAsyncGenerator.js" + }, + "./helpers/wrapAsyncGenerator.js" + ], + "./helpers/esm/wrapAsyncGenerator": "./helpers/esm/wrapAsyncGenerator.js", + "./helpers/wrapNativeSuper": [ + { + "node": "./helpers/wrapNativeSuper.js", + "import": "./helpers/esm/wrapNativeSuper.js", + "default": "./helpers/wrapNativeSuper.js" + }, + "./helpers/wrapNativeSuper.js" + ], + "./helpers/esm/wrapNativeSuper": "./helpers/esm/wrapNativeSuper.js", + "./helpers/wrapRegExp": [ + { + "node": "./helpers/wrapRegExp.js", + "import": "./helpers/esm/wrapRegExp.js", + "default": "./helpers/wrapRegExp.js" + }, + "./helpers/wrapRegExp.js" + ], + "./helpers/esm/wrapRegExp": "./helpers/esm/wrapRegExp.js", + "./helpers/writeOnlyError": [ + { + "node": "./helpers/writeOnlyError.js", + "import": "./helpers/esm/writeOnlyError.js", + "default": "./helpers/writeOnlyError.js" + }, + "./helpers/writeOnlyError.js" + ], + "./helpers/esm/writeOnlyError": "./helpers/esm/writeOnlyError.js", + "./helpers/AwaitValue": [ + { + "node": "./helpers/AwaitValue.js", + "import": "./helpers/esm/AwaitValue.js", + "default": "./helpers/AwaitValue.js" + }, + "./helpers/AwaitValue.js" + ], + "./helpers/esm/AwaitValue": "./helpers/esm/AwaitValue.js", + "./helpers/applyDecs": [ + { + "node": "./helpers/applyDecs.js", + "import": "./helpers/esm/applyDecs.js", + "default": "./helpers/applyDecs.js" + }, + "./helpers/applyDecs.js" + ], + "./helpers/esm/applyDecs": "./helpers/esm/applyDecs.js", + "./helpers/applyDecs2203": [ + { + "node": "./helpers/applyDecs2203.js", + "import": "./helpers/esm/applyDecs2203.js", + "default": "./helpers/applyDecs2203.js" + }, + "./helpers/applyDecs2203.js" + ], + "./helpers/esm/applyDecs2203": "./helpers/esm/applyDecs2203.js", + "./helpers/applyDecs2203R": [ + { + "node": "./helpers/applyDecs2203R.js", + "import": "./helpers/esm/applyDecs2203R.js", + "default": "./helpers/applyDecs2203R.js" + }, + "./helpers/applyDecs2203R.js" + ], + "./helpers/esm/applyDecs2203R": "./helpers/esm/applyDecs2203R.js", + "./helpers/applyDecs2301": [ + { + "node": "./helpers/applyDecs2301.js", + "import": "./helpers/esm/applyDecs2301.js", + "default": "./helpers/applyDecs2301.js" + }, + "./helpers/applyDecs2301.js" + ], + "./helpers/esm/applyDecs2301": "./helpers/esm/applyDecs2301.js", + "./helpers/applyDecs2305": [ + { + "node": "./helpers/applyDecs2305.js", + "import": "./helpers/esm/applyDecs2305.js", + "default": "./helpers/applyDecs2305.js" + }, + "./helpers/applyDecs2305.js" + ], + "./helpers/esm/applyDecs2305": "./helpers/esm/applyDecs2305.js", + "./helpers/classApplyDescriptorDestructureSet": [ + { + "node": "./helpers/classApplyDescriptorDestructureSet.js", + "import": "./helpers/esm/classApplyDescriptorDestructureSet.js", + "default": "./helpers/classApplyDescriptorDestructureSet.js" + }, + "./helpers/classApplyDescriptorDestructureSet.js" + ], + "./helpers/esm/classApplyDescriptorDestructureSet": "./helpers/esm/classApplyDescriptorDestructureSet.js", + "./helpers/classApplyDescriptorGet": [ + { + "node": "./helpers/classApplyDescriptorGet.js", + "import": "./helpers/esm/classApplyDescriptorGet.js", + "default": "./helpers/classApplyDescriptorGet.js" + }, + "./helpers/classApplyDescriptorGet.js" + ], + "./helpers/esm/classApplyDescriptorGet": "./helpers/esm/classApplyDescriptorGet.js", + "./helpers/classApplyDescriptorSet": [ + { + "node": "./helpers/classApplyDescriptorSet.js", + "import": "./helpers/esm/classApplyDescriptorSet.js", + "default": "./helpers/classApplyDescriptorSet.js" + }, + "./helpers/classApplyDescriptorSet.js" + ], + "./helpers/esm/classApplyDescriptorSet": "./helpers/esm/classApplyDescriptorSet.js", + "./helpers/classCheckPrivateStaticAccess": [ + { + "node": "./helpers/classCheckPrivateStaticAccess.js", + "import": "./helpers/esm/classCheckPrivateStaticAccess.js", + "default": "./helpers/classCheckPrivateStaticAccess.js" + }, + "./helpers/classCheckPrivateStaticAccess.js" + ], + "./helpers/esm/classCheckPrivateStaticAccess": "./helpers/esm/classCheckPrivateStaticAccess.js", + "./helpers/classCheckPrivateStaticFieldDescriptor": [ + { + "node": "./helpers/classCheckPrivateStaticFieldDescriptor.js", + "import": "./helpers/esm/classCheckPrivateStaticFieldDescriptor.js", + "default": "./helpers/classCheckPrivateStaticFieldDescriptor.js" + }, + "./helpers/classCheckPrivateStaticFieldDescriptor.js" + ], + "./helpers/esm/classCheckPrivateStaticFieldDescriptor": "./helpers/esm/classCheckPrivateStaticFieldDescriptor.js", + "./helpers/classExtractFieldDescriptor": [ + { + "node": "./helpers/classExtractFieldDescriptor.js", + "import": "./helpers/esm/classExtractFieldDescriptor.js", + "default": "./helpers/classExtractFieldDescriptor.js" + }, + "./helpers/classExtractFieldDescriptor.js" + ], + "./helpers/esm/classExtractFieldDescriptor": "./helpers/esm/classExtractFieldDescriptor.js", + "./helpers/classPrivateFieldDestructureSet": [ + { + "node": "./helpers/classPrivateFieldDestructureSet.js", + "import": "./helpers/esm/classPrivateFieldDestructureSet.js", + "default": "./helpers/classPrivateFieldDestructureSet.js" + }, + "./helpers/classPrivateFieldDestructureSet.js" + ], + "./helpers/esm/classPrivateFieldDestructureSet": "./helpers/esm/classPrivateFieldDestructureSet.js", + "./helpers/classPrivateFieldGet": [ + { + "node": "./helpers/classPrivateFieldGet.js", + "import": "./helpers/esm/classPrivateFieldGet.js", + "default": "./helpers/classPrivateFieldGet.js" + }, + "./helpers/classPrivateFieldGet.js" + ], + "./helpers/esm/classPrivateFieldGet": "./helpers/esm/classPrivateFieldGet.js", + "./helpers/classPrivateFieldSet": [ + { + "node": "./helpers/classPrivateFieldSet.js", + "import": "./helpers/esm/classPrivateFieldSet.js", + "default": "./helpers/classPrivateFieldSet.js" + }, + "./helpers/classPrivateFieldSet.js" + ], + "./helpers/esm/classPrivateFieldSet": "./helpers/esm/classPrivateFieldSet.js", + "./helpers/classPrivateMethodGet": [ + { + "node": "./helpers/classPrivateMethodGet.js", + "import": "./helpers/esm/classPrivateMethodGet.js", + "default": "./helpers/classPrivateMethodGet.js" + }, + "./helpers/classPrivateMethodGet.js" + ], + "./helpers/esm/classPrivateMethodGet": "./helpers/esm/classPrivateMethodGet.js", + "./helpers/classPrivateMethodSet": [ + { + "node": "./helpers/classPrivateMethodSet.js", + "import": "./helpers/esm/classPrivateMethodSet.js", + "default": "./helpers/classPrivateMethodSet.js" + }, + "./helpers/classPrivateMethodSet.js" + ], + "./helpers/esm/classPrivateMethodSet": "./helpers/esm/classPrivateMethodSet.js", + "./helpers/classStaticPrivateFieldDestructureSet": [ + { + "node": "./helpers/classStaticPrivateFieldDestructureSet.js", + "import": "./helpers/esm/classStaticPrivateFieldDestructureSet.js", + "default": "./helpers/classStaticPrivateFieldDestructureSet.js" + }, + "./helpers/classStaticPrivateFieldDestructureSet.js" + ], + "./helpers/esm/classStaticPrivateFieldDestructureSet": "./helpers/esm/classStaticPrivateFieldDestructureSet.js", + "./helpers/classStaticPrivateFieldSpecGet": [ + { + "node": "./helpers/classStaticPrivateFieldSpecGet.js", + "import": "./helpers/esm/classStaticPrivateFieldSpecGet.js", + "default": "./helpers/classStaticPrivateFieldSpecGet.js" + }, + "./helpers/classStaticPrivateFieldSpecGet.js" + ], + "./helpers/esm/classStaticPrivateFieldSpecGet": "./helpers/esm/classStaticPrivateFieldSpecGet.js", + "./helpers/classStaticPrivateFieldSpecSet": [ + { + "node": "./helpers/classStaticPrivateFieldSpecSet.js", + "import": "./helpers/esm/classStaticPrivateFieldSpecSet.js", + "default": "./helpers/classStaticPrivateFieldSpecSet.js" + }, + "./helpers/classStaticPrivateFieldSpecSet.js" + ], + "./helpers/esm/classStaticPrivateFieldSpecSet": "./helpers/esm/classStaticPrivateFieldSpecSet.js", + "./helpers/classStaticPrivateMethodSet": [ + { + "node": "./helpers/classStaticPrivateMethodSet.js", + "import": "./helpers/esm/classStaticPrivateMethodSet.js", + "default": "./helpers/classStaticPrivateMethodSet.js" + }, + "./helpers/classStaticPrivateMethodSet.js" + ], + "./helpers/esm/classStaticPrivateMethodSet": "./helpers/esm/classStaticPrivateMethodSet.js", + "./helpers/defineEnumerableProperties": [ + { + "node": "./helpers/defineEnumerableProperties.js", + "import": "./helpers/esm/defineEnumerableProperties.js", + "default": "./helpers/defineEnumerableProperties.js" + }, + "./helpers/defineEnumerableProperties.js" + ], + "./helpers/esm/defineEnumerableProperties": "./helpers/esm/defineEnumerableProperties.js", + "./helpers/dispose": [ + { + "node": "./helpers/dispose.js", + "import": "./helpers/esm/dispose.js", + "default": "./helpers/dispose.js" + }, + "./helpers/dispose.js" + ], + "./helpers/esm/dispose": "./helpers/esm/dispose.js", + "./helpers/objectSpread": [ + { + "node": "./helpers/objectSpread.js", + "import": "./helpers/esm/objectSpread.js", + "default": "./helpers/objectSpread.js" + }, + "./helpers/objectSpread.js" + ], + "./helpers/esm/objectSpread": "./helpers/esm/objectSpread.js", + "./helpers/using": [ + { + "node": "./helpers/using.js", + "import": "./helpers/esm/using.js", + "default": "./helpers/using.js" + }, + "./helpers/using.js" + ], + "./helpers/esm/using": "./helpers/esm/using.js", + "./package": "./package.json", + "./package.json": "./package.json", + "./regenerator": "./regenerator/index.js", + "./regenerator/*.js": "./regenerator/*.js", + "./regenerator/": "./regenerator/" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/@babel/runtime/regenerator/index.js b/24_10_22_faktorialis/node_modules/@babel/runtime/regenerator/index.js new file mode 100644 index 0000000..5881357 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/@babel/runtime/regenerator/index.js @@ -0,0 +1,15 @@ +// TODO(Babel 8): Remove this file. + +var runtime = require("../helpers/regeneratorRuntime")(); +module.exports = runtime; + +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} diff --git a/24_10_22_faktorialis/node_modules/complex.js/LICENSE b/24_10_22_faktorialis/node_modules/complex.js/LICENSE new file mode 100644 index 0000000..7ab7efa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Robert Eisele + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/complex.js/README.md b/24_10_22_faktorialis/node_modules/complex.js/README.md new file mode 100644 index 0000000..ceb374e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/README.md @@ -0,0 +1,336 @@ +# Complex.js - ℂ in JavaScript + +[![NPM Package](https://img.shields.io/npm/v/complex.js.svg?style=flat)](https://npmjs.org/package/complex.js "View this project on npm") +[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) + +Complex.js is a well tested JavaScript library to work with [complex number arithmetic](https://raw.org/book/analysis/complex-numbers/) in JavaScript. It implements every elementary complex number manipulation function and the API is intentionally similar to [Fraction.js](https://github.com/rawify/Fraction.js). Furthermore, it's the basis of [Polynomial.js](https://github.com/infusion/Polynomial.js) and [Math.js](https://github.com/josdejong/mathjs). + + +## Examples + + +```js +let Complex = require('complex.js'); + +let c = new Complex("99.3+8i"); +c.mul({re: 3, im: 9}).div(4.9).sub(3, 2); +``` + +A classical use case for complex numbers is solving quadratic equations `ax² + bx + c = 0` for all `a, b, c ∈ ℝ`: + +```js + +function quadraticRoot(a, b, c) { + let sqrt = Complex(b * b - 4 * a * c).sqrt() + let x1 = Complex(-b).add(sqrt).div(2 * a) + let x2 = Complex(-b).sub(sqrt).div(2 * a) + return {x1, x2} +} + +// quadraticRoot(1, 4, 5) -> -2 ± i +``` + +For cubic roots have a look at [RootFinder](https://github.com/rawify/RootFinder.js) which uses Complex.js. + +## Parser + + +Any function (see below) as well as the constructor of the *Complex* class parses its input like this. + +You can pass either Objects, Doubles or Strings. + +### Objects + +```javascript +new Complex({re: real, im: imaginary}); +new Complex({arg: angle, abs: radius}); +new Complex({phi: angle, r: radius}); +new Complex([real, imaginary]); // Vector/Array syntax +``` +If there are other attributes on the passed object, they're not getting preserved and have to be merged manually. + +### Doubles + +```javascript +new Complex(55.4); +``` + +### Strings + +```javascript +new Complex("123.45"); +new Complex("15+3i"); +new Complex("i"); +``` + +### Two arguments + +```javascript +new Complex(3, 2); // 3+2i +``` + +## Attributes + + +Every complex number object exposes its real and imaginary part as attribute `re` and `im`: + +```javascript +let c = new Complex(3, 2); + +console.log("Real part:", c.re); // 3 +console.log("Imaginary part:", c.im); // 2 +``` + +## Functions + + +Complex sign() +--- +Returns the complex sign, defined as the complex number normalized by it's absolute value + +Complex add(n) +--- +Adds another complex number + +Complex sub(n) +--- +Subtracts another complex number + +Complex mul(n) +--- +Multiplies the number with another complex number + +Complex div(n) +--- +Divides the number by another complex number + +Complex pow(exp) +--- +Returns the number raised to the complex exponent (Note: `Complex.ZERO.pow(0) = Complex.ONE` by convention) + +Complex sqrt() +--- +Returns the complex square root of the number + +Complex exp(n) +--- +Returns `e^n` with complex exponent `n`. + +Complex log() +--- +Returns the natural logarithm (base `E`) of the actual complex number + +_Note:_ The logarithm to a different base can be calculated with `z.log().div(Math.log(base))`. + +double abs() +--- +Calculates the magnitude of the complex number + +double arg() +--- +Calculates the angle of the complex number + +Complex inverse() +--- +Calculates the multiplicative inverse of the complex number (1 / z) + +Complex conjugate() +--- +Calculates the conjugate of the complex number (multiplies the imaginary part with -1) + +Complex neg() +--- +Negates the number (multiplies both the real and imaginary part with -1) in order to get the additive inverse + +Complex floor([places=0]) +--- +Floors the complex number parts towards zero + +Complex ceil([places=0]) +--- +Ceils the complex number parts off zero + +Complex round([places=0]) +--- +Rounds the complex number parts + +boolean equals(n) +--- +Checks if both numbers are exactly the same, if both numbers are infinite they +are considered **not** equal. + +boolean isNaN() +--- +Checks if the given number is not a number + +boolean isFinite() +--- +Checks if the given number is finite + +Complex clone() +--- +Returns a new Complex instance with the same real and imaginary properties + +Array toVector() +--- +Returns a Vector of the actual complex number with two components + +String toString() +--- +Returns a string representation of the actual number. As of v1.9.0 the output is a bit more human readable + +```javascript +new Complex(1, 2).toString(); // 1 + 2i +new Complex(0, 1).toString(); // i +new Complex(9, 0).toString(); // 9 +new Complex(1, 1).toString(); // 1 + i +``` + +double valueOf() +--- +Returns the real part of the number if imaginary part is zero. Otherwise `null` + + +## Trigonometric functions + +The following trigonometric functions are defined on Complex.js: + +| Trig | Arcus | Hyperbolic | Area-Hyperbolic | +|------|-------|------------|------------------| +| sin() | asin() | sinh() | asinh() | +| cos() | acos() | cosh() | acosh() | +| tan() | atan() | tanh() | atanh() | +| cot() | acot() | coth() | acoth() | +| sec() | asec() | sech() | asech() | +| csc() | acsc() | csch() | acsch() | + + +## Geometric Equivalence + + +Complex numbers can also be seen as a vector in the 2D space. Here is a simple overview of basic operations and how to implement them with complex.js: + +New vector +--- +```js +let v1 = new Complex(1, 0); +let v2 = new Complex(1, 1); +``` + +Scale vector +--- +```js +scale(v1, factor):= v1.mul(factor) +``` + +Vector norm +--- +```js +norm(v):= v.abs() +``` + +Translate vector +--- +```js +translate(v1, v2):= v1.add(v2) +``` + +Rotate vector around center +--- +```js +rotate(v, angle):= v.mul({abs: 1, arg: angle}) +``` + +Rotate vector around a point +--- +```js +rotate(v, p, angle):= v.sub(p).mul({abs: 1, arg: angle}).add(p) +``` + +Distance to another vector +--- +```js +distance(v1, v2):= v1.sub(v2).abs() +``` + +## Constants + + +Complex.ZERO +--- +A complex zero value (south pole on the Riemann Sphere) + +Complex.ONE +--- +A complex one instance + +Complex.INFINITY +--- +A complex infinity value (north pole on the Riemann Sphere) + +Complex.NAN +--- +A complex NaN value (not on the Riemann Sphere) + +Complex.I +--- +An imaginary number i instance + +Complex.PI +--- +A complex PI instance + +Complex.E +--- +A complex euler number instance + +Complex.EPSILON +--- +A small epsilon value used for `equals()` comparison in order to circumvent double imprecision. + + +## Installation + +Installing complex.js is as easy as cloning this repo or use one of the following command: + + +```bash +npm install complex.js +``` + +## Using Complex.js with the browser + +```html + + +``` + + + +## Coding Style + +As every library I publish, Complex.js is also built to be as small as possible after compressing it with Google Closure Compiler in advanced mode. Thus the coding style orientates a little on maxing-out the compression rate. Please make sure you keep this style if you plan to extend the library. + +## Building the library + +After cloning the Git repository run: + +``` +npm install +npm run build +``` + +## Run a test + +Testing the source against the shipped test suite is as easy as + +``` +npm run test +``` + +## Copyright and Licensing + +Copyright (c) 2024, [Robert Eisele](https://raw.org/) +Licensed under the MIT license. diff --git a/24_10_22_faktorialis/node_modules/complex.js/complex.d.ts b/24_10_22_faktorialis/node_modules/complex.js/complex.d.ts new file mode 100644 index 0000000..37003f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/complex.d.ts @@ -0,0 +1,323 @@ +type AValue = + | Complex + | { im: number; re: number } + | { abs: number; arg: number } + | { r: number; phi: number } + | [number, number] + | string + | number + | null + | undefined; +type BValue = number | undefined; + +export function Complex(a: AValue, b?: BValue): Complex; + +export default Complex; + +/** + * + * This class allows the manipulation of complex numbers. + * You can pass a complex number in different formats. Either as object, double, string or two integer parameters. + * + * Object form + * { re: , im: } + * { arg: , abs: } + * { phi: , r: } + * + * Array / Vector form + * [ real, imaginary ] + * + * Double form + * 99.3 - Single double value + * + * String form + * '23.1337' - Simple real number + * '15+3i' - a simple complex number + * '3-i' - a simple complex number + * + * Example: + * + * var c = new Complex('99.3+8i'); + * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); + * + */ +export class Complex { + re: number; + im: number; + + constructor(a: AValue, b?: BValue); + + /** + * Calculates the sign of a complex number, which is a normalized complex + * + */ + sign(): Complex; + /** + * Adds two complex numbers + * + */ + add(a: AValue, b?: BValue): Complex; + /** + * Subtracts two complex numbers + * + */ + sub(a: AValue, b?: BValue): Complex; + /** + * Multiplies two complex numbers + * + */ + mul(a: AValue, b?: BValue): Complex; + /** + * Divides two complex numbers + * + */ + div(a: AValue, b?: BValue): Complex; + /** + * Calculate the power of two complex numbers + * + */ + pow(a: AValue, b?: BValue): Complex; + /** + * Calculate the complex square root + * + */ + sqrt(): Complex; + /** + * Calculate the complex exponent + * + */ + exp(): Complex; + /** + * Calculate the complex exponent and subtracts one. + * + * This may be more accurate than `Complex(x).exp().sub(1)` if + * `x` is small. + * + */ + expm1(): Complex; + /** + * Calculate the natural log + * + */ + log(): Complex; + /** + * Calculate the magnitude of the complex number + * + */ + abs(): number; + /** + * Calculate the angle of the complex number + * + */ + arg(): number; + /** + * Calculate the sine of the complex number + * + */ + sin(): Complex; + /** + * Calculate the cosine + * + */ + cos(): Complex; + /** + * Calculate the tangent + * + */ + tan(): Complex; + /** + * Calculate the cotangent + * + */ + cot(): Complex; + /** + * Calculate the secant + * + */ + sec(): Complex; + /** + * Calculate the cosecans + * + */ + csc(): Complex; + /** + * Calculate the complex arcus sinus + * + */ + asin(): Complex; + /** + * Calculate the complex arcus cosinus + * + */ + acos(): Complex; + /** + * Calculate the complex arcus tangent + * + */ + atan(): Complex; + /** + * Calculate the complex arcus cotangent + * + */ + acot(): Complex; + /** + * Calculate the complex arcus secant + * + */ + asec(): Complex; + /** + * Calculate the complex arcus cosecans + * + */ + acsc(): Complex; + /** + * Calculate the complex sinh + * + */ + sinh(): Complex; + /** + * Calculate the complex cosh + * + */ + cosh(): Complex; + /** + * Calculate the complex tanh + * + */ + tanh(): Complex; + /** + * Calculate the complex coth + * + */ + coth(): Complex; + /** + * Calculate the complex coth + * + */ + csch(): Complex; + /** + * Calculate the complex sech + * + */ + sech(): Complex; + /** + * Calculate the complex asinh + * + */ + asinh(): Complex; + /** + * Calculate the complex acosh + * + */ + acosh(): Complex; + /** + * Calculate the complex atanh + * + */ + atanh(): Complex; + /** + * Calculate the complex acoth + * + */ + acoth(): Complex; + /** + * Calculate the complex acsch + * + */ + acsch(): Complex; + /** + * Calculate the complex asech + * + */ + asech(): Complex; + /** + * Calculate the complex inverse 1/z + * + */ + inverse(): Complex; + /** + * Returns the complex conjugate + * + */ + conjugate(): Complex; + /** + * Gets the negated complex number + * + */ + neg(): Complex; + /** + * Ceils the actual complex number + * + */ + ceil(places: number): Complex; + /** + * Floors the actual complex number + * + */ + floor(places: number): Complex; + /** + * Ceils the actual complex number + * + */ + round(places: number): Complex; + /** + * Compares two complex numbers + * + * **Note:** new Complex(Infinity).equals(Infinity) === false + * + */ + equals(a: AValue, b?: BValue): boolean; + /** + * Clones the actual object + * + */ + clone(): Complex; + /** + * Gets a string of the actual complex number + * + */ + toString(): string; + /** + * Returns the actual number as a vector + * + */ + toVector(): number[]; + /** + * Returns the actual real value of the current object + * + * @returns {number|null} + */ + valueOf(): number | null; + /** + * Determines whether a complex number is not on the Riemann sphere. + * + */ + isNaN(): boolean; + /** + * Determines whether or not a complex number is at the zero pole of the + * Riemann sphere. + * + */ + isZero(): boolean; + /** + * Determines whether a complex number is not at the infinity pole of the + * Riemann sphere. + * + */ + isFinite(): boolean; + /** + * Determines whether or not a complex number is at the infinity pole of the + * Riemann sphere. + * + */ + isInfinite(): boolean; + + static ZERO: Complex; + static ONE: Complex; + static I: Complex; + static PI: Complex; + static E: Complex; + static INFINITY: Complex; + static NAN: Complex; + static EPSILON: number; +} diff --git a/24_10_22_faktorialis/node_modules/complex.js/dist/complex.js b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.js new file mode 100644 index 0000000..58897b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.js @@ -0,0 +1,1407 @@ +'use strict'; + +/** + * + * This class allows the manipulation of complex numbers. + * You can pass a complex number in different formats. Either as object, double, string or two integer parameters. + * + * Object form + * { re: , im: } + * { arg: , abs: } + * { phi: , r: } + * + * Array / Vector form + * [ real, imaginary ] + * + * Double form + * 99.3 - Single double value + * + * String form + * '23.1337' - Simple real number + * '15+3i' - a simple complex number + * '3-i' - a simple complex number + * + * Example: + * + * var c = new Complex('99.3+8i'); + * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); + * + */ + + +var cosh = Math.cosh || function (x) { + return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; +}; + +var sinh = Math.sinh || function (x) { + return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5; +}; + +/** + * Calculates cos(x) - 1 using Taylor series if x is small (-¼π ≤ x ≤ ¼π). + * + * @param {number} x + * @returns {number} cos(x) - 1 + */ +var cosm1 = function (x) { + + var b = Math.PI / 4; + if (-b > x || x > b) { + return Math.cos(x) - 1.0; + } + + /* Calculate horner form of polynomial of taylor series in Q + var fac = 1, alt = 1, pol = {}; + for (var i = 0; i <= 16; i++) { + fac*= i || 1; + if (i % 2 == 0) { + pol[i] = new Fraction(1, alt * fac); + alt = -alt; + } + } + console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1 + */ + + var xx = x * x; + return xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx / 20922789888000 + - 1 / 87178291200) + + 1 / 479001600) + - 1 / 3628800) + + 1 / 40320) + - 1 / 720) + + 1 / 24) + - 1 / 2); +}; + +var hypot = function (x, y) { + + var a = Math.abs(x); + var b = Math.abs(y); + + if (a < 3000 && b < 3000) { + return Math.sqrt(a * a + b * b); + } + + if (a < b) { + a = b; + b = x / y; + } else { + b = y / x; + } + return a * Math.sqrt(1 + b * b); +}; + +var parser_exit = function () { + throw SyntaxError('Invalid Param'); +}; + +/** + * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows + * + * @param {number} a + * @param {number} b + * @returns {number} + */ +function logHypot(a, b) { + + var _a = Math.abs(a); + var _b = Math.abs(b); + + if (a === 0) { + return Math.log(_b); + } + + if (b === 0) { + return Math.log(_a); + } + + if (_a < 3000 && _b < 3000) { + return Math.log(a * a + b * b) * 0.5; + } + + /* I got 4 ideas to compute this property without overflow: + * + * Testing 1000000 times with random samples for a,b ∈ [1, 1000000000] against a big decimal library to get an error estimate + * + * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11) + + Math.log(a * a + b * b) / 2 + + * + * + * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10) + + var fn = function(a, b) { + a = Math.abs(a); + b = Math.abs(b); + var t = Math.min(a, b); + a = Math.max(a, b); + t = t / a; + + return Math.log(a) + Math.log(1 + t * t) / 2; + }; + + * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10) + + Math.log(a / Math.cos(Math.atan2(b, a))) + + * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9) + + Math.log(a) - Math.log(Math.cos(Math.atan2(b, a))) + + */ + + a = a / 2; + b = b / 2; + + return 0.5 * Math.log(a * a + b * b) + Math.LN2; +} + +var parse = function (a, b) { + + var z = { 're': 0, 'im': 0 }; + + if (a === undefined || a === null) { + z['re'] = + z['im'] = 0; + } else if (b !== undefined) { + z['re'] = a; + z['im'] = b; + } else + switch (typeof a) { + + case 'object': + + if ('im' in a && 're' in a) { + z['re'] = a['re']; + z['im'] = a['im']; + } else if ('abs' in a && 'arg' in a) { + if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) { + return Complex['INFINITY']; + } + z['re'] = a['abs'] * Math.cos(a['arg']); + z['im'] = a['abs'] * Math.sin(a['arg']); + } else if ('r' in a && 'phi' in a) { + if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) { + return Complex['INFINITY']; + } + z['re'] = a['r'] * Math.cos(a['phi']); + z['im'] = a['r'] * Math.sin(a['phi']); + } else if (a.length === 2) { // Quick array check + z['re'] = a[0]; + z['im'] = a[1]; + } else { + parser_exit(); + } + break; + + case 'string': + + z['im'] = /* void */ + z['re'] = 0; + + var tokens = a.replace(/_/g, '') + .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); + var plus = 1; + var minus = 0; + + if (tokens === null) { + parser_exit(); + } + + for (var i = 0; i < tokens.length; i++) { + + var c = tokens[i]; + + if (c === ' ' || c === '\t' || c === '\n') { + /* void */ + } else if (c === '+') { + plus++; + } else if (c === '-') { + minus++; + } else if (c === 'i' || c === 'I') { + + if (plus + minus === 0) { + parser_exit(); + } + + if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) { + z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]); + i++; + } else { + z['im'] += parseFloat((minus % 2 ? '-' : '') + '1'); + } + plus = minus = 0; + + } else { + + if (plus + minus === 0 || isNaN(c)) { + parser_exit(); + } + + if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') { + z['im'] += parseFloat((minus % 2 ? '-' : '') + c); + i++; + } else { + z['re'] += parseFloat((minus % 2 ? '-' : '') + c); + } + plus = minus = 0; + } + } + + // Still something on the stack + if (plus + minus > 0) { + parser_exit(); + } + break; + + case 'number': + z['im'] = 0; + z['re'] = a; + break; + + default: + parser_exit(); + } + + if (isNaN(z['re']) || isNaN(z['im'])) { + // If a calculation is NaN, we treat it as NaN and don't throw + //parser_exit(); + } + + return z; +}; + +/** + * @constructor + * @returns {Complex} + */ +function Complex(a, b) { + + if (!(this instanceof Complex)) { + return new Complex(a, b); + } + + var z = parse(a, b); + + this['re'] = z['re']; + this['im'] = z['im']; +} + +Complex.prototype = { + + 're': 0, + 'im': 0, + + /** + * Calculates the sign of a complex number, which is a normalized complex + * + * @returns {Complex} + */ + 'sign': function () { + + var abs = this['abs'](); + + return new Complex( + this['re'] / abs, + this['im'] / abs); + }, + + /** + * Adds two complex numbers + * + * @returns {Complex} + */ + 'add': function (a, b) { + + var z = new Complex(a, b); + + // Infinity + Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity + z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] + z['re'], + this['im'] + z['im']); + }, + + /** + * Subtracts two complex numbers + * + * @returns {Complex} + */ + 'sub': function (a, b) { + + var z = new Complex(a, b); + + // Infinity - Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity - z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] - z['re'], + this['im'] - z['im']); + }, + + /** + * Multiplies two complex numbers + * + * @returns {Complex} + */ + 'mul': function (a, b) { + + var z = new Complex(a, b); + + // Infinity * 0 = NaN + if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity * z = Infinity { where z != 0 } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + // Short circuit for real values + if (z['im'] === 0 && this['im'] === 0) { + return new Complex(this['re'] * z['re'], 0); + } + + return new Complex( + this['re'] * z['re'] - this['im'] * z['im'], + this['re'] * z['im'] + this['im'] * z['re']); + }, + + /** + * Divides two complex numbers + * + * @returns {Complex} + */ + 'div': function (a, b) { + + var z = new Complex(a, b); + + // 0 / 0 = NaN and Infinity / Infinity = NaN + if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity / 0 = Infinity + if (this['isInfinite']() || z['isZero']()) { + return Complex['INFINITY']; + } + + // 0 / Infinity = 0 + if (this['isZero']() || z['isInfinite']()) { + return Complex['ZERO']; + } + + a = this['re']; + b = this['im']; + + var c = z['re']; + var d = z['im']; + var t, x; + + if (0 === d) { + // Divisor is real + return new Complex(a / c, b / c); + } + + if (Math.abs(c) < Math.abs(d)) { + + x = c / d; + t = c * x + d; + + return new Complex( + (a * x + b) / t, + (b * x - a) / t); + + } else { + + x = d / c; + t = d * x + c; + + return new Complex( + (a + b * x) / t, + (b - a * x) / t); + } + }, + + /** + * Calculate the power of two complex numbers + * + * @returns {Complex} + */ + 'pow': function (a, b) { + + var z = new Complex(a, b); + + a = this['re']; + b = this['im']; + + if (z['isZero']()) { + return Complex['ONE']; + } + + // If the exponent is real + if (z['im'] === 0) { + + if (b === 0 && a > 0) { + + return new Complex(Math.pow(a, z['re']), 0); + + } else if (a === 0) { // If base is fully imaginary + + switch ((z['re'] % 4 + 4) % 4) { + case 0: + return new Complex(Math.pow(b, z['re']), 0); + case 1: + return new Complex(0, Math.pow(b, z['re'])); + case 2: + return new Complex(-Math.pow(b, z['re']), 0); + case 3: + return new Complex(0, -Math.pow(b, z['re'])); + } + } + } + + /* I couldn't find a good formula, so here is a derivation and optimization + * + * z_1^z_2 = (a + bi)^(c + di) + * = exp((c + di) * log(a + bi) + * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a)) + * =>... + * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * + * =>... + * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * + * => + * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1)) + * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1)) + * + */ + + if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) { + return Complex['ZERO']; + } + + var arg = Math.atan2(b, a); + var loh = logHypot(a, b); + + a = Math.exp(z['re'] * loh - z['im'] * arg); + b = z['im'] * loh + z['re'] * arg; + return new Complex( + a * Math.cos(b), + a * Math.sin(b)); + }, + + /** + * Calculate the complex square root + * + * @returns {Complex} + */ + 'sqrt': function () { + + var a = this['re']; + var b = this['im']; + var r = this['abs'](); + + var re, im; + + if (a >= 0) { + + if (b === 0) { + return new Complex(Math.sqrt(a), 0); + } + + re = 0.5 * Math.sqrt(2.0 * (r + a)); + } else { + re = Math.abs(b) / Math.sqrt(2 * (r - a)); + } + + if (a <= 0) { + im = 0.5 * Math.sqrt(2.0 * (r - a)); + } else { + im = Math.abs(b) / Math.sqrt(2 * (r + a)); + } + + return new Complex(re, b < 0 ? -im : im); + }, + + /** + * Calculate the complex exponent + * + * @returns {Complex} + */ + 'exp': function () { + + var tmp = Math.exp(this['re']); + + if (this['im'] === 0) { + //return new Complex(tmp, 0); + } + return new Complex( + tmp * Math.cos(this['im']), + tmp * Math.sin(this['im'])); + }, + + /** + * Calculate the complex exponent and subtracts one. + * + * This may be more accurate than `Complex(x).exp().sub(1)` if + * `x` is small. + * + * @returns {Complex} + */ + 'expm1': function () { + + /** + * exp(a + i*b) - 1 + = exp(a) * (cos(b) + j*sin(b)) - 1 + = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b) + */ + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.expm1(a) * Math.cos(b) + cosm1(b), + Math.exp(a) * Math.sin(b)); + }, + + /** + * Calculate the natural log + * + * @returns {Complex} + */ + 'log': function () { + + var a = this['re']; + var b = this['im']; + + if (b === 0 && a > 0) { + //return new Complex(Math.log(a), 0); + } + + return new Complex( + logHypot(a, b), + Math.atan2(b, a)); + }, + + /** + * Calculate the magnitude of the complex number + * + * @returns {number} + */ + 'abs': function () { + + return hypot(this['re'], this['im']); + }, + + /** + * Calculate the angle of the complex number + * + * @returns {number} + */ + 'arg': function () { + + return Math.atan2(this['im'], this['re']); + }, + + /** + * Calculate the sine of the complex number + * + * @returns {Complex} + */ + 'sin': function () { + + // sin(z) = ( e^iz - e^-iz ) / 2i + // = sin(a)cosh(b) + i cos(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.sin(a) * cosh(b), + Math.cos(a) * sinh(b)); + }, + + /** + * Calculate the cosine + * + * @returns {Complex} + */ + 'cos': function () { + + // cos(z) = ( e^iz + e^-iz ) / 2 + // = cos(a)cosh(b) - i sin(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.cos(a) * cosh(b), + -Math.sin(a) * sinh(b)); + }, + + /** + * Calculate the tangent + * + * @returns {Complex} + */ + 'tan': function () { + + // tan(z) = sin(z) / cos(z) + // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) ) + // = ( e^2iz - 1 ) / i( e^2iz + 1 ) + // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) ) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) + cosh(b); + + return new Complex( + Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the cotangent + * + * @returns {Complex} + */ + 'cot': function () { + + // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci)) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) - cosh(b); + + return new Complex( + -Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the secant + * + * @returns {Complex} + */ + 'sec': function () { + + // sec(c) = 2 / (e^(ci) + e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a); + + return new Complex( + Math.cos(a) * cosh(b) / d, + Math.sin(a) * sinh(b) / d); + }, + + /** + * Calculate the cosecans + * + * @returns {Complex} + */ + 'csc': function () { + + // csc(c) = 2i / (e^(ci) - e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a); + + return new Complex( + Math.sin(a) * cosh(b) / d, + -Math.cos(a) * sinh(b) / d); + }, + + /** + * Calculate the complex arcus sinus + * + * @returns {Complex} + */ + 'asin': function () { + + // asin(c) = -i * log(ci + sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(t2['im'], -t2['re']); + }, + + /** + * Calculate the complex arcus cosinus + * + * @returns {Complex} + */ + 'acos': function () { + + // acos(c) = i * log(c - i * sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(Math.PI / 2 - t2['im'], t2['re']); + }, + + /** + * Calculate the complex arcus tangent + * + * @returns {Complex} + */ + 'atan': function () { + + // atan(c) = i / 2 log((i + x) / (i - x)) + + var a = this['re']; + var b = this['im']; + + if (a === 0) { + + if (b === 1) { + return new Complex(0, Infinity); + } + + if (b === -1) { + return new Complex(0, -Infinity); + } + } + + var d = a * a + (1.0 - b) * (1.0 - b); + + var t1 = new Complex( + (1 - b * b - a * a) / d, + -2 * a / d).log(); + + return new Complex(-0.5 * t1['im'], 0.5 * t1['re']); + }, + + /** + * Calculate the complex arcus cotangent + * + * @returns {Complex} + */ + 'acot': function () { + + // acot(c) = i / 2 log((c - i) / (c + i)) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + return new Complex(Math.atan2(1, a), 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atan() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atan(); + }, + + /** + * Calculate the complex arcus secant + * + * @returns {Complex} + */ + 'asec': function () { + + // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acos() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acos(); + }, + + /** + * Calculate the complex arcus cosecans + * + * @returns {Complex} + */ + 'acsc': function () { + + // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(Math.PI / 2, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asin() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asin(); + }, + + /** + * Calculate the complex sinh + * + * @returns {Complex} + */ + 'sinh': function () { + + // sinh(c) = (e^c - e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + sinh(a) * Math.cos(b), + cosh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex cosh + * + * @returns {Complex} + */ + 'cosh': function () { + + // cosh(c) = (e^c + e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + cosh(a) * Math.cos(b), + sinh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex tanh + * + * @returns {Complex} + */ + 'tanh': function () { + + // tanh(c) = (e^c - e^-c) / (e^c + e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) + Math.cos(b); + + return new Complex( + sinh(a) / d, + Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'coth': function () { + + // coth(c) = (e^c + e^-c) / (e^c - e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) - Math.cos(b); + + return new Complex( + sinh(a) / d, + -Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'csch': function () { + + // csch(c) = 2 / (e^c - e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) - cosh(2 * a); + + return new Complex( + -2 * sinh(a) * Math.cos(b) / d, + 2 * cosh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex sech + * + * @returns {Complex} + */ + 'sech': function () { + + // sech(c) = 2 / (e^c + e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) + cosh(2 * a); + + return new Complex( + 2 * cosh(a) * Math.cos(b) / d, + -2 * sinh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex asinh + * + * @returns {Complex} + */ + 'asinh': function () { + + // asinh(c) = log(c + sqrt(c^2 + 1)) + + var tmp = this['im']; + this['im'] = -this['re']; + this['re'] = tmp; + var res = this['asin'](); + + this['re'] = -this['im']; + this['im'] = tmp; + tmp = res['re']; + + res['re'] = -res['im']; + res['im'] = tmp; + return res; + }, + + /** + * Calculate the complex acosh + * + * @returns {Complex} + */ + 'acosh': function () { + + // acosh(c) = log(c + sqrt(c^2 - 1)) + + var res = this['acos'](); + if (res['im'] <= 0) { + var tmp = res['re']; + res['re'] = -res['im']; + res['im'] = tmp; + } else { + var tmp = res['im']; + res['im'] = -res['re']; + res['re'] = tmp; + } + return res; + }, + + /** + * Calculate the complex atanh + * + * @returns {Complex} + */ + 'atanh': function () { + + // atanh(c) = log((1+c) / (1-c)) / 2 + + var a = this['re']; + var b = this['im']; + + var noIM = a > 1 && b === 0; + var oneMinus = 1 - a; + var onePlus = 1 + a; + var d = oneMinus * oneMinus + b * b; + + var x = (d !== 0) + ? new Complex( + (onePlus * oneMinus - b * b) / d, + (b * oneMinus + onePlus * b) / d) + : new Complex( + (a !== -1) ? (a / 0) : 0, + (b !== 0) ? (b / 0) : 0); + + var temp = x['re']; + x['re'] = logHypot(x['re'], x['im']) / 2; + x['im'] = Math.atan2(x['im'], temp) / 2; + if (noIM) { + x['im'] = -x['im']; + } + return x; + }, + + /** + * Calculate the complex acoth + * + * @returns {Complex} + */ + 'acoth': function () { + + // acoth(c) = log((c+1) / (c-1)) / 2 + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Math.PI / 2); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atanh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atanh(); + }, + + /** + * Calculate the complex acsch + * + * @returns {Complex} + */ + 'acsch': function () { + + // acsch(c) = log((1+sqrt(1+c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + + return new Complex( + (a !== 0) + ? Math.log(a + Math.sqrt(a * a + 1)) + : Infinity, 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asinh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asinh(); + }, + + /** + * Calculate the complex asech + * + * @returns {Complex} + */ + 'asech': function () { + + // asech(c) = log((1+sqrt(1-c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (this['isZero']()) { + return Complex['INFINITY']; + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acosh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acosh(); + }, + + /** + * Calculate the complex inverse 1/z + * + * @returns {Complex} + */ + 'inverse': function () { + + // 1 / 0 = Infinity and 1 / Infinity = 0 + if (this['isZero']()) { + return Complex['INFINITY']; + } + + if (this['isInfinite']()) { + return Complex['ZERO']; + } + + var a = this['re']; + var b = this['im']; + + var d = a * a + b * b; + + return new Complex(a / d, -b / d); + }, + + /** + * Returns the complex conjugate + * + * @returns {Complex} + */ + 'conjugate': function () { + + return new Complex(this['re'], -this['im']); + }, + + /** + * Gets the negated complex number + * + * @returns {Complex} + */ + 'neg': function () { + + return new Complex(-this['re'], -this['im']); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'ceil': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.ceil(this['re'] * places) / places, + Math.ceil(this['im'] * places) / places); + }, + + /** + * Floors the actual complex number + * + * @returns {Complex} + */ + 'floor': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.floor(this['re'] * places) / places, + Math.floor(this['im'] * places) / places); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'round': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.round(this['re'] * places) / places, + Math.round(this['im'] * places) / places); + }, + + /** + * Compares two complex numbers + * + * **Note:** new Complex(Infinity).equals(Infinity) === false + * + * @returns {boolean} + */ + 'equals': function (a, b) { + + var z = new Complex(a, b); + + return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] && + Math.abs(z['im'] - this['im']) <= Complex['EPSILON']; + }, + + /** + * Clones the actual object + * + * @returns {Complex} + */ + 'clone': function () { + + return new Complex(this['re'], this['im']); + }, + + /** + * Gets a string of the actual complex number + * + * @returns {string} + */ + 'toString': function () { + + var a = this['re']; + var b = this['im']; + var ret = ""; + + if (this['isNaN']()) { + return 'NaN'; + } + + if (this['isInfinite']()) { + return 'Infinity'; + } + + if (Math.abs(a) < Complex['EPSILON']) { + a = 0; + } + + if (Math.abs(b) < Complex['EPSILON']) { + b = 0; + } + + // If is real number + if (b === 0) { + return ret + a; + } + + if (a !== 0) { + ret += a; + ret += " "; + if (b < 0) { + b = -b; + ret += "-"; + } else { + ret += "+"; + } + ret += " "; + } else if (b < 0) { + b = -b; + ret += "-"; + } + + if (1 !== b) { // b is the absolute imaginary part + ret += b; + } + return ret + "i"; + }, + + /** + * Returns the actual number as a vector + * + * @returns {Array} + */ + 'toVector': function () { + + return [this['re'], this['im']]; + }, + + /** + * Returns the actual real value of the current object + * + * @returns {number|null} + */ + 'valueOf': function () { + + if (this['im'] === 0) { + return this['re']; + } + return null; + }, + + /** + * Determines whether a complex number is not on the Riemann sphere. + * + * @returns {boolean} + */ + 'isNaN': function () { + return isNaN(this['re']) || isNaN(this['im']); + }, + + /** + * Determines whether or not a complex number is at the zero pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isZero': function () { + return this['im'] === 0 && this['re'] === 0; + }, + + /** + * Determines whether a complex number is not at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isFinite': function () { + return isFinite(this['re']) && isFinite(this['im']); + }, + + /** + * Determines whether or not a complex number is at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isInfinite': function () { + return !(this['isNaN']() || this['isFinite']()); + } +}; + +Complex['ZERO'] = new Complex(0, 0); +Complex['ONE'] = new Complex(1, 0); +Complex['I'] = new Complex(0, 1); +Complex['PI'] = new Complex(Math.PI, 0); +Complex['E'] = new Complex(Math.E, 0); +Complex['INFINITY'] = new Complex(Infinity, Infinity); +Complex['NAN'] = new Complex(NaN, NaN); +Complex['EPSILON'] = 1e-15; + +Object.defineProperty(Complex, "__esModule", { 'value': true }); +Complex['default'] = Complex; +Complex['Complex'] = Complex; +module['exports'] = Complex; diff --git a/24_10_22_faktorialis/node_modules/complex.js/dist/complex.min.js b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.min.js new file mode 100644 index 0000000..adc1d5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.min.js @@ -0,0 +1,25 @@ +/* +Complex.js v2.3.0 10/10/2024 +https://raw.org/article/complex-numbers-in-javascript/ + +Copyright (c) 2024, Robert Eisele (https://raw.org/) +Licensed under the MIT license. +*/ +'use strict';(function(n){function l(){throw SyntaxError("Invalid Param");}function m(a,b){var c=Math.abs(a),e=Math.abs(b);if(0===a)return Math.log(e);if(0===b)return Math.log(c);if(3E3>c&&3E3>e)return.5*Math.log(a*a+b*b);a/=2;b/=2;return.5*Math.log(a*a+b*b)+Math.LN2}function d(a,b){if(!(this instanceof d))return new d(a,b);var c={re:0,im:0};if(void 0===a||null===a)c.re=c.im=0;else if(void 0!==b)c.re=a,c.im=b;else switch(typeof a){case "object":"im"in a&&"re"in a?(c.re=a.re,c.im=a.im):"abs"in a&& +"arg"in a?!Number.isFinite(a.abs)&&Number.isFinite(a.arg)?c=d.INFINITY:(c.re=a.abs*Math.cos(a.arg),c.im=a.abs*Math.sin(a.arg)):"r"in a&&"phi"in a?!Number.isFinite(a.r)&&Number.isFinite(a.phi)?c=d.INFINITY:(c.re=a.r*Math.cos(a.phi),c.im=a.r*Math.sin(a.phi)):2===a.length?(c.re=a[0],c.im=a[1]):l();break;case "string":c.im=c.re=0;a=a.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);b=1;var e=0;null===a&&l();for(var f=0;fMath.abs(a)?1-a:.5*(Math.exp(a)+Math.exp(-a))},k=Math.sinh||function(a){return 1E-9>Math.abs(a)? +a:.5*(Math.exp(a)-Math.exp(-a))};d.prototype={re:0,im:0,sign:function(){var a=this.abs();return new d(this.re/a,this.im/a)},add:function(a,b){a=new d(a,b);return this.isInfinite()&&a.isInfinite()?d.NAN:this.isInfinite()||a.isInfinite()?d.INFINITY:new d(this.re+a.re,this.im+a.im)},sub:function(a,b){a=new d(a,b);return this.isInfinite()&&a.isInfinite()?d.NAN:this.isInfinite()||a.isInfinite()?d.INFINITY:new d(this.re-a.re,this.im-a.im)},mul:function(a,b){a=new d(a,b);return this.isInfinite()&&a.isZero()|| +this.isZero()&&a.isInfinite()?d.NAN:this.isInfinite()||a.isInfinite()?d.INFINITY:0===a.im&&0===this.im?new d(this.re*a.re,0):new d(this.re*a.re-this.im*a.im,this.re*a.im+this.im*a.re)},div:function(a,b){var c=new d(a,b);if(this.isZero()&&c.isZero()||this.isInfinite()&&c.isInfinite())return d.NAN;if(this.isInfinite()||c.isZero())return d.INFINITY;if(this.isZero()||c.isInfinite())return d.ZERO;a=this.re;b=this.im;var e=c.re,f=c.im;if(0===f)return new d(a/e,b/e);if(Math.abs(e)=a?.5*Math.sqrt(2*(c-a)):Math.abs(b)/Math.sqrt(2*(c+a));return new d(e,0>b?-a:a)},exp:function(){var a=Math.exp(this.re);return new d(a*Math.cos(this.im),a*Math.sin(this.im))},expm1:function(){var a=this.re,b=this.im,c=Math.expm1(a)*Math.cos(b);var e= +Math.PI/4;-e>b||b>e?e=Math.cos(b)-1:(e=b*b,e*=e*(e*(e*(e*(e*(e*(e/20922789888E3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5);return new d(c+e,Math.exp(a)*Math.sin(b))},log:function(){var a=this.re,b=this.im;return new d(m(a,b),Math.atan2(b,a))},abs:function(){var a=this.re;var b=this.im,c=Math.abs(a),e=Math.abs(b);3E3>c&&3E3>e?a=Math.sqrt(c*c+e*e):(c=a.im){var b=a.re;a.re=-a.im;a.im=b}else b=a.im,a.im=-a.re,a.re=b;return a},atanh:function(){var a=this.re,b=this.im,c=1< +a&&0===b,e=1-a,f=1+a,h=e*e+b*b;a=0!==h?new d((f*e-b*b)/h,(b*e+f*b)/h):new d(-1!==a?a/0:0,0!==b?b/0:0);b=a.re;a.re=m(a.re,a.im)/2;a.im=Math.atan2(a.im,b)/2;c&&(a.im=-a.im);return a},acoth:function(){var a=this.re,b=this.im;if(0===a&&0===b)return new d(0,Math.PI/2);var c=a*a+b*b;return 0!==c?(new d(a/c,-b/c)).atanh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).atanh()},acsch:function(){var a=this.re,b=this.im;if(0===b)return new d(0!==a?Math.log(a+Math.sqrt(a*a+1)):Infinity,0);var c=a*a+b*b;return 0!==c?(new d(a/ +c,-b/c)).asinh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).asinh()},asech:function(){var a=this.re,b=this.im;if(this.isZero())return d.INFINITY;var c=a*a+b*b;return 0!==c?(new d(a/c,-b/c)).acosh():(new d(0!==a?a/0:0,0!==b?-b/0:0)).acosh()},inverse:function(){if(this.isZero())return d.INFINITY;if(this.isInfinite())return d.ZERO;var a=this.re,b=this.im,c=a*a+b*b;return new d(a/c,-b/c)},conjugate:function(){return new d(this.re,-this.im)},neg:function(){return new d(-this.re,-this.im)},ceil:function(a){a=Math.pow(10, +a||0);return new d(Math.ceil(this.re*a)/a,Math.ceil(this.im*a)/a)},floor:function(a){a=Math.pow(10,a||0);return new d(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){a=Math.pow(10,a||0);return new d(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,b){a=new d(a,b);return Math.abs(a.re-this.re)<=d.EPSILON&&Math.abs(a.im-this.im)<=d.EPSILON},clone:function(){return new d(this.re,this.im)},toString:function(){var a=this.re,b=this.im,c="";if(this.isNaN())return"NaN"; +if(this.isInfinite())return"Infinity";Math.abs(a)b?(b=-b,c+="-"):c+="+",c+=" "):0>b&&(b=-b,c+="-");1!==b&&(c+=b);return c+"i"},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()|| +this.isFinite())}};d.ZERO=new d(0,0);d.ONE=new d(1,0);d.I=new d(0,1);d.PI=new d(Math.PI,0);d.E=new d(Math.E,0);d.INFINITY=new d(Infinity,Infinity);d.NAN=new d(NaN,NaN);d.EPSILON=1E-15;"function"===typeof define&&define.amd?define([],function(){return d}):"object"===typeof exports?(Object.defineProperty(d,"__esModule",{value:!0}),d["default"]=d,d.Complex=d,module.exports=d):n.Complex=d})(this); diff --git a/24_10_22_faktorialis/node_modules/complex.js/dist/complex.mjs b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.mjs new file mode 100644 index 0000000..9f0910f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/dist/complex.mjs @@ -0,0 +1,1405 @@ +'use strict'; + +/** + * + * This class allows the manipulation of complex numbers. + * You can pass a complex number in different formats. Either as object, double, string or two integer parameters. + * + * Object form + * { re: , im: } + * { arg: , abs: } + * { phi: , r: } + * + * Array / Vector form + * [ real, imaginary ] + * + * Double form + * 99.3 - Single double value + * + * String form + * '23.1337' - Simple real number + * '15+3i' - a simple complex number + * '3-i' - a simple complex number + * + * Example: + * + * var c = new Complex('99.3+8i'); + * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); + * + */ + + +var cosh = Math.cosh || function (x) { + return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; +}; + +var sinh = Math.sinh || function (x) { + return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5; +}; + +/** + * Calculates cos(x) - 1 using Taylor series if x is small (-¼π ≤ x ≤ ¼π). + * + * @param {number} x + * @returns {number} cos(x) - 1 + */ +var cosm1 = function (x) { + + var b = Math.PI / 4; + if (-b > x || x > b) { + return Math.cos(x) - 1.0; + } + + /* Calculate horner form of polynomial of taylor series in Q + var fac = 1, alt = 1, pol = {}; + for (var i = 0; i <= 16; i++) { + fac*= i || 1; + if (i % 2 == 0) { + pol[i] = new Fraction(1, alt * fac); + alt = -alt; + } + } + console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1 + */ + + var xx = x * x; + return xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx / 20922789888000 + - 1 / 87178291200) + + 1 / 479001600) + - 1 / 3628800) + + 1 / 40320) + - 1 / 720) + + 1 / 24) + - 1 / 2); +}; + +var hypot = function (x, y) { + + var a = Math.abs(x); + var b = Math.abs(y); + + if (a < 3000 && b < 3000) { + return Math.sqrt(a * a + b * b); + } + + if (a < b) { + a = b; + b = x / y; + } else { + b = y / x; + } + return a * Math.sqrt(1 + b * b); +}; + +var parser_exit = function () { + throw SyntaxError('Invalid Param'); +}; + +/** + * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows + * + * @param {number} a + * @param {number} b + * @returns {number} + */ +function logHypot(a, b) { + + var _a = Math.abs(a); + var _b = Math.abs(b); + + if (a === 0) { + return Math.log(_b); + } + + if (b === 0) { + return Math.log(_a); + } + + if (_a < 3000 && _b < 3000) { + return Math.log(a * a + b * b) * 0.5; + } + + /* I got 4 ideas to compute this property without overflow: + * + * Testing 1000000 times with random samples for a,b ∈ [1, 1000000000] against a big decimal library to get an error estimate + * + * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11) + + Math.log(a * a + b * b) / 2 + + * + * + * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10) + + var fn = function(a, b) { + a = Math.abs(a); + b = Math.abs(b); + var t = Math.min(a, b); + a = Math.max(a, b); + t = t / a; + + return Math.log(a) + Math.log(1 + t * t) / 2; + }; + + * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10) + + Math.log(a / Math.cos(Math.atan2(b, a))) + + * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9) + + Math.log(a) - Math.log(Math.cos(Math.atan2(b, a))) + + */ + + a = a / 2; + b = b / 2; + + return 0.5 * Math.log(a * a + b * b) + Math.LN2; +} + +var parse = function (a, b) { + + var z = { 're': 0, 'im': 0 }; + + if (a === undefined || a === null) { + z['re'] = + z['im'] = 0; + } else if (b !== undefined) { + z['re'] = a; + z['im'] = b; + } else + switch (typeof a) { + + case 'object': + + if ('im' in a && 're' in a) { + z['re'] = a['re']; + z['im'] = a['im']; + } else if ('abs' in a && 'arg' in a) { + if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) { + return Complex['INFINITY']; + } + z['re'] = a['abs'] * Math.cos(a['arg']); + z['im'] = a['abs'] * Math.sin(a['arg']); + } else if ('r' in a && 'phi' in a) { + if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) { + return Complex['INFINITY']; + } + z['re'] = a['r'] * Math.cos(a['phi']); + z['im'] = a['r'] * Math.sin(a['phi']); + } else if (a.length === 2) { // Quick array check + z['re'] = a[0]; + z['im'] = a[1]; + } else { + parser_exit(); + } + break; + + case 'string': + + z['im'] = /* void */ + z['re'] = 0; + + var tokens = a.replace(/_/g, '') + .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); + var plus = 1; + var minus = 0; + + if (tokens === null) { + parser_exit(); + } + + for (var i = 0; i < tokens.length; i++) { + + var c = tokens[i]; + + if (c === ' ' || c === '\t' || c === '\n') { + /* void */ + } else if (c === '+') { + plus++; + } else if (c === '-') { + minus++; + } else if (c === 'i' || c === 'I') { + + if (plus + minus === 0) { + parser_exit(); + } + + if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) { + z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]); + i++; + } else { + z['im'] += parseFloat((minus % 2 ? '-' : '') + '1'); + } + plus = minus = 0; + + } else { + + if (plus + minus === 0 || isNaN(c)) { + parser_exit(); + } + + if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') { + z['im'] += parseFloat((minus % 2 ? '-' : '') + c); + i++; + } else { + z['re'] += parseFloat((minus % 2 ? '-' : '') + c); + } + plus = minus = 0; + } + } + + // Still something on the stack + if (plus + minus > 0) { + parser_exit(); + } + break; + + case 'number': + z['im'] = 0; + z['re'] = a; + break; + + default: + parser_exit(); + } + + if (isNaN(z['re']) || isNaN(z['im'])) { + // If a calculation is NaN, we treat it as NaN and don't throw + //parser_exit(); + } + + return z; +}; + +/** + * @constructor + * @returns {Complex} + */ +function Complex(a, b) { + + if (!(this instanceof Complex)) { + return new Complex(a, b); + } + + var z = parse(a, b); + + this['re'] = z['re']; + this['im'] = z['im']; +} + +Complex.prototype = { + + 're': 0, + 'im': 0, + + /** + * Calculates the sign of a complex number, which is a normalized complex + * + * @returns {Complex} + */ + 'sign': function () { + + var abs = this['abs'](); + + return new Complex( + this['re'] / abs, + this['im'] / abs); + }, + + /** + * Adds two complex numbers + * + * @returns {Complex} + */ + 'add': function (a, b) { + + var z = new Complex(a, b); + + // Infinity + Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity + z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] + z['re'], + this['im'] + z['im']); + }, + + /** + * Subtracts two complex numbers + * + * @returns {Complex} + */ + 'sub': function (a, b) { + + var z = new Complex(a, b); + + // Infinity - Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity - z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] - z['re'], + this['im'] - z['im']); + }, + + /** + * Multiplies two complex numbers + * + * @returns {Complex} + */ + 'mul': function (a, b) { + + var z = new Complex(a, b); + + // Infinity * 0 = NaN + if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity * z = Infinity { where z != 0 } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + // Short circuit for real values + if (z['im'] === 0 && this['im'] === 0) { + return new Complex(this['re'] * z['re'], 0); + } + + return new Complex( + this['re'] * z['re'] - this['im'] * z['im'], + this['re'] * z['im'] + this['im'] * z['re']); + }, + + /** + * Divides two complex numbers + * + * @returns {Complex} + */ + 'div': function (a, b) { + + var z = new Complex(a, b); + + // 0 / 0 = NaN and Infinity / Infinity = NaN + if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity / 0 = Infinity + if (this['isInfinite']() || z['isZero']()) { + return Complex['INFINITY']; + } + + // 0 / Infinity = 0 + if (this['isZero']() || z['isInfinite']()) { + return Complex['ZERO']; + } + + a = this['re']; + b = this['im']; + + var c = z['re']; + var d = z['im']; + var t, x; + + if (0 === d) { + // Divisor is real + return new Complex(a / c, b / c); + } + + if (Math.abs(c) < Math.abs(d)) { + + x = c / d; + t = c * x + d; + + return new Complex( + (a * x + b) / t, + (b * x - a) / t); + + } else { + + x = d / c; + t = d * x + c; + + return new Complex( + (a + b * x) / t, + (b - a * x) / t); + } + }, + + /** + * Calculate the power of two complex numbers + * + * @returns {Complex} + */ + 'pow': function (a, b) { + + var z = new Complex(a, b); + + a = this['re']; + b = this['im']; + + if (z['isZero']()) { + return Complex['ONE']; + } + + // If the exponent is real + if (z['im'] === 0) { + + if (b === 0 && a > 0) { + + return new Complex(Math.pow(a, z['re']), 0); + + } else if (a === 0) { // If base is fully imaginary + + switch ((z['re'] % 4 + 4) % 4) { + case 0: + return new Complex(Math.pow(b, z['re']), 0); + case 1: + return new Complex(0, Math.pow(b, z['re'])); + case 2: + return new Complex(-Math.pow(b, z['re']), 0); + case 3: + return new Complex(0, -Math.pow(b, z['re'])); + } + } + } + + /* I couldn't find a good formula, so here is a derivation and optimization + * + * z_1^z_2 = (a + bi)^(c + di) + * = exp((c + di) * log(a + bi) + * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a)) + * =>... + * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * + * =>... + * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * + * => + * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1)) + * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1)) + * + */ + + if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) { + return Complex['ZERO']; + } + + var arg = Math.atan2(b, a); + var loh = logHypot(a, b); + + a = Math.exp(z['re'] * loh - z['im'] * arg); + b = z['im'] * loh + z['re'] * arg; + return new Complex( + a * Math.cos(b), + a * Math.sin(b)); + }, + + /** + * Calculate the complex square root + * + * @returns {Complex} + */ + 'sqrt': function () { + + var a = this['re']; + var b = this['im']; + var r = this['abs'](); + + var re, im; + + if (a >= 0) { + + if (b === 0) { + return new Complex(Math.sqrt(a), 0); + } + + re = 0.5 * Math.sqrt(2.0 * (r + a)); + } else { + re = Math.abs(b) / Math.sqrt(2 * (r - a)); + } + + if (a <= 0) { + im = 0.5 * Math.sqrt(2.0 * (r - a)); + } else { + im = Math.abs(b) / Math.sqrt(2 * (r + a)); + } + + return new Complex(re, b < 0 ? -im : im); + }, + + /** + * Calculate the complex exponent + * + * @returns {Complex} + */ + 'exp': function () { + + var tmp = Math.exp(this['re']); + + if (this['im'] === 0) { + //return new Complex(tmp, 0); + } + return new Complex( + tmp * Math.cos(this['im']), + tmp * Math.sin(this['im'])); + }, + + /** + * Calculate the complex exponent and subtracts one. + * + * This may be more accurate than `Complex(x).exp().sub(1)` if + * `x` is small. + * + * @returns {Complex} + */ + 'expm1': function () { + + /** + * exp(a + i*b) - 1 + = exp(a) * (cos(b) + j*sin(b)) - 1 + = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b) + */ + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.expm1(a) * Math.cos(b) + cosm1(b), + Math.exp(a) * Math.sin(b)); + }, + + /** + * Calculate the natural log + * + * @returns {Complex} + */ + 'log': function () { + + var a = this['re']; + var b = this['im']; + + if (b === 0 && a > 0) { + //return new Complex(Math.log(a), 0); + } + + return new Complex( + logHypot(a, b), + Math.atan2(b, a)); + }, + + /** + * Calculate the magnitude of the complex number + * + * @returns {number} + */ + 'abs': function () { + + return hypot(this['re'], this['im']); + }, + + /** + * Calculate the angle of the complex number + * + * @returns {number} + */ + 'arg': function () { + + return Math.atan2(this['im'], this['re']); + }, + + /** + * Calculate the sine of the complex number + * + * @returns {Complex} + */ + 'sin': function () { + + // sin(z) = ( e^iz - e^-iz ) / 2i + // = sin(a)cosh(b) + i cos(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.sin(a) * cosh(b), + Math.cos(a) * sinh(b)); + }, + + /** + * Calculate the cosine + * + * @returns {Complex} + */ + 'cos': function () { + + // cos(z) = ( e^iz + e^-iz ) / 2 + // = cos(a)cosh(b) - i sin(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.cos(a) * cosh(b), + -Math.sin(a) * sinh(b)); + }, + + /** + * Calculate the tangent + * + * @returns {Complex} + */ + 'tan': function () { + + // tan(z) = sin(z) / cos(z) + // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) ) + // = ( e^2iz - 1 ) / i( e^2iz + 1 ) + // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) ) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) + cosh(b); + + return new Complex( + Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the cotangent + * + * @returns {Complex} + */ + 'cot': function () { + + // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci)) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) - cosh(b); + + return new Complex( + -Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the secant + * + * @returns {Complex} + */ + 'sec': function () { + + // sec(c) = 2 / (e^(ci) + e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a); + + return new Complex( + Math.cos(a) * cosh(b) / d, + Math.sin(a) * sinh(b) / d); + }, + + /** + * Calculate the cosecans + * + * @returns {Complex} + */ + 'csc': function () { + + // csc(c) = 2i / (e^(ci) - e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a); + + return new Complex( + Math.sin(a) * cosh(b) / d, + -Math.cos(a) * sinh(b) / d); + }, + + /** + * Calculate the complex arcus sinus + * + * @returns {Complex} + */ + 'asin': function () { + + // asin(c) = -i * log(ci + sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(t2['im'], -t2['re']); + }, + + /** + * Calculate the complex arcus cosinus + * + * @returns {Complex} + */ + 'acos': function () { + + // acos(c) = i * log(c - i * sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(Math.PI / 2 - t2['im'], t2['re']); + }, + + /** + * Calculate the complex arcus tangent + * + * @returns {Complex} + */ + 'atan': function () { + + // atan(c) = i / 2 log((i + x) / (i - x)) + + var a = this['re']; + var b = this['im']; + + if (a === 0) { + + if (b === 1) { + return new Complex(0, Infinity); + } + + if (b === -1) { + return new Complex(0, -Infinity); + } + } + + var d = a * a + (1.0 - b) * (1.0 - b); + + var t1 = new Complex( + (1 - b * b - a * a) / d, + -2 * a / d).log(); + + return new Complex(-0.5 * t1['im'], 0.5 * t1['re']); + }, + + /** + * Calculate the complex arcus cotangent + * + * @returns {Complex} + */ + 'acot': function () { + + // acot(c) = i / 2 log((c - i) / (c + i)) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + return new Complex(Math.atan2(1, a), 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atan() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atan(); + }, + + /** + * Calculate the complex arcus secant + * + * @returns {Complex} + */ + 'asec': function () { + + // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acos() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acos(); + }, + + /** + * Calculate the complex arcus cosecans + * + * @returns {Complex} + */ + 'acsc': function () { + + // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(Math.PI / 2, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asin() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asin(); + }, + + /** + * Calculate the complex sinh + * + * @returns {Complex} + */ + 'sinh': function () { + + // sinh(c) = (e^c - e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + sinh(a) * Math.cos(b), + cosh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex cosh + * + * @returns {Complex} + */ + 'cosh': function () { + + // cosh(c) = (e^c + e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + cosh(a) * Math.cos(b), + sinh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex tanh + * + * @returns {Complex} + */ + 'tanh': function () { + + // tanh(c) = (e^c - e^-c) / (e^c + e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) + Math.cos(b); + + return new Complex( + sinh(a) / d, + Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'coth': function () { + + // coth(c) = (e^c + e^-c) / (e^c - e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) - Math.cos(b); + + return new Complex( + sinh(a) / d, + -Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'csch': function () { + + // csch(c) = 2 / (e^c - e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) - cosh(2 * a); + + return new Complex( + -2 * sinh(a) * Math.cos(b) / d, + 2 * cosh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex sech + * + * @returns {Complex} + */ + 'sech': function () { + + // sech(c) = 2 / (e^c + e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) + cosh(2 * a); + + return new Complex( + 2 * cosh(a) * Math.cos(b) / d, + -2 * sinh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex asinh + * + * @returns {Complex} + */ + 'asinh': function () { + + // asinh(c) = log(c + sqrt(c^2 + 1)) + + var tmp = this['im']; + this['im'] = -this['re']; + this['re'] = tmp; + var res = this['asin'](); + + this['re'] = -this['im']; + this['im'] = tmp; + tmp = res['re']; + + res['re'] = -res['im']; + res['im'] = tmp; + return res; + }, + + /** + * Calculate the complex acosh + * + * @returns {Complex} + */ + 'acosh': function () { + + // acosh(c) = log(c + sqrt(c^2 - 1)) + + var res = this['acos'](); + if (res['im'] <= 0) { + var tmp = res['re']; + res['re'] = -res['im']; + res['im'] = tmp; + } else { + var tmp = res['im']; + res['im'] = -res['re']; + res['re'] = tmp; + } + return res; + }, + + /** + * Calculate the complex atanh + * + * @returns {Complex} + */ + 'atanh': function () { + + // atanh(c) = log((1+c) / (1-c)) / 2 + + var a = this['re']; + var b = this['im']; + + var noIM = a > 1 && b === 0; + var oneMinus = 1 - a; + var onePlus = 1 + a; + var d = oneMinus * oneMinus + b * b; + + var x = (d !== 0) + ? new Complex( + (onePlus * oneMinus - b * b) / d, + (b * oneMinus + onePlus * b) / d) + : new Complex( + (a !== -1) ? (a / 0) : 0, + (b !== 0) ? (b / 0) : 0); + + var temp = x['re']; + x['re'] = logHypot(x['re'], x['im']) / 2; + x['im'] = Math.atan2(x['im'], temp) / 2; + if (noIM) { + x['im'] = -x['im']; + } + return x; + }, + + /** + * Calculate the complex acoth + * + * @returns {Complex} + */ + 'acoth': function () { + + // acoth(c) = log((c+1) / (c-1)) / 2 + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Math.PI / 2); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atanh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atanh(); + }, + + /** + * Calculate the complex acsch + * + * @returns {Complex} + */ + 'acsch': function () { + + // acsch(c) = log((1+sqrt(1+c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + + return new Complex( + (a !== 0) + ? Math.log(a + Math.sqrt(a * a + 1)) + : Infinity, 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asinh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asinh(); + }, + + /** + * Calculate the complex asech + * + * @returns {Complex} + */ + 'asech': function () { + + // asech(c) = log((1+sqrt(1-c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (this['isZero']()) { + return Complex['INFINITY']; + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acosh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acosh(); + }, + + /** + * Calculate the complex inverse 1/z + * + * @returns {Complex} + */ + 'inverse': function () { + + // 1 / 0 = Infinity and 1 / Infinity = 0 + if (this['isZero']()) { + return Complex['INFINITY']; + } + + if (this['isInfinite']()) { + return Complex['ZERO']; + } + + var a = this['re']; + var b = this['im']; + + var d = a * a + b * b; + + return new Complex(a / d, -b / d); + }, + + /** + * Returns the complex conjugate + * + * @returns {Complex} + */ + 'conjugate': function () { + + return new Complex(this['re'], -this['im']); + }, + + /** + * Gets the negated complex number + * + * @returns {Complex} + */ + 'neg': function () { + + return new Complex(-this['re'], -this['im']); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'ceil': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.ceil(this['re'] * places) / places, + Math.ceil(this['im'] * places) / places); + }, + + /** + * Floors the actual complex number + * + * @returns {Complex} + */ + 'floor': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.floor(this['re'] * places) / places, + Math.floor(this['im'] * places) / places); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'round': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.round(this['re'] * places) / places, + Math.round(this['im'] * places) / places); + }, + + /** + * Compares two complex numbers + * + * **Note:** new Complex(Infinity).equals(Infinity) === false + * + * @returns {boolean} + */ + 'equals': function (a, b) { + + var z = new Complex(a, b); + + return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] && + Math.abs(z['im'] - this['im']) <= Complex['EPSILON']; + }, + + /** + * Clones the actual object + * + * @returns {Complex} + */ + 'clone': function () { + + return new Complex(this['re'], this['im']); + }, + + /** + * Gets a string of the actual complex number + * + * @returns {string} + */ + 'toString': function () { + + var a = this['re']; + var b = this['im']; + var ret = ""; + + if (this['isNaN']()) { + return 'NaN'; + } + + if (this['isInfinite']()) { + return 'Infinity'; + } + + if (Math.abs(a) < Complex['EPSILON']) { + a = 0; + } + + if (Math.abs(b) < Complex['EPSILON']) { + b = 0; + } + + // If is real number + if (b === 0) { + return ret + a; + } + + if (a !== 0) { + ret += a; + ret += " "; + if (b < 0) { + b = -b; + ret += "-"; + } else { + ret += "+"; + } + ret += " "; + } else if (b < 0) { + b = -b; + ret += "-"; + } + + if (1 !== b) { // b is the absolute imaginary part + ret += b; + } + return ret + "i"; + }, + + /** + * Returns the actual number as a vector + * + * @returns {Array} + */ + 'toVector': function () { + + return [this['re'], this['im']]; + }, + + /** + * Returns the actual real value of the current object + * + * @returns {number|null} + */ + 'valueOf': function () { + + if (this['im'] === 0) { + return this['re']; + } + return null; + }, + + /** + * Determines whether a complex number is not on the Riemann sphere. + * + * @returns {boolean} + */ + 'isNaN': function () { + return isNaN(this['re']) || isNaN(this['im']); + }, + + /** + * Determines whether or not a complex number is at the zero pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isZero': function () { + return this['im'] === 0 && this['re'] === 0; + }, + + /** + * Determines whether a complex number is not at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isFinite': function () { + return isFinite(this['re']) && isFinite(this['im']); + }, + + /** + * Determines whether or not a complex number is at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isInfinite': function () { + return !(this['isNaN']() || this['isFinite']()); + } +}; + +Complex['ZERO'] = new Complex(0, 0); +Complex['ONE'] = new Complex(1, 0); +Complex['I'] = new Complex(0, 1); +Complex['PI'] = new Complex(Math.PI, 0); +Complex['E'] = new Complex(Math.E, 0); +Complex['INFINITY'] = new Complex(Infinity, Infinity); +Complex['NAN'] = new Complex(NaN, NaN); +Complex['EPSILON'] = 1e-15; +export { + Complex as default, Complex +}; diff --git a/24_10_22_faktorialis/node_modules/complex.js/examples/gamma.js b/24_10_22_faktorialis/node_modules/complex.js/examples/gamma.js new file mode 100644 index 0000000..1cc739d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/examples/gamma.js @@ -0,0 +1,33 @@ +/* + * A gamma function implementation based on Lanczos Approximation + * https://en.wikipedia.org/wiki/Lanczos_approximation + */ + +var Complex = require('complex.js'); + +var P = [ + Complex(0.99999999999980993), + Complex(676.5203681218851), Complex(-1259.1392167224028), Complex(771.32342877765313), + Complex(-176.61502916214059), Complex(12.507343278686905), Complex(-0.13857109526572012), + Complex(9.9843695780195716e-6), Complex(1.5056327351493116e-7) +]; + +var SQRT2PI = Complex(Math.sqrt(2 * Math.PI)); + +function gamma(z) { + + z = z.sub(1); + + var x = P[0]; + var t = z.add(7.5); + for (var i = 1; i < P.length; i++) { + x = x.add(P[i].div(z.add(i))); + } + return SQRT2PI.mul(t.pow(z.add(0.5))).mul(t.neg().exp()).mul(x); +} + +var fac = 1; +for (var i = 1; i <= 10; i++) { + console.log(fac, gamma(Complex(i))); + fac *= i; +} diff --git a/24_10_22_faktorialis/node_modules/complex.js/package.json b/24_10_22_faktorialis/node_modules/complex.js/package.json new file mode 100644 index 0000000..876f4e5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/package.json @@ -0,0 +1,60 @@ +{ + "name": "complex.js", + "title": "Complex.js", + "version": "2.3.0", + "homepage": "https://raw.org/article/complex-numbers-in-javascript/", + "bugs": "https://github.com/rawify/Complex.js/issues", + "description": "A complex numbers library", + "keywords": [ + "complex numbers", + "math", + "complex", + "number", + "calculus", + "parser", + "arithmetic" + ], + "private": false, + "main": "./dist/complex.js", + "module": "./dist/complex.mjs", + "types": "./complex.d.ts", + "browser": "./dist/complex.min.js", + "unpkg": "./dist/complex.min.js", + "readmeFilename": "README.md", + "exports": { + ".": { + "types": "./complex.d.ts", + "require": "./dist/complex.js", + "import": "./dist/complex.mjs" + } + }, + "repository": { + "type": "git", + "url": "git@github.com:rawify/Complex.js.git" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + }, + "author": { + "name": "Robert Eisele", + "email": "robert@raw.org", + "url": "https://raw.org/" + }, + "license": "MIT", + "engines": { + "node": "*" + }, + "directories": { + "example": "examples", + "test": "tests" + }, + "scripts": { + "build": "crude-build Complex", + "test": "mocha tests/*.js" + }, + "devDependencies": { + "crude-build": "^0.1.1", + "mocha": "*" + } +} diff --git a/24_10_22_faktorialis/node_modules/complex.js/src/complex.js b/24_10_22_faktorialis/node_modules/complex.js/src/complex.js new file mode 100644 index 0000000..084d203 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/src/complex.js @@ -0,0 +1,1408 @@ +/** + * @license Complex.js v2.3.0 10/10/2024 + * https://raw.org/article/complex-numbers-in-javascript/ + * + * Copyright (c) 2024, Robert Eisele (https://raw.org/) + * Licensed under the MIT license. + **/ + +/** + * + * This class allows the manipulation of complex numbers. + * You can pass a complex number in different formats. Either as object, double, string or two integer parameters. + * + * Object form + * { re: , im: } + * { arg: , abs: } + * { phi: , r: } + * + * Array / Vector form + * [ real, imaginary ] + * + * Double form + * 99.3 - Single double value + * + * String form + * '23.1337' - Simple real number + * '15+3i' - a simple complex number + * '3-i' - a simple complex number + * + * Example: + * + * var c = new Complex('99.3+8i'); + * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); + * + */ + + +var cosh = Math.cosh || function (x) { + return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; +}; + +var sinh = Math.sinh || function (x) { + return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5; +}; + +/** + * Calculates cos(x) - 1 using Taylor series if x is small (-¼π ≤ x ≤ ¼π). + * + * @param {number} x + * @returns {number} cos(x) - 1 + */ +var cosm1 = function (x) { + + var b = Math.PI / 4; + if (-b > x || x > b) { + return Math.cos(x) - 1.0; + } + + /* Calculate horner form of polynomial of taylor series in Q + var fac = 1, alt = 1, pol = {}; + for (var i = 0; i <= 16; i++) { + fac*= i || 1; + if (i % 2 == 0) { + pol[i] = new Fraction(1, alt * fac); + alt = -alt; + } + } + console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1 + */ + + var xx = x * x; + return xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx * ( + xx / 20922789888000 + - 1 / 87178291200) + + 1 / 479001600) + - 1 / 3628800) + + 1 / 40320) + - 1 / 720) + + 1 / 24) + - 1 / 2); +}; + +var hypot = function (x, y) { + + var a = Math.abs(x); + var b = Math.abs(y); + + if (a < 3000 && b < 3000) { + return Math.sqrt(a * a + b * b); + } + + if (a < b) { + a = b; + b = x / y; + } else { + b = y / x; + } + return a * Math.sqrt(1 + b * b); +}; + +var parser_exit = function () { + throw SyntaxError('Invalid Param'); +}; + +/** + * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows + * + * @param {number} a + * @param {number} b + * @returns {number} + */ +function logHypot(a, b) { + + var _a = Math.abs(a); + var _b = Math.abs(b); + + if (a === 0) { + return Math.log(_b); + } + + if (b === 0) { + return Math.log(_a); + } + + if (_a < 3000 && _b < 3000) { + return Math.log(a * a + b * b) * 0.5; + } + + /* I got 4 ideas to compute this property without overflow: + * + * Testing 1000000 times with random samples for a,b ∈ [1, 1000000000] against a big decimal library to get an error estimate + * + * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11) + + Math.log(a * a + b * b) / 2 + + * + * + * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10) + + var fn = function(a, b) { + a = Math.abs(a); + b = Math.abs(b); + var t = Math.min(a, b); + a = Math.max(a, b); + t = t / a; + + return Math.log(a) + Math.log(1 + t * t) / 2; + }; + + * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10) + + Math.log(a / Math.cos(Math.atan2(b, a))) + + * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9) + + Math.log(a) - Math.log(Math.cos(Math.atan2(b, a))) + + */ + + a = a / 2; + b = b / 2; + + return 0.5 * Math.log(a * a + b * b) + Math.LN2; +} + +var parse = function (a, b) { + + var z = { 're': 0, 'im': 0 }; + + if (a === undefined || a === null) { + z['re'] = + z['im'] = 0; + } else if (b !== undefined) { + z['re'] = a; + z['im'] = b; + } else + switch (typeof a) { + + case 'object': + + if ('im' in a && 're' in a) { + z['re'] = a['re']; + z['im'] = a['im']; + } else if ('abs' in a && 'arg' in a) { + if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) { + return Complex['INFINITY']; + } + z['re'] = a['abs'] * Math.cos(a['arg']); + z['im'] = a['abs'] * Math.sin(a['arg']); + } else if ('r' in a && 'phi' in a) { + if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) { + return Complex['INFINITY']; + } + z['re'] = a['r'] * Math.cos(a['phi']); + z['im'] = a['r'] * Math.sin(a['phi']); + } else if (a.length === 2) { // Quick array check + z['re'] = a[0]; + z['im'] = a[1]; + } else { + parser_exit(); + } + break; + + case 'string': + + z['im'] = /* void */ + z['re'] = 0; + + var tokens = a.replace(/_/g, '') + .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); + var plus = 1; + var minus = 0; + + if (tokens === null) { + parser_exit(); + } + + for (var i = 0; i < tokens.length; i++) { + + var c = tokens[i]; + + if (c === ' ' || c === '\t' || c === '\n') { + /* void */ + } else if (c === '+') { + plus++; + } else if (c === '-') { + minus++; + } else if (c === 'i' || c === 'I') { + + if (plus + minus === 0) { + parser_exit(); + } + + if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) { + z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]); + i++; + } else { + z['im'] += parseFloat((minus % 2 ? '-' : '') + '1'); + } + plus = minus = 0; + + } else { + + if (plus + minus === 0 || isNaN(c)) { + parser_exit(); + } + + if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') { + z['im'] += parseFloat((minus % 2 ? '-' : '') + c); + i++; + } else { + z['re'] += parseFloat((minus % 2 ? '-' : '') + c); + } + plus = minus = 0; + } + } + + // Still something on the stack + if (plus + minus > 0) { + parser_exit(); + } + break; + + case 'number': + z['im'] = 0; + z['re'] = a; + break; + + default: + parser_exit(); + } + + if (isNaN(z['re']) || isNaN(z['im'])) { + // If a calculation is NaN, we treat it as NaN and don't throw + //parser_exit(); + } + + return z; +}; + +/** + * @constructor + * @returns {Complex} + */ +function Complex(a, b) { + + if (!(this instanceof Complex)) { + return new Complex(a, b); + } + + var z = parse(a, b); + + this['re'] = z['re']; + this['im'] = z['im']; +} + +Complex.prototype = { + + 're': 0, + 'im': 0, + + /** + * Calculates the sign of a complex number, which is a normalized complex + * + * @returns {Complex} + */ + 'sign': function () { + + var abs = this['abs'](); + + return new Complex( + this['re'] / abs, + this['im'] / abs); + }, + + /** + * Adds two complex numbers + * + * @returns {Complex} + */ + 'add': function (a, b) { + + var z = new Complex(a, b); + + // Infinity + Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity + z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] + z['re'], + this['im'] + z['im']); + }, + + /** + * Subtracts two complex numbers + * + * @returns {Complex} + */ + 'sub': function (a, b) { + + var z = new Complex(a, b); + + // Infinity - Infinity = NaN + if (this['isInfinite']() && z['isInfinite']()) { + return Complex['NAN']; + } + + // Infinity - z = Infinity { where z != Infinity } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + return new Complex( + this['re'] - z['re'], + this['im'] - z['im']); + }, + + /** + * Multiplies two complex numbers + * + * @returns {Complex} + */ + 'mul': function (a, b) { + + var z = new Complex(a, b); + + // Infinity * 0 = NaN + if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity * z = Infinity { where z != 0 } + if (this['isInfinite']() || z['isInfinite']()) { + return Complex['INFINITY']; + } + + // Short circuit for real values + if (z['im'] === 0 && this['im'] === 0) { + return new Complex(this['re'] * z['re'], 0); + } + + return new Complex( + this['re'] * z['re'] - this['im'] * z['im'], + this['re'] * z['im'] + this['im'] * z['re']); + }, + + /** + * Divides two complex numbers + * + * @returns {Complex} + */ + 'div': function (a, b) { + + var z = new Complex(a, b); + + // 0 / 0 = NaN and Infinity / Infinity = NaN + if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) { + return Complex['NAN']; + } + + // Infinity / 0 = Infinity + if (this['isInfinite']() || z['isZero']()) { + return Complex['INFINITY']; + } + + // 0 / Infinity = 0 + if (this['isZero']() || z['isInfinite']()) { + return Complex['ZERO']; + } + + a = this['re']; + b = this['im']; + + var c = z['re']; + var d = z['im']; + var t, x; + + if (0 === d) { + // Divisor is real + return new Complex(a / c, b / c); + } + + if (Math.abs(c) < Math.abs(d)) { + + x = c / d; + t = c * x + d; + + return new Complex( + (a * x + b) / t, + (b * x - a) / t); + + } else { + + x = d / c; + t = d * x + c; + + return new Complex( + (a + b * x) / t, + (b - a * x) / t); + } + }, + + /** + * Calculate the power of two complex numbers + * + * @returns {Complex} + */ + 'pow': function (a, b) { + + var z = new Complex(a, b); + + a = this['re']; + b = this['im']; + + if (z['isZero']()) { + return Complex['ONE']; + } + + // If the exponent is real + if (z['im'] === 0) { + + if (b === 0 && a > 0) { + + return new Complex(Math.pow(a, z['re']), 0); + + } else if (a === 0) { // If base is fully imaginary + + switch ((z['re'] % 4 + 4) % 4) { + case 0: + return new Complex(Math.pow(b, z['re']), 0); + case 1: + return new Complex(0, Math.pow(b, z['re'])); + case 2: + return new Complex(-Math.pow(b, z['re']), 0); + case 3: + return new Complex(0, -Math.pow(b, z['re'])); + } + } + } + + /* I couldn't find a good formula, so here is a derivation and optimization + * + * z_1^z_2 = (a + bi)^(c + di) + * = exp((c + di) * log(a + bi) + * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a)) + * =>... + * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a)) + * + * =>... + * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a)) + * + * => + * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1)) + * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1)) + * + */ + + if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) { + return Complex['ZERO']; + } + + var arg = Math.atan2(b, a); + var loh = logHypot(a, b); + + a = Math.exp(z['re'] * loh - z['im'] * arg); + b = z['im'] * loh + z['re'] * arg; + return new Complex( + a * Math.cos(b), + a * Math.sin(b)); + }, + + /** + * Calculate the complex square root + * + * @returns {Complex} + */ + 'sqrt': function () { + + var a = this['re']; + var b = this['im']; + var r = this['abs'](); + + var re, im; + + if (a >= 0) { + + if (b === 0) { + return new Complex(Math.sqrt(a), 0); + } + + re = 0.5 * Math.sqrt(2.0 * (r + a)); + } else { + re = Math.abs(b) / Math.sqrt(2 * (r - a)); + } + + if (a <= 0) { + im = 0.5 * Math.sqrt(2.0 * (r - a)); + } else { + im = Math.abs(b) / Math.sqrt(2 * (r + a)); + } + + return new Complex(re, b < 0 ? -im : im); + }, + + /** + * Calculate the complex exponent + * + * @returns {Complex} + */ + 'exp': function () { + + var tmp = Math.exp(this['re']); + + if (this['im'] === 0) { + //return new Complex(tmp, 0); + } + return new Complex( + tmp * Math.cos(this['im']), + tmp * Math.sin(this['im'])); + }, + + /** + * Calculate the complex exponent and subtracts one. + * + * This may be more accurate than `Complex(x).exp().sub(1)` if + * `x` is small. + * + * @returns {Complex} + */ + 'expm1': function () { + + /** + * exp(a + i*b) - 1 + = exp(a) * (cos(b) + j*sin(b)) - 1 + = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b) + */ + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.expm1(a) * Math.cos(b) + cosm1(b), + Math.exp(a) * Math.sin(b)); + }, + + /** + * Calculate the natural log + * + * @returns {Complex} + */ + 'log': function () { + + var a = this['re']; + var b = this['im']; + + if (b === 0 && a > 0) { + //return new Complex(Math.log(a), 0); + } + + return new Complex( + logHypot(a, b), + Math.atan2(b, a)); + }, + + /** + * Calculate the magnitude of the complex number + * + * @returns {number} + */ + 'abs': function () { + + return hypot(this['re'], this['im']); + }, + + /** + * Calculate the angle of the complex number + * + * @returns {number} + */ + 'arg': function () { + + return Math.atan2(this['im'], this['re']); + }, + + /** + * Calculate the sine of the complex number + * + * @returns {Complex} + */ + 'sin': function () { + + // sin(z) = ( e^iz - e^-iz ) / 2i + // = sin(a)cosh(b) + i cos(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.sin(a) * cosh(b), + Math.cos(a) * sinh(b)); + }, + + /** + * Calculate the cosine + * + * @returns {Complex} + */ + 'cos': function () { + + // cos(z) = ( e^iz + e^-iz ) / 2 + // = cos(a)cosh(b) - i sin(a)sinh(b) + + var a = this['re']; + var b = this['im']; + + return new Complex( + Math.cos(a) * cosh(b), + -Math.sin(a) * sinh(b)); + }, + + /** + * Calculate the tangent + * + * @returns {Complex} + */ + 'tan': function () { + + // tan(z) = sin(z) / cos(z) + // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) ) + // = ( e^2iz - 1 ) / i( e^2iz + 1 ) + // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) ) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) + cosh(b); + + return new Complex( + Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the cotangent + * + * @returns {Complex} + */ + 'cot': function () { + + // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci)) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = Math.cos(a) - cosh(b); + + return new Complex( + -Math.sin(a) / d, + sinh(b) / d); + }, + + /** + * Calculate the secant + * + * @returns {Complex} + */ + 'sec': function () { + + // sec(c) = 2 / (e^(ci) + e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a); + + return new Complex( + Math.cos(a) * cosh(b) / d, + Math.sin(a) * sinh(b) / d); + }, + + /** + * Calculate the cosecans + * + * @returns {Complex} + */ + 'csc': function () { + + // csc(c) = 2i / (e^(ci) - e^(-ci)) + + var a = this['re']; + var b = this['im']; + var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a); + + return new Complex( + Math.sin(a) * cosh(b) / d, + -Math.cos(a) * sinh(b) / d); + }, + + /** + * Calculate the complex arcus sinus + * + * @returns {Complex} + */ + 'asin': function () { + + // asin(c) = -i * log(ci + sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(t2['im'], -t2['re']); + }, + + /** + * Calculate the complex arcus cosinus + * + * @returns {Complex} + */ + 'acos': function () { + + // acos(c) = i * log(c - i * sqrt(1 - c^2)) + + var a = this['re']; + var b = this['im']; + + var t1 = new Complex( + b * b - a * a + 1, + -2 * a * b)['sqrt'](); + + var t2 = new Complex( + t1['re'] - b, + t1['im'] + a)['log'](); + + return new Complex(Math.PI / 2 - t2['im'], t2['re']); + }, + + /** + * Calculate the complex arcus tangent + * + * @returns {Complex} + */ + 'atan': function () { + + // atan(c) = i / 2 log((i + x) / (i - x)) + + var a = this['re']; + var b = this['im']; + + if (a === 0) { + + if (b === 1) { + return new Complex(0, Infinity); + } + + if (b === -1) { + return new Complex(0, -Infinity); + } + } + + var d = a * a + (1.0 - b) * (1.0 - b); + + var t1 = new Complex( + (1 - b * b - a * a) / d, + -2 * a / d).log(); + + return new Complex(-0.5 * t1['im'], 0.5 * t1['re']); + }, + + /** + * Calculate the complex arcus cotangent + * + * @returns {Complex} + */ + 'acot': function () { + + // acot(c) = i / 2 log((c - i) / (c + i)) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + return new Complex(Math.atan2(1, a), 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atan() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atan(); + }, + + /** + * Calculate the complex arcus secant + * + * @returns {Complex} + */ + 'asec': function () { + + // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acos() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acos(); + }, + + /** + * Calculate the complex arcus cosecans + * + * @returns {Complex} + */ + 'acsc': function () { + + // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2)) + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(Math.PI / 2, Infinity); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asin() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asin(); + }, + + /** + * Calculate the complex sinh + * + * @returns {Complex} + */ + 'sinh': function () { + + // sinh(c) = (e^c - e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + sinh(a) * Math.cos(b), + cosh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex cosh + * + * @returns {Complex} + */ + 'cosh': function () { + + // cosh(c) = (e^c + e^-c) / 2 + + var a = this['re']; + var b = this['im']; + + return new Complex( + cosh(a) * Math.cos(b), + sinh(a) * Math.sin(b)); + }, + + /** + * Calculate the complex tanh + * + * @returns {Complex} + */ + 'tanh': function () { + + // tanh(c) = (e^c - e^-c) / (e^c + e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) + Math.cos(b); + + return new Complex( + sinh(a) / d, + Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'coth': function () { + + // coth(c) = (e^c + e^-c) / (e^c - e^-c) + + var a = 2 * this['re']; + var b = 2 * this['im']; + var d = cosh(a) - Math.cos(b); + + return new Complex( + sinh(a) / d, + -Math.sin(b) / d); + }, + + /** + * Calculate the complex coth + * + * @returns {Complex} + */ + 'csch': function () { + + // csch(c) = 2 / (e^c - e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) - cosh(2 * a); + + return new Complex( + -2 * sinh(a) * Math.cos(b) / d, + 2 * cosh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex sech + * + * @returns {Complex} + */ + 'sech': function () { + + // sech(c) = 2 / (e^c + e^-c) + + var a = this['re']; + var b = this['im']; + var d = Math.cos(2 * b) + cosh(2 * a); + + return new Complex( + 2 * cosh(a) * Math.cos(b) / d, + -2 * sinh(a) * Math.sin(b) / d); + }, + + /** + * Calculate the complex asinh + * + * @returns {Complex} + */ + 'asinh': function () { + + // asinh(c) = log(c + sqrt(c^2 + 1)) + + var tmp = this['im']; + this['im'] = -this['re']; + this['re'] = tmp; + var res = this['asin'](); + + this['re'] = -this['im']; + this['im'] = tmp; + tmp = res['re']; + + res['re'] = -res['im']; + res['im'] = tmp; + return res; + }, + + /** + * Calculate the complex acosh + * + * @returns {Complex} + */ + 'acosh': function () { + + // acosh(c) = log(c + sqrt(c^2 - 1)) + + var res = this['acos'](); + if (res['im'] <= 0) { + var tmp = res['re']; + res['re'] = -res['im']; + res['im'] = tmp; + } else { + var tmp = res['im']; + res['im'] = -res['re']; + res['re'] = tmp; + } + return res; + }, + + /** + * Calculate the complex atanh + * + * @returns {Complex} + */ + 'atanh': function () { + + // atanh(c) = log((1+c) / (1-c)) / 2 + + var a = this['re']; + var b = this['im']; + + var noIM = a > 1 && b === 0; + var oneMinus = 1 - a; + var onePlus = 1 + a; + var d = oneMinus * oneMinus + b * b; + + var x = (d !== 0) + ? new Complex( + (onePlus * oneMinus - b * b) / d, + (b * oneMinus + onePlus * b) / d) + : new Complex( + (a !== -1) ? (a / 0) : 0, + (b !== 0) ? (b / 0) : 0); + + var temp = x['re']; + x['re'] = logHypot(x['re'], x['im']) / 2; + x['im'] = Math.atan2(x['im'], temp) / 2; + if (noIM) { + x['im'] = -x['im']; + } + return x; + }, + + /** + * Calculate the complex acoth + * + * @returns {Complex} + */ + 'acoth': function () { + + // acoth(c) = log((c+1) / (c-1)) / 2 + + var a = this['re']; + var b = this['im']; + + if (a === 0 && b === 0) { + return new Complex(0, Math.PI / 2); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).atanh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).atanh(); + }, + + /** + * Calculate the complex acsch + * + * @returns {Complex} + */ + 'acsch': function () { + + // acsch(c) = log((1+sqrt(1+c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (b === 0) { + + return new Complex( + (a !== 0) + ? Math.log(a + Math.sqrt(a * a + 1)) + : Infinity, 0); + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).asinh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).asinh(); + }, + + /** + * Calculate the complex asech + * + * @returns {Complex} + */ + 'asech': function () { + + // asech(c) = log((1+sqrt(1-c^2))/c) + + var a = this['re']; + var b = this['im']; + + if (this['isZero']()) { + return Complex['INFINITY']; + } + + var d = a * a + b * b; + return (d !== 0) + ? new Complex( + a / d, + -b / d).acosh() + : new Complex( + (a !== 0) ? a / 0 : 0, + (b !== 0) ? -b / 0 : 0).acosh(); + }, + + /** + * Calculate the complex inverse 1/z + * + * @returns {Complex} + */ + 'inverse': function () { + + // 1 / 0 = Infinity and 1 / Infinity = 0 + if (this['isZero']()) { + return Complex['INFINITY']; + } + + if (this['isInfinite']()) { + return Complex['ZERO']; + } + + var a = this['re']; + var b = this['im']; + + var d = a * a + b * b; + + return new Complex(a / d, -b / d); + }, + + /** + * Returns the complex conjugate + * + * @returns {Complex} + */ + 'conjugate': function () { + + return new Complex(this['re'], -this['im']); + }, + + /** + * Gets the negated complex number + * + * @returns {Complex} + */ + 'neg': function () { + + return new Complex(-this['re'], -this['im']); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'ceil': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.ceil(this['re'] * places) / places, + Math.ceil(this['im'] * places) / places); + }, + + /** + * Floors the actual complex number + * + * @returns {Complex} + */ + 'floor': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.floor(this['re'] * places) / places, + Math.floor(this['im'] * places) / places); + }, + + /** + * Ceils the actual complex number + * + * @returns {Complex} + */ + 'round': function (places) { + + places = Math.pow(10, places || 0); + + return new Complex( + Math.round(this['re'] * places) / places, + Math.round(this['im'] * places) / places); + }, + + /** + * Compares two complex numbers + * + * **Note:** new Complex(Infinity).equals(Infinity) === false + * + * @returns {boolean} + */ + 'equals': function (a, b) { + + var z = new Complex(a, b); + + return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] && + Math.abs(z['im'] - this['im']) <= Complex['EPSILON']; + }, + + /** + * Clones the actual object + * + * @returns {Complex} + */ + 'clone': function () { + + return new Complex(this['re'], this['im']); + }, + + /** + * Gets a string of the actual complex number + * + * @returns {string} + */ + 'toString': function () { + + var a = this['re']; + var b = this['im']; + var ret = ""; + + if (this['isNaN']()) { + return 'NaN'; + } + + if (this['isInfinite']()) { + return 'Infinity'; + } + + if (Math.abs(a) < Complex['EPSILON']) { + a = 0; + } + + if (Math.abs(b) < Complex['EPSILON']) { + b = 0; + } + + // If is real number + if (b === 0) { + return ret + a; + } + + if (a !== 0) { + ret += a; + ret += " "; + if (b < 0) { + b = -b; + ret += "-"; + } else { + ret += "+"; + } + ret += " "; + } else if (b < 0) { + b = -b; + ret += "-"; + } + + if (1 !== b) { // b is the absolute imaginary part + ret += b; + } + return ret + "i"; + }, + + /** + * Returns the actual number as a vector + * + * @returns {Array} + */ + 'toVector': function () { + + return [this['re'], this['im']]; + }, + + /** + * Returns the actual real value of the current object + * + * @returns {number|null} + */ + 'valueOf': function () { + + if (this['im'] === 0) { + return this['re']; + } + return null; + }, + + /** + * Determines whether a complex number is not on the Riemann sphere. + * + * @returns {boolean} + */ + 'isNaN': function () { + return isNaN(this['re']) || isNaN(this['im']); + }, + + /** + * Determines whether or not a complex number is at the zero pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isZero': function () { + return this['im'] === 0 && this['re'] === 0; + }, + + /** + * Determines whether a complex number is not at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isFinite': function () { + return isFinite(this['re']) && isFinite(this['im']); + }, + + /** + * Determines whether or not a complex number is at the infinity pole of the + * Riemann sphere. + * + * @returns {boolean} + */ + 'isInfinite': function () { + return !(this['isNaN']() || this['isFinite']()); + } +}; + +Complex['ZERO'] = new Complex(0, 0); +Complex['ONE'] = new Complex(1, 0); +Complex['I'] = new Complex(0, 1); +Complex['PI'] = new Complex(Math.PI, 0); +Complex['E'] = new Complex(Math.E, 0); +Complex['INFINITY'] = new Complex(Infinity, Infinity); +Complex['NAN'] = new Complex(NaN, NaN); +Complex['EPSILON'] = 1e-15; diff --git a/24_10_22_faktorialis/node_modules/complex.js/tests/complex.test.js b/24_10_22_faktorialis/node_modules/complex.js/tests/complex.test.js new file mode 100644 index 0000000..c43d589 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/complex.js/tests/complex.test.js @@ -0,0 +1,1082 @@ + +var Complex = require("complex.js"); +var assert = require("assert"); + +var functionTests = [{ + set: Complex.I, + fn: "mul", + param: Complex(Math.PI).exp(), + expect: "23.140692632779267i" +}, { + set: new Complex(1, 4), + fn: "mul", + param: 3, + expect: "3 + 12i" +}, { + set: "4 + 3i", + fn: "add", + param: "-3 - 2i", + expect: "1 + i" +}, { + set: "3i", + fn: "add", + param: "-2i", + expect: "i" +}, { + set: "4", + fn: "add", + param: "-3", + expect: "1" +}, { + set: 9, + fn: "sqrt", + expect: "3" +}, { + set: -9, + fn: "sqrt", + expect: "3i" +}, { + set: "-36", + fn: "sqrt", + expect: "6i" +}, { + set: "36i", + fn: "sqrt", + expect: "4.242640687119285 + 4.242640687119285i" +}, { + set: Infinity, + fn: "mul", + param: "i", + expect: "Infinity" +}, { + set: "-36i", + fn: "sqrt", + expect: "4.242640687119285 - 4.242640687119285i" +}, { + set: "4 + 2i", + fn: "div", + param: "0", + expect: "Infinity" +}, { + set: "0", + fn: "div", + param: Infinity, + expect: "0" +}, { + set: -Infinity, + fn: "div", + param: 0, + expect: "Infinity" +}, { + set: Infinity, + fn: "div", + param: Infinity, + expect: "NaN" +}, { + set: 0, + fn: "div", + param: 0, + expect: "NaN" +}, { + set: "4 + 2i", + fn: "div", + param: "1 + i", + expect: "3 - i" +}, { + set: "25", + fn: "div", + param: "3 - 4i", + expect: "3 + 4i" +}, { + set: "3 - 2i", + fn: "div", + param: "i", + expect: "-2 - 3i" +}, { + set: "4i", + fn: "mul", + param: "-5i", + expect: "20" +}, { + set: "3 - 6i", + fn: "mul", + param: "i", + expect: "6 + 3i" +}, { + set: Infinity, + fn: "mul", + param: 0, + expect: "NaN" +}, { + set: "3 + 4i", + fn: "add", + param: "5 - 7i", + expect: "8 - 3i" +}, { + set: Infinity, + fn: "add", + param: Infinity, + expect: "NaN" +}, { + set: -Infinity, + fn: "sub", + param: -Infinity, + expect: "NaN" +}, { + set: "6i", + fn: "div", + param: "3 - 12i", + expect: "-0.47058823529411764 + 0.11764705882352941i" +}, { + set: "36 + 36i", + fn: "sqrt", + expect: "6.59210468080686 + 2.730539163373364i" +}, { + set: "36 - 36i", + fn: "sqrt", + expect: "6.59210468080686 - 2.730539163373364i" +}, { + set: "-36 + 36i", + fn: "sqrt", + expect: "2.730539163373364 + 6.59210468080686i" +}, { + set: "-36 - 36i", + fn: "sqrt", + expect: "2.730539163373364 - 6.59210468080686i" +}, { + set: "0", + fn: "sqrt", + expect: "0" +}, { + set: Math.E, + fn: "log", + expect: "1" +}, { + set: 0, + fn: "log", + expect: "Infinity" +}, { + set: Infinity, + fn: "mul", + param: 3, + expect: "Infinity" +}, { + set: "-1", + fn: "log", + expect: Math.PI + "i" +}, { + set: "i", + fn: "log", + expect: (Math.PI / 2) + "i" +}, { + set: "3 + 2i", + fn: "log", + expect: Math.log(13) / 2 + " + " + Math.atan2(2, 3) + "i" +}, { + set: "3 - 2i", + fn: "log", + expect: Math.log(13) / 2 + " - " + Math.atan2(2, 3) + "i" +}, { + set: 1, + fn: "exp", + expect: "" + Math.E +}, { + set: "i", + fn: "exp", + expect: Math.cos(1) + " + " + Math.sin(1) + "i" +}, { + set: "i", + fn: "mul", + param: "i", + expect: "-1" +}, { + set: "3 + 2i", + fn: "exp", + expect: "-8.358532650935372 + 18.263727040666765i" +}, { + set: "3 - 2i", + fn: "exp", + expect: "-8.358532650935372 - 18.263727040666765i" +}, { + set: "3 - 2i", + fn: "expm1", + expect: "-9.358532650935372 - 18.263727040666765i" +}, { + set: "0", + fn: "expm1", + expect: "0" +}, { + set: "1e-6", + fn: "expm1", + expect: "0.0000010000005000001665" +}, { + set: "1e-5 + 5i", + fn: "expm1", + expect: "-0.716334977900736 - 0.9589338639538314i" +}, { + set: "1.2e-7 - 2e-6i", + fn: "expm1", + expect: "1.1999800719976027e-7 - 0.000002000000239998681i" +}, { + set: "3", + fn: "pow", + param: "3", + expect: "27" +}, { + set: -2, + fn: "pow", + param: 1.5, + expect: "-2.82842712474619i" +}, { + set: -8, + fn: "pow", + param: 1 / 3, + expect: "1 + 1.732050807568877i" +}, { + set: -25, + fn: "sqrt", + expect: "5i" +}, { + set: -25, + fn: "pow", + param: 0.5, + expect: "5i" +}, { + set: "0", + fn: "pow", + param: "1+i", + expect: "0" +}, { + set: "i", + fn: "pow", + param: "0", + expect: "1" +}, { + set: "87", + fn: "pow", + param: "3", + expect: "658503" +}, { + set: "i", + fn: "pow", + param: "1", + expect: "i" +}, { + set: "i", + fn: "pow", + param: "2", + expect: "-1" +}, { + set: "i", + fn: "pow", + param: "3", + expect: "-i" +}, { + set: "i", + fn: "pow", + param: "4", + expect: "1" +}, { + set: "i", + fn: "pow", + param: "5", + expect: "i" +}, { + set: 7, + fn: "pow", + param: 2, + expect: '49' +}, { + set: 0, + fn: "pow", + param: 2, + expect: '0' +}, { + set: "3i", + fn: "pow", + param: "3i", + expect: "-0.008876640735623678 - 0.0013801328997494863i" +}, { + set: { re: 3, im: 4 }, + fn: "abs", + expect: "5" +}, { + set: { re: 10, im: 24 }, + fn: "abs", + expect: "26" +}, { + set: "+++++--+1 + 4i", + fn: "mul", + param: "3 + 2i", + expect: "-5 + 14i" +}, { + set: "4 + 16i", + fn: "div", + param: "4.0000", + expect: "1 + 4i" +}, { + set: { re: -7.1, im: 2.5 }, + fn: "neg", + expect: "7.1 - 2.5i" +}, { + set: { re: 1, im: 1 }, + fn: "div", + param: { re: 3, im: 4 }, + expect: 7 / 25 + " - " + 1 / 25 + "i" +}, { + set: new Complex(-7.1, 2.5), + fn: "neg", + expect: "7.1 - 2.5i" +}, { + set: { re: 1, im: 1 }, + fn: "arg", + expect: "" + Math.PI / 4 +}, { + set: { re: -1, im: -1 }, + fn: "arg", + expect: "" + -3 * Math.PI / 4 +}, { + set: { re: 0, im: 1 }, + fn: "arg", + expect: "" + Math.PI / 2 +}, { + set: { re: 1, im: 0.5 * Math.sqrt(4 / 3) }, + fn: "arg", + expect: "" + Math.PI / 6 +}, { + set: "3 + 4i", + fn: "conjugate", + expect: "3 - 4i" +}, { + set: { re: 99, im: 50 }, + fn: "conjugate", + expect: "99 - 50i" +}, { + set: { re: 0, im: 0 }, + fn: "conjugate", + expect: "0" +}, { + set: { re: 1, im: 23 }, + fn: "conjugate", + expect: "1 - 23i" +}, { + set: "2 + 8i", + fn: "div", + param: new Complex(1, 2), + expect: "3.6 + 0.8i" +}, { + set: "2 + 8i", + fn: "div", + param: "2 + 8i", + expect: "1" +}, { + set: -Infinity, + fn: "div", + param: 3, + expect: "Infinity" +}, { + set: "3+4i", + fn: "add", + param: "5 - i", + expect: "8 + 3i" +}, { + set: { re: 1, im: 2 }, + fn: "add", + param: "4 + 6i", + expect: "5 + 8i" +}, { + set: { re: 5, im: 8 }, + fn: "sub", + param: "4 + 6i", + expect: "1 + 2i" +}, { + set: "3 + 4i", + fn: "sub", + param: "2 - 5i", + expect: "1 + 9i" +}, { + set: "1 + 2i", + fn: "pow", + param: "2", + expect: "-2.999999999999999 + 4.000000000000001i" +}, { + set: "1 + 2i", + fn: "pow", + param: "1 + 2i", + expect: "-0.22251715680177267 + 0.10070913113607541i" +}, { + set: { re: 1, im: 2 }, + fn: "pow", + param: new Complex(3, 4), + expect: "0.1290095940744669 + 0.03392409290517001i" +}, { + fn: "abs", + set: new Complex(3, 4), + expect: "5" +}, { + param: 2, + fn: "pow", + set: new Complex(1, 2), + expect: "-2.999999999999999 + 4.000000000000001i" +}, { + set: "i", + fn: "pow", + param: 7, + expect: "-i" +}, { + set: "2+3i", + fn: "mul", + param: "4+5i", + expect: "-7 + 22i" +}, { + set: "3 + 4i", + fn: "mul", + param: "2 - 5i", + expect: "26 - 7i" +}, { + set: "i", + fn: "pow", + param: 4, + expect: "1" +}, { + set: "i", + fn: "pow", + param: 5, + expect: "i" +}, { + set: "0-0i", + fn: "pow", + param: 2, + expect: "0" +}, { + set: "0-0i", + fn: "pow", + param: 0, + expect: "1" +}, { + set: "1 + 4i", + fn: "sqrt", + expect: "1.600485180440241 + 1.2496210676876531i" +}, { + set: { re: -3, im: 4 }, + fn: "sqrt", + expect: "1 + 2i" +}, { + set: { re: 3, im: -4 }, + fn: "sqrt", + expect: "2 - i" +}, { + set: { re: -3, im: -4 }, + fn: "sqrt", + expect: "1 - 2i" +}, { + set: [-2, 0], + fn: "pow", + param: 2, + expect: "4" +}, { + set: { abs: 1, arg: 0 }, + fn: "equals", + param: { re: 1, im: 0 }, + expect: "true" +}, { + set: -Complex.E.pow(2), + fn: "log", + expect: "2 + 3.141592653589793i" +}, { + set: "4 + 3i", + fn: "log", + expect: "1.6094379124341003 + 0.6435011087932844i" +}, { + set: "4 + 3i", + fn: "exp", + expect: "-54.051758861078156 + 7.704891372731154i" +}, { + set: "1-2i", + fn: "sqrt", + expect: "1.272019649514069 - 0.7861513777574233i" +}, { + set: { re: 1, im: 2 }, + fn: "sin", + expect: "3.165778513216168 + 1.9596010414216063i" +}, { + set: "i", + fn: "cos", + expect: "1.5430806348152437" +}, { + set: "i", + fn: "acos", + expect: "1.5707963267948966 - 0.8813735870195428i" +}, { + set: { re: 1, im: 2 }, + fn: "cos", + expect: "2.0327230070196656 - 3.0518977991518i" +}, { + set: { re: 1, im: 2 }, + fn: "tan", + expect: "0.03381282607989669 + 1.0147936161466335i" +}, { + set: { re: 1, im: 3 }, + fn: "sinh", + expect: "-1.1634403637032504 + 0.21775955162215221i" +}, { + set: { re: 1, im: 3 }, + fn: "cosh", + expect: "-1.5276382501165433 + 0.1658444019189788i" +}, { + set: { re: 1, im: 3 }, + fn: "tanh", + expect: "0.7680176472869112 - 0.059168539566050726i" +}, { + set: { re: 1, im: 3 }, + fn: "inverse", + expect: "0.1 - 0.3i" +}, { + set: "3+4i", + fn: "inverse", + expect: "0.12 - 0.16i" // 3/25 - (4/25)i +}, { + set: { re: 0.5, im: -0.5 }, + fn: "inverse", + expect: "1 + i" +}, { + set: "1 + i", + fn: "inverse", + expect: "0.5 - 0.5i" +}, { + set: "0", + fn: "inverse", + expect: "Infinity" +}, { + set: Infinity, + fn: "inverse", + expect: "0" +}, { + set: Complex['EPSILON'], + fn: "equals", + param: 1e-16, + expect: "true" +}, { + set: 0, + fn: "equals", + param: "5i", + expect: "false" +}, { + set: 5, + fn: "equals", + param: "5i", + expect: "false" +}, { + set: 5, + fn: "equals", + param: 5, + expect: "true" +}, { + set: "10i", + fn: "equals", + param: "10i", + expect: "true" +}, { + set: "2 + 3i", + fn: "equals", + param: "2 + 3i", + expect: "true" +}, { + set: "2 + 3i", + fn: "equals", + param: "5i", + expect: "false" +}, { + set: "2 + 3i", + fn: "round", + param: "0", + expect: "2 + 3i" +}, { + set: "2.5 + 3.5i", + fn: "round", + param: "1", + expect: "2.5 + 3.5i" +}, { + set: "2.5 + 3.5i", + fn: "sign", + param: null, + expect: "0.5812381937190965 + 0.813733471206735i" +}, { + set: "10 + 24i", + fn: "sign", + param: null, + expect: "0.38461538461538464 + 0.9230769230769231i" +}, { + set: "1e3i", + fn: "add", + param: "3e-3 + 1e2i", + expect: "0.003 + 1100i" +}, { + set: "3.14-4i", + fn: "coth", + expect: "0.9994481238383576 + 0.0037048958915019857i" +}, { + set: "8i-31", + fn: "cot", + expect: "1.6636768291213935e-7 - 1.0000001515864902i" +}, { + set: Complex(1, 1).sub(0, 1), // Distance + fn: "abs", + expect: "1" +}, { + set: Complex(1, 1), // Rotate around center + fn: "mul", + param: { abs: 1, arg: Math.PI / 2 }, + expect: "-0.9999999999999999 + i" +}, { + set: Complex(1, 1).sub(0, 1).mul({ abs: 1, arg: Math.PI / 2 }), // Rotate around another point + fn: "add", + param: "i", + expect: "2i" +}, { + set: Complex(0, 10000000000), + fn: "log", + param: null, + expect: "23.025850929940457 + 1.5707963267948966i" +}, { + set: Complex(0, 1000000000000000), + fn: "log", + param: null, + expect: "34.538776394910684 + 1.5707963267948966i" +}, { + set: Complex(0, 100000000000000000), + fn: "log", + param: null, + expect: "39.14394658089878 + 1.5707963267948966i" +}, { + set: Complex(0, 10000000000000000000), + fn: "log", + param: null, + expect: "43.74911676688687 + 1.5707963267948966i" +}, { + set: Complex(0, 1e+30), + fn: "log", + param: null, + expect: "69.07755278982137 + 1.5707963267948966i" +}, { + set: Complex(1, 10000000000), + fn: "log", + param: null, + expect: "23.025850929940454 + 1.5707963266948965i" +}, { + set: Complex(1, 1000000000000000), + fn: "log", + param: null, + expect: "34.538776394910684 + 1.5707963267948957i" +}, { + set: Complex(1, 100000000000000000), + fn: "log", + param: null, + expect: "39.14394658089878 + 1.5707963267948966i" +}, { + set: Complex(1, 10000000000000000000), + fn: "log", + param: null, + expect: "43.74911676688687 + 1.5707963267948966i" +}, { + set: Complex(1, 1e+30), + fn: "log", + param: null, + expect: "69.07755278982137 + 1.5707963267948966i" +}, { + set: Complex(-1, 10000000000), + fn: "log", + param: null, + expect: "23.025850929940454 + 1.5707963268948968i" +}, { + set: Complex(-1, 1000000000000000), + fn: "log", + param: null, + expect: "34.538776394910684 + 1.5707963267948977i" +}, { + set: Complex(-1, 100000000000000000), + fn: "log", + param: null, + expect: "39.14394658089878 + 1.5707963267948968i" +}, { + set: Complex(-1, 10000000000000000000), + fn: "log", + param: null, + expect: "43.74911676688687 + 1.5707963267948966i" +}, { + set: Complex(-1, 1e+30), + fn: "log", + param: null, + expect: "69.07755278982137 + 1.5707963267948966i" +}]; + +var constructorTests = [{ + set: null, + expect: "0" +}, { + set: undefined, + expect: "0" +}, { + set: "foo", + error: "SyntaxError: Invalid Param" +}, { + set: {}, + error: "SyntaxError: Invalid Param" +}, { + set: " + i", + expect: "i" +}, { + set: "3+4i", + expect: "3 + 4i" +}, { + set: "i", + expect: "i" +}, { + set: "3", + expect: "3" +}, { + set: [9, 8], + expect: "9 + 8i" +}, { + set: "2.3", + expect: "2.3" +}, { + set: "2.3", + expect: "2.3" +}, { + set: "0", + expect: "0" +}, { + set: "-0", + expect: "0" +}, { + set: { re: -0, im: 0 }, + expect: "0" +}, { + set: { re: 0, im: -0 }, + expect: "0" +}, { + set: Infinity, + expect: "Infinity" +}, { + set: -Infinity, + expect: "Infinity" +}, { + set: { re: Infinity, im: 0 }, + expect: "Infinity" +}, { + set: { re: -Infinity, im: 0 }, + expect: "Infinity" +}, { + set: { re: 0, im: Infinity }, + expect: "Infinity" +}, { + set: { re: 0, im: -Infinity }, + expect: "Infinity" +}, { + set: " + 7 - i + 3i - + + + + 43 + 2i - i4 + - 33 + 65 - 1 ", + expect: "-5" +}, { + set: " + 7 - i + 3i - + + + + 43 + 2i - i4 + - 33 + 65 - 1 + ", + error: "SyntaxError: Invalid Param" +}, { + set: "-3x + 4", + error: "SyntaxError: Invalid Param" +}, { + set: "- + 7", + expect: "-7" +}, { + set: "4 5i", + error: "SyntaxError: Invalid Param" +}, { + set: "-", + error: "SyntaxError: Invalid Param" +}, { + set: "2.2e-1-3.2e-1i", + expect: "0.22 - 0.32i" +}, { + set: "2.2.", + error: "SyntaxError: Invalid Param" +}, { + set: { r: 0, phi: 4 }, + expect: "0" +}, { + set: { r: 1, phi: 1 }, + expect: "0.5403023058681398 + 0.8414709848078965i" +}, { + set: { r: Infinity, phi: 0 }, + expect: "Infinity" +}, { + set: { r: Infinity, phi: 2 }, + expect: "Infinity" +}, { + set: { r: Infinity, phi: Infinity }, + expect: "NaN" +}, { + set: { r: Infinity, phi: NaN }, + expect: "NaN" +},{ + set: "1000_000i", + expect: "1000000i" +} +]; + +for (let i = 0, len = constructorTests.length; i < len; ++i) { + if (constructorTests[i].set != null && constructorTests[i].set.hasOwnProperty('r')) { + constructorTests.push({ + set: { + abs: constructorTests[i].set.r, + arg: constructorTests[i].set.phi, + }, + expect: constructorTests[i].expect + }) + } +} + + +function stringify(value) { + return JSON.stringify(value, function replacer(key, val) { + if (typeof val === "number") { + return val.toString(); + } + return val; + }) +} + +function describeTest(test) { + var ctor = "new Complex(" + (test.set !== undefined ? stringify(test.set) : "") + ")"; + + var fnCall = test.fn == null + ? "" + : "." + test.fn + "(" + (test.param !== undefined ? stringify(test.param) : "") + ")"; + + var expectedResult = test.expect == null + ? "" + : " === " + stringify(test.expect); + + var error = test.error == null + ? "" + : " should throw " + test.error; + + return ctor + fnCall + expectedResult + error; +} + +describe("Complex functions", function () { + + for (var i = 0; i < functionTests.length; i++) { + + (function (test) { + + it(describeTest(test), function () { + if (test.error) { + try { + new Complex(test.set)[test.fn](test.param); + } catch (e) { + assert.strictEqual(e.toString(), test.error.toString()); + } + } else { + assert.strictEqual(new Complex(test.set)[test.fn](test.param).toString(), test.expect); + } + }); + })(functionTests[i]); + } +}); + +describe("Complex constructor", function () { + + for (var i = 0; i < constructorTests.length; i++) { + + (function (test) { + it(describeTest(test), function () { + if (test.error) { + try { + new Complex(test.set); + } catch (e) { + assert.strictEqual(e.toString(), test.error.toString()); + } + } else { + assert.strictEqual(new Complex(test.set).toString(), test.expect); + } + }); + })(constructorTests[i]); + } +}); + +describe("Complex Details", function () { + + it("should work with different params", function () { + assert.strictEqual(Complex(1, -1).toString(), "1 - i"); + assert.strictEqual(Complex(0, 0).toString(), "0"); + assert.strictEqual(Complex(0, 2).toString(), "2i"); + assert.strictEqual(Complex.I.toString(), "i"); + assert.strictEqual(Complex(0, -2).toString(), "-2i"); + assert.strictEqual(Complex({ re: 0, im: -2 }).toString(), "-2i"); + }); + + it("Complex Combinations", function () { + + var zero = Complex(0, 0), one = Complex(1, 1), two = Complex(2, 2); + + assert.strictEqual(zero.toString(), "0"); + assert.strictEqual(one.toString(), "1 + i"); + assert(one.neg().equals(Complex(-1, -1))); + assert(one.conjugate().equals(Complex(1, -1))); + assert.strictEqual(one.abs(), Math.SQRT2); + assert.strictEqual(one.arg(), Math.PI / 4); + assert.strictEqual(one.add(one).toString(), two.toString()); + assert.strictEqual(one.sub(one).toString(), zero.toString()); + assert.strictEqual(one.mul(2).toString(), two.toString()); + assert.strictEqual(one.mul(one).toString(), Complex(0, 2).toString()); + assert.strictEqual(one.div(2).toString(), "0.5 + 0.5i"); + assert.strictEqual(one.div(one).toString(), "1"); + assert.strictEqual(one.div(0).toString(), "Infinity"); + assert.strictEqual(one.exp().toString(), "1.4686939399158851 + 2.2873552871788423i"); + assert.strictEqual(one.log().toString(), "0.34657359027997264 + 0.7853981633974483i"); + assert.strictEqual(one.pow(one).toString(), "0.2739572538301211 + 0.5837007587586147i"); + assert.strictEqual(one.pow(zero).toString(), "1"); + assert.strictEqual(one.sqrt().toString(), "1.09868411346781 + 0.45508986056222733i"); + assert.strictEqual(one.sin().toString(), "1.2984575814159773 + 0.6349639147847361i"); + assert.strictEqual(one.cos().toString(), "0.8337300251311491 - 0.9888977057628651i"); + assert.strictEqual(one.tan().toString(), "0.27175258531951174 + 1.0839233273386948i"); + assert.strictEqual(one.asin().toString(), "0.6662394324925153 + 1.0612750619050355i"); + assert.strictEqual(one.acos().toString(), "0.9045568943023813 - 1.0612750619050355i"); + assert.strictEqual(one.atan().toString(), "1.0172219678978514 + 0.40235947810852507i"); + + assert.strictEqual(Complex(3, 4).abs(), 5); + + assert.strictEqual(Complex("5i + 3").log().exp().toString(), "3 + 5i") + assert.strictEqual(Complex("-2i - 1").log().exp().toString(), "-1 - 2i") + }); + + it("should calculate distributed conjugate", function () { + + var c1 = Complex(7, 3); + var c2 = Complex(1, 2); + + var r1 = c1.add(c2).conjugate(); + var r2 = c1.conjugate().add(c2.conjugate()); + + assert.strictEqual(r1.toString(), r2.toString()); + }); + + it("should be raised to power of 6", function () { + var c1 = Complex(2, 2); + + var t = c1.pow(6); + + assert.strictEqual(t.toString(), "-9.405287417451663e-14 - 511.9999999999995i"); + }); + + it("should handle inverse trig fns", function () { + + var values = [ + new Complex(2.3, 1.4), + new Complex(-2.3, 1.4), + new Complex(-2.3, -1.4), + new Complex(2.3, -1.4)]; + + var fns = ['sin', 'cos', 'tan']; + + for (var i = 0; i < values.length; i++) { + + for (var j = 0; j < 3; j++) { + + var a = values[i]['a' + fns[j]]()[fns[j]](); + + var res = values[i]; + + assert(Math.abs(a.re - res.re) < 1e-12 && Math.abs(a.im - res.im) < 1e-12); + } + } + }); + + it('should handle get real part', function () { + assert.strictEqual(Complex({ abs: 1, arg: Math.PI / 4 }).re, Math.SQRT2 / 2); + }); + + it('should handle get complex part', function () { + assert.strictEqual(Complex({ abs: 1, arg: Math.PI / 4 }).im, 0.7071067811865475); + }); + + it('should handle sum', function () { + assert.strictEqual(Complex({ abs: 1, arg: 0 }).add({ abs: 1, arg: Math.PI / 2 }).abs(), Math.SQRT2); + assert.strictEqual(Complex({ abs: 1, arg: 0 }).add({ abs: 1, arg: Math.PI / 2 }).arg(), Math.PI / 4); + }); + + it('should handle conjugate', function () { + assert.strictEqual(Complex({ abs: 1, arg: Math.PI / 4 }).conjugate().toString(), Complex({ abs: 1, arg: -Math.PI / 4 }).toString()); + }); + + it('should handle substract', function () { + assert.strictEqual(Complex({ abs: 1, arg: 0 }).sub({ abs: 1, arg: Math.PI / 2 }).abs().toString(), "1.414213562373095"); + assert.strictEqual(Complex({ abs: 1, arg: 0 }).sub({ abs: 1, arg: Math.PI / 2 }).arg().toString(), "-0.7853981633974484"); + }); + + it('should handle arg for the first quadrant', function () { + assert.strictEqual(Complex({ re: 1, im: 1 }).arg(), Math.PI / 4); + }); + + it('should handle arg for the second quadrant', function () { + assert.strictEqual(Complex({ re: -1, im: 1 }).arg(), 3 * Math.PI / 4); + }); + + it('should handle arg for the third quadrant', function () { + assert.strictEqual(Complex({ re: -1, im: -1 }).arg(), -3 * Math.PI / 4); + }); + + it('should handle arg for the fourth quadrant', function () { + assert.strictEqual(Complex({ re: 1, im: -1 }).arg(), -Math.PI / 4); + }); + + it('should handle arg for the fourth and first quadrant', function () { + assert.strictEqual(Complex({ re: 1, im: 0 }).arg(), 0); + }); + + it('should handle arg for first and second quadrant', function () { + assert.strictEqual(Complex({ re: 0, im: 1 }).arg(), Math.PI / 2); + }); + + it('should handle arg for the second and third quadrant', function () { + assert.strictEqual(Complex({ re: -1, im: 0 }).arg(), Math.PI); + }); + + it('should handle arg for the third and fourth quadrant', function () { + assert.strictEqual(Complex({ re: 0, im: -1 }).arg(), -Math.PI / 2); + }); + + it("should eat its own dog food", function () { + + var a = Complex(1, -5).toString(); + var b = Complex(a).toString(); + var c = Complex(b).mul(a); + + assert.strictEqual(c.toString(), '-24 - 10i'); + }); + + it("should calculate the absolute value of i", function () { + + var a = Complex("i").sign().inverse().mul("i"); + + assert.strictEqual(a.toString(), '1'); + }); + + it('should take the natural logarithm', function () { + var n = Complex(Math.E * Math.E).log().div("i").mul(-Math.PI * 2, 1); + + assert.strictEqual(n.toString(), '2 + ' + 4 * Math.PI + "i"); + }); + + it('should follow exp rules', function () { + + var a = Math.random() * 10; + var b = Math.random() * 10; + + var t1 = Complex({re: a, im: b}).exp(); + var t2 = Complex(a).exp().mul(Complex.I.mul(b).exp()); + var t3 = Complex(a).exp().mul(Complex({re:0, im: b}).exp()); + + assert.strictEqual(t1.toString(), t2.toString()); + assert.strictEqual(t2.toString(), t3.toString()); + }); + +}); diff --git a/24_10_22_faktorialis/node_modules/decimal.js/LICENCE.md b/24_10_22_faktorialis/node_modules/decimal.js/LICENCE.md new file mode 100644 index 0000000..1063109 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/LICENCE.md @@ -0,0 +1,23 @@ +The MIT Licence. + +Copyright (c) 2022 Michael Mclaughlin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/24_10_22_faktorialis/node_modules/decimal.js/README.md b/24_10_22_faktorialis/node_modules/decimal.js/README.md new file mode 100644 index 0000000..1d02eb7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/README.md @@ -0,0 +1,246 @@ +![decimal.js](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/decimaljs.png) + +An arbitrary-precision Decimal type for JavaScript. + +[![npm version](https://img.shields.io/npm/v/decimal.js.svg)](https://www.npmjs.com/package/decimal.js) +[![npm downloads](https://img.shields.io/npm/dw/decimal.js)](https://www.npmjs.com/package/decimal.js) +[![Build Status](https://travis-ci.org/MikeMcl/decimal.js.svg)](https://travis-ci.org/MikeMcl/decimal.js) +[![CDNJS](https://img.shields.io/cdnjs/v/decimal.js.svg)](https://cdnjs.com/libraries/decimal.js) + +
+ +## Features + + - Integers and floats + - Simple but full-featured API + - Replicates many of the methods of JavaScript's `Number.prototype` and `Math` objects + - Also handles hexadecimal, binary and octal values + - Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal + - No dependencies + - Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only + - Comprehensive [documentation](https://mikemcl.github.io/decimal.js/) and test set + - Used under the hood by [math.js](https://github.com/josdejong/mathjs) + - Includes a TypeScript declaration file: *decimal.d.ts* + +![API](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/API.png) + +The library is similar to [bignumber.js](https://github.com/MikeMcl/bignumber.js/), but here +precision is specified in terms of significant digits rather than decimal places, and all +calculations are rounded to the precision (similar to Python's decimal module) rather than just +those involving division. + +This library also adds the trigonometric functions, among others, and supports non-integer powers, +which makes it a significantly larger library than *bignumber.js* and the even smaller +[big.js](https://github.com/MikeMcl/big.js/). + +For a lighter version of this library without the trigonometric functions see +[decimal.js-light](https://github.com/MikeMcl/decimal.js-light/). + +## Load + +The library is the single JavaScript file *decimal.js* or ES module *decimal.mjs*. + +Browser: + +```html + + + +``` + +[Node.js](https://nodejs.org): + +```bash +npm install decimal.js +``` +```js +const Decimal = require('decimal.js'); + +import Decimal from 'decimal.js'; + +import {Decimal} from 'decimal.js'; +``` + +## Use + +*In all examples below, semicolons and `toString` calls are not shown. +If a commented-out value is in quotes it means `toString` has been called on the preceding expression.* + +The library exports a single constructor function, `Decimal`, which expects a single argument that is a number, string or Decimal instance. + +```js +x = new Decimal(123.4567) +y = new Decimal('123456.7e-3') +z = new Decimal(x) +x.equals(y) && y.equals(z) && x.equals(z) // true +``` + +If using values with more than a few digits, it is recommended to pass strings rather than numbers to avoid a potential loss of precision. + +```js +// Precision loss from using numeric literals with more than 15 significant digits. +new Decimal(1.0000000000000001) // '1' +new Decimal(88259496234518.57) // '88259496234518.56' +new Decimal(99999999999999999999) // '100000000000000000000' + +// Precision loss from using numeric literals outside the range of Number values. +new Decimal(2e+308) // 'Infinity' +new Decimal(1e-324) // '0' + +// Precision loss from the unexpected result of arithmetic with Number values. +new Decimal(0.7 + 0.1) // '0.7999999999999999' +``` + +As with JavaScript numbers, strings can contain underscores as separators to improve readability. + +```js +x = new Decimal('2_147_483_647') +``` + +String values in binary, hexadecimal or octal notation are also accepted if the appropriate prefix is included. + +```js +x = new Decimal('0xff.f') // '255.9375' +y = new Decimal('0b10101100') // '172' +z = x.plus(y) // '427.9375' + +z.toBinary() // '0b110101011.1111' +z.toBinary(13) // '0b1.101010111111p+8' + +// Using binary exponential notation to create a Decimal with the value of `Number.MAX_VALUE`. +x = new Decimal('0b1.1111111111111111111111111111111111111111111111111111p+1023') +// '1.7976931348623157081e+308' +``` + +Decimal instances are immutable in the sense that they are not changed by their methods. + +```js +0.3 - 0.1 // 0.19999999999999998 +x = new Decimal(0.3) +x.minus(0.1) // '0.2' +x // '0.3' +``` + +The methods that return a Decimal can be chained. + +```js +x.dividedBy(y).plus(z).times(9).floor() +x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').ceil() +``` + +Many method names have a shorter alias. + +```js +x.squareRoot().dividedBy(y).toPower(3).equals(x.sqrt().div(y).pow(3)) // true +x.comparedTo(y.modulo(z).negated() === x.cmp(y.mod(z).neg()) // true +``` + +Most of the methods of JavaScript's `Number.prototype` and `Math` objects are replicated. + +```js +x = new Decimal(255.5) +x.toExponential(5) // '2.55500e+2' +x.toFixed(5) // '255.50000' +x.toPrecision(5) // '255.50' + +Decimal.sqrt('6.98372465832e+9823') // '8.3568682281821340204e+4911' +Decimal.pow(2, 0.0979843) // '1.0702770511687781839' + +// Using `toFixed()` to avoid exponential notation: +x = new Decimal('0.0000001') +x.toString() // '1e-7' +x.toFixed() // '0.0000001' +``` + +And there are `isNaN` and `isFinite` methods, as `NaN` and `Infinity` are valid `Decimal` values. + +```js +x = new Decimal(NaN) // 'NaN' +y = new Decimal(Infinity) // 'Infinity' +x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true +``` + +There is also a `toFraction` method with an optional *maximum denominator* argument. + +```js +z = new Decimal(355) +pi = z.dividedBy(113) // '3.1415929204' +pi.toFraction() // [ '7853982301', '2500000000' ] +pi.toFraction(1000) // [ '355', '113' ] +``` + +All calculations are rounded according to the number of significant digits and rounding mode specified +by the `precision` and `rounding` properties of the Decimal constructor. + +For advanced usage, multiple Decimal constructors can be created, each with their own independent +configuration which applies to all Decimal numbers created from it. + +```js +// Set the precision and rounding of the default Decimal constructor +Decimal.set({ precision: 5, rounding: 4 }) + +// Create another Decimal constructor, optionally passing in a configuration object +Dec = Decimal.clone({ precision: 9, rounding: 1 }) + +x = new Decimal(5) +y = new Dec(5) + +x.div(3) // '1.6667' +y.div(3) // '1.66666666' +``` + +The value of a Decimal is stored in a floating point format in terms of its digits, exponent and sign, but these properties should be considered read-only. + +```js +x = new Decimal(-12345.67); +x.d // [ 12345, 6700000 ] digits (base 10000000) +x.e // 4 exponent (base 10) +x.s // -1 sign +``` + +For further information see the [API](http://mikemcl.github.io/decimal.js/) reference in the *doc* directory. + +## Test + +To run the tests using Node.js from the root directory: + +```bash +npm test +``` + +Each separate test module can also be executed individually, for example: + +```bash +node test/modules/toFraction +``` + +To run the tests in a browser, open *test/test.html*. + +## Minify + +Two minification examples: + +Using [uglify-js](https://github.com/mishoo/UglifyJS) to minify the *decimal.js* file: + +```bash +npm install uglify-js -g +uglifyjs decimal.js --source-map url=decimal.min.js.map -c -m -o decimal.min.js +``` + +Using [terser](https://github.com/terser/terser) to minify the ES module version, *decimal.mjs*: + +```bash +npm install terser -g +terser decimal.mjs --source-map url=decimal.min.mjs.map -c -m --toplevel -o decimal.min.mjs +``` + +```js +import Decimal from './decimal.min.mjs'; +``` + +## Licence + +[The MIT Licence (Expat).](LICENCE.md) diff --git a/24_10_22_faktorialis/node_modules/decimal.js/decimal.d.ts b/24_10_22_faktorialis/node_modules/decimal.js/decimal.d.ts new file mode 100644 index 0000000..0fbc7b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/decimal.d.ts @@ -0,0 +1,299 @@ +// Type definitions for decimal.js >=7.0.0 +// Project: https://github.com/MikeMcl/decimal.js +// Definitions by: Michael Mclaughlin +// Definitions: https://github.com/MikeMcl/decimal.js +// +// Documentation: http://mikemcl.github.io/decimal.js/ +// +// Exports: +// +// class Decimal (default export) +// type Decimal.Constructor +// type Decimal.Instance +// type Decimal.Modulo +// type Decimal.Rounding +// type Decimal.Value +// interface Decimal.Config +// +// Example (alternative syntax commented-out): +// +// import {Decimal} from "decimal.js" +// //import Decimal from "decimal.js" +// +// let r: Decimal.Rounding = Decimal.ROUND_UP; +// let c: Decimal.Configuration = {precision: 4, rounding: r}; +// Decimal.set(c); +// let v: Decimal.Value = '12345.6789'; +// let d: Decimal = new Decimal(v); +// //let d: Decimal.Instance = new Decimal(v); +// +// The use of compiler option `--strictNullChecks` is recommended. + +export default Decimal; + +export namespace Decimal { + export type Constructor = typeof Decimal; + export type Instance = Decimal; + export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + export type Modulo = Rounding | 9; + export type Value = string | number | Decimal; + + // http://mikemcl.github.io/decimal.js/#constructor-properties + export interface Config { + precision?: number; + rounding?: Rounding; + toExpNeg?: number; + toExpPos?: number; + minE?: number; + maxE?: number; + crypto?: boolean; + modulo?: Modulo; + defaults?: boolean; + } +} + +export declare class Decimal { + readonly d: number[]; + readonly e: number; + readonly s: number; + + constructor(n: Decimal.Value); + + absoluteValue(): Decimal; + abs(): Decimal; + + ceil(): Decimal; + + clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; + clamp(min: Decimal.Value, max: Decimal.Value): Decimal; + + comparedTo(n: Decimal.Value): number; + cmp(n: Decimal.Value): number; + + cosine(): Decimal; + cos(): Decimal; + + cubeRoot(): Decimal; + cbrt(): Decimal; + + decimalPlaces(): number; + dp(): number; + + dividedBy(n: Decimal.Value): Decimal; + div(n: Decimal.Value): Decimal; + + dividedToIntegerBy(n: Decimal.Value): Decimal; + divToInt(n: Decimal.Value): Decimal; + + equals(n: Decimal.Value): boolean; + eq(n: Decimal.Value): boolean; + + floor(): Decimal; + + greaterThan(n: Decimal.Value): boolean; + gt(n: Decimal.Value): boolean; + + greaterThanOrEqualTo(n: Decimal.Value): boolean; + gte(n: Decimal.Value): boolean; + + hyperbolicCosine(): Decimal; + cosh(): Decimal; + + hyperbolicSine(): Decimal; + sinh(): Decimal; + + hyperbolicTangent(): Decimal; + tanh(): Decimal; + + inverseCosine(): Decimal; + acos(): Decimal; + + inverseHyperbolicCosine(): Decimal; + acosh(): Decimal; + + inverseHyperbolicSine(): Decimal; + asinh(): Decimal; + + inverseHyperbolicTangent(): Decimal; + atanh(): Decimal; + + inverseSine(): Decimal; + asin(): Decimal; + + inverseTangent(): Decimal; + atan(): Decimal; + + isFinite(): boolean; + + isInteger(): boolean; + isInt(): boolean; + + isNaN(): boolean; + + isNegative(): boolean; + isNeg(): boolean; + + isPositive(): boolean; + isPos(): boolean; + + isZero(): boolean; + + lessThan(n: Decimal.Value): boolean; + lt(n: Decimal.Value): boolean; + + lessThanOrEqualTo(n: Decimal.Value): boolean; + lte(n: Decimal.Value): boolean; + + logarithm(n?: Decimal.Value): Decimal; + log(n?: Decimal.Value): Decimal; + + minus(n: Decimal.Value): Decimal; + sub(n: Decimal.Value): Decimal; + + modulo(n: Decimal.Value): Decimal; + mod(n: Decimal.Value): Decimal; + + naturalExponential(): Decimal; + exp(): Decimal; + + naturalLogarithm(): Decimal; + ln(): Decimal; + + negated(): Decimal; + neg(): Decimal; + + plus(n: Decimal.Value): Decimal; + add(n: Decimal.Value): Decimal; + + precision(includeZeros?: boolean): number; + sd(includeZeros?: boolean): number; + + round(): Decimal; + + sine() : Decimal; + sin() : Decimal; + + squareRoot(): Decimal; + sqrt(): Decimal; + + tangent() : Decimal; + tan() : Decimal; + + times(n: Decimal.Value): Decimal; + mul(n: Decimal.Value) : Decimal; + + toBinary(significantDigits?: number): string; + toBinary(significantDigits: number, rounding: Decimal.Rounding): string; + + toDecimalPlaces(decimalPlaces?: number): Decimal; + toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + toDP(decimalPlaces?: number): Decimal; + toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; + + toExponential(decimalPlaces?: number): string; + toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFixed(decimalPlaces?: number): string; + toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; + + toFraction(max_denominator?: Decimal.Value): Decimal[]; + + toHexadecimal(significantDigits?: number): string; + toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; + toHex(significantDigits?: number): string; + toHex(significantDigits: number, rounding?: Decimal.Rounding): string; + + toJSON(): string; + + toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; + + toNumber(): number; + + toOctal(significantDigits?: number): string; + toOctal(significantDigits: number, rounding: Decimal.Rounding): string; + + toPower(n: Decimal.Value): Decimal; + pow(n: Decimal.Value): Decimal; + + toPrecision(significantDigits?: number): string; + toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; + + toSignificantDigits(significantDigits?: number): Decimal; + toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; + toSD(significantDigits?: number): Decimal; + toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; + + toString(): string; + + truncated(): Decimal; + trunc(): Decimal; + + valueOf(): string; + + static abs(n: Decimal.Value): Decimal; + static acos(n: Decimal.Value): Decimal; + static acosh(n: Decimal.Value): Decimal; + static add(x: Decimal.Value, y: Decimal.Value): Decimal; + static asin(n: Decimal.Value): Decimal; + static asinh(n: Decimal.Value): Decimal; + static atan(n: Decimal.Value): Decimal; + static atanh(n: Decimal.Value): Decimal; + static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; + static cbrt(n: Decimal.Value): Decimal; + static ceil(n: Decimal.Value): Decimal; + static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; + static clone(object?: Decimal.Config): Decimal.Constructor; + static config(object: Decimal.Config): Decimal.Constructor; + static cos(n: Decimal.Value): Decimal; + static cosh(n: Decimal.Value): Decimal; + static div(x: Decimal.Value, y: Decimal.Value): Decimal; + static exp(n: Decimal.Value): Decimal; + static floor(n: Decimal.Value): Decimal; + static hypot(...n: Decimal.Value[]): Decimal; + static isDecimal(object: any): object is Decimal; + static ln(n: Decimal.Value): Decimal; + static log(n: Decimal.Value, base?: Decimal.Value): Decimal; + static log2(n: Decimal.Value): Decimal; + static log10(n: Decimal.Value): Decimal; + static max(...n: Decimal.Value[]): Decimal; + static min(...n: Decimal.Value[]): Decimal; + static mod(x: Decimal.Value, y: Decimal.Value): Decimal; + static mul(x: Decimal.Value, y: Decimal.Value): Decimal; + static noConflict(): Decimal.Constructor; // Browser only + static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; + static random(significantDigits?: number): Decimal; + static round(n: Decimal.Value): Decimal; + static set(object: Decimal.Config): Decimal.Constructor; + static sign(n: Decimal.Value): number; + static sin(n: Decimal.Value): Decimal; + static sinh(n: Decimal.Value): Decimal; + static sqrt(n: Decimal.Value): Decimal; + static sub(x: Decimal.Value, y: Decimal.Value): Decimal; + static sum(...n: Decimal.Value[]): Decimal; + static tan(n: Decimal.Value): Decimal; + static tanh(n: Decimal.Value): Decimal; + static trunc(n: Decimal.Value): Decimal; + + static readonly default?: Decimal.Constructor; + static readonly Decimal?: Decimal.Constructor; + + static readonly precision: number; + static readonly rounding: Decimal.Rounding; + static readonly toExpNeg: number; + static readonly toExpPos: number; + static readonly minE: number; + static readonly maxE: number; + static readonly crypto: boolean; + static readonly modulo: Decimal.Modulo; + + static readonly ROUND_UP: 0; + static readonly ROUND_DOWN: 1; + static readonly ROUND_CEIL: 2; + static readonly ROUND_FLOOR: 3; + static readonly ROUND_HALF_UP: 4; + static readonly ROUND_HALF_DOWN: 5; + static readonly ROUND_HALF_EVEN: 6; + static readonly ROUND_HALF_CEIL: 7; + static readonly ROUND_HALF_FLOOR: 8; + static readonly EUCLID: 9; +} diff --git a/24_10_22_faktorialis/node_modules/decimal.js/decimal.js b/24_10_22_faktorialis/node_modules/decimal.js/decimal.js new file mode 100644 index 0000000..aa6526a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/decimal.js @@ -0,0 +1,4934 @@ +;(function (globalScope) { + 'use strict'; + + + /*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ + + + // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ // + + + // The maximum exponent magnitude. + // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`. + var EXP_LIMIT = 9e15, // 0 to 9e15 + + // The limit on the value of `precision`, and on the value of the first argument to + // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`. + MAX_DIGITS = 1e9, // 0 to 1e9 + + // Base conversion alphabet. + NUMERALS = '0123456789abcdef', + + // The natural logarithm of 10 (1025 digits). + LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058', + + // Pi (1025 digits). + PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789', + + + // The initial configuration properties of the Decimal constructor. + DEFAULTS = { + + // These values must be integers within the stated ranges (inclusive). + // Most of these values can be changed at run-time using the `Decimal.config` method. + + // The maximum number of significant digits of the result of a calculation or base conversion. + // E.g. `Decimal.config({ precision: 20 });` + precision: 20, // 1 to MAX_DIGITS + + // The rounding mode used when rounding to `precision`. + // + // ROUND_UP 0 Away from zero. + // ROUND_DOWN 1 Towards zero. + // ROUND_CEIL 2 Towards +Infinity. + // ROUND_FLOOR 3 Towards -Infinity. + // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + // + // E.g. + // `Decimal.rounding = 4;` + // `Decimal.rounding = Decimal.ROUND_HALF_UP;` + rounding: 4, // 0 to 8 + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend (JavaScript %). + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 The IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive. + // + // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian + // division (9) are commonly used for the modulus operation. The other rounding modes can also + // be used, but they may not give useful results. + modulo: 1, // 0 to 9 + + // The exponent value at and beneath which `toString` returns exponential notation. + // JavaScript numbers: -7 + toExpNeg: -7, // 0 to -EXP_LIMIT + + // The exponent value at and above which `toString` returns exponential notation. + // JavaScript numbers: 21 + toExpPos: 21, // 0 to EXP_LIMIT + + // The minimum exponent value, beneath which underflow to zero occurs. + // JavaScript numbers: -324 (5e-324) + minE: -EXP_LIMIT, // -1 to -EXP_LIMIT + + // The maximum exponent value, above which overflow to Infinity occurs. + // JavaScript numbers: 308 (1.7976931348623157e+308) + maxE: EXP_LIMIT, // 1 to EXP_LIMIT + + // Whether to use cryptographically-secure random number generation, if available. + crypto: false // true/false + }, + + + // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- // + + + Decimal, inexact, noConflict, quadrant, + external = true, + + decimalError = '[DecimalError] ', + invalidArgument = decimalError + 'Invalid argument: ', + precisionLimitExceeded = decimalError + 'Precision limit exceeded', + cryptoUnavailable = decimalError + 'crypto unavailable', + tag = '[object Decimal]', + + mathfloor = Math.floor, + mathpow = Math.pow, + + isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, + isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, + isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, + isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, + + BASE = 1e7, + LOG_BASE = 7, + MAX_SAFE_INTEGER = 9007199254740991, + + LN10_PRECISION = LN10.length - 1, + PI_PRECISION = PI.length - 1, + + // Decimal.prototype object + P = { toStringTag: tag }; + + + // Decimal prototype methods + + + /* + * absoluteValue abs + * ceil + * clampedTo clamp + * comparedTo cmp + * cosine cos + * cubeRoot cbrt + * decimalPlaces dp + * dividedBy div + * dividedToIntegerBy divToInt + * equals eq + * floor + * greaterThan gt + * greaterThanOrEqualTo gte + * hyperbolicCosine cosh + * hyperbolicSine sinh + * hyperbolicTangent tanh + * inverseCosine acos + * inverseHyperbolicCosine acosh + * inverseHyperbolicSine asinh + * inverseHyperbolicTangent atanh + * inverseSine asin + * inverseTangent atan + * isFinite + * isInteger isInt + * isNaN + * isNegative isNeg + * isPositive isPos + * isZero + * lessThan lt + * lessThanOrEqualTo lte + * logarithm log + * [maximum] [max] + * [minimum] [min] + * minus sub + * modulo mod + * naturalExponential exp + * naturalLogarithm ln + * negated neg + * plus add + * precision sd + * round + * sine sin + * squareRoot sqrt + * tangent tan + * times mul + * toBinary + * toDecimalPlaces toDP + * toExponential + * toFixed + * toFraction + * toHexadecimal toHex + * toNearest + * toNumber + * toOctal + * toPower pow + * toPrecision + * toSignificantDigits toSD + * toString + * truncated trunc + * valueOf toJSON + */ + + + /* + * Return a new Decimal whose value is the absolute value of this Decimal. + * + */ + P.absoluteValue = P.abs = function () { + var x = new this.constructor(this); + if (x.s < 0) x.s = 1; + return finalise(x); + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the + * direction of positive Infinity. + * + */ + P.ceil = function () { + return finalise(new this.constructor(this), this.e + 1, 2); + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal clamped to the range + * delineated by `min` and `max`. + * + * min {number|string|Decimal} + * max {number|string|Decimal} + * + */ + P.clampedTo = P.clamp = function (min, max) { + var k, + x = this, + Ctor = x.constructor; + min = new Ctor(min); + max = new Ctor(max); + if (!min.s || !max.s) return new Ctor(NaN); + if (min.gt(max)) throw Error(invalidArgument + max); + k = x.cmp(min); + return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x); + }; + + + /* + * Return + * 1 if the value of this Decimal is greater than the value of `y`, + * -1 if the value of this Decimal is less than the value of `y`, + * 0 if they have the same value, + * NaN if the value of either Decimal is NaN. + * + */ + P.comparedTo = P.cmp = function (y) { + var i, j, xdL, ydL, + x = this, + xd = x.d, + yd = (y = new x.constructor(y)).d, + xs = x.s, + ys = y.s; + + // Either NaN or ±Infinity? + if (!xd || !yd) { + return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; + } + + // Either zero? + if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0; + + // Signs differ? + if (xs !== ys) return xs; + + // Compare exponents. + if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1; + + xdL = xd.length; + ydL = yd.length; + + // Compare digit by digit. + for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { + if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; + } + + // Compare lengths. + return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; + }; + + + /* + * Return a new Decimal whose value is the cosine of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * cos(0) = 1 + * cos(-0) = 1 + * cos(Infinity) = NaN + * cos(-Infinity) = NaN + * cos(NaN) = NaN + * + */ + P.cosine = P.cos = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.d) return new Ctor(NaN); + + // cos(0) = cos(-0) = 1 + if (!x.d[0]) return new Ctor(1); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + + x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); + }; + + + /* + * + * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * cbrt(0) = 0 + * cbrt(-0) = -0 + * cbrt(1) = 1 + * cbrt(-1) = -1 + * cbrt(N) = N + * cbrt(-I) = -I + * cbrt(I) = I + * + * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3)) + * + */ + P.cubeRoot = P.cbrt = function () { + var e, m, n, r, rep, s, sd, t, t3, t3plusx, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + external = false; + + // Initial estimate. + s = x.s * mathpow(x.s * x, 1 / 3); + + // Math.cbrt underflow/overflow? + // Pass x to Math.pow as integer, then adjust the exponent of the result. + if (!s || Math.abs(s) == 1 / 0) { + n = digitsToString(x.d); + e = x.e; + + // Adjust n exponent so it is a multiple of 3 away from x exponent. + if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00'); + s = mathpow(n, 1 / 3); + + // Rarely, e may be one less than the result exponent value. + e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); + + if (s == 1 / 0) { + n = '5e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new Ctor(n); + r.s = x.s; + } else { + r = new Ctor(s.toString()); + } + + sd = (e = Ctor.precision) + 3; + + // Halley's method. + // TODO? Compare Newton's method. + for (;;) { + t = r; + t3 = t.times(t).times(t); + t3plusx = t3.plus(x); + r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); + + // TODO? Replace with for-loop and checkRoundingDigits. + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999 + // , i.e. approaching a rounding boundary, continue the iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the exact result as the + // nines may infinitely repeat. + if (!rep) { + finalise(t, e + 1, 0); + + if (t.times(t).times(t).eq(x)) { + r = t; + break; + } + } + + sd += 4; + rep = 1; + } else { + + // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. + // If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + finalise(r, e + 1, 1); + m = !r.times(r).times(r).eq(x); + } + + break; + } + } + } + + external = true; + + return finalise(r, e, Ctor.rounding, m); + }; + + + /* + * Return the number of decimal places of the value of this Decimal. + * + */ + P.decimalPlaces = P.dp = function () { + var w, + d = this.d, + n = NaN; + + if (d) { + w = d.length - 1; + n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last word. + w = d[w]; + if (w) for (; w % 10 == 0; w /= 10) n--; + if (n < 0) n = 0; + } + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + */ + P.dividedBy = P.div = function (y) { + return divide(this, new this.constructor(y)); + }; + + + /* + * Return a new Decimal whose value is the integer part of dividing the value of this Decimal + * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`. + * + */ + P.dividedToIntegerBy = P.divToInt = function (y) { + var x = this, + Ctor = x.constructor; + return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); + }; + + + /* + * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false. + * + */ + P.equals = P.eq = function (y) { + return this.cmp(y) === 0; + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the + * direction of negative Infinity. + * + */ + P.floor = function () { + return finalise(new this.constructor(this), this.e + 1, 3); + }; + + + /* + * Return true if the value of this Decimal is greater than the value of `y`, otherwise return + * false. + * + */ + P.greaterThan = P.gt = function (y) { + return this.cmp(y) > 0; + }; + + + /* + * Return true if the value of this Decimal is greater than or equal to the value of `y`, + * otherwise return false. + * + */ + P.greaterThanOrEqualTo = P.gte = function (y) { + var k = this.cmp(y); + return k == 1 || k === 0; + }; + + + /* + * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [1, Infinity] + * + * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ... + * + * cosh(0) = 1 + * cosh(-0) = 1 + * cosh(Infinity) = Infinity + * cosh(-Infinity) = Infinity + * cosh(NaN) = NaN + * + * x time taken (ms) result + * 1000 9 9.8503555700852349694e+433 + * 10000 25 4.4034091128314607936e+4342 + * 100000 171 1.4033316802130615897e+43429 + * 1000000 3817 1.5166076984010437725e+434294 + * 10000000 abandoned after 2 minute wait + * + * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x)) + * + */ + P.hyperbolicCosine = P.cosh = function () { + var k, n, pr, rm, len, + x = this, + Ctor = x.constructor, + one = new Ctor(1); + + if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN); + if (x.isZero()) return one; + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + + // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1 + // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4)) + + // Estimate the optimum number of times to use the argument reduction. + // TODO? Estimation reused from cosine() and may not be optimal here. + if (len < 32) { + k = Math.ceil(len / 3); + n = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + n = '2.3283064365386962890625e-10'; + } + + x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); + + // Reverse argument reduction + var cosh2_x, + i = k, + d8 = new Ctor(8); + for (; i--;) { + cosh2_x = x.times(x); + x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); + } + + return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); + }; + + + /* + * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ... + * + * sinh(0) = 0 + * sinh(-0) = -0 + * sinh(Infinity) = Infinity + * sinh(-Infinity) = -Infinity + * sinh(NaN) = NaN + * + * x time taken (ms) + * 10 2 ms + * 100 5 ms + * 1000 14 ms + * 10000 82 ms + * 100000 886 ms 1.4033316802130615897e+43429 + * 200000 2613 ms + * 300000 5407 ms + * 400000 8824 ms + * 500000 13026 ms 8.7080643612718084129e+217146 + * 1000000 48543 ms + * + * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x)) + * + */ + P.hyperbolicSine = P.sinh = function () { + var k, pr, rm, len, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + + if (len < 3) { + x = taylorSeries(Ctor, 2, x, x, true); + } else { + + // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x)) + // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3)) + // 3 multiplications and 1 addition + + // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x))) + // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5))) + // 4 multiplications and 2 additions + + // Estimate the optimum number of times to use the argument reduction. + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x, true); + + // Reverse argument reduction + var sinh2_x, + d5 = new Ctor(5), + d16 = new Ctor(16), + d20 = new Ctor(20); + for (; k--;) { + sinh2_x = x.times(x); + x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); + } + } + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(x, pr, rm, true); + }; + + + /* + * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * tanh(x) = sinh(x) / cosh(x) + * + * tanh(0) = 0 + * tanh(-0) = -0 + * tanh(Infinity) = 1 + * tanh(-Infinity) = -1 + * tanh(NaN) = NaN + * + */ + P.hyperbolicTangent = P.tanh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(x.s); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 7; + Ctor.rounding = 1; + + return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); + }; + + + /* + * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of + * this Decimal. + * + * Domain: [-1, 1] + * Range: [0, pi] + * + * acos(x) = pi/2 - asin(x) + * + * acos(0) = pi/2 + * acos(-0) = pi/2 + * acos(1) = 0 + * acos(-1) = pi + * acos(1/2) = pi/3 + * acos(-1/2) = 2*pi/3 + * acos(|x| > 1) = NaN + * acos(NaN) = NaN + * + */ + P.inverseCosine = P.acos = function () { + var halfPi, + x = this, + Ctor = x.constructor, + k = x.abs().cmp(1), + pr = Ctor.precision, + rm = Ctor.rounding; + + if (k !== -1) { + return k === 0 + // |x| is 1 + ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) + // |x| > 1 or x is NaN + : new Ctor(NaN); + } + + if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5); + + // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3 + + Ctor.precision = pr + 6; + Ctor.rounding = 1; + + x = x.asin(); + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return halfPi.minus(x); + }; + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the + * value of this Decimal. + * + * Domain: [1, Infinity] + * Range: [0, Infinity] + * + * acosh(x) = ln(x + sqrt(x^2 - 1)) + * + * acosh(x < 1) = NaN + * acosh(NaN) = NaN + * acosh(Infinity) = Infinity + * acosh(-Infinity) = NaN + * acosh(0) = NaN + * acosh(-0) = NaN + * acosh(1) = 0 + * acosh(-1) = NaN + * + */ + P.inverseHyperbolicCosine = P.acosh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN); + if (!x.isFinite()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; + Ctor.rounding = 1; + external = false; + + x = x.times(x).minus(1).sqrt().plus(x); + + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.ln(); + }; + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value + * of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * asinh(x) = ln(x + sqrt(x^2 + 1)) + * + * asinh(NaN) = NaN + * asinh(Infinity) = Infinity + * asinh(-Infinity) = -Infinity + * asinh(0) = 0 + * asinh(-0) = -0 + * + */ + P.inverseHyperbolicSine = P.asinh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; + Ctor.rounding = 1; + external = false; + + x = x.times(x).plus(1).sqrt().plus(x); + + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.ln(); + }; + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the + * value of this Decimal. + * + * Domain: [-1, 1] + * Range: [-Infinity, Infinity] + * + * atanh(x) = 0.5 * ln((1 + x) / (1 - x)) + * + * atanh(|x| > 1) = NaN + * atanh(NaN) = NaN + * atanh(Infinity) = NaN + * atanh(-Infinity) = NaN + * atanh(0) = 0 + * atanh(-0) = -0 + * atanh(1) = Infinity + * atanh(-1) = -Infinity + * + */ + P.inverseHyperbolicTangent = P.atanh = function () { + var pr, rm, wpr, xsd, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); + + pr = Ctor.precision; + rm = Ctor.rounding; + xsd = x.sd(); + + if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true); + + Ctor.precision = wpr = xsd - x.e; + + x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); + + Ctor.precision = pr + 4; + Ctor.rounding = 1; + + x = x.ln(); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.times(0.5); + }; + + + /* + * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi/2, pi/2] + * + * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2))) + * + * asin(0) = 0 + * asin(-0) = -0 + * asin(1/2) = pi/6 + * asin(-1/2) = -pi/6 + * asin(1) = pi/2 + * asin(-1) = -pi/2 + * asin(|x| > 1) = NaN + * asin(NaN) = NaN + * + * TODO? Compare performance of Taylor series. + * + */ + P.inverseSine = P.asin = function () { + var halfPi, k, + pr, rm, + x = this, + Ctor = x.constructor; + + if (x.isZero()) return new Ctor(x); + + k = x.abs().cmp(1); + pr = Ctor.precision; + rm = Ctor.rounding; + + if (k !== -1) { + + // |x| is 1 + if (k === 0) { + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + halfPi.s = x.s; + return halfPi; + } + + // |x| > 1 or x is NaN + return new Ctor(NaN); + } + + // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6 + + Ctor.precision = pr + 6; + Ctor.rounding = 1; + + x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.times(2); + }; + + + /* + * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value + * of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi/2, pi/2] + * + * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... + * + * atan(0) = 0 + * atan(-0) = -0 + * atan(1) = pi/4 + * atan(-1) = -pi/4 + * atan(Infinity) = pi/2 + * atan(-Infinity) = -pi/2 + * atan(NaN) = NaN + * + */ + P.inverseTangent = P.atan = function () { + var i, j, k, n, px, t, r, wpr, x2, + x = this, + Ctor = x.constructor, + pr = Ctor.precision, + rm = Ctor.rounding; + + if (!x.isFinite()) { + if (!x.s) return new Ctor(NaN); + if (pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.5); + r.s = x.s; + return r; + } + } else if (x.isZero()) { + return new Ctor(x); + } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.25); + r.s = x.s; + return r; + } + + Ctor.precision = wpr = pr + 10; + Ctor.rounding = 1; + + // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x); + + // Argument reduction + // Ensure |x| < 0.42 + // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2))) + + k = Math.min(28, wpr / LOG_BASE + 2 | 0); + + for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1)); + + external = false; + + j = Math.ceil(wpr / LOG_BASE); + n = 1; + x2 = x.times(x); + r = new Ctor(x); + px = x; + + // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... + for (; i !== -1;) { + px = px.times(x2); + t = r.minus(px.div(n += 2)); + + px = px.times(x2); + r = t.plus(px.div(n += 2)); + + if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;); + } + + if (k) r = r.times(2 << (k - 1)); + + external = true; + + return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); + }; + + + /* + * Return true if the value of this Decimal is a finite number, otherwise return false. + * + */ + P.isFinite = function () { + return !!this.d; + }; + + + /* + * Return true if the value of this Decimal is an integer, otherwise return false. + * + */ + P.isInteger = P.isInt = function () { + return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; + }; + + + /* + * Return true if the value of this Decimal is NaN, otherwise return false. + * + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this Decimal is negative, otherwise return false. + * + */ + P.isNegative = P.isNeg = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this Decimal is positive, otherwise return false. + * + */ + P.isPositive = P.isPos = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this Decimal is 0 or -0, otherwise return false. + * + */ + P.isZero = function () { + return !!this.d && this.d[0] === 0; + }; + + + /* + * Return true if the value of this Decimal is less than `y`, otherwise return false. + * + */ + P.lessThan = P.lt = function (y) { + return this.cmp(y) < 0; + }; + + + /* + * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false. + * + */ + P.lessThanOrEqualTo = P.lte = function (y) { + return this.cmp(y) < 1; + }; + + + /* + * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * If no base is specified, return log[10](arg). + * + * log[base](arg) = ln(arg) / ln(base) + * + * The result will always be correctly rounded if the base of the log is 10, and 'almost always' + * otherwise: + * + * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen + * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error + * between the result and the correctly rounded result will be one ulp (unit in the last place). + * + * log[-b](a) = NaN + * log[0](a) = NaN + * log[1](a) = NaN + * log[NaN](a) = NaN + * log[Infinity](a) = NaN + * log[b](0) = -Infinity + * log[b](-0) = -Infinity + * log[b](-a) = NaN + * log[b](1) = 0 + * log[b](Infinity) = Infinity + * log[b](NaN) = NaN + * + * [base] {number|string|Decimal} The base of the logarithm. + * + */ + P.logarithm = P.log = function (base) { + var isBase10, d, denominator, k, inf, num, sd, r, + arg = this, + Ctor = arg.constructor, + pr = Ctor.precision, + rm = Ctor.rounding, + guard = 5; + + // Default base is 10. + if (base == null) { + base = new Ctor(10); + isBase10 = true; + } else { + base = new Ctor(base); + d = base.d; + + // Return NaN if base is negative, or non-finite, or is 0 or 1. + if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN); + + isBase10 = base.eq(10); + } + + d = arg.d; + + // Is arg negative, non-finite, 0 or 1? + if (arg.s < 0 || !d || !d[0] || arg.eq(1)) { + return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0); + } + + // The result will have a non-terminating decimal expansion if base is 10 and arg is not an + // integer power of 10. + if (isBase10) { + if (d.length > 1) { + inf = true; + } else { + for (k = d[0]; k % 10 === 0;) k /= 10; + inf = k !== 1; + } + } + + external = false; + sd = pr + guard; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + + // The result will have 5 rounding digits. + r = divide(num, denominator, sd, 1); + + // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000, + // calculate 10 further digits. + // + // If the result is known to have an infinite decimal expansion, repeat this until it is clear + // that the result is above or below the boundary. Otherwise, if after calculating the 10 + // further digits, the last 14 are nines, round up and assume the result is exact. + // Also assume the result is exact if the last 14 are zero. + // + // Example of a result that will be incorrectly rounded: + // log[1048576](4503599627370502) = 2.60000000000000009610279511444746... + // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it + // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so + // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal + // place is still 2.6. + if (checkRoundingDigits(r.d, k = pr, rm)) { + + do { + sd += 10; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + + if (!inf) { + + // Check for 14 nines from the 2nd rounding digit, as the first may be 4. + if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + + break; + } + } while (checkRoundingDigits(r.d, k += 10, rm)); + } + + external = true; + + return finalise(r, pr, rm); + }; + + + /* + * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal. + * + * arguments {number|string|Decimal} + * + P.max = function () { + Array.prototype.push.call(arguments, this); + return maxOrMin(this.constructor, arguments, 'lt'); + }; + */ + + + /* + * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal. + * + * arguments {number|string|Decimal} + * + P.min = function () { + Array.prototype.push.call(arguments, this); + return maxOrMin(this.constructor, arguments, 'gt'); + }; + */ + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ + P.minus = P.sub = function (y) { + var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // If either is not finite... + if (!x.d || !y.d) { + + // Return NaN if either is NaN. + if (!x.s || !y.s) y = new Ctor(NaN); + + // Return y negated if x is finite and y is ±Infinity. + else if (x.d) y.s = -y.s; + + // Return x if y is finite and x is ±Infinity. + // Return x if both are ±Infinity with different signs. + // Return NaN if both are ±Infinity with the same sign. + else y = new Ctor(y.d || x.s !== y.s ? x : NaN); + + return y; + } + + // If signs differ... + if (x.s != y.s) { + y.s = -y.s; + return x.plus(y); + } + + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + + // If either is zero... + if (!xd[0] || !yd[0]) { + + // Return y negated if x is zero and y is non-zero. + if (yd[0]) y.s = -y.s; + + // Return x if y is zero and x is non-zero. + else if (xd[0]) y = new Ctor(x); + + // Return zero if both are zero. + // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity. + else return new Ctor(rm === 3 ? -0 : 0); + + return external ? finalise(y, pr, rm) : y; + } + + // x and y are finite, non-zero numbers with the same sign. + + // Calculate base 1e7 exponents. + e = mathfloor(y.e / LOG_BASE); + xe = mathfloor(x.e / LOG_BASE); + + xd = xd.slice(); + k = xe - e; + + // If base 1e7 exponents differ... + if (k) { + xLTy = k < 0; + + if (xLTy) { + d = xd; + k = -k; + len = yd.length; + } else { + d = yd; + e = xe; + len = xd.length; + } + + // Numbers with massively different exponents would result in a very high number of + // zeros needing to be prepended, but this can be avoided while still ensuring correct + // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`. + i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; + + if (k > i) { + k = i; + d.length = 1; + } + + // Prepend zeros to equalise exponents. + d.reverse(); + for (i = k; i--;) d.push(0); + d.reverse(); + + // Base 1e7 exponents equal. + } else { + + // Check digits to determine which is the bigger number. + + i = xd.length; + len = yd.length; + xLTy = i < len; + if (xLTy) len = i; + + for (i = 0; i < len; i++) { + if (xd[i] != yd[i]) { + xLTy = xd[i] < yd[i]; + break; + } + } + + k = 0; + } + + if (xLTy) { + d = xd; + xd = yd; + yd = d; + y.s = -y.s; + } + + len = xd.length; + + // Append zeros to `xd` if shorter. + // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length. + for (i = yd.length - len; i > 0; --i) xd[len++] = 0; + + // Subtract yd from xd. + for (i = yd.length; i > k;) { + + if (xd[--i] < yd[i]) { + for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1; + --xd[j]; + xd[i] += BASE; + } + + xd[i] -= yd[i]; + } + + // Remove trailing zeros. + for (; xd[--len] === 0;) xd.pop(); + + // Remove leading zeros and adjust exponent accordingly. + for (; xd[0] === 0; xd.shift()) --e; + + // Zero? + if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0); + + y.d = xd; + y.e = getBase10Exponent(xd, e); + + return external ? finalise(y, pr, rm) : y; + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * The result depends on the modulo mode. + * + */ + P.modulo = P.mod = function (y) { + var q, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0. + if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN); + + // Return x if y is ±Infinity or x is ±0. + if (!y.d || x.d && !x.d[0]) { + return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); + } + + // Prevent rounding of intermediate calculations. + external = false; + + if (Ctor.modulo == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // result = x - q * y where 0 <= result < abs(y) + q = divide(x, y.abs(), 0, 3, 1); + q.s *= y.s; + } else { + q = divide(x, y, 0, Ctor.modulo, 1); + } + + q = q.times(y); + + external = true; + + return x.minus(q); + }; + + + /* + * Return a new Decimal whose value is the natural exponential of the value of this Decimal, + * i.e. the base e raised to the power the value of this Decimal, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ + P.naturalExponential = P.exp = function () { + return naturalExponential(this); + }; + + + /* + * Return a new Decimal whose value is the natural logarithm of the value of this Decimal, + * rounded to `precision` significant digits using rounding mode `rounding`. + * + */ + P.naturalLogarithm = P.ln = function () { + return naturalLogarithm(this); + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by + * -1. + * + */ + P.negated = P.neg = function () { + var x = new this.constructor(this); + x.s = -x.s; + return finalise(x); + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ + P.plus = P.add = function (y) { + var carry, d, e, i, k, len, pr, rm, xd, yd, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // If either is not finite... + if (!x.d || !y.d) { + + // Return NaN if either is NaN. + if (!x.s || !y.s) y = new Ctor(NaN); + + // Return x if y is finite and x is ±Infinity. + // Return x if both are ±Infinity with the same sign. + // Return NaN if both are ±Infinity with different signs. + // Return y if x is finite and y is ±Infinity. + else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN); + + return y; + } + + // If signs differ... + if (x.s != y.s) { + y.s = -y.s; + return x.minus(y); + } + + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + + // If either is zero... + if (!xd[0] || !yd[0]) { + + // Return x if y is zero. + // Return y if y is non-zero. + if (!yd[0]) y = new Ctor(x); + + return external ? finalise(y, pr, rm) : y; + } + + // x and y are finite, non-zero numbers with the same sign. + + // Calculate base 1e7 exponents. + k = mathfloor(x.e / LOG_BASE); + e = mathfloor(y.e / LOG_BASE); + + xd = xd.slice(); + i = k - e; + + // If base 1e7 exponents differ... + if (i) { + + if (i < 0) { + d = xd; + i = -i; + len = yd.length; + } else { + d = yd; + e = k; + len = xd.length; + } + + // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1. + k = Math.ceil(pr / LOG_BASE); + len = k > len ? k + 1 : len + 1; + + if (i > len) { + i = len; + d.length = 1; + } + + // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts. + d.reverse(); + for (; i--;) d.push(0); + d.reverse(); + } + + len = xd.length; + i = yd.length; + + // If yd is longer than xd, swap xd and yd so xd points to the longer array. + if (len - i < 0) { + i = len; + d = yd; + yd = xd; + xd = d; + } + + // Only start adding at yd.length - 1 as the further digits of xd can be left as they are. + for (carry = 0; i;) { + carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; + xd[i] %= BASE; + } + + if (carry) { + xd.unshift(carry); + ++e; + } + + // Remove trailing zeros. + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + for (len = xd.length; xd[--len] == 0;) xd.pop(); + + y.d = xd; + y.e = getBase10Exponent(xd, e); + + return external ? finalise(y, pr, rm) : y; + }; + + + /* + * Return the number of significant digits of the value of this Decimal. + * + * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0. + * + */ + P.precision = P.sd = function (z) { + var k, + x = this; + + if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z); + + if (x.d) { + k = getPrecision(x.d); + if (z && x.e + 1 > k) k = x.e + 1; + } else { + k = NaN; + } + + return k; + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using + * rounding mode `rounding`. + * + */ + P.round = function () { + var x = this, + Ctor = x.constructor; + + return finalise(new Ctor(x), x.e + 1, Ctor.rounding); + }; + + + /* + * Return a new Decimal whose value is the sine of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * sin(x) = x - x^3/3! + x^5/5! - ... + * + * sin(0) = 0 + * sin(-0) = -0 + * sin(Infinity) = NaN + * sin(-Infinity) = NaN + * sin(NaN) = NaN + * + */ + P.sine = P.sin = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + + x = sine(Ctor, toLessThanHalfPi(Ctor, x)); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); + }; + + + /* + * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + */ + P.squareRoot = P.sqrt = function () { + var m, n, sd, r, rep, t, + x = this, + d = x.d, + e = x.e, + s = x.s, + Ctor = x.constructor; + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !d || !d[0]) { + return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); + } + + external = false; + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = digitsToString(d); + + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '5e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new Ctor(n); + } else { + r = new Ctor(s.toString()); + } + + sd = (e = Ctor.precision) + 3; + + // Newton-Raphson iteration. + for (;;) { + t = r; + r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); + + // TODO? Replace with for-loop and checkRoundingDigits. + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or + // 4999, i.e. approaching a rounding boundary, continue the iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the exact result as the + // nines may infinitely repeat. + if (!rep) { + finalise(t, e + 1, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + sd += 4; + rep = 1; + } else { + + // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. + // If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + finalise(r, e + 1, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + + external = true; + + return finalise(r, e, Ctor.rounding, m); + }; + + + /* + * Return a new Decimal whose value is the tangent of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * tan(0) = 0 + * tan(-0) = -0 + * tan(Infinity) = NaN + * tan(-Infinity) = NaN + * tan(NaN) = NaN + * + */ + P.tangent = P.tan = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 10; + Ctor.rounding = 1; + + x = x.sin(); + x.s = 1; + x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + */ + P.times = P.mul = function (y) { + var carry, e, i, k, r, rL, t, xdL, ydL, + x = this, + Ctor = x.constructor, + xd = x.d, + yd = (y = new Ctor(y)).d; + + y.s *= x.s; + + // If either is NaN, ±Infinity or ±0... + if (!xd || !xd[0] || !yd || !yd[0]) { + + return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd + + // Return NaN if either is NaN. + // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity. + ? NaN + + // Return ±Infinity if either is ±Infinity. + // Return ±0 if either is ±0. + : !xd || !yd ? y.s / 0 : y.s * 0); + } + + e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); + xdL = xd.length; + ydL = yd.length; + + // Ensure xd points to the longer array. + if (xdL < ydL) { + r = xd; + xd = yd; + yd = r; + rL = xdL; + xdL = ydL; + ydL = rL; + } + + // Initialise the result array with zeros. + r = []; + rL = xdL + ydL; + for (i = rL; i--;) r.push(0); + + // Multiply! + for (i = ydL; --i >= 0;) { + carry = 0; + for (k = xdL + i; k > i;) { + t = r[k] + yd[i] * xd[k - i - 1] + carry; + r[k--] = t % BASE | 0; + carry = t / BASE | 0; + } + + r[k] = (r[k] + carry) % BASE | 0; + } + + // Remove trailing zeros. + for (; !r[--rL];) r.pop(); + + if (carry) ++e; + else r.shift(); + + y.d = r; + y.e = getBase10Exponent(r, e); + + return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; + }; + + + /* + * Return a string representing the value of this Decimal in base 2, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toBinary = function (sd, rm) { + return toStringBinary(this, 2, sd, rm); + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp` + * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted. + * + * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toDecimalPlaces = P.toDP = function (dp, rm) { + var x = this, + Ctor = x.constructor; + + x = new Ctor(x); + if (dp === void 0) return x; + + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + return finalise(x, dp + x.e + 1, rm); + }; + + + /* + * Return a string representing the value of this Decimal in exponential notation rounded to + * `dp` fixed decimal places using rounding mode `rounding`. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toExponential = function (dp, rm) { + var str, + x = this, + Ctor = x.constructor; + + if (dp === void 0) { + str = finiteToString(x, true); + } else { + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + x = finalise(new Ctor(x), dp + 1, rm); + str = finiteToString(x, true, dp + 1); + } + + return x.isNeg() && !x.isZero() ? '-' + str : str; + }; + + + /* + * Return a string representing the value of this Decimal in normal (fixed-point) notation to + * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is + * omitted. + * + * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. + * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. + * (-0).toFixed(3) is '0.000'. + * (-0.5).toFixed(0) is '-0'. + * + */ + P.toFixed = function (dp, rm) { + var str, y, + x = this, + Ctor = x.constructor; + + if (dp === void 0) { + str = finiteToString(x); + } else { + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + y = finalise(new Ctor(x), dp + x.e + 1, rm); + str = finiteToString(y, false, dp + y.e + 1); + } + + // To determine whether to add the minus sign look at the value before it was rounded, + // i.e. look at `x` rather than `y`. + return x.isNeg() && !x.isZero() ? '-' + str : str; + }; + + + /* + * Return an array representing the value of this Decimal as a simple fraction with an integer + * numerator and an integer denominator. + * + * The denominator will be a positive non-zero value less than or equal to the specified maximum + * denominator. If a maximum denominator is not specified, the denominator will be the lowest + * value necessary to represent the number exactly. + * + * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity. + * + */ + P.toFraction = function (maxD) { + var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, + x = this, + xd = x.d, + Ctor = x.constructor; + + if (!xd) return new Ctor(x); + + n1 = d0 = new Ctor(1); + d1 = n0 = new Ctor(0); + + d = new Ctor(d1); + e = d.e = getPrecision(xd) - x.e - 1; + k = e % LOG_BASE; + d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); + + if (maxD == null) { + + // d is 10**e, the minimum max-denominator needed. + maxD = e > 0 ? d : n1; + } else { + n = new Ctor(maxD); + if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n); + maxD = n.gt(d) ? (e > 0 ? d : n1) : n; + } + + external = false; + n = new Ctor(digitsToString(xd)); + pr = Ctor.precision; + Ctor.precision = e = xd.length * LOG_BASE * 2; + + for (;;) { + q = divide(n, d, 0, 1, 1); + d2 = d0.plus(q.times(d1)); + if (d2.cmp(maxD) == 1) break; + d0 = d1; + d1 = d2; + d2 = n1; + n1 = n0.plus(q.times(d2)); + n0 = d2; + d2 = d; + d = n.minus(q.times(d2)); + n = d2; + } + + d2 = divide(maxD.minus(d0), d1, 0, 1, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + + // Determine which fraction is closer to x, n0/d0 or n1/d1? + r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 + ? [n1, d1] : [n0, d0]; + + Ctor.precision = pr; + external = true; + + return r; + }; + + + /* + * Return a string representing the value of this Decimal in base 16, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toHexadecimal = P.toHex = function (sd, rm) { + return toStringBinary(this, 16, sd, rm); + }; + + + /* + * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding + * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal. + * + * The return value will always have the same sign as this Decimal, unless either this Decimal + * or `y` is NaN, in which case the return value will be also be NaN. + * + * The return value is not affected by the value of `precision`. + * + * y {number|string|Decimal} The magnitude to round to a multiple of. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toNearest() rounding mode not an integer: {rm}' + * 'toNearest() rounding mode out of range: {rm}' + * + */ + P.toNearest = function (y, rm) { + var x = this, + Ctor = x.constructor; + + x = new Ctor(x); + + if (y == null) { + + // If x is not finite, return x. + if (!x.d) return x; + + y = new Ctor(1); + rm = Ctor.rounding; + } else { + y = new Ctor(y); + if (rm === void 0) { + rm = Ctor.rounding; + } else { + checkInt32(rm, 0, 8); + } + + // If x is not finite, return x if y is not NaN, else NaN. + if (!x.d) return y.s ? x : y; + + // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN. + if (!y.d) { + if (y.s) y.s = x.s; + return y; + } + } + + // If y is not zero, calculate the nearest multiple of y to x. + if (y.d[0]) { + external = false; + x = divide(x, y, 0, rm, 1).times(y); + external = true; + finalise(x); + + // If y is zero, return zero with the sign of x. + } else { + y.s = x.s; + x = y; + } + + return x; + }; + + + /* + * Return the value of this Decimal converted to a number primitive. + * Zero keeps its sign. + * + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this Decimal in base 8, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toOctal = function (sd, rm) { + return toStringBinary(this, 8, sd, rm); + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded + * to `precision` significant digits using rounding mode `rounding`. + * + * ECMAScript compliant. + * + * pow(x, NaN) = NaN + * pow(x, ±0) = 1 + + * pow(NaN, non-zero) = NaN + * pow(abs(x) > 1, +Infinity) = +Infinity + * pow(abs(x) > 1, -Infinity) = +0 + * pow(abs(x) == 1, ±Infinity) = NaN + * pow(abs(x) < 1, +Infinity) = +0 + * pow(abs(x) < 1, -Infinity) = +Infinity + * pow(+Infinity, y > 0) = +Infinity + * pow(+Infinity, y < 0) = +0 + * pow(-Infinity, odd integer > 0) = -Infinity + * pow(-Infinity, even integer > 0) = +Infinity + * pow(-Infinity, odd integer < 0) = -0 + * pow(-Infinity, even integer < 0) = +0 + * pow(+0, y > 0) = +0 + * pow(+0, y < 0) = +Infinity + * pow(-0, odd integer > 0) = -0 + * pow(-0, even integer > 0) = +0 + * pow(-0, odd integer < 0) = -Infinity + * pow(-0, even integer < 0) = +Infinity + * pow(finite x < 0, finite non-integer) = NaN + * + * For non-integer or very large exponents pow(x, y) is calculated using + * + * x^y = exp(y*ln(x)) + * + * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the + * probability of an incorrectly rounded result + * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14 + * i.e. 1 in 250,000,000,000,000 + * + * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place). + * + * y {number|string|Decimal} The power to which to raise this Decimal. + * + */ + P.toPower = P.pow = function (y) { + var e, k, pr, r, rm, s, + x = this, + Ctor = x.constructor, + yn = +(y = new Ctor(y)); + + // Either ±Infinity, NaN or ±0? + if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn)); + + x = new Ctor(x); + + if (x.eq(1)) return x; + + pr = Ctor.precision; + rm = Ctor.rounding; + + if (y.eq(1)) return finalise(x, pr, rm); + + // y exponent + e = mathfloor(y.e / LOG_BASE); + + // If y is a small integer use the 'exponentiation by squaring' algorithm. + if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { + r = intPow(Ctor, x, k, pr); + return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); + } + + s = x.s; + + // if x is negative + if (s < 0) { + + // if y is not an integer + if (e < y.d.length - 1) return new Ctor(NaN); + + // Result is positive if x is negative and the last digit of integer y is even. + if ((y.d[e] & 1) == 0) s = 1; + + // if x.eq(-1) + if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { + x.s = s; + return x; + } + } + + // Estimate result exponent. + // x^y = 10^e, where e = y * log10(x) + // log10(x) = log10(x_significand) + x_exponent + // log10(x_significand) = ln(x_significand) / ln(10) + k = mathpow(+x, yn); + e = k == 0 || !isFinite(k) + ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) + : new Ctor(k + '').e; + + // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1. + + // Overflow/underflow? + if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0); + + external = false; + Ctor.rounding = x.s = 1; + + // Estimate the extra guard digits needed to ensure five correct rounding digits from + // naturalLogarithm(x). Example of failure without these extra digits (precision: 10): + // new Decimal(2.32456).pow('2087987436534566.46411') + // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815 + k = Math.min(12, (e + '').length); + + // r = x^y = exp(y*ln(x)) + r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); + + // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40) + if (r.d) { + + // Truncate to the required precision plus five rounding digits. + r = finalise(r, pr + 5, 1); + + // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate + // the result. + if (checkRoundingDigits(r.d, pr, rm)) { + e = pr + 10; + + // Truncate to the increased precision plus five rounding digits. + r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); + + // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9). + if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + } + } + + r.s = s; + external = true; + Ctor.rounding = rm; + + return finalise(r, pr, rm); + }; + + + /* + * Return a string representing the value of this Decimal rounded to `sd` significant digits + * using rounding mode `rounding`. + * + * Return exponential notation if `sd` is less than the number of digits necessary to represent + * the integer part of the value in normal notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ + P.toPrecision = function (sd, rm) { + var str, + x = this, + Ctor = x.constructor; + + if (sd === void 0) { + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + } else { + checkInt32(sd, 1, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + x = finalise(new Ctor(x), sd, rm); + str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); + } + + return x.isNeg() && !x.isZero() ? '-' + str : str; + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd` + * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if + * omitted. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toSD() digits out of range: {sd}' + * 'toSD() digits not an integer: {sd}' + * 'toSD() rounding mode not an integer: {rm}' + * 'toSD() rounding mode out of range: {rm}' + * + */ + P.toSignificantDigits = P.toSD = function (sd, rm) { + var x = this, + Ctor = x.constructor; + + if (sd === void 0) { + sd = Ctor.precision; + rm = Ctor.rounding; + } else { + checkInt32(sd, 1, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + } + + return finalise(new Ctor(x), sd, rm); + }; + + + /* + * Return a string representing the value of this Decimal. + * + * Return exponential notation if this Decimal has a positive exponent equal to or greater than + * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`. + * + */ + P.toString = function () { + var x = this, + Ctor = x.constructor, + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + + return x.isNeg() && !x.isZero() ? '-' + str : str; + }; + + + /* + * Return a new Decimal whose value is the value of this Decimal truncated to a whole number. + * + */ + P.truncated = P.trunc = function () { + return finalise(new this.constructor(this), this.e + 1, 1); + }; + + + /* + * Return a string representing the value of this Decimal. + * Unlike `toString`, negative zero will include the minus sign. + * + */ + P.valueOf = P.toJSON = function () { + var x = this, + Ctor = x.constructor, + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + + return x.isNeg() ? '-' + str : str; + }; + + + // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers. + + + /* + * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower, + * finiteToString, naturalExponential, naturalLogarithm + * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest, + * P.toPrecision, P.toSignificantDigits, toStringBinary, random + * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm + * convertBase toStringBinary, parseOther + * cos P.cos + * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy, + * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction, + * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm, + * taylorSeries, atan2, parseOther + * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh, + * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus, + * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot, + * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed, + * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits, + * P.truncated, divide, getLn10, getPi, naturalExponential, + * naturalLogarithm, ceil, floor, round, trunc + * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf, + * toStringBinary + * getBase10Exponent P.minus, P.plus, P.times, parseOther + * getLn10 P.logarithm, naturalLogarithm + * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2 + * getPrecision P.precision, P.toFraction + * getZeroString digitsToString, finiteToString + * intPow P.toPower, parseOther + * isOdd toLessThanHalfPi + * maxOrMin max, min + * naturalExponential P.naturalExponential, P.toPower + * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm, + * P.toPower, naturalExponential + * nonFiniteToString finiteToString, toStringBinary + * parseDecimal Decimal + * parseOther Decimal + * sin P.sin + * taylorSeries P.cosh, P.sinh, cos, sin + * toLessThanHalfPi P.cos, P.sin + * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal + * truncate intPow + * + * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi, + * naturalLogarithm, config, parseOther, random, Decimal + */ + + + function digitsToString(d) { + var i, k, ws, + indexOfLastWord = d.length - 1, + str = '', + w = d[0]; + + if (indexOfLastWord > 0) { + str += w; + for (i = 1; i < indexOfLastWord; i++) { + ws = d[i] + ''; + k = LOG_BASE - ws.length; + if (k) str += getZeroString(k); + str += ws; + } + + w = d[i]; + ws = w + ''; + k = LOG_BASE - ws.length; + if (k) str += getZeroString(k); + } else if (w === 0) { + return '0'; + } + + // Remove trailing zeros of last w. + for (; w % 10 === 0;) w /= 10; + + return str + w; + } + + + function checkInt32(i, min, max) { + if (i !== ~~i || i < min || i > max) { + throw Error(invalidArgument + i); + } + } + + + /* + * Check 5 rounding digits if `repeating` is null, 4 otherwise. + * `repeating == null` if caller is `log` or `pow`, + * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`. + */ + function checkRoundingDigits(d, i, rm, repeating) { + var di, k, r, rd; + + // Get the length of the first word of the array d. + for (k = d[0]; k >= 10; k /= 10) --i; + + // Is the rounding digit in the first word of d? + if (--i < 0) { + i += LOG_BASE; + di = 0; + } else { + di = Math.ceil((i + 1) / LOG_BASE); + i %= LOG_BASE; + } + + // i is the index (0 - 6) of the rounding digit. + // E.g. if within the word 3487563 the first rounding digit is 5, + // then i = 4, k = 1000, rd = 3487563 % 1000 = 563 + k = mathpow(10, LOG_BASE - i); + rd = d[di] % k | 0; + + if (repeating == null) { + if (i < 3) { + if (i == 0) rd = rd / 100 | 0; + else if (i == 1) rd = rd / 10 | 0; + r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0; + } else { + r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && + (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || + (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; + } + } else { + if (i < 4) { + if (i == 0) rd = rd / 1000 | 0; + else if (i == 1) rd = rd / 100 | 0; + else if (i == 2) rd = rd / 10 | 0; + r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; + } else { + r = ((repeating || rm < 4) && rd + 1 == k || + (!repeating && rm > 3) && rd + 1 == k / 2) && + (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1; + } + } + + return r; + } + + + // Convert string of `baseIn` to an array of numbers of `baseOut`. + // Eg. convertBase('255', 10, 16) returns [15, 15]. + // Eg. convertBase('ff', 16, 10) returns [2, 5, 5]. + function convertBase(str, baseIn, baseOut) { + var j, + arr = [0], + arrL, + i = 0, + strL = str.length; + + for (; i < strL;) { + for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn; + arr[0] += NUMERALS.indexOf(str.charAt(i++)); + for (j = 0; j < arr.length; j++) { + if (arr[j] > baseOut - 1) { + if (arr[j + 1] === void 0) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + + /* + * cos(x) = 1 - x^2/2! + x^4/4! - ... + * |x| < pi/2 + * + */ + function cosine(Ctor, x) { + var k, len, y; + + if (x.isZero()) return x; + + // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1 + // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1 + + // Estimate the optimum number of times to use the argument reduction. + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + y = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + y = '2.3283064365386962890625e-10'; + } + + Ctor.precision += k; + + x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); + + // Reverse argument reduction + for (var i = k; i--;) { + var cos2x = x.times(x); + x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); + } + + Ctor.precision -= k; + + return x; + } + + + /* + * Perform division in the specified base. + */ + var divide = (function () { + + // Assumes non-zero x and k, and hence non-zero result. + function multiplyInteger(x, k, base) { + var temp, + carry = 0, + i = x.length; + + for (x = x.slice(); i--;) { + temp = x[i] * k + carry; + x[i] = temp % base | 0; + carry = temp / base | 0; + } + + if (carry) x.unshift(carry); + + return x; + } + + function compare(a, b, aL, bL) { + var i, r; + + if (aL != bL) { + r = aL > bL ? 1 : -1; + } else { + for (i = r = 0; i < aL; i++) { + if (a[i] != b[i]) { + r = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return r; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1;) a.shift(); + } + + return function (x, y, pr, rm, dp, base) { + var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, + yL, yz, + Ctor = x.constructor, + sign = x.s == y.s ? 1 : -1, + xd = x.d, + yd = y.d; + + // Either NaN, Infinity or 0? + if (!xd || !xd[0] || !yd || !yd[0]) { + + return new Ctor(// Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : + + // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0. + xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0); + } + + if (base) { + logBase = 1; + e = x.e - y.e; + } else { + base = BASE; + logBase = LOG_BASE; + e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); + } + + yL = yd.length; + xL = xd.length; + q = new Ctor(sign); + qd = q.d = []; + + // Result exponent may be one less than e. + // The digit array of a Decimal from toStringBinary may have trailing zeros. + for (i = 0; yd[i] == (xd[i] || 0); i++); + + if (yd[i] > (xd[i] || 0)) e--; + + if (pr == null) { + sd = pr = Ctor.precision; + rm = Ctor.rounding; + } else if (dp) { + sd = pr + (x.e - y.e) + 1; + } else { + sd = pr; + } + + if (sd < 0) { + qd.push(1); + more = true; + } else { + + // Convert precision in number of base 10 digits to base 1e7 digits. + sd = sd / logBase + 2 | 0; + i = 0; + + // divisor < 1e7 + if (yL == 1) { + k = 0; + yd = yd[0]; + sd++; + + // k is the carry. + for (; (i < xL || k) && sd--; i++) { + t = k * base + (xd[i] || 0); + qd[i] = t / yd | 0; + k = t % yd | 0; + } + + more = k || i < xL; + + // divisor >= 1e7 + } else { + + // Normalise xd and yd so highest order digit of yd is >= base/2 + k = base / (yd[0] + 1) | 0; + + if (k > 1) { + yd = multiplyInteger(yd, k, base); + xd = multiplyInteger(xd, k, base); + yL = yd.length; + xL = xd.length; + } + + xi = yL; + rem = xd.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL;) rem[remL++] = 0; + + yz = yd.slice(); + yz.unshift(0); + yd0 = yd[0]; + + if (yd[1] >= base / 2) ++yd0; + + do { + k = 0; + + // Compare divisor and remainder. + cmp = compare(yd, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, k. + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // k will be how many times the divisor goes into the current remainder. + k = rem0 / yd0 | 0; + + // Algorithm: + // 1. product = divisor * trial digit (k) + // 2. if product > remainder: product -= divisor, k-- + // 3. remainder -= product + // 4. if product was < remainder at 2: + // 5. compare new remainder and divisor + // 6. If remainder > divisor: remainder -= divisor, k++ + + if (k > 1) { + if (k >= base) k = base - 1; + + // product = divisor * trial digit. + prod = multiplyInteger(yd, k, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + cmp = compare(prod, rem, prodL, remL); + + // product > remainder. + if (cmp == 1) { + k--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yd, prodL, base); + } + } else { + + // cmp is -1. + // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1 + // to avoid it. If k is 1 there is a need to compare yd and rem again below. + if (k == 0) cmp = k = 1; + prod = yd.slice(); + } + + prodL = prod.length; + if (prodL < remL) prod.unshift(0); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + + // If product was < previous remainder. + if (cmp == -1) { + remL = rem.length; + + // Compare divisor and new remainder. + cmp = compare(yd, rem, yL, remL); + + // If divisor < new remainder, subtract divisor from remainder. + if (cmp < 1) { + k++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yd, remL, base); + } + } + + remL = rem.length; + } else if (cmp === 0) { + k++; + rem = [0]; + } // if cmp === 1, k will be 0 + + // Add the next digit, k, to the result array. + qd[i++] = k; + + // Update the remainder. + if (cmp && rem[0]) { + rem[remL++] = xd[xi] || 0; + } else { + rem = [xd[xi]]; + remL = 1; + } + + } while ((xi++ < xL || rem[0] !== void 0) && sd--); + + more = rem[0] !== void 0; + } + + // Leading zero? + if (!qd[0]) qd.shift(); + } + + // logBase is 1 when divide is being used for base conversion. + if (logBase == 1) { + q.e = e; + inexact = more; + } else { + + // To calculate q.e, first get the number of digits of qd[0]. + for (i = 1, k = qd[0]; k >= 10; k /= 10) i++; + q.e = i + e * logBase - 1; + + finalise(q, dp ? pr + q.e + 1 : pr, rm, more); + } + + return q; + }; + })(); + + + /* + * Round `x` to `sd` significant digits using rounding mode `rm`. + * Check for over/under-flow. + */ + function finalise(x, sd, rm, isTruncated) { + var digits, i, j, k, rd, roundUp, w, xd, xdi, + Ctor = x.constructor; + + // Don't round if sd is null or undefined. + out: if (sd != null) { + xd = x.d; + + // Infinity/NaN. + if (!xd) return x; + + // rd: the rounding digit, i.e. the digit after the digit that may be rounded up. + // w: the word of xd containing rd, a base 1e7 number. + // xdi: the index of w within xd. + // digits: the number of digits of w. + // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if + // they had leading zeros) + // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero). + + // Get the length of the first word of the digits array xd. + for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++; + i = sd - digits; + + // Is the rounding digit in the first word of xd? + if (i < 0) { + i += LOG_BASE; + j = sd; + w = xd[xdi = 0]; + + // Get the rounding digit at index j of w. + rd = w / mathpow(10, digits - j - 1) % 10 | 0; + } else { + xdi = Math.ceil((i + 1) / LOG_BASE); + k = xd.length; + if (xdi >= k) { + if (isTruncated) { + + // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`. + for (; k++ <= xdi;) xd.push(0); + w = rd = 0; + digits = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + w = k = xd[xdi]; + + // Get the number of digits of w. + for (digits = 1; k >= 10; k /= 10) digits++; + + // Get the index of rd within w. + i %= LOG_BASE; + + // Get the index of rd within w, adjusted for leading zeros. + // The number of leading zeros of w is given by LOG_BASE - digits. + j = i - LOG_BASE + digits; + + // Get the rounding digit at index j of w. + rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; + } + } + + // Are there any non-zero digits after the rounding digit? + isTruncated = isTruncated || sd < 0 || + xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); + + // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right + // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression + // will give 714. + + roundUp = rm < 4 + ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xd[0]) { + xd.length = 0; + if (roundUp) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); + x.e = -sd || 0; + } else { + + // Zero. + xd[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xd.length = xdi; + k = 1; + xdi--; + } else { + xd.length = xdi + 1; + k = mathpow(10, LOG_BASE - i); + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of w. + xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; + } + + if (roundUp) { + for (;;) { + + // Is the digit to be rounded up in the first word of xd? + if (xdi == 0) { + + // i will be the length of xd[0] before k is added. + for (i = 1, j = xd[0]; j >= 10; j /= 10) i++; + j = xd[0] += k; + for (k = 1; j >= 10; j /= 10) k++; + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xd[0] == BASE) xd[0] = 1; + } + + break; + } else { + xd[xdi] += k; + if (xd[xdi] != BASE) break; + xd[xdi--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xd.length; xd[--i] === 0;) xd.pop(); + } + + if (external) { + + // Overflow? + if (x.e > Ctor.maxE) { + + // Infinity. + x.d = null; + x.e = NaN; + + // Underflow? + } else if (x.e < Ctor.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + // Ctor.underflow = true; + } // else Ctor.underflow = false; + } + + return x; + } + + + function finiteToString(x, isExp, sd) { + if (!x.isFinite()) return nonFiniteToString(x); + var k, + e = x.e, + str = digitsToString(x.d), + len = str.length; + + if (isExp) { + if (sd && (k = sd - len) > 0) { + str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k); + } else if (len > 1) { + str = str.charAt(0) + '.' + str.slice(1); + } + + str = str + (x.e < 0 ? 'e' : 'e+') + x.e; + } else if (e < 0) { + str = '0.' + getZeroString(-e - 1) + str; + if (sd && (k = sd - len) > 0) str += getZeroString(k); + } else if (e >= len) { + str += getZeroString(e + 1 - len); + if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k); + } else { + if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k); + if (sd && (k = sd - len) > 0) { + if (e + 1 === len) str += '.'; + str += getZeroString(k); + } + } + + return str; + } + + + // Calculate the base 10 exponent from the base 1e7 exponent. + function getBase10Exponent(digits, e) { + var w = digits[0]; + + // Add the number of digits of the first word of the digits array. + for ( e *= LOG_BASE; w >= 10; w /= 10) e++; + return e; + } + + + function getLn10(Ctor, sd, pr) { + if (sd > LN10_PRECISION) { + + // Reset global state in case the exception is caught. + external = true; + if (pr) Ctor.precision = pr; + throw Error(precisionLimitExceeded); + } + return finalise(new Ctor(LN10), sd, 1, true); + } + + + function getPi(Ctor, sd, rm) { + if (sd > PI_PRECISION) throw Error(precisionLimitExceeded); + return finalise(new Ctor(PI), sd, rm, true); + } + + + function getPrecision(digits) { + var w = digits.length - 1, + len = w * LOG_BASE + 1; + + w = digits[w]; + + // If non-zero... + if (w) { + + // Subtract the number of trailing zeros of the last word. + for (; w % 10 == 0; w /= 10) len--; + + // Add the number of digits of the first word. + for (w = digits[0]; w >= 10; w /= 10) len++; + } + + return len; + } + + + function getZeroString(k) { + var zs = ''; + for (; k--;) zs += '0'; + return zs; + } + + + /* + * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an + * integer of type number. + * + * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`. + * + */ + function intPow(Ctor, x, n, pr) { + var isTruncated, + r = new Ctor(1), + + // Max n of 9007199254740991 takes 53 loop iterations. + // Maximum digits array length; leaves [28, 34] guard digits. + k = Math.ceil(pr / LOG_BASE + 4); + + external = false; + + for (;;) { + if (n % 2) { + r = r.times(x); + if (truncate(r.d, k)) isTruncated = true; + } + + n = mathfloor(n / 2); + if (n === 0) { + + // To ensure correct rounding when r.d is truncated, increment the last word if it is zero. + n = r.d.length - 1; + if (isTruncated && r.d[n] === 0) ++r.d[n]; + break; + } + + x = x.times(x); + truncate(x.d, k); + } + + external = true; + + return r; + } + + + function isOdd(n) { + return n.d[n.d.length - 1] & 1; + } + + + /* + * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'. + */ + function maxOrMin(Ctor, args, ltgt) { + var y, + x = new Ctor(args[0]), + i = 0; + + for (; ++i < args.length;) { + y = new Ctor(args[i]); + if (!y.s) { + x = y; + break; + } else if (x[ltgt](y)) { + x = y; + } + } + + return x; + } + + + /* + * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant + * digits. + * + * Taylor/Maclaurin series. + * + * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ... + * + * Argument reduction: + * Repeat x = x / 32, k += 5, until |x| < 0.1 + * exp(x) = exp(x / 2^k)^(2^k) + * + * Previously, the argument was initially reduced by + * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10) + * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was + * found to be slower than just dividing repeatedly by 32 as above. + * + * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000 + * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000 + * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324) + * + * exp(Infinity) = Infinity + * exp(-Infinity) = 0 + * exp(NaN) = NaN + * exp(±0) = 1 + * + * exp(x) is non-terminating for any finite, non-zero x. + * + * The result will always be correctly rounded. + * + */ + function naturalExponential(x, sd) { + var denominator, guard, j, pow, sum, t, wpr, + rep = 0, + i = 0, + k = 0, + Ctor = x.constructor, + rm = Ctor.rounding, + pr = Ctor.precision; + + // 0/NaN/Infinity? + if (!x.d || !x.d[0] || x.e > 17) { + + return new Ctor(x.d + ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 + : x.s ? x.s < 0 ? 0 : x : 0 / 0); + } + + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + + t = new Ctor(0.03125); + + // while abs(x) >= 0.1 + while (x.e > -2) { + + // x = x / 2^5 + x = x.times(t); + k += 5; + } + + // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision + // necessary to ensure the first 4 rounding digits are correct. + guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; + wpr += guard; + denominator = pow = sum = new Ctor(1); + Ctor.precision = wpr; + + for (;;) { + pow = finalise(pow.times(x), wpr, 1); + denominator = denominator.times(++i); + t = sum.plus(divide(pow, denominator, wpr, 1)); + + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { + j = k; + while (j--) sum = finalise(sum.times(sum), wpr, 1); + + // Check to see if the first 4 rounding digits are [49]999. + // If so, repeat the summation with a higher precision, otherwise + // e.g. with precision: 18, rounding: 1 + // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123) + // `wpr - guard` is the index of first rounding digit. + if (sd == null) { + + if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += 10; + denominator = pow = t = new Ctor(1); + i = 0; + rep++; + } else { + return finalise(sum, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum; + } + } + + sum = t; + } + } + + + /* + * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant + * digits. + * + * ln(-n) = NaN + * ln(0) = -Infinity + * ln(-0) = -Infinity + * ln(1) = 0 + * ln(Infinity) = Infinity + * ln(-Infinity) = NaN + * ln(NaN) = NaN + * + * ln(n) (n != 1) is non-terminating. + * + */ + function naturalLogarithm(y, sd) { + var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2, + n = 1, + guard = 10, + x = y, + xd = x.d, + Ctor = x.constructor, + rm = Ctor.rounding, + pr = Ctor.precision; + + // Is x negative or Infinity, NaN, 0 or 1? + if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { + return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); + } + + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + + Ctor.precision = wpr += guard; + c = digitsToString(xd); + c0 = c.charAt(0); + + if (Math.abs(e = x.e) < 1.5e15) { + + // Argument reduction. + // The series converges faster the closer the argument is to 1, so using + // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b + // multiply the argument by itself until the leading digits of the significand are 7, 8, 9, + // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can + // later be divided by this number, then separate out the power of 10 using + // ln(a*10^b) = ln(a) + b*ln(10). + + // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14). + //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) { + // max n is 6 (gives 0.7 - 1.3) + while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { + x = x.times(y); + c = digitsToString(x.d); + c0 = c.charAt(0); + n++; + } + + e = x.e; + + if (c0 > 1) { + x = new Ctor('0.' + c); + e++; + } else { + x = new Ctor(c0 + '.' + c.slice(1)); + } + } else { + + // The argument reduction method above may result in overflow if the argument y is a massive + // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this + // function using ln(x*10^e) = ln(x) + e*ln(10). + t = getLn10(Ctor, wpr + 2, pr).times(e + ''); + x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t); + Ctor.precision = pr; + + return sd == null ? finalise(x, pr, rm, external = true) : x; + } + + // x1 is x reduced to a value near 1. + x1 = x; + + // Taylor series. + // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...) + // where x = (y - 1)/(y + 1) (|x| < 1) + sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = 3; + + for (;;) { + numerator = finalise(numerator.times(x2), wpr, 1); + t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1)); + + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { + sum = sum.times(2); + + // Reverse the argument reduction. Check that e is not 0 because, besides preventing an + // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0. + if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + '')); + sum = divide(sum, new Ctor(n), wpr, 1); + + // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has + // been repeated previously) and the first 4 rounding digits 9999? + // If so, restart the summation with a higher precision, otherwise + // e.g. with precision: 12, rounding: 1 + // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463. + // `wpr - guard` is the index of first rounding digit. + if (sd == null) { + if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += guard; + t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = rep = 1; + } else { + return finalise(sum, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum; + } + } + + sum = t; + denominator += 2; + } + } + + + // ±Infinity, NaN. + function nonFiniteToString(x) { + // Unsigned. + return String(x.s * x.s / 0); + } + + + /* + * Parse the value of a new Decimal `x` from string `str`. + */ + function parseDecimal(x, str) { + var e, i, len; + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(len - 1) === 48; --len); + str = str.slice(i, len); + + if (str) { + len -= i; + x.e = e = e - i - 1; + x.d = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first word of the digits array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.d.push(+str.slice(0, i)); + for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE)); + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--;) str += '0'; + x.d.push(+str); + + if (external) { + + // Overflow? + if (x.e > x.constructor.maxE) { + + // Infinity. + x.d = null; + x.e = NaN; + + // Underflow? + } else if (x.e < x.constructor.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + // x.constructor.underflow = true; + } // else x.constructor.underflow = false; + } + } else { + + // Zero. + x.e = 0; + x.d = [0]; + } + + return x; + } + + + /* + * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value. + */ + function parseOther(x, str) { + var base, Ctor, divisor, i, isFloat, len, p, xd, xe; + + if (str.indexOf('_') > -1) { + str = str.replace(/(\d)_(?=\d)/g, '$1'); + if (isDecimal.test(str)) return parseDecimal(x, str); + } else if (str === 'Infinity' || str === 'NaN') { + if (!+str) x.s = NaN; + x.e = NaN; + x.d = null; + return x; + } + + if (isHex.test(str)) { + base = 16; + str = str.toLowerCase(); + } else if (isBinary.test(str)) { + base = 2; + } else if (isOctal.test(str)) { + base = 8; + } else { + throw Error(invalidArgument + str); + } + + // Is there a binary exponent part? + i = str.search(/p/i); + + if (i > 0) { + p = +str.slice(i + 1); + str = str.substring(2, i); + } else { + str = str.slice(2); + } + + // Convert `str` as an integer then divide the result by `base` raised to a power such that the + // fraction part will be restored. + i = str.indexOf('.'); + isFloat = i >= 0; + Ctor = x.constructor; + + if (isFloat) { + str = str.replace('.', ''); + len = str.length; + i = len - i; + + // log[10](16) = 1.2041... , log[10](88) = 1.9444.... + divisor = intPow(Ctor, new Ctor(base), i, i * 2); + } + + xd = convertBase(str, base, BASE); + xe = xd.length - 1; + + // Remove trailing zeros. + for (i = xe; xd[i] === 0; --i) xd.pop(); + if (i < 0) return new Ctor(x.s * 0); + x.e = getBase10Exponent(xd, xe); + x.d = xd; + external = false; + + // At what precision to perform the division to ensure exact conversion? + // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount) + // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412 + // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits. + // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount + // Therefore using 4 * the number of digits of str will always be enough. + if (isFloat) x = divide(x, divisor, len * 4); + + // Multiply by the binary exponent part if present. + if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); + external = true; + + return x; + } + + + /* + * sin(x) = x - x^3/3! + x^5/5! - ... + * |x| < pi/2 + * + */ + function sine(Ctor, x) { + var k, + len = x.d.length; + + if (len < 3) { + return x.isZero() ? x : taylorSeries(Ctor, 2, x, x); + } + + // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x) + // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5) + // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20)) + + // Estimate the optimum number of times to use the argument reduction. + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x); + + // Reverse argument reduction + var sin2_x, + d5 = new Ctor(5), + d16 = new Ctor(16), + d20 = new Ctor(20); + for (; k--;) { + sin2_x = x.times(x); + x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); + } + + return x; + } + + + // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`. + function taylorSeries(Ctor, n, x, y, isHyperbolic) { + var j, t, u, x2, + i = 1, + pr = Ctor.precision, + k = Math.ceil(pr / LOG_BASE); + + external = false; + x2 = x.times(x); + u = new Ctor(y); + + for (;;) { + t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); + u = isHyperbolic ? y.plus(t) : y.minus(t); + y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); + t = u.plus(y); + + if (t.d[k] !== void 0) { + for (j = k; t.d[j] === u.d[j] && j--;); + if (j == -1) break; + } + + j = u; + u = y; + y = t; + t = j; + i++; + } + + external = true; + t.d.length = k + 1; + + return t; + } + + + // Exponent e must be positive and non-zero. + function tinyPow(b, e) { + var n = b; + while (--e) n *= b; + return n; + } + + + // Return the absolute value of `x` reduced to less than or equal to half pi. + function toLessThanHalfPi(Ctor, x) { + var t, + isNeg = x.s < 0, + pi = getPi(Ctor, Ctor.precision, 1), + halfPi = pi.times(0.5); + + x = x.abs(); + + if (x.lte(halfPi)) { + quadrant = isNeg ? 4 : 1; + return x; + } + + t = x.divToInt(pi); + + if (t.isZero()) { + quadrant = isNeg ? 3 : 2; + } else { + x = x.minus(t.times(pi)); + + // 0 <= x < pi + if (x.lte(halfPi)) { + quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1); + return x; + } + + quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2); + } + + return x.minus(pi).abs(); + } + + + /* + * Return the value of Decimal `x` as a string in base `baseOut`. + * + * If the optional `sd` argument is present include a binary exponent suffix. + */ + function toStringBinary(x, baseOut, sd, rm) { + var base, e, i, k, len, roundUp, str, xd, y, + Ctor = x.constructor, + isExp = sd !== void 0; + + if (isExp) { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + } else { + sd = Ctor.precision; + rm = Ctor.rounding; + } + + if (!x.isFinite()) { + str = nonFiniteToString(x); + } else { + str = finiteToString(x); + i = str.indexOf('.'); + + // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required: + // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10)) + // minBinaryExponent = floor(decimalExponent * log[2](10)) + // log[2](10) = 3.321928094887362347870319429489390175864 + + if (isExp) { + base = 2; + if (baseOut == 16) { + sd = sd * 4 - 3; + } else if (baseOut == 8) { + sd = sd * 3 - 2; + } + } else { + base = baseOut; + } + + // Convert the number as an integer then divide the result by its base raised to a power such + // that the fraction part will be restored. + + // Non-integer. + if (i >= 0) { + str = str.replace('.', ''); + y = new Ctor(1); + y.e = str.length - i; + y.d = convertBase(finiteToString(y), 10, base); + y.e = y.d.length; + } + + xd = convertBase(str, 10, base); + e = len = xd.length; + + // Remove trailing zeros. + for (; xd[--len] == 0;) xd.pop(); + + if (!xd[0]) { + str = isExp ? '0p+0' : '0'; + } else { + if (i < 0) { + e--; + } else { + x = new Ctor(x); + x.d = xd; + x.e = e; + x = divide(x, y, sd, rm, 0, base); + xd = x.d; + e = x.e; + roundUp = inexact; + } + + // The rounding digit, i.e. the digit after the digit that may be rounded up. + i = xd[sd]; + k = base / 2; + roundUp = roundUp || xd[sd + 1] !== void 0; + + roundUp = rm < 4 + ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) + : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || + rm === (x.s < 0 ? 8 : 7)); + + xd.length = sd; + + if (roundUp) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (; ++xd[--sd] > base - 1;) { + xd[sd] = 0; + if (!sd) { + ++e; + xd.unshift(1); + } + } + } + + // Determine trailing zeros. + for (len = xd.length; !xd[len - 1]; --len); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]); + + // Add binary exponent suffix? + if (isExp) { + if (len > 1) { + if (baseOut == 16 || baseOut == 8) { + i = baseOut == 16 ? 4 : 3; + for (--len; len % i; len++) str += '0'; + xd = convertBase(str, base, baseOut); + for (len = xd.length; !xd[len - 1]; --len); + + // xd[0] will always be be 1 + for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]); + } else { + str = str.charAt(0) + '.' + str.slice(1); + } + } + + str = str + (e < 0 ? 'p' : 'p+') + e; + } else if (e < 0) { + for (; ++e;) str = '0' + str; + str = '0.' + str; + } else { + if (++e > len) for (e -= len; e-- ;) str += '0'; + else if (e < len) str = str.slice(0, e) + '.' + str.slice(e); + } + } + + str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str; + } + + return x.s < 0 ? '-' + str : str; + } + + + // Does not strip trailing zeros. + function truncate(arr, len) { + if (arr.length > len) { + arr.length = len; + return true; + } + } + + + // Decimal methods + + + /* + * abs + * acos + * acosh + * add + * asin + * asinh + * atan + * atanh + * atan2 + * cbrt + * ceil + * clamp + * clone + * config + * cos + * cosh + * div + * exp + * floor + * hypot + * ln + * log + * log2 + * log10 + * max + * min + * mod + * mul + * pow + * random + * round + * set + * sign + * sin + * sinh + * sqrt + * sub + * sum + * tan + * tanh + * trunc + */ + + + /* + * Return a new Decimal whose value is the absolute value of `x`. + * + * x {number|string|Decimal} + * + */ + function abs(x) { + return new this(x).abs(); + } + + + /* + * Return a new Decimal whose value is the arccosine in radians of `x`. + * + * x {number|string|Decimal} + * + */ + function acos(x) { + return new this(x).acos(); + } + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function acosh(x) { + return new this(x).acosh(); + } + + + /* + * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ + function add(x, y) { + return new this(x).plus(y); + } + + + /* + * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function asin(x) { + return new this(x).asin(); + } + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function asinh(x) { + return new this(x).asinh(); + } + + + /* + * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function atan(x) { + return new this(x).atan(); + } + + + /* + * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function atanh(x) { + return new this(x).atanh(); + } + + + /* + * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi + * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi, pi] + * + * y {number|string|Decimal} The y-coordinate. + * x {number|string|Decimal} The x-coordinate. + * + * atan2(±0, -0) = ±pi + * atan2(±0, +0) = ±0 + * atan2(±0, -x) = ±pi for x > 0 + * atan2(±0, x) = ±0 for x > 0 + * atan2(-y, ±0) = -pi/2 for y > 0 + * atan2(y, ±0) = pi/2 for y > 0 + * atan2(±y, -Infinity) = ±pi for finite y > 0 + * atan2(±y, +Infinity) = ±0 for finite y > 0 + * atan2(±Infinity, x) = ±pi/2 for finite x + * atan2(±Infinity, -Infinity) = ±3*pi/4 + * atan2(±Infinity, +Infinity) = ±pi/4 + * atan2(NaN, x) = NaN + * atan2(y, NaN) = NaN + * + */ + function atan2(y, x) { + y = new this(y); + x = new this(x); + var r, + pr = this.precision, + rm = this.rounding, + wpr = pr + 4; + + // Either NaN + if (!y.s || !x.s) { + r = new this(NaN); + + // Both ±Infinity + } else if (!y.d && !x.d) { + r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); + r.s = y.s; + + // x is ±Infinity or y is ±0 + } else if (!x.d || y.isZero()) { + r = x.s < 0 ? getPi(this, pr, rm) : new this(0); + r.s = y.s; + + // y is ±Infinity or x is ±0 + } else if (!y.d || x.isZero()) { + r = getPi(this, wpr, 1).times(0.5); + r.s = y.s; + + // Both non-zero and finite + } else if (x.s < 0) { + this.precision = wpr; + this.rounding = 1; + r = this.atan(divide(y, x, wpr, 1)); + x = getPi(this, wpr, 1); + this.precision = pr; + this.rounding = rm; + r = y.s < 0 ? r.minus(x) : r.plus(x); + } else { + r = this.atan(divide(y, x, wpr, 1)); + } + + return r; + } + + + /* + * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function cbrt(x) { + return new this(x).cbrt(); + } + + + /* + * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`. + * + * x {number|string|Decimal} + * + */ + function ceil(x) { + return finalise(x = new this(x), x.e + 1, 2); + } + + + /* + * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`. + * + * x {number|string|Decimal} + * min {number|string|Decimal} + * max {number|string|Decimal} + * + */ + function clamp(x, min, max) { + return new this(x).clamp(min, max); + } + + + /* + * Configure global settings for a Decimal constructor. + * + * `obj` is an object with one or more of the following properties, + * + * precision {number} + * rounding {number} + * toExpNeg {number} + * toExpPos {number} + * maxE {number} + * minE {number} + * modulo {number} + * crypto {boolean|number} + * defaults {true} + * + * E.g. Decimal.config({ precision: 20, rounding: 4 }) + * + */ + function config(obj) { + if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected'); + var i, p, v, + useDefaults = obj.defaults === true, + ps = [ + 'precision', 1, MAX_DIGITS, + 'rounding', 0, 8, + 'toExpNeg', -EXP_LIMIT, 0, + 'toExpPos', 0, EXP_LIMIT, + 'maxE', 0, EXP_LIMIT, + 'minE', -EXP_LIMIT, 0, + 'modulo', 0, 9 + ]; + + for (i = 0; i < ps.length; i += 3) { + if (p = ps[i], useDefaults) this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v; + else throw Error(invalidArgument + p + ': ' + v); + } + } + + if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (v === true || v === false || v === 0 || v === 1) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + this[p] = true; + } else { + throw Error(cryptoUnavailable); + } + } else { + this[p] = false; + } + } else { + throw Error(invalidArgument + p + ': ' + v); + } + } + + return this; + } + + + /* + * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function cos(x) { + return new this(x).cos(); + } + + + /* + * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function cosh(x) { + return new this(x).cosh(); + } + + + /* + * Create and return a Decimal constructor with the same configuration properties as this Decimal + * constructor. + * + */ + function clone(obj) { + var i, p, ps; + + /* + * The Decimal constructor and exported function. + * Return a new Decimal instance. + * + * v {number|string|Decimal} A numeric value. + * + */ + function Decimal(v) { + var e, i, t, + x = this; + + // Decimal called without new. + if (!(x instanceof Decimal)) return new Decimal(v); + + // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor + // which points to Object. + x.constructor = Decimal; + + // Duplicate. + if (isDecimalInstance(v)) { + x.s = v.s; + + if (external) { + if (!v.d || v.e > Decimal.maxE) { + + // Infinity. + x.e = NaN; + x.d = null; + } else if (v.e < Decimal.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + } else { + x.e = v.e; + x.d = v.d.slice(); + } + } else { + x.e = v.e; + x.d = v.d ? v.d.slice() : v.d; + } + + return; + } + + t = typeof v; + + if (t === 'number') { + if (v === 0) { + x.s = 1 / v < 0 ? -1 : 1; + x.e = 0; + x.d = [0]; + return; + } + + if (v < 0) { + v = -v; + x.s = -1; + } else { + x.s = 1; + } + + // Fast path for small integers. + if (v === ~~v && v < 1e7) { + for (e = 0, i = v; i >= 10; i /= 10) e++; + + if (external) { + if (e > Decimal.maxE) { + x.e = NaN; + x.d = null; + } else if (e < Decimal.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = e; + x.d = [v]; + } + } else { + x.e = e; + x.d = [v]; + } + + return; + + // Infinity, NaN. + } else if (v * 0 !== 0) { + if (!v) x.s = NaN; + x.e = NaN; + x.d = null; + return; + } + + return parseDecimal(x, v.toString()); + + } else if (t !== 'string') { + throw Error(invalidArgument + v); + } + + // Minus sign? + if ((i = v.charCodeAt(0)) === 45) { + v = v.slice(1); + x.s = -1; + } else { + // Plus sign? + if (i === 43) v = v.slice(1); + x.s = 1; + } + + return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); + } + + Decimal.prototype = P; + + Decimal.ROUND_UP = 0; + Decimal.ROUND_DOWN = 1; + Decimal.ROUND_CEIL = 2; + Decimal.ROUND_FLOOR = 3; + Decimal.ROUND_HALF_UP = 4; + Decimal.ROUND_HALF_DOWN = 5; + Decimal.ROUND_HALF_EVEN = 6; + Decimal.ROUND_HALF_CEIL = 7; + Decimal.ROUND_HALF_FLOOR = 8; + Decimal.EUCLID = 9; + + Decimal.config = Decimal.set = config; + Decimal.clone = clone; + Decimal.isDecimal = isDecimalInstance; + + Decimal.abs = abs; + Decimal.acos = acos; + Decimal.acosh = acosh; // ES6 + Decimal.add = add; + Decimal.asin = asin; + Decimal.asinh = asinh; // ES6 + Decimal.atan = atan; + Decimal.atanh = atanh; // ES6 + Decimal.atan2 = atan2; + Decimal.cbrt = cbrt; // ES6 + Decimal.ceil = ceil; + Decimal.clamp = clamp; + Decimal.cos = cos; + Decimal.cosh = cosh; // ES6 + Decimal.div = div; + Decimal.exp = exp; + Decimal.floor = floor; + Decimal.hypot = hypot; // ES6 + Decimal.ln = ln; + Decimal.log = log; + Decimal.log10 = log10; // ES6 + Decimal.log2 = log2; // ES6 + Decimal.max = max; + Decimal.min = min; + Decimal.mod = mod; + Decimal.mul = mul; + Decimal.pow = pow; + Decimal.random = random; + Decimal.round = round; + Decimal.sign = sign; // ES6 + Decimal.sin = sin; + Decimal.sinh = sinh; // ES6 + Decimal.sqrt = sqrt; + Decimal.sub = sub; + Decimal.sum = sum; + Decimal.tan = tan; + Decimal.tanh = tanh; // ES6 + Decimal.trunc = trunc; // ES6 + + if (obj === void 0) obj = {}; + if (obj) { + if (obj.defaults !== true) { + ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto']; + for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p]; + } + } + + Decimal.config(obj); + + return Decimal; + } + + + /* + * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ + function div(x, y) { + return new this(x).div(y); + } + + + /* + * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} The power to which to raise the base of the natural log. + * + */ + function exp(x) { + return new this(x).exp(); + } + + + /* + * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`. + * + * x {number|string|Decimal} + * + */ + function floor(x) { + return finalise(x = new this(x), x.e + 1, 3); + } + + + /* + * Return a new Decimal whose value is the square root of the sum of the squares of the arguments, + * rounded to `precision` significant digits using rounding mode `rounding`. + * + * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...) + * + * arguments {number|string|Decimal} + * + */ + function hypot() { + var i, n, + t = new this(0); + + external = false; + + for (i = 0; i < arguments.length;) { + n = new this(arguments[i++]); + if (!n.d) { + if (n.s) { + external = true; + return new this(1 / 0); + } + t = n; + } else if (t.d) { + t = t.plus(n.times(n)); + } + } + + external = true; + + return t.sqrt(); + } + + + /* + * Return true if object is a Decimal instance (where Decimal is any Decimal constructor), + * otherwise return false. + * + */ + function isDecimalInstance(obj) { + return obj instanceof Decimal || obj && obj.toStringTag === tag || false; + } + + + /* + * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function ln(x) { + return new this(x).ln(); + } + + + /* + * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base + * is specified, rounded to `precision` significant digits using rounding mode `rounding`. + * + * log[y](x) + * + * x {number|string|Decimal} The argument of the logarithm. + * y {number|string|Decimal} The base of the logarithm. + * + */ + function log(x, y) { + return new this(x).log(y); + } + + + /* + * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function log2(x) { + return new this(x).log(2); + } + + + /* + * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function log10(x) { + return new this(x).log(10); + } + + + /* + * Return a new Decimal whose value is the maximum of the arguments. + * + * arguments {number|string|Decimal} + * + */ + function max() { + return maxOrMin(this, arguments, 'lt'); + } + + + /* + * Return a new Decimal whose value is the minimum of the arguments. + * + * arguments {number|string|Decimal} + * + */ + function min() { + return maxOrMin(this, arguments, 'gt'); + } + + + /* + * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ + function mod(x, y) { + return new this(x).mod(y); + } + + + /* + * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ + function mul(x, y) { + return new this(x).mul(y); + } + + + /* + * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} The base. + * y {number|string|Decimal} The exponent. + * + */ + function pow(x, y) { + return new this(x).pow(y); + } + + + /* + * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with + * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros + * are produced). + * + * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive. + * + */ + function random(sd) { + var d, e, k, n, + i = 0, + r = new this(1), + rd = []; + + if (sd === void 0) sd = this.precision; + else checkInt32(sd, 1, MAX_DIGITS); + + k = Math.ceil(sd / LOG_BASE); + + if (!this.crypto) { + for (; i < k;) rd[i++] = Math.random() * 1e7 | 0; + + // Browsers supporting crypto.getRandomValues. + } else if (crypto.getRandomValues) { + d = crypto.getRandomValues(new Uint32Array(k)); + + for (; i < k;) { + n = d[i]; + + // 0 <= n < 4294967296 + // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865). + if (n >= 4.29e9) { + d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; + } else { + + // 0 <= n <= 4289999999 + // 0 <= (n % 1e7) <= 9999999 + rd[i++] = n % 1e7; + } + } + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + d = crypto.randomBytes(k *= 4); + + for (; i < k;) { + + // 0 <= n < 2147483648 + n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24); + + // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286). + if (n >= 2.14e9) { + crypto.randomBytes(4).copy(d, i); + } else { + + // 0 <= n <= 2139999999 + // 0 <= (n % 1e7) <= 9999999 + rd.push(n % 1e7); + i += 4; + } + } + + i = k / 4; + } else { + throw Error(cryptoUnavailable); + } + + k = rd[--i]; + sd %= LOG_BASE; + + // Convert trailing digits to zeros according to sd. + if (k && sd) { + n = mathpow(10, LOG_BASE - sd); + rd[i] = (k / n | 0) * n; + } + + // Remove trailing words which are zero. + for (; rd[i] === 0; i--) rd.pop(); + + // Zero? + if (i < 0) { + e = 0; + rd = [0]; + } else { + e = -1; + + // Remove leading words which are zero and adjust exponent accordingly. + for (; rd[0] === 0; e -= LOG_BASE) rd.shift(); + + // Count the digits of the first word of rd to determine leading zeros. + for (k = 1, n = rd[0]; n >= 10; n /= 10) k++; + + // Adjust the exponent for leading zeros of the first word of rd. + if (k < LOG_BASE) e -= LOG_BASE - k; + } + + r.e = e; + r.d = rd; + + return r; + } + + + /* + * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`. + * + * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL). + * + * x {number|string|Decimal} + * + */ + function round(x) { + return finalise(x = new this(x), x.e + 1, this.rounding); + } + + + /* + * Return + * 1 if x > 0, + * -1 if x < 0, + * 0 if x is 0, + * -0 if x is -0, + * NaN otherwise + * + * x {number|string|Decimal} + * + */ + function sign(x) { + x = new this(x); + return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN; + } + + + /* + * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function sin(x) { + return new this(x).sin(); + } + + + /* + * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function sinh(x) { + return new this(x).sinh(); + } + + + /* + * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ + function sqrt(x) { + return new this(x).sqrt(); + } + + + /* + * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ + function sub(x, y) { + return new this(x).sub(y); + } + + + /* + * Return a new Decimal whose value is the sum of the arguments, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * Only the result is rounded, not the intermediate calculations. + * + * arguments {number|string|Decimal} + * + */ + function sum() { + var i = 0, + args = arguments, + x = new this(args[i]); + + external = false; + for (; x.s && ++i < args.length;) x = x.plus(args[i]); + external = true; + + return finalise(x, this.precision, this.rounding); + } + + + /* + * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function tan(x) { + return new this(x).tan(); + } + + + /* + * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ + function tanh(x) { + return new this(x).tanh(); + } + + + /* + * Return a new Decimal whose value is `x` truncated to an integer. + * + * x {number|string|Decimal} + * + */ + function trunc(x) { + return finalise(x = new this(x), x.e + 1, 1); + } + + + // Create and configure initial Decimal constructor. + Decimal = clone(DEFAULTS); + Decimal.prototype.constructor = Decimal; + Decimal['default'] = Decimal.Decimal = Decimal; + + // Create the internal constants from their string values. + LN10 = new Decimal(LN10); + PI = new Decimal(PI); + + + // Export. + + + // AMD. + if (typeof define == 'function' && define.amd) { + define(function () { + return Decimal; + }); + + // Node and other environments that support module.exports. + } else if (typeof module != 'undefined' && module.exports) { + if (typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol') { + P[Symbol['for']('nodejs.util.inspect.custom')] = P.toString; + P[Symbol.toStringTag] = 'Decimal'; + } + + module.exports = Decimal; + + // Browser. + } else { + if (!globalScope) { + globalScope = typeof self != 'undefined' && self && self.self == self ? self : window; + } + + noConflict = globalScope.Decimal; + Decimal.noConflict = function () { + globalScope.Decimal = noConflict; + return Decimal; + }; + + globalScope.Decimal = Decimal; + } +})(this); diff --git a/24_10_22_faktorialis/node_modules/decimal.js/decimal.mjs b/24_10_22_faktorialis/node_modules/decimal.js/decimal.mjs new file mode 100644 index 0000000..909300c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/decimal.mjs @@ -0,0 +1,4898 @@ +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ + + +// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ // + + + // The maximum exponent magnitude. + // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`. +var EXP_LIMIT = 9e15, // 0 to 9e15 + + // The limit on the value of `precision`, and on the value of the first argument to + // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`. + MAX_DIGITS = 1e9, // 0 to 1e9 + + // Base conversion alphabet. + NUMERALS = '0123456789abcdef', + + // The natural logarithm of 10 (1025 digits). + LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058', + + // Pi (1025 digits). + PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789', + + + // The initial configuration properties of the Decimal constructor. + DEFAULTS = { + + // These values must be integers within the stated ranges (inclusive). + // Most of these values can be changed at run-time using the `Decimal.config` method. + + // The maximum number of significant digits of the result of a calculation or base conversion. + // E.g. `Decimal.config({ precision: 20 });` + precision: 20, // 1 to MAX_DIGITS + + // The rounding mode used when rounding to `precision`. + // + // ROUND_UP 0 Away from zero. + // ROUND_DOWN 1 Towards zero. + // ROUND_CEIL 2 Towards +Infinity. + // ROUND_FLOOR 3 Towards -Infinity. + // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + // + // E.g. + // `Decimal.rounding = 4;` + // `Decimal.rounding = Decimal.ROUND_HALF_UP;` + rounding: 4, // 0 to 8 + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend (JavaScript %). + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 The IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive. + // + // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian + // division (9) are commonly used for the modulus operation. The other rounding modes can also + // be used, but they may not give useful results. + modulo: 1, // 0 to 9 + + // The exponent value at and beneath which `toString` returns exponential notation. + // JavaScript numbers: -7 + toExpNeg: -7, // 0 to -EXP_LIMIT + + // The exponent value at and above which `toString` returns exponential notation. + // JavaScript numbers: 21 + toExpPos: 21, // 0 to EXP_LIMIT + + // The minimum exponent value, beneath which underflow to zero occurs. + // JavaScript numbers: -324 (5e-324) + minE: -EXP_LIMIT, // -1 to -EXP_LIMIT + + // The maximum exponent value, above which overflow to Infinity occurs. + // JavaScript numbers: 308 (1.7976931348623157e+308) + maxE: EXP_LIMIT, // 1 to EXP_LIMIT + + // Whether to use cryptographically-secure random number generation, if available. + crypto: false // true/false + }, + + +// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- // + + + inexact, quadrant, + external = true, + + decimalError = '[DecimalError] ', + invalidArgument = decimalError + 'Invalid argument: ', + precisionLimitExceeded = decimalError + 'Precision limit exceeded', + cryptoUnavailable = decimalError + 'crypto unavailable', + tag = '[object Decimal]', + + mathfloor = Math.floor, + mathpow = Math.pow, + + isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, + isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, + isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, + isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, + + BASE = 1e7, + LOG_BASE = 7, + MAX_SAFE_INTEGER = 9007199254740991, + + LN10_PRECISION = LN10.length - 1, + PI_PRECISION = PI.length - 1, + + // Decimal.prototype object + P = { toStringTag: tag }; + + +// Decimal prototype methods + + +/* + * absoluteValue abs + * ceil + * clampedTo clamp + * comparedTo cmp + * cosine cos + * cubeRoot cbrt + * decimalPlaces dp + * dividedBy div + * dividedToIntegerBy divToInt + * equals eq + * floor + * greaterThan gt + * greaterThanOrEqualTo gte + * hyperbolicCosine cosh + * hyperbolicSine sinh + * hyperbolicTangent tanh + * inverseCosine acos + * inverseHyperbolicCosine acosh + * inverseHyperbolicSine asinh + * inverseHyperbolicTangent atanh + * inverseSine asin + * inverseTangent atan + * isFinite + * isInteger isInt + * isNaN + * isNegative isNeg + * isPositive isPos + * isZero + * lessThan lt + * lessThanOrEqualTo lte + * logarithm log + * [maximum] [max] + * [minimum] [min] + * minus sub + * modulo mod + * naturalExponential exp + * naturalLogarithm ln + * negated neg + * plus add + * precision sd + * round + * sine sin + * squareRoot sqrt + * tangent tan + * times mul + * toBinary + * toDecimalPlaces toDP + * toExponential + * toFixed + * toFraction + * toHexadecimal toHex + * toNearest + * toNumber + * toOctal + * toPower pow + * toPrecision + * toSignificantDigits toSD + * toString + * truncated trunc + * valueOf toJSON + */ + + +/* + * Return a new Decimal whose value is the absolute value of this Decimal. + * + */ +P.absoluteValue = P.abs = function () { + var x = new this.constructor(this); + if (x.s < 0) x.s = 1; + return finalise(x); +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the + * direction of positive Infinity. + * + */ +P.ceil = function () { + return finalise(new this.constructor(this), this.e + 1, 2); +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal clamped to the range + * delineated by `min` and `max`. + * + * min {number|string|Decimal} + * max {number|string|Decimal} + * + */ +P.clampedTo = P.clamp = function (min, max) { + var k, + x = this, + Ctor = x.constructor; + min = new Ctor(min); + max = new Ctor(max); + if (!min.s || !max.s) return new Ctor(NaN); + if (min.gt(max)) throw Error(invalidArgument + max); + k = x.cmp(min); + return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x); +}; + + +/* + * Return + * 1 if the value of this Decimal is greater than the value of `y`, + * -1 if the value of this Decimal is less than the value of `y`, + * 0 if they have the same value, + * NaN if the value of either Decimal is NaN. + * + */ +P.comparedTo = P.cmp = function (y) { + var i, j, xdL, ydL, + x = this, + xd = x.d, + yd = (y = new x.constructor(y)).d, + xs = x.s, + ys = y.s; + + // Either NaN or ±Infinity? + if (!xd || !yd) { + return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; + } + + // Either zero? + if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0; + + // Signs differ? + if (xs !== ys) return xs; + + // Compare exponents. + if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1; + + xdL = xd.length; + ydL = yd.length; + + // Compare digit by digit. + for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { + if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; + } + + // Compare lengths. + return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; +}; + + +/* + * Return a new Decimal whose value is the cosine of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * cos(0) = 1 + * cos(-0) = 1 + * cos(Infinity) = NaN + * cos(-Infinity) = NaN + * cos(NaN) = NaN + * + */ +P.cosine = P.cos = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.d) return new Ctor(NaN); + + // cos(0) = cos(-0) = 1 + if (!x.d[0]) return new Ctor(1); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + + x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); +}; + + +/* + * + * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * cbrt(0) = 0 + * cbrt(-0) = -0 + * cbrt(1) = 1 + * cbrt(-1) = -1 + * cbrt(N) = N + * cbrt(-I) = -I + * cbrt(I) = I + * + * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3)) + * + */ +P.cubeRoot = P.cbrt = function () { + var e, m, n, r, rep, s, sd, t, t3, t3plusx, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + external = false; + + // Initial estimate. + s = x.s * mathpow(x.s * x, 1 / 3); + + // Math.cbrt underflow/overflow? + // Pass x to Math.pow as integer, then adjust the exponent of the result. + if (!s || Math.abs(s) == 1 / 0) { + n = digitsToString(x.d); + e = x.e; + + // Adjust n exponent so it is a multiple of 3 away from x exponent. + if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00'); + s = mathpow(n, 1 / 3); + + // Rarely, e may be one less than the result exponent value. + e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); + + if (s == 1 / 0) { + n = '5e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new Ctor(n); + r.s = x.s; + } else { + r = new Ctor(s.toString()); + } + + sd = (e = Ctor.precision) + 3; + + // Halley's method. + // TODO? Compare Newton's method. + for (;;) { + t = r; + t3 = t.times(t).times(t); + t3plusx = t3.plus(x); + r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); + + // TODO? Replace with for-loop and checkRoundingDigits. + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999 + // , i.e. approaching a rounding boundary, continue the iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the exact result as the + // nines may infinitely repeat. + if (!rep) { + finalise(t, e + 1, 0); + + if (t.times(t).times(t).eq(x)) { + r = t; + break; + } + } + + sd += 4; + rep = 1; + } else { + + // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. + // If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + finalise(r, e + 1, 1); + m = !r.times(r).times(r).eq(x); + } + + break; + } + } + } + + external = true; + + return finalise(r, e, Ctor.rounding, m); +}; + + +/* + * Return the number of decimal places of the value of this Decimal. + * + */ +P.decimalPlaces = P.dp = function () { + var w, + d = this.d, + n = NaN; + + if (d) { + w = d.length - 1; + n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last word. + w = d[w]; + if (w) for (; w % 10 == 0; w /= 10) n--; + if (n < 0) n = 0; + } + + return n; +}; + + +/* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + */ +P.dividedBy = P.div = function (y) { + return divide(this, new this.constructor(y)); +}; + + +/* + * Return a new Decimal whose value is the integer part of dividing the value of this Decimal + * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`. + * + */ +P.dividedToIntegerBy = P.divToInt = function (y) { + var x = this, + Ctor = x.constructor; + return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); +}; + + +/* + * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false. + * + */ +P.equals = P.eq = function (y) { + return this.cmp(y) === 0; +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the + * direction of negative Infinity. + * + */ +P.floor = function () { + return finalise(new this.constructor(this), this.e + 1, 3); +}; + + +/* + * Return true if the value of this Decimal is greater than the value of `y`, otherwise return + * false. + * + */ +P.greaterThan = P.gt = function (y) { + return this.cmp(y) > 0; +}; + + +/* + * Return true if the value of this Decimal is greater than or equal to the value of `y`, + * otherwise return false. + * + */ +P.greaterThanOrEqualTo = P.gte = function (y) { + var k = this.cmp(y); + return k == 1 || k === 0; +}; + + +/* + * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [1, Infinity] + * + * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ... + * + * cosh(0) = 1 + * cosh(-0) = 1 + * cosh(Infinity) = Infinity + * cosh(-Infinity) = Infinity + * cosh(NaN) = NaN + * + * x time taken (ms) result + * 1000 9 9.8503555700852349694e+433 + * 10000 25 4.4034091128314607936e+4342 + * 100000 171 1.4033316802130615897e+43429 + * 1000000 3817 1.5166076984010437725e+434294 + * 10000000 abandoned after 2 minute wait + * + * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x)) + * + */ +P.hyperbolicCosine = P.cosh = function () { + var k, n, pr, rm, len, + x = this, + Ctor = x.constructor, + one = new Ctor(1); + + if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN); + if (x.isZero()) return one; + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + + // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1 + // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4)) + + // Estimate the optimum number of times to use the argument reduction. + // TODO? Estimation reused from cosine() and may not be optimal here. + if (len < 32) { + k = Math.ceil(len / 3); + n = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + n = '2.3283064365386962890625e-10'; + } + + x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); + + // Reverse argument reduction + var cosh2_x, + i = k, + d8 = new Ctor(8); + for (; i--;) { + cosh2_x = x.times(x); + x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); + } + + return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); +}; + + +/* + * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ... + * + * sinh(0) = 0 + * sinh(-0) = -0 + * sinh(Infinity) = Infinity + * sinh(-Infinity) = -Infinity + * sinh(NaN) = NaN + * + * x time taken (ms) + * 10 2 ms + * 100 5 ms + * 1000 14 ms + * 10000 82 ms + * 100000 886 ms 1.4033316802130615897e+43429 + * 200000 2613 ms + * 300000 5407 ms + * 400000 8824 ms + * 500000 13026 ms 8.7080643612718084129e+217146 + * 1000000 48543 ms + * + * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x)) + * + */ +P.hyperbolicSine = P.sinh = function () { + var k, pr, rm, len, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + + if (len < 3) { + x = taylorSeries(Ctor, 2, x, x, true); + } else { + + // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x)) + // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3)) + // 3 multiplications and 1 addition + + // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x))) + // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5))) + // 4 multiplications and 2 additions + + // Estimate the optimum number of times to use the argument reduction. + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x, true); + + // Reverse argument reduction + var sinh2_x, + d5 = new Ctor(5), + d16 = new Ctor(16), + d20 = new Ctor(20); + for (; k--;) { + sinh2_x = x.times(x); + x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); + } + } + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(x, pr, rm, true); +}; + + +/* + * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * tanh(x) = sinh(x) / cosh(x) + * + * tanh(0) = 0 + * tanh(-0) = -0 + * tanh(Infinity) = 1 + * tanh(-Infinity) = -1 + * tanh(NaN) = NaN + * + */ +P.hyperbolicTangent = P.tanh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(x.s); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 7; + Ctor.rounding = 1; + + return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); +}; + + +/* + * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of + * this Decimal. + * + * Domain: [-1, 1] + * Range: [0, pi] + * + * acos(x) = pi/2 - asin(x) + * + * acos(0) = pi/2 + * acos(-0) = pi/2 + * acos(1) = 0 + * acos(-1) = pi + * acos(1/2) = pi/3 + * acos(-1/2) = 2*pi/3 + * acos(|x| > 1) = NaN + * acos(NaN) = NaN + * + */ +P.inverseCosine = P.acos = function () { + var halfPi, + x = this, + Ctor = x.constructor, + k = x.abs().cmp(1), + pr = Ctor.precision, + rm = Ctor.rounding; + + if (k !== -1) { + return k === 0 + // |x| is 1 + ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) + // |x| > 1 or x is NaN + : new Ctor(NaN); + } + + if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5); + + // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3 + + Ctor.precision = pr + 6; + Ctor.rounding = 1; + + x = x.asin(); + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return halfPi.minus(x); +}; + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the + * value of this Decimal. + * + * Domain: [1, Infinity] + * Range: [0, Infinity] + * + * acosh(x) = ln(x + sqrt(x^2 - 1)) + * + * acosh(x < 1) = NaN + * acosh(NaN) = NaN + * acosh(Infinity) = Infinity + * acosh(-Infinity) = NaN + * acosh(0) = NaN + * acosh(-0) = NaN + * acosh(1) = 0 + * acosh(-1) = NaN + * + */ +P.inverseHyperbolicCosine = P.acosh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN); + if (!x.isFinite()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; + Ctor.rounding = 1; + external = false; + + x = x.times(x).minus(1).sqrt().plus(x); + + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.ln(); +}; + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value + * of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * asinh(x) = ln(x + sqrt(x^2 + 1)) + * + * asinh(NaN) = NaN + * asinh(Infinity) = Infinity + * asinh(-Infinity) = -Infinity + * asinh(0) = 0 + * asinh(-0) = -0 + * + */ +P.inverseHyperbolicSine = P.asinh = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite() || x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; + Ctor.rounding = 1; + external = false; + + x = x.times(x).plus(1).sqrt().plus(x); + + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.ln(); +}; + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the + * value of this Decimal. + * + * Domain: [-1, 1] + * Range: [-Infinity, Infinity] + * + * atanh(x) = 0.5 * ln((1 + x) / (1 - x)) + * + * atanh(|x| > 1) = NaN + * atanh(NaN) = NaN + * atanh(Infinity) = NaN + * atanh(-Infinity) = NaN + * atanh(0) = 0 + * atanh(-0) = -0 + * atanh(1) = Infinity + * atanh(-1) = -Infinity + * + */ +P.inverseHyperbolicTangent = P.atanh = function () { + var pr, rm, wpr, xsd, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); + + pr = Ctor.precision; + rm = Ctor.rounding; + xsd = x.sd(); + + if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true); + + Ctor.precision = wpr = xsd - x.e; + + x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); + + Ctor.precision = pr + 4; + Ctor.rounding = 1; + + x = x.ln(); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.times(0.5); +}; + + +/* + * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this + * Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi/2, pi/2] + * + * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2))) + * + * asin(0) = 0 + * asin(-0) = -0 + * asin(1/2) = pi/6 + * asin(-1/2) = -pi/6 + * asin(1) = pi/2 + * asin(-1) = -pi/2 + * asin(|x| > 1) = NaN + * asin(NaN) = NaN + * + * TODO? Compare performance of Taylor series. + * + */ +P.inverseSine = P.asin = function () { + var halfPi, k, + pr, rm, + x = this, + Ctor = x.constructor; + + if (x.isZero()) return new Ctor(x); + + k = x.abs().cmp(1); + pr = Ctor.precision; + rm = Ctor.rounding; + + if (k !== -1) { + + // |x| is 1 + if (k === 0) { + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + halfPi.s = x.s; + return halfPi; + } + + // |x| > 1 or x is NaN + return new Ctor(NaN); + } + + // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6 + + Ctor.precision = pr + 6; + Ctor.rounding = 1; + + x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return x.times(2); +}; + + +/* + * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value + * of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi/2, pi/2] + * + * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... + * + * atan(0) = 0 + * atan(-0) = -0 + * atan(1) = pi/4 + * atan(-1) = -pi/4 + * atan(Infinity) = pi/2 + * atan(-Infinity) = -pi/2 + * atan(NaN) = NaN + * + */ +P.inverseTangent = P.atan = function () { + var i, j, k, n, px, t, r, wpr, x2, + x = this, + Ctor = x.constructor, + pr = Ctor.precision, + rm = Ctor.rounding; + + if (!x.isFinite()) { + if (!x.s) return new Ctor(NaN); + if (pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.5); + r.s = x.s; + return r; + } + } else if (x.isZero()) { + return new Ctor(x); + } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.25); + r.s = x.s; + return r; + } + + Ctor.precision = wpr = pr + 10; + Ctor.rounding = 1; + + // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x); + + // Argument reduction + // Ensure |x| < 0.42 + // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2))) + + k = Math.min(28, wpr / LOG_BASE + 2 | 0); + + for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1)); + + external = false; + + j = Math.ceil(wpr / LOG_BASE); + n = 1; + x2 = x.times(x); + r = new Ctor(x); + px = x; + + // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... + for (; i !== -1;) { + px = px.times(x2); + t = r.minus(px.div(n += 2)); + + px = px.times(x2); + r = t.plus(px.div(n += 2)); + + if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;); + } + + if (k) r = r.times(2 << (k - 1)); + + external = true; + + return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); +}; + + +/* + * Return true if the value of this Decimal is a finite number, otherwise return false. + * + */ +P.isFinite = function () { + return !!this.d; +}; + + +/* + * Return true if the value of this Decimal is an integer, otherwise return false. + * + */ +P.isInteger = P.isInt = function () { + return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; +}; + + +/* + * Return true if the value of this Decimal is NaN, otherwise return false. + * + */ +P.isNaN = function () { + return !this.s; +}; + + +/* + * Return true if the value of this Decimal is negative, otherwise return false. + * + */ +P.isNegative = P.isNeg = function () { + return this.s < 0; +}; + + +/* + * Return true if the value of this Decimal is positive, otherwise return false. + * + */ +P.isPositive = P.isPos = function () { + return this.s > 0; +}; + + +/* + * Return true if the value of this Decimal is 0 or -0, otherwise return false. + * + */ +P.isZero = function () { + return !!this.d && this.d[0] === 0; +}; + + +/* + * Return true if the value of this Decimal is less than `y`, otherwise return false. + * + */ +P.lessThan = P.lt = function (y) { + return this.cmp(y) < 0; +}; + + +/* + * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false. + * + */ +P.lessThanOrEqualTo = P.lte = function (y) { + return this.cmp(y) < 1; +}; + + +/* + * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * If no base is specified, return log[10](arg). + * + * log[base](arg) = ln(arg) / ln(base) + * + * The result will always be correctly rounded if the base of the log is 10, and 'almost always' + * otherwise: + * + * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen + * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error + * between the result and the correctly rounded result will be one ulp (unit in the last place). + * + * log[-b](a) = NaN + * log[0](a) = NaN + * log[1](a) = NaN + * log[NaN](a) = NaN + * log[Infinity](a) = NaN + * log[b](0) = -Infinity + * log[b](-0) = -Infinity + * log[b](-a) = NaN + * log[b](1) = 0 + * log[b](Infinity) = Infinity + * log[b](NaN) = NaN + * + * [base] {number|string|Decimal} The base of the logarithm. + * + */ +P.logarithm = P.log = function (base) { + var isBase10, d, denominator, k, inf, num, sd, r, + arg = this, + Ctor = arg.constructor, + pr = Ctor.precision, + rm = Ctor.rounding, + guard = 5; + + // Default base is 10. + if (base == null) { + base = new Ctor(10); + isBase10 = true; + } else { + base = new Ctor(base); + d = base.d; + + // Return NaN if base is negative, or non-finite, or is 0 or 1. + if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN); + + isBase10 = base.eq(10); + } + + d = arg.d; + + // Is arg negative, non-finite, 0 or 1? + if (arg.s < 0 || !d || !d[0] || arg.eq(1)) { + return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0); + } + + // The result will have a non-terminating decimal expansion if base is 10 and arg is not an + // integer power of 10. + if (isBase10) { + if (d.length > 1) { + inf = true; + } else { + for (k = d[0]; k % 10 === 0;) k /= 10; + inf = k !== 1; + } + } + + external = false; + sd = pr + guard; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + + // The result will have 5 rounding digits. + r = divide(num, denominator, sd, 1); + + // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000, + // calculate 10 further digits. + // + // If the result is known to have an infinite decimal expansion, repeat this until it is clear + // that the result is above or below the boundary. Otherwise, if after calculating the 10 + // further digits, the last 14 are nines, round up and assume the result is exact. + // Also assume the result is exact if the last 14 are zero. + // + // Example of a result that will be incorrectly rounded: + // log[1048576](4503599627370502) = 2.60000000000000009610279511444746... + // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it + // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so + // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal + // place is still 2.6. + if (checkRoundingDigits(r.d, k = pr, rm)) { + + do { + sd += 10; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + + if (!inf) { + + // Check for 14 nines from the 2nd rounding digit, as the first may be 4. + if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + + break; + } + } while (checkRoundingDigits(r.d, k += 10, rm)); + } + + external = true; + + return finalise(r, pr, rm); +}; + + +/* + * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal. + * + * arguments {number|string|Decimal} + * +P.max = function () { + Array.prototype.push.call(arguments, this); + return maxOrMin(this.constructor, arguments, 'lt'); +}; + */ + + +/* + * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal. + * + * arguments {number|string|Decimal} + * +P.min = function () { + Array.prototype.push.call(arguments, this); + return maxOrMin(this.constructor, arguments, 'gt'); +}; + */ + + +/* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ +P.minus = P.sub = function (y) { + var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // If either is not finite... + if (!x.d || !y.d) { + + // Return NaN if either is NaN. + if (!x.s || !y.s) y = new Ctor(NaN); + + // Return y negated if x is finite and y is ±Infinity. + else if (x.d) y.s = -y.s; + + // Return x if y is finite and x is ±Infinity. + // Return x if both are ±Infinity with different signs. + // Return NaN if both are ±Infinity with the same sign. + else y = new Ctor(y.d || x.s !== y.s ? x : NaN); + + return y; + } + + // If signs differ... + if (x.s != y.s) { + y.s = -y.s; + return x.plus(y); + } + + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + + // If either is zero... + if (!xd[0] || !yd[0]) { + + // Return y negated if x is zero and y is non-zero. + if (yd[0]) y.s = -y.s; + + // Return x if y is zero and x is non-zero. + else if (xd[0]) y = new Ctor(x); + + // Return zero if both are zero. + // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity. + else return new Ctor(rm === 3 ? -0 : 0); + + return external ? finalise(y, pr, rm) : y; + } + + // x and y are finite, non-zero numbers with the same sign. + + // Calculate base 1e7 exponents. + e = mathfloor(y.e / LOG_BASE); + xe = mathfloor(x.e / LOG_BASE); + + xd = xd.slice(); + k = xe - e; + + // If base 1e7 exponents differ... + if (k) { + xLTy = k < 0; + + if (xLTy) { + d = xd; + k = -k; + len = yd.length; + } else { + d = yd; + e = xe; + len = xd.length; + } + + // Numbers with massively different exponents would result in a very high number of + // zeros needing to be prepended, but this can be avoided while still ensuring correct + // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`. + i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; + + if (k > i) { + k = i; + d.length = 1; + } + + // Prepend zeros to equalise exponents. + d.reverse(); + for (i = k; i--;) d.push(0); + d.reverse(); + + // Base 1e7 exponents equal. + } else { + + // Check digits to determine which is the bigger number. + + i = xd.length; + len = yd.length; + xLTy = i < len; + if (xLTy) len = i; + + for (i = 0; i < len; i++) { + if (xd[i] != yd[i]) { + xLTy = xd[i] < yd[i]; + break; + } + } + + k = 0; + } + + if (xLTy) { + d = xd; + xd = yd; + yd = d; + y.s = -y.s; + } + + len = xd.length; + + // Append zeros to `xd` if shorter. + // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length. + for (i = yd.length - len; i > 0; --i) xd[len++] = 0; + + // Subtract yd from xd. + for (i = yd.length; i > k;) { + + if (xd[--i] < yd[i]) { + for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1; + --xd[j]; + xd[i] += BASE; + } + + xd[i] -= yd[i]; + } + + // Remove trailing zeros. + for (; xd[--len] === 0;) xd.pop(); + + // Remove leading zeros and adjust exponent accordingly. + for (; xd[0] === 0; xd.shift()) --e; + + // Zero? + if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0); + + y.d = xd; + y.e = getBase10Exponent(xd, e); + + return external ? finalise(y, pr, rm) : y; +}; + + +/* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * The result depends on the modulo mode. + * + */ +P.modulo = P.mod = function (y) { + var q, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0. + if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN); + + // Return x if y is ±Infinity or x is ±0. + if (!y.d || x.d && !x.d[0]) { + return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); + } + + // Prevent rounding of intermediate calculations. + external = false; + + if (Ctor.modulo == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // result = x - q * y where 0 <= result < abs(y) + q = divide(x, y.abs(), 0, 3, 1); + q.s *= y.s; + } else { + q = divide(x, y, 0, Ctor.modulo, 1); + } + + q = q.times(y); + + external = true; + + return x.minus(q); +}; + + +/* + * Return a new Decimal whose value is the natural exponential of the value of this Decimal, + * i.e. the base e raised to the power the value of this Decimal, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ +P.naturalExponential = P.exp = function () { + return naturalExponential(this); +}; + + +/* + * Return a new Decimal whose value is the natural logarithm of the value of this Decimal, + * rounded to `precision` significant digits using rounding mode `rounding`. + * + */ +P.naturalLogarithm = P.ln = function () { + return naturalLogarithm(this); +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by + * -1. + * + */ +P.negated = P.neg = function () { + var x = new this.constructor(this); + x.s = -x.s; + return finalise(x); +}; + + +/* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + */ +P.plus = P.add = function (y) { + var carry, d, e, i, k, len, pr, rm, xd, yd, + x = this, + Ctor = x.constructor; + + y = new Ctor(y); + + // If either is not finite... + if (!x.d || !y.d) { + + // Return NaN if either is NaN. + if (!x.s || !y.s) y = new Ctor(NaN); + + // Return x if y is finite and x is ±Infinity. + // Return x if both are ±Infinity with the same sign. + // Return NaN if both are ±Infinity with different signs. + // Return y if x is finite and y is ±Infinity. + else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN); + + return y; + } + + // If signs differ... + if (x.s != y.s) { + y.s = -y.s; + return x.minus(y); + } + + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + + // If either is zero... + if (!xd[0] || !yd[0]) { + + // Return x if y is zero. + // Return y if y is non-zero. + if (!yd[0]) y = new Ctor(x); + + return external ? finalise(y, pr, rm) : y; + } + + // x and y are finite, non-zero numbers with the same sign. + + // Calculate base 1e7 exponents. + k = mathfloor(x.e / LOG_BASE); + e = mathfloor(y.e / LOG_BASE); + + xd = xd.slice(); + i = k - e; + + // If base 1e7 exponents differ... + if (i) { + + if (i < 0) { + d = xd; + i = -i; + len = yd.length; + } else { + d = yd; + e = k; + len = xd.length; + } + + // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1. + k = Math.ceil(pr / LOG_BASE); + len = k > len ? k + 1 : len + 1; + + if (i > len) { + i = len; + d.length = 1; + } + + // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts. + d.reverse(); + for (; i--;) d.push(0); + d.reverse(); + } + + len = xd.length; + i = yd.length; + + // If yd is longer than xd, swap xd and yd so xd points to the longer array. + if (len - i < 0) { + i = len; + d = yd; + yd = xd; + xd = d; + } + + // Only start adding at yd.length - 1 as the further digits of xd can be left as they are. + for (carry = 0; i;) { + carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; + xd[i] %= BASE; + } + + if (carry) { + xd.unshift(carry); + ++e; + } + + // Remove trailing zeros. + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + for (len = xd.length; xd[--len] == 0;) xd.pop(); + + y.d = xd; + y.e = getBase10Exponent(xd, e); + + return external ? finalise(y, pr, rm) : y; +}; + + +/* + * Return the number of significant digits of the value of this Decimal. + * + * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0. + * + */ +P.precision = P.sd = function (z) { + var k, + x = this; + + if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z); + + if (x.d) { + k = getPrecision(x.d); + if (z && x.e + 1 > k) k = x.e + 1; + } else { + k = NaN; + } + + return k; +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using + * rounding mode `rounding`. + * + */ +P.round = function () { + var x = this, + Ctor = x.constructor; + + return finalise(new Ctor(x), x.e + 1, Ctor.rounding); +}; + + +/* + * Return a new Decimal whose value is the sine of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-1, 1] + * + * sin(x) = x - x^3/3! + x^5/5! - ... + * + * sin(0) = 0 + * sin(-0) = -0 + * sin(Infinity) = NaN + * sin(-Infinity) = NaN + * sin(NaN) = NaN + * + */ +P.sine = P.sin = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + + x = sine(Ctor, toLessThanHalfPi(Ctor, x)); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); +}; + + +/* + * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + */ +P.squareRoot = P.sqrt = function () { + var m, n, sd, r, rep, t, + x = this, + d = x.d, + e = x.e, + s = x.s, + Ctor = x.constructor; + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !d || !d[0]) { + return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); + } + + external = false; + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = digitsToString(d); + + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '5e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new Ctor(n); + } else { + r = new Ctor(s.toString()); + } + + sd = (e = Ctor.precision) + 3; + + // Newton-Raphson iteration. + for (;;) { + t = r; + r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); + + // TODO? Replace with for-loop and checkRoundingDigits. + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or + // 4999, i.e. approaching a rounding boundary, continue the iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the exact result as the + // nines may infinitely repeat. + if (!rep) { + finalise(t, e + 1, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + sd += 4; + rep = 1; + } else { + + // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. + // If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + finalise(r, e + 1, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + + external = true; + + return finalise(r, e, Ctor.rounding, m); +}; + + +/* + * Return a new Decimal whose value is the tangent of the value in radians of this Decimal. + * + * Domain: [-Infinity, Infinity] + * Range: [-Infinity, Infinity] + * + * tan(0) = 0 + * tan(-0) = -0 + * tan(Infinity) = NaN + * tan(-Infinity) = NaN + * tan(NaN) = NaN + * + */ +P.tangent = P.tan = function () { + var pr, rm, + x = this, + Ctor = x.constructor; + + if (!x.isFinite()) return new Ctor(NaN); + if (x.isZero()) return new Ctor(x); + + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 10; + Ctor.rounding = 1; + + x = x.sin(); + x.s = 1; + x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); + + Ctor.precision = pr; + Ctor.rounding = rm; + + return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); +}; + + +/* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + */ +P.times = P.mul = function (y) { + var carry, e, i, k, r, rL, t, xdL, ydL, + x = this, + Ctor = x.constructor, + xd = x.d, + yd = (y = new Ctor(y)).d; + + y.s *= x.s; + + // If either is NaN, ±Infinity or ±0... + if (!xd || !xd[0] || !yd || !yd[0]) { + + return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd + + // Return NaN if either is NaN. + // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity. + ? NaN + + // Return ±Infinity if either is ±Infinity. + // Return ±0 if either is ±0. + : !xd || !yd ? y.s / 0 : y.s * 0); + } + + e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); + xdL = xd.length; + ydL = yd.length; + + // Ensure xd points to the longer array. + if (xdL < ydL) { + r = xd; + xd = yd; + yd = r; + rL = xdL; + xdL = ydL; + ydL = rL; + } + + // Initialise the result array with zeros. + r = []; + rL = xdL + ydL; + for (i = rL; i--;) r.push(0); + + // Multiply! + for (i = ydL; --i >= 0;) { + carry = 0; + for (k = xdL + i; k > i;) { + t = r[k] + yd[i] * xd[k - i - 1] + carry; + r[k--] = t % BASE | 0; + carry = t / BASE | 0; + } + + r[k] = (r[k] + carry) % BASE | 0; + } + + // Remove trailing zeros. + for (; !r[--rL];) r.pop(); + + if (carry) ++e; + else r.shift(); + + y.d = r; + y.e = getBase10Exponent(r, e); + + return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; +}; + + +/* + * Return a string representing the value of this Decimal in base 2, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toBinary = function (sd, rm) { + return toStringBinary(this, 2, sd, rm); +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp` + * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted. + * + * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toDecimalPlaces = P.toDP = function (dp, rm) { + var x = this, + Ctor = x.constructor; + + x = new Ctor(x); + if (dp === void 0) return x; + + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + return finalise(x, dp + x.e + 1, rm); +}; + + +/* + * Return a string representing the value of this Decimal in exponential notation rounded to + * `dp` fixed decimal places using rounding mode `rounding`. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toExponential = function (dp, rm) { + var str, + x = this, + Ctor = x.constructor; + + if (dp === void 0) { + str = finiteToString(x, true); + } else { + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + x = finalise(new Ctor(x), dp + 1, rm); + str = finiteToString(x, true, dp + 1); + } + + return x.isNeg() && !x.isZero() ? '-' + str : str; +}; + + +/* + * Return a string representing the value of this Decimal in normal (fixed-point) notation to + * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is + * omitted. + * + * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. + * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. + * (-0).toFixed(3) is '0.000'. + * (-0.5).toFixed(0) is '-0'. + * + */ +P.toFixed = function (dp, rm) { + var str, y, + x = this, + Ctor = x.constructor; + + if (dp === void 0) { + str = finiteToString(x); + } else { + checkInt32(dp, 0, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + y = finalise(new Ctor(x), dp + x.e + 1, rm); + str = finiteToString(y, false, dp + y.e + 1); + } + + // To determine whether to add the minus sign look at the value before it was rounded, + // i.e. look at `x` rather than `y`. + return x.isNeg() && !x.isZero() ? '-' + str : str; +}; + + +/* + * Return an array representing the value of this Decimal as a simple fraction with an integer + * numerator and an integer denominator. + * + * The denominator will be a positive non-zero value less than or equal to the specified maximum + * denominator. If a maximum denominator is not specified, the denominator will be the lowest + * value necessary to represent the number exactly. + * + * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity. + * + */ +P.toFraction = function (maxD) { + var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, + x = this, + xd = x.d, + Ctor = x.constructor; + + if (!xd) return new Ctor(x); + + n1 = d0 = new Ctor(1); + d1 = n0 = new Ctor(0); + + d = new Ctor(d1); + e = d.e = getPrecision(xd) - x.e - 1; + k = e % LOG_BASE; + d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); + + if (maxD == null) { + + // d is 10**e, the minimum max-denominator needed. + maxD = e > 0 ? d : n1; + } else { + n = new Ctor(maxD); + if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n); + maxD = n.gt(d) ? (e > 0 ? d : n1) : n; + } + + external = false; + n = new Ctor(digitsToString(xd)); + pr = Ctor.precision; + Ctor.precision = e = xd.length * LOG_BASE * 2; + + for (;;) { + q = divide(n, d, 0, 1, 1); + d2 = d0.plus(q.times(d1)); + if (d2.cmp(maxD) == 1) break; + d0 = d1; + d1 = d2; + d2 = n1; + n1 = n0.plus(q.times(d2)); + n0 = d2; + d2 = d; + d = n.minus(q.times(d2)); + n = d2; + } + + d2 = divide(maxD.minus(d0), d1, 0, 1, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + + // Determine which fraction is closer to x, n0/d0 or n1/d1? + r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 + ? [n1, d1] : [n0, d0]; + + Ctor.precision = pr; + external = true; + + return r; +}; + + +/* + * Return a string representing the value of this Decimal in base 16, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toHexadecimal = P.toHex = function (sd, rm) { + return toStringBinary(this, 16, sd, rm); +}; + + +/* + * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding + * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal. + * + * The return value will always have the same sign as this Decimal, unless either this Decimal + * or `y` is NaN, in which case the return value will be also be NaN. + * + * The return value is not affected by the value of `precision`. + * + * y {number|string|Decimal} The magnitude to round to a multiple of. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toNearest() rounding mode not an integer: {rm}' + * 'toNearest() rounding mode out of range: {rm}' + * + */ +P.toNearest = function (y, rm) { + var x = this, + Ctor = x.constructor; + + x = new Ctor(x); + + if (y == null) { + + // If x is not finite, return x. + if (!x.d) return x; + + y = new Ctor(1); + rm = Ctor.rounding; + } else { + y = new Ctor(y); + if (rm === void 0) { + rm = Ctor.rounding; + } else { + checkInt32(rm, 0, 8); + } + + // If x is not finite, return x if y is not NaN, else NaN. + if (!x.d) return y.s ? x : y; + + // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN. + if (!y.d) { + if (y.s) y.s = x.s; + return y; + } + } + + // If y is not zero, calculate the nearest multiple of y to x. + if (y.d[0]) { + external = false; + x = divide(x, y, 0, rm, 1).times(y); + external = true; + finalise(x); + + // If y is zero, return zero with the sign of x. + } else { + y.s = x.s; + x = y; + } + + return x; +}; + + +/* + * Return the value of this Decimal converted to a number primitive. + * Zero keeps its sign. + * + */ +P.toNumber = function () { + return +this; +}; + + +/* + * Return a string representing the value of this Decimal in base 8, round to `sd` significant + * digits using rounding mode `rm`. + * + * If the optional `sd` argument is present then return binary exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toOctal = function (sd, rm) { + return toStringBinary(this, 8, sd, rm); +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded + * to `precision` significant digits using rounding mode `rounding`. + * + * ECMAScript compliant. + * + * pow(x, NaN) = NaN + * pow(x, ±0) = 1 + + * pow(NaN, non-zero) = NaN + * pow(abs(x) > 1, +Infinity) = +Infinity + * pow(abs(x) > 1, -Infinity) = +0 + * pow(abs(x) == 1, ±Infinity) = NaN + * pow(abs(x) < 1, +Infinity) = +0 + * pow(abs(x) < 1, -Infinity) = +Infinity + * pow(+Infinity, y > 0) = +Infinity + * pow(+Infinity, y < 0) = +0 + * pow(-Infinity, odd integer > 0) = -Infinity + * pow(-Infinity, even integer > 0) = +Infinity + * pow(-Infinity, odd integer < 0) = -0 + * pow(-Infinity, even integer < 0) = +0 + * pow(+0, y > 0) = +0 + * pow(+0, y < 0) = +Infinity + * pow(-0, odd integer > 0) = -0 + * pow(-0, even integer > 0) = +0 + * pow(-0, odd integer < 0) = -Infinity + * pow(-0, even integer < 0) = +Infinity + * pow(finite x < 0, finite non-integer) = NaN + * + * For non-integer or very large exponents pow(x, y) is calculated using + * + * x^y = exp(y*ln(x)) + * + * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the + * probability of an incorrectly rounded result + * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14 + * i.e. 1 in 250,000,000,000,000 + * + * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place). + * + * y {number|string|Decimal} The power to which to raise this Decimal. + * + */ +P.toPower = P.pow = function (y) { + var e, k, pr, r, rm, s, + x = this, + Ctor = x.constructor, + yn = +(y = new Ctor(y)); + + // Either ±Infinity, NaN or ±0? + if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn)); + + x = new Ctor(x); + + if (x.eq(1)) return x; + + pr = Ctor.precision; + rm = Ctor.rounding; + + if (y.eq(1)) return finalise(x, pr, rm); + + // y exponent + e = mathfloor(y.e / LOG_BASE); + + // If y is a small integer use the 'exponentiation by squaring' algorithm. + if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { + r = intPow(Ctor, x, k, pr); + return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); + } + + s = x.s; + + // if x is negative + if (s < 0) { + + // if y is not an integer + if (e < y.d.length - 1) return new Ctor(NaN); + + // Result is positive if x is negative and the last digit of integer y is even. + if ((y.d[e] & 1) == 0) s = 1; + + // if x.eq(-1) + if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { + x.s = s; + return x; + } + } + + // Estimate result exponent. + // x^y = 10^e, where e = y * log10(x) + // log10(x) = log10(x_significand) + x_exponent + // log10(x_significand) = ln(x_significand) / ln(10) + k = mathpow(+x, yn); + e = k == 0 || !isFinite(k) + ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) + : new Ctor(k + '').e; + + // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1. + + // Overflow/underflow? + if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0); + + external = false; + Ctor.rounding = x.s = 1; + + // Estimate the extra guard digits needed to ensure five correct rounding digits from + // naturalLogarithm(x). Example of failure without these extra digits (precision: 10): + // new Decimal(2.32456).pow('2087987436534566.46411') + // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815 + k = Math.min(12, (e + '').length); + + // r = x^y = exp(y*ln(x)) + r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); + + // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40) + if (r.d) { + + // Truncate to the required precision plus five rounding digits. + r = finalise(r, pr + 5, 1); + + // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate + // the result. + if (checkRoundingDigits(r.d, pr, rm)) { + e = pr + 10; + + // Truncate to the increased precision plus five rounding digits. + r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); + + // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9). + if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + } + } + + r.s = s; + external = true; + Ctor.rounding = rm; + + return finalise(r, pr, rm); +}; + + +/* + * Return a string representing the value of this Decimal rounded to `sd` significant digits + * using rounding mode `rounding`. + * + * Return exponential notation if `sd` is less than the number of digits necessary to represent + * the integer part of the value in normal notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + */ +P.toPrecision = function (sd, rm) { + var str, + x = this, + Ctor = x.constructor; + + if (sd === void 0) { + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + } else { + checkInt32(sd, 1, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + + x = finalise(new Ctor(x), sd, rm); + str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); + } + + return x.isNeg() && !x.isZero() ? '-' + str : str; +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd` + * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if + * omitted. + * + * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toSD() digits out of range: {sd}' + * 'toSD() digits not an integer: {sd}' + * 'toSD() rounding mode not an integer: {rm}' + * 'toSD() rounding mode out of range: {rm}' + * + */ +P.toSignificantDigits = P.toSD = function (sd, rm) { + var x = this, + Ctor = x.constructor; + + if (sd === void 0) { + sd = Ctor.precision; + rm = Ctor.rounding; + } else { + checkInt32(sd, 1, MAX_DIGITS); + + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + } + + return finalise(new Ctor(x), sd, rm); +}; + + +/* + * Return a string representing the value of this Decimal. + * + * Return exponential notation if this Decimal has a positive exponent equal to or greater than + * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`. + * + */ +P.toString = function () { + var x = this, + Ctor = x.constructor, + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + + return x.isNeg() && !x.isZero() ? '-' + str : str; +}; + + +/* + * Return a new Decimal whose value is the value of this Decimal truncated to a whole number. + * + */ +P.truncated = P.trunc = function () { + return finalise(new this.constructor(this), this.e + 1, 1); +}; + + +/* + * Return a string representing the value of this Decimal. + * Unlike `toString`, negative zero will include the minus sign. + * + */ +P.valueOf = P.toJSON = function () { + var x = this, + Ctor = x.constructor, + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + + return x.isNeg() ? '-' + str : str; +}; + + +// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers. + + +/* + * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower, + * finiteToString, naturalExponential, naturalLogarithm + * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest, + * P.toPrecision, P.toSignificantDigits, toStringBinary, random + * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm + * convertBase toStringBinary, parseOther + * cos P.cos + * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy, + * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction, + * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm, + * taylorSeries, atan2, parseOther + * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh, + * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus, + * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot, + * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed, + * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits, + * P.truncated, divide, getLn10, getPi, naturalExponential, + * naturalLogarithm, ceil, floor, round, trunc + * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf, + * toStringBinary + * getBase10Exponent P.minus, P.plus, P.times, parseOther + * getLn10 P.logarithm, naturalLogarithm + * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2 + * getPrecision P.precision, P.toFraction + * getZeroString digitsToString, finiteToString + * intPow P.toPower, parseOther + * isOdd toLessThanHalfPi + * maxOrMin max, min + * naturalExponential P.naturalExponential, P.toPower + * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm, + * P.toPower, naturalExponential + * nonFiniteToString finiteToString, toStringBinary + * parseDecimal Decimal + * parseOther Decimal + * sin P.sin + * taylorSeries P.cosh, P.sinh, cos, sin + * toLessThanHalfPi P.cos, P.sin + * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal + * truncate intPow + * + * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi, + * naturalLogarithm, config, parseOther, random, Decimal + */ + + +function digitsToString(d) { + var i, k, ws, + indexOfLastWord = d.length - 1, + str = '', + w = d[0]; + + if (indexOfLastWord > 0) { + str += w; + for (i = 1; i < indexOfLastWord; i++) { + ws = d[i] + ''; + k = LOG_BASE - ws.length; + if (k) str += getZeroString(k); + str += ws; + } + + w = d[i]; + ws = w + ''; + k = LOG_BASE - ws.length; + if (k) str += getZeroString(k); + } else if (w === 0) { + return '0'; + } + + // Remove trailing zeros of last w. + for (; w % 10 === 0;) w /= 10; + + return str + w; +} + + +function checkInt32(i, min, max) { + if (i !== ~~i || i < min || i > max) { + throw Error(invalidArgument + i); + } +} + + +/* + * Check 5 rounding digits if `repeating` is null, 4 otherwise. + * `repeating == null` if caller is `log` or `pow`, + * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`. + */ +function checkRoundingDigits(d, i, rm, repeating) { + var di, k, r, rd; + + // Get the length of the first word of the array d. + for (k = d[0]; k >= 10; k /= 10) --i; + + // Is the rounding digit in the first word of d? + if (--i < 0) { + i += LOG_BASE; + di = 0; + } else { + di = Math.ceil((i + 1) / LOG_BASE); + i %= LOG_BASE; + } + + // i is the index (0 - 6) of the rounding digit. + // E.g. if within the word 3487563 the first rounding digit is 5, + // then i = 4, k = 1000, rd = 3487563 % 1000 = 563 + k = mathpow(10, LOG_BASE - i); + rd = d[di] % k | 0; + + if (repeating == null) { + if (i < 3) { + if (i == 0) rd = rd / 100 | 0; + else if (i == 1) rd = rd / 10 | 0; + r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0; + } else { + r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && + (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || + (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; + } + } else { + if (i < 4) { + if (i == 0) rd = rd / 1000 | 0; + else if (i == 1) rd = rd / 100 | 0; + else if (i == 2) rd = rd / 10 | 0; + r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; + } else { + r = ((repeating || rm < 4) && rd + 1 == k || + (!repeating && rm > 3) && rd + 1 == k / 2) && + (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1; + } + } + + return r; +} + + +// Convert string of `baseIn` to an array of numbers of `baseOut`. +// Eg. convertBase('255', 10, 16) returns [15, 15]. +// Eg. convertBase('ff', 16, 10) returns [2, 5, 5]. +function convertBase(str, baseIn, baseOut) { + var j, + arr = [0], + arrL, + i = 0, + strL = str.length; + + for (; i < strL;) { + for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn; + arr[0] += NUMERALS.indexOf(str.charAt(i++)); + for (j = 0; j < arr.length; j++) { + if (arr[j] > baseOut - 1) { + if (arr[j + 1] === void 0) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); +} + + +/* + * cos(x) = 1 - x^2/2! + x^4/4! - ... + * |x| < pi/2 + * + */ +function cosine(Ctor, x) { + var k, len, y; + + if (x.isZero()) return x; + + // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1 + // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1 + + // Estimate the optimum number of times to use the argument reduction. + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + y = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + y = '2.3283064365386962890625e-10'; + } + + Ctor.precision += k; + + x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); + + // Reverse argument reduction + for (var i = k; i--;) { + var cos2x = x.times(x); + x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); + } + + Ctor.precision -= k; + + return x; +} + + +/* + * Perform division in the specified base. + */ +var divide = (function () { + + // Assumes non-zero x and k, and hence non-zero result. + function multiplyInteger(x, k, base) { + var temp, + carry = 0, + i = x.length; + + for (x = x.slice(); i--;) { + temp = x[i] * k + carry; + x[i] = temp % base | 0; + carry = temp / base | 0; + } + + if (carry) x.unshift(carry); + + return x; + } + + function compare(a, b, aL, bL) { + var i, r; + + if (aL != bL) { + r = aL > bL ? 1 : -1; + } else { + for (i = r = 0; i < aL; i++) { + if (a[i] != b[i]) { + r = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return r; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1;) a.shift(); + } + + return function (x, y, pr, rm, dp, base) { + var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, + yL, yz, + Ctor = x.constructor, + sign = x.s == y.s ? 1 : -1, + xd = x.d, + yd = y.d; + + // Either NaN, Infinity or 0? + if (!xd || !xd[0] || !yd || !yd[0]) { + + return new Ctor(// Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : + + // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0. + xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0); + } + + if (base) { + logBase = 1; + e = x.e - y.e; + } else { + base = BASE; + logBase = LOG_BASE; + e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); + } + + yL = yd.length; + xL = xd.length; + q = new Ctor(sign); + qd = q.d = []; + + // Result exponent may be one less than e. + // The digit array of a Decimal from toStringBinary may have trailing zeros. + for (i = 0; yd[i] == (xd[i] || 0); i++); + + if (yd[i] > (xd[i] || 0)) e--; + + if (pr == null) { + sd = pr = Ctor.precision; + rm = Ctor.rounding; + } else if (dp) { + sd = pr + (x.e - y.e) + 1; + } else { + sd = pr; + } + + if (sd < 0) { + qd.push(1); + more = true; + } else { + + // Convert precision in number of base 10 digits to base 1e7 digits. + sd = sd / logBase + 2 | 0; + i = 0; + + // divisor < 1e7 + if (yL == 1) { + k = 0; + yd = yd[0]; + sd++; + + // k is the carry. + for (; (i < xL || k) && sd--; i++) { + t = k * base + (xd[i] || 0); + qd[i] = t / yd | 0; + k = t % yd | 0; + } + + more = k || i < xL; + + // divisor >= 1e7 + } else { + + // Normalise xd and yd so highest order digit of yd is >= base/2 + k = base / (yd[0] + 1) | 0; + + if (k > 1) { + yd = multiplyInteger(yd, k, base); + xd = multiplyInteger(xd, k, base); + yL = yd.length; + xL = xd.length; + } + + xi = yL; + rem = xd.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL;) rem[remL++] = 0; + + yz = yd.slice(); + yz.unshift(0); + yd0 = yd[0]; + + if (yd[1] >= base / 2) ++yd0; + + do { + k = 0; + + // Compare divisor and remainder. + cmp = compare(yd, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, k. + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // k will be how many times the divisor goes into the current remainder. + k = rem0 / yd0 | 0; + + // Algorithm: + // 1. product = divisor * trial digit (k) + // 2. if product > remainder: product -= divisor, k-- + // 3. remainder -= product + // 4. if product was < remainder at 2: + // 5. compare new remainder and divisor + // 6. If remainder > divisor: remainder -= divisor, k++ + + if (k > 1) { + if (k >= base) k = base - 1; + + // product = divisor * trial digit. + prod = multiplyInteger(yd, k, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + cmp = compare(prod, rem, prodL, remL); + + // product > remainder. + if (cmp == 1) { + k--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yd, prodL, base); + } + } else { + + // cmp is -1. + // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1 + // to avoid it. If k is 1 there is a need to compare yd and rem again below. + if (k == 0) cmp = k = 1; + prod = yd.slice(); + } + + prodL = prod.length; + if (prodL < remL) prod.unshift(0); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + + // If product was < previous remainder. + if (cmp == -1) { + remL = rem.length; + + // Compare divisor and new remainder. + cmp = compare(yd, rem, yL, remL); + + // If divisor < new remainder, subtract divisor from remainder. + if (cmp < 1) { + k++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yd, remL, base); + } + } + + remL = rem.length; + } else if (cmp === 0) { + k++; + rem = [0]; + } // if cmp === 1, k will be 0 + + // Add the next digit, k, to the result array. + qd[i++] = k; + + // Update the remainder. + if (cmp && rem[0]) { + rem[remL++] = xd[xi] || 0; + } else { + rem = [xd[xi]]; + remL = 1; + } + + } while ((xi++ < xL || rem[0] !== void 0) && sd--); + + more = rem[0] !== void 0; + } + + // Leading zero? + if (!qd[0]) qd.shift(); + } + + // logBase is 1 when divide is being used for base conversion. + if (logBase == 1) { + q.e = e; + inexact = more; + } else { + + // To calculate q.e, first get the number of digits of qd[0]. + for (i = 1, k = qd[0]; k >= 10; k /= 10) i++; + q.e = i + e * logBase - 1; + + finalise(q, dp ? pr + q.e + 1 : pr, rm, more); + } + + return q; + }; +})(); + + +/* + * Round `x` to `sd` significant digits using rounding mode `rm`. + * Check for over/under-flow. + */ + function finalise(x, sd, rm, isTruncated) { + var digits, i, j, k, rd, roundUp, w, xd, xdi, + Ctor = x.constructor; + + // Don't round if sd is null or undefined. + out: if (sd != null) { + xd = x.d; + + // Infinity/NaN. + if (!xd) return x; + + // rd: the rounding digit, i.e. the digit after the digit that may be rounded up. + // w: the word of xd containing rd, a base 1e7 number. + // xdi: the index of w within xd. + // digits: the number of digits of w. + // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if + // they had leading zeros) + // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero). + + // Get the length of the first word of the digits array xd. + for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++; + i = sd - digits; + + // Is the rounding digit in the first word of xd? + if (i < 0) { + i += LOG_BASE; + j = sd; + w = xd[xdi = 0]; + + // Get the rounding digit at index j of w. + rd = w / mathpow(10, digits - j - 1) % 10 | 0; + } else { + xdi = Math.ceil((i + 1) / LOG_BASE); + k = xd.length; + if (xdi >= k) { + if (isTruncated) { + + // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`. + for (; k++ <= xdi;) xd.push(0); + w = rd = 0; + digits = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + w = k = xd[xdi]; + + // Get the number of digits of w. + for (digits = 1; k >= 10; k /= 10) digits++; + + // Get the index of rd within w. + i %= LOG_BASE; + + // Get the index of rd within w, adjusted for leading zeros. + // The number of leading zeros of w is given by LOG_BASE - digits. + j = i - LOG_BASE + digits; + + // Get the rounding digit at index j of w. + rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; + } + } + + // Are there any non-zero digits after the rounding digit? + isTruncated = isTruncated || sd < 0 || + xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); + + // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right + // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression + // will give 714. + + roundUp = rm < 4 + ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xd[0]) { + xd.length = 0; + if (roundUp) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); + x.e = -sd || 0; + } else { + + // Zero. + xd[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xd.length = xdi; + k = 1; + xdi--; + } else { + xd.length = xdi + 1; + k = mathpow(10, LOG_BASE - i); + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of w. + xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; + } + + if (roundUp) { + for (;;) { + + // Is the digit to be rounded up in the first word of xd? + if (xdi == 0) { + + // i will be the length of xd[0] before k is added. + for (i = 1, j = xd[0]; j >= 10; j /= 10) i++; + j = xd[0] += k; + for (k = 1; j >= 10; j /= 10) k++; + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xd[0] == BASE) xd[0] = 1; + } + + break; + } else { + xd[xdi] += k; + if (xd[xdi] != BASE) break; + xd[xdi--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xd.length; xd[--i] === 0;) xd.pop(); + } + + if (external) { + + // Overflow? + if (x.e > Ctor.maxE) { + + // Infinity. + x.d = null; + x.e = NaN; + + // Underflow? + } else if (x.e < Ctor.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + // Ctor.underflow = true; + } // else Ctor.underflow = false; + } + + return x; +} + + +function finiteToString(x, isExp, sd) { + if (!x.isFinite()) return nonFiniteToString(x); + var k, + e = x.e, + str = digitsToString(x.d), + len = str.length; + + if (isExp) { + if (sd && (k = sd - len) > 0) { + str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k); + } else if (len > 1) { + str = str.charAt(0) + '.' + str.slice(1); + } + + str = str + (x.e < 0 ? 'e' : 'e+') + x.e; + } else if (e < 0) { + str = '0.' + getZeroString(-e - 1) + str; + if (sd && (k = sd - len) > 0) str += getZeroString(k); + } else if (e >= len) { + str += getZeroString(e + 1 - len); + if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k); + } else { + if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k); + if (sd && (k = sd - len) > 0) { + if (e + 1 === len) str += '.'; + str += getZeroString(k); + } + } + + return str; +} + + +// Calculate the base 10 exponent from the base 1e7 exponent. +function getBase10Exponent(digits, e) { + var w = digits[0]; + + // Add the number of digits of the first word of the digits array. + for ( e *= LOG_BASE; w >= 10; w /= 10) e++; + return e; +} + + +function getLn10(Ctor, sd, pr) { + if (sd > LN10_PRECISION) { + + // Reset global state in case the exception is caught. + external = true; + if (pr) Ctor.precision = pr; + throw Error(precisionLimitExceeded); + } + return finalise(new Ctor(LN10), sd, 1, true); +} + + +function getPi(Ctor, sd, rm) { + if (sd > PI_PRECISION) throw Error(precisionLimitExceeded); + return finalise(new Ctor(PI), sd, rm, true); +} + + +function getPrecision(digits) { + var w = digits.length - 1, + len = w * LOG_BASE + 1; + + w = digits[w]; + + // If non-zero... + if (w) { + + // Subtract the number of trailing zeros of the last word. + for (; w % 10 == 0; w /= 10) len--; + + // Add the number of digits of the first word. + for (w = digits[0]; w >= 10; w /= 10) len++; + } + + return len; +} + + +function getZeroString(k) { + var zs = ''; + for (; k--;) zs += '0'; + return zs; +} + + +/* + * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an + * integer of type number. + * + * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`. + * + */ +function intPow(Ctor, x, n, pr) { + var isTruncated, + r = new Ctor(1), + + // Max n of 9007199254740991 takes 53 loop iterations. + // Maximum digits array length; leaves [28, 34] guard digits. + k = Math.ceil(pr / LOG_BASE + 4); + + external = false; + + for (;;) { + if (n % 2) { + r = r.times(x); + if (truncate(r.d, k)) isTruncated = true; + } + + n = mathfloor(n / 2); + if (n === 0) { + + // To ensure correct rounding when r.d is truncated, increment the last word if it is zero. + n = r.d.length - 1; + if (isTruncated && r.d[n] === 0) ++r.d[n]; + break; + } + + x = x.times(x); + truncate(x.d, k); + } + + external = true; + + return r; +} + + +function isOdd(n) { + return n.d[n.d.length - 1] & 1; +} + + +/* + * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'. + */ +function maxOrMin(Ctor, args, ltgt) { + var y, + x = new Ctor(args[0]), + i = 0; + + for (; ++i < args.length;) { + y = new Ctor(args[i]); + if (!y.s) { + x = y; + break; + } else if (x[ltgt](y)) { + x = y; + } + } + + return x; +} + + +/* + * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant + * digits. + * + * Taylor/Maclaurin series. + * + * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ... + * + * Argument reduction: + * Repeat x = x / 32, k += 5, until |x| < 0.1 + * exp(x) = exp(x / 2^k)^(2^k) + * + * Previously, the argument was initially reduced by + * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10) + * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was + * found to be slower than just dividing repeatedly by 32 as above. + * + * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000 + * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000 + * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324) + * + * exp(Infinity) = Infinity + * exp(-Infinity) = 0 + * exp(NaN) = NaN + * exp(±0) = 1 + * + * exp(x) is non-terminating for any finite, non-zero x. + * + * The result will always be correctly rounded. + * + */ +function naturalExponential(x, sd) { + var denominator, guard, j, pow, sum, t, wpr, + rep = 0, + i = 0, + k = 0, + Ctor = x.constructor, + rm = Ctor.rounding, + pr = Ctor.precision; + + // 0/NaN/Infinity? + if (!x.d || !x.d[0] || x.e > 17) { + + return new Ctor(x.d + ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 + : x.s ? x.s < 0 ? 0 : x : 0 / 0); + } + + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + + t = new Ctor(0.03125); + + // while abs(x) >= 0.1 + while (x.e > -2) { + + // x = x / 2^5 + x = x.times(t); + k += 5; + } + + // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision + // necessary to ensure the first 4 rounding digits are correct. + guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; + wpr += guard; + denominator = pow = sum = new Ctor(1); + Ctor.precision = wpr; + + for (;;) { + pow = finalise(pow.times(x), wpr, 1); + denominator = denominator.times(++i); + t = sum.plus(divide(pow, denominator, wpr, 1)); + + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { + j = k; + while (j--) sum = finalise(sum.times(sum), wpr, 1); + + // Check to see if the first 4 rounding digits are [49]999. + // If so, repeat the summation with a higher precision, otherwise + // e.g. with precision: 18, rounding: 1 + // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123) + // `wpr - guard` is the index of first rounding digit. + if (sd == null) { + + if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += 10; + denominator = pow = t = new Ctor(1); + i = 0; + rep++; + } else { + return finalise(sum, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum; + } + } + + sum = t; + } +} + + +/* + * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant + * digits. + * + * ln(-n) = NaN + * ln(0) = -Infinity + * ln(-0) = -Infinity + * ln(1) = 0 + * ln(Infinity) = Infinity + * ln(-Infinity) = NaN + * ln(NaN) = NaN + * + * ln(n) (n != 1) is non-terminating. + * + */ +function naturalLogarithm(y, sd) { + var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2, + n = 1, + guard = 10, + x = y, + xd = x.d, + Ctor = x.constructor, + rm = Ctor.rounding, + pr = Ctor.precision; + + // Is x negative or Infinity, NaN, 0 or 1? + if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { + return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); + } + + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + + Ctor.precision = wpr += guard; + c = digitsToString(xd); + c0 = c.charAt(0); + + if (Math.abs(e = x.e) < 1.5e15) { + + // Argument reduction. + // The series converges faster the closer the argument is to 1, so using + // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b + // multiply the argument by itself until the leading digits of the significand are 7, 8, 9, + // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can + // later be divided by this number, then separate out the power of 10 using + // ln(a*10^b) = ln(a) + b*ln(10). + + // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14). + //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) { + // max n is 6 (gives 0.7 - 1.3) + while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { + x = x.times(y); + c = digitsToString(x.d); + c0 = c.charAt(0); + n++; + } + + e = x.e; + + if (c0 > 1) { + x = new Ctor('0.' + c); + e++; + } else { + x = new Ctor(c0 + '.' + c.slice(1)); + } + } else { + + // The argument reduction method above may result in overflow if the argument y is a massive + // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this + // function using ln(x*10^e) = ln(x) + e*ln(10). + t = getLn10(Ctor, wpr + 2, pr).times(e + ''); + x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t); + Ctor.precision = pr; + + return sd == null ? finalise(x, pr, rm, external = true) : x; + } + + // x1 is x reduced to a value near 1. + x1 = x; + + // Taylor series. + // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...) + // where x = (y - 1)/(y + 1) (|x| < 1) + sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = 3; + + for (;;) { + numerator = finalise(numerator.times(x2), wpr, 1); + t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1)); + + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { + sum = sum.times(2); + + // Reverse the argument reduction. Check that e is not 0 because, besides preventing an + // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0. + if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + '')); + sum = divide(sum, new Ctor(n), wpr, 1); + + // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has + // been repeated previously) and the first 4 rounding digits 9999? + // If so, restart the summation with a higher precision, otherwise + // e.g. with precision: 12, rounding: 1 + // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463. + // `wpr - guard` is the index of first rounding digit. + if (sd == null) { + if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += guard; + t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = rep = 1; + } else { + return finalise(sum, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum; + } + } + + sum = t; + denominator += 2; + } +} + + +// ±Infinity, NaN. +function nonFiniteToString(x) { + // Unsigned. + return String(x.s * x.s / 0); +} + + +/* + * Parse the value of a new Decimal `x` from string `str`. + */ +function parseDecimal(x, str) { + var e, i, len; + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(len - 1) === 48; --len); + str = str.slice(i, len); + + if (str) { + len -= i; + x.e = e = e - i - 1; + x.d = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first word of the digits array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.d.push(+str.slice(0, i)); + for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE)); + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--;) str += '0'; + x.d.push(+str); + + if (external) { + + // Overflow? + if (x.e > x.constructor.maxE) { + + // Infinity. + x.d = null; + x.e = NaN; + + // Underflow? + } else if (x.e < x.constructor.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + // x.constructor.underflow = true; + } // else x.constructor.underflow = false; + } + } else { + + // Zero. + x.e = 0; + x.d = [0]; + } + + return x; +} + + +/* + * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value. + */ +function parseOther(x, str) { + var base, Ctor, divisor, i, isFloat, len, p, xd, xe; + + if (str.indexOf('_') > -1) { + str = str.replace(/(\d)_(?=\d)/g, '$1'); + if (isDecimal.test(str)) return parseDecimal(x, str); + } else if (str === 'Infinity' || str === 'NaN') { + if (!+str) x.s = NaN; + x.e = NaN; + x.d = null; + return x; + } + + if (isHex.test(str)) { + base = 16; + str = str.toLowerCase(); + } else if (isBinary.test(str)) { + base = 2; + } else if (isOctal.test(str)) { + base = 8; + } else { + throw Error(invalidArgument + str); + } + + // Is there a binary exponent part? + i = str.search(/p/i); + + if (i > 0) { + p = +str.slice(i + 1); + str = str.substring(2, i); + } else { + str = str.slice(2); + } + + // Convert `str` as an integer then divide the result by `base` raised to a power such that the + // fraction part will be restored. + i = str.indexOf('.'); + isFloat = i >= 0; + Ctor = x.constructor; + + if (isFloat) { + str = str.replace('.', ''); + len = str.length; + i = len - i; + + // log[10](16) = 1.2041... , log[10](88) = 1.9444.... + divisor = intPow(Ctor, new Ctor(base), i, i * 2); + } + + xd = convertBase(str, base, BASE); + xe = xd.length - 1; + + // Remove trailing zeros. + for (i = xe; xd[i] === 0; --i) xd.pop(); + if (i < 0) return new Ctor(x.s * 0); + x.e = getBase10Exponent(xd, xe); + x.d = xd; + external = false; + + // At what precision to perform the division to ensure exact conversion? + // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount) + // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412 + // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits. + // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount + // Therefore using 4 * the number of digits of str will always be enough. + if (isFloat) x = divide(x, divisor, len * 4); + + // Multiply by the binary exponent part if present. + if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); + external = true; + + return x; +} + + +/* + * sin(x) = x - x^3/3! + x^5/5! - ... + * |x| < pi/2 + * + */ +function sine(Ctor, x) { + var k, + len = x.d.length; + + if (len < 3) { + return x.isZero() ? x : taylorSeries(Ctor, 2, x, x); + } + + // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x) + // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5) + // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20)) + + // Estimate the optimum number of times to use the argument reduction. + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x); + + // Reverse argument reduction + var sin2_x, + d5 = new Ctor(5), + d16 = new Ctor(16), + d20 = new Ctor(20); + for (; k--;) { + sin2_x = x.times(x); + x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); + } + + return x; +} + + +// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`. +function taylorSeries(Ctor, n, x, y, isHyperbolic) { + var j, t, u, x2, + i = 1, + pr = Ctor.precision, + k = Math.ceil(pr / LOG_BASE); + + external = false; + x2 = x.times(x); + u = new Ctor(y); + + for (;;) { + t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); + u = isHyperbolic ? y.plus(t) : y.minus(t); + y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); + t = u.plus(y); + + if (t.d[k] !== void 0) { + for (j = k; t.d[j] === u.d[j] && j--;); + if (j == -1) break; + } + + j = u; + u = y; + y = t; + t = j; + i++; + } + + external = true; + t.d.length = k + 1; + + return t; +} + + +// Exponent e must be positive and non-zero. +function tinyPow(b, e) { + var n = b; + while (--e) n *= b; + return n; +} + + +// Return the absolute value of `x` reduced to less than or equal to half pi. +function toLessThanHalfPi(Ctor, x) { + var t, + isNeg = x.s < 0, + pi = getPi(Ctor, Ctor.precision, 1), + halfPi = pi.times(0.5); + + x = x.abs(); + + if (x.lte(halfPi)) { + quadrant = isNeg ? 4 : 1; + return x; + } + + t = x.divToInt(pi); + + if (t.isZero()) { + quadrant = isNeg ? 3 : 2; + } else { + x = x.minus(t.times(pi)); + + // 0 <= x < pi + if (x.lte(halfPi)) { + quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1); + return x; + } + + quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2); + } + + return x.minus(pi).abs(); +} + + +/* + * Return the value of Decimal `x` as a string in base `baseOut`. + * + * If the optional `sd` argument is present include a binary exponent suffix. + */ +function toStringBinary(x, baseOut, sd, rm) { + var base, e, i, k, len, roundUp, str, xd, y, + Ctor = x.constructor, + isExp = sd !== void 0; + + if (isExp) { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) rm = Ctor.rounding; + else checkInt32(rm, 0, 8); + } else { + sd = Ctor.precision; + rm = Ctor.rounding; + } + + if (!x.isFinite()) { + str = nonFiniteToString(x); + } else { + str = finiteToString(x); + i = str.indexOf('.'); + + // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required: + // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10)) + // minBinaryExponent = floor(decimalExponent * log[2](10)) + // log[2](10) = 3.321928094887362347870319429489390175864 + + if (isExp) { + base = 2; + if (baseOut == 16) { + sd = sd * 4 - 3; + } else if (baseOut == 8) { + sd = sd * 3 - 2; + } + } else { + base = baseOut; + } + + // Convert the number as an integer then divide the result by its base raised to a power such + // that the fraction part will be restored. + + // Non-integer. + if (i >= 0) { + str = str.replace('.', ''); + y = new Ctor(1); + y.e = str.length - i; + y.d = convertBase(finiteToString(y), 10, base); + y.e = y.d.length; + } + + xd = convertBase(str, 10, base); + e = len = xd.length; + + // Remove trailing zeros. + for (; xd[--len] == 0;) xd.pop(); + + if (!xd[0]) { + str = isExp ? '0p+0' : '0'; + } else { + if (i < 0) { + e--; + } else { + x = new Ctor(x); + x.d = xd; + x.e = e; + x = divide(x, y, sd, rm, 0, base); + xd = x.d; + e = x.e; + roundUp = inexact; + } + + // The rounding digit, i.e. the digit after the digit that may be rounded up. + i = xd[sd]; + k = base / 2; + roundUp = roundUp || xd[sd + 1] !== void 0; + + roundUp = rm < 4 + ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) + : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || + rm === (x.s < 0 ? 8 : 7)); + + xd.length = sd; + + if (roundUp) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (; ++xd[--sd] > base - 1;) { + xd[sd] = 0; + if (!sd) { + ++e; + xd.unshift(1); + } + } + } + + // Determine trailing zeros. + for (len = xd.length; !xd[len - 1]; --len); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]); + + // Add binary exponent suffix? + if (isExp) { + if (len > 1) { + if (baseOut == 16 || baseOut == 8) { + i = baseOut == 16 ? 4 : 3; + for (--len; len % i; len++) str += '0'; + xd = convertBase(str, base, baseOut); + for (len = xd.length; !xd[len - 1]; --len); + + // xd[0] will always be be 1 + for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]); + } else { + str = str.charAt(0) + '.' + str.slice(1); + } + } + + str = str + (e < 0 ? 'p' : 'p+') + e; + } else if (e < 0) { + for (; ++e;) str = '0' + str; + str = '0.' + str; + } else { + if (++e > len) for (e -= len; e-- ;) str += '0'; + else if (e < len) str = str.slice(0, e) + '.' + str.slice(e); + } + } + + str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str; + } + + return x.s < 0 ? '-' + str : str; +} + + +// Does not strip trailing zeros. +function truncate(arr, len) { + if (arr.length > len) { + arr.length = len; + return true; + } +} + + +// Decimal methods + + +/* + * abs + * acos + * acosh + * add + * asin + * asinh + * atan + * atanh + * atan2 + * cbrt + * ceil + * clamp + * clone + * config + * cos + * cosh + * div + * exp + * floor + * hypot + * ln + * log + * log2 + * log10 + * max + * min + * mod + * mul + * pow + * random + * round + * set + * sign + * sin + * sinh + * sqrt + * sub + * sum + * tan + * tanh + * trunc + */ + + +/* + * Return a new Decimal whose value is the absolute value of `x`. + * + * x {number|string|Decimal} + * + */ +function abs(x) { + return new this(x).abs(); +} + + +/* + * Return a new Decimal whose value is the arccosine in radians of `x`. + * + * x {number|string|Decimal} + * + */ +function acos(x) { + return new this(x).acos(); +} + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function acosh(x) { + return new this(x).acosh(); +} + + +/* + * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ +function add(x, y) { + return new this(x).plus(y); +} + + +/* + * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function asin(x) { + return new this(x).asin(); +} + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function asinh(x) { + return new this(x).asinh(); +} + + +/* + * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function atan(x) { + return new this(x).atan(); +} + + +/* + * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to + * `precision` significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function atanh(x) { + return new this(x).atanh(); +} + + +/* + * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi + * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`. + * + * Domain: [-Infinity, Infinity] + * Range: [-pi, pi] + * + * y {number|string|Decimal} The y-coordinate. + * x {number|string|Decimal} The x-coordinate. + * + * atan2(±0, -0) = ±pi + * atan2(±0, +0) = ±0 + * atan2(±0, -x) = ±pi for x > 0 + * atan2(±0, x) = ±0 for x > 0 + * atan2(-y, ±0) = -pi/2 for y > 0 + * atan2(y, ±0) = pi/2 for y > 0 + * atan2(±y, -Infinity) = ±pi for finite y > 0 + * atan2(±y, +Infinity) = ±0 for finite y > 0 + * atan2(±Infinity, x) = ±pi/2 for finite x + * atan2(±Infinity, -Infinity) = ±3*pi/4 + * atan2(±Infinity, +Infinity) = ±pi/4 + * atan2(NaN, x) = NaN + * atan2(y, NaN) = NaN + * + */ +function atan2(y, x) { + y = new this(y); + x = new this(x); + var r, + pr = this.precision, + rm = this.rounding, + wpr = pr + 4; + + // Either NaN + if (!y.s || !x.s) { + r = new this(NaN); + + // Both ±Infinity + } else if (!y.d && !x.d) { + r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); + r.s = y.s; + + // x is ±Infinity or y is ±0 + } else if (!x.d || y.isZero()) { + r = x.s < 0 ? getPi(this, pr, rm) : new this(0); + r.s = y.s; + + // y is ±Infinity or x is ±0 + } else if (!y.d || x.isZero()) { + r = getPi(this, wpr, 1).times(0.5); + r.s = y.s; + + // Both non-zero and finite + } else if (x.s < 0) { + this.precision = wpr; + this.rounding = 1; + r = this.atan(divide(y, x, wpr, 1)); + x = getPi(this, wpr, 1); + this.precision = pr; + this.rounding = rm; + r = y.s < 0 ? r.minus(x) : r.plus(x); + } else { + r = this.atan(divide(y, x, wpr, 1)); + } + + return r; +} + + +/* + * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function cbrt(x) { + return new this(x).cbrt(); +} + + +/* + * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`. + * + * x {number|string|Decimal} + * + */ +function ceil(x) { + return finalise(x = new this(x), x.e + 1, 2); +} + + +/* + * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`. + * + * x {number|string|Decimal} + * min {number|string|Decimal} + * max {number|string|Decimal} + * + */ +function clamp(x, min, max) { + return new this(x).clamp(min, max); +} + + +/* + * Configure global settings for a Decimal constructor. + * + * `obj` is an object with one or more of the following properties, + * + * precision {number} + * rounding {number} + * toExpNeg {number} + * toExpPos {number} + * maxE {number} + * minE {number} + * modulo {number} + * crypto {boolean|number} + * defaults {true} + * + * E.g. Decimal.config({ precision: 20, rounding: 4 }) + * + */ +function config(obj) { + if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected'); + var i, p, v, + useDefaults = obj.defaults === true, + ps = [ + 'precision', 1, MAX_DIGITS, + 'rounding', 0, 8, + 'toExpNeg', -EXP_LIMIT, 0, + 'toExpPos', 0, EXP_LIMIT, + 'maxE', 0, EXP_LIMIT, + 'minE', -EXP_LIMIT, 0, + 'modulo', 0, 9 + ]; + + for (i = 0; i < ps.length; i += 3) { + if (p = ps[i], useDefaults) this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v; + else throw Error(invalidArgument + p + ': ' + v); + } + } + + if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (v === true || v === false || v === 0 || v === 1) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + this[p] = true; + } else { + throw Error(cryptoUnavailable); + } + } else { + this[p] = false; + } + } else { + throw Error(invalidArgument + p + ': ' + v); + } + } + + return this; +} + + +/* + * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function cos(x) { + return new this(x).cos(); +} + + +/* + * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function cosh(x) { + return new this(x).cosh(); +} + + +/* + * Create and return a Decimal constructor with the same configuration properties as this Decimal + * constructor. + * + */ +function clone(obj) { + var i, p, ps; + + /* + * The Decimal constructor and exported function. + * Return a new Decimal instance. + * + * v {number|string|Decimal} A numeric value. + * + */ + function Decimal(v) { + var e, i, t, + x = this; + + // Decimal called without new. + if (!(x instanceof Decimal)) return new Decimal(v); + + // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor + // which points to Object. + x.constructor = Decimal; + + // Duplicate. + if (isDecimalInstance(v)) { + x.s = v.s; + + if (external) { + if (!v.d || v.e > Decimal.maxE) { + + // Infinity. + x.e = NaN; + x.d = null; + } else if (v.e < Decimal.minE) { + + // Zero. + x.e = 0; + x.d = [0]; + } else { + x.e = v.e; + x.d = v.d.slice(); + } + } else { + x.e = v.e; + x.d = v.d ? v.d.slice() : v.d; + } + + return; + } + + t = typeof v; + + if (t === 'number') { + if (v === 0) { + x.s = 1 / v < 0 ? -1 : 1; + x.e = 0; + x.d = [0]; + return; + } + + if (v < 0) { + v = -v; + x.s = -1; + } else { + x.s = 1; + } + + // Fast path for small integers. + if (v === ~~v && v < 1e7) { + for (e = 0, i = v; i >= 10; i /= 10) e++; + + if (external) { + if (e > Decimal.maxE) { + x.e = NaN; + x.d = null; + } else if (e < Decimal.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = e; + x.d = [v]; + } + } else { + x.e = e; + x.d = [v]; + } + + return; + + // Infinity, NaN. + } else if (v * 0 !== 0) { + if (!v) x.s = NaN; + x.e = NaN; + x.d = null; + return; + } + + return parseDecimal(x, v.toString()); + + } else if (t !== 'string') { + throw Error(invalidArgument + v); + } + + // Minus sign? + if ((i = v.charCodeAt(0)) === 45) { + v = v.slice(1); + x.s = -1; + } else { + // Plus sign? + if (i === 43) v = v.slice(1); + x.s = 1; + } + + return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); + } + + Decimal.prototype = P; + + Decimal.ROUND_UP = 0; + Decimal.ROUND_DOWN = 1; + Decimal.ROUND_CEIL = 2; + Decimal.ROUND_FLOOR = 3; + Decimal.ROUND_HALF_UP = 4; + Decimal.ROUND_HALF_DOWN = 5; + Decimal.ROUND_HALF_EVEN = 6; + Decimal.ROUND_HALF_CEIL = 7; + Decimal.ROUND_HALF_FLOOR = 8; + Decimal.EUCLID = 9; + + Decimal.config = Decimal.set = config; + Decimal.clone = clone; + Decimal.isDecimal = isDecimalInstance; + + Decimal.abs = abs; + Decimal.acos = acos; + Decimal.acosh = acosh; // ES6 + Decimal.add = add; + Decimal.asin = asin; + Decimal.asinh = asinh; // ES6 + Decimal.atan = atan; + Decimal.atanh = atanh; // ES6 + Decimal.atan2 = atan2; + Decimal.cbrt = cbrt; // ES6 + Decimal.ceil = ceil; + Decimal.clamp = clamp; + Decimal.cos = cos; + Decimal.cosh = cosh; // ES6 + Decimal.div = div; + Decimal.exp = exp; + Decimal.floor = floor; + Decimal.hypot = hypot; // ES6 + Decimal.ln = ln; + Decimal.log = log; + Decimal.log10 = log10; // ES6 + Decimal.log2 = log2; // ES6 + Decimal.max = max; + Decimal.min = min; + Decimal.mod = mod; + Decimal.mul = mul; + Decimal.pow = pow; + Decimal.random = random; + Decimal.round = round; + Decimal.sign = sign; // ES6 + Decimal.sin = sin; + Decimal.sinh = sinh; // ES6 + Decimal.sqrt = sqrt; + Decimal.sub = sub; + Decimal.sum = sum; + Decimal.tan = tan; + Decimal.tanh = tanh; // ES6 + Decimal.trunc = trunc; // ES6 + + if (obj === void 0) obj = {}; + if (obj) { + if (obj.defaults !== true) { + ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto']; + for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p]; + } + } + + Decimal.config(obj); + + return Decimal; +} + + +/* + * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ +function div(x, y) { + return new this(x).div(y); +} + + +/* + * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} The power to which to raise the base of the natural log. + * + */ +function exp(x) { + return new this(x).exp(); +} + + +/* + * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`. + * + * x {number|string|Decimal} + * + */ +function floor(x) { + return finalise(x = new this(x), x.e + 1, 3); +} + + +/* + * Return a new Decimal whose value is the square root of the sum of the squares of the arguments, + * rounded to `precision` significant digits using rounding mode `rounding`. + * + * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...) + * + * arguments {number|string|Decimal} + * + */ +function hypot() { + var i, n, + t = new this(0); + + external = false; + + for (i = 0; i < arguments.length;) { + n = new this(arguments[i++]); + if (!n.d) { + if (n.s) { + external = true; + return new this(1 / 0); + } + t = n; + } else if (t.d) { + t = t.plus(n.times(n)); + } + } + + external = true; + + return t.sqrt(); +} + + +/* + * Return true if object is a Decimal instance (where Decimal is any Decimal constructor), + * otherwise return false. + * + */ +function isDecimalInstance(obj) { + return obj instanceof Decimal || obj && obj.toStringTag === tag || false; +} + + +/* + * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function ln(x) { + return new this(x).ln(); +} + + +/* + * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base + * is specified, rounded to `precision` significant digits using rounding mode `rounding`. + * + * log[y](x) + * + * x {number|string|Decimal} The argument of the logarithm. + * y {number|string|Decimal} The base of the logarithm. + * + */ +function log(x, y) { + return new this(x).log(y); +} + + +/* + * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function log2(x) { + return new this(x).log(2); +} + + +/* + * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function log10(x) { + return new this(x).log(10); +} + + +/* + * Return a new Decimal whose value is the maximum of the arguments. + * + * arguments {number|string|Decimal} + * + */ +function max() { + return maxOrMin(this, arguments, 'lt'); +} + + +/* + * Return a new Decimal whose value is the minimum of the arguments. + * + * arguments {number|string|Decimal} + * + */ +function min() { + return maxOrMin(this, arguments, 'gt'); +} + + +/* + * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ +function mod(x, y) { + return new this(x).mod(y); +} + + +/* + * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ +function mul(x, y) { + return new this(x).mul(y); +} + + +/* + * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} The base. + * y {number|string|Decimal} The exponent. + * + */ +function pow(x, y) { + return new this(x).pow(y); +} + + +/* + * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with + * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros + * are produced). + * + * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive. + * + */ +function random(sd) { + var d, e, k, n, + i = 0, + r = new this(1), + rd = []; + + if (sd === void 0) sd = this.precision; + else checkInt32(sd, 1, MAX_DIGITS); + + k = Math.ceil(sd / LOG_BASE); + + if (!this.crypto) { + for (; i < k;) rd[i++] = Math.random() * 1e7 | 0; + + // Browsers supporting crypto.getRandomValues. + } else if (crypto.getRandomValues) { + d = crypto.getRandomValues(new Uint32Array(k)); + + for (; i < k;) { + n = d[i]; + + // 0 <= n < 4294967296 + // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865). + if (n >= 4.29e9) { + d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; + } else { + + // 0 <= n <= 4289999999 + // 0 <= (n % 1e7) <= 9999999 + rd[i++] = n % 1e7; + } + } + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + d = crypto.randomBytes(k *= 4); + + for (; i < k;) { + + // 0 <= n < 2147483648 + n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24); + + // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286). + if (n >= 2.14e9) { + crypto.randomBytes(4).copy(d, i); + } else { + + // 0 <= n <= 2139999999 + // 0 <= (n % 1e7) <= 9999999 + rd.push(n % 1e7); + i += 4; + } + } + + i = k / 4; + } else { + throw Error(cryptoUnavailable); + } + + k = rd[--i]; + sd %= LOG_BASE; + + // Convert trailing digits to zeros according to sd. + if (k && sd) { + n = mathpow(10, LOG_BASE - sd); + rd[i] = (k / n | 0) * n; + } + + // Remove trailing words which are zero. + for (; rd[i] === 0; i--) rd.pop(); + + // Zero? + if (i < 0) { + e = 0; + rd = [0]; + } else { + e = -1; + + // Remove leading words which are zero and adjust exponent accordingly. + for (; rd[0] === 0; e -= LOG_BASE) rd.shift(); + + // Count the digits of the first word of rd to determine leading zeros. + for (k = 1, n = rd[0]; n >= 10; n /= 10) k++; + + // Adjust the exponent for leading zeros of the first word of rd. + if (k < LOG_BASE) e -= LOG_BASE - k; + } + + r.e = e; + r.d = rd; + + return r; +} + + +/* + * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`. + * + * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL). + * + * x {number|string|Decimal} + * + */ +function round(x) { + return finalise(x = new this(x), x.e + 1, this.rounding); +} + + +/* + * Return + * 1 if x > 0, + * -1 if x < 0, + * 0 if x is 0, + * -0 if x is -0, + * NaN otherwise + * + * x {number|string|Decimal} + * + */ +function sign(x) { + x = new this(x); + return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN; +} + + +/* + * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function sin(x) { + return new this(x).sin(); +} + + +/* + * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function sinh(x) { + return new this(x).sinh(); +} + + +/* + * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} + * + */ +function sqrt(x) { + return new this(x).sqrt(); +} + + +/* + * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits + * using rounding mode `rounding`. + * + * x {number|string|Decimal} + * y {number|string|Decimal} + * + */ +function sub(x, y) { + return new this(x).sub(y); +} + + +/* + * Return a new Decimal whose value is the sum of the arguments, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * Only the result is rounded, not the intermediate calculations. + * + * arguments {number|string|Decimal} + * + */ +function sum() { + var i = 0, + args = arguments, + x = new this(args[i]); + + external = false; + for (; x.s && ++i < args.length;) x = x.plus(args[i]); + external = true; + + return finalise(x, this.precision, this.rounding); +} + + +/* + * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant + * digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function tan(x) { + return new this(x).tan(); +} + + +/* + * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision` + * significant digits using rounding mode `rounding`. + * + * x {number|string|Decimal} A value in radians. + * + */ +function tanh(x) { + return new this(x).tanh(); +} + + +/* + * Return a new Decimal whose value is `x` truncated to an integer. + * + * x {number|string|Decimal} + * + */ +function trunc(x) { + return finalise(x = new this(x), x.e + 1, 1); +} + + +P[Symbol.for('nodejs.util.inspect.custom')] = P.toString; +P[Symbol.toStringTag] = 'Decimal'; + +// Create and configure initial Decimal constructor. +export var Decimal = P.constructor = clone(DEFAULTS); + +// Create the internal constants from their string values. +LN10 = new Decimal(LN10); +PI = new Decimal(PI); + +export default Decimal; diff --git a/24_10_22_faktorialis/node_modules/decimal.js/package.json b/24_10_22_faktorialis/node_modules/decimal.js/package.json new file mode 100644 index 0000000..4b59cd6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/decimal.js/package.json @@ -0,0 +1,55 @@ +{ + "name": "decimal.js", + "description": "An arbitrary-precision Decimal type for JavaScript.", + "version": "10.4.3", + "keywords": [ + "arbitrary", + "precision", + "arithmetic", + "big", + "number", + "decimal", + "float", + "biginteger", + "bigdecimal", + "bignumber", + "bigint", + "bignum" + ], + "repository" : { + "type": "git", + "url": "https://github.com/MikeMcl/decimal.js.git" + }, + "main": "decimal", + "module": "decimal.mjs", + "browser": "decimal.js", + "exports": { + ".": { + "types": "./decimal.d.ts", + "import": "./decimal.mjs", + "require": "./decimal.js" + }, + "./decimal.mjs": "./decimal.mjs", + "./decimal.js": "./decimal.js", + "./package.json": "./package.json", + "./decimal": { + "types": "./decimal.d.ts", + "import": "./decimal.mjs", + "require": "./decimal.js" + } + }, + "author": { + "name": "Michael Mclaughlin", + "email": "M8ch88l@gmail.com" + }, + "license": "MIT", + "scripts": { + "test": "node ./test/test.js" + }, + "types": "decimal.d.ts", + "files": [ + "decimal.js", + "decimal.mjs", + "decimal.d.ts" + ] +} diff --git a/24_10_22_faktorialis/node_modules/escape-latex/LICENSE.md b/24_10_22_faktorialis/node_modules/escape-latex/LICENSE.md new file mode 100644 index 0000000..6e54eff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/escape-latex/LICENSE.md @@ -0,0 +1,18 @@ +Copyright (c) 2012 Dang Mai + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/escape-latex/README.md b/24_10_22_faktorialis/node_modules/escape-latex/README.md new file mode 100644 index 0000000..78ff9da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/escape-latex/README.md @@ -0,0 +1,75 @@ +# escape-latex + +[![Greenkeeper badge](https://badges.greenkeeper.io/dangmai/escape-latex.svg)](https://greenkeeper.io/) + +[![Build Status](https://travis-ci.org/dangmai/escape-latex.png)](https://travis-ci.org/dangmai/escape-latex) + +Escape LaTeX special characters with Javascript in NodeJS (>= 4.x) environment. + +## Usage + +```javascript +npm install escape-latex +var lescape = require('escape-latex'); +lescape("String to be escaped here #yolo"); +``` + +## API + +```javascript +lescape((input: String), { + preserveFormatting: Boolean, + escapeMapFn: Function, +}); +``` + +By default, +`escape-latex` only escapes characters that would result in malformed LaTeX. +These characters include `# $ % & \ ^ _ { }`. + +This means that the final LaTeX output might not look the same as your input Javascript string. +For example, multiple spaces are kept as-is, which may be truncated to 1 space by your LaTeX software. + +If you want the final output string to be as similar to your input Javascript string as possible, +you can set the `preserveFormatting` param to `true`, like so: + +```javascript +lescape("Hello World", { preserveFormatting: true }); +// Hello~~~World +``` + +Which will be converted to three non-breaking spaces by your LaTeX software. + +The list of format characters that are escaped include `space, \t (tab), – (en-dash), — (em-dash)`. + +There is also the param `escapeMapFn` to modify the mapping of escaped characters, +so you can add/modify/remove your own escapes if necessary. + +It accepts a callback function that takes in the default character escapes and the formatting escapes as parameters, and returns a complete escape mapping. Here's an example: + +```javascript +lescape("Hello World", { + preseveFormatting: true, + escapeMapFn: function(defaultEscapes, formattingEscapes) { + formattingEscapes[" "] = "\\\\"; + return Object.assign({}, defaultEscapes, formattingEscapes); + }, +}); +// Hello\\\\\\world +``` + +## Testing + +``` +npm test +``` + +## Notes + +* If you are updating from `escape-latex < 1.0.0`, + the `en-dash` and `em-dash` are no longer escaped by default. + Please use `preserveFormatting` to turn them on if necessary. + +## License + +MIT diff --git a/24_10_22_faktorialis/node_modules/escape-latex/dist/index.js b/24_10_22_faktorialis/node_modules/escape-latex/dist/index.js new file mode 100644 index 0000000..0da9c0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/escape-latex/dist/index.js @@ -0,0 +1,80 @@ +"use strict"; + +// Map the characters to escape to their escaped values. The list is derived +// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var defaultEscapes = { + "{": "\\{", + "}": "\\}", + "\\": "\\textbackslash{}", + "#": "\\#", + $: "\\$", + "%": "\\%", + "&": "\\&", + "^": "\\textasciicircum{}", + _: "\\_", + "~": "\\textasciitilde{}" +}; +var formatEscapes = { + "\u2013": "\\--", + "\u2014": "\\---", + " ": "~", + "\t": "\\qquad{}", + "\r\n": "\\newline{}", + "\n": "\\newline{}" +}; + +var defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) { + return _extends({}, defaultEscapes, formatEscapes); +}; + +/** + * Escape a string to be used in LaTeX documents. + * @param {string} str the string to be escaped. + * @param {boolean} params.preserveFormatting whether formatting escapes should + * be performed (default: false). + * @param {function} params.escapeMapFn the function to modify the escape maps. + * @return {string} the escaped string, ready to be used in LaTeX. + */ +module.exports = function (str) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$preserveFormatti = _ref.preserveFormatting, + preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti, + _ref$escapeMapFn = _ref.escapeMapFn, + escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn; + + var runningStr = String(str); + var result = ""; + + var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {}); + var escapeKeys = Object.keys(escapes); // as it is reused later on + + // Algorithm: Go through the string character by character, if it matches + // with one of the special characters then we'll replace it with the escaped + // version. + + var _loop = function _loop() { + var specialCharFound = false; + escapeKeys.forEach(function (key, index) { + if (specialCharFound) { + return; + } + if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) { + result += escapes[escapeKeys[index]]; + runningStr = runningStr.slice(key.length, runningStr.length); + specialCharFound = true; + } + }); + if (!specialCharFound) { + result += runningStr.slice(0, 1); + runningStr = runningStr.slice(1, runningStr.length); + } + }; + + while (runningStr) { + _loop(); + } + return result; +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/escape-latex/package.json b/24_10_22_faktorialis/node_modules/escape-latex/package.json new file mode 100644 index 0000000..a57945d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/escape-latex/package.json @@ -0,0 +1,55 @@ +{ + "name": "escape-latex", + "version": "1.2.0", + "description": "Escape LaTeX special characters with Javascript", + "main": "./dist/index.js", + "files": ["dist"], + "scripts": { + "test": "mocha --require babel-core/register -u tdd ./src/**/*.test.js", + "preversion": "npm test && npm run build", + "postversion": "git push && git push --tags", + "precommit": "npm run lint && lint-staged", + "prettier": "prettier --write ./src/**/*.js", + "lint": "eslint ./src", + "init": "mkdir dist", + "clean": "rm -rf dist", + "prebuild": "npm run clean && npm run init", + "build": "babel ./src -d ./dist --ignore index.test.js" + }, + "lint-staged": { + "*.{js,json,css,md}": ["npm run prettier", "git add"] + }, + "eslintConfig": { + "parserOptions": { + "ecmaVersion": 8 + }, + "extends": ["eslint:recommended", "google", "prettier"], + "env": { + "node": "true" + } + }, + "prettier": { + "trailingComma": "all" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangmai/escape-latex" + }, + "keywords": ["latex", "escape"], + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-preset-env": "^1.6.1", + "chai": "^4.1.2", + "eslint": "^5.0.1", + "eslint-config-google": "^0.9.1", + "eslint-config-prettier": "^3.0.1", + "husky": "^0.14.3", + "lint-staged": "^7.0.5", + "mocha": "^5.0.0", + "prettier": "^1.9.2" + }, + "author": "Dang Mai", + "license": "MIT" +} diff --git a/24_10_22_faktorialis/node_modules/fraction.js/LICENSE b/24_10_22_faktorialis/node_modules/fraction.js/LICENSE new file mode 100644 index 0000000..6dd5328 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Robert Eisele + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/fraction.js/README.md b/24_10_22_faktorialis/node_modules/fraction.js/README.md new file mode 100644 index 0000000..7d3f31a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/README.md @@ -0,0 +1,466 @@ +# Fraction.js - ℚ in JavaScript + +[![NPM Package](https://img.shields.io/npm/v/fraction.js.svg?style=flat)](https://npmjs.org/package/fraction.js "View this project on npm") +[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) + + +Tired of inprecise numbers represented by doubles, which have to store rational and irrational numbers like PI or sqrt(2) the same way? Obviously the following problem is preventable: + +```javascript +1 / 98 * 98 // = 0.9999999999999999 +``` + +If you need more precision or just want a fraction as a result, just include *Fraction.js*: + +```javascript +var Fraction = require('fraction.js'); +// or +import Fraction from 'fraction.js'; +``` + +and give it a trial: + +```javascript +Fraction(1).div(98).mul(98) // = 1 +``` + +Internally, numbers are represented as *numerator / denominator*, which adds just a little overhead. However, the library is written with performance and accuracy in mind, which makes it the perfect basis for [Polynomial.js](https://github.com/infusion/Polynomial.js) and [Math.js](https://github.com/josdejong/mathjs). + +Convert decimal to fraction +=== +The simplest job for fraction.js is to get a fraction out of a decimal: +```javascript +var x = new Fraction(1.88); +var res = x.toFraction(true); // String "1 22/25" +``` + +Examples / Motivation +=== +A simple example might be + +```javascript +var f = new Fraction("9.4'31'"); // 9.4313131313131... +f.mul([-4, 3]).mod("4.'8'"); // 4.88888888888888... +``` +The result is + +```javascript +console.log(f.toFraction()); // -4154 / 1485 +``` +You could of course also access the sign (s), numerator (n) and denominator (d) on your own: +```javascript +f.s * f.n / f.d = -1 * 4154 / 1485 = -2.797306... +``` + +If you would try to calculate it yourself, you would come up with something like: + +```javascript +(9.4313131 * (-4 / 3)) % 4.888888 = -2.797308133... +``` + +Quite okay, but yea - not as accurate as it could be. + + +Laplace Probability +=== +Simple example. What's the probability of throwing a 3, and 1 or 4, and 2 or 4 or 6 with a fair dice? + +P({3}): +```javascript +var p = new Fraction([3].length, 6).toString(); // 0.1(6) +``` + +P({1, 4}): +```javascript +var p = new Fraction([1, 4].length, 6).toString(); // 0.(3) +``` + +P({2, 4, 6}): +```javascript +var p = new Fraction([2, 4, 6].length, 6).toString(); // 0.5 +``` + +Convert degrees/minutes/seconds to precise rational representation: +=== + +57+45/60+17/3600 +```javascript +var deg = 57; // 57° +var min = 45; // 45 Minutes +var sec = 17; // 17 Seconds + +new Fraction(deg).add(min, 60).add(sec, 3600).toString() // -> 57.7547(2) +``` + + +Rational approximation of irrational numbers +=== + +Now it's getting messy ;d To approximate a number like *sqrt(5) - 2* with a numerator and denominator, you can reformat the equation as follows: *pow(n / d + 2, 2) = 5*. + +Then the following algorithm will generate the rational number besides the binary representation. + +```javascript +var x = "/", s = ""; + +var a = new Fraction(0), + b = new Fraction(1); +for (var n = 0; n <= 10; n++) { + + var c = a.add(b).div(2); + + console.log(n + "\t" + a + "\t" + b + "\t" + c + "\t" + x); + + if (c.add(2).pow(2) < 5) { + a = c; + x = "1"; + } else { + b = c; + x = "0"; + } + s+= x; +} +console.log(s) +``` + +The result is + +``` +n a[n] b[n] c[n] x[n] +0 0/1 1/1 1/2 / +1 0/1 1/2 1/4 0 +2 0/1 1/4 1/8 0 +3 1/8 1/4 3/16 1 +4 3/16 1/4 7/32 1 +5 7/32 1/4 15/64 1 +6 15/64 1/4 31/128 1 +7 15/64 31/128 61/256 0 +8 15/64 61/256 121/512 0 +9 15/64 121/512 241/1024 0 +10 241/1024 121/512 483/2048 1 +``` +Thus the approximation after 11 iterations of the bisection method is *483 / 2048* and the binary representation is 0.00111100011 (see [WolframAlpha](http://www.wolframalpha.com/input/?i=sqrt%285%29-2+binary)) + + +I published another example on how to approximate PI with fraction.js on my [blog](http://www.xarg.org/2014/03/precise-calculations-in-javascript/) (Still not the best idea to approximate irrational numbers, but it illustrates the capabilities of Fraction.js perfectly). + + +Get the exact fractional part of a number +--- +```javascript +var f = new Fraction("-6.(3416)"); +console.log("" + f.mod(1).abs()); // 0.(3416) +``` + +Mathematical correct modulo +--- +The behaviour on negative congruences is different to most modulo implementations in computer science. Even the *mod()* function of Fraction.js behaves in the typical way. To solve the problem of having the mathematical correct modulo with Fraction.js you could come up with this: + +```javascript +var a = -1; +var b = 10.99; + +console.log(new Fraction(a) + .mod(b)); // Not correct, usual Modulo + +console.log(new Fraction(a) + .mod(b).add(b).mod(b)); // Correct! Mathematical Modulo +``` + +fmod() impreciseness circumvented +--- +It turns out that Fraction.js outperforms almost any fmod() implementation, including JavaScript itself, [php.js](http://phpjs.org/functions/fmod/), C++, Python, Java and even Wolframalpha due to the fact that numbers like 0.05, 0.1, ... are infinite decimal in base 2. + +The equation *fmod(4.55, 0.05)* gives *0.04999999999999957*, wolframalpha says *1/20*. The correct answer should be **zero**, as 0.05 divides 4.55 without any remainder. + + +Parser +=== + +Any function (see below) as well as the constructor of the *Fraction* class parses its input and reduce it to the smallest term. + +You can pass either Arrays, Objects, Integers, Doubles or Strings. + +Arrays / Objects +--- +```javascript +new Fraction(numerator, denominator); +new Fraction([numerator, denominator]); +new Fraction({n: numerator, d: denominator}); +``` + +Integers +--- +```javascript +new Fraction(123); +``` + +Doubles +--- +```javascript +new Fraction(55.4); +``` + +**Note:** If you pass a double as it is, Fraction.js will perform a number analysis based on Farey Sequences. If you concern performance, cache Fraction.js objects and pass arrays/objects. + +The method is really precise, but too large exact numbers, like 1234567.9991829 will result in a wrong approximation. If you want to keep the number as it is, convert it to a string, as the string parser will not perform any further observations. If you have problems with the approximation, in the file `examples/approx.js` is a different approximation algorithm, which might work better in some more specific use-cases. + + +Strings +--- +```javascript +new Fraction("123.45"); +new Fraction("123/45"); // A rational number represented as two decimals, separated by a slash +new Fraction("123:45"); // A rational number represented as two decimals, separated by a colon +new Fraction("4 123/45"); // A rational number represented as a whole number and a fraction +new Fraction("123.'456'"); // Note the quotes, see below! +new Fraction("123.(456)"); // Note the brackets, see below! +new Fraction("123.45'6'"); // Note the quotes, see below! +new Fraction("123.45(6)"); // Note the brackets, see below! +``` + +Two arguments +--- +```javascript +new Fraction(3, 2); // 3/2 = 1.5 +``` + +Repeating decimal places +--- +*Fraction.js* can easily handle repeating decimal places. For example *1/3* is *0.3333...*. There is only one repeating digit. As you can see in the examples above, you can pass a number like *1/3* as "0.'3'" or "0.(3)", which are synonym. There are no tests to parse something like 0.166666666 to 1/6! If you really want to handle this number, wrap around brackets on your own with the function below for example: 0.1(66666666) + +Assume you want to divide 123.32 / 33.6(567). [WolframAlpha](http://www.wolframalpha.com/input/?i=123.32+%2F+%2812453%2F370%29) states that you'll get a period of 1776 digits. *Fraction.js* comes to the same result. Give it a try: + +```javascript +var f = new Fraction("123.32"); +console.log("Bam: " + f.div("33.6(567)")); +``` + +To automatically make a number like "0.123123123" to something more Fraction.js friendly like "0.(123)", I hacked this little brute force algorithm in a 10 minutes. Improvements are welcome... + +```javascript +function formatDecimal(str) { + + var comma, pre, offset, pad, times, repeat; + + if (-1 === (comma = str.indexOf("."))) + return str; + + pre = str.substr(0, comma + 1); + str = str.substr(comma + 1); + + for (var i = 0; i < str.length; i++) { + + offset = str.substr(0, i); + + for (var j = 0; j < 5; j++) { + + pad = str.substr(i, j + 1); + + times = Math.ceil((str.length - offset.length) / pad.length); + + repeat = new Array(times + 1).join(pad); // Silly String.repeat hack + + if (0 === (offset + repeat).indexOf(str)) { + return pre + offset + "(" + pad + ")"; + } + } + } + return null; +} + +var f, x = formatDecimal("13.0123123123"); // = 13.0(123) +if (x !== null) { + f = new Fraction(x); +} +``` + +Attributes +=== + +The Fraction object allows direct access to the numerator, denominator and sign attributes. It is ensured that only the sign-attribute holds sign information so that a sign comparison is only necessary against this attribute. + +```javascript +var f = new Fraction('-1/2'); +console.log(f.n); // Numerator: 1 +console.log(f.d); // Denominator: 2 +console.log(f.s); // Sign: -1 +``` + + +Functions +=== + +Fraction abs() +--- +Returns the actual number without any sign information + +Fraction neg() +--- +Returns the actual number with flipped sign in order to get the additive inverse + +Fraction add(n) +--- +Returns the sum of the actual number and the parameter n + +Fraction sub(n) +--- +Returns the difference of the actual number and the parameter n + +Fraction mul(n) +--- +Returns the product of the actual number and the parameter n + +Fraction div(n) +--- +Returns the quotient of the actual number and the parameter n + +Fraction pow(exp) +--- +Returns the power of the actual number, raised to an possible rational exponent. If the result becomes non-rational the function returns `null`. + +Fraction mod(n) +--- +Returns the modulus (rest of the division) of the actual object and n (this % n). It's a much more precise [fmod()](#fmod-impreciseness-circumvented) if you like. Please note that *mod()* is just like the modulo operator of most programming languages. If you want a mathematical correct modulo, see [here](#mathematical-correct-modulo). + +Fraction mod() +--- +Returns the modulus (rest of the division) of the actual object (numerator mod denominator) + +Fraction gcd(n) +--- +Returns the fractional greatest common divisor + +Fraction lcm(n) +--- +Returns the fractional least common multiple + +Fraction ceil([places=0-16]) +--- +Returns the ceiling of a rational number with Math.ceil + +Fraction floor([places=0-16]) +--- +Returns the floor of a rational number with Math.floor + +Fraction round([places=0-16]) +--- +Returns the rational number rounded with Math.round + +Fraction roundTo(multiple) +--- +Rounds a fraction to the closest multiple of another fraction. + +Fraction inverse() +--- +Returns the multiplicative inverse of the actual number (n / d becomes d / n) in order to get the reciprocal + +Fraction simplify([eps=0.001]) +--- +Simplifies the rational number under a certain error threshold. Ex. `0.333` will be `1/3` with `eps=0.001` + +boolean equals(n) +--- +Check if two numbers are equal + +int compare(n) +--- +Compare two numbers. +``` +result < 0: n is greater than actual number +result > 0: n is smaller than actual number +result = 0: n is equal to the actual number +``` + +boolean divisible(n) +--- +Check if two numbers are divisible (n divides this) + +double valueOf() +--- +Returns a decimal representation of the fraction + +String toString([decimalPlaces=15]) +--- +Generates an exact string representation of the actual object. For repeated decimal places all digits are collected within brackets, like `1/3 = "0.(3)"`. For all other numbers, up to `decimalPlaces` significant digits are collected - which includes trailing zeros if the number is getting truncated. However, `1/2 = "0.5"` without trailing zeros of course. + +**Note:** As `valueOf()` and `toString()` are provided, `toString()` is only called implicitly in a real string context. Using the plus-operator like `"123" + new Fraction` will call valueOf(), because JavaScript tries to combine two primitives first and concatenates them later, as string will be the more dominant type. `alert(new Fraction)` or `String(new Fraction)` on the other hand will do what you expect. If you really want to have control, you should call `toString()` or `valueOf()` explicitly! + +String toLatex(excludeWhole=false) +--- +Generates an exact LaTeX representation of the actual object. You can see a [live demo](http://www.xarg.org/2014/03/precise-calculations-in-javascript/) on my blog. + +The optional boolean parameter indicates if you want to exclude the whole part. "1 1/3" instead of "4/3" + +String toFraction(excludeWhole=false) +--- +Gets a string representation of the fraction + +The optional boolean parameter indicates if you want to exclude the whole part. "1 1/3" instead of "4/3" + +Array toContinued() +--- +Gets an array of the fraction represented as a continued fraction. The first element always contains the whole part. + +```javascript +var f = new Fraction('88/33'); +var c = f.toContinued(); // [2, 1, 2] +``` + +Fraction clone() +--- +Creates a copy of the actual Fraction object + + +Exceptions +=== +If a really hard error occurs (parsing error, division by zero), *fraction.js* throws exceptions! Please make sure you handle them correctly. + + + +Installation +=== +Installing fraction.js is as easy as cloning this repo or use the following command: + +``` +npm install fraction.js +``` + +Using Fraction.js with the browser +=== +```html + + +``` + +Using Fraction.js with TypeScript +=== +```js +import Fraction from "fraction.js"; +console.log(Fraction("123/456")); +``` + +Coding Style +=== +As every library I publish, fraction.js is also built to be as small as possible after compressing it with Google Closure Compiler in advanced mode. Thus the coding style orientates a little on maxing-out the compression rate. Please make sure you keep this style if you plan to extend the library. + + +Precision +=== +Fraction.js tries to circumvent floating point errors, by having an internal representation of numerator and denominator. As it relies on JavaScript, there is also a limit. The biggest number representable is `Number.MAX_SAFE_INTEGER / 1` and the smallest is `-1 / Number.MAX_SAFE_INTEGER`, with `Number.MAX_SAFE_INTEGER=9007199254740991`. If this is not enough, there is `bigfraction.js` shipped experimentally, which relies on `BigInt` and should become the new Fraction.js eventually. + +Testing +=== +If you plan to enhance the library, make sure you add test cases and all the previous tests are passing. You can test the library with + +``` +npm test +``` + + +Copyright and licensing +=== +Copyright (c) 2023, [Robert Eisele](https://raw.org/) +Licensed under the MIT license. diff --git a/24_10_22_faktorialis/node_modules/fraction.js/bigfraction.js b/24_10_22_faktorialis/node_modules/fraction.js/bigfraction.js new file mode 100644 index 0000000..038ca05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/bigfraction.js @@ -0,0 +1,899 @@ +/** + * @license Fraction.js v4.2.1 20/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * let f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + +(function(root) { + + "use strict"; + + // Set Identity function to downgrade BigInt to Number if needed + if (typeof BigInt === 'undefined') BigInt = function(n) { if (isNaN(n)) throw new Error(""); return n; }; + + const C_ONE = BigInt(1); + const C_ZERO = BigInt(0); + const C_TEN = BigInt(10); + const C_TWO = BigInt(2); + const C_FIVE = BigInt(5); + + // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. + // Example: 1/7 = 0.(142857) has 6 repeating decimal places. + // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits + const MAX_CYCLE_LEN = 2000; + + // Parsed data to avoid calling "new" all the time + const P = { + "s": C_ONE, + "n": C_ZERO, + "d": C_ONE + }; + + function assign(n, s) { + + try { + n = BigInt(n); + } catch (e) { + throw InvalidParameter(); + } + return n * s; + } + + // Creates a new Fraction internally without the need of the bulky constructor + function newFraction(n, d) { + + if (d === C_ZERO) { + throw DivisionByZero(); + } + + const f = Object.create(Fraction.prototype); + f["s"] = n < C_ZERO ? -C_ONE : C_ONE; + + n = n < C_ZERO ? -n : n; + + const a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + + const factors = {}; + + let n = num; + let i = C_TWO; + let s = C_FIVE - C_ONE; + + while (s <= n) { + + while (n % i === C_ZERO) { + n/= i; + factors[i] = (factors[i] || C_ZERO) + C_ONE; + } + s+= C_ONE + C_TWO * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || C_ZERO) + C_ONE; + } else { + factors[num] = (factors[num] || C_ZERO) + C_ONE; + } + return factors; + } + + const parse = function(p1, p2) { + + let n = C_ZERO, d = C_ONE, s = C_ONE; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = BigInt(p1); + d = BigInt(p2); + s = n * d; + + if (n % C_ONE !== C_ZERO || d % C_ONE !== C_ZERO) { + throw NonIntegerParameter(); + } + + } else if (typeof p1 === "object") { + if ("d" in p1 && "n" in p1) { + n = BigInt(p1["n"]); + d = BigInt(p1["d"]); + if ("s" in p1) + n*= BigInt(p1["s"]); + } else if (0 in p1) { + n = BigInt(p1[0]); + if (1 in p1) + d = BigInt(p1[1]); + } else if (p1 instanceof BigInt) { + n = BigInt(p1); + } else { + throw InvalidParameter(); + } + s = n * d; + } else if (typeof p1 === "bigint") { + n = p1; + s = p1; + d = C_ONE; + } else if (typeof p1 === "number") { + + if (isNaN(p1)) { + throw InvalidParameter(); + } + + if (p1 < 0) { + s = -C_ONE; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = BigInt(p1); + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + let z = 1; + + let A = 0, B = 1; + let C = 1, D = 1; + + let N = 10000000; + + if (p1 >= 1) { + z = 10 ** Math.floor(1 + Math.log10(p1)); + p1/= z; + } + + // Using Farey Sequences + + while (B <= N && D <= N) { + let M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n = BigInt(n) * BigInt(z); + d = BigInt(d); + + } + + } else if (typeof p1 === "string") { + + let ndx = 0; + + let v = C_ZERO, w = C_ZERO, x = C_ZERO, y = C_ONE, z = C_ONE; + + let match = p1.match(/\d+|./g); + + if (match === null) + throw InvalidParameter(); + + if (match[ndx] === '-') {// Check for minus sign at the beginning + s = -C_ONE; + ndx++; + } else if (match[ndx] === '+') {// Check for plus sign at the beginning + ndx++; + } + + if (match.length === ndx + 1) { // Check if it's just a simple number "1234" + w = assign(match[ndx++], s); + } else if (match[ndx + 1] === '.' || match[ndx] === '.') { // Check if it's a decimal number + + if (match[ndx] !== '.') { // Handle 0.5 and .5 + v = assign(match[ndx++], s); + } + ndx++; + + // Check for decimal places + if (ndx + 1 === match.length || match[ndx + 1] === '(' && match[ndx + 3] === ')' || match[ndx + 1] === "'" && match[ndx + 3] === "'") { + w = assign(match[ndx], s); + y = C_TEN ** BigInt(match[ndx].length); + ndx++; + } + + // Check for repeating places + if (match[ndx] === '(' && match[ndx + 2] === ')' || match[ndx] === "'" && match[ndx + 2] === "'") { + x = assign(match[ndx + 1], s); + z = C_TEN ** BigInt(match[ndx + 1].length) - C_ONE; + ndx+= 3; + } + + } else if (match[ndx + 1] === '/' || match[ndx + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(match[ndx], s); + y = assign(match[ndx + 2], C_ONE); + ndx+= 3; + } else if (match[ndx + 3] === '/' && match[ndx + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(match[ndx], s); + w = assign(match[ndx + 2], s); + y = assign(match[ndx + 4], C_ONE); + ndx+= 5; + } + + if (match.length <= ndx) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + } else { + throw InvalidParameter(); + } + + } else { + throw InvalidParameter(); + } + + if (d === C_ZERO) { + throw DivisionByZero(); + } + + P["s"] = s < C_ZERO ? -C_ONE : C_ONE; + P["n"] = n < C_ZERO ? -n : n; + P["d"] = d < C_ZERO ? -d : d; + }; + + function modpow(b, e, m) { + + let r = C_ONE; + for (; e > C_ZERO; b = (b * b) % m, e >>= C_ONE) { + + if (e & C_ONE) { + r = (r * b) % m; + } + } + return r; + } + + function cycleLen(n, d) { + + for (; d % C_TWO === C_ZERO; + d/= C_TWO) { + } + + for (; d % C_FIVE === C_ZERO; + d/= C_FIVE) { + } + + if (d === C_ONE) // Catch non-cyclic numbers + return C_ZERO; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + let rem = C_TEN % d; + let t = 1; + + for (; rem !== C_ONE; t++) { + rem = rem * C_TEN % d; + + if (t > MAX_CYCLE_LEN) + return C_ZERO; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return BigInt(t); + } + + function cycleStart(n, d, len) { + + let rem1 = C_ONE; + let rem2 = modpow(C_TEN, len, d); + + for (let t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return BigInt(t); + + rem1 = rem1 * C_TEN % d; + rem2 = rem2 * C_TEN % d; + } + return 0; + } + + function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } + } + + /** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ + function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } + } + + var DivisionByZero = function() {return new Error("Division by Zero");}; + var InvalidParameter = function() {return new Error("Invalid argument");}; + var NonIntegerParameter = function() {return new Error("Parameters must be integer");}; + + Fraction.prototype = { + + "s": C_ONE, + "n": C_ZERO, + "d": C_ONE, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], C_ONE); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === C_ZERO && this["n"] === C_ZERO) { + return newFraction(C_ZERO, C_ONE); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some integer exponent + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === C_ONE) { + + if (P['s'] < C_ZERO) { + return newFraction((this['s'] * this["d"]) ** P['n'], this["n"] ** P['n']); + } else { + return newFraction((this['s'] * this["n"]) ** P['n'], this["d"] ** P['n']); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula + // From which follows that only for c=0 the root is non-complex + if (this['s'] < C_ZERO) return null; + + // Now prime factor n and d + let N = factorize(this['n']); + let D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + let n = C_ONE; + let d = C_ONE; + for (let k in N) { + if (k === '1') continue; + if (k === '0') { + n = C_ZERO; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === C_ZERO) { + N[k]/= P['d']; + } else return null; + n*= BigInt(k) ** N[k]; + } + + for (let k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === C_ZERO) { + D[k]/= P['d']; + } else return null; + d*= BigInt(k) ** D[k]; + } + + if (P['s'] < C_ZERO) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + let t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + + return (C_ZERO < t) - (t < C_ZERO); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = C_TEN ** BigInt(places || 0); + + return newFraction(this["s"] * places * this["n"] / this["d"] + + (places * this["n"] % this["d"] > C_ZERO && this["s"] >= C_ZERO ? C_ONE : C_ZERO), + places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = C_TEN ** BigInt(places || 0); + + return newFraction(this["s"] * places * this["n"] / this["d"] - + (places * this["n"] % this["d"] > C_ZERO && this["s"] < C_ZERO ? C_ONE : C_ZERO), + places); + }, + + /** + * Rounds a rational numbers + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = C_TEN ** BigInt(places || 0); + + /* Derivation: + + s >= 0: + round(n / d) = trunc(n / d) + (n % d) / d >= 0.5 ? 1 : 0 + = trunc(n / d) + 2(n % d) >= d ? 1 : 0 + s < 0: + round(n / d) =-trunc(n / d) - (n % d) / d > 0.5 ? 1 : 0 + =-trunc(n / d) - 2(n % d) > d ? 1 : 0 + + =>: + + round(s * n / d) = s * trunc(n / d) + s * (C + 2(n % d) > d ? 1 : 0) + where C = s >= 0 ? 1 : 0, to fix the >= for the positve case. + */ + + return newFraction(this["s"] * places * this["n"] / this["d"] + + this["s"] * ((this["s"] >= C_ZERO ? C_ONE : C_ZERO) + C_TWO * (places * this["n"] % this["d"]) > this["d"] ? C_ONE : C_ZERO), + places); + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + // Best we can do so far + return Number(this["s"] * this["n"]) / Number(this["d"]); + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + let N = this["n"]; + let D = this["d"]; + + function trunc(x) { + return typeof x === 'bigint' ? x : Math.floor(x); + } + + dec = dec || 15; // 15 = decimal places when no repetition + + let cycLen = cycleLen(N, D); // Cycle length + let cycOff = cycleStart(N, D, cycLen); // Cycle start + + let str = this['s'] < C_ZERO ? "-" : ""; + + // Append integer part + str+= trunc(N / D); + + N%= D; + N*= C_TEN; + + if (N) + str+= "."; + + if (cycLen) { + + for (let i = cycOff; i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + str+= "("; + for (let i = cycLen; i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + str+= ")"; + } else { + for (let i = dec; N && i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + } + return str; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction() => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + let n = this["n"]; + let d = this["d"]; + let str = this['s'] < C_ZERO ? "-" : ""; + + if (d === C_ONE) { + str+= n; + } else { + let whole = n / d; + if (excludeWhole && whole > C_ZERO) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + let n = this["n"]; + let d = this["d"]; + let str = this['s'] < C_ZERO ? "-" : ""; + + if (d === C_ONE) { + str+= n; + } else { + let whole = n / d; + if (excludeWhole && whole > C_ZERO) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + let a = this['n']; + let b = this['d']; + let res = []; + + do { + res.push(a / b); + let t = a % b; + a = b; + b = t; + } while (a !== C_ONE); + + return res; + }, + + "simplify": function(eps) { + + eps = eps || 0.001; + + const thisABS = this['abs'](); + const cont = thisABS['toContinued'](); + + for (let i = 1; i < cont.length; i++) { + + let s = newFraction(cont[i - 1], C_ONE); + for (let k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + } + }; + + if (typeof define === "function" && define["amd"]) { + define([], function() { + return Fraction; + }); + } else if (typeof exports === "object") { + Object.defineProperty(exports, "__esModule", { 'value': true }); + Fraction['default'] = Fraction; + Fraction['Fraction'] = Fraction; + module['exports'] = Fraction; + } else { + root['Fraction'] = Fraction; + } + +})(this); diff --git a/24_10_22_faktorialis/node_modules/fraction.js/fraction.cjs b/24_10_22_faktorialis/node_modules/fraction.js/fraction.cjs new file mode 100644 index 0000000..0a10d8c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/fraction.cjs @@ -0,0 +1,904 @@ +/** + * @license Fraction.js v4.3.7 31/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * var f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + +(function(root) { + + "use strict"; + + // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. + // Example: 1/7 = 0.(142857) has 6 repeating decimal places. + // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits + var MAX_CYCLE_LEN = 2000; + + // Parsed data to avoid calling "new" all the time + var P = { + "s": 1, + "n": 0, + "d": 1 + }; + + function assign(n, s) { + + if (isNaN(n = parseInt(n, 10))) { + throw InvalidParameter(); + } + return n * s; + } + + // Creates a new Fraction internally without the need of the bulky constructor + function newFraction(n, d) { + + if (d === 0) { + throw DivisionByZero(); + } + + var f = Object.create(Fraction.prototype); + f["s"] = n < 0 ? -1 : 1; + + n = n < 0 ? -n : n; + + var a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + + var factors = {}; + + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + + while (n % i === 0) { + n/= i; + factors[i] = (factors[i] || 0) + 1; + } + s+= 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + return factors; + } + + var parse = function(p1, p2) { + + var n = 0, d = 1, s = 1; + var v = 0, w = 0, x = 0, y = 1, z = 1; + + var A = 0, B = 1; + var C = 1, D = 1; + + var N = 10000000; + var M; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw NonIntegerParameter(); + } + + } else + switch (typeof p1) { + + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) + n*= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) + d = p1[1]; + } else { + throw InvalidParameter(); + } + s = n * d; + break; + } + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1/= z; + } + + // Using Farey Sequences + // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n*= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + break; + } + case "string": + { + B = p1.match(/\d+|./g); + + if (B === null) + throw InvalidParameter(); + + if (B[A] === '-') {// Check for minus sign at the beginning + s = -1; + A++; + } else if (B[A] === '+') {// Check for plus sign at the beginning + A++; + } + + if (B.length === A + 1) { // Check if it's just a simple number "1234" + w = assign(B[A++], s); + } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number + + if (B[A] !== '.') { // Handle 0.5 and .5 + v = assign(B[A++], s); + } + A++; + + // Check for decimal places + if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + // Check for repeating places + if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A+= 3; + } + + } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A+= 3; + } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A+= 5; + } + + if (B.length <= A) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + break; + } + + /* Fall through on error */ + } + default: + throw InvalidParameter(); + } + + if (d === 0) { + throw DivisionByZero(); + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); + }; + + function modpow(b, e, m) { + + var r = 1; + for (; e > 0; b = (b * b) % m, e >>= 1) { + + if (e & 1) { + r = (r * b) % m; + } + } + return r; + } + + + function cycleLen(n, d) { + + for (; d % 2 === 0; + d/= 2) { + } + + for (; d % 5 === 0; + d/= 5) { + } + + if (d === 1) // Catch non-cyclic numbers + return 0; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + + if (t > MAX_CYCLE_LEN) + return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return t; + } + + + function cycleStart(n, d, len) { + + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return t; + + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + return 0; + } + + function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } + }; + + /** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ + function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse variable a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } + } + + var DivisionByZero = function() { return new Error("Division by Zero"); }; + var InvalidParameter = function() { return new Error("Invalid argument"); }; + var NonIntegerParameter = function() { return new Error("Parameters must be integer"); }; + + Fraction.prototype = { + + "s": 1, + "n": 0, + "d": 1, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return new Fraction(NaN); + } + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational numbers + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number to a multiple of another rational number + * + * Ex: new Fraction('0.9').roundTo("1/8") => 7 / 8 + **/ + "roundTo": function(a, b) { + + /* + k * x/y ≤ a/b < (k+1) * x/y + ⇔ k ≤ a/b / (x/y) < (k+1) + ⇔ k = floor(a/b * y/x) + */ + + parse(a, b); + + return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some rational exponent, if possible + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === 1) { + + if (P['s'] < 0) { + return newFraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); + } else { + return newFraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) + // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. + if (this['s'] < 0) return null; + + // Now prime factor n and d + var N = factorize(this['n']); + var D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + var n = 1; + var d = 1; + for (var k in N) { + if (k === '1') continue; + if (k === '0') { + n = 0; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === 0) { + N[k]/= P['d']; + } else return null; + n*= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === 0) { + D[k]/= P['d']; + } else return null; + d*= Math.pow(k, D[k]); + } + + if (P['s'] < 0) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + return (0 < t) - (t < 0); + }, + + "simplify": function(eps) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return this; + } + + eps = eps || 0.001; + + var thisABS = this['abs'](); + var cont = thisABS['toContinued'](); + + for (var i = 1; i < cont.length; i++) { + + var s = newFraction(cont[i - 1], 1); + for (var k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + + return this["s"] * this["n"] / this["d"]; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction(true) => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + var t; + var a = this['n']; + var b = this['d']; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; // 15 = decimal places when no repetation + + var cycLen = cycleLen(N, D); // Cycle length + var cycOff = cycleStart(N, D, cycLen); // Cycle start + + var str = this['s'] < 0 ? "-" : ""; + + str+= N / D | 0; + + N%= D; + N*= 10; + + if (N) + str+= "."; + + if (cycLen) { + + for (var i = cycOff; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= "("; + for (var i = cycLen; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= ")"; + } else { + for (var i = dec; N && i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + } + return str; + } + }; + + if (typeof exports === "object") { + Object.defineProperty(exports, "__esModule", { 'value': true }); + exports['default'] = Fraction; + module['exports'] = Fraction; + } else { + root['Fraction'] = Fraction; + } + +})(this); diff --git a/24_10_22_faktorialis/node_modules/fraction.js/fraction.d.ts b/24_10_22_faktorialis/node_modules/fraction.js/fraction.d.ts new file mode 100644 index 0000000..8a11b3a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/fraction.d.ts @@ -0,0 +1,60 @@ +declare module 'Fraction'; + +export interface NumeratorDenominator { + n: number; + d: number; +} + +type FractionConstructor = { + (fraction: Fraction): Fraction; + (num: number | string): Fraction; + (numerator: number, denominator: number): Fraction; + (numbers: [number | string, number | string]): Fraction; + (fraction: NumeratorDenominator): Fraction; + (firstValue: Fraction | number | string | [number | string, number | string] | NumeratorDenominator, secondValue?: number): Fraction; +}; + +export default class Fraction { + constructor (fraction: Fraction); + constructor (num: number | string); + constructor (numerator: number, denominator: number); + constructor (numbers: [number | string, number | string]); + constructor (fraction: NumeratorDenominator); + constructor (firstValue: Fraction | number | string | [number | string, number | string] | NumeratorDenominator, secondValue?: number); + + s: number; + n: number; + d: number; + + abs(): Fraction; + neg(): Fraction; + + add: FractionConstructor; + sub: FractionConstructor; + mul: FractionConstructor; + div: FractionConstructor; + pow: FractionConstructor; + gcd: FractionConstructor; + lcm: FractionConstructor; + + mod(n?: number | string | Fraction): Fraction; + + ceil(places?: number): Fraction; + floor(places?: number): Fraction; + round(places?: number): Fraction; + + inverse(): Fraction; + + simplify(eps?: number): Fraction; + + equals(n: number | string | Fraction): boolean; + compare(n: number | string | Fraction): number; + divisible(n: number | string | Fraction): boolean; + + valueOf(): number; + toString(decimalPlaces?: number): string; + toLatex(excludeWhole?: boolean): string; + toFraction(excludeWhole?: boolean): string; + toContinued(): number[]; + clone(): Fraction; +} diff --git a/24_10_22_faktorialis/node_modules/fraction.js/fraction.js b/24_10_22_faktorialis/node_modules/fraction.js/fraction.js new file mode 100644 index 0000000..b9780e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/fraction.js @@ -0,0 +1,891 @@ +/** + * @license Fraction.js v4.3.7 31/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * var f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + + +// Maximum search depth for cyclic rational numbers. 2000 should be more than enough. +// Example: 1/7 = 0.(142857) has 6 repeating decimal places. +// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits +var MAX_CYCLE_LEN = 2000; + +// Parsed data to avoid calling "new" all the time +var P = { + "s": 1, + "n": 0, + "d": 1 +}; + +function assign(n, s) { + + if (isNaN(n = parseInt(n, 10))) { + throw InvalidParameter(); + } + return n * s; +} + +// Creates a new Fraction internally without the need of the bulky constructor +function newFraction(n, d) { + + if (d === 0) { + throw DivisionByZero(); + } + + var f = Object.create(Fraction.prototype); + f["s"] = n < 0 ? -1 : 1; + + n = n < 0 ? -n : n; + + var a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; +} + +function factorize(num) { + + var factors = {}; + + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + + while (n % i === 0) { + n/= i; + factors[i] = (factors[i] || 0) + 1; + } + s+= 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + return factors; +} + +var parse = function(p1, p2) { + + var n = 0, d = 1, s = 1; + var v = 0, w = 0, x = 0, y = 1, z = 1; + + var A = 0, B = 1; + var C = 1, D = 1; + + var N = 10000000; + var M; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw NonIntegerParameter(); + } + + } else + switch (typeof p1) { + + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) + n*= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) + d = p1[1]; + } else { + throw InvalidParameter(); + } + s = n * d; + break; + } + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1/= z; + } + + // Using Farey Sequences + // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n*= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + break; + } + case "string": + { + B = p1.match(/\d+|./g); + + if (B === null) + throw InvalidParameter(); + + if (B[A] === '-') {// Check for minus sign at the beginning + s = -1; + A++; + } else if (B[A] === '+') {// Check for plus sign at the beginning + A++; + } + + if (B.length === A + 1) { // Check if it's just a simple number "1234" + w = assign(B[A++], s); + } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number + + if (B[A] !== '.') { // Handle 0.5 and .5 + v = assign(B[A++], s); + } + A++; + + // Check for decimal places + if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + // Check for repeating places + if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A+= 3; + } + + } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A+= 3; + } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A+= 5; + } + + if (B.length <= A) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + break; + } + + /* Fall through on error */ + } + default: + throw InvalidParameter(); + } + + if (d === 0) { + throw DivisionByZero(); + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); +}; + +function modpow(b, e, m) { + + var r = 1; + for (; e > 0; b = (b * b) % m, e >>= 1) { + + if (e & 1) { + r = (r * b) % m; + } + } + return r; +} + + +function cycleLen(n, d) { + + for (; d % 2 === 0; + d/= 2) { + } + + for (; d % 5 === 0; + d/= 5) { + } + + if (d === 1) // Catch non-cyclic numbers + return 0; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + + if (t > MAX_CYCLE_LEN) + return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return t; +} + + +function cycleStart(n, d, len) { + + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return t; + + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + return 0; +} + +function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } +}; + +/** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ +export default function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse variable a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } +} + +var DivisionByZero = function() { return new Error("Division by Zero"); }; +var InvalidParameter = function() { return new Error("Invalid argument"); }; +var NonIntegerParameter = function() { return new Error("Parameters must be integer"); }; + +Fraction.prototype = { + + "s": 1, + "n": 0, + "d": 1, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return new Fraction(NaN); + } + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number to a multiple of another rational number + * + * Ex: new Fraction('0.9').roundTo("1/8") => 7 / 8 + **/ + "roundTo": function(a, b) { + + /* + k * x/y ≤ a/b < (k+1) * x/y + ⇔ k ≤ a/b / (x/y) < (k+1) + ⇔ k = floor(a/b * y/x) + */ + + parse(a, b); + + return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some rational exponent, if possible + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === 1) { + + if (P['s'] < 0) { + return newFraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); + } else { + return newFraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) + // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. + if (this['s'] < 0) return null; + + // Now prime factor n and d + var N = factorize(this['n']); + var D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + var n = 1; + var d = 1; + for (var k in N) { + if (k === '1') continue; + if (k === '0') { + n = 0; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === 0) { + N[k]/= P['d']; + } else return null; + n*= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === 0) { + D[k]/= P['d']; + } else return null; + d*= Math.pow(k, D[k]); + } + + if (P['s'] < 0) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + return (0 < t) - (t < 0); + }, + + "simplify": function(eps) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return this; + } + + eps = eps || 0.001; + + var thisABS = this['abs'](); + var cont = thisABS['toContinued'](); + + for (var i = 1; i < cont.length; i++) { + + var s = newFraction(cont[i - 1], 1); + for (var k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + + return this["s"] * this["n"] / this["d"]; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction(true) => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + var t; + var a = this['n']; + var b = this['d']; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; // 15 = decimal places when no repetation + + var cycLen = cycleLen(N, D); // Cycle length + var cycOff = cycleStart(N, D, cycLen); // Cycle start + + var str = this['s'] < 0 ? "-" : ""; + + str+= N / D | 0; + + N%= D; + N*= 10; + + if (N) + str+= "."; + + if (cycLen) { + + for (var i = cycOff; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= "("; + for (var i = cycLen; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= ")"; + } else { + for (var i = dec; N && i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + } + return str; + } +}; diff --git a/24_10_22_faktorialis/node_modules/fraction.js/fraction.min.js b/24_10_22_faktorialis/node_modules/fraction.js/fraction.min.js new file mode 100644 index 0000000..1cfa151 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/fraction.min.js @@ -0,0 +1,18 @@ +/* +Fraction.js v4.3.7 31/08/2023 +https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + +Copyright (c) 2023, Robert Eisele (robert@raw.org) +Dual licensed under the MIT or GPL Version 2 licenses. +*/ +(function(B){function x(){return Error("Invalid argument")}function z(){return Error("Division by Zero")}function n(a,c){var b=0,d=1,f=1,l=0,k=0,t=0,y=1,u=1,g=0,h=1,v=1,q=1;if(void 0!==a&&null!==a)if(void 0!==c){if(b=a,d=c,f=b*d,0!==b%1||0!==d%1)throw Error("Parameters must be integer");}else switch(typeof a){case "object":if("d"in a&&"n"in a)b=a.n,d=a.d,"s"in a&&(b*=a.s);else if(0 in a)b=a[0],1 in a&&(d=a[1]);else throw x();f=b*d;break;case "number":0>a&&(f=a,a=-a);if(0===a%1)b=a;else if(0=h&&1E7>=q;)if(b=(g+v)/(h+q),a===b){1E7>=h+q?(b=g+v,d=h+q):q>h?(b=v,d=q):(b=g,d=h);break}else a>b?(g+=v,h+=q):(v+=g,q+=h),1E7f?-1:1;e.n=Math.abs(b);e.d=Math.abs(d)}function r(a,c){if(isNaN(a=parseInt(a,10)))throw x();return a*c} +function m(a,c){if(0===c)throw z();var b=Object.create(p.prototype);b.s=0>a?-1:1;a=0>a?-a:a;var d=w(a,c);b.n=a/d;b.d=c/d;return b}function A(a){for(var c={},b=a,d=2,f=4;f<=b;){for(;0===b%d;)b/=d,c[d]=(c[d]||0)+1;f+=1+2*d++}b!==a?1e.s?m(Math.pow(this.s*this.d,e.n),Math.pow(this.n,e.n)):m(Math.pow(this.s*this.n,e.n),Math.pow(this.d, +e.n));if(0>this.s)return null;var b=A(this.n),d=A(this.d),f=1,l=1,k;for(k in b)if("1"!==k){if("0"===k){f=0;break}b[k]*=e.n;if(0===b[k]%e.d)b[k]/=e.d;else return null;f*=Math.pow(k,b[k])}for(k in d)if("1"!==k){d[k]*=e.n;if(0===d[k]%e.d)d[k]/=e.d;else return null;l*=Math.pow(k,d[k])}return 0>e.s?m(l,f):m(f,l)},equals:function(a,c){n(a,c);return this.s*this.n*e.d===e.s*e.n*this.d},compare:function(a,c){n(a,c);var b=this.s*this.n*e.d-e.s*e.n*this.d;return(0b)},simplify:function(a){if(isNaN(this.n)|| +isNaN(this.d))return this;a=a||.001;for(var c=this.abs(),b=c.toContinued(),d=1;dthis.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b=b+c+" ",d%=f),b=b+d+"/",b+=f);return b}, +toLatex:function(a){var c,b="",d=this.n,f=this.d;0>this.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b+=c,d%=f),b=b+"\\frac{"+d+"}{"+f,b+="}");return b},toContinued:function(){var a=this.n,c=this.d,b=[];if(isNaN(a)||isNaN(c))return b;do{b.push(Math.floor(a/c));var d=a%c;a=c;c=d}while(1!==a);return b},toString:function(a){var c=this.n,b=this.d;if(isNaN(c)||isNaN(b))return"NaN";var d;a:{for(d=b;0===d%2;d/=2);for(;0===d%5;d/=5);if(1===d)d=0;else{for(var f=10%d,l=1;1!==f;l++)if(f=10*f%d,2E3>=1)k&1&&(t=t*l%b);l=t;for(k=0;300>k;k++){if(f===l){l=k;break a}f=10*f%b;l=10*l%b}l=0}f=0>this.s?"-":"";f+=c/b|0;(c=c%b*10)&&(f+=".");if(d){for(a=l;a--;)f+=c/b|0,c%=b,c*=10;f+="(";for(a=d;a--;)f+=c/b|0,c%=b,c*=10;f+=")"}else for(a=a||15;c&&a--;)f+=c/b|0,c%=b,c*=10;return f}};"object"===typeof exports?(Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=p,module.exports=p):B.Fraction=p})(this); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/fraction.js/package.json b/24_10_22_faktorialis/node_modules/fraction.js/package.json new file mode 100644 index 0000000..085d287 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/fraction.js/package.json @@ -0,0 +1,55 @@ +{ + "name": "fraction.js", + "title": "fraction.js", + "version": "4.3.7", + "homepage": "https://www.xarg.org/2014/03/rational-numbers-in-javascript/", + "bugs": "https://github.com/rawify/Fraction.js/issues", + "description": "A rational number library", + "keywords": [ + "math", + "fraction", + "rational", + "rationals", + "number", + "parser", + "rational numbers" + ], + "author": { + "name": "Robert Eisele", + "email": "robert@raw.org", + "url": "https://raw.org/" + }, + "type": "module", + "main": "fraction.cjs", + "exports": { + ".": { + "import": "./fraction.js", + "require": "./fraction.cjs", + "types": "./fraction.d.ts" + } + }, + "types": "./fraction.d.ts", + "private": false, + "readmeFilename": "README.md", + "directories": { + "example": "examples" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/rawify/Fraction.js.git" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + }, + "engines": { + "node": "*" + }, + "scripts": { + "test": "mocha tests/*.js" + }, + "devDependencies": { + "mocha": "*" + } +} diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.gitattributes b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/.name b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/.name new file mode 100644 index 0000000..f9bd021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/.name @@ -0,0 +1 @@ +javascript-natural-sort \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/encodings.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml new file mode 100644 index 0000000..6b8184f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/misc.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/misc.xml new file mode 100644 index 0000000..1162f43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/modules.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/modules.xml new file mode 100644 index 0000000..63a98c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/vcs.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/workspace.xml b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/workspace.xml new file mode 100644 index 0000000..e229274 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.idea/workspace.xml @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1388535088299 + 1388535088299 + + + 1388535399296 + 1388535399296 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/.npmignore b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.npmignore new file mode 100644 index 0000000..5ebd21a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/.npmignore @@ -0,0 +1,163 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/README.md b/24_10_22_faktorialis/node_modules/javascript-natural-sort/README.md new file mode 100644 index 0000000..8270bd1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/README.md @@ -0,0 +1,76 @@ +### Simple numerics + +```javascript +>>> ['10',9,2,'1','4'].sort(naturalSort) +['1',2,'4',9,'10'] +``` + +### Floats + +```javascript +>>> ['10.0401',10.022,10.042,'10.021999'].sort(naturalSort) +['10.021999',10.022,'10.0401',10.042] +``` + +### Float & decimal notation + +```javascript +>>> ['10.04f','10.039F','10.038d','10.037D'].sort(naturalSort) +['10.037D','10.038d','10.039F','10.04f'] +``` + +### Scientific notation + +```javascript +>>> ['1.528535047e5','1.528535047e7','1.528535047e3'].sort(naturalSort) +['1.528535047e3','1.528535047e5','1.528535047e7'] +``` + +### IP addresses + +```javascript +>>> ['192.168.0.100','192.168.0.1','192.168.1.1'].sort(naturalSort) +['192.168.0.1','192.168.0.100','192.168.1.1'] +``` + +### Filenames + +```javascript +>>> ['car.mov','01alpha.sgi','001alpha.sgi','my.string_41299.tif'].sort(naturalSort) +['001alpha.sgi','01alpha.sgi','car.mov','my.string_41299.tif' +``` + +### Dates + +```javascript +>>> ['10/12/2008','10/11/2008','10/11/2007','10/12/2007'].sort(naturalSort) +['10/11/2007', '10/12/2007', '10/11/2008', '10/12/2008'] +``` + +### Money + +```javascript +>>> ['$10002.00','$10001.02','$10001.01'].sort(naturalSort) +['$10001.01','$10001.02','$10002.00'] +``` + +### Movie Titles + +```javascript +>>> ['1 Title - The Big Lebowski','1 Title - Gattaca','1 Title - Last Picture Show'].sort(naturalSort) +['1 Title - Gattaca','1 Title - Last Picture Show','1 Title - The Big Lebowski'] +``` + +### By default - case-sensitive sorting + +```javascript +>>> ['a', 'B'].sort(naturalSort); +['B', 'a'] +``` + +### To enable case-insensitive sorting +```javascript +>>> naturalSort.insensitive = true; +>>> ['a', 'B'].sort(naturalSort); +['a', 'B'] +``` diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/index.html b/24_10_22_faktorialis/node_modules/javascript-natural-sort/index.html new file mode 100644 index 0000000..9c0bf7e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/index.html @@ -0,0 +1,100 @@ + + + + + + overset/javascript-natural-sort @ GitHub + + + + + + Fork me on GitHub + +
+ +
+ + + + +
+ +

javascript-natural-sort + by overset

+ +
+ A fast and lightweight function to be used in conjunction with the Array.sort() using the browser's default bubble sort. This will properly sort padded numbers, numbers preceding text, dates, floats, etc. +
+ + + + + + + + +

License

+

MIT

+ + + +

Authors

+

Jim Palmer (jimpalmer@gmail.com)

+ + + +

Contact

+

Jim Palmer (jimpalmer@gmail.com)

+ + +

Download

+

+ You can download this project in either + zip or + tar formats. +

+

You can also clone the project with Git + by running: +

$ git clone git://github.com/overset/javascript-natural-sort
+

+ + + +
+ + +" + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/naturalSort.js b/24_10_22_faktorialis/node_modules/javascript-natural-sort/naturalSort.js new file mode 100644 index 0000000..28dd64d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/naturalSort.js @@ -0,0 +1,45 @@ +/* + * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license + * Author: Jim Palmer (based on chunking idea from Dave Koelle) + */ +/*jshint unused:false */ +module.exports = function naturalSort (a, b) { + "use strict"; + var re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, + sre = /(^[ ]*|[ ]*$)/g, + dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, + hre = /^0x[0-9a-f]+$/i, + ore = /^0/, + i = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; }, + // convert all to strings strip whitespace + x = i(a).replace(sre, '') || '', + y = i(b).replace(sre, '') || '', + // chunk/tokenize + xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), + yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), + // numeric, hex or date detection + xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)), + yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null, + oFxNcL, oFyNcL; + // first try and sort Hex codes or Dates + if (yD) { + if ( xD < yD ) { return -1; } + else if ( xD > yD ) { return 1; } + } + // natural sorting through split numeric strings and default strings + for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) { + // find floats not starting with '0', string or 0 if not defined (Clint Priest) + oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0; + oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0; + // handle numeric vs string comparison - number < string - (Kyle Adams) + if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; } + // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' + else if (typeof oFxNcL !== typeof oFyNcL) { + oFxNcL += ''; + oFyNcL += ''; + } + if (oFxNcL < oFyNcL) { return -1; } + if (oFxNcL > oFyNcL) { return 1; } + } + return 0; +}; diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/package.json b/24_10_22_faktorialis/node_modules/javascript-natural-sort/package.json new file mode 100644 index 0000000..4b1bf07 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/package.json @@ -0,0 +1,27 @@ +{ + "name": "javascript-natural-sort", + "version": "0.7.1", + "description": "Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license", + "main": "naturalSort.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/Bill4Time/javascript-natural-sort.git" + }, + "keywords": [ + "natural", + "sort", + "javascript", + "array", + "sort", + "sorting" + ], + "author": "Jim Palmer (based on chunking idea from Dave Koelle, packaged by @khous of Bill4Time)", + "license": "MIT", + "bugs": { + "url": "https://github.com/Bill4Time/javascript-natural-sort/issues" + }, + "homepage": "https://github.com/Bill4Time/javascript-natural-sort" +} diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/speed-tests.html b/24_10_22_faktorialis/node_modules/javascript-natural-sort/speed-tests.html new file mode 100644 index 0000000..090259b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/speed-tests.html @@ -0,0 +1,105 @@ + + + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/javascript-natural-sort/unit-tests.html b/24_10_22_faktorialis/node_modules/javascript-natural-sort/unit-tests.html new file mode 100644 index 0000000..7b11540 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/javascript-natural-sort/unit-tests.html @@ -0,0 +1,365 @@ + + + + js-naturalsort test suite + + + + + + + +

js-naturalsort test suite

+

+

+
    + + diff --git a/24_10_22_faktorialis/node_modules/mathjs/CONTRIBUTING.md b/24_10_22_faktorialis/node_modules/mathjs/CONTRIBUTING.md new file mode 100644 index 0000000..474a34f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/CONTRIBUTING.md @@ -0,0 +1,24 @@ +## Contributing + +Contributions to the math.js library are very welcome! We can't do this alone. You can contribute in different ways: spread the word, report bugs, come up with ideas and suggestions, and contribute to the code. + +### What can I do? + +Search through the [issues](https://github.com/josdejong/mathjs/issues) looking for bugs that you can help fix, or look at [discussions/ideas](https://github.com/josdejong/mathjs/discussions/categories/ideas) to see if there is an idea for a new feature that that looks interesting to pick up. + +### There are a few preferences regarding code contributions: + +- The code of math.js follows the JavaScript Standard Style as described on https://standardjs.com/, powered by `eslint`. Run `npm run lint` to test, and `npm run format` to automatically adjust your code to the code style. +- Make sure you properly unit test your changes. +- Before creating a pull request, run the unit tests to make sure they all pass. +- Only commit changes done in the source files under `src`, not to the generated builds + which are located in the folders `dist` and `lib`. +- Send pull requests to the `develop` branch, not the `master` branch. + +### FAQ + +- How to implement a new function? Answer: See the section [Implementing a new function](README.md#implementing-a-new-function) in the README.md. +- Where to find more documentation? Answer: best starting point is the project's [README.md](https://github.com/josdejong/mathjs#readme) file. +- I'm not sure how/where to start, what now? Answer: feel free to ask when in doubt, just [open an issue](https://github.com/josdejong/mathjs/issues) and discuss your thoughts and questions. + +Thanks! diff --git a/24_10_22_faktorialis/node_modules/mathjs/HISTORY.md b/24_10_22_faktorialis/node_modules/mathjs/HISTORY.md new file mode 100644 index 0000000..52a11aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/HISTORY.md @@ -0,0 +1,2960 @@ +# History + +# 2204-10-02 13.2.0 + +- Feat: improve performance of functions `map`, `filter` and `forEach` (#3256). + Thanks @dvd101x. +- Feat: improve performance of the methods `map()` and `forEach()` + of `DenseMatrix` (#3251). Thanks @Galm007. +- Fix: #3253 cannot use identifiers containing special characters in function + `derivative`. +- Fix: improve the type definitions of `ConstantNode` to support all data + types (#3257). Thanks @smith120bh. +- Fix: #3259 function `symbolicEqual` missing in the TypeScript definitions. +- Fix: #3246 function `leafCount` missing in the TypeScript definitions. +- Fix: #3267 implicit multiplication with a negative number and unit `in`. +- Docs: fix broken links on the Configuration page. Thanks @vassudanagunta. +- Docs: document the syntax of `map` and `forEach` in the expression parser + (#3272). Thanks @dvd101x. + +# 2024-08-27, 13.1.1 + +- Fix security vulnerability in the CLI and web API allowing to call functions + `import`, `createUnit` and `reviver`, allowing to get access to the internal + math namespace and allowing arbitrary code execution. Thanks @StarlightPWN. +- Fix security vulnerability: when overwriting a `rawArgs` function with a + non-`rawArgs` function, it was still called with raw arguments. This was both + a functional issue and a security issue. Thanks @StarlightPWN. +- Fix security vulnerability: ensure that `ObjectWrappingMap` cannot delete + unsafe properties. Thanks @StarlightPWN. +- Fix: not being able to use methods and properties on arrays inside the + expression parser. + +# 2024-08-26, 13.1.0 + +- Feat: support multiple inputs in function `map` (#3228, #3196). + Thanks @dvd101x. +- Feat: add matrix datatypes in more cases (#3235). Thanks @dvd101x. +- Feat: export util functions `isMap`, `isPartitionedMap`, and + `isObjectWrappingMap`. +- Fix: #3241 function `map` not always working with matrices (#3242). + Thanks @dvd101x. +- Fix: #3244 fix broken link to `ResultSet` in the docs about classes. +- Docs: add a link to the documentation page about the syntax expression + from the function `evaluate` (see #3238). +- Docs: improve the documentation of `scope` and fix the example + `custom_scope_objects.js` (#3150) +- Docs: spelling fixes in the embedded docs (#3252). Thanks @dvd101x. + +# 2024-07-19, 13.0.3 + +- Fix: #3232 fix type definitions of function `format` to support notations + `hex`, `bin`, and `oct`. +- Fix: use more precise definitions for US liquid volume units (#3229). + Thanks @Vistinum. +- Fix: #2286 types static methods and members for Unit class (#3230). + Thanks @orelbn. + +# 2024-07-04, 13.0.2 + +- Fix an error in the type definitions of `quantileSeq` (#3223). + Thanks @domdomegg. + +# 2024-06-28, 13.0.1 + +- Fix: #3227 generated bundle containing `catch` blocks without parameters. +- Fix: #2348 update type definitions of the `Parser` methods (#3226). + Thanks @orelbn. + +# 2024-05-31, 13.0.0 + +Breaking changes: + +- Change `isZero`, `isPositive`, and `isNegative` to respect `config.epsilon` + (#3139, #2838). +- Change the behavior of the internal `nearlyEqual` to align with Python and + Julia (#3152, #2838) +- Upgrade to `fraction.js@4.3.7`, + see . +- Dropped support for JavaScript engines that do not fully support ES6 or + `bigint`, or are not actively maintained. ES2020 is now the minimum required + EcmaScript version. + +Non-breaking changes: + +- Implemented support for `bigint` (#3207, #3207) +- Implemented a new config option `config.numberFallback` needed for `bigint` + (#3207). +- Internal: refactored tooling to ES modules and upgraded all devDependencies. + +# 2024-05-31, 12.4.3 + +- Fix: serialization of Units without a value, see #1240. +- Fix: outdated, incorrect documentation about the order of precedence for + operator modulus `%`. See #3189. +- Fix: #3197 improve `quantileSeq` type definitions (#3198). Thanks @domdomegg. + +# 2024-04-24, 12.4.2 + +- Fix #3192: function `isNaN` returns `false` for `NaN` units in a matrix or + array (#3193). Thanks @lgerin. +- Fix: #3180 fix type definitions of functions `add` and `multiply` to allow + more than two arguments. +- Docs: correct the docs about `traverse` returning void (#3177). + Thanks @rohildshah. + +# 2024-03-13, 12.4.1 + +- Docs: implement an interactive version of the Lorenz example, and show the + chart full screen (#3151). Thanks @dvd101x. +- Fix #3172: simplify `"true and true"`. +- Fix #3163: `toTex` wrongly returning `Infinity` for large BigNumbers. +- Fix #3162: add license information about CSParse (#3164). +- Fix #3175: cannot delete units using `math.Unit.deleteUnit`. +- Fix: faster startup time of the CLI and REPL by loading the bundle. +- Fix: remove using polyfill.io inside the example + `pretty_printing_with_mathjax.html` (#3167). Thanks @SukkaW. + +# 2024-02-22, 12.4.0 + +- Feat: implement support for trailing commas in matrices (#3154, #2968). + Thanks @dvd101x. +- Feat: improve the performance of `multiply` a lot by adding matrix type + inferencing (#3149). Thanks @RandomGamingDev. +- Fix: #3100 function `round` not handling round-off errors (#3136). + Thanks @BrianFugate. +- Fix: `PartitionedMap` and `ObjectWrappingMap` missing a property + `Symbol.iterator`, causing problems when trying `new Map(scope)` (#3156). +- Fix: type definitions of function `mode` (#3153). Thanks @rich-martinez. +- Docs: describe method `getAllAsMap` in the Parser docs (#3158, #3157). + Thanks @dvd101x. + +# 2024-02-08, 12.3.2 + +- Improved the performance of custom defined functions in the expression + parser (#3150). +- Fix: #3143 cannot use `and` and `or` inside a function definition. + Regression since `v12.1.0` (#3150). + +# 2024-02-01, 12.3.1 + +- Improved the typings of the arguments of `ArrayNode`, `FunctionNode`, + `IndexNode`, `OperatorNode`, and `RelationalNode` (#3123). Thanks @sylee957. +- Added a fully featured code editor example with CodeMirror and Katex (#3027). + Thanks @dvd101x. +- Fix: #3114 build warnings related to a number of wrong `/* #__PURE__ */` + annotations. +- Fix: #3142 support BigNumber values for the options of function `format`: + `precision`, `wordSize`, `lowerExp`, `upperExp`. Support BigNumber values + for the option `wordSize` in the functions `hex`, `bin`, and `oct`. +- Fix: #3125 type definitions of function `hypot` (#3144). + Thanks @silentmissile. +- Fix: #3141 `help(config)` altering the actual `config` when evaluating the + examples. +- Docs: #3145 fix documentation about REPL, it does require a build step + nowadays. + +# 2024-01-12, 12.3.0 + +- Implement support new metric prefixes: `ronna` (`R`), `quetta` (`Q`), + `ronto` (`r`), and `quecto` (`q`) (#3113, #3112). Thanks @AlexEdgcomb. +- Fix a bug converting a unitless unit (#3117). Thanks @costerwi. +- Fix: #3097 `toSI()` wrongly converting `degC` (#3118). Thanks @costerwi. + +# 2023-12-20, 12.2.1 + +- Fix #3109: method `Node.toHTML` not accepting a custom `handler`. + +# 2023-12-08, 12.2.0 + +- Feat: lazy evaluation of operators `and`, `or`, `&`, `|` (#3090, #3101, + #2766). Thanks @smith120bh. +- Fix: passing a 4th argument with a scope to raw functions. +- Fix: #3096 embedded docs of eigs throwing an error. + +# 2023-11-17, 12.1.0 + +- Feat: Extend function `round` with support for units (#2761, #3095). +- Feat: Extend function `mod` with support for negative divisors in when + using `BigNumber` or `Fraction` (#3087). +- Fix: #3092 a typo in an error message when converting a string into a number. +- Fix: #3094 function `derivative` mutates the input expression when it fails. + +# 2023-10-26, 12.0.0 + +Breaking changes: + +- Fix #2879, #2927, #3014: change the confusing interface of `eigs` (#3037), + thanks @gwhitney. + Before, functions `eigs` returned an object: + + ``` + { values: MathCollection; vectors: MathCollection } + ``` + + where `vectors` was a 2d matrix of which the columns contained the vectors. + This is changed to `eigs` returning an object: + + ``` + { + values: MathCollection + eigenvectors: Array<{ + value: number | BigNumber + vector: MathCollection + }> + } + ``` + + Where `eigenvectors` is an array containing an object with the corresponding + eigenvalue and vector. +- Refactored the TypeScript type definitions to make them work with a `NodeNext` + module resolution (#3079, #2919). + - Type `MathJsStatic` is renamed to `MathJsInstance`. + - Type `FactoryDependencies` is deprecated, use `MathJsFactory` instead, and + import dependency maps directly from the library. +- Change the assignment operator of `.toTex()` output from `:=` to `=` (see + #2980, #2987). +- Drop official support for Node.js 14 and 16. + +Features: + +- Function `eigs` now has an option to turn off calculation of eigenvectors + (#3057, #2180). Thanks @gwhitney. + +Fixes: + +- Find eigenvectors of defective matrices (#3037). Thanks @gwhitney. + +# 2023-10-26, 11.12.0 + +- Implemented function `subtractScalar` (#3081, #2643), thanks @vrushaket. +- Fix #3073: function format not escaping control characters and double + quotes (#3082). +- Fix: function `clone` not throwing an error when passing an unsupported + type like a function. +- Fix: #2960 add type definition of function `symbolicEqual` (#3035), + thanks @juancodeaudio. + +# 2023-10-11, 11.11.2 + +- Fix #3025: improve handling of matrices and error handling + in function `corr` (#3030). Thanks @vrushaket. +- Fix #3074: improve error message when using function `max` in `derivative`. +- Fix #3073: fix parsing quotes inside a string. +- Fix #2027: cannot use named operators like `to` or `mod` as property name. + +# 2023-09-20, 11.11.1 + +- Fix #2989: use one-based indices in `print` in the parser (#3009). + Thanks @dvd101x. +- Fix #2936: `mod` sometimes giving wrong results due to internal round-off + errors (#3011). Thanks @praisennamonu1. +- Internal refactor of `quantileSeq`, and fixed the embedded help (#3003). + Thanks @dvd101x. +- Updated dependencies and devDependencies. + +# 2023-09-05, 11.11.0 + +- Implement function `corr` to calculate the correlation between two matrices + (#3015, #2624). Thanks @vrushaket. +- Lock `fraction.js` at version `4.3.4` for now, see #3024, 3022, + . + +# 2023-08-31, 11.10.1 + +- Upgrade to `fraction.js@4.3.4`, see #3022. +- Fix #3020: `lruQueue` using the global `hasOwnProperty` which may be + polluted. +- Add support for prefixes for the unit `erg`, and restrict prefixes of the + unit `joule` to only long prefixes like `kilo` and no short prefixes + like `k` (#3019). Thanks @costerwi. +- Add a new browser example `examples/browser/lorenz.html` that uses `solveODE` + and plots the result in a chart (#3018). Thanks @dvd101x. + +# 2023-08-23, 11.10.0 + +- Extend function `quantileSeq` with support for a `dimension` (#3002). + Thanks @dvd101x. +- Implement #2735: Support indexing with an array of booleans, for + example `a[[true, false, true]]` and `a[a > 2]` (#2994). Thanks @dvd101x. +- Implement function `zeta` (#2950, #2975, #2904). Thanks @Bobingstern. +- Fix #2990: `DenseMatrix` can mutate input arrays (#2991). + +# 2023-07-24, 11.9.1 + +- Fix a security vulnerability in `FunctionNode` and `SymbolNode` allowing + arbitrary code execution via `math.evaluate`. Thanks Harry Chen. +- Fix #3001: mathjs bundle containing `new Function(...)` (CSP issue). + +# 2023-07-19, 11.9.0 + +- Implement function `solveODE` (#2958). Thanks @dvd101x. +- Implement functions `zpk2tf` and `freqz` (#2988, #2969). Thanks @alykhaled. +- Implement support for units in function `range` (#2997). Thanks @dvd101x. +- Fix #2974: `simplify` puts plus and minus signs next to each other (#2981). + Thanks @MaybePixem. +- Fix #2973: fixes and improvements in the embedded docs (#2976). + Thanks @dvd101x. +- Fix #2996: two errors in the examples in the documentation about Expression + trees. +- Fix round-off errors near zero when converting temperatures (#2962). + Thanks @costerwi. +- Refactored function `range`, reducing the amount of code (#2995). + Thanks @dvd101x. + +# 2023-06-20, 11.8.2 + +- Fix #2971: improve typings of statistics functions `min`, `max`, `mean`, + `median`, `mode`, `std`, `sum`, `prod`, `variance`. Fixes a regression + introduced in v11.8.1. +- Fix #2972: type definitions of `Unit.divide(Unit)` have a wrong return type. + +# 2023-06-13, 11.8.1 + +- Fix #2964: issue in function `distance` when calculate the distance from + a point to a line (#2965). Thanks @Kiku-CN. +- Fix `math.format` not working correctly for `engineering` notation when using + BigNumbers and for `fixed` notation with `precision: 0` configured (#2956). + Thanks @mgreminger. +- Fix #2880: not possible to map cube root `cbrt`. +- Fix #2938: make the syntax description of all functions consistent in the + docs (#2941). Thanks @dvd101x. +- Fix #2954: improve the TypeScript definitions the return type of functions + `min` and `max` (#2955). Thanks @Maxim-Mazurok. +- Fix #2959: typo in an example in the docs. Thanks @kunalagrwl. +- Drop official support for Node.js 14, has reached end of life. + +# 2023-04-03, 11.8.0 + +- Extended functions `fraction`, `bignumber`, and `number` with support for + units, see #2918 (#2926). +- Implemented aliases `amp` and `amps` for unit `ampere` (#2917). + Thanks @veggiesaurus. +- Improve TypeScript definitions of function `gcd` (#2922). Thanks @brunoSnoww. +- Fix #2923: improve docs of the function `distance` (#2924). Thanks @tmtron. + +# 2023-03-15, 11.7.0 + +- Implement #2567: accept array as parameter for function `gcd` (#2878). + Thanks @jakubriegel. +- Fix #2908: improvements in the docs and examples of functions + `partitionSelect`, `diff`, `expm1`, `round`, `nthRoots`, `sign`, + `rigthArithShift`, `setIsSubset`, `setSize`, and the docs about units. + Thanks @tmtron. +- Fix #2907: determinant of empty matrix should be 1. +- Refactor index.d.ts by writing function declarations using a generic, + reducing a lot of repetition (#2913). Thanks @brunoSnoww. + +# 2023-02-24, 11.6.0 + +- Implement broadcasting for the following functions and their corresponding + operator: `add`, `dotDivide`, `dotMultiply`, `dotPow`, `gcd`, `lcm`, `mod`, + `nthRoot`, `subtract`, `bitAnd`, `bitOr`, `bitXor`, `leftShift`, + `rightArithShift`, `rightLogShift`, `and`, `or`, `xor`, `compare`, + `compareText`, `equal`, `larger`, `largerEq`, `smaller`, `smallerEq`, + `unequal`, `atan2` and `to` (#2895, #2753). Thanks @dvd101x. +- Implement support for non-power-of-2 fft (#2900, #2577). Thanks @cyavictor88. +- Fix #2888: update type definitions of function `unit` to allow creating a + unit from a fraction or complex number. +- Fix #2892: an error in the examples of the embedded help of function `sort`. +- Fix #2891: functions `column` and `row` sometimes returning a scalar number. +- Fix #2896: define the fourth argument of function `intersect` as optional + in the TypeScript definitions. Thanks @wodndb. +- Fix: quantileSeq not accepting a matrix as second argument `prob` (see #2902). +- Fix broken examples in functions `to`, `distance`, `getMatrixDataType`, + `subset`, and `max` (see #2902). + +# 2023-01-31, 11.5.1 + +- Add type definitions for function `rotationMatrix` (#2860). + Thanks @brunoSnoww. +- Add type signature for `lusolve(LUDecomposition, ...)` (#2864). + Thanks @evanmiller. +- Fix #2873: the rocket_trajectory_optimization.html example being partly + broken. Thanks @dvd101x. +- Fix #2871: coverage report broken (#2877). Thanks @bornova. +- Fix #2883: update documentation for stat functions, describe missing syntax. +- Fix #2884: fix examples in the embedded docs of function `pow` and some other + functions. +- Fix type definition of function `complex` for one numeric input (#2886), + thanks @ariymarkowitz. +- Fix type definitions of `map()` and `forEach()` (#2887), thanks @xiaohk. +- Fix #2606: improve type definitions of `dotMultiply`, `dotPow` and + `dotDivide` (#2890). Thanks @brunoSnoww. + +# 2022-12-05, 11.5.0 + +- Improve `simplify` rule matches in non-commutative contexts (#2841). + Thanks @samueltlg. +- Simplify: add rules and restructure tests for non-commutative contexts + (#2847). Thanks @samueltlg. +- Fix function `reshape` mutating the input in case of a matrix (see #2854). +- Fix TypeScript types for `multiply()` with `number[]` and `number[][]` + (#2852). Thanks @hfhchan. + +# 2022-11-18, 11.4.0 + +- Implemented more wildcards to describe rules for `simplify`, making it easier + for example to describe unary minus (#1915). Thanks @thatcomputerguy0101. +- Implemented functions `schur`, `sylvester`, and `lyap` (#2646). + Thanks @egidioln. +- Implemented function `polynomialRoot`, and use it in a benchmark (#2839). + Thanks @gwhitney. +- Fix #2825 partly: improve simplifying operations on constants in + non-commutative contexts (#2827). Thanks @samueltlg. +- Fix #2840: a bug in the docs and type definitions of `Node.traverse` and + `Node.forEach`, they do return `void`. + +# 2022-11-07, 11.3.3 + +- Fix #2830: Prevent inserting zero values when creating a `SparseMatrix` from a + `DenseMatrix` (#2836). Thanks @AlexandreAlvesDB. +- Fix #2835: a regression in the type definitions of `FunctionNode`, introduced + in `v11.3.2`. See #2733. Thanks @dsteve. + +# 2022-10-25, 11.3.2 + +- Add generics to remaining Node type definitions (#2733). Thanks @mattvague. +- Allow unit prefixes for (absolute) temperatures `kelvin`, `rankine`, + `celsius`, and `fahrenheit` (#2824). Thanks @jfeist + +# 2022-10-19, 11.3.1 + +- Fix #2809: code completion issues in some IDE's (#2812). +- Fix #2818: throw an error when a function assignment has duplicate + parameter names (#2819). +- Update `decimal.js` to version `10.4.2`. + +# 2022-10-11, 11.3.0 + +- Allow creating new subclasses of `Node` in TypeScript (#2772). + Note that this disables being able to narrow MathNodes by using the `.type` + property. Use typeguards like `isOperatorNode(...)` instead (see #2810). + Thanks @mattvague. +- Fix #2793: `flatten()` cloning entries of array/Matrix (#2799). +- Fix #2627: TypeScript definitions of `pinv` missing (#2804). + Thanks @HanchaiN. +- Update dependencies to `decimal.js@10.4.1`. + +# 2022-09-13, 11.2.1 + +- Fix doc generator being broken, not generating a function reference. + +# 2022-09-12, 11.2.0 + +- Implement function `isRelationalNode` (#2731). Thanks @isaacbyr. +- Added missing types `'largerEq'` and `'or'` in `OperatorNodeMap` in the + TypeScript definitions. Thanks @ajinkyac03. +- Fixed typos in min func type defs (#2768). Thanks @mabdullahadeel. +- Improved the TypeScript definitions for `pickRandom`. Thanks @mattvague. +- Fixed documentation of unit `min` which means `minutes`, not `minim` (#2773). + Thanks @jasonhornsby. + +# 2022-08-23, 11.1.0 + +- Add Unit constructor from value and pure (valueless) Unit (#2628). + Thanks @costerwi +- Fix #2144: `examples/advanced/custom_loading.js` was broken. +- Fix JSON `replacer` function missing in the TypeScript definitions. + Thanks @mattvague. +- Update dependencies to `typed-function@4.1.0` and `decimal.js@10.4.0`. + +# 2022-07-25, version 11.0.1 + +- Fix #2632: TypeScript issue of `simplifyConstant` and `simplifyCore` + not having a return type defined. + +# 2022-07-23, version 11.0.0 + +!!! BE CAREFUL: BREAKING CHANGES !!! + +Breaking changes: + +- Dropped official support for IE11. +- Upgraded to `typed-function@3`, see [josdejong/typed-function/HISTORY.md](https://github.com/josdejong/typed-function/blob/develop/HISTORY.md#2022-05-12-version-300). Thanks @gwhitney. Most importantly: + - Conversions now have preference over `any`. + - The `this` variable is no longer bound to the typed function itself. + - The properties `typed.types`, `typed.conversions`, and `typed.ignore` + have been removed. + - There are new static functions available like `typed.referTo`, + `typed.referToSelf`, `typed.addTypes`, `typed.addConversions`. +- Implement amended "Rule 2" for implicit multiplication (#2370, #2460): + when having a division followed by an implicit multiplication, the division + gets higher precedence over the implicit multiplication when (a) the + numerator is a constant with optionally a prefix operator (`-`, `+`, `~`), + and (b) the denominator is a constant. For example: formerly `-1 / 2 x` was + interpreted as `-1 / (2 * x)` and now it is interpreted as `(-1 / 2) * x`. + Thanks @gwhitney. +- Drop elementwise matrix support for trigonometric functions, exp, log, gamma, + square, sqrt, cube, and cbrt to prevent confusion with standard matrix + functions (#2440, #2465). Instead, use `math.map(matrix, fn)`. + Thanks @gwhitney. +- Simplify: convert equivalent function calls into operators, for example, + `add(2, x)` will now be simplified into `2 + x` (#2415, #2466). + Thanks @gwhitney. +- Removed the automatic conversion from `number` to `string` (#2482). + Thanks @gwhitney. +- Fix #2412: let function `diff` return an empty matrix when the input contains + only one element (#2422). +- Internal refactoring in the `simplifyCore` logic (#2490, #2484, #2459). + The function `simplifyCore` will no longer (partially) merge constants, that + behavior has been moved to `simplifyConstant`. The combination of + `simplifyConstant` and `simplifyCore` is still close to the old behavior + of `simplifyCore`, but there are some differences. To reproduce the same + behavior as the old `simplifyCore`, you can use + `math.simplify(expr, [math.simplifyCore, math.simplifyConstant])`. + Thanks to the refactoring, `simplify` is more thorough in reducing constants. + Thanks @gwhitney. +- Disable support for splitting rest parameters in chained calculations + (#2485, #2474). For example: `math.chain(3).max(4, 2).done()` will now throw + an error rather than return `4`, because the rest parameter of + `math.max(...number)` has been split between the contents of the chain and + the arguments to the max call. Thanks @gwhitney. +- Function `typeOf` now returns `function` (lowercase) for a function instead + of `Function` (#2560). Thanks @gwhitney. + +Non-breaking changes: + +- Fix #2600: improve the TypeScript definitions of `simplify`. + Thanks @laureen-m and @mattvague. +- Fix #2607: improve type definition of `createUnit`. Thanks @egziko. +- Fix #2608: clarify the docs on the need to configure a smaller `epsilon` + when using BigNumbers. +- Fix #2613: describe matrix methods `get` and `set` in the docs. +- Fix link to `math.rationalize` in the docs (#2616). Thanks @nukisman. +- Fix #2621: add TypeScript definitions for `count` (#2622). Thanks @Hansuku. +- Improved TypeScript definitions of `multiply` (#2623). Thanks @Windrill. + +# 2022-06-28, version 10.6.4 + +- Improve TypeScript definitions of the `factory` function, thanks @mattvague. + +# 2022-06-24, version 10.6.3 + +- Revert the TypeScript definition fixes for `factory` applied in `v10.6.2`, + they give some complications. + +# 2022-06-24, version 10.6.2 + +- Improve TypeScript definitions of `ParenthesisNode`. Thanks @mattvague. +- Change the TypeScript definition of `MathNodeCommon['type']` into a less + strict string, so it is possible to extend with new Node classes. + Thanks @mattvague. +- Improve TypeScript definitions of the `factory` function, thanks @mattvague. + +# 2022-05-31, version 10.6.1 + +- Improve the TypeScript types For `OperatorNode`: you can now define generic + types like `OperatorNode<'+', 'add'>`. Thanks @mattvague. + +# 2022-05-24, version 10.6.0 + +- Implementation of Fourier transform functions `fft` and `ifft` (#2540). + Thanks @HanchaiN. +- Fix TypeScript types not being listed in the exported fields (#2569). + Thanks @mattvague. +- Large improvements in TypeScript definitions for chained expressions (#2537). + Thanks @mattvague. +- Fix #2571: improve TypeScript definition of functions `clone` and `cloneDeep` + (#2572). Thanks @mattvague. +- Fix the first argument of `derivative` holding the expression not correctly + being converted when using `.toTex()` (#2564). Thanks @mattvague. + +# 2022-05-11, version 10.5.3 + +- Fix #2337: npm package containing examples and docs to solve security + vulnerabilities being reported on the examples and their dependencies. +- Fix core, construction, and some other functions missing in docs. +- Drop official support for Node.js 12 which has reached its end of life. + +# 2022-05-09, version 10.5.2 + +- Fix #2553: `@types/mocha` defined in `dependencies` instead of + `devDependencies`, causing problems in projects that use a different version + of this dependency. Thanks @Kolahzary. +- Fix #2550: remove `examples/node_modules` folder from the npm package. +- Fix #2528: improve contribution guidelines (#2548). +- Document `SymbolNode.onUndefinedSymbol` and + `FunctionNode.onUndefinedFunction`. + +# 2022-05-02, version 10.5.1 + +- Fix #2526, #2529: improve TypeScript definitions of function `round`, `fix`, + `floor`, `ceil`, and `nthRoot`, and improved the number only implementations + of those functions (#2531, #2539). Thanks @simlaticak and @gwhitney. +- Fix #2532: matrix index symbol `end` not working when used inside + a sub-expression. +- Fix #2524: In generating AUTHORS list, ignore a list of specific commits + (e.g., to avoid spurious duplicates in list). (#2543) +- Add type definitions of function `resolve` (#2536). Thanks @mattvague. + +# 2022-04-19, version 10.5.0 + +- Implement #1563: function `pinv`, Moore–Penrose inverse (#2521). + Thanks @HanchaiN. +- Optimize function `det` for integers by switching to the Bareiss algorithm: + no more round-off errors for integer input (#2516). Thanks @HanchaiN. +- Implement #2463: allow negative integer powers of invertible square matrices + (#2517). Thanks @HanchaiN. +- Implement the `lgamma` function (defined as log(gamma(z))) for number and + Complex types. Supersedes #320. (#2417). Thanks @yifanwww. +- Fix #2523: update to the latest complex.js to improve `sin(z)` for small + `im(z)` (#2525). Thanks @gwhitney. +- Fix #2526: update TypeScript definition of `ceil` (#2531). Thanks @simlaticak +- Change mocha reporter to 'dot' to avoid excessively long log files. (#2520) + +# 2022-04-08, version 10.4.3 + +- Fix #2508: improve the precision of stirlingS2 (#2509). Thanks @gwhitney. +- Fix #2514: implement optional argument `base` in the number implementation + of function `log` (#2515). Thanks @gwhitney. +- Improve the documentation on operator `;` (#2512). Thanks @gwhitney. + +# 2022-03-29, version 10.4.2 + +- Fix #2499: different behavior for unit conversion "degC" and "K" (#2501). + Also disables getting the sign for units with an offset, which is ambiguous. + Thanks @gwhitney. +- Fix #2503: fix an issue in `log()` for complex numbers in which the imaginary + part is much larger in absolute value than the real part, fixed in + `complex.js@2.1.0` (#2505), thanks @gwhitney, @infusion. +- Fix #2493: unclear error message when an entity that is not a function + is being called as a function (#2494). Thanks @gwhitney. +- Some fixes in the docs on units (#2498). Thanks @dvd101x. +- Add `forEach` example in embedded docs (#2507). Thanks @dvd101x. +- Correct approx.deepEqual() to accept an epsilon argument giving the + comparison tolerance. It was already being called this way, but was + silently ignoring the tolerance. Thanks @yifanwww. + +# 2022-03-23, version 10.4.1 + +- Improve TypeScript definitions for function `unit` (#2479). + Thanks @SinanAkkoyun. +- Add tests for type declarations (#2448). Thanks @samestep. +- Further improvement to TypeScript definitions of `std` and `variance` + (make dimension parameter optional, #2474). Thanks @NattapongSiri. +- Next step (as per #2431) for full publication of "is" functions like + `isMatrix` etc: Provide TypeScript definitions of "is" functions and + make them type guards. (#2432). Thanks @ChristopherChudzicki. +- Fix #2491: Multi line object expressions don't work with comments (#2492). + Thanks @gwhitney. +- Fix #2478: a bug in calculating the eigenvectors when dealing with complex + numbers (#2496). Thanks @gwhitney. +- Update project dependencies and devDependencies. + +# 2022-03-07, version 10.4.0 + +- Fix #2461: make sure `simplifyCore` recurses over all binary nodes (#2462). + Thanks @gwhitney. +- Fix #2429: fix the TypeScript definitions of functions `std` and `variance` + (#2455). Thanks @NattapongSiri. +- Fix #1633: implement a `cumsum` function generating cumulative sums of a list + of values or a matrix. (#1870). Thanks @hjonasson. +- Upgrade to the latest version of `Fraction.js`, having more strict input, + only accepting an integer numerator and denominator. See #2427. +- Fix typo in documentation example for `format`. (#2468) Thanks @abranhe. +- Write unit tests for all jsdoc examples. See #2452. Thanks @gwhitney. + +# 2021-03-02, version 10.3.0 + +- Fix #1260: implement function `symbolicEqual` (#2424). Thanks @gwhitney. +- Fix #2441, #2442: support passing a function as argument to functions created + in the expression parser (#2443). Thanks @gwhitney. +- Fix #2325: improve documentation of subset indices (#2446). Thanks @gwhitney. +- Fix #2439: fix a bug in `complexEigs` in which real-valued norms were + inadvertently being typed as complex numbers (#2445). Thanks @gwhitney. +- Fix #2436: improve documentation and error message of function `map` (#2457). + Thanks @gwhitney. + +# 2022-03-01, version 10.2.0 + +- Implemented context options to control simplifications allowed in `simplify`, + see #2399, #2391. Thanks @gwhitney. +- Implemented function `leafCount` as a first simple measure of the complexity + of an expression, see #2411, #2389. Thanks @gwhitney. +- Fix #2413: improve `combinations` to return an integer result without rounding + errors for larger values, see #2414. Thanks @gwhitney. +- Fix #2385: function `rotate` missing in TypeScript definitions. + Thanks @DIVYA-19. +- Fix #2450: Add BigNumber to parameter type in `math.unit` and add TypeScript + types for `Unit.simplify` and `Unit.units` (#2353). Thanks @joshhansen. +- Fix #2383: detect infinite loops in `simplify` (#2405). Thanks @gwhitney. +- Fix #1423: collect like factors and cancel like terms in sums (#2388). + Thanks @gwhitney. + +# 2022-02-02, version 10.1.1 + +- Improvements and fixes in function `simplify`, thanks @gwhitney: + - Fix #2393: regression bug in `simplify('2-(x+1)')`. + - Ad option `consoleDebug` to `simplify` to see what is going on. +- Fix TypeScript definition of `ConfigOptions`, which was missing option + `predictable`. + +# 2022-01-15, version 10.1.0 + +- Implemented function `invmod`, see #2368, #1744. Thanks @thetazero. +- Improvements and fixes in function `simplify`, thanks @gwhitney: + - Fix #1179, #1290: improve collection of non-constant like terms (#2384). + - Fix #2152: do not transform strings into numbers (#2372). + - Fix #1913: implement support for array and object simplification (#2382). +- Fix #2379: add embedded documentation for function `print`. +- Remove broken example from the embedded documentation of function `forEach`. + +# 2021-12-29, version 10.0.2 + +- Fix #2156: simplify expressions like `-1 / (-x)` to `1/x`. Thanks @ony3000. +- Fix #2363: remove a redundant part of the regex to split a number. +- Fix #2291: add support for fractions in function `intersect`. + Thanks @thetazero. +- Fix #2358: bug in `SparseMatrix` when replacing a subset of a matrix with + a non-consecutive index. Thanks @Al-0. + +# 2021-12-22, version 10.0.1 + +- Fix #1681: function `gamma` giving inaccurate complex results in some cases. + Thanks @kmdrGroch. +- Fixed a typo in an example, see #2366. Thanks @blackwindforce. + +# 2021-11-03, version 10.0.0 + +!!! BE CAREFUL: BREAKING CHANGES IN THE TYPESCRIPT DEFINITIONS !!! + +- Improvements to the Typescript typings (commit fc5c202e). + Thanks @joshhansen. First introduced in v9.5.1, but reverted because + it contains breaking changes. + + Breaking changes: interface `MathNode` is now renamed to `MathNodeCommon` + and the related interfaces are structured in a different way. + +- Fixed a typo in the TypeScript definition of toHTML. Thanks @TheToto. + +# 2021-11-03, version 9.5.2` + +- Revert the improvements to the Typescript typings because they contain + breaking changes. The improvements will be published in v10.0.0. See #2339. + +# 2021-10-13, version 9.5.1 + +- Various improvements to the Typescript typings. + Thanks @joshhansen and @DianaTdr. + +# 2021-09-22, version 9.5.0 + +- Implemented support for calculations with percentage, see #2303. + Thanks @rvramesh. +- Fix #2319: make the API of `Parser.evaluate` consistent with `math.evaluate`: + support a list with expressions as input. +- Improved documentation of function `setCartesian`. Thanks @fieldfoxWim. + +# 2021-09-15, version 9.4.5 + +- Improved the performance of `Node.equals` by improving the internal + function `deepStrictEqual`. Thanks @tomlarkworthy. +- Fixes in the TypeScript definitions: + - Define `hasNumericValue`. Thanks @write2kcl. + - Define `MathNode.isRelationalNode`. Thanks @m93a. + - Fix typo in `MathNode.isConditionalNode`. Thanks @m93a. + +# 2021-07-07, version 9.4.4 + +- Fixed `ArrayNode.toTex()`: remove the row delimiter on the last row, + see #2267. Thanks @davidtranhq. +- Fix #2269: `intersect` not returning `null` for matrix input. Thanks @m93a. +- Fix #2245: mathjs not working in IE11 anymore due to a missing polyfill for + `Symbol`. The browser bundle now includes the necessary polyfills (it is + larger now because of that, see also #2266). Thanks @m93a. +- Update dependencies (`complex.js@2.0.15`, `decimal.js@10.3.1`) +- Drop official support for node.js 10, which has reached end of life. + See #2258. + +# 2021-06-23, version 9.4.3 + +- Fix #2222: mathjs polluting the `Decimal` prototype. Thanks @m93a. +- Fix #2253: expression parser throwing an error when accessing nested object + properties named `e`. +- Fixes in the TypeScript definitions: + - function `floor`, #2159, #2246. Thanks @write2kcl. + - function `simplify`, see #2252. Thanks @nitroin. +- Upgraded to `decimal.js@10.3.0` + +# 2021-06-05, version 9.4.2 + +- Implemented iterative eigenvalue finder for `eigs`, making it much more + robust. See #2179, #2237. Thanks @m93a. +- Improved TypeScript definitions of function `parse`. Thanks @OpportunityLiu. + +# 2021-05-24, version 9.4.1 + +- Fix #2100: add TypeScript declaration for `eigs`. Thanks @andrebianchessi. +- Fix #2220: add TypeScript files to published npm package. Thanks @dhritzkiv. +- Update readme regarding TypeScript definition files. Thanks @dhritzkiv. +- Update to `fraction.js@4.1.1` + +# 2021-05-16, version 9.4.0 + +- Implemented support to use objects with a `Map` interface as scope, + see #2143, #2166. Thanks @jhugman. +- Extend `eigs` to support general complex matrices, see #1741. Thanks @m93a. +- DenseMatrix and SparseMatrix are now iterable, see #1184. Thanks @m93a. +- Implemented utility functions `matrixFromRows`, `matrixFromColumns`, and + `matrixFromFunction`, see #2155, #2153. Thanks @m93a. +- Added TypeScript definitions to the project, making it redundant to install + `@types/mathjs`, and making it easier to improve the definitions. See #2187, + #2192. Thanks @CatsMiaow. +- Upgraded dependencies + - `complex.js@2.0.13` (fixing #2211). Thanks @infusion + - `fraction.js@4.1.0` (`pow` now supporting rational exponents). +- Fix #2174: function `pickRandom` having no name. Thanks @HK-SHAO. +- Fix #2019: VSCode auto import keeps adding import { null } from 'mathjs'. +- Fix #2185: Fix TypeScript definition of unit division, which can also return + a number. +- Fix #2123: add type definitions for functions `row` and `column`. +- Fix some files not exposed in the package, see #2213. Thanks @javiermarinros. + +# 2021-04-12, version 9.3.2 + +- Fix #2169: mathjs requesting `@babel/runtime` dependency. + Regression introduced in `v9.3.1`. + +# 2021-04-10, version 9.3.1 + +- Fix #2133: strongly improved the performance of `isPrime`, see #2139. + Thanks @Yaffle. +- Fix #2150: give a clear error "Error: Undefined function ..." instead when + evaluating a non-existing function. +- Fix #660: expose internal functions `FunctionNode.onUndefinedFunction(name)` + and `SymbolNode.onUndefinedSymbol(name)`, allowing to override the behavior. + By default, an Error is thrown. + +# 2021-03-10, version 9.3.0 + +- Implemented support for parsing non decimal numbers with radix point, + see #2122, #2121. Thanks @clnhlzmn. +- Fix #2128: typo in docs of `luSolveAll` and `usolveAll`. + +# 2021-02-03, version 9.2.0 + +- Implemented function `count` to count the total elements in a matrix, + see #2085. Thanks @Josef37. +- Fix #2096: cleanup old reference to external dependency `crypto`. +- Some refactoring in the code to remove duplications, see #2093. + Thanks @Josef37. + +# 2021-01-27, version 9.1.0 + +- Extended function `reshape` with support for a wildcard `-1` to automatically + calculate the remaining size, like `reshape([1, 2, 3, 4, 5, 6], [-1, 2])` + which will output `[[0, 1], [2, 3], [4, 5]]`. See #2075. Thanks @Josef37. +- Fix #2087: function `simplify` ignores second argument of `log`, for example + in `simplify('log(e, 9)')` . Thanks @quentintruong. + +# 2021-01-16, version 9.0.0 + +- Improved support for bin, hex, and oct literals. See #1996. Thanks @clnhlzmn. + - **Breaking change**: parse literals with prefixes `0b`, `0c`, and `0x` are + now unsigned by default. To parse them as signed, you have to specify a + suffix specifying the word size such as `i16` or `i32`. + - Function `format` now supports more notations: `bin`, 'hex', and `oct`, + for example `format(255, {notation: "hex"})`. + - The functions `format`, `bin`, `hex`, `oct` now allow specifying a wordSize, + like `bin(10, 32)` and `format(10, {notation: "bin", wordSize: 32})`. + - BigNumber support for the bin, hex, and oct literals. +- Extended and improved the example rocket_trajectory_optimization.html. + Thanks @Josef37. + +# 2020-12-30, version 8.1.1 + +- Improved the performance of parsing and evaluating units a lot, see #2065. + Thanks @flaviut. +- Upgraded dependency `fraction.js` to `v4.0.13`. +- Moved continuous integration testing from Travis CI to Github Workflow, + see #2024, #2041. Thanks @harrysarson. + +# 2020-12-04, version 8.1.0 + +- Implemented units `kilogramforce` (`kgf`). Thanks @rnd-debug. +- Fix #2026: Implement a new option `fractionsLimit` for function `simplify`, + defaulting to `Infinity`. +- Improved the documentation of function `clone`. Thanks @redbar0n. + +# 2020-11-09, version 8.0.1 + +- Fix #1979: missing "subset" dependency when using "mathjs/number" entry point. +- Fix #2022: update pretty printing with MathJax example to the latest version + of MathJax. Thanks @pkra. + +# 2020-11-06, version 8.0.0 + +!!! BE CAREFUL: BREAKING CHANGES !!! + +- You can now use mathjs directly in node.js using ES modules without need for + a transpiler (see #1928, #1941, #1962). + Automatically loading either commonjs code or ES modules code is improved. + All generated code is moved under `/lib`: the browser bundle is moved from + `/dist` to `/lib/browser`, ES module files are moved to `/lib/esm`, + and commonjs files are moved to `/lib/cjs`. Thanks @GreenImp. +- Non-minified bundle `dist/math.js` is no longer provided. Either use the + minified bundle, or create a bundle yourself. +- Replaced random library `seed-random` with `seedrandom`, see #1955. + Thanks @poppinlp. +- Breaking changes in `pickRandom`, see #1990, #1976. + - Will no longer return the input matrix when the given number is greater + than the length of the provided possibles. Instead, the function always + returns results with the requested number of picks. + - Will now return a `Matrix` as output when input was a `Matrix`. + - Introduced a new syntax: + + ``` + math.pickRandom(array, { weights, number, elementWise }) + ``` + + - Introduced a new option `elementWise`, which is `true` by default. + When setting `elementWise` to false, an array containing arrays will return + random pick of arrays instead of the elements inside of the nested arrays. + +# 2020-11-02, version 7.6.0 + +- Implemented function `rotate(w, theta)`. See #1992, #1160. Thanks @rnd-debug. +- Implemented support for custom characters in Units via `Unit.isValidAlpha`. + See #1663, #2000. Thanks @rnd-debug. + +# 2020-10-10, version 7.5.1 + +- Fix object pollution vulnerability in `math.config`. Thanks Snyk. + +# 2020-10-07, version 7.5.0 + +- Function `pickRandom` now allows randomly picking elements from matrices + with 2 or more dimensions instead of only from a vector, see #1974. + Thanks @KonradLinkowski. + +# 2020-10-07, version 7.4.0 + +- Implemented support for passing a precision in functions `ceil`, `floor`, + and `fix`, similar to `round`, see #1967, #1901. Thanks @rnd-debug. +- Implemented function `rotationMatrix`, see #1160, #1984. Thanks @rnd-debug. +- Implement a clear error message when using `sqrtm` with a matrix having + more than two dimensions. Thanks @KonradLinkowski. +- Update dependency `decimal.js` to `10.2.1`. + +# 2020-09-26, version 7.3.0 + +- Implemented functions `usolveAll` and `lsolveAll`, see #1916. Thanks @m93a. +- Implemented support for units in functions `std` and `variance`, see #1950. + Thanks @rnd-debug. +- Implemented support for binary, octal, and hexadecimal notation in the + expression parser, and implemented functions `bin`, `oct`, and `hex` for + formatting. Thanks @clnhlzmn. +- Fix #1964: inconsistent calculation of negative dividend modulo for + `BigNumber` and `Fraction`. Thanks @ovk. + +# 2020-08-24, version 7.2.0 + +- Implemented new function `diff`, see #1634, #1920. Thanks @Veeloxfire. +- Implemented support for norm 2 for matrices in function `norm`. + Thanks @rnd-debug. + +# 2020-07-13, version 7.1.0 + +- Implement support for recursion (self-referencing) of typed-functions, + new in `typed-function@2.0.0`. This fixes #1885: functions which where + extended with a new data type did not always work. Thanks @nickewing. +- Fix #1899: documentation on expression trees still using old namespace + `math.expression.node.*` instead of `math.*`. + +# 2020-06-24, version 7.0.2 + +- Fix #1882: have `DenseMatrix.resize` and `SparseMatrix.resize` accept + `DenseMatrix` and `SparseMatrix` as inputs too, not only `Array`. +- Fix functions `sum`, `prod`, `min`, and `max` not throwing a conversion error + when passing a single string, like `sum("abc")`. + +# 2020-05-30, version 7.0.1 + +- Fix #1844: clarify the documentation of function `eigs`. Thanks @Lazersmoke. +- Fix #1855: Fix error in the documentation for `math.nthRoots(x)`. +- Fix #1856: make the library robust against Object prototype pollution. + +# 2020-05-07, version 7.0.0 + +Breaking changes: + +- Improvements in calculation of the `dot` product of complex values. + The first argument is now conjugated. See #1761. Thanks @m93a. +- Dropped official support for Node.js v8 which has reached end of life. +- Removed all deprecation warnings introduced in v6. + To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first + and resolve all deprecation warnings. + +# 2020-05-04, version 6.6.5 + +- Fix #1834: value `Infinity` cannot be serialized and deserialized. + This is solved now with a new `math.replacer` function used as + `JSON.stringify(value, math.replacer)`. +- Fix #1842: value `Infinity` not turned into the latex symbol `\\infty`. + +# 2020-04-15, version 6.6.4 + +- Fix published files containing Windows line endings (CRLF instead of LF). + +# 2020-04-10, version 6.6.3 + +- Fix #1813: bug in engineering notation for numbers of function `format`, + sometimes resulting in needless trailing zeros. +- Fix #1808: methods `.toNumber()` and `.toNumeric()` not working on a + unitless unit. +- Fix #1645: not being able to use named operators `mod`, `and`, `not`, `or`, + `xor`, `to`, `in` as object keys. Thanks @Veeloxfire. +- Fix `eigs` not using `config.epsilon`. + +# 2020-03-29, version 6.6.2 + +- Fix #1789: Function `eigs` not calculating with BigNumber precision + when input contains BigNumbers. +- Run the build script during npm `prepare`, so you can use the library + directly when installing directly from git. See #1751. Thanks @cinderblock. + +# 2020-02-26, version 6.6.1 + +- Fix #1725: simplify `a/(b/c)`. Thanks @dbramwell. +- Fix examples in documentation of `row` and `column`. + +# 2020-02-01, version 6.6.0 + +- Implemented function `eigs`, see #1705, #542 #1175. Thanks @arkajitmandal. +- Fixed #1727: validate matrix size when creating a `DenseMatrix` using + `fromJSON`. +- Fixed `DenseMatrix.map` copying the size and datatype from the original + matrix instead of checking the returned dimensions and type of the callback. +- Add a caret to dependencies (like) `^1.2.3`) to allow downstream updates + without having to await a new release of mathjs. + +# 2020-01-08, version 6.5.0 + +- Implemented `baseName` option for `createUnit`, see #1707. + Thanks @ericman314. + +# 2020-01-06, version 6.4.0 + +- Extended function `dimension` with support for n-dimensional points. + Thanks @Veeloxfire. + +# 2019-12-31, version 6.3.0 + +- Improved performance of `factorial` for `BigNumber` up to a factor two, + see #1687. Thanks @kmdrGroch. + +# 2019-11-20, version 6.2.5 + +- Fixed `IndexNode` using a hardcoded, one-based implementation of `index`, + making it impossible to instantiate a zero-based version of the expression + parser. See #782. + +# 2019-11-20, version 6.2.4 + +- Fixed #1669: function 'qr' threw an error if the pivot was zero, + thanks @kevinkelleher12 and @harrysarson. +- Resolves #942: remove misleading assert in 'qr'. Thanks @harrysarson. +- Work around a bug in complex.js where `sign(0)` returns complex NaN. + Thanks @harrysarson. + +# 2019-10-06, version 6.2.3 + +- Fixed #1640: function `mean` not working for units. Thanks @clintonc. +- Fixed #1639: function `min` listed twice in the "See also" section of the + embedded docs of function `std`. +- Improved performance of `isPrime`, see #1641. Thanks @arguiot. + +# 2019-09-23, version 6.2.2 + +- Fixed methods `map` and `clone` not copying the `dotNotation` property of + `IndexNode`. Thanks @rianmcguire. +- Fixed a typo in the documentation of `toHTML`. Thanks @maytanthegeek. +- Fixed #1615: error in the docs of `isNumeric`. +- Fixed #1628: Cannot call methods on empty strings or numbers with value `0`. + +# 2019-08-31, version 6.2.1 + +- Fixed #1606: function `format` not working for expressions. + +# 2019-08-28, version 6.2.0 + +- Improved performance of `combinationsWithRep`. Thanks @waseemyusuf. +- Add unit aliases `bit` and `byte`. +- Fix docs referring to `bit` and `byte` instead of `bits` and `bytes`. +- Updated dependency `typed-function@1.1.1`. + +# 2019-08-17, version 6.1.0 + +- Implemented function `combinationsWithRep` (see #1329). Thanks @waseemyusuf. + +# 2019-08-05, version 6.0.4 + +- Fixed #1554, #1565: ES Modules where not transpiled to ES5, giving issues on + old browsers. Thanks @mockdeep for helping to find a solution. + +# 2019-07-07, version 6.0.3 + +- Add `unpkg` and `jsdelivr` fields in package.json pointing to UMD build. + Thanks @tmcw. +- Fix #1550: nested user defined function not receiving variables of an + outer user defined function. + +# 2019-06-11, version 6.0.2 + +- Fix not being able to set configuration after disabling function `import` + (regression since v6.0.0). + +# 2019-06-09, version 6.0.1 + +- Fix function reference not published in npm library. +- Fix function `evaluate` and `parse` missing in generated docs. + +# 2019-06-08, version 6.0.0 + +!!! BE CAREFUL: BREAKING CHANGES !!! + +### Most notable changes + +1. Full support for **ES modules**. Support for tree-shaking out of the box. + + Load all functions: + + ```js + import * as math from 'mathjs' + ``` + + Use a few functions: + + ```js + import { add, multiply } from 'mathjs' + ``` + + Load all functions with custom configuration: + + ```js + import { create, all } from 'mathjs' + const config = { number: 'BigNumber' } + const math = create(all, config) + ``` + + Load a few functions with custom configuration: + + ```js + import { create, addDependencies, multiplyDependencies } from 'mathjs' + const config = { number: 'BigNumber' } + const { add, multiply } = create({ + addDependencies, + multiplyDependencies + }, config) + ``` + +2. Support for **lightweight, number-only** implementations of all functions: + + ``` + import { add, multiply } from 'mathjs/number' + ``` + +3. New **dependency injection** solution used under the hood. + +### Breaking changes + +- Node 6 is no longer supported. + +- Functions `config` and `import` are not available anymore in the global + context: + + ```js + // v5 + import * as mathjs from 'mathjs' + mathjs.config(...) // error in v6.0.0 + mathjs.import(...) // error in v6.0.0 + ``` + + Instead, create your own mathjs instance and pass config and imports + there: + + ```js + // v6 + import { create, all } from 'mathjs' + const config = { number: 'BigNumber' } + const mathjs = create(all, config) + mathjs.import(...) + ``` + +- Renamed function `typeof` to `typeOf`, `var` to `variance`, + and `eval` to `evaluate`. (the old function names are reserved keywords + which can not be used as a variable name). +- Deprecated the `Matrix.storage` function. Use `math.matrix` instead to create + a matrix. +- Deprecated function `math.expression.parse`, use `math.parse` instead. + Was used before for example to customize supported characters by replacing + `math.parse.isAlpha`. +- Moved all classes like `math.type.Unit` and `math.expression.Parser` to + `math.Unit` and `math.Parser` respectively. +- Fixed #1428: transform iterating over replaced nodes. New behavior + is that it stops iterating when a node is replaced. +- Dropped support for renaming factory functions when importing them. +- Dropped fake BigNumber support of function `erf`. +- Removed all index.js files used to load specific functions instead of all, like: + + ``` + // v5 + // ... set up empty instance of mathjs, then load a set of functions: + math.import(require('mathjs/lib/function/arithmetic')) + ``` + + Individual functions are now loaded simply like: + + ```js + // v6 + import { add, multiply } from 'mathjs' + ``` + + To set a specific configuration on the functions: + + ```js + // v6 + import { create, addDependencies, multiplyDependencies } from 'mathjs' + const config = { number: 'BigNumber' } + const math = create({ addDependencies, multiplyDependencies }, config) + ``` + + See example `advanced/custom_loading.js`. + +- Updated the values of all physical units to their latest official values. + See #1529. Thanks @ericman314. + +### Non breaking changes + +- Implemented units `t`, `tonne`, `bel`, `decibel`, `dB`, and prefixes + for `candela`. Thanks @mcvladthegoat. +- Fixed `epsilon` setting being applied globally to Complex numbers. +- Fix `math.simplify('add(2, 3)')` throwing an error. +- Fix #1530: number formatting first applied `lowerExp` and `upperExp` + and after that rounded the value instead of the other way around. +- Fix #1473: remove `'use strict'` in every file, not needed anymore. + +# 2019-05-18, version 5.10.3 + +- Fixed dependency `del` being a dependency instead of devDependency. + +# 2019-05-18, version 5.10.2 + +- Fix #1515, #1516, #1517: broken package due to a naming conflict in + the build folder of a util file `typeOf.js` and `typeof.js`. + Solved by properly cleaning all build folders before building. + +# 2019-05-17, version 5.10.1 + +- Fix #1512: format using notation `engineering` can give wrong results + when the value has less significant digits than the number of digits in + the output. + +# 2019-05-08, version 5.10.0 + +- Fix `lib/header.js` not having filled in date and version. Thanks @kevjin. +- Upgraded dependency `decimal.js@10.2.0`, fixing an issue on node.js 12. + +# 2019-04-08, version 5.9.0 + +- Implemented functions `row` and `column` (see #1413). Thanks @SzechuanSage. +- Fixed #1459: `engineering` notation of function `format` not available + for `BigNumber`. +- Fixed #1465: `node.toHTML()` not correct for unary operators like + `factorial`. + +# 2019-03-20, version 5.8.0 + +- Implemented new function `apply`. Thanks @bnlcas. +- Implemented passing an optional `dimension` argument to `std` and `var`. + Thanks @bnlcas. + +# 2019-03-10, version 5.7.0 + +- Implemented support for `pow()` in `derivative`. Thanks @sam-19. +- Gracefully handle round-off errors in fix, ceil, floor, and range + (Fixes #1429, see also #1434, #1432). Thanks @ericman314. + +# 2019-03-02, version 5.6.0 + +- Upgrade decimal.js to v10.1.1 (#1421). +- Fixed #1418: missing whitespace when stringifying an expression + containing "not". + +# 2019-02-20, version 5.5.0 + +- Fixed #1401: methods `map` and `forEach` of `SparseMatrix` not working + correctly when indexes are unordered. +- Fixed #1404: inconsistent rounding of negative numbers. +- Upgrade tiny-emitter to v2.1.0 (#1397). + +# 2019-01-25, version 5.4.2 + +- Fixed `math.format` not working for BigNumbers with a precision above + 1025 digits (see #1385). Thanks @ericman314. +- Fixed incorrect LaTeX output of `RelationalNode`. Thanks @rianmcguire. +- Fixed a bug the methods `map`, `forEach`, `traverse`, and `transform` + of `FunctionNode`. + +# 2019-01-10, version 5.4.1 + +- Fix #1378: negative bignumbers not formatted correctly. +- Upgrade fraction.js to version 4.0.12 (#1369). + +# 2018-12-09, version 5.4.0 + +- Extended sum.js to accept a dimension input to calculate the sum over a + specific axis. Thanks @bnlcas. +- Fix #1328: objects can't be written multi-line. Thanks @GHolk. +- Remove side effects caused by `Unit.format` and `Unit.toString`, + making changes to the unit on execution. Thanks @ericman314. + +# 2018-12-03, version 5.3.1 + +- Fixed #1336: Unit.toSI() returning units with prefix like `mm` instead + of `m`. Thanks @ericman314. + +# 2018-11-29, version 5.3.0 + +- Implemented function `hasNumericValue`. Thanks @Sathish-kumar-Subramani. +- Fix #1326: non-ascii character in print.js. +- Fix #1337: `math.format` not working correctly with `{ precision: 0 }`. + Thanks @dkenul. + +# 2018-10-30, version 5.2.3 + +- Fixed #1293: non-unicode characters in `escape-latex` giving issues in some + specific cases. Thanks @dangmai. +- Fixed incorrect LaTeX output of function `bitNot`, see #1299. Thanks @FSMaxB. +- Fixed #1304: function `pow` not supporting inputs `pow(Unit, BigNumber)`. +- Upgraded dependencies (`escape-latex@1.2.0`) + +# 2018-10-23, version 5.2.2 + +- Fixed #1286: Fixed unit base recognition and formatting for + user-defined units. Thanks @ericman314. + +# 2018-10-18, version 5.2.1 + +- Fixed unit `rod` being defined as `5.02921` instead of `5.0292`. + Thanks @ericman314. +- Upgraded dependencies (`fraction.js@4.0.10`) +- Upgraded devDependencies (`@babel/core@7.1.2`, `nyc@13.1.0`, + `webpack@4.21.0`). + +# 2018-10-05, version 5.2.0 + +- Implemented support for chained conditionals like `10 < x <= 50`. + Thanks @ericman314. +- Add an example showing a proof of concept of using `BigInt` in mathjs. +- Fixed #1269: Bugfix for BigNumber divided by unit. Thanks @ericman314. +- Fixed #1240: allow units having just a value and no unit. + Thanks @ericman314. + +## 2018-09-09, version 5.1.2 + +- Fixed a typo in the docs of `parse`. Thanks @mathiasvr. +- Fixed #1222: a typo in the docs of `subset`. +- Fixed #1236: `quantileSeq` has inconsistent return. +- Fixed #1237: norm sometimes returning a complex number instead of + number. +- Upgraded dependencies (`fraction.js@4.0.9`) +- Upgraded devDependencies (`babel@7`, `karma-webpack@3.0.4`, + `nyc@13.0.1`, `standard@12.0.0`, `uglify-js@3.4.9`, `webpack@4.17.2`) + +## 2018-08-21, version 5.1.1 + +- Function `isNumeric` now recognizes more types. +- Fixed #1214: functions `sqrt`, `max`, `min`, `var`, `std`, `mode`, `mad`, + `median`, and `partitionSelect` not neatly handling `NaN` inputs. In some + cases (`median`, `mad`, and `partitionSelect`) this resulted in an infinite + loop. +- Upgraded dependencies (`escape-latex@1.1.1`) +- Upgraded devDependencies (`webpack@4.17.0`) + +## 2018-08-12, version 5.1.0 + +- Implemented support for strings enclosed in single quotes. + Thanks @jean-emmanuel. +- Implemented function `getMatrixDataType`. Thanks @JasonShin. +- Implemented new `options` argument in `simplify`. Thanks @paulobuchsbaum. +- Bug fixes in `rationalize`, see #1173. Thanks @paulobuchsbaum. + +## 2018-07-22, version 5.0.4 + +- Strongly improved the performance of functions `factorial` for numbers. + This improves performance of functions `gamma`, `permutation`, and + `combination` too. See #1170. Thanks @honeybar. +- Strongly improved the performance of function `reshape`, thanks to a + friend of @honeybar. + +## 2018-07-14, version 5.0.3 + +- Fixed many functions (for example `add` and `subtract`) not working + with matrices having a `datatype` defined. +- Fixed #1147: bug in `format` with `engineering` notation in outputting + the correct number of significant figures. Thanks @ericman314. +- Fixed #1162: transform functions not being cleaned up when overriding + it by importing a factory function with the same name. +- Fixed broken links in the documentation. Thanks @stropitek. +- Refactored the code of `parse` into a functional approach. + Thanks @harrysarson. +- Changed `decimal.js` import to ES6. Thanks @weinshel. + +## 2018-07-07, version 5.0.2 + +- Fixed #1136: rocket trajectory example broken (since v4.0.0). +- Fixed #1137: `simplify` unnecessarily replacing implicit multiplication with + explicit multiplication. +- Fixed #1146: `rationalize` throwing exceptions for some input with decimals. + Thanks @maruta. +- Fixed #1088: function arguments not being passed to `rawArgs` functions. +- Fixed advanced example `add_new_datatypes`. +- Fixed mathjs core constants not working without complex numbers. + Thanks @ChristopherChudzicki. +- Fixed a broken link in the documentation on units. Thanks @stropitek. +- Upgraded dependencies (`typed-function@1.0.4`, `complex.js@2.0.11`). +- Upgraded devDependencies (`babel-loader@7.1.5`, `uglify-js@3.4.3`, + `expr-eval@1.2.2`, `webpack@4.15.1`). + +## 2018-07-01, version 5.0.1 + +- Improved error messaging when converting units. Thanks @gap777. +- Upgraded devDependencies (`kerma`, `uglify-js`, `webpack`). + +## 2018-06-16, version 5.0.0 + +!!! BE CAREFUL: BREAKING CHANGES !!! + +- Implemented complex conjugate transpose `math.ctranspose`. See #1097. + Thanks @jackschmidt. +- Changed the behavior of `A'` (transpose) in the expression parser to + calculate the complex conjugate transpose. See #1097. Thanks @jackschmidt. +- Added support for `complex({abs: 1, arg: 1})`, and improved the docs on + complex numbers. Thanks @ssaket. +- Renamed `eye` to `identity`, see #1054. +- Math.js code can now contain ES6. The ES6 source code is moved from `lib` + to `src`, and `lib` now contains the compiled ES5 code. +- Upgraded dependencies: + - `decimal.js` from `9.0.1` to `10.0.1` + - Upgraded dev dependencies +- Changed code style to , run linter on `npm test`. + See #1110. +- Dropped support for bower. Use npm or an other package manages instead. +- Dropped support for (non-primitive) instances of `Number`, `Boolean`, and + `String` from functions `clone` and `typeof`. +- Dropped official support for IE9 (probably still works, but it's not tested). +- Fixed #851: More consistent behavior of sqrt, nthRoot, and pow. + Thanks @dakotablair. +- Fixed #1103: Calling `toTex` on node that contains `derivative` causing + an exception. Thanks @joelhoover. + +## 2018-06-02, version 4.4.2 + +- Drastically improved the performance of `det`. Thanks @ericman314. +- Fixed #1065, #1121: Fixed wrong documentation of function + `compareNatural` and clarified the behavior for strings. +- Fixed #1122 a regression in function `inv` (since `v4.4.1`). + Thanks @ericman314. + +## 2018-05-29, version 4.4.1 + +- Fixed #1109: a bug in `inv` when dealing with values close to zero. + Thanks @ericman314. + +## 2018-05-28, version 4.4.0 + +- Implemented functions `equalText` and `compareText`. See #1085. + +## 2018-05-21, version 4.3.0 + +- Implemented matrix exponential `math.expm`. Thanks @ericman314. +- Fixed #1101: math.js bundle not working when loading in a WebWorker. +- Upgraded dependencies + - `complex.js` from `v2.0.2` to `v2.0.10`. + - `fraction.js` from `v4.0.4` to `v4.0.8`. +- Upgraded devDependencies (`mocha`, `uglify-js`, `webpack`). + +## 2018-05-05, version 4.2.2 + +- Fixed calculating the Frobenius norm of complex matrices correctly, + see #1098. Thanks @jackschmidt. +- Fixed #1076: cannot use mathjs in React VR by updating to + `escape-latex@1.0.3`. + +## 2018-05-02, version 4.2.1 + +- Fixed `dist/math.js` being minified. + +## 2018-05-02, version 4.2.0 + +- Implemented function `math.sqrtm`. Thanks @ferrolho. +- Implemented functions `math.log2`, `math.log1p`, and `math.expm1`. + Thanks @BigFav and @harrysarson. +- Fixed some unit tests broken on nodejs v10. +- Upgraded development dependencies. +- Dropped integration testing on nodejs v4. + +## 2018-04-18, version 4.1.2 + +- Fixed #1082: implemented support for unit plurals `decades`, `centuries`, + and `millennia`. +- Fixed #1083: units `decade` and `watt` having a wrong name when stringifying. + Thanks @ericman314. + +## 2018-04-11, version 4.1.1 + +- Fixed #1063: derivative not working when resolving a variable with unary + minus like `math.derivative('-x', 'x')`. + +## 2018-04-08, version 4.1.0 + +- Extended function `math.print` with support for arrays and matrices. + Thanks @jean-emmanuel. +- Fixed #1077: Serialization/deserialization to JSON with reviver not being + supported by nodes. +- Fixed #1016: Extended `math.typeof` with support for `ResultSet` and nodes + like `SymbolNode`. +- Fixed #1072: Added support for long and short prefixes for the unit `bar` + (i.e. `millibar` and `mbar`). + +## 2018-03-17, version 4.0.1 + +- Fixed #1062: mathjs not working on ES5 browsers like IE11 and Safari 9.3. +- Fixed #1061: `math.unit` not accepting input like `1/s`. + +## 2018-02-25, version 4.0.0 + +!!! BE CAREFUL: BREAKING CHANGES !!! + +Breaking changes (see also #682): + +- **New expression compiler** + + The compiler of the expression parser is replaced with one that doesn't use + `eval` internally. See #1019. This means: + + - a slightly improved performance on most browsers. + - less risk of security exploits. + - the code of the new compiler is easier to understand, maintain, and debug. + + Breaking change here: When using custom nodes in the expression parser, + the syntax of `_compile` has changed. This is an undocumented feature though. + +- **Parsed expressions** + + - The class `ConstantNode` is changed such that it just holds a value + instead of holding a stringified value and it's type. + `ConstantNode(valueStr, valueType`) is now `ConstantNode(value)` + Stringification uses `math.format`, which may result in differently + formatted numeric output. + + - The constants `true`, `false`, `null`, `undefined`, `NaN`, `Infinity`, + and `uninitialized` are now parsed as ConstantNodes instead of + SymbolNodes in the expression parser. See #833. + +- **Implicit multiplication** + + - Changed the behavior of implicit multiplication to have higher + precedence than explicit multiplication and division, except in + a number of specific cases. This gives a more natural behavior + for implicit multiplications. For example `24h / 6h` now returns `4`, + whilst `1/2 kg` evaluates to `0.5 kg`. Thanks @ericman314. See: #792. + Detailed documentation: . + + - Immediately invoking a function returned by a function like `partialAdd(2)(3)` + is no longer supported, instead these expressions are evaluated as + an implicit multiplication `partialAdd(2) * (3)`. See #1035. + +- **String formatting** + + - In function `math.format`, the options `{exponential: {lower: number, upper: number}}` + (where `lower` and `upper` are values) are replaced with `{lowerExp: number, upperExp: number}` + (where `lowerExp` and `upperExp` are exponents). See #676. For example: + + ```js + math.format(2000, {exponential: {lower: 1e-2, upper: 1e2}}) + ``` + + is now: + + ```js + math.format(2000, {lowerExp: -2, upperExp: 2}) + ``` + + - In function `math.format`, the option `notation: 'fixed'` no longer rounds to + zero digits when no precision is specified: it leaves the digits as is. + See #676. + +- **String comparison** + + Changed the behavior of relational functions (`compare`, `equal`, + `equalScalar`, `larger`, `largerEq`, `smaller`, `smallerEq`, `unequal`) + to compare strings by their numeric value they contain instead of + alphabetically. This also impacts functions `deepEqual`, `sort`, `min`, + `max`, `median`, and `partitionSelect`. Use `compareNatural` if you + need to sort an array with text. See #680. + +- **Angle units** + + Changed `rad`, `deg`, and `grad` to have short prefixes, + and introduced `radian`, `degree`, and `gradian` and their plurals + having long prefixes. See #749. + +- **Null** + + - `null` is no longer implicitly casted to a number `0`, so input like + `math.add(2, null)` is no longer supported. See #830, #353. + + - Dropped constant `uninitialized`, which was used to initialize + leave new entries undefined when resizing a matrix is removed. + Use `undefined` instead to indicate entries that are not explicitly + set. See #833. + +- **New typed-function library** + + - The `typed-function` library used to check the input types + of functions is completely rewritten and doesn't use `eval` under + the hood anymore. This means a reduced security risk, and easier + to debug code. The API is the same, but error messages may differ + a bit. Performance is comparable but may differ in specific + use cases and browsers. + +Non breaking changes: + +- Thanks to the new expression compiler and `typed-function` implementation, + mathjs doesn't use JavaScript's `eval` anymore under the hood. + This allows using mathjs in environments with security restrictions. + See #401. +- Implemented additional methods `isUnary()` and `isBinary()` on + `OperatorNode`. See #1025. +- Improved error messages for statistical functions. +- Upgraded devDependencies. +- Fixed #1014: `derivative` silently dropping additional arguments + from operator nodes with more than two arguments. + +## 2018-02-07, version 3.20.2 + +- Upgraded to `typed-function@0.10.7` (bug-fix release). +- Fixed option `implicit` not being copied from an `OperatorNode` + when applying function `map`. Thanks @HarrySarson. +- Fixed #995: spaces and underscores not property being escaped + in `toTex()`. Thanks @FSMaxB. + +## 2018-01-17, version 3.20.1 + +- Fixed #1018: `simplifyCore` failing in some cases with parentheses. + Thanks @firepick1. + +## 2018-01-14, version 3.20.0 + +- Implement support for 3 or more arguments for operators `+` and `*` in + `derivative`. Thanks @HarrySarson. See #1002. +- Fixed `simplify` evalution of `simplify` of functions with more than two + arguments wrongly: `simplify('f(x, y, z)') evaluated to`f(f(x, y), z)` + instead of `f(x, y, z)`. Thanks @joelhoover. +- Fixed `simplify` throwing an error in some cases when simplifying unknown + functions, for example `simplify('f(4)')`. Thanks @joelhoover. +- Fixed #1013: `simplify` wrongly simplifing some expressions containing unary + minus, like `0 - -x`. Thanks @joelhoover. +- Fixed an error in an example in the documentation of `xor`. Thanks @denisx. + +## 2018-01-06, version 3.19.0 + +- Extended functions `distance` and `intersect` with support for BigNumbers. + Thanks @ovk. +- Improvements in function `simplify`: added a rule that allows combining + of like terms in embedded quantities. Thanks @joelhoover. + +## 2017-12-28, version 3.18.1 + +- Fixed #998: An issue with simplifying an expression containing a subtraction. + Thanks @firepick1. + +## 2017-12-16, version 3.18.0 + +- Implemented function `rationalize`. Thanks @paulobuchsbaum. +- Upgraded dependencies: + + ``` + decimal.js 7.2.3 → 9.0.1 (no breaking changes affecting mathjs) + fraction.js 4.0.2 → 4.0.4 + tiny-emitter 2.0.0 → 2.0.2 + ``` + +- Upgraded dev dependencies. +- Fixed #975: a wrong example in the docs of lusolve. +- Fixed #983: `pickRandom` returning an array instead of single value + when input was an array with just one value. Clarified docs. +- Fixed #969: preven issues with yarn autoclean by renaming an + interally used folder "docs" to "embeddedDocs". + +## 2017-11-18, version 3.17.0 + +- Improved `simplify` for nested exponentiations. Thanks @IvanVergiliev. +- Fixed a security issue in `typed-function` allowing arbitrary code execution + in the JavaScript engine by creating a typed function with JavaScript code + in the name. Thanks Masato Kinugawa. +- Fixed a security issue where forbidden properties like constructor could be + replaced by using unicode characters when creating an object. No known exploit, + but could possibly allow arbitrary code execution. Thanks Masato Kinugawa. + +## 2017-10-18, version 3.16.5 + +- Fixed #954: Functions `add` and `multiply` not working when + passing three or more arrays or matrices. + +## 2017-10-01, version 3.16.4 + +- Fixed #948, #949: function `simplify` returning wrong results or + running into an infinite recursive loop. Thanks @ericman314. +- Fixed many small issues in the embedded docs. Thanks @Schnark. + +## 2017-08-28, version 3.16.3 + +- Fixed #934: Wrong simplification of unary minus. Thanks @firepick1. +- Fixed #933: function `simplify` reordering operations. Thanks @firepick1. +- Fixed #930: function `isNaN` returning wrong result for complex + numbers having just one of their parts (re/im) being `NaN`. +- Fixed #929: `FibonacciHeap.isEmpty` returning wrong result. + +## 2017-08-20, version 3.16.2 + +- Fixed #924: a regression in `simplify` not accepting the signature + `simplify(expr, rules, scope)` anymore. Thanks @firepick1. +- Fixed missing parenthesis when stringifying expressions containing + implicit multiplications (see #922). Thanks @FSMaxB. + +## 2017-08-12, version 3.16.1 + +- For security reasons, type checking is now done in a more strict + way using functions like `isComplex(x)` instead of duck type checking + like `x && x.isComplex === true`. +- Fixed #915: No access to property "name". +- Fixed #901: Simplify units when calling `unit.toNumeric()`. + Thanks @AlexanderBeyn. +- Fixed `toString` of a parsed expression tree containing an + immediately invoked function assignment not being wrapped in + parenthesis (for example `(f(x) = x^2)(4)`). + +## 2017-08-06, version 3.16.0 + +- Significant performance improvements in `math.simplify`. + Thanks @firepick1. +- Improved API for `math.simplify`, optionally pass a scope with + variables which are resolved, see #907. Thanks @firepick1. +- Fixed #912: math.js didn't work on IE10 anymore (regression + since 3.15.0). + +## 2017-07-29, version 3.15.0 + +- Added support for the dollar character `$` in symbol names (see #895). +- Allow objects with prototypes as scope again in the expression parser, + this was disabled for security reasons some time ago. See #888, #899. + Thanks @ThomasBrierley. +- Fixed #846: Issues in the functions `map`, `forEach`, and `filter` + when used in the expression parser: + - Not being able to use a function assignment as inline expression + for the callback function. + - Not being able to pass an inline expression as callback for `map` + and `forEach`. + - Index and original array/matrix not passed in `map` and `filter`. + +## 2017-07-05, version 3.14.2 + +- Upgraded to `fraction.js@4.0.2` +- Fixed #891 using BigNumbers not working in browser environments. + +## 2017-06-30, version 3.14.1 + +- Reverted to `fraction.js@4.0.0`, there is an issue with `4.0.1` + in the browser. + +## 2017-06-30, version 3.14.0 + +- Implemented set methods `setCartesian`, `setDifference`, + `setDistinct`, `setIntersect`, `setIsSubset`, `setPowerset`, + `setSize`. Thanks @Nekomajin42. +- Implemented method `toHTML` on nodes. Thanks @Nekomajin42. +- Implemented `compareNatural` and `sort([...], 'natural')`. +- Upgraded dependencies to the latest versions: + - `complex.js@2.0.4` + - `decimal.js@7.2.3` + - `fraction.js@4.0.1` + - `tiny-emitter@2.0.0` + - And all devDependencies. +- Fixed #865: `splitUnit` can now deal with round-off errors. + Thanks @ericman314. +- Fixed #876: incorrect definition for unit `erg`. Thanks @pjhampton. +- More informative error message when using single quotes instead of + double quotes around a string. Thanks @HarrySarson. + +## 2017-05-27, version 3.13.3 + +- Fixed a bug in function `intersection` of line and plane. + Thanks @viclai. +- Fixed security vulnerabilities. + +## 2017-05-26, version 3.13.2 + +- Disabled function `chain` inside the expression parser for security + reasons (it's not needed there anyway). +- Fixed #856: function `subset` not returning non-primitive scalars + from Arrays correctly. (like `math.eval('arr[1]', {arr: [math.bignumber(2)]})`. +- Fixed #861: physical constants not available in the expression parser. + +## 2017-05-12, version 3.13.1 + +- Fixed creating units with an alias not working within the expression + parser. +- Fixed security vulnerabilities. Thanks Sam. + +## 2017-05-12, version 3.13.0 + +- Command line application can now evaluate inline expressions + like `mathjs 1+2`. Thanks @slavaGanzin. +- Function `derivative` now supports `abs`. Thanks @tetslee. +- Function `simplify` now supports BigNumbers. Thanks @tetslee. +- Prevent against endless loops in `simplify`. Thanks @tetslee. +- Fixed #813: function `simplify` converting small numbers to inexact + Fractions. Thanks @tetslee. +- Fixed #838: Function `simplify` now supports constants like `e`. + Thanks @tetslee. + +## 2017-05-05, version 3.12.3 + +- Fixed security vulnerabilities. Thanks Dan and Sam. + +## 2017-04-30, version 3.12.2 + +- Added a rocket trajectory optimization example. + +## 2017-04-24, version 3.12.1 + +- Fixed #804 + - Improved handling of powers of `Infinity`. Thanks @HarrySarson. + - Fixed wrong formatting of complex NaN. +- Fixed security vulnerabilities in the expression parser. + Thanks Sam and Dan. + +## 2017-04-17, version 3.12.0 + +- Implemented QR decomposition, function `math.qr`. Thanks @HarrySarson. +- Fixed #824: Calling `math.random()` freezes IE and node.js. + +## 2017-04-08, version 3.11.5 + +- More security measures in the expression parser. + WARNING: the behavior of the expression parser is now more strict, + some undocumented features may not work any longer. + - Accessing and assigning properties is now only allowed on plain + objects, not on classes, arrays, and functions anymore. + - Accessing methods is restricted to a set of known, safe methods. + +## 2017-04-03, version 3.11.4 + +- Fixed a security vulnerability in the expression parser. Thanks @xfix. + +## 2017-04-03, version 3.11.3 + +- Fixed a security vulnerability in the expression parser. Thanks @xfix. + +## 2017-04-03, version 3.11.2 + +- Fixed a security vulnerability in the expression parser. Thanks @xfix. + +## 2017-04-02, version 3.11.1 + +- Fixed security vulnerabilities in the expression parser. + Thanks Joe Vennix and @xfix. + +## 2017-04-02, version 3.11.0 + +- Implemented method Unit.toSI() to convert a unit to base SI units. + Thanks @ericman314. +- Fixed #821, #822: security vulnerabilities in the expression parser. + Thanks @comex and @xfix. + +## 2017-03-31, version 3.10.3 + +- More security fixes related to the ones fixed in `v3.10.2`. + +## 2017-03-31, version 3.10.2 + +- Fixed a security vulnerability in the expression parser allowing + execution of arbitrary JavaScript. Thanks @CapacitorSet and @denvit. + +## 2017-03-26, version 3.10.1 + +- Fixed `xgcd` for negative values. Thanks @litmit. +- Fixed #807: function transform of existing functions not being removed when + overriding such a function. + +## 2017-03-05, version 3.10.0 + +- Implemented function `reshape`. Thanks @patgrasso and @ericman314. +- Implemented configuration option `seedRandom` for deterministic random + numbers. Thanks @morsecodist. +- Small fixes in the docs. Thanks @HarrySarson. +- Dropped support for component package manager (which became deprecated about + one and a half year ago). + +## 2017-02-22, version 3.9.3 + +- Fixed #797: issue with production builds of React Native projects. +- Fixed `math.round` not accepting inputs `NaN`, `Infinity`, `-Infinity`. +- Upgraded all dependencies. + +## 2017-02-16, version 3.9.2 + +- Fixed #795: Parse error in case of a multi-line expression with just comments. + +## 2017-02-06, version 3.9.1 + +- Fixed #789: Math.js not supporting conversion of `string` to `BigNumber`, + `Fraction`, or `Complex` number. +- Fixed #790: Expression parser did not pass function arguments of enclosing + functions via `scope` to functions having `rawArgs = true`. +- Small fixes in the docs. Thanks @HarrySarson. + +## 2017-01-23, version 3.9.0 + +- Implemented support for algebra: powerful new functions `simplify` and + `derivative`. Thanks @ericman314, @tetslee, and @BigFav. +- Implemented Kronecker Product `kron`. Thanks @adamisntdead. +- Reverted `FunctionNode` not accepting a string as function name anymore. +- Fixed #765: `FunctionAssignmentNode.toString()` returning a string + incompatible with the function assignment syntax. + +## 2016-12-15, version 3.8.1 + +- Implemented function `mad` (median absolute deviation). Thanks @ruhleder. +- Fixed #762: expression parser failing to invoke a function returned + by a function. + +## 2016-11-18, version 3.8.0 + +- Functions `add` and `multiply` now accept more than two arguments. See #739. +- `OperatorNode` now supports more than two arguments. See #739. Thanks @FSMaxB. +- Implemented a method `Node.cloneDeep` for the expression nodes. See #745. +- Fixed a bug in `Node.clone()` not cloning implicit multiplication correctly. + Thanks @FSMaxB. +- Fixed #737: Improved algorithm determining the best prefix for units. + It will now retain the original unit like `1 cm` when close enough, + instead of returning `10 mm`. Thanks @ericman314. +- Fixed #732: Allow letter-like unicode characters like Ohm `\u2126`. +- Fixed #749: Units `rad`, `deg`, and `grad` can now have prefixes like `millirad`. +- Some fixes in the docs and comments of examples. Thanks @HarrySarson. + +## 2016-11-05, version 3.7.0 + +- Implemented method `Node.equals(other)` for all nodes of the expression parser. +- Implemented BigNumber support in function `arg()`. +- Command Line Interface loads faster. +- Implicit conversions between Fractions and BigNumbers throw a neat error now + (See #710). + +## 2016-10-21, version 3.6.0 + +- Implemented function `erf()`. THanks @patgrasso. +- Extended function `cross()` to support n-d vectors. Thanks @patgrasso. +- Extended function `pickRandom` with the option to pick multiple values from + an array and give the values weights: `pickRandom(possibles, number, weights)`. + Thanks @woylie. +- Parser now exposes test functions like `isAlpha` which can be replaced in + order to adjust the allowed characters in variables names (See #715). +- Fixed #727: Parser not throwing an error for invalid implicit multiplications + like `-2 2` and `2^3 4` (right after the second value of an operator). +- Fixed #688: Describe allowed variable names in the docs. + +## 2016-09-21, version 3.5.3 + +- Some more fixes regarding numbers ending with a decimal mark (like `2.`). + +## 2016-09-20, version 3.5.2 + +- Fixed numbers ending with a decimal mark (like `2.`) not being supported by + the parser, solved the underlying ambiguity in the parser. See #707, #711. + +## 2016-09-12, version 3.5.1 + +- Removed a left over console.log statement. Thanks @eknkc. + +## 2016-09-07, version 3.5.0 + +- Comments of expressions are are now stored in the parsed nodes. See #690. +- Fixed function `print` not accepting an Object with formatting options as + third parameter Thanks @ThomasBrierley. +- Fixed #707: The expression parser no longer accepts numbers ending with a dot + like `2.`. + +## 2016-08-08, version 3.4.1 + +- Fixed broken bundle files (`dist/math.js`, `dist/math.min.js`). +- Fixed some layout issues in the function reference docs. + +## 2016-08-07, version 3.4.0 + +- Implemented support for custom units using `createUnit`. Thanks @ericman314. +- Implemented function `splitUnits`. Thanks @ericman314. +- Implemented function `isPrime`. Thanks @MathBunny. + +## 2016-07-05, version 3.3.0 + +- Implemented function `isNaN`. +- Function `math.filter` now passes three arguments to the callback function: + value, index, and array. +- Removed the check on the number of arguments from functions defined in the + expression parser (see #665). +- Fixed #665: functions `map`, `forEach`, and `filter` now invoke callbacks + which are a typed-function with the correct number of arguments. + +## 2016-04-26, version 3.2.1 + +- Fixed #651: unable to perform calculations on "Unit-less" units. +- Fixed matrix.subset mutating the replacement matrix when unsqueezing it. + +## 2016-04-16, version 3.2.0 + +- Implemented #644: method `Parser.getAll()` to retrieve all defined variables. +- Upgraded dependencies (decimal.js@5.0.8, fraction.js@3.3.1, + typed-function@0.10.4). +- Fixed #601: Issue with unnamed typed-functions by upgrading to + typed-function v0.10.4. +- Fixed #636: More strict `toTex` templates, reckon with number of arguments. +- Fixed #641: Bug in expression parser parsing implicit multiplication with + wrong precedence in specific cases. +- Fixed #645: Added documentation about `engineering` notation of function + `math.format`. + +## 2016-04-03, version 3.1.4 + +- Using ES6 Math functions like `Math.sinh`, `Math.cbrt`, `Math.sign`, etc when + available. +- Fixed #631: unit aliases `weeks`, `months`, and `years` where missing. +- Fixed #632: problem with escaped backslashes at the end of strings. +- Fixed #635: `Node.toString` options where not passed to function arguments. +- Fixed #629: expression parser throws an error when passing a number with + decimal exponent instead of parsing them as implicit multiplication. +- Fixed #484, #555: inaccuracy of `math.sinh` for values between -1 and 1. +- Fixed #625: Unit `in` (`inch`) not always working due to ambiguity with + the operator `a in b` (alias of `a to b`). + +## 2016-03-24, version 3.1.3 + +- Fix broken bundle. + +## 2016-03-24, version 3.1.2 + +- Fix broken npm release. + +## 2016-03-24, version 3.1.1 + +- Fixed #621: a bug in parsing implicit multiplications like `(2)(3)+4`. +- Fixed #623: `nthRoot` of zero with a negative root returned `0` instead of + `Infinity`. +- Throw an error when functions `min`, `max`, `mean`, or `median` are invoked + with multiple matrices as arguments (see #598). + +## 2016-03-19, version 3.1.0 + +- Hide multiplication operator by default when outputting `toTex` and `toString` + for implicit multiplications. Implemented and option to output the operator. +- Implemented unit `kip` and alias `kips`. Thanks @hgupta9. +- Added support for prefixes for units `mol` and `mole`. Thanks @stu-blair. +- Restored support for implicit multiplications like `2(3+4)` and `(2+3)(4+5)`. +- Some improvements in the docs. +- Added automatic conversions from `boolean` and `null` to `Fraction`, + and conversions from `Fraction` to `Complex`. + +## 2016-03-04, version 3.0.0 + +### breaking changes + +- More restricted support for implicit multiplication in the expression + parser: `(...)(...)` is now evaluated as a function invocation, + and `[...][...]` as a matrix subset. +- Matrix multiplication no longer squeezes scalar outputs to a scalar value, + but leaves them as they are: a vector or matrix containing a single value. + See #529. +- Assignments in the expression parser now return the assigned value rather + than the created or updated object (see #533). Example: + + ``` + A = eye(3) + A[1,1] = 2 # this assignment now returns 2 instead of A + ``` + +- Expression parser now supports objects. This involves a refactoring and + extension in expression nodes: + - Implemented new node `ObjectNode`. + - Refactored `AssignmentNode`, `UpdateNode`, and `IndexNode` are refactored + into `AccessorNode`, `AssignmentNode`, and `IndexNode` having a different API. +- Upgraded the used BigNumber library `decimal.js` to v5. Replaced the + trigonometric functions of math.js with those provided in decimal.js v5. + This can give slightly different behavior qua round-off errors. +- Replaced the internal `Complex.js` class with the `complex.js` library + created by @infusion. +- Entries in a matrix (typically numbers, BigNumbers, Units, etc) are now + considered immutable, they are no longer copied when performing operations on + the entries, improving performance. +- Implemented nearly equal comparison for relational functions (`equal`, + `larger`, `smaller`, etc.) when using BigNumbers. +- Changed the casing of the configuration options `matrix` (`Array` or `Matrix`) + and `number` (`number`, `BigNumber`, `Fraction`) such that they now match + the type returned by `math.typeof`. Wrong casing gives a console warning but + will still work. +- Changed the default config value for `epsilon` from `1e-14` to `1e-12`, + see #561. + +### non-breaking changes + +- Extended function `pow` to return the real root for cubic roots of negative + numbers. See #525, #482, #567. +- Implemented support for JSON objects in the expression parser and the + function `math.format`. +- Function `math.fraction` now supports `BigNumber`, and function + `math.bignumber` now supports `Fraction`. +- Expression parser now allows function and/or variable assignments inside + accessors and conditionals, like `A[x=2]` or `a > 2 ? b="ok" : b="fail"`. +- Command line interface: + - Outputs the variable name of assignments. + - Fixed not rounding BigNumbers to 14 digits like numbers. + - Fixed non-working autocompletion of user defined variables. +- Reorganized and extended docs, added docs on classes and more. Thanks @hgupta9. +- Added new units `acre`, `hectare`, `torr`, `bar`, `mmHg`, `mmH2O`, `cmH2O`, + and added new aliases `acres`, `hectares`, `sqfeet`, `sqyard`, `sqmile`, + `sqmiles`, `mmhg`, `mmh2o`, `cmh2o`. Thanks @hgupta9. +- Fixed a bug in the toString method of an IndexNode. +- Fixed angle units `deg`, `rad`, `grad`, `cycle`, `arcsec`, and `arcmin` not + being defined as BigNumbers when configuring to use BigNumbers. + +## 2016-02-03, version 2.7.0 + +- Added more unit aliases for time: `secs`, `mins`, `hr`, `hrs`. See #551. +- Added support for doing operations with mixed `Fractions` and `BigNumbers`. +- Fixed #540: `math.intersect()` returning null in some cases. Thanks @void42. +- Fixed #546: Cannot import BigNumber, Fraction, Matrix, Array. + Thanks @brettjurgens. + +## 2016-01-08, version 2.6.0 + +- Implemented (complex) units `VA` and `VAR`. +- Implemented time units for weeks, months, years, decades, centuries, and + millennia. Thanks @owenversteeg. +- Implemented new notation `engineering` in function `math.format`. + Thanks @johnmarinelli. +- Fixed #523: In some circumstances, matrix subset returned a scalar instead + of the correct subset. +- Fixed #536: A bug in an internal method used for sparse matrices. + +## 2015-12-05, version 2.5.0 + +- Implemented support for numeric types `Fraction` and `BigNumber` in units. +- Implemented new method `toNumeric` for units. +- Implemented new units `arcsec`, `arcsecond`, `arcmin`, `arcminute`. + Thanks @devdevdata222. +- Implemented new unit `Herts` (`Hz`). Thanks @SwamWithTurtles. +- Fixed #485: Scoping issue with variables both used globally as well as in a + function definition. +- Fixed: Function `number` didn't support `Fraction` as input. + +## 2015-11-14, version 2.4.2 + +- Fixed #502: Issue with `format` in some JavaScript engines. +- Fixed #503: Removed trailing commas and the use of keyword `import` as + property, as this gives issues with old JavaScript engines. + +## 2015-10-29, version 2.4.1 + +- Fixed #480: `nthRoot` not working on Internet Explorer (up to IE11). +- Fixed #490: `nthRoot` returning an error for negative values like + `nthRoot(-2, 3)`. +- Fixed #489: an issue with initializing a sparse matrix without data. + Thanks @Retsam. +- Fixed: #493: function `combinations` did not throw an exception for + non-integer values of `k`. +- Fixed: function `import` did not override typed functions when the option + override was set true. +- Fixed: added functions `math.sparse` and `math.index` to the reference docs, + they where missing. +- Fixed: removed memoization from `gamma` and `factorial` functions, this + could blow up memory. + +## 2015-10-09, version 2.4.0 + +- Added support in the expression parser for mathematical alphanumeric symbols + in the expression parser: unicode range \u{1D400} to \u{1D7FF} excluding + invalid code points. +- Extended function `distance` with more signatures. Thanks @kv-kunalvyas. +- Fixed a bug in functions `sin` and `cos`, which gave wrong results for + BigNumber integer values around multiples of tau (i.e. `sin(bignumber(7))`). +- Fixed value of unit `stone`. Thanks @Esvandiary for finding the error. + +## 2015-09-19, version 2.3.0 + +- Implemented function `distance`. Thanks @devanp92. +- Implemented support for Fractions in function `lcm`. Thanks @infusion. +- Implemented function `cbrt` for numbers, complex numbers, BigNumbers, Units. +- Implemented function `hypot`. +- Upgraded to fraction.js v3.0.0. +- Fixed #450: issue with non sorted index in sparse matrices. +- Fixed #463, #322: inconsistent handling of implicit multiplication. +- Fixed #444: factorial of infinity not returning infinity. + +## 2015-08-30, version 2.2.0 + +- Units with powers (like `m^2` and `s^-1`) now output with the best prefix. +- Implemented support for units to `abs`, `cube`, `sign`, `sqrt`, `square`. + Thanks @ericman314. +- Implemented function `catalan` (Combinatorics). Thanks @devanp92. +- Improved the `canDefineProperty` check to return false in case of IE8, which + has a broken implementation of `defineProperty`. Thanks @golmansax. +- Fixed function `to` not working in case of a simplified unit. +- Fixed #437: an issue with row swapping in `lup`, also affecting `lusolve`. + +## 2015-08-12, version 2.1.1 + +- Fixed wrong values of the physical constants `speedOfLight`, `molarMassC12`, + and `magneticFluxQuantum`. Thanks @ericman314 for finding two of them. + +## 2015-08-11, version 2.1.0 + +- Implemented derived units (like `110 km/h in m/s`). Thanks @ericman314. +- Implemented support for electric units. Thanks @ericman314. +- Implemented about 50 physical constants like `speedOfLight`, `gravity`, etc. +- Implemented function `kldivergence` (Kullback-Leibler divergence). + Thanks @saromanov. +- Implemented function `mode`. Thanks @kv-kunalvyas. +- Added support for unicode characters in the expression parser: greek letters + and latin letters with accents. See #265. +- Internal functions `Unit.parse` and `Complex.parse` now throw an Error + instead of returning null when passing invalid input. + +## 2015-07-29, version 2.0.1 + +- Fixed operations with mixed fractions and numbers be converted to numbers + instead of fractions. + +## 2015-07-28, version 2.0.0 + +- Large internal refactoring: + - performance improvements. + - allows to create custom bundles + - functions are composed using `typed-function` and are extensible +- Implemented support for fractions, powered by the library `fraction.js`. +- Implemented matrix LU decomposition with partial pivoting and a LU based + linear equations solver (functions `lup` and `lusolve`). Thanks @rjbaucells. +- Implemented a new configuration option `predictable`, which can be set to + true in order to ensure predictable function output types. +- Implemented function `intersect`. Thanks @kv-kunalvyas. +- Implemented support for adding `toTex` properties to custom functions. + Thanks @FSMaxB. +- Implemented support for complex values to `nthRoot`. Thanks @gangachris. +- Implemented util functions `isInteger`, `isNegative`, `isNumeric`, + `isPositive`, and `isZero`. + +### breaking changes + +- String input is now converted to numbers by default for all functions. +- Adding two strings will no longer concatenate them, but will convert the + strings to numbers and add them. +- Function `index` does no longer accept an array `[start, end, step]`, but + instead accepts an array with arbitrary index values. It also accepts + a `Range` object as input. +- Function `typeof` no longer returns lower case names, but now returns lower + case names for primitives (like `number`, `boolean`, `string`), and + upper-camel-case for non-primitives (like `Array`, `Complex`, `Function`). +- Function `import` no longer supports a module name as argument. Instead, + modules can be loaded using require: `math.import(require('module-name'))`. +- Function `import` has a new option `silent` to ignore errors, and throws + errors on duplicates by default. +- Method `Node.compile()` no longer needs `math` to be passed as argument. +- Reintroduced method `Node.eval([scope])`. +- Function `sum` now returns zero when input is an empty array. Thanks @FSMAxB. +- The size of Arrays is no longer validated. Matrices will validate this on + creation. + +## 2015-07-12, version 1.7.1 + +- Fixed #397: Inaccuracies in nthRoot for very large values, and wrong results + for very small values. (backported from v2) +- Fixed #405: Parser throws error when defining a function in a multiline + expression. + +## 2015-05-31, version 1.7.0 + +- Implemented function `quantileSeq` and `partitionSelect`. Thanks @BigFav. +- Implemented functions `stirlingS2`, `bellNumbers`, `composition`, and + `multinomial`. Thanks @devanp92. +- Improved the performance of `median` (see #373). Thanks @BigFav. +- Extended the command line interface with a `mode` option to output either + the expressions result, string representation, or tex representation. + Thanks @FSMaxB. +- Fixed #309: Function median mutating the input matrix. Thanks @FSMaxB. +- Fixed `Node.transform` not recursing over replaced parts of the + node tree (see #349). +- Fixed #381: issue in docs of `randomInt`. + +## 2015-04-22, version 1.6.0 + +- Improvements in `toTex`. Thanks @FSMaxB. +- Fixed #328: `abs(0 + 0i)` evaluated to `NaN`. +- Fixed not being able to override lazy loaded constants. + +## 2015-04-09, version 1.5.2 + +- Fixed #313: parsed functions did not handle recursive calls correctly. +- Fixed #251: binary prefix and SI prefix incorrectly used for byte. Now + following SI standards (`1 KiB == 1024 B`, `1 kB == 1000 B`). +- Performance improvements in parsed functions. + +## 2015-04-08, version 1.5.1 + +- Fixed #316: a bug in rounding values when formatting. +- Fixed #317, #319: a bug in formatting negative values. + +## 2015-03-28, version 1.5.0 + +- Added unit `stone` (6.35 kg). +- Implemented support for sparse matrices. Thanks @rjbaucells. +- Implemented BigNumber support for function `atan2`. Thanks @BigFav. +- Implemented support for custom LaTeX representations. Thanks @FSMaxB. +- Improvements and bug fixes in outputting parentheses in `Node.toString` and + `Node.toTex` functions. Thanks @FSMaxB. +- Fixed #291: function `format` sometimes returning exponential notation when + it should return a fixed notation. + +## 2015-02-28, version 1.4.0 + +- Implemented trigonometric functions: + `acosh`, `acoth`, `acsch`, `asech`, `asinh`, `atanh`, `acot`, `acsc`, `asec`. + Thanks @BigFav. +- Added BigNumber support for functions: `cot`, `csc`, `sec`, `coth`, + `csch`, `sech`. Thanks @BigFav. +- Implemented support for serialization and deserialization of math.js data + types. +- Fixed the calculation of `norm()` and `abs()` for large complex numbers. + Thanks @rjbaucells. +- Fixed #281: improved formatting complex numbers. Round the real or imaginary + part to zero when the difference is larger than the configured precision. + +## 2015-02-09, version 1.3.0 + +- Implemented BigNumber implementations of most trigonometric functions: `sin`, + `cos`, `tan`, `asin`, `acos`, `atan`, `cosh`, `sinh`, `tanh`. Thanks @BigFav. +- Implemented function `trace`. Thanks @pcorey. +- Faster loading of BigNumber configuration with a high precision by lazy + loading constants like `pi` and `e`. +- Fixed constants `NaN` and `Infinity` not being BigNumber objects when + BigNumbers are configured. +- Fixed missing parentheses in the `toTex` representation of function + `permutations`. +- Some minor fixes in the docs. Thanks @KenanY. + +## 2014-12-25, version 1.2.0 + +- Support for bitwise operations `bitAnd`, `bitNot`, `bitOr`, `bitXor`, + `leftShift`, `rightArithShift`, and `rightLogShift`. Thanks @BigFav. +- Support for boolean operations `and`, `not`, `or`, `xor`. Thanks @BigFav. +- Support for `gamma` function. Thanks @BigFav. +- Converting a unit without value will now result in a unit *with* value, + i.e. `inch in cm` will return `2.54 cm` instead of `cm`. +- Improved accuracy of `sinh` and complex `cos` and `sin`. Thanks @pavpanchekha. +- Renamed function `select` to `chain`. The old function `select` will remain + functional until math.js v2.0. +- Upgraded to decimal.js v4.0.1 (BigNumber library). + +## 2014-11-22, version 1.1.1 + +- Fixed Unit divided by Number returning zero. +- Fixed BigNumber downgrading to Number for a negative base in `pow`. +- Fixed some typos in error messaging (thanks @andy0130tw) and docs. + +## 2014-11-15, version 1.1.0 + +- Implemented functions `dot` (dot product), `cross` (cross product), and + `nthRoot`. +- Officially opened up the API of expression trees: + - Documented the API. + - Implemented recursive functions `clone`, `map`, `forEach`, `traverse`, + `transform`, and `filter` for expression trees. + - Parameter `index` in the callbacks of `map` and `forEach` are now cloned + for every callback. + - Some internal refactoring inside nodes to make the API consistent: + - Renamed `params` to `args` and vice versa to make things consistent. + - Renamed `Block.nodes` to `Block.blocks`. + - `FunctionNode` now has a `name: string` instead of a `symbol: SymbolNode`. + - Changed constructor of `RangeNode` to + `new RangeNode(start: Node, end: Node [, step: Node])`. + - Nodes for a `BlockNode` must now be passed via the constructor instead + of via a function `add`. +- Fixed `2e` giving a syntax error instead of being parsed as `2 * e`. + +## 2014-09-12, version 1.0.1 + +- Disabled array notation for ranges in a matrix index in the expression parser + (it is confusing and redundant there). +- Fixed a regression in the build of function subset not being able to return + a scalar. +- Fixed some missing docs and broken links in the docs. + +## 2014-09-04, version 1.0.0 + +- Implemented a function `filter(x, test)`. +- Removed `math.distribution` for now, needs some rethinking. +- `math.number` can convert units to numbers (requires a second argument) +- Fixed some precedence issues with the range and conversion operators. +- Fixed an zero-based issue when getting a matrix subset using an index + containing a matrix. + +## 2014-08-21, version 0.27.0 + +- Implemented functions `sort(x [, compare])` and `flatten(x)`. +- Implemented support for `null` in all functions. +- Implemented support for "rawArgs" functions in the expression parser. Raw + functions are invoked with unevaluated parameters (nodes). +- Expressions in the expression parser can now be spread over multiple lines, + like '2 +\n3'. +- Changed default value of the option `wrap` of function `math.import` to false. +- Changed the default value for new entries in a resized matrix when to zero. + To leave new entries uninitialized, use the new constant `math.uninitialized` + as default value. +- Renamed transform property from `__transform__` to `transform`, and documented + the transform feature. +- Fixed a bug in `math.import` not applying options when passing a module name. +- A returned matrix subset is now only squeezed when the `index` consists of + scalar values, and no longer for ranges resolving into a single value. + +## 2014-08-03, version 0.26.0 + +- A new instance of math.js can no longer be created like `math([options])`, + to prevent side effects from math being a function instead of an object. + Instead, use the function `math.create([options])` to create a new instance. +- Implemented `BigNumber` support for all constants: `pi`, `tau`, `e`, `phi`, + `E`, `LN2`, `LN10`, `LOG2E`, `LOG10E`, `PI`, `SQRT1_2`, and `SQRT2`. +- Implemented `BigNumber` support for functions `gcd`, `xgcd`, and `lcm`. +- Fixed function `gxcd` returning an Array when math.js was configured + as `{matrix: 'matrix'}`. +- Multi-line expressions now return a `ResultSet` instead of an `Array`. +- Implemented transforms (used right now to transform one-based indices to + zero-based for expressions). +- When used inside the expression parser, functions `concat`, `min`, `max`, + and `mean` expect an one-based dimension number. +- Functions `map` and `forEach` invoke the callback with one-based indices + when used from within the expression parser. +- When adding or removing dimensions when resizing a matrix, the dimensions + are added/removed from the inner side (right) instead of outer side (left). +- Improved index out of range errors. +- Fixed function `concat` not accepting a `BigNumber` for parameter `dim`. +- Function `squeeze` now squeezes both inner and outer singleton dimensions. +- Output of getting a matrix subset is not automatically squeezed anymore + except for scalar output. +- Renamed `FunctionNode` to `FunctionAssignmentNode`, and renamed `ParamsNode` + to `FunctionNode` for more clarity. +- Fixed broken auto completion in CLI. +- Some minor fixes. + +## 2014-07-01, version 0.25.0 + +- The library now immediately returns a default instance of mathjs, there is + no need to instantiate math.js in a separate step unless one ones to set + configuration options: + + // instead of: + var mathjs = require('mathjs'), // load math.js + math = mathjs(); // create an instance + + // just do: + var math = require('mathjs'); +- Implemented support for implicit multiplication, like `math.eval('2a', {a:3})` + and `math.eval('(2+3)(1-3)')`. This changes behavior of matrix indexes as + well: an expression like `[...][...]` is not evaluated as taking a subset of + the first matrix, but as an implicit multiplication of two matrices. +- Removed utility function `ifElse`. This function is redundant now the + expression parser has a conditional operator `a ? b : c`. +- Fixed a bug with multiplying a number with a temperature, + like `math.eval('10 * celsius')`. +- Fixed a bug with symbols having value `undefined` not being evaluated. + +## 2014-06-20, version 0.24.1 + +- Something went wrong with publishing on npm. + +## 2014-06-20, version 0.24.0 + +- Added constant `null`. +- Functions `equal` and `unequal` support `null` and `undefined` now. +- Function `typeof` now recognizes regular expressions as well. +- Objects `Complex`, `Unit`, and `Help` now return their string representation + when calling `.valueOf()`. +- Changed the default number of significant digits for BigNumbers from 20 to 64. +- Changed the behavior of the conditional operator (a ? b : c) to lazy + evaluating. +- Fixed imported, wrapped functions not accepting `null` and `undefined` as + function arguments. + +## 2014-06-10, version 0.23.0 + +- Renamed some functions (everything now has a logical, camel case name): + - Renamed functions `edivide`, `emultiply`, and `epow` to `dotDivide`, + `dotMultiply`, and `dotPow` respectively. + - Renamed functions `smallereq` and `largereq` to `smallerEq` and `largerEq`. + - Renamed function `unary` to `unaryMinus` and added support for strings. +- `end` is now a reserved keyword which cannot be used as function or symbol + name in the expression parser, and is not allowed in the scope against which + an expression is evaluated. +- Implemented function `unaryPlus` and unary plus operator. +- Implemented function `deepEqual` for matrix comparisons. +- Added constant `phi`, the golden ratio (`phi = 1.618...`). +- Added constant `version`, returning the version number of math.js as string. +- Added unit `drop` (`gtt`). +- Fixed not being able to load math.js using AMD/require.js. +- Changed signature of `math.parse(expr, nodes)` to `math.parse(expr, options)` + where `options: {nodes: Object.}` +- Removed matrix support from conditional function `ifElse`. +- Removed automatic assignment of expression results to variable `ans`. + This functionality can be restored by pre- or postprocessing every evaluation, + something like: + + function evalWithAns (expr, scope) { + var ans = math.eval(expr, scope); + if (scope) { + scope.ans = ans; + } + return ans; + } + +## 2014-05-22, version 0.22.0 + +- Implemented support to export expressions to LaTeX. Thanks Niels Heisterkamp + (@nheisterkamp). +- Output of matrix multiplication is now consistently squeezed. +- Added reference documentation in the section /docs/reference. +- Fixed a bug in multiplying units without value with a number (like `5 * cm`). +- Fixed a bug in multiplying two matrices containing vectors (worked fine for + arrays). +- Fixed random functions not accepting Matrix as input, and always returning + a Matrix as output. + +## 2014-05-13, version 0.21.1 + +- Removed `crypto` library from the bundle. +- Deprecated functions `Parser.parse` and `Parser.compile`. Use + `math.parse` and `math.compile` instead. +- Fixed function `add` not adding strings and matrices element wise. +- Fixed parser not being able to evaluate an exponent followed by a unary minus + like `2^-3`, and a transpose followed by an index like `[3]'[1]`. + +## 2014-04-24, version 0.21.0 + +- Implemented trigonometric hyperbolic functions `cosh`, `coth`, `csch`, + `sech`, `sinh`, `tanh`. Thanks Rogelio J. Baucells (@rjbaucells). +- Added property `type` to all expression nodes in an expression tree. +- Fixed functions `log`, `log10`, `pow`, and `sqrt` not supporting complex + results from BigNumber input (like `sqrt(bignumber(-4))`). + +## 2014-04-16, version 0.20.0 + +- Switched to module `decimal.js` for BigNumber support, instead of + `bignumber.js`. +- Implemented support for polar coordinates to the `Complex` datatype. + Thanks Finn Pauls (@finnp). +- Implemented BigNumber support for functions `exp`, `log`, and `log10`. +- Implemented conditional operator `a ? b : c` in expression parser. +- Improved floating point comparison: the functions now check whether values + are nearly equal, against a configured maximum relative difference `epsilon`. + Thanks Rogelio J. Baucells (@rjbaucells). +- Implemented function `norm`. Thanks Rogelio J. Baucells (@rjbaucells). +- Improved function `ifElse`, is now specified for special data types too. +- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli). +- Implemented `BigNumber` support for functions `det` and `diag`. +- Added unit alias `lbs` (pound mass). +- Changed configuration option `decimals` to `precision` (applies to BigNumbers + only). +- Fixed support for element-wise comparisons between a string and a matrix. +- Fixed: expression parser now trows IndexErrors with one-based indices instead + of zero-based. +- Minor bug fixes. + +## 2014-03-30, version 0.19.0 + +- Implemented functions `compare`, `sum`, `prod`, `var`, `std`, `median`. +- Implemented function `ifElse` Thanks @mtraynham. +- Minor bug fixes. + +## 2014-02-15, version 0.18.1 + +- Added unit `feet`. +- Implemented function `compile` (shortcut for parsing and then compiling). +- Improved performance of function `pow` for matrices. Thanks @hamadu. +- Fixed broken auto completion in the command line interface. +- Fixed an error in function `combinations` for large numbers, and + improved performance of both functions `combinations` and `permutations`. + +## 2014-01-18, version 0.18.0 + +- Changed matrix index notation of expression parser from round brackets to + square brackets, for example `A[1, 1:3]` instead of `A(1, 1:3)`. +- Removed need to use the `function` keyword for function assignments in the + expression parser, you can define a function now like `f(x) = x^2`. +- Implemented a compilation step in the expression parser: expressions are + compiled into JavaScript, giving much better performance (easily 10x as fast). +- Renamed unit conversion function and operator `in` to `to`. Operator `in` is + still available in the expression parser as an alias for `to`. Added unit + `in`, an abbreviation for `inch`. Thanks Elijah Insua (@tmpvar). +- Added plurals and aliases for units. +- Implemented an argument `includeEnd` for function `range` (false by default). +- Ranges in the expression parser now support big numbers. +- Implemented functions `permutations` and `combinations`. + Thanks Daniel Levin (@daniel-levin). +- Added lower case abbreviation `l` for unit litre. + +## 2013-12-19, version 0.17.1 + +- Fixed a bug with negative temperatures. +- Fixed a bug with prefixes of units squared meter `m2` and cubic meter `m3`. + +## 2013-12-12, version 0.17.0 + +- Renamed and flattened configuration settings: + - `number.defaultType` is now `number`. + - `number.precision` is now `decimals`. + - `matrix.defaultType` is now `matrix`. +- Function `multiply` now consistently outputs a complex number on complex input. +- Fixed `mod` and `in` not working as function (only as operator). +- Fixed support for old browsers (IE8 and older), compatible when using es5-shim. +- Fixed support for Java's ScriptEngine. + +## 2013-11-28, version 0.16.0 + +- Implemented BigNumber support for arbitrary precision calculations. + Added settings `number.defaultType` and `number.precision` to configure + big numbers. +- Documentation is extended. +- Removed utility functions `isScalar`, `toScalar`, `isVector`, `toVector` + from `Matrix` and `Range`. Use `math.squeeze` and `math.size` instead. +- Implemented functions `get` and `set` on `Matrix`, for easier and faster + retrieval/replacement of elements in a matrix. +- Implemented function `resize`, handling matrices, scalars, and strings. +- Functions `ones` and `zeros` now return an empty matrix instead of a + number 1 or 0 when no arguments are provided. +- Implemented functions `min` and `max` for `Range` and `Index`. +- Resizing matrices now leaves new elements undefined by default instead of + filling them with zeros. Function `resize` now has an extra optional + parameter `defaultValue`. +- Range operator `:` in expression parser has been given a higher precedence. +- Functions don't allow arguments of unknown type anymore. +- Options be set when constructing a math.js instance or using the new function + `config(options`. Options are no longer accessible via `math.options`. +- Renamed `scientific` notation to `exponential` in function `format`. +- Function `format` outputs exponential notation with positive exponents now + always with `+` sign, so outputs `2.1e+3` instead of `2.1e3`. +- Fixed function `squeeze` not being able squeeze into a scalar. +- Some fixes and performance improvements in the `resize` and `subset` + functions. +- Function `size` now adheres to the option `matrix.defaultType` for scalar + input. +- Minor bug fixes. + +## 2013-10-26, version 0.15.0 + +- Math.js must be instantiated now, static calls are no longer supported. Usage: + - node.js: `var math = require('mathjs')();` + - browser: `var math = mathjs();` +- Implemented support for multiplying vectors with matrices. +- Improved number formatting: + - Function `format` now support various options: precision, different + notations (`fixed`, `scientific`, `auto`), and more. + - Numbers are no longer rounded to 5 digits by default when formatted. + - Implemented a function `format` for `Matrix`, `Complex`, `Unit`, `Range`, + and `Selector` to format using options. + - Function `format` does only stringify values now, and has a new parameter + `precision` to round to a specific number of digits. + - Removed option `math.options.precision`, + use `math.format(value [, precision])` instead. + - Fixed formatting numbers as scientific notation in some cases returning + a zero digit left from the decimal point. (like "0.33333e8" rather than + "3.3333e7"). Thanks @husayt. +- Implemented a function `print` to interpolate values in a template string, + this functionality was moved from the function `format`. +- Implemented statistics function `mean`. Thanks Guillermo Indalecio Fernandez + (@guillermobox). +- Extended and changed `max` and `min` for multi dimensional matrices: they now + return the maximum and minimum of the flattened array. An optional second + argument `dim` allows to calculate the `max` or `min` for specified dimension. +- Renamed option `math.options.matrix.default` to + `math.options.matrix.defaultType`. +- Removed support for comparing complex numbers in functions `smaller`, + `smallereq`, `larger`, `largereq`. Complex numbers cannot be ordered. + +## 2013-10-08, version 0.14.0 + +- Introduced an option `math.options.matrix.default` which can have values + `matrix` (default) or `array`. This option is used by the functions `eye`, + `ones`, `range`, and `zeros`, to determine the type of matrix output. +- Getting a subset of a matrix will automatically squeeze the resulting subset, + setting a subset of a matrix will automatically unsqueeze the given subset. +- Removed concatenation of nested arrays in the expression parser. + You can now input nested arrays like in JavaScript. Matrices can be + concatenated using the function `concat`. +- The matrix syntax `[...]` in the expression parser now creates 1 dimensional + matrices by default. `math.eval('[1,2,3,4]')` returns a matrix with + size `[4]`, `math.eval('[1,2;3,4]')` returns a matrix with size `[2,2]`. +- Documentation is restructured and extended. +- Fixed non working operator `mod` (modulus operator). + +## 2013-09-03, version 0.13.0 + +- Implemented support for booleans in all relevant functions. +- Implemented functions `map` and `forEach`. Thanks Sebastien Piquemal (@sebpic). +- All construction functions can be used to convert the type of variables, + also element-wise for all elements in an Array or Matrix. +- Changed matrix indexes of the expression parser to one-based with the + upper-bound included, similar to most math applications. Note that on a + JavaScript level, math.js uses zero-based indexes with excluded upper-bound. +- Removed support for scalars in the function `subset`, it now only supports + Array, Matrix, and String. +- Removed the functions `get` and `set` from a selector, they are a duplicate + of the function `subset`. +- Replaced functions `get` and `set` of `Matrix` with a single function + `subset`. +- Some moving around with code and namespaces: + - Renamed namespace `math.expr` to `math.expression` (contains Scope, Parser, + node objects). + - Renamed namespace `math.docs` to `math.expression.docs`. + - Moved `math.expr.Selector` to `math.chaining.Selector`. +- Fixed some edge cases in functions `lcm` and `xgcd`. + +## 2013-08-22, version 0.12.1 + +- Fixed outdated version of README.md. +- Fixed a broken unit test. + +## 2013-08-22, version 0.12.0 + +- Implemented functions `random([min, max])`, `randomInt([min, max])`, + `pickRandom(array)`. Thanks Sebastien Piquemal (@sebpic). +- Implemented function `distribution(name)`, generating a distribution object + with functions `random`, `randomInt`, `pickRandom` for different + distributions. Currently supporting `uniform` and `normal`. +- Changed the behavior of `range` to exclude the upper bound, so `range(1, 4)` + now returns `[1, 2, 3]` instead of `[1, 2, 3, 4]`. +- Changed the syntax of `range`, which is now `range(start, end [, step])` + instead of `range(start, [step, ] end)`. +- Changed the behavior of `ones` and `zeros` to geometric dimensions, for + example `ones(3)` returns a vector with length 3, filled with ones, and + `ones(3,3)` returns a 2D array with size [3, 3]. +- Changed the return type of `ones` and `zeros`: they now return an Array when + arguments are Numbers or an Array, and returns a Matrix when the argument + is a Matrix. +- Change matrix index notation in parser from round brackets to square brackets, + for example `A[0, 0:3]`. +- Removed the feature introduced in v0.10.0 to automatically convert a complex + value with an imaginary part equal to zero to a number. +- Fixed zeros being formatted as null. Thanks @TimKraft. + +## 2013-07-23, version 0.11.1 + +- Fixed missing development dependency + +## 2013-07-23, version 0.11.0 + +- Changed math.js from one-based to zero-based indexes. + - Getting and setting matrix subset is now zero-based. + - The dimension argument in function `concat` is now zero-based. +- Improvements in the string output of function help. +- Added constants `true` and `false`. +- Added constructor function `boolean`. +- Fixed function `select` not accepting `0` as input. + Thanks Elijah Manor (@elijahmanor). +- Parser now supports multiple unary minus operators after each other. +- Fixed not accepting empty matrices like `[[], []]`. +- Some fixes in the end user documentation. + +## 2013-07-08, version 0.10.0 + +- For complex calculations, all functions now automatically replace results + having an imaginary part of zero with a Number. (`2i * 2i` now returns a + Number `-4` instead of a Complex `-4 + 0i`). +- Implemented support for injecting custom node handlers in the parser. Can be + used for example to implement a node handler for plotting a graph. +- Implemented end user documentation and a new `help` function. +- Functions `size` and `squeeze` now return a Matrix instead of an Array as + output on Matrix input. +- Added a constant tau (2 * pi). Thanks Zak Zibrat (@palimpsests). +- Renamed function `unaryminus` to `unary`. +- Fixed a bug in determining node dependencies in function assignments. + +## 2013-06-14, version 0.9.1 + +- Implemented element-wise functions and operators: `emultiply` (`x .* y`), + `edivide` (`x ./ y`), `epow` (`x .^ y`). +- Added constants `Infinity` and `NaN`. +- Removed support for Workspace to keep the library focused on its core task. +- Fixed a bug in the Complex constructor, not accepting NaN values. +- Fixed division by zero in case of pure complex values. +- Fixed a bug in function multiply multiplying a pure complex value with + Infinity. + +## 2013-05-29, version 0.9.0 + +- Implemented function `math.parse(expr [,scope])`. Optional parameter scope can + be a plain JavaScript Object containing variables. +- Extended function `math.expr(expr [, scope])` with an additional parameter + `scope`, similar to `parse`. Example: `math.eval('x^a', {x:3, a:2});`. +- Implemented function `subset`, to get or set a subset from a matrix, string, + or other data types. +- Implemented construction functions number and string (mainly useful inside + the parser). +- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli). +- Moved the parse code from prototype math.expr.Parser to function math.parse, + simplified Parser a little bit. +- Strongly simplified the code of Scope and Workspace. +- Fixed function mod for negative numerators, and added error messages in case + of wrong input. + +## 2013-05-18, version 0.8.2 + +- Extended the import function and some other minor improvements. +- Fixed a bug in merging one dimensional vectors into a matrix. +- Fixed a bug in function subtract, when subtracting a complex number from a + real number. + +## 2013-05-10, version 0.8.1 + +- Fixed an npm warning when installing mathjs globally. + +## 2013-05-10, version 0.8.0 + +- Implemented a command line interface. When math.js is installed globally via + npm, the application is available on your system as 'mathjs'. +- Implemented `end` keyword for index operator, and added support for implicit + start and end (expressions like `a(2,:)` and `b(2:end,3:end-1)` are supported + now). +- Function math.eval is more flexible now: it supports variables and multi-line + expressions. +- Removed the read-only option from Parser and Scope. +- Fixed non-working unequal operator != in the parser. +- Fixed a bug in resizing matrices when replacing a subset. +- Fixed a bug in updating a subset of a non-existing variable. +- Minor bug fixes. + +## 2013-05-04, version 0.7.2 + +- Fixed method unequal, which was checking for equality instead of inequality. + Thanks @FJS2. + +## 2013-04-27, version 0.7.1 + +- Improvements in the parser: + - Added support for chained arguments. + - Added support for chained variable assignments. + - Added a function remove(name) to remove a variable from the parsers scope. + - Renamed nodes for more consistency and to resolve naming conflicts. + - Improved stringification of an expression tree. + - Some simplifications in the code. + - Minor bug fixes. +- Fixed a bug in the parser, returning NaN instead of throwing an error for a + number with multiple decimal separators like `2.3.4`. +- Fixed a bug in Workspace.insertAfter. +- Fixed: math.js now works on IE 6-8 too. + +## 2013-04-20, version 0.7.0 + +- Implemented method `math.eval`, which uses a readonly parser to evaluate + expressions. +- Implemented method `xgcd` (extended eucledian algorithm). Thanks Bart Kiers + (@bkiers). +- Improved math.format, which now rounds values to a maximum number of digits + instead of decimals (default is 5 digits, for example `math.format(math.pi)` + returns `3.1416`). +- Added examples. +- Changed methods square and cube to evaluate matrices element wise (consistent + with all other methods). +- Changed second parameter of method import to an object with options. +- Fixed method math.typeof on IE. +- Minor bug fixes and improvements. + +## 2013-04-13, version 0.6.0 + +- Implemented chained operations via method math.select(). For example + `math.select(3).add(4).subtract(2).done()` will return `5`. +- Implemented methods gcd and lcm. +- Implemented method `Unit.in(unit)`, which creates a clone of the unit with a + fixed representation. For example `math.unit('5.08 cm').in('inch')` will + return a unit which string representation always is in inch, thus `2 inch`. + `Unit.in(unit)` is the same as method `math.in(x, unit)`. +- Implemented `Unit.toNumber(unit)`, which returns the value of the unit when + represented with given unit. For example + `math.unit('5.08 cm').toNumber('inch')` returns the number `2`, as the + representation of the unit in inches has 2 as value. +- Improved: method `math.in(x, unit)` now supports a string as second parameter, + for example `math.in(math.unit('5.08 cm'), 'inch')`. +- Split the end user documentation of the parser functions from the source + files. +- Removed function help and the built-in documentation from the core library. +- Fixed constant i being defined as -1i instead of 1i. +- Minor bug fixes. + +## 2013-04-06, version 0.5.0 + +- Implemented data types Matrix and Range. +- Implemented matrix methods clone, concat, det, diag, eye, inv, ones, size, + squeeze, transpose, zeros. +- Implemented range operator `:`, and transpose operator `'` in parser. +- Changed: created construction methods for easy object creation for all data + types and for the parser. For example, a complex value is now created + with `math.complex(2, 3)` instead of `new math.Complex(2, 3)`, and a parser + is now created with `math.parser()` instead of `new math.parser.Parser()`. +- Changed: moved all data types under the namespace math.type, and moved the + Parser, Workspace, etc. under the namespace math.expr. +- Changed: changed operator precedence of the power operator: + - it is now right associative instead of left associative like most scripting + languages. So `2^3^4` is now calculated as `2^(3^4)`. + - it has now higher precedence than unary minus most languages, thus `-3^2` is + now calculated as `-(3^2)`. +- Changed: renamed the parsers method 'put' into 'set'. +- Fixed: method 'in' did not check for units to have the same base. + +## 2013-03-16, version 0.4.0 + +- Implemented Array support for all methods. +- Implemented Array support in the Parser. +- Implemented method format. +- Implemented parser for units, math.Unit.parse(str). +- Improved parser for complex values math.Complex.parse(str); +- Improved method help: it now evaluates the examples. +- Fixed: a scoping issue with the Parser when defining functions. +- Fixed: method 'typeof' was not working well with minified and mangled code. +- Fixed: errors in determining the best prefix for a unit. + +## 2013-03-09, version 0.3.0 + +- Implemented Workspace +- Implemented methods cot, csc, sec. +- Implemented Array support for methods with one parameter. + +## 2013-02-25, version 0.2.0 + +- Parser, Scope, and expression tree with Nodes implemented. +- Implemented method import which makes it easy to extend math.js. +- Implemented methods arg, conj, cube, equal, factorial, im, largereq, + log(x, base), log10, mod, re, sign, smallereq, square, unequal. + +## 2013-02-18, version 0.1.0 + +- Reached full compatibility with Javascripts built-in Math library. +- More functions implemented. +- Some bugfixes. + +## 2013-02-16, version 0.0.2 + +- All constants of Math implemented, plus the imaginary unit i. +- Data types Complex and Unit implemented. +- First set of functions implemented. + +## 2013-02-15, version 0.0.1 + +- First publish of the mathjs package. (package is still empty) diff --git a/24_10_22_faktorialis/node_modules/mathjs/LICENSE b/24_10_22_faktorialis/node_modules/mathjs/LICENSE new file mode 100644 index 0000000..9cf8c11 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/24_10_22_faktorialis/node_modules/mathjs/NOTICE b/24_10_22_faktorialis/node_modules/mathjs/NOTICE new file mode 100644 index 0000000..8aa6f0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/NOTICE @@ -0,0 +1,16 @@ +math.js +https://github.com/josdejong/mathjs + +Copyright (C) 2013-2024 Jos de Jong + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/24_10_22_faktorialis/node_modules/mathjs/README.md b/24_10_22_faktorialis/node_modules/mathjs/README.md new file mode 100644 index 0000000..5300f6b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/README.md @@ -0,0 +1,242 @@ +![math.js](https://raw.github.com/josdejong/mathjs/master/misc/img/mathjs.png) + +[https://mathjs.org](https://mathjs.org) + +Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. Powerful and easy to use. + +[![Version](https://img.shields.io/npm/v/mathjs.svg)](https://www.npmjs.com/package/mathjs) +[![Downloads](https://img.shields.io/npm/dm/mathjs.svg)](https://www.npmjs.com/package/mathjs) +[![Build Status](https://github.com/josdejong/mathjs/workflows/Node.js%20CI/badge.svg)](https://github.com/josdejong/mathjs/actions) +[![Maintenance](https://img.shields.io/maintenance/yes/2024.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity) +[![License](https://img.shields.io/github/license/josdejong/mathjs.svg)](https://github.com/josdejong/mathjs/blob/master/LICENSE) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs?ref=badge_shield) +[![Codecov](https://codecov.io/gh/josdejong/mathjs/branch/develop/graph/badge.svg)](https://codecov.io/gh/josdejong/mathjs) +[![Github Sponsor](https://img.shields.io/github/sponsors/josdejong +)](https://github.com/sponsors/josdejong) + +## Features + +- Supports numbers, bignumbers, bigints, complex numbers, fractions, units, strings, arrays, and matrices. +- Is compatible with JavaScript's built-in Math library. +- Contains a flexible expression parser. +- Does symbolic computation. +- Comes with a large set of built-in functions and constants. +- Can be used as a command line application as well. +- Runs on any JavaScript engine. +- Is easily extensible. +- Open source. + +## Usage + +Math.js can be used in both node.js and in the browser. + +Install math.js using [npm](https://www.npmjs.com/package/mathjs): + + npm install mathjs + +Or download mathjs via one of the CDN's listed on the downloads page: + +    [https://mathjs.org/download.html](https://mathjs.org/download.html#download) + +Math.js can be used similar to JavaScript's built-in Math library. Besides that, +math.js can evaluate +[expressions](https://mathjs.org/docs/expressions/index.html) +and supports +[chained operations](https://mathjs.org/docs/core/chaining.html). + +```js +import { + atan2, chain, derivative, e, evaluate, log, pi, pow, round, sqrt +} from 'mathjs' + +// functions and constants +round(e, 3) // 2.718 +atan2(3, -3) / pi // 0.75 +log(10000, 10) // 4 +sqrt(-4) // 2i +pow([[-1, 2], [3, 1]], 2) // [[7, 0], [0, 7]] +derivative('x^2 + x', 'x') // 2 * x + 1 + +// expressions +evaluate('12 / (2.3 + 0.7)') // 4 +evaluate('12.7 cm to inch') // 5 inch +evaluate('sin(45 deg) ^ 2') // 0.5 +evaluate('9 / 3 + 2i') // 3 + 2i +evaluate('det([-1, 2; 3, 1])') // -7 + +// chaining +chain(3) + .add(4) + .multiply(2) + .done() // 14 +``` + +See the [Getting Started](https://mathjs.org/docs/getting_started.html) for a more detailed tutorial. + + +## Browser support + +Math.js works on any [ES2020](https://262.ecma-international.org/11.0/) compatible JavaScript engine, including node.js, Chrome, Firefox, Safari, and Edge. + + +## Documentation + +- [Getting Started](https://mathjs.org/docs/getting_started.html) +- [Examples](https://mathjs.org/examples/index.html) +- [Overview](https://mathjs.org/docs/index.html) +- [History](https://mathjs.org/history.html) + + +## Build + +First clone the project from github: + + git clone git@github.com:josdejong/mathjs.git + cd mathjs + +Install the project dependencies: + + npm install + +Then, the project can be build by executing the build script via npm: + + npm run build + +This will build ESM output, CommonJS output, and the bundle math.js +from the source files and put them in the folder lib. + + +## Develop + +When developing new features for mathjs, it is good to be aware of the following background information. + +### Code + +The code of `mathjs` is written in ES modules, and requires all files to have a real, relative path, meaning the files must have a `*.js` extension. Please configure adding file extensions on auto import in your IDE. + +### Architecture + +What mathjs tries to achieve is to offer an environment where you can do calculations with mixed data types, +like multiplying a regular `number` with a `Complex` number or a `BigNumber`, and work with all of those in matrices. +Mathjs also allows to add a new data type with little effort. + +The solution that mathjs uses has two main ingredients: + +- **Typed functions**. All functions are created using [`typed-function`](https://github.com/josdejong/typed-function/). This makes it easier to (dynamically) create and extend a single function with new data types, automatically do type conversions on function inputs, etc. So, if you create function multiply for two `number`s, you can extend it with support for multiplying your own data type, say `MyDecimal`. If you define a conversion from `MyDecimal` to `number`, the typed-function will automatically allow you to multiply a `MyDecimal` with a `number`. + +- **Dependency injection**. When we have a function `multiply` with support for `MyDecimal`, thanks to the dependency injection, other functions using `multiply` under the hood, like `prod`, will automatically support `MyDecimal` too. This also works the other way around: if you don't need the heavyweight `multiply` (which supports BigNumbers, matrices, etc), and you just need a plain and simple number support, you can use a lightweight implementation of `multiply` just for numbers, and inject that in `prod` and other functions. + +At the lowest level, mathjs has immutable factory functions which create immutable functions. The core function `math.create(...)` creates a new instance having functions created from all passed factory functions. A mathjs instance is a collection of created functions. It contains a function like `math.import` to allow extending the instance with new functions, which can then be used in the expression parser. + +### Implementing a new function + +A common case is to implement a new function. This involves the following steps: + +- Implement the function in the right category, for example `./src/function/arithmetic/myNewFunction.js`, where you can replace `arithmetic` with the proper category, and `myNewFunction` with the name of the new function. Add the new function to the index files `./src/factoriesAny.js` and possibly `./src/factoriesNumber.js`. +- Write documentation on the function in the source code comment of `myNewFunction.js`. This documentation is used to auto generate documentation on the website. +- Write embedded documentation for the new function in `./src/expression/embeddedDocs/function/arithmetic/myNewFunction.js`. Add the new documentation to the index file `./src/expression/embeddedDocs/embeddedDocs.js`. +- Write unit tests for the function in `./test/unit-tests/function/arithmetic/myNewFunction.test.js`. +- Write the necessary TypeScript definitions for the new function in `./types/index.d.ts`, and write tests for it in `./test/typescript-tests/testTypes.ts`. This is described in [./types/EXPLANATION.md](./types/EXPLANATION.md). +- Ensure the code style is ok by running `npm run lint` (run `npm run format` to fix the code style automatically). + + +### Build scripts + +The build script currently generates two types of output: + +- **any**, generate entry points to create full versions of all functions +- **number**: generating and entry points to create lightweight functions just supporting `number` + +For each function, an object is generated containing the factory functions of all dependencies of the function. This allows to just load a specific set of functions, and not load or bundle any other functionality. So for example, to just create function `add` you can do `math.create(addDependencies)`. + + +## Test + +To execute tests for the library, install the project dependencies once: + + npm install + +Then, the tests can be executed: + + npm test + +To test the type definitions: + + npm run test:types + +Additionally, the tests can be run on FireFox using [headless mode](https://developer.mozilla.org/en-US/Firefox/Headless_mode): + + npm run test:browser + +To run the tests remotely on BrowserStack, first set the environment variables `BROWSER_STACK_USERNAME` and `BROWSER_STACK_ACCESS_KEY` with your username and access key and then execute: + + npm run test:browserstack + +You can separately run the code linter, though it is also executed with `npm test`: + + npm run lint + +To automatically fix linting issue, run: + + npm run format + +To test code coverage of the tests: + + npm run coverage + +To see the coverage results, open the generated report in your browser: + + ./coverage/lcov-report/index.html + + +### Continuous integration testing + +Continuous integration tests are run on [Github Actions](https://github.com/josdejong/mathjs/actions) and [BrowserStack](https://www.browserstack.com) every time a commit is pushed to github. Github Actions runs the tests for different versions of node.js, and BrowserStack runs the tests on all major browsers. + +[![BrowserStack](https://raw.github.com/josdejong/mathjs/master/misc/browserstack.png)](https://www.browserstack.com) + +Thanks Github Actions and BrowserStack for the generous free hosting of this open source project! + +## License + +mathjs is published under the Apache 2.0 license: + +``` +Copyright (C) 2013-2024 Jos de Jong + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +mathjs contains a JavaScript port of the [CSparse](https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source) library, published under the LGPL-2.1+ license: + +``` +CSparse: a Concise Sparse matrix package. +Copyright (c) 2006, Timothy A. Davis. +http://www.suitesparse.com + +-------------------------------------------------------------------------------- + +CSparse is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +CSparse is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this Module; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +``` diff --git a/24_10_22_faktorialis/node_modules/mathjs/bin/cli.js b/24_10_22_faktorialis/node_modules/mathjs/bin/cli.js new file mode 100644 index 0000000..6d31390 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/bin/cli.js @@ -0,0 +1,446 @@ +#!/usr/bin/env node +/** + * math.js + * https://github.com/josdejong/mathjs + * + * Math.js is an extensive math library for JavaScript and Node.js, + * It features real and complex numbers, units, matrices, a large set of + * mathematical functions, and a flexible expression parser. + * + * Usage: + * + * mathjs [scriptfile(s)] {OPTIONS} + * + * Options: + * + * --version, -v Show application version + * --help, -h Show this message + * --tex Generate LaTeX instead of evaluating + * --string Generate string instead of evaluating + * --parenthesis= Set the parenthesis option to + * either of "keep", "auto" and "all" + * + * Example usage: + * mathjs Open a command prompt + * mathjs 1+2 Evaluate expression + * mathjs script.txt Run a script file + * mathjs script1.txt script2.txt Run two script files + * mathjs script.txt > results.txt Run a script file, output to file + * cat script.txt | mathjs Run input stream + * cat script.txt | mathjs > results.txt Run input stream, output to file + * + * @license + * Copyright (C) 2013-2024 Jos de Jong + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +const fs = require('fs') +const path = require('path') +const { createEmptyMap } = require('../lib/cjs/utils/map.js') +let scope = createEmptyMap() + +const PRECISION = 14 // decimals + +/** + * "Lazy" load math.js: only require when we actually start using it. + * This ensures the cli application looks like it loads instantly. + * When requesting help or version number, math.js isn't even loaded. + * @return {{ evalute: function, parse: function, math: Object }} + */ +function getMath () { + const { create, all } = require('../lib/browser/math.js') + + const math = create(all) + const parse = math.parse + const evaluate = math.evaluate + + // See https://mathjs.org/docs/expressions/security.html#less-vulnerable-expression-parser + math.import({ + 'import': function () { throw new Error('Function import is disabled') }, + 'createUnit': function () { throw new Error('Function createUnit is disabled') }, + 'reviver': function () { throw new Error('Function reviver is disabled') } + }, { override: true }) + + return { math, parse, evaluate } +} + +/** + * Helper function to format a value. Regular numbers will be rounded + * to 14 digits to prevent round-off errors from showing up. + * @param {*} value + */ +function format (value) { + const { math } = getMath() + + return math.format(value, { + fn: function (value) { + if (typeof value === 'number') { + // round numbers + return math.format(value, PRECISION) + } else { + return math.format(value) + } + } + }) +} + +/** + * auto complete a text + * @param {String} text + * @return {[Array, String]} completions + */ +function completer (text) { + const { math } = getMath() + let matches = [] + let keyword + const m = /[a-zA-Z_0-9]+$/.exec(text) + if (m) { + keyword = m[0] + + // scope variables + for (const def in scope.keys()) { + if (def.indexOf(keyword) === 0) { + matches.push(def) + } + } + + // commandline keywords + ['exit', 'quit', 'clear'].forEach(function (cmd) { + if (cmd.indexOf(keyword) === 0) { + matches.push(cmd) + } + }) + + // math functions and constants + const ignore = ['expr', 'type'] + for (const func in math.expression.mathWithTransform) { + if (hasOwnProperty(math.expression.mathWithTransform, func)) { + if (func.indexOf(keyword) === 0 && !ignore.includes(func)) { + matches.push(func) + } + } + } + + // units + const Unit = math.Unit + for (const name in Unit.UNITS) { + if (hasOwnProperty(Unit.UNITS, name)) { + if (name.indexOf(keyword) === 0) { + matches.push(name) + } + } + } + for (const name in Unit.PREFIXES) { + if (hasOwnProperty(Unit.PREFIXES, name)) { + const prefixes = Unit.PREFIXES[name] + for (const prefix in prefixes) { + if (hasOwnProperty(prefixes, prefix)) { + if (prefix.indexOf(keyword) === 0) { + matches.push(prefix) + } else if (keyword.indexOf(prefix) === 0) { + const unitKeyword = keyword.substring(prefix.length) + for (const n in Unit.UNITS) { + if (hasOwnProperty(Unit.UNITS, n)) { + if (n.indexOf(unitKeyword) === 0 && + Unit.isValuelessUnit(prefix + n)) { + matches.push(prefix + n) + } + } + } + } + } + } + } + } + + // remove duplicates + matches = matches.filter(function (elem, pos, arr) { + return arr.indexOf(elem) === pos + }) + } + + return [matches, keyword] +} + +/** + * Run stream, read and evaluate input and stream that to output. + * Text lines read from the input are evaluated, and the results are send to + * the output. + * @param input Input stream + * @param output Output stream + * @param mode Output mode + * @param parenthesis Parenthesis option + */ +function runStream (input, output, mode, parenthesis) { + const readline = require('readline') + const rl = readline.createInterface({ + input: input || process.stdin, + output: output || process.stdout, + completer: completer + }) + + if (rl.output.isTTY) { + rl.setPrompt('> ') + rl.prompt() + } + + // load math.js now, right *after* loading the prompt. + const { math, parse } = getMath() + + // TODO: automatic insertion of 'ans' before operators like +, -, *, / + + rl.on('line', function (line) { + const expr = line.trim() + + switch (expr.toLowerCase()) { + case 'quit': + case 'exit': + // exit application + rl.close() + break + case 'clear': + // clear memory + scope = createEmptyMap() + console.log('memory cleared') + + // get next input + if (rl.output.isTTY) { + rl.prompt() + } + break + default: + if (!expr) { + break + } + switch (mode) { + case 'evaluate': + // evaluate expression + try { + let node = parse(expr) + let res = node.evaluate(scope) + + if (math.isResultSet(res)) { + // we can have 0 or 1 results in the ResultSet, as the CLI + // does not allow multiple expressions separated by a return + res = res.entries[0] + node = node.blocks + .filter(function (entry) { return entry.visible }) + .map(function (entry) { return entry.node })[0] + } + + if (node) { + if (math.isAssignmentNode(node)) { + const name = findSymbolName(node) + if (name !== null) { + const value = scope.get(name) + scope.set('ans', value) + console.log(name + ' = ' + format(value)) + } else { + scope.set('ans', res) + console.log(format(res)) + } + } else if (math.isHelp(res)) { + console.log(res.toString()) + } else { + scope.set('ans', res) + console.log(format(res)) + } + } + } catch (err) { + console.log(err.toString()) + } + break + + case 'string': + try { + const string = math.parse(expr).toString({ parenthesis: parenthesis }) + console.log(string) + } catch (err) { + console.log(err.toString()) + } + break + + case 'tex': + try { + const tex = math.parse(expr).toTex({ parenthesis: parenthesis }) + console.log(tex) + } catch (err) { + console.log(err.toString()) + } + break + } + } + + // get next input + if (rl.output.isTTY) { + rl.prompt() + } + }) + + rl.on('close', function () { + console.log() + process.exit(0) + }) +} + +/** + * Find the symbol name of an AssignmentNode. Recurses into the chain of + * objects to the root object. + * @param {AssignmentNode} node + * @return {string | null} Returns the name when found, else returns null. + */ +function findSymbolName (node) { + const { math } = getMath() + let n = node + + while (n) { + if (math.isSymbolNode(n)) { + return n.name + } + n = n.object + } + + return null +} + +/** + * Output application version number. + * Version number is read version from package.json. + */ +function outputVersion () { + fs.readFile(path.join(__dirname, '/../package.json'), function (err, data) { + if (err) { + console.log(err.toString()) + } else { + const pkg = JSON.parse(data) + const version = pkg && pkg.version ? pkg.version : 'unknown' + console.log(version) + } + process.exit(0) + }) +} + +/** + * Output a help message + */ +function outputHelp () { + console.log('math.js') + console.log('https://mathjs.org') + console.log() + console.log('Math.js is an extensive math library for JavaScript and Node.js. It features ') + console.log('real and complex numbers, units, matrices, a large set of mathematical') + console.log('functions, and a flexible expression parser.') + console.log() + console.log('Usage:') + console.log(' mathjs [scriptfile(s)|expression] {OPTIONS}') + console.log() + console.log('Options:') + console.log(' --version, -v Show application version') + console.log(' --help, -h Show this message') + console.log(' --tex Generate LaTeX instead of evaluating') + console.log(' --string Generate string instead of evaluating') + console.log(' --parenthesis= Set the parenthesis option to') + console.log(' either of "keep", "auto" and "all"') + console.log() + console.log('Example usage:') + console.log(' mathjs Open a command prompt') + console.log(' mathjs 1+2 Evaluate expression') + console.log(' mathjs script.txt Run a script file') + console.log(' mathjs script.txt script2.txt Run two script files') + console.log(' mathjs script.txt > results.txt Run a script file, output to file') + console.log(' cat script.txt | mathjs Run input stream') + console.log(' cat script.txt | mathjs > results.txt Run input stream, output to file') + console.log() + process.exit(0) +} + +/** + * Process input and output, based on the command line arguments + */ +const scripts = [] // queue of scripts that need to be processed +let mode = 'evaluate' // one of 'evaluate', 'tex' or 'string' +let parenthesis = 'keep' +let version = false +let help = false + +process.argv.forEach(function (arg, index) { + if (index < 2) { + return + } + + switch (arg) { + case '-v': + case '--version': + version = true + break + + case '-h': + case '--help': + help = true + break + + case '--tex': + mode = 'tex' + break + + case '--string': + mode = 'string' + break + + case '--parenthesis=keep': + parenthesis = 'keep' + break + + case '--parenthesis=auto': + parenthesis = 'auto' + break + + case '--parenthesis=all': + parenthesis = 'all' + break + + // TODO: implement configuration via command line arguments + + default: + scripts.push(arg) + } +}) + +if (version) { + outputVersion() +} else if (help) { + outputHelp() +} else if (scripts.length === 0) { + // run a stream, can be user input or pipe input + runStream(process.stdin, process.stdout, mode, parenthesis) +} else { + fs.stat(scripts[0], function (err) { + if (err) { + const { evaluate } = getMath() + console.log(evaluate(scripts.join(' ')).toString()) + } else { + // work through the queue of scripts + scripts.forEach(function (arg) { + // run a script file + runStream(fs.createReadStream(arg), process.stdout, mode, parenthesis) + }) + } + }) +} + +// helper function to safely check whether an object as a property +// copy from the function in object.js which is ES6 +function hasOwnProperty (object, property) { + return object && Object.hasOwnProperty.call(object, property) +} diff --git a/24_10_22_faktorialis/node_modules/mathjs/bin/package.json b/24_10_22_faktorialis/node_modules/mathjs/bin/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/bin/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/24_10_22_faktorialis/node_modules/mathjs/bin/repl.js b/24_10_22_faktorialis/node_modules/mathjs/bin/repl.js new file mode 100644 index 0000000..9ad06fe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/bin/repl.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node + +/* + * This simply preloads mathjs and drops you into a REPL to + * help interactive debugging. + **/ +global.math = require('../lib/browser/math.js') +const repl = require('repl') + +repl.start({ useGlobal: true }) diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js new file mode 100644 index 0000000..1e35332 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js @@ -0,0 +1,3 @@ +/*! For license information please see math.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,(()=>(()=>{var e={5716:function(e,t){var r;!function(){"use strict";var n=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},i=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function a(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}function s(e,t){if(!(this instanceof s))return new s(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return s.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return s.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&o();for(var u=0;u0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}s.prototype={re:0,im:0,sign:function(){var e=this.abs();return new s(this.re/e,this.im/e)},add:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:0===r.im&&0===this.im?new s(this.re*r.re,0):new s(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new s(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return s.NAN;if(this.isInfinite()||r.isZero())return s.INFINITY;if(this.isZero()||r.isInfinite())return s.ZERO;e=this.re,t=this.im;var n,i,o=r.re,a=r.im;return 0===a?new s(e/o,t/o):Math.abs(o)0)return new s(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new s(Math.pow(t,r.re),0);case 1:return new s(0,Math.pow(t,r.re));case 2:return new s(-Math.pow(t,r.re),0);case 3:return new s(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return s.ZERO;var n=Math.atan2(t,e),i=a(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new s(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,i=this.abs();if(r>=0){if(0===n)return new s(Math.sqrt(r),0);e=.5*Math.sqrt(2*(i+r))}else e=Math.abs(n)/Math.sqrt(2*(i-r));return t=r<=0?.5*Math.sqrt(2*(i-r)):Math.abs(n)/Math.sqrt(2*(i+r)),new s(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new s(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new s(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new s(a(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r1&&0===t,n=1-e,i=1+e,o=n*n+t*t,u=0!==o?new s((i*n-t*t)/o,(t*n+i*t)/o):new s(-1!==e?e/0:0,0!==t?t/0:0),c=u.re;return u.re=a(u.re,u.im)/2,u.im=Math.atan2(u.im,c)/2,r&&(u.im=-u.im),u},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).atanh():new s(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new s(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).asinh():new s(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return s.INFINITY;var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).acosh():new s(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new s(e/r,-t/r)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new s(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new s(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new s(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new s(e,t);return Math.abs(r.re-this.re)<=s.EPSILON&&Math.abs(r.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e){"use strict";var t=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},a=o.preserveFormatting,s=void 0!==a&&a,u=o.escapeMapFn,c=void 0===u?i:u,l=String(e),f="",p=c(t({},r),s?t({},n):{}),m=Object.keys(p),d=function(){var e=!1;m.forEach((function(t,r){e||l.length>=t.length&&l.slice(0,t.length)===t&&(f+=p[m[r]],l=l.slice(t.length,l.length),e=!0)})),e||(f+=l.slice(0,1),l=l.slice(1,l.length))};l;)d();return f}},1880:e=>{e.exports=function e(t,r){"use strict";var n,i,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},f=l(t).replace(a,"")||"",p=l(r).replace(a,"")||"",m=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=p.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(f.match(u),16)||1!==m.length&&f.match(s)&&Date.parse(f),g=parseInt(p.match(u),16)||h&&p.match(s)&&Date.parse(p)||null;if(g){if(hg)return 1}for(var y=0,x=Math.max(m.length,d.length);yi)return 1}return 0}},7391:(e,t,r)=>{var n=r(7180),i=r(3181),o=r(3031),a=r(9067),s=r(6833),u=r(6098),c=r(4801);c.alea=n,c.xor128=i,c.xorwow=o,c.xorshift7=a,c.xor4096=s,c.tychei=u,e.exports=c},7180:function(e,t,r){var n;!function(e,i){function o(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var r=new o(e),n=t&&t.state,i=r.next;return i.int32=function(){return 4294967296*r.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.alea=s}(0,e=r.nmd(e),r.amdD)},6098:function(e,t,r){var n;!function(e,i){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,i=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.tychei=s}(0,e=r.nmd(e),r.amdD)},3181:function(e,t,r){var n;!function(e,i){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor128=s}(0,e=r.nmd(e),r.amdD)},6833:function(e,t,r){var n;!function(e,i){function o(e){var t=this;t.next=function(){var e,r,n=t.w,i=t.X,o=t.i;return t.w=n=n+1640531527|0,r=i[o+34&127],e=i[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=i[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,i,o,a,s=[],u=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,u=Math.max(u,t.length)),i=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(a=a+1640531527|0,i=0==(r=s[127&o]^=n+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)n=s[i+34&127],r=s[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[i]=n^r;e.w=a,e.X=s,e.i=i}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.X&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor4096=s}(0,e=r.nmd(e),r.amdD)},9067:function(e,t,r){var n;!function(e,i){function o(e){var t=this;t.next=function(){var e,r,n=t.x,i=t.i;return e=n[i],r=(e^=e>>>7)^e<<24,r^=(e=n[i+1&7])^e>>>10,r^=(e=n[i+3&7])^e>>>3,r^=(e=n[i+4&7])^e<<7,e=n[i+7&7],r^=(e^=e<<13)^e<<9,n[i]=r,t.i=i+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.x&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorshift7=s}(0,e=r.nmd(e),r.amdD)},3031:function(e,t,r){var n;!function(e,i){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorwow=s}(0,e=r.nmd(e),r.amdD)},4801:function(e,t,r){var n;!function(i,o,a){var s,u=256,c=a.pow(u,6),l=a.pow(2,52),f=2*l,p=u-1;function m(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,x(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(u):(e=new Uint8Array(u),(i.crypto||i.msCrypto).getRandomValues(e)),x(e)}catch(e){var t=i.navigator,r=t&&t.plugins;return[+new Date,i,r,i.screen,x(o)]}}():e,3),n),m=new d(n),b=function(){for(var e=m.g(6),t=c,r=0;e=f;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|m.g(4)},b.quick=function(){return m.g(4)/4294967296},b.double=b,y(x(m.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&h(n,m),e.state=function(){return h(m,{})}),r?(a.random=e,t):e})(b,p,"global"in t?t.global:this==a,t.state)}function d(e){var t,r=e.length,n=this,i=0,o=n.i=n.j=0,a=n.S=[];for(r||(e=[r++]);i{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n{},9306:(e,t,r)=>{"use strict";var n=r(4901),i=r(6823),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not a function")}},5548:(e,t,r)=>{"use strict";var n=r(3517),i=r(6823),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not a constructor")}},3506:(e,t,r)=>{"use strict";var n=r(3925),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},6469:(e,t,r)=>{"use strict";var n=r(8227),i=r(2360),o=r(4913).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},7829:(e,t,r)=>{"use strict";var n=r(8183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},679:(e,t,r)=>{"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},8551:(e,t,r)=>{"use strict";var n=r(34),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not an object")}},9617:(e,t,r)=>{"use strict";var n=r(5397),i=r(5610),o=r(6198),a=function(e){return function(t,r,a){var s=n(t),u=o(s);if(0===u)return!e&&-1;var c,l=i(a,u);if(e&&r!=r){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4598:(e,t,r)=>{"use strict";var n=r(9039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},926:(e,t,r)=>{"use strict";var n=r(9306),i=r(8981),o=r(7055),a=r(6198),s=TypeError,u="Reduce of empty array with no initial value",c=function(e){return function(t,r,c,l){var f=i(t),p=o(f),m=a(f);if(n(r),0===m&&c<2)throw new s(u);var d=e?m-1:0,h=e?-1:1;if(c<2)for(;;){if(d in p){l=p[d],d+=h;break}if(d+=h,e?d<0:m<=d)throw new s(u)}for(;e?d>=0:m>d;d+=h)d in p&&(l=r(l,p[d],d,f));return l}};e.exports={left:c(!1),right:c(!0)}},7680:(e,t,r)=>{"use strict";var n=r(9504);e.exports=n([].slice)},4488:(e,t,r)=>{"use strict";var n=r(7680),i=Math.floor,o=function(e,t){var r=e.length;if(r<8)for(var a,s,u=1;u0;)e[s]=e[--s];s!==u++&&(e[s]=a)}else for(var c=i(r/2),l=o(n(e,0,c),t),f=o(n(e,c),t),p=l.length,m=f.length,d=0,h=0;d{"use strict";var n=r(8227)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},2195:(e,t,r)=>{"use strict";var n=r(9504),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},6955:(e,t,r)=>{"use strict";var n=r(2140),i=r(4901),o=r(2195),a=r(8227)("toStringTag"),s=Object,u="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:u?o(t):"Object"===(n=o(t))&&i(t.callee)?"Arguments":n}},7740:(e,t,r)=>{"use strict";var n=r(9297),i=r(5031),o=r(7347),a=r(4913);e.exports=function(e,t,r){for(var s=i(t),u=a.f,c=o.f,l=0;l{"use strict";var n=r(3724),i=r(4913),o=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4659:(e,t,r)=>{"use strict";var n=r(3724),i=r(4913),o=r(6980);e.exports=function(e,t,r){n?i.f(e,t,o(0,r)):e[t]=r}},2106:(e,t,r)=>{"use strict";var n=r(283),i=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},6840:(e,t,r)=>{"use strict";var n=r(4901),i=r(4913),o=r(283),a=r(9433);e.exports=function(e,t,r,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:t;if(n(r)&&o(r,c,s),s.global)u?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:(e,t,r)=>{"use strict";var n=r(4576),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},4606:(e,t,r)=>{"use strict";var n=r(6823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+n(t)+" of "+n(e))}},3724:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(e,t,r)=>{"use strict";var n=r(4576),i=r(34),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3709:(e,t,r)=>{"use strict";var n=r(2839).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},3763:(e,t,r)=>{"use strict";var n=r(2839);e.exports=/MSIE|Trident/.test(n)},4265:(e,t,r)=>{"use strict";var n=r(2839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},9544:(e,t,r)=>{"use strict";var n=r(2839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},6193:(e,t,r)=>{"use strict";var n=r(4215);e.exports="NODE"===n},7860:(e,t,r)=>{"use strict";var n=r(2839);e.exports=/web0s(?!.*chrome)/i.test(n)},2839:(e,t,r)=>{"use strict";var n=r(4576).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},9519:(e,t,r)=>{"use strict";var n,i,o=r(4576),a=r(2839),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},3607:(e,t,r)=>{"use strict";var n=r(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},4215:(e,t,r)=>{"use strict";var n=r(4576),i=r(2839),o=r(2195),a=function(e){return i.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},6518:(e,t,r)=>{"use strict";var n=r(4576),i=r(7347).f,o=r(6699),a=r(6840),s=r(9433),u=r(7740),c=r(2796);e.exports=function(e,t){var r,l,f,p,m,d=e.target,h=e.global,g=e.stat;if(r=h?n:g?n[d]||s(d,{}):n[d]&&n[d].prototype)for(l in t){if(p=t[l],f=e.dontCallGetSet?(m=i(r,l))&&m.value:r[l],!c(h?l:d+(g?".":"#")+l,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(e.sham||f&&f.sham)&&o(p,"sham",!0),a(r,l,p,e)}}},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9228:(e,t,r)=>{"use strict";r(7495);var n=r(9565),i=r(6840),o=r(7323),a=r(9039),s=r(8227),u=r(6699),c=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,f){var p=s(e),m=!a((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),d=m&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!m||!d||r){var h=/./[p],g=t(p,""[e],(function(e,t,r,i,a){var s=t.exec;return s===o||s===l.exec?m&&!a?{done:!0,value:n(h,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(l,p,g[1])}f&&u(l[p],"sham",!0)}},8745:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},6080:(e,t,r)=>{"use strict";var n=r(7476),i=r(9306),o=r(616),a=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},616:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},350:(e,t,r)=>{"use strict";var n=r(3724),i=r(9297),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,c=s&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},6706:(e,t,r)=>{"use strict";var n=r(9504),i=r(9306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},7476:(e,t,r)=>{"use strict";var n=r(2195),i=r(9504);e.exports=function(e){if("Function"===n(e))return i(e)}},9504:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},7751:(e,t,r)=>{"use strict";var n=r(4576),i=r(4901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},851:(e,t,r)=>{"use strict";var n=r(6955),i=r(5966),o=r(4117),a=r(6269),s=r(8227)("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||a[n(e)]}},81:(e,t,r)=>{"use strict";var n=r(9565),i=r(9306),o=r(8551),a=r(6823),s=r(851),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(i(r))return o(n(r,e));throw new u(a(e)+" is not iterable")}},6933:(e,t,r)=>{"use strict";var n=r(9504),i=r(4376),o=r(4901),a=r(2195),s=r(655),u=n([].push);e.exports=function(e){if(o(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n{"use strict";var n=r(9306),i=r(4117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2478:(e,t,r)=>{"use strict";var n=r(9504),i=r(8981),o=Math.floor,a=n("".charAt),s=n("".replace),u=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,f,p){var m=r+e.length,d=n.length,h=l;return void 0!==f&&(f=i(f),h=c),s(p,h,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,r);case"'":return u(t,m);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>d){var p=o(l/10);return 0===p?i:p<=d?void 0===n[p-1]?a(s,1):n[p-1]+a(s,1):i}c=n[l-1]}return void 0===c?"":c}))}},4576:function(e){"use strict";var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,r)=>{"use strict";var n=r(9504),i=r(8981),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},421:e=>{"use strict";e.exports={}},3138:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},397:(e,t,r)=>{"use strict";var n=r(7751);e.exports=n("document","documentElement")},5917:(e,t,r)=>{"use strict";var n=r(3724),i=r(9039),o=r(4055);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7055:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),o=r(2195),a=Object,s=n("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},3167:(e,t,r)=>{"use strict";var n=r(4901),i=r(34),o=r(2967);e.exports=function(e,t,r){var a,s;return o&&n(a=t.constructor)&&a!==r&&i(s=a.prototype)&&s!==r.prototype&&o(e,s),e}},3706:(e,t,r)=>{"use strict";var n=r(9504),i=r(4901),o=r(7629),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},1181:(e,t,r)=>{"use strict";var n,i,o,a=r(8622),s=r(4576),u=r(34),c=r(6699),l=r(9297),f=r(7629),p=r(6119),m=r(421),d="Object already initialized",h=s.TypeError,g=s.WeakMap;if(a||f.state){var y=f.state||(f.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw new h(d);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var x=p("state");m[x]=!0,n=function(e,t){if(l(e,x))throw new h(d);return t.facade=e,c(e,x,t),t},i=function(e){return l(e,x)?e[x]:{}},o=function(e){return l(e,x)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw new h("Incompatible receiver, "+e+" required");return r}}}},4209:(e,t,r)=>{"use strict";var n=r(8227),i=r(6269),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},4376:(e,t,r)=>{"use strict";var n=r(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},3517:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),o=r(4901),a=r(6955),s=r(7751),u=r(3706),c=function(){},l=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=n(f.exec),m=!f.test(c),d=function(e){if(!o(e))return!1;try{return l(c,[],e),!0}catch(e){return!1}},h=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!p(f,u(e))}catch(e){return!0}};h.sham=!0,e.exports=!l||i((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?h:d},2796:(e,t,r)=>{"use strict";var n=r(9039),i=r(4901),o=/#|\.prototype\./,a=function(e,t){var r=u[s(e)];return r===l||r!==c&&(i(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},4117:e=>{"use strict";e.exports=function(e){return null==e}},34:(e,t,r)=>{"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},3925:(e,t,r)=>{"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},6395:e=>{"use strict";e.exports=!1},788:(e,t,r)=>{"use strict";var n=r(34),i=r(2195),o=r(8227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===i(e))}},757:(e,t,r)=>{"use strict";var n=r(7751),i=r(4901),o=r(1625),a=r(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&o(t.prototype,s(e))}},2652:(e,t,r)=>{"use strict";var n=r(6080),i=r(9565),o=r(8551),a=r(6823),s=r(4209),u=r(6198),c=r(1625),l=r(81),f=r(851),p=r(9539),m=TypeError,d=function(e,t){this.stopped=e,this.result=t},h=d.prototype;e.exports=function(e,t,r){var g,y,x,b,v,w,N,E=r&&r.that,A=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_RECORD),M=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=n(t,E),D=function(e){return g&&p(g,"normal",e),new d(!0,e)},F=function(e){return A?(o(e),C?T(e[0],e[1],D):T(e[0],e[1])):C?T(e,D):T(e)};if(S)g=e.iterator;else if(M)g=e;else{if(!(y=f(e)))throw new m(a(e)+" is not iterable");if(s(y)){for(x=0,b=u(e);b>x;x++)if((v=F(e[x]))&&c(h,v))return v;return new d(!1)}g=l(e,y)}for(w=S?e.next:g.next;!(N=i(w,g)).done;){try{v=F(N.value)}catch(e){p(g,"throw",e)}if("object"==typeof v&&v&&c(h,v))return v}return new d(!1)}},9539:(e,t,r)=>{"use strict";var n=r(9565),i=r(8551),o=r(5966);e.exports=function(e,t,r){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return i(a),r}},6269:e=>{"use strict";e.exports={}},6198:(e,t,r)=>{"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},283:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),o=r(4901),a=r(9297),s=r(3724),u=r(350).CONFIGURABLE,c=r(3706),l=r(1181),f=l.enforce,p=l.get,m=String,d=Object.defineProperty,h=n("".slice),g=n("".replace),y=n([].join),x=s&&!i((function(){return 8!==d((function(){}),"length",{value:8}).length})),b=String(String).split("String"),v=e.exports=function(e,t,r){"Symbol("===h(m(t),0,7)&&(t="["+g(m(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t),x&&r&&a(r,"arity")&&e.length!==r.arity&&d(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=f(e);return a(n,"source")||(n.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&p(this).source||c(this)}),"toString")},741:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},1955:(e,t,r)=>{"use strict";var n,i,o,a,s,u=r(4576),c=r(3389),l=r(6080),f=r(9225).set,p=r(8265),m=r(9544),d=r(4265),h=r(7860),g=r(6193),y=u.MutationObserver||u.WebKitMutationObserver,x=u.document,b=u.process,v=u.Promise,w=c("queueMicrotask");if(!w){var N=new p,E=function(){var e,t;for(g&&(e=b.domain)&&e.exit();t=N.get();)try{t()}catch(e){throw N.head&&n(),e}e&&e.enter()};m||g||h||!y||!x?!d&&v&&v.resolve?((a=v.resolve(void 0)).constructor=v,s=l(a.then,a),n=function(){s(E)}):g?n=function(){b.nextTick(E)}:(f=l(f,u),n=function(){f(E)}):(i=!0,o=x.createTextNode(""),new y(E).observe(o,{characterData:!0}),n=function(){o.data=i=!i}),w=function(e){N.head||n(),N.add(e)}}e.exports=w},6043:(e,t,r)=>{"use strict";var n=r(9306),i=TypeError,o=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new o(e)}},2360:(e,t,r)=>{"use strict";var n,i=r(8551),o=r(6801),a=r(8727),s=r(421),u=r(397),c=r(4055),l=r(6119),f="prototype",p="script",m=l("IE_PROTO"),d=function(){},h=function(e){return"<"+p+">"+e+""},g=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;y="undefined"!=typeof document?document.domain&&n?g(n):(t=c("iframe"),r="java"+p+":",t.style.display="none",u.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):g(n);for(var i=a.length;i--;)delete y[f][a[i]];return y()};s[m]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(d[f]=i(e),r=new d,d[f]=null,r[m]=e):r=y(),void 0===t?r:o.f(r,t)}},6801:(e,t,r)=>{"use strict";var n=r(3724),i=r(8686),o=r(4913),a=r(8551),s=r(5397),u=r(1072);t.f=n&&!i?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),i=u(t),c=i.length,l=0;c>l;)o.f(e,r=i[l++],n[r]);return e}},4913:(e,t,r)=>{"use strict";var n=r(3724),i=r(5917),o=r(8686),a=r(8551),s=r(6969),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",m="writable";t.f=n?o?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&m in r&&!r[m]){var n=l(e,t);n&&n[m]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:f in r?r[f]:n[f],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(a(e),t=s(t),a(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},7347:(e,t,r)=>{"use strict";var n=r(3724),i=r(9565),o=r(8773),a=r(6980),s=r(5397),u=r(6969),c=r(9297),l=r(5917),f=Object.getOwnPropertyDescriptor;t.f=n?f:function(e,t){if(e=s(e),t=u(t),l)try{return f(e,t)}catch(e){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},8480:(e,t,r)=>{"use strict";var n=r(1828),i=r(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1625:(e,t,r)=>{"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1828:(e,t,r)=>{"use strict";var n=r(9504),i=r(9297),o=r(5397),a=r(9617).indexOf,s=r(421),u=n([].push);e.exports=function(e,t){var r,n=o(e),c=0,l=[];for(r in n)!i(s,r)&&i(n,r)&&u(l,r);for(;t.length>c;)i(n,r=t[c++])&&(~a(l,r)||u(l,r));return l}},1072:(e,t,r)=>{"use strict";var n=r(1828),i=r(8727);e.exports=Object.keys||function(e){return n(e,i)}},8773:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},2967:(e,t,r)=>{"use strict";var n=r(6706),i=r(34),o=r(7750),a=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),a(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},4270:(e,t,r)=>{"use strict";var n=r(9565),i=r(4901),o=r(34),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!o(s=n(r,e)))return s;if(i(r=e.valueOf)&&!o(s=n(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!o(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},5031:(e,t,r)=>{"use strict";var n=r(7751),i=r(9504),o=r(8480),a=r(3717),s=r(8551),u=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),r=a.f;return r?u(t,r(e)):t}},1103:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},916:(e,t,r)=>{"use strict";var n=r(4576),i=r(550),o=r(4901),a=r(2796),s=r(3706),u=r(8227),c=r(4215),l=r(6395),f=r(9519),p=i&&i.prototype,m=u("species"),d=!1,h=o(n.PromiseRejectionEvent),g=a("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===f)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!f||f<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[m]=n,!(d=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||h)}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:h,SUBCLASSING:d}},550:(e,t,r)=>{"use strict";var n=r(4576);e.exports=n.Promise},3438:(e,t,r)=>{"use strict";var n=r(8551),i=r(34),o=r(6043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},537:(e,t,r)=>{"use strict";var n=r(550),i=r(4428),o=r(916).CONSTRUCTOR;e.exports=o||!i((function(e){n.all(e).then(void 0,(function(){}))}))},1056:(e,t,r)=>{"use strict";var n=r(4913).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},8265:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},6682:(e,t,r)=>{"use strict";var n=r(9565),i=r(8551),o=r(4901),a=r(2195),s=r(7323),u=TypeError;e.exports=function(e,t){var r=e.exec;if(o(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return n(s,e,t);throw new u("RegExp#exec called on incompatible receiver")}},7323:(e,t,r)=>{"use strict";var n,i,o=r(9565),a=r(9504),s=r(655),u=r(7979),c=r(8429),l=r(5745),f=r(2360),p=r(1181).get,m=r(3635),d=r(8814),h=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,x=a("".charAt),b=a("".indexOf),v=a("".replace),w=a("".slice),N=(i=/b*/g,o(g,n=/a/,"a"),o(g,i,"a"),0!==n.lastIndex||0!==i.lastIndex),E=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(N||A||E||m||d)&&(y=function(e){var t,r,n,i,a,c,l,m=this,d=p(m),S=s(e),M=d.raw;if(M)return M.lastIndex=m.lastIndex,t=o(y,M,S),m.lastIndex=M.lastIndex,t;var C=d.groups,T=E&&m.sticky,D=o(u,m),F=m.source,O=0,B=S;if(T&&(D=v(D,"y",""),-1===b(D,"g")&&(D+="g"),B=w(S,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==x(S,m.lastIndex-1))&&(F="(?: "+F+")",B=" "+B,O++),r=new RegExp("^(?:"+F+")",D)),A&&(r=new RegExp("^"+F+"$(?!\\s)",D)),N&&(n=m.lastIndex),i=o(g,T?r:m,B),T?i?(i.input=w(i.input,O),i[0]=w(i[0],O),i.index=m.lastIndex,m.lastIndex+=i[0].length):m.lastIndex=0:N&&i&&(m.lastIndex=m.global?i.index+i[0].length:n),A&&i&&i.length>1&&o(h,i[0],r,(function(){for(a=1;a{"use strict";var n=r(8551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},1034:(e,t,r)=>{"use strict";var n=r(9565),i=r(9297),o=r(1625),a=r(7979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!o(s,e)?t:n(a,e)}},8429:(e,t,r)=>{"use strict";var n=r(9039),i=r(4576).RegExp,o=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||n((function(){return!i("a","y").sticky})),s=o||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},3635:(e,t,r)=>{"use strict";var n=r(9039),i=r(4576).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},8814:(e,t,r)=>{"use strict";var n=r(9039),i=r(4576).RegExp;e.exports=n((function(){var e=i("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},7750:(e,t,r)=>{"use strict";var n=r(4117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},3389:(e,t,r)=>{"use strict";var n=r(4576),i=r(3724),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=o(n,e);return t&&t.value}},7633:(e,t,r)=>{"use strict";var n=r(7751),i=r(2106),o=r(8227),a=r(3724),s=o("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},687:(e,t,r)=>{"use strict";var n=r(4913).f,i=r(9297),o=r(8227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,o)&&n(e,o,{configurable:!0,value:t})}},6119:(e,t,r)=>{"use strict";var n=r(5745),i=r(3392),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},7629:(e,t,r)=>{"use strict";var n=r(6395),i=r(4576),o=r(9433),a="__core-js_shared__",s=e.exports=i[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.38.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,r)=>{"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},2293:(e,t,r)=>{"use strict";var n=r(8551),i=r(5548),o=r(4117),a=r(8227)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||o(r=n(s)[a])?t:i(r)}},8183:(e,t,r)=>{"use strict";var n=r(9504),i=r(1291),o=r(655),a=r(7750),s=n("".charAt),u=n("".charCodeAt),c=n("".slice),l=function(e){return function(t,r){var n,l,f=o(a(t)),p=i(r),m=f.length;return p<0||p>=m?e?"":void 0:(n=u(f,p))<55296||n>56319||p+1===m||(l=u(f,p+1))<56320||l>57343?e?s(f,p):n:e?c(f,p,p+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},4495:(e,t,r)=>{"use strict";var n=r(9519),i=r(9039),o=r(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},9225:(e,t,r)=>{"use strict";var n,i,o,a,s=r(4576),u=r(8745),c=r(6080),l=r(4901),f=r(9297),p=r(9039),m=r(397),d=r(7680),h=r(4055),g=r(2812),y=r(9544),x=r(6193),b=s.setImmediate,v=s.clearImmediate,w=s.process,N=s.Dispatch,E=s.Function,A=s.MessageChannel,S=s.String,M=0,C={},T="onreadystatechange";p((function(){n=s.location}));var D=function(e){if(f(C,e)){var t=C[e];delete C[e],t()}},F=function(e){return function(){D(e)}},O=function(e){D(e.data)},B=function(e){s.postMessage(S(e),n.protocol+"//"+n.host)};b&&v||(b=function(e){g(arguments.length,1);var t=l(e)?e:E(e),r=d(arguments,1);return C[++M]=function(){u(t,void 0,r)},i(M),M},v=function(e){delete C[e]},x?i=function(e){w.nextTick(F(e))}:N&&N.now?i=function(e){N.now(F(e))}:A&&!y?(a=(o=new A).port2,o.port1.onmessage=O,i=c(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(B)?(i=B,s.addEventListener("message",O,!1)):i=T in h("script")?function(e){m.appendChild(h("script"))[T]=function(){m.removeChild(this),D(e)}}:function(e){setTimeout(F(e),0)}),e.exports={set:b,clear:v}},5610:(e,t,r)=>{"use strict";var n=r(1291),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},5397:(e,t,r)=>{"use strict";var n=r(7055),i=r(7750);e.exports=function(e){return n(i(e))}},1291:(e,t,r)=>{"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},8014:(e,t,r)=>{"use strict";var n=r(1291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8981:(e,t,r)=>{"use strict";var n=r(7750),i=Object;e.exports=function(e){return i(n(e))}},2777:(e,t,r)=>{"use strict";var n=r(9565),i=r(34),o=r(757),a=r(5966),s=r(4270),u=r(8227),c=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,u=a(e,l);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!i(r)||o(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:(e,t,r)=>{"use strict";var n=r(2777),i=r(757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},2140:(e,t,r)=>{"use strict";var n={};n[r(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},655:(e,t,r)=>{"use strict";var n=r(6955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,r)=>{"use strict";var n=r(9504),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},7040:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,r)=>{"use strict";var n=r(3724),i=r(9039);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";var n=r(4576),i=r(4901),o=n.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},8227:(e,t,r)=>{"use strict";var n=r(4576),i=r(5745),o=r(9297),a=r(3392),s=r(4495),u=r(7040),c=n.Symbol,l=i("wks"),f=u?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return o(l,e)||(l[e]=s&&o(c,e)?c[e]:f("Symbol."+e)),l[e]}},4423:(e,t,r)=>{"use strict";var n=r(6518),i=r(9617).includes,o=r(9039),a=r(6469);n({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2712:(e,t,r)=>{"use strict";var n=r(6518),i=r(926).left,o=r(4598),a=r(9519);n({target:"Array",proto:!0,forced:!r(6193)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},6910:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),o=r(9306),a=r(8981),s=r(6198),u=r(4606),c=r(655),l=r(9039),f=r(4488),p=r(4598),m=r(3709),d=r(3763),h=r(9519),g=r(3607),y=[],x=i(y.sort),b=i(y.push),v=l((function(){y.sort(void 0)})),w=l((function(){y.sort(null)})),N=p("sort"),E=!l((function(){if(h)return h<70;if(!(m&&m>3)){if(d)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)y.push({k:t+n,v:r})}for(y.sort((function(e,t){return t.v-e.v})),n=0;nc(r)?1:-1}}(e)),r=s(i),n=0;n{"use strict";var n=r(6518),i=r(7751),o=r(8745),a=r(9565),s=r(9504),u=r(9039),c=r(4901),l=r(757),f=r(7680),p=r(6933),m=r(4495),d=String,h=i("JSON","stringify"),g=s(/./.exec),y=s("".charAt),x=s("".charCodeAt),b=s("".replace),v=s(1..toString),w=/[\uD800-\uDFFF]/g,N=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,A=!m||u((function(){var e=i("Symbol")("stringify detection");return"[null]"!==h([e])||"{}"!==h({a:e})||"{}"!==h(Object(e))})),S=u((function(){return'"\\udf06\\ud834"'!==h("\udf06\ud834")||'"\\udead"'!==h("\udead")})),M=function(e,t){var r=f(arguments),n=p(t);if(c(n)||void 0!==e&&!l(e))return r[1]=function(e,t){if(c(n)&&(t=a(n,this,d(e),t)),!l(t))return t},o(h,null,r)},C=function(e,t,r){var n=y(r,t-1),i=y(r,t+1);return g(N,e)&&!g(E,i)||g(E,e)&&!g(N,n)?"\\u"+v(x(e,0),16):e};h&&n({target:"JSON",stat:!0,arity:3,forced:A||S},{stringify:function(e,t,r){var n=f(arguments),i=o(A?M:h,null,n);return S&&"string"==typeof i?b(i,w,C):i}})},3921:(e,t,r)=>{"use strict";var n=r(6518),i=r(2652),o=r(4659);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,r){o(t,e,r)}),{AS_ENTRIES:!0}),t}})},6499:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565),o=r(9306),a=r(6043),s=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(e){var t=this,r=a.f(t),n=r.resolve,c=r.reject,l=s((function(){var r=o(t.resolve),a=[],s=0,l=1;u(e,(function(e){var o=s++,u=!1;l++,i(r,t,e).then((function(e){u||(u=!0,a[o]=e,--l||n(a))}),c)})),--l||n(a)}));return l.error&&c(l.value),r.promise}})},2003:(e,t,r)=>{"use strict";var n=r(6518),i=r(6395),o=r(916).CONSTRUCTOR,a=r(550),s=r(7751),u=r(4901),c=r(6840),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(a)){var f=s("Promise").prototype.catch;l.catch!==f&&c(l,"catch",f,{unsafe:!0})}},436:(e,t,r)=>{"use strict";var n,i,o,a=r(6518),s=r(6395),u=r(6193),c=r(4576),l=r(9565),f=r(6840),p=r(2967),m=r(687),d=r(7633),h=r(9306),g=r(4901),y=r(34),x=r(679),b=r(2293),v=r(9225).set,w=r(1955),N=r(3138),E=r(1103),A=r(8265),S=r(1181),M=r(550),C=r(916),T=r(6043),D="Promise",F=C.CONSTRUCTOR,O=C.REJECTION_EVENT,B=C.SUBCLASSING,_=S.getterFor(D),z=S.set,I=M&&M.prototype,k=M,q=I,R=c.TypeError,P=c.document,j=c.process,U=T.f,L=U,$=!!(P&&P.createEvent&&c.dispatchEvent),H="unhandledrejection",G=function(e){var t;return!(!y(e)||!g(t=e.then))&&t},Z=function(e,t){var r,n,i,o=t.value,a=1===t.state,s=a?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(a||(2===t.rejection&&X(t),t.rejection=1),!0===s?r=o:(f&&f.enter(),r=s(o),f&&(f.exit(),i=!0)),r===e.promise?c(new R("Promise-chain cycle")):(n=G(r))?l(n,r,u,c):u(r)):c(o)}catch(e){f&&!i&&f.exit(),c(e)}},V=function(e,t){e.notified||(e.notified=!0,w((function(){for(var r,n=e.reactions;r=n.get();)Z(r,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},W=function(e,t,r){var n,i;$?((n=P.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!O&&(i=c["on"+e])?i(n):e===H&&N("Unhandled promise rejection",r)},Y=function(e){l(v,c,(function(){var t,r=e.facade,n=e.value;if(J(e)&&(t=E((function(){u?j.emit("unhandledRejection",n,r):W(H,r,n)})),e.rejection=u||J(e)?2:1,t.error))throw t.value}))},J=function(e){return 1!==e.rejection&&!e.parent},X=function(e){l(v,c,(function(){var t=e.facade;u?j.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)}))},Q=function(e,t,r){return function(n){e(t,n,r)}},K=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,V(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new R("Promise can't be resolved itself");var n=G(t);n?w((function(){var r={done:!1};try{l(n,t,Q(ee,r,e),Q(K,r,e))}catch(t){K(r,t,e)}})):(e.value=t,e.state=1,V(e,!1))}catch(t){K({done:!1},t,e)}}};if(F&&(q=(k=function(e){x(this,q),h(e),l(n,this);var t=_(this);try{e(Q(ee,t),Q(K,t))}catch(e){K(t,e)}}).prototype,(n=function(e){z(this,{type:D,done:!1,notified:!1,parent:!1,reactions:new A,rejection:!1,state:0,value:null})}).prototype=f(q,"then",(function(e,t){var r=_(this),n=U(b(this,k));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=u?j.domain:void 0,0===r.state?r.reactions.add(n):w((function(){Z(n,r)})),n.promise})),i=function(){var e=new n,t=_(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(K,t)},T.f=U=function(e){return e===k||void 0===e?new i(e):L(e)},!s&&g(M)&&I!==Object.prototype)){o=I.then,B||f(I,"then",(function(e,t){var r=this;return new k((function(e,t){l(o,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete I.constructor}catch(e){}p&&p(I,q)}a({global:!0,constructor:!0,wrap:!0,forced:F},{Promise:k}),m(k,D,!1,!0),d(D)},3362:(e,t,r)=>{"use strict";r(436),r(6499),r(2003),r(7743),r(1481),r(280)},7743:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565),o=r(9306),a=r(6043),s=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(e){var t=this,r=a.f(t),n=r.reject,c=s((function(){var a=o(t.resolve);u(e,(function(e){i(a,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},1481:(e,t,r)=>{"use strict";var n=r(6518),i=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},280:(e,t,r)=>{"use strict";var n=r(6518),i=r(7751),o=r(6395),a=r(550),s=r(916).CONSTRUCTOR,u=r(3438),c=i("Promise"),l=o&&!s;n({target:"Promise",stat:!0,forced:o||s},{resolve:function(e){return u(l&&this===c?a:this,e)}})},4864:(e,t,r)=>{"use strict";var n=r(3724),i=r(4576),o=r(9504),a=r(2796),s=r(3167),u=r(6699),c=r(2360),l=r(8480).f,f=r(1625),p=r(788),m=r(655),d=r(1034),h=r(8429),g=r(1056),y=r(6840),x=r(9039),b=r(9297),v=r(1181).enforce,w=r(7633),N=r(8227),E=r(3635),A=r(8814),S=N("match"),M=i.RegExp,C=M.prototype,T=i.SyntaxError,D=o(C.exec),F=o("".charAt),O=o("".replace),B=o("".indexOf),_=o("".slice),z=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,k=/a/g,q=new M(I)!==I,R=h.MISSED_STICKY,P=h.UNSUPPORTED_Y;if(a("RegExp",n&&(!q||R||E||A||x((function(){return k[S]=!1,M(I)!==I||M(k)===k||"/a/i"!==String(M(I,"i"))}))))){for(var j=function(e,t){var r,n,i,o,a,l,h=f(C,this),g=p(e),y=void 0===t,x=[],w=e;if(!h&&g&&y&&e.constructor===j)return e;if((g||f(C,e))&&(e=e.source,y&&(t=d(w))),e=void 0===e?"":m(e),t=void 0===t?"":m(t),w=e,E&&"dotAll"in I&&(n=!!t&&B(t,"s")>-1)&&(t=O(t,/s/g,"")),r=t,R&&"sticky"in I&&(i=!!t&&B(t,"y")>-1)&&P&&(t=O(t,/y/g,"")),A&&(o=function(e){for(var t,r=e.length,n=0,i="",o=[],a=c(null),s=!1,u=!1,l=0,f="";n<=r;n++){if("\\"===(t=F(e,n)))t+=F(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(i+=t,"?:"===_(e,n+1,n+3))continue;D(z,_(e,n+1))&&(n+=2,u=!0),l++;continue;case">"===t&&u:if(""===f||b(a,f))throw new T("Invalid capture group name");a[f]=!0,o[o.length]=[f,l],u=!1,f="";continue}u?f+=t:i+=t}return[i,o]}(e),e=o[0],x=o[1]),a=s(M(e,t),h?this:C,j),(n||i||x.length)&&(l=v(a),n&&(l.dotAll=!0,l.raw=j(function(e){for(var t,r=e.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(t=F(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+F(e,++n);return i}(e),r)),i&&(l.sticky=!0),x.length&&(l.groups=x)),e!==w)try{u(a,"source",""===w?"(?:)":w)}catch(e){}return a},U=l(M),L=0;U.length>L;)g(j,M,U[L++]);C.constructor=j,j.prototype=C,y(i,"RegExp",j,{constructor:!0})}w("RegExp")},7465:(e,t,r)=>{"use strict";var n=r(3724),i=r(3635),o=r(2195),a=r(2106),s=r(1181).get,u=RegExp.prototype,c=TypeError;n&&i&&a(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===o(this))return!!s(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},7495:(e,t,r)=>{"use strict";var n=r(6518),i=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},5440:(e,t,r)=>{"use strict";var n=r(8745),i=r(9565),o=r(9504),a=r(9228),s=r(9039),u=r(8551),c=r(4901),l=r(4117),f=r(1291),p=r(8014),m=r(655),d=r(7750),h=r(7829),g=r(5966),y=r(2478),x=r(6682),b=r(8227)("replace"),v=Math.max,w=Math.min,N=o([].concat),E=o([].push),A=o("".indexOf),S=o("".slice),M="$0"==="a".replace(/./,"$0"),C=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(e,t,r){var o=C?"$":"$0";return[function(e,r){var n=d(this),o=l(e)?void 0:g(e,b);return o?i(o,e,n,r):i(t,m(n),e,r)},function(e,i){var a=u(this),s=m(e);if("string"==typeof i&&-1===A(i,o)&&-1===A(i,"$<")){var l=r(t,a,s,i);if(l.done)return l.value}var d=c(i);d||(i=m(i));var g,b=a.global;b&&(g=a.unicode,a.lastIndex=0);for(var M,C=[];null!==(M=x(a,s))&&(E(C,M),b);)""===m(M[0])&&(a.lastIndex=h(s,p(a.lastIndex),g));for(var T,D="",F=0,O=0;O=F&&(D+=S(s,F,z)+B,F=z+_.length)}return D+S(s,F)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}))||!M||C)},9463:(e,t,r)=>{"use strict";var n=r(6518),i=r(3724),o=r(4576),a=r(9504),s=r(9297),u=r(4901),c=r(1625),l=r(655),f=r(2106),p=r(7740),m=o.Symbol,d=m&&m.prototype;if(i&&u(m)&&(!("description"in d)||void 0!==m().description)){var h={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=c(d,this)?new m(e):void 0===e?m():m(e);return""===e&&(h[t]=!0),t};p(g,m),g.prototype=d,d.constructor=g;var y="Symbol(description detection)"===String(m("description detection")),x=a(d.valueOf),b=a(d.toString),v=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),N=a("".slice);f(d,"description",{configurable:!0,get:function(){var e=x(this);if(s(h,e))return"";var t=b(e),r=y?N(t,7,-1):w(t,v,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},2369:function(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function r(){}const n="Argument is not a typed-function.";return function i(){function o(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const a=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:o},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],s={name:"any",test:e,isAny:!0};let u,c,l=0,f={createCount:0};function p(e){const t=u.get(e);if(t)return t;let r='Unknown type "'+e+'"';const n=e.toLowerCase();let i;for(i of c)if(i.toLowerCase()===n){r+='. Did you mean "'+i+'" ?';break}throw new TypeError(r)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=t?p(t).index:c.length,n=[];for(let t=0;t{const r=u.get(t);return!r.isAny&&r.test(e)}));return t.length?t:["any"]}function g(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,r){if(!g(e))throw new TypeError(n);const i=r&&r.exact,o=N(Array.isArray(t)?t.join(","):t),a=x(o);if(!i||a in e.signatures){const t=e._typedFunctionData.signatureMap.get(a);if(t)return t}const s=o.length;let u,c;if(i){let t;for(t in u=[],e.signatures)u.push(e._typedFunctionData.signatureMap.get(t))}else u=e._typedFunctionData.signatures;for(let e=0;e!e.has(t.name))))continue}r.push(n)}}if(u=r,0===u.length)break}for(c of u)if(c.params.length<=s)return c;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+x(o,", ")+"))")}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function b(e){const t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>p(e.trim())));let n=!1,i=t?"...":"";return{types:r.map((function(e){return n=e.isAny||n,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}function v(e){const t=function(e){if(0===e.length)return[];const t=e.map(p);e.length>1&&t.sort(((e,t)=>e.index-t.index));let r=t[0].conversionsTo;if(1===e.length)return r;r=r.concat([]);const n=new Set(e);for(let e=1;ee.name)));let r=e.hasAny,n=e.name;const i=t.map((function(e){const t=p(e.from);return r=t.isAny||r,n+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function w(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function N(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const r=e.trim();if(""===r)return t;const n=r.split(",");for(let e=0;e=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=A(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=A(e[0]),n=A(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(A),function(e){for(let r=0;r{const n=C(e.params,t);let i;for(i of n)r.add(i)})),r.has("any")?["any"]:Array.from(r)}function F(e,t,r){let n,i;const o=e||"unnamed";let a,s=r;for(a=0;a{const n=A(M(r.params,a));(a0){const e=h(t[a]);return n=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+a+")"),n.data={category:"wrongType",fn:o,index:a,actual:e,expected:i},n}}else s=e}const u=s.map((function(e){return E(e.params)?1/0:e.params.length}));if(t.lengthc)return n=new TypeError("Too many arguments in function "+o+" (expected: "+c+", actual: "+t.length+")"),n.data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:c},n;const l=[];for(let e=0;e0)return 1;const n=B(e)-B(t);return n<0?-1:n>0?1:0}function z(e,t){const r=e.params,n=t.params,i=H(r),o=H(n),a=E(r),s=E(n);if(a&&i.hasAny){if(!s||!o.hasAny)return 1}else if(s&&o.hasAny)return-1;let u,c=0,l=0;for(u of r)u.hasAny&&++c,u.hasConversion&&++l;let f=0,p=0;for(u of n)u.hasAny&&++f,u.hasConversion&&++p;if(c!==f)return c-f;if(a&&i.hasConversion){if(!s||!o.hasConversion)return 1}else if(s&&o.hasConversion)return-1;if(l!==p)return l-p;if(a){if(!s)return 1}else if(s)return-1;const m=(r.length-n.length)*(a?-1:1);if(0!==m)return m;const d=[];let h,g=0;for(let e=0;ee.hasConversion))){const n=E(e),i=e.map(k);r=function(){const e=[],r=n?arguments.length-1:arguments.length;for(let t=0;te.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),s.push(a)}else s=a.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return i=s,o=function(i){return e(t,r+1,n.concat([i]))},Array.prototype.concat.apply([],i.map(o))}var i,o;return[n]}(e,0,[])}function R(e,t){const r=Math.max(e.length,t.length);for(let n=0;n=n:a?n>=i:n===i}function P(e,t,r){const n=[];let i;for(i of e){let e=r[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;n.push(e)}return n}function j(e,t,r){const n=function(e){return e.map((e=>Y(e)?V(e.referToSelf.callback):W(e)?Z(e.referTo.references,e.referTo.callback):e))}(e),i=new Array(n.length).fill(!1);let o=!0;for(;o;){o=!1;let e=!0;for(let a=0;a{const n=e[r];if(t.test(n.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(n);const i=[],o=[],a={},s=[];let u;for(u in n){if(!Object.prototype.hasOwnProperty.call(n,u))continue;const e=N(u);if(!e)continue;i.forEach((function(t){if(R(t,e))throw new TypeError('Conflicting signatures "'+x(t)+'" and "'+x(e)+'".')})),i.push(e);const t=o.length;o.push(n[u]);const r=e.map(v);let c;for(c of q(r)){const e=x(c);s.push({params:c,name:e,fn:t}),c.every((e=>!e.hasConversion))&&(a[e]=t)}}s.sort(z);const c=j(o,a,se);let l;for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&(a[l]=c[a[l]]);const p=[],m=new Map;for(l of s)m.has(l.name)||(l.fn=c[l.fn],p.push(l),m.set(l.name,l));const d=p[0]&&p[0].params.length<=2&&!E(p[0].params),h=p[1]&&p[1].params.length<=2&&!E(p[1].params),g=p[2]&&p[2].params.length<=2&&!E(p[2].params),y=p[3]&&p[3].params.length<=2&&!E(p[3].params),b=p[4]&&p[4].params.length<=2&&!E(p[4].params),w=p[5]&&p[5].params.length<=2&&!E(p[5].params),M=d&&h&&g&&y&&b&&w;for(let e=0;ee.test)),oe=p.map((e=>e.implementation)),ae=function(){for(let e=re;ex(N(e)))),t=H(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return Z(e,t)},f.referToSelf=V,f.convert=function(e,t){const r=p(t);if(r.test(e))return e;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+t+" defined.");for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{override:!1};ee(e);const r=p(e.to),n=r.conversionsTo.find((t=>t.from===e.from));if(n){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+r.name+'"');f.removeConversion({from:n.from,to:e.to,convert:n.convert})}r.conversionsTo.push({from:e.from,convert:e.convert,index:l++})},f.addConversions=function(e,t){e.forEach((e=>f.addConversion(e,t)))},f.removeConversion=function(e){ee(e);const t=p(e.to),r=function(e,t){for(let r=0;rt.from===e.from));if(!r)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},f.resolve=function(e,t){if(!g(e))throw new TypeError(n);const r=e._typedFunctionData.signatures;for(let e=0;e{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.d(n,{default:()=>Py});var e={};r.r(e),r.d(e,{createAbs:()=>fo,createAccessorNode:()=>dp,createAcos:()=>Cl,createAcosh:()=>Zl,createAcot:()=>Wl,createAcoth:()=>Jl,createAcsc:()=>Ql,createAcsch:()=>ef,createAdd:()=>Qf,createAddScalar:()=>yo,createAnd:()=>Ec,createAndTransform:()=>Dy,createApply:()=>mo,createApplyTransform:()=>ey,createArg:()=>Ka,createArrayNode:()=>gp,createAsec:()=>rf,createAsech:()=>of,createAsin:()=>sf,createAsinh:()=>uf,createAssignmentNode:()=>Ep,createAtan:()=>cf,createAtan2:()=>ff,createAtanh:()=>mf,createAtomicMass:()=>Og,createAvogadro:()=>Bg,createBellNumbers:()=>ah,createBigNumberClass:()=>Br,createBigint:()=>Ni,createBignumber:()=>Ci,createBin:()=>zu,createBitAnd:()=>Ga,createBitAndTransform:()=>Oy,createBitNot:()=>Va,createBitOr:()=>Ya,createBitOrTransform:()=>By,createBitXor:()=>Qa,createBlockNode:()=>Sp,createBohrMagneton:()=>fg,createBohrRadius:()=>yg,createBoltzmann:()=>_g,createBoolean:()=>Mi,createCatalan:()=>uh,createCbrt:()=>wo,createCeil:()=>To,createChain:()=>Rm,createChainClass:()=>Om,createClassicalElectronRadius:()=>xg,createClone:()=>Ln,createColumn:()=>hs,createColumnTransform:()=>ty,createCombinations:()=>Ed,createCombinationsWithRep:()=>Md,createCompare:()=>Sc,createCompareNatural:()=>Dc,createCompareText:()=>Bc,createCompile:()=>im,createComplex:()=>Ti,createComplexClass:()=>zr,createComposition:()=>lh,createConcat:()=>ms,createConcatTransform:()=>yy,createConditionalNode:()=>Cp,createConductanceQuantum:()=>pg,createConj:()=>ts,createConstantNode:()=>kp,createCorr:()=>bd,createCos:()=>hf,createCosh:()=>yf,createCot:()=>xf,createCoth:()=>vf,createCoulomb:()=>cg,createCount:()=>ys,createCreateUnit:()=>Sl,createCross:()=>bs,createCsc:()=>wf,createCsch:()=>Ef,createCtranspose:()=>pu,createCube:()=>Fo,createCumSum:()=>ad,createCumSumTransform:()=>Ay,createDeepEqual:()=>Xc,createDenseMatrixClass:()=>jn,createDerivative:()=>Ah,createDet:()=>Pm,createDeuteronMass:()=>Ag,createDiag:()=>ws,createDiff:()=>Rs,createDiffTransform:()=>by,createDistance:()=>rd,createDivide:()=>ed,createDivideScalar:()=>Zu,createDot:()=>np,createDotDivide:()=>oc,createDotMultiply:()=>Ca,createDotPow:()=>nc,createE:()=>$h,createEfimovFactor:()=>Fg,createEigs:()=>$m,createElectricConstant:()=>sg,createElectronMass:()=>bg,createElementaryCharge:()=>lg,createEqual:()=>zc,createEqualScalar:()=>bi,createEqualText:()=>qc,createErf:()=>bu,createEvaluate:()=>am,createExp:()=>Oo,createExpm:()=>Gm,createExpm1:()=>_o,createFactorial:()=>Pd,createFalse:()=>qh,createFaraday:()=>zg,createFermiCoupling:()=>vg,createFft:()=>hu,createFibonacciHeapClass:()=>ll,createFilter:()=>Ns,createFilterTransform:()=>ay,createFineStructure:()=>wg,createFirstRadiation:()=>Ig,createFix:()=>qo,createFlatten:()=>Ss,createFloor:()=>Uo,createForEach:()=>Cs,createForEachTransform:()=>sy,createFormat:()=>_u,createFraction:()=>Di,createFractionClass:()=>Gr,createFreqz:()=>Fh,createFunctionAssignmentNode:()=>Rp,createFunctionNode:()=>em,createGamma:()=>Id,createGasConstant:()=>qg,createGcd:()=>ra,createGetMatrixDataType:()=>Fs,createGravitationConstant:()=>ng,createGravity:()=>Zg,createHartreeEnergy:()=>Ng,createHasNumericValue:()=>ui,createHelp:()=>km,createHelpClass:()=>Fm,createHex:()=>ku,createHypot:()=>ep,createI:()=>Xh,createIdentity:()=>Bs,createIfft:()=>yu,createIm:()=>rs,createImmutableDenseMatrixClass:()=>sl,createIndex:()=>ap,createIndexClass:()=>ul,createIndexNode:()=>jp,createIndexTransform:()=>uy,createInfinity:()=>Ph,createIntersect:()=>nd,createInv:()=>jm,createInverseConductanceQuantum:()=>mg,createInvmod:()=>Aa,createIsInteger:()=>Xn,createIsNaN:()=>di,createIsNegative:()=>ii,createIsNumeric:()=>ai,createIsPositive:()=>li,createIsPrime:()=>$u,createIsZero:()=>pi,createKldivergence:()=>Ud,createKlitzing:()=>gg,createKron:()=>zs,createLN10:()=>Zh,createLN2:()=>Gh,createLOG10E:()=>Wh,createLOG2E:()=>Vh,createLarger:()=>Gc,createLargerEq:()=>Wc,createLcm:()=>ia,createLeafCount:()=>ph,createLeftShift:()=>xc,createLgamma:()=>qd,createLog:()=>Xu,createLog10:()=>aa,createLog1p:()=>Ku,createLog2:()=>ua,createLoschmidt:()=>kg,createLsolve:()=>uc,createLsolveAll:()=>pc,createLup:()=>lm,createLusolve:()=>Cm,createLyap:()=>Km,createMad:()=>fd,createMagneticConstant:()=>ag,createMagneticFluxQuantum:()=>dg,createMap:()=>ks,createMapTransform:()=>cy,createMatrix:()=>Oi,createMatrixClass:()=>Vr,createMatrixFromColumns:()=>qi,createMatrixFromFunction:()=>_i,createMatrixFromRows:()=>Ii,createMax:()=>ol,createMaxTransform:()=>fy,createMean:()=>ud,createMeanTransform:()=>py,createMedian:()=>ld,createMin:()=>al,createMinTransform:()=>my,createMod:()=>Wo,createMode:()=>Tu,createMolarMass:()=>Hg,createMolarMassC12:()=>Gg,createMolarPlanckConstant:()=>Rg,createMolarVolume:()=>Pg,createMultinomial:()=>$d,createMultiply:()=>fa,createMultiplyScalar:()=>ca,createNaN:()=>jh,createNeutronMass:()=>Sg,createNode:()=>up,createNorm:()=>rp,createNot:()=>cs,createNthRoot:()=>ma,createNthRoots:()=>tc,createNuclearMagneton:()=>hg,createNull:()=>Rh,createNumber:()=>wi,createNumeric:()=>Hu,createObjectNode:()=>Lp,createOct:()=>Iu,createOnes:()=>Ps,createOperatorNode:()=>Gp,createOr:()=>ls,createOrTransform:()=>Fy,createParenthesisNode:()=>Vp,createParse:()=>rm,createParser:()=>cm,createParserClass:()=>sm,createPartitionSelect:()=>rl,createPermutations:()=>Gd,createPhi:()=>Hh,createPi:()=>Uh,createPickRandom:()=>Xd,createPinv:()=>Lm,createPlanckCharge:()=>Jg,createPlanckConstant:()=>ig,createPlanckLength:()=>Vg,createPlanckMass:()=>Wg,createPlanckTemperature:()=>Xg,createPlanckTime:()=>Yg,createPolynomialRoot:()=>Dm,createPow:()=>Vu,createPrint:()=>Pu,createPrintTransform:()=>Ty,createProd:()=>Ou,createProtonMass:()=>Eg,createQr:()=>fm,createQuantileSeq:()=>gd,createQuantileSeqTransform:()=>Ny,createQuantumOfCirculation:()=>Mg,createRandom:()=>eh,createRandomInt:()=>rh,createRange:()=>Hs,createRangeClass:()=>Zr,createRangeNode:()=>Yp,createRangeTransform:()=>dy,createRationalize:()=>Mh,createRe:()=>ns,createReducedPlanckConstant:()=>og,createRelationalNode:()=>Xp,createReplacer:()=>Bh,createReshape:()=>Zs,createResize:()=>Vs,createResolve:()=>vh,createResultSet:()=>Ve,createReviver:()=>Oh,createRightArithShift:()=>vc,createRightLogShift:()=>Nc,createRotate:()=>Ys,createRotationMatrix:()=>Xs,createRound:()=>Ju,createRow:()=>Qs,createRowTransform:()=>hy,createRydberg:()=>Cg,createSQRT1_2:()=>Yh,createSQRT2:()=>Jh,createSackurTetrode:()=>jg,createSchur:()=>Xm,createSec:()=>Af,createSech:()=>Mf,createSecondRadiation:()=>Ug,createSetCartesian:()=>_f,createSetDifference:()=>If,createSetDistinct:()=>qf,createSetIntersect:()=>Pf,createSetIsSubset:()=>Uf,createSetMultiplicity:()=>$f,createSetPowerset:()=>Gf,createSetSize:()=>Vf,createSetSymDifference:()=>Yf,createSetUnion:()=>Xf,createSign:()=>ha,createSimplify:()=>gh,createSimplifyConstant:()=>yh,createSimplifyCore:()=>bh,createSin:()=>Cf,createSinh:()=>Df,createSize:()=>eu,createSlu:()=>Am,createSmaller:()=>Pc,createSmallerEq:()=>Lc,createSolveODE:()=>xu,createSort:()=>il,createSpaClass:()=>fl,createSparse:()=>El,createSparseMatrixClass:()=>vi,createSpeedOfLight:()=>rg,createSplitUnit:()=>Pi,createSqrt:()=>ga,createSqrtm:()=>Vm,createSquare:()=>xa,createSqueeze:()=>ru,createStd:()=>yd,createStdTransform:()=>vy,createStefanBoltzmann:()=>Lg,createStirlingS2:()=>ih,createString:()=>Ai,createSubset:()=>iu,createSubsetTransform:()=>gy,createSubtract:()=>va,createSubtractScalar:()=>bo,createSum:()=>id,createSumTransform:()=>wy,createSylvester:()=>Ym,createSymbolNode:()=>Qp,createSymbolicEqual:()=>Nh,createTan:()=>Ff,createTanh:()=>Of,createTau:()=>Lh,createThomsonCrossSection:()=>Tg,createTo:()=>Uu,createTrace:()=>ip,createTranspose:()=>lu,createTrue:()=>kh,createTypeOf:()=>gi,createTyped:()=>$e,createUnaryMinus:()=>uo,createUnaryPlus:()=>lo,createUnequal:()=>Kc,createUnitClass:()=>bl,createUnitFunction:()=>wl,createUppercaseE:()=>Kh,createUppercasePi:()=>Qh,createUsolve:()=>lc,createUsolveAll:()=>dc,createVacuumImpedance:()=>ug,createVariance:()=>dd,createVarianceTransform:()=>My,createVersion:()=>eg,createWeakMixingAngle:()=>Dg,createWienDisplacement:()=>$g,createXgcd:()=>Na,createXor:()=>fs,createZeros:()=>du,createZeta:()=>Mu,createZpk2tf:()=>Th}),r(4423),r(7495);var t=r(2369);function i(e,t){if(a(e,t))return e[t];if("function"==typeof e[t]&&s(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function o(e,t,r){if(a(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function a(e,t){return!(!function(e){return"object"==typeof e&&e&&e.constructor===Object}(e)&&!Array.isArray(e)||!me(u,t)&&(t in Object.prototype||t in Function.prototype))}function s(e,t){return!(null==e||"function"!=typeof e[t]||me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!me(c,t)&&(t in Object.prototype||t in Function.prototype))}r(6910),r(4864),r(7465);const u={length:!0,name:!0},c={toString:!0,valueOf:!0,toLocaleString:!0};class l{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter((e=>this.has(e))).values()}get(e){return i(this.wrappedObject,e)}set(e,t){return o(this.wrappedObject,e,t),this}has(e){return a(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return p(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){a(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(const e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class f{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return p(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function p(e,t){return{next:()=>{const r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function m(){return new Map}function d(e){if(!e)return m();if(k(e))return e;if(I(e))return new l(e);throw new Error("createMap can create maps from objects or Maps")}function h(e){return"number"==typeof e}function g(e){return!(!e||"object"!=typeof e||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function y(e){return"bigint"==typeof e}function x(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function b(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function v(e){return e&&!0===e.constructor.prototype.isUnit||!1}function w(e){return"string"==typeof e}const N=Array.isArray;function E(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function A(e){return Array.isArray(e)||E(e)}function S(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function M(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function C(e){return e&&!0===e.constructor.prototype.isRange||!1}function T(e){return e&&!0===e.constructor.prototype.isIndex||!1}function D(e){return"boolean"==typeof e}function F(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function O(e){return e&&!0===e.constructor.prototype.isHelp||!1}function B(e){return"function"==typeof e}function _(e){return e instanceof Date}function z(e){return e instanceof RegExp}function I(e){return!(!e||"object"!=typeof e||e.constructor!==Object||x(e)||b(e))}function k(e){return!!e&&(e instanceof Map||e instanceof l||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function q(e){return k(e)&&k(e.a)&&k(e.b)}function R(e){return k(e)&&I(e.wrappedObject)}function P(e){return null===e}function j(e){return void 0===e}function U(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function G(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function Z(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function V(e){return Z(e)||K(e)&&1===e.args.length&&Z(e.args[0])&&"-+~".includes(e.op)}function W(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Y(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function J(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function X(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function Q(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function K(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function ee(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function te(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function re(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function ne(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function ie(e){return e&&!0===e.constructor.prototype.isChain||!1}function oe(e){const t=typeof e;return"object"===t?null===e?"null":g(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ae(e){const t=typeof e;if("number"===t||"bigint"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return ae(e)}));if(e instanceof Date)return new Date(e.valueOf());if(g(e))return e;if(I(e))return function(e,t){const r={};for(const n in e)me(e,n)&&(r[n]=t(e[n]));return r}(e,ae);throw new TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function se(e,t){for(const r in t)me(t,r)&&(e[r]=t[r]);return e}function ue(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(const r in t)if(me(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r]&&e[r].constructor===Object?ue(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function ce(e,t){let r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==r[e]))){const n=t.filter((e=>void 0===r[e]));throw new Error(`Cannot create function "${e}", some dependencies are missing: ${n.map((e=>`"${e}"`)).join(", ")}.`)}}(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function he(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function ge(e){return e&&"?"===e[0]?e.slice(1):e}function ye(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function xe(e,t){return"bigint"!==t.number||/^-?\d+$/.test(e)?t.number:t.numberFallback}r(5440);const be=Math.sign||function(e){return e>0?1:e<0?-1:0},ve=Math.log2||function(e){return Math.log(e)/Math.LN2},we=Math.log10||function(e){return Math.log(e)/Math.LN10},Ne=Math.log1p||function(e){return Math.log(e+1)},Ee=Math.cbrt||function(e){if(0===e)return e;const t=e<0;let r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},Ae=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function Se(e,t,r){const n={2:"0b",8:"0o",16:"0x"}[t];let i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ye(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error(`Value must be in range [-2^${r-1}, 2^${r-1}-1]`);if(!ye(e))throw new Error("Value must be an integer");e<0&&(e+=2**r),i=`i${r}`}let o="";return e<0&&(e=-e,o="-"),`${o}${n}${e.toString(t)}${i}`}function Me(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";const{notation:r,precision:n,wordSize:i}=Ce(t);switch(r){case"fixed":return De(e,n);case"exponential":return Fe(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);const r=Oe(Te(e),t),n=r.exponent,i=r.coefficients,o=n%3==0?n:n<0?n-3-n%3:n-n%3;if(h(t))for(;t>i.length||n-o+1>i.length;)i.push(0);else{const e=Math.abs(n-o)-(i.length-1);for(let t=0;t0;)s++,a--;const u=i.slice(s).join(""),c=h(t)&&u.length||u.match(/[1-9]/)?"."+u:"",l=i.slice(0,s).join("")+c+"e"+(n>=0?"+":"")+o.toString();return r.sign+l}(e,n);case"bin":return Se(e,2,i);case"oct":return Se(e,8,i);case"hex":return Se(e,16,i);case"auto":return function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);const n=Ue(null==r?void 0:r.lowerExp,-3),i=Ue(null==r?void 0:r.upperExp,5),o=Te(e),a=t?Oe(o,t):o;if(a.exponent=i)return Fe(e,t);{let e=a.coefficients;const r=a.exponent;e.length0?r:0;return n{throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(r=je(e.wordSize,(()=>{throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(n=e.notation)}return{notation:n,precision:t,wordSize:r}}function Te(e){const t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);const r=t[1],n=t[2];let i=parseFloat(t[4]||"0");const o=n.indexOf(".");i+=-1!==o?o-1:n.length-1;const a=n.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===a.length&&(a.push(0),i++),{sign:r,coefficients:a,exponent:i}}function De(e,t){if(isNaN(e)||!isFinite(e))return String(e);const r=Te(e),n="number"==typeof t?Oe(r,r.exponent+1+t):r;let i=n.coefficients,o=n.exponent+1;const a=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Oe(e,t){const r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;for(;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){let e=t-1;for(n[e]++;10===n[e];)n.pop(),0===e&&(n.unshift(0),r.exponent++,e++),e--,n[e]++}return r}function Be(e){const t=[];for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-8,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(isFinite(e)&&isFinite(t)?e===t||Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n):e===t)}Number.EPSILON;const ze=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},Ie=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},ke=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},qe=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},Re=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Pe=Math.tanh||function(e){const t=Math.exp(2*e);return(t-1)/(t+1)};function je(e,t){return h(e)?e:g(e)?e.toNumber():void t()}function Ue(e,t){return h(e)?e:g(e)?e.toNumber():t}let Le=function(){return Le=t.create,t};const $e=de("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){let{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e;const o=Le();return o.clear(),o.addTypes([{name:"number",test:h},{name:"Complex",test:x},{name:"BigNumber",test:g},{name:"bigint",test:y},{name:"Fraction",test:b},{name:"Unit",test:v},{name:"identifier",test:e=>w&&/^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49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\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(e)},{name:"string",test:w},{name:"Chain",test:ie},{name:"Array",test:N},{name:"Matrix",test:E},{name:"DenseMatrix",test:S},{name:"SparseMatrix",test:M},{name:"Range",test:C},{name:"Index",test:T},{name:"boolean",test:D},{name:"ResultSet",test:F},{name:"Help",test:O},{name:"function",test:B},{name:"Date",test:_},{name:"RegExp",test:z},{name:"null",test:P},{name:"undefined",test:j},{name:"AccessorNode",test:U},{name:"ArrayNode",test:L},{name:"AssignmentNode",test:$},{name:"BlockNode",test:H},{name:"ConditionalNode",test:G},{name:"ConstantNode",test:Z},{name:"FunctionNode",test:Y},{name:"FunctionAssignmentNode",test:W},{name:"IndexNode",test:J},{name:"Node",test:X},{name:"ObjectNode",test:Q},{name:"OperatorNode",test:K},{name:"ParenthesisNode",test:ee},{name:"RangeNode",test:te},{name:"RelationalNode",test:re},{name:"SymbolNode",test:ne},{name:"Map",test:k},{name:"Object",test:I}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||He(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||Ge(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||Ge(e),new r(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e+")");return Number(e)}},{from:"bigint",to:"BigNumber",convert:function(e){return t||He(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return i||Ze(e),new i(e.toString())}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||Ge(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Ze(e);const t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){const t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||He(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){i||Ze(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||Ge(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||He(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Ze(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),o.onMismatch=(e,t,r)=>{const n=o.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&A(t[0])&&r.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},o.onMismatch=(e,t,r)=>{const n=o.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&A(t[0])&&r.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},o}));function He(e){throw new Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function Ge(e){throw new Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function Ze(e){throw new Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}const Ve=de("ResultSet",[],(()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0});var We,Ye,Je=9e15,Xe=1e9,Qe="0123456789abcdef",Ke="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",et="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",tt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Je,maxE:Je,crypto:!1},rt=!0,nt="[DecimalError] ",it=nt+"Invalid argument: ",ot=nt+"Precision limit exceeded",at=nt+"crypto unavailable",st="[object Decimal]",ut=Math.floor,ct=Math.pow,lt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ft=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,pt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,mt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,dt=1e7,ht=7,gt=Ke.length-1,yt=et.length-1,xt={toStringTag:st};function bt(e){var t,r,n,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;tr)throw Error(it+e)}function wt(e,t,r,n){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=ht,i=0):(i=Math.ceil((t+1)/ht),t%=ht),o=ct(10,ht-t),s=e[i]%o|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(e[i+1]/o/100|0)==ct(10,t-2)-1||(s==o/2||0==s)&&!(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(n||r<4)&&9999==s||!n&&r>3&&4999==s):a=((n||r<4)&&s+1==o||!n&&r>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==ct(10,t-3)-1,a}function Nt(e,t,r){for(var n,i,o=[0],a=0,s=e.length;ar-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}xt.absoluteValue=xt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),At(e)},xt.ceil=function(){return At(new this.constructor(this),this.e+1,2)},xt.clampedTo=xt.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(it+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},xt.comparedTo=xt.cmp=function(e){var t,r,n,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,u=o.s,c=e.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(t=0,r=(n=a.length)<(i=s.length)?n:i;ts[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},xt.cosine=xt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+ht,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/jt(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Pt(e,1,t.times(i),new e(1));for(var o=r;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}(n,Ut(n,r)),n.precision=e,n.rounding=t,At(2==Ye||3==Ye?r.neg():r,e,t,!0)):new n(1):new n(NaN)},xt.cubeRoot=xt.cbrt=function(){var e,t,r,n,i,o,a,s,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(rt=!1,(o=l.s*ct(l.s*l,1/3))&&Math.abs(o)!=1/0?n=new f(o.toString()):(r=bt(l.d),(o=((e=l.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=ct(r,1/3),e=ut((e+1)/3)-(e%3==(e<0?-1:2)),(n=new f(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=l.s),a=(e=f.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(l),n=Et(c.plus(l).times(s),c.plus(u),a+2,1),bt(s.d).slice(0,a)===(r=bt(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(At(n,e+1,1),t=!n.times(n).times(n).eq(l));break}if(!i&&(At(s,e+1,0),s.times(s).times(s).eq(l))){n=s;break}a+=4,i=1}return rt=!0,At(n,e,f.rounding,t)},xt.decimalPlaces=xt.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-ut(this.e/ht))*ht,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},xt.dividedBy=xt.div=function(e){return Et(this,new this.constructor(e))},xt.dividedToIntegerBy=xt.divToInt=function(e){var t=this.constructor;return At(Et(this,new t(e),0,1,1),t.precision,t.rounding)},xt.equals=xt.eq=function(e){return 0===this.cmp(e)},xt.floor=function(){return At(new this.constructor(this),this.e+1,3)},xt.greaterThan=xt.gt=function(e){return this.cmp(e)>0},xt.greaterThanOrEqualTo=xt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},xt.hyperbolicCosine=xt.cosh=function(){var e,t,r,n,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/jt(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=Pt(a,1,o.times(t),new a(1),!0);for(var u,c=e,l=new a(8);c--;)u=o.times(o),o=s.minus(u.times(l.minus(u.times(l))));return At(o,a.precision=r,a.rounding=n,!0)},xt.hyperbolicSine=xt.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=Pt(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=Pt(o,2,i=i.times(1/jt(5,e)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=t,o.rounding=r,At(i,t,r,!0)},xt.hyperbolicTangent=xt.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Et(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},xt.inverseCosine=xt.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?t.isNeg()?Tt(r,i,o):new r(0):new r(NaN):t.isZero()?Tt(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Tt(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},xt.inverseHyperbolicCosine=xt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,rt=!1,r=r.times(r).minus(1).sqrt().plus(r),rt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},xt.inverseHyperbolicSine=xt.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,rt=!1,r=r.times(r).plus(1).sqrt().plus(r),rt=!0,n.precision=e,n.rounding=t,r.ln())},xt.inverseHyperbolicTangent=xt.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?At(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Et(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},xt.inverseSine=xt.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t?0===t?((e=Tt(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},xt.inverseTangent=xt.atan=function(){var e,t,r,n,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=yt)return(a=Tt(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=yt)return(a=Tt(l,f+4,p).times(.5)).s=c.s,a}for(l.precision=s=f+10,l.rounding=1,e=r=Math.min(28,s/ht+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(rt=!1,t=Math.ceil(s/ht),n=1,u=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(u),o=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(n+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return r&&(a=a.times(2<this.d.length-2},xt.isNaN=function(){return!this.s},xt.isNegative=xt.isNeg=function(){return this.s<0},xt.isPositive=xt.isPos=function(){return this.s>0},xt.isZero=function(){return!!this.d&&0===this.d[0]},xt.lessThan=xt.lt=function(e){return this.cmp(e)<0},xt.lessThanOrEqualTo=xt.lte=function(e){return this.cmp(e)<1},xt.logarithm=xt.log=function(e){var t,r,n,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(null==e)e=new l(10),t=!0;else{if(r=(e=new l(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new l(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}if(rt=!1,a=It(c,s=f+5),n=t?Ct(l,s+10):It(e,s),wt((u=Et(a,n,s,1)).d,i=f,p))do{if(a=It(c,s+=10),n=t?Ct(l,s+10):It(e,s),u=Et(a,n,s,1),!o){+bt(u.d).slice(i+1,i+15)+1==1e14&&(u=At(u,f+1,0));break}}while(wt(u.d,i+=10,p));return rt=!0,At(u,f,p)},xt.minus=xt.sub=function(e){var t,r,n,i,o,a,s,u,c,l,f,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN):e=new d(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,s=d.precision,u=d.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new d(3===u?-0:0);e=new d(m)}return rt?At(e,s,u):e}if(r=ut(e.e/ht),l=ut(m.e/ht),c=c.slice(),o=l-r){for((f=o<0)?(t=c,o=-o,a=p.length):(t=p,r=l,a=c.length),o>(n=Math.max(Math.ceil(s/ht),a)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((f=(n=c.length)<(a=p.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=p.length;n>o;){if(c[--n](a=(o=Math.ceil(s/ht))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,r=l,l=c,c=r),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/dt|0,c[i]%=dt;for(t&&(c.unshift(t),++n),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=Mt(c,n),rt?At(e,s,u):e},xt.precision=xt.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(it+e);return r.d?(t=Dt(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},xt.round=function(){var e=this,t=e.constructor;return At(new t(e),e.e+1,t.rounding)},xt.sine=xt.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+ht,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Pt(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=Pt(e,2,t=t.times(1/jt(5,r)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(n,Ut(n,r)),n.precision=e,n.rounding=t,At(Ye>2?r.neg():r,e,t,!0)):new n(NaN)},xt.squareRoot=xt.sqrt=function(){var e,t,r,n,i,o,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(rt=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=bt(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=ut((u+1)/2)-(u<0||u%2),n=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new l(c.toString()),r=(u=l.precision)+3;;)if(n=(o=n).plus(Et(a,o,r+2,1)).times(.5),bt(o.d).slice(0,r)===(t=bt(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(At(n,u+1,1),e=!n.times(n).eq(a));break}if(!i&&(At(o,u+1,0),o.times(o).eq(a))){n=o;break}r+=4,i=1}return rt=!0,At(n,u,l.rounding,e)},xt.tangent=xt.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=Et(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,At(2==Ye||4==Ye?r.neg():r,e,t,!0)):new n(NaN)},xt.times=xt.mul=function(e){var t,r,n,i,o,a,s,u,c,l=this,f=l.constructor,p=l.d,m=(e=new f(e)).d;if(e.s*=l.s,!(p&&p[0]&&m&&m[0]))return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*e.s:e.s/0);for(r=ut(l.e/ht)+ut(e.e/ht),(u=p.length)<(c=m.length)&&(o=p,p=m,m=o,a=u,u=c,c=a),o=[],n=a=u+c;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)s=o[i]+m[n]*p[i-n-1]+t,o[i--]=s%dt|0,t=s/dt|0;o[i]=(o[i]+t)%dt|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Mt(o,r),rt?At(e,f.precision,f.rounding):e},xt.toBinary=function(e,t){return Lt(this,2,e,t)},xt.toDecimalPlaces=xt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(vt(e,0,Xe),void 0===t?t=n.rounding:vt(t,0,8),At(r,e+r.e+1,t))},xt.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=St(n,!0):(vt(e,0,Xe),void 0===t?t=i.rounding:vt(t,0,8),r=St(n=At(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},xt.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?r=St(i):(vt(e,0,Xe),void 0===t?t=o.rounding:vt(t,0,8),r=St(n=At(new o(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},xt.toFraction=function(e){var t,r,n,i,o,a,s,u,c,l,f,p,m=this,d=m.d,h=m.constructor;if(!d)return new h(m);if(c=r=new h(1),n=u=new h(0),a=(o=(t=new h(n)).e=Dt(d)-m.e-1)%ht,t.d[0]=ct(10,a<0?ht+a:a),null==e)e=o>0?t:c;else{if(!(s=new h(e)).isInt()||s.lt(c))throw Error(it+s);e=s.gt(t)?o>0?t:c:s}for(rt=!1,s=new h(bt(d)),l=h.precision,h.precision=o=d.length*ht*2;f=Et(s,t,0,1,1),1!=(i=r.plus(f.times(n))).cmp(e);)r=n,n=i,i=c,c=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=Et(e.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=m.s,p=Et(c,n,o,1).minus(m).abs().cmp(Et(u,r,o,1).minus(m).abs())<1?[c,n]:[u,r],h.precision=l,rt=!0,p},xt.toHexadecimal=xt.toHex=function(e,t){return Lt(this,16,e,t)},xt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:vt(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(rt=!1,r=Et(r,e,0,t,1).times(e),rt=!0,At(r)):(e.s=r.s,r=e),r},xt.toNumber=function(){return+this},xt.toOctal=function(e,t){return Lt(this,8,e,t)},xt.toPower=xt.pow=function(e){var t,r,n,i,o,a,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(ct(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,o=u.rounding,e.eq(1))return At(s,n,o);if((t=ut(e.e/ht))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=Ot(u,s,r,n),e.s<0?new u(1).div(i):At(i,n,o);if((a=s.s)<0){if(tu.maxE+1||t0?a/0:0):(rt=!1,u.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=zt(e.times(It(s,n+r)),n)).d&&wt((i=At(i,n+5,1)).d,n,o)&&(t=n+10,+bt((i=At(zt(e.times(It(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=At(i,n+1,0))),i.s=a,rt=!0,u.rounding=o,At(i,n,o))},xt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=St(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(vt(e,1,Xe),void 0===t?t=i.rounding:vt(t,0,8),r=St(n=At(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},xt.toSignificantDigits=xt.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(vt(e,1,Xe),void 0===t?t=r.rounding:vt(t,0,8)),At(new r(this),e,t)},xt.toString=function(){var e=this,t=e.constructor,r=St(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},xt.truncated=xt.trunc=function(){return At(new this.constructor(this),this.e+1,1)},xt.valueOf=xt.toJSON=function(){var e=this,t=e.constructor,r=St(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var Et=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;)e.shift()}return function(n,i,o,a,s,u){var c,l,f,p,m,d,h,g,y,x,b,v,w,N,E,A,S,M,C,T,D=n.constructor,F=n.s==i.s?1:-1,O=n.d,B=i.d;if(!(O&&O[0]&&B&&B[0]))return new D(n.s&&i.s&&(O?!B||O[0]!=B[0]:B)?O&&0==O[0]||!B?0*F:F/0:NaN);for(u?(m=1,l=n.e-i.e):(u=dt,m=ht,l=ut(n.e/m)-ut(i.e/m)),C=B.length,S=O.length,x=(y=new D(F)).d=[],f=0;B[f]==(O[f]||0);f++);if(B[f]>(O[f]||0)&&l--,null==o?(N=o=D.precision,a=D.rounding):N=s?o+(n.e-i.e)+1:o,N<0)x.push(1),d=!0;else{if(N=N/m+2|0,f=0,1==C){for(p=0,B=B[0],N++;(f1&&(B=e(B,p,u),O=e(O,p,u),C=B.length,S=O.length),A=C,v=(b=O.slice(0,C)).length;v=u/2&&++M;do{p=0,(c=t(B,b,C,v))<0?(w=b[0],C!=v&&(w=w*u+(b[1]||0)),(p=w/M|0)>1?(p>=u&&(p=u-1),1==(c=t(h=e(B,p,u),b,g=h.length,v=b.length))&&(p--,r(h,C=10;p/=10)f++;y.e=f+l*m-1,At(y,s?o+y.e+1:o,a,d)}return y}}();function At(e,t,r,n){var i,o,a,s,u,c,l,f,p,m=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=ht,a=t,u=(l=f[p=0])/ct(10,i-a-1)%10|0;else if((p=Math.ceil((o+1)/ht))>=(s=f.length)){if(!n)break e;for(;s++<=p;)f.push(0);l=u=0,i=1,a=(o%=ht)-ht+1}else{for(l=s=f[p],i=1;s>=10;s/=10)i++;u=(a=(o%=ht)-ht+i)<0?0:l/ct(10,i-a-1)%10|0}if(n=n||t<0||void 0!==f[p+1]||(a<0?l:l%ct(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?a>0?l/ct(10,i-a):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=ct(10,(ht-t%ht)%ht),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=p,s=1,p--):(f.length=p+1,s=ct(10,ht-o),f[p]=a>0?(l/ct(10,i-a)%ct(10,a)|0)*s:0),c)for(;;){if(0==p){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,f[0]==dt&&(f[0]=1));break}if(f[p]+=s,f[p]!=dt)break;f[p--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return rt&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ft(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ft(-i-1)+o,r&&(n=r-a)>0&&(o+=Ft(n))):i>=a?(o+=Ft(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+Ft(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=Ft(n))),o}function Mt(e,t){var r=e[0];for(t*=ht;r>=10;r/=10)t++;return t}function Ct(e,t,r){if(t>gt)throw rt=!0,r&&(e.precision=r),Error(ot);return At(new e(Ke),t,1,!0)}function Tt(e,t,r){if(t>yt)throw Error(ot);return At(new e(et),t,r,!0)}function Dt(e){var t=e.length-1,r=t*ht+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ft(e){for(var t="";e--;)t+="0";return t}function Ot(e,t,r,n){var i,o=new e(1),a=Math.ceil(n/ht+4);for(rt=!1;;){if(r%2&&$t((o=o.times(t)).d,a)&&(i=!0),0===(r=ut(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}$t((t=t.times(t)).d,a)}return rt=!0,o}function Bt(e){return 1&e.d[e.d.length-1]}function _t(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(rt=!1,u=d):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=n=Math.log(ct(2,f))/Math.LN10*2+5|0,r=o=a=new p(1),p.precision=u;;){if(o=At(o.times(e),u,1),r=r.times(++l),bt((s=a.plus(Et(o,r,u,1))).d).slice(0,u)===bt(a.d).slice(0,u)){for(i=f;i--;)a=At(a.times(a),u,1);if(null!=t)return p.precision=d,a;if(!(c<3&&wt(a.d,u-n,m,c)))return At(a,p.precision=d,m,rt=!0);p.precision=u+=10,r=o=s=new p(1),l=0,c++}a=s}}function It(e,t){var r,n,i,o,a,s,u,c,l,f,p,m=1,d=e,h=d.d,g=d.constructor,y=g.rounding,x=g.precision;if(d.s<0||!h||!h[0]||!d.e&&1==h[0]&&1==h.length)return new g(h&&!h[0]?-1/0:1!=d.s?NaN:h?0:d);if(null==t?(rt=!1,l=x):l=t,g.precision=l+=10,n=(r=bt(h)).charAt(0),!(Math.abs(o=d.e)<15e14))return c=Ct(g,l+2,x).times(o+""),d=It(new g(n+"."+r.slice(1)),l-10).plus(c),g.precision=x,null==t?At(d,x,y,rt=!0):d;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=bt((d=d.times(e)).d)).charAt(0),m++;for(o=d.e,n>1?(d=new g("0."+r),o++):d=new g(n+"."+r.slice(1)),f=d,u=a=d=Et(d.minus(1),d.plus(1),l,1),p=At(d.times(d),l,1),i=3;;){if(a=At(a.times(p),l,1),bt((c=u.plus(Et(a,new g(i),l,1))).d).slice(0,l)===bt(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(Ct(g,l+2,x).times(o+""))),u=Et(u,new g(m),l,1),null!=t)return g.precision=x,u;if(!wt(u.d,l-10,y,s))return At(u,g.precision=x,y,rt=!0);g.precision=l+=10,c=a=d=Et(f.minus(1),f.plus(1),l,1),p=At(d.times(d),l,1),i=s=1}u=c,i+=2}}function kt(e){return String(e.s*e.s/0)}function qt(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%ht,r<0&&(n+=ht),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),mt.test(t))return qt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ft.test(t))r=16,t=t.toLowerCase();else if(lt.test(t))r=2;else{if(!pt.test(t))throw Error(it+t);r=8}for((o=t.search(/p/i))>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,n=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=Ot(n,new n(r),o,2*o)),o=l=(c=Nt(t,r,dt)).length-1;0===c[o];--o)c.pop();return o<0?new n(0*e.s):(e.e=Mt(c,l),e.d=c,rt=!1,a&&(e=Et(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?ct(2,u):Fr.pow(2,u))),rt=!0,e)}function Pt(e,t,r,n,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/ht);for(rt=!1,u=r.times(r),s=new e(n);;){if(a=Et(s.times(u),new e(t++*t++),c,1),s=i?n.plus(a):n.minus(a),n=Et(a.times(u),new e(t++*t++),c,1),void 0!==(a=s.plus(n)).d[l]){for(o=l;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=n,n=a,a=o}return rt=!0,a.d.length=l+1,a}function jt(e,t){for(var r=e;--t;)r*=e;return r}function Ut(e,t){var r,n=t.s<0,i=Tt(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return Ye=n?4:1,t;if((r=t.divToInt(i)).isZero())Ye=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return Ye=Bt(r)?n?2:3:n?4:1,t;Ye=Bt(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Lt(e,t,r,n){var i,o,a,s,u,c,l,f,p,m=e.constructor,d=void 0!==r;if(d?(vt(r,1,Xe),void 0===n?n=m.rounding:vt(n,0,8)):(r=m.precision,n=m.rounding),e.isFinite()){for(d?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(a=(l=St(e)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new m(1)).e=l.length-a,p.d=Nt(St(p),10,i),p.e=p.d.length),o=u=(f=Nt(l,10,i)).length;0==f[--u];)f.pop();if(f[0]){if(a<0?o--:((e=new m(e)).d=f,e.e=o,f=(e=Et(e,p,r,n,0,i)).d,o=e.e,c=We),a=f[r],s=i/2,c=c||void 0!==f[r+1],c=n<4?(void 0!==a||c)&&(0===n||n===(e.s<0?3:2)):a>s||a===s&&(4===n||c||6===n&&1&f[r-1]||n===(e.s<0?8:7)),f.length=r,c)for(;++f[--r]>i-1;)f[r]=0,r||(++o,f.unshift(1));for(u=f.length;!f[u-1];--u);for(a=0,l="";a1)if(16==t||8==t){for(a=16==t?4:3,--u;u%a;u++)l+="0";for(u=(f=Nt(l,i,t)).length;!f[u-1];--u);for(a=1,l="1.";au)for(o-=u;o--;)l+="0";else ot)return e.length=t,!0}function Ht(e){return new this(e).abs()}function Gt(e){return new this(e).acos()}function Zt(e){return new this(e).acosh()}function Vt(e,t){return new this(e).plus(t)}function Wt(e){return new this(e).asin()}function Yt(e){return new this(e).asinh()}function Jt(e){return new this(e).atan()}function Xt(e){return new this(e).atanh()}function Qt(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?Tt(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=Tt(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Et(e,t,o,1)),t=Tt(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Et(e,t,o,1)):(r=Tt(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function Kt(e){return new this(e).cbrt()}function er(e){return At(e=new this(e),e.e+1,2)}function tr(e,t,r){return new this(e).clamp(t,r)}function rr(e){if(!e||"object"!=typeof e)throw Error(nt+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,Xe,"rounding",0,8,"toExpNeg",-Je,0,"toExpPos",0,Je,"maxE",0,Je,"minE",-Je,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2]))throw Error(it+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=tt[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(it+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(at);this[r]=!0}else this[r]=!1}return this}function nr(e){return new this(e).cos()}function ir(e){return new this(e).cosh()}function or(e,t){return new this(e).div(t)}function ar(e){return new this(e).exp()}function sr(e){return At(e=new this(e),e.e+1,3)}function ur(){var e,t,r=new this(0);for(rt=!1,e=0;e=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(at);for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;no.maxE?(i.e=NaN,i.d=null):e.e=10;r/=10)t++;return void(rt?t>o.maxE?(i.e=NaN,i.d=null):t{let{on:t,config:r}=e;const n=Or.clone({precision:r.precision,modulo:Or.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})})),n}),{isClass:!0});var _r=r(5716);const zr=de("Complex",[],(()=>(Object.defineProperty(_r,"name",{value:"Complex"}),_r.prototype.constructor=_r,_r.prototype.type="Complex",_r.prototype.isComplex=!0,_r.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},_r.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},_r.prototype.format=function(e){let t="",r=this.im,n=this.re;const i=Me(this.re,e),o=Me(this.im,e),a=h(e)?e:e?e.precision:null;if(null!==a){const e=Math.pow(10,-a);Math.abs(n/r)t.re?1:e.ret.im?1:e.im1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var Pr=function(e,t){var r,n=0,i=1,o=1,a=0,s=0,u=0,c=1,l=1,f=0,p=1,m=1,d=1,h=1e7;if(null==e);else if(void 0!==t){if(o=(n=e)*(i=t),n%1!=0||i%1!=0)throw Hr()}else switch(typeof e){case"object":if("d"in e&&"n"in e)n=e.n,i=e.d,"s"in e&&(n*=e.s);else{if(!(0 in e))throw $r();n=e[0],1 in e&&(i=e[1])}o=n*i;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)n=e;else if(e>0){for(e>=1&&(e/=l=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=h&&d<=h;){if(e===(r=(f+m)/(p+d))){p+d<=h?(n=f+m,i=p+d):d>p?(n=m,i=d):(n=f,i=p);break}e>r?(f+=m,p+=d):(m+=f,d+=p),p>h?(n=m,i=d):(n=f,i=p)}n*=l}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(p=e.match(/\d+|./g)))throw $r();if("-"===p[f]?(o=-1,f++):"+"===p[f]&&f++,p.length===f+1?s=kr(p[f++],o):"."===p[f+1]||"."===p[f]?("."!==p[f]&&(a=kr(p[f++],o)),(1+ ++f===p.length||"("===p[f+1]&&")"===p[f+3]||"'"===p[f+1]&&"'"===p[f+3])&&(s=kr(p[f],o),c=Math.pow(10,p[f].length),f++),("("===p[f]&&")"===p[f+2]||"'"===p[f]&&"'"===p[f+2])&&(u=kr(p[f+1],o),l=Math.pow(10,p[f+1].length)-1,f+=3)):"/"===p[f+1]||":"===p[f+1]?(s=kr(p[f],o),c=kr(p[f+2],1),f+=3):"/"===p[f+3]&&" "===p[f+1]&&(a=kr(p[f],o),s=kr(p[f+2],o),c=kr(p[f+4],1),f+=5),p.length<=f){o=n=u+(i=c*l)*a+l*s;break}default:throw $r()}if(0===i)throw Lr();Ir.s=o<0?-1:1,Ir.n=Math.abs(n),Ir.d=Math.abs(i)};function jr(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function Ur(e,t){if(Pr(e,t),!(this instanceof Ur))return qr(Ir.s*Ir.n,Ir.d);e=jr(Ir.d,Ir.n),this.s=Ir.s,this.n=Ir.n/e,this.d=Ir.d/e}var Lr=function(){return new Error("Division by Zero")},$r=function(){return new Error("Invalid argument")},Hr=function(){return new Error("Parameters must be integer")};Ur.prototype={s:1,n:0,d:1,abs:function(){return qr(this.n,this.d)},neg:function(){return qr(-this.s*this.n,this.d)},add:function(e,t){return Pr(e,t),qr(this.s*this.n*Ir.d+Ir.s*this.d*Ir.n,this.d*Ir.d)},sub:function(e,t){return Pr(e,t),qr(this.s*this.n*Ir.d-Ir.s*this.d*Ir.n,this.d*Ir.d)},mul:function(e,t){return Pr(e,t),qr(this.s*Ir.s*this.n*Ir.n,this.d*Ir.d)},div:function(e,t){return Pr(e,t),qr(this.s*Ir.s*this.n*Ir.d,this.d*Ir.n)},clone:function(){return qr(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Ur(NaN);if(void 0===e)return qr(this.s*this.n%this.d,1);if(Pr(e,t),0===Ir.n&&0===this.d)throw Lr();return qr(this.s*(Ir.d*this.n)%(Ir.n*this.d),Ir.d*this.d)},gcd:function(e,t){return Pr(e,t),qr(jr(Ir.n,this.n)*jr(Ir.d,this.d),Ir.d*this.d)},lcm:function(e,t){return Pr(e,t),0===Ir.n&&0===this.n?qr(0,1):qr(Ir.n*this.n,jr(Ir.n,this.n)*jr(Ir.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ur(NaN):qr(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ur(NaN):qr(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ur(NaN):qr(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return Pr(e,t),qr(this.s*Math.round(this.n*Ir.d/(this.d*Ir.n))*Ir.n,Ir.d)},inverse:function(){return qr(this.s*this.d,this.n)},pow:function(e,t){if(Pr(e,t),1===Ir.d)return Ir.s<0?qr(Math.pow(this.s*this.d,Ir.n),Math.pow(this.n,Ir.n)):qr(Math.pow(this.s*this.n,Ir.n),Math.pow(this.d,Ir.n));if(this.s<0)return null;var r=Rr(this.n),n=Rr(this.d),i=1,o=1;for(var a in r)if("1"!==a){if("0"===a){i=0;break}if(r[a]*=Ir.n,r[a]%Ir.d!=0)return null;r[a]/=Ir.d,i*=Math.pow(a,r[a])}for(var a in n)if("1"!==a){if(n[a]*=Ir.n,n[a]%Ir.d!=0)return null;n[a]/=Ir.d,o*=Math.pow(a,n[a])}return Ir.s<0?qr(o,i):qr(i,o)},equals:function(e,t){return Pr(e,t),this.s*this.n*Ir.d==Ir.s*Ir.n*this.d},compare:function(e,t){Pr(e,t);var r=this.s*this.n*Ir.d-Ir.s*Ir.n*this.d;return(0=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>2e3)return 0;return n}(0,r),i=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),o=0;o<300;o++){if(n===i)return o;n=10*n%t,i=10*i%t}return 0}(0,r,n),o=this.s<0?"-":"";if(o+=t/r|0,t%=r,(t*=10)&&(o+="."),n){for(var a=i;a--;)o+=t/r|0,t%=r,t*=10;for(o+="(",a=n;a--;)o+=t/r|0,t%=r,t*=10;o+=")"}else for(a=e;t&&a--;)o+=t/r|0,t%=r,t*=10;return o}};const Gr=de("Fraction",[],(()=>(Object.defineProperty(Ur,"name",{value:"Fraction"}),Ur.prototype.constructor=Ur,Ur.prototype.type="Fraction",Ur.prototype.isFraction=!0,Ur.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ur.fromJSON=function(e){return new Ur(e)},Ur)),{isClass:!0});r(3362);const Zr=de("Range",[],(()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");const i=null!=t,o=null!=r,a=null!=n;if(i)if(g(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(o)if(g(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter end must be a number");if(a)if(g(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=a?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;const r=t.split(":").map((function(e){return parseFloat(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[2],r[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){let e=0;const t=this.start,r=this.step,n=this.end-t;return be(r)===be(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){const e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){const e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){let t=this.start;const r=this.step,n=this.end;let i=0;if(r>0)for(;tn;)e(t,[i],this),t+=r,i++},e.prototype.map=function(e){const t=[];return this.forEach((function(r,n,i){t[n[0]]=e(r,n,i)})),t},e.prototype.toArray=function(){const e=[];return this.forEach((function(t,r){e[r[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){let t=Me(this.start,e);return 1!==this.step&&(t+=":"+Me(this.step,e)),t+=":"+Me(this.end,e),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e}),{isClass:!0}),Vr=de("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0});function Wr(){return Wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0?"+":"")+n.toString()}(e,n);case"bin":return Yr(e,2,i);case"oct":return Yr(e,8,i);case"hex":return Yr(e,16,i);case"auto":{const r=Xr(null==t?void 0:t.lowerExp,-3),i=Xr(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";let o;const a=e.toSignificantDigits(n),s=a.e;return o=s>=r&&sen(r)+": "+Kr(e[r],t))).join(", ")+"}":String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function en(e){const t=String(e);let r="",n=0;for(;n/g,">"),t}function nn(e,t){if(Array.isArray(e)){let r="[";const n=e.length;for(let i=0;it?1:-1}function an(e,t,r){if(!(this instanceof an))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function sn(e,t,r){if(!(this instanceof sn))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function un(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function cn(e,t,r){let n;const i=e.length;if(i!==t[r])throw new an(i,t[r]);if(r")}function ln(e,t){if(0===t.length){if(Array.isArray(e))throw new an(e.length,0)}else cn(e,t,0)}function fn(e,t){const r=e.isMatrix?e._size:un(e);t._sourceSize.forEach(((e,t)=>{if(null!==e&&e!==r[t])throw new an(e,r[t])}))}function pn(e,t){if(void 0!==e){if(!h(e)||!ye(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new sn(e,t)}}function mn(e){for(let t=0;t=0){if(t%r!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function xn(e){return e.reduce(((e,t)=>e*t),1)}function bn(e,t){const r=t||un(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],r.shift();let n=r.length;for(;1===r[n-1];)n--;return nt.test(e)))}function Cn(e,t){return Array.prototype.join.call(e,t)}function Tn(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;const t=[];let r=0;t[0]={value:e[0],identifier:0};for(let n=1;n1)return e.slice(1).reduce((function(e,r){return On(e,r,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function _n(){for(var e=arguments.length,t=new Array(e),r=0;re.length)),i=Math.max(...n),o=new Array(i).fill(null);for(let e=0;eo[t]&&(o[t]=r[e])}}for(let e=0;e1||e[i]>t[o])throw new Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${n} with size ${e[i]} to size ${t[o]}`)}}function In(e,t){let r=un(e);if(ce(r,t))return e;zn(r,t);const n=_n(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r];let a=function(e){return Wr([],e)}(e);r.lengthe[t]),e)}function qn(e,t,r,n){return Array.isArray(e)?e.map((function(e,i){return qn(e,t.concat(i),r,n)})):n(e,t,r)}function Rn(e,r,n){if(t.isTypedFunction(e)){const i=(r.isMatrix?r.size():un(r)).map((()=>0)),o=r.isMatrix?r.get(i):kn(r,i),a=1===Object.keys(e.signatures).length,s=function(e,r,n,i){const o=[r,n,i];for(let r=3;r>0;r--){const n=o.slice(0,r);if(null!==t.resolve(e,n))return r}}(e,o,i,r),u=a?Object.values(e.signatures)[0]:e;return s>=1&&s<=3?function(){for(var t=arguments.length,r=new Array(t),i=0;i=2&&e.push(`index: ${oe(t[1])}`),t.length>=3&&e.push(`array: ${oe(t[2])}`),new TypeError(`Function ${r} cannot apply callback arguments ${n}(${e.join(", ")}) at index ${JSON.stringify(t[1])}`)}throw new TypeError(`Function ${r} cannot apply callback arguments to function ${n}: ${e.message}`)}(e,t,r,n)}}an.prototype=new RangeError,an.prototype.constructor=RangeError,an.prototype.name="DimensionError",an.prototype.isDimensionError=!0,sn.prototype=new RangeError,sn.prototype.constructor=RangeError,sn.prototype.name="IndexError",sn.prototype.isIndexError=!0,r(3110);const jn=de("DenseMatrix",["Matrix"],(e=>{let{Matrix:t}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(E(e))"DenseMatrix"===e.type?(this._data=ae(e._data),this._size=ae(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&N(e.data)&&N(e.size))this._data=e.data,this._size=e.size,ln(this._data,this._size),this._datatype=t||e.datatype;else if(N(e))this._data=s(e),this._size=un(this._data),ln(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+oe(e)+")");this._data=[],this._size=[0],this._datatype=t}}function n(e,t,r,i){const o=i===r-1,a=t.dimension(i);return o?a.map((function(t){return pn(t,e.length),e[t]})).valueOf():a.map((function(o){return pn(o,e.length),n(e[o],t,r,i+1)})).valueOf()}function i(e,t,r,n,o){const a=o===n-1,s=t.dimension(o);a?s.forEach((function(t,n){pn(t),e[t]=r[n[0]]})):s.forEach((function(a,s){pn(a),i(e[a],t,r[s[0]],n,o+1)}))}function o(e,t,r){if(0===t.length){let t=e._data;for(;N(t);)t=t[0];return t}return e._size=t.slice(0),e._data=dn(e._data,e._size,r),e}function a(e,t,r){const n=e._size.slice(0);let i=!1;for(;n.lengthn[e]&&(n[e]=t[e],i=!0);i&&o(e,n,r)}function s(e){return E(e)?s(e.valueOf()):N(e)?e.map(s):e}return r.prototype=new t,r.prototype.createDenseMatrix=function(e,t){return new r(e,t)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return Fn(this._data,oe)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.subset=function(e,t,o){switch(arguments.length){case 1:return function(e,t){if(!T(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());{const i=t.size();if(i.length!==e._size.length)throw new an(i.length,e._size.length);const o=t.min(),a=t.max();for(let t=0,r=e._size.length;t");a(e,t.max().map((function(e){return e+1})),n);const s=o.length,c=0;i(e._data,t,r,s,c)}return e}(this,e,t,o);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){return kn(this._data,e)},r.prototype.set=function(e,t,r){if(!N(e))throw new TypeError("Array expected");if(e.lengthArray.isArray(e)&&1===e.length?e[0]:e));return o(r?this.clone():this,n,t)},r.prototype.reshape=function(e,t){const r=t?this.clone():this;r._data=gn(r._data,e);const n=r._size.reduce(((e,t)=>e*t));return r._size=yn(e,n),r},r.prototype.clone=function(){return new r({data:ae(this._data),size:ae(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype._forEach=function(e){const t=this,r=t.size();if(1===r.length){for(let n=0;n=0;a--){if(n[a]++,n[a]!==r[a]){i[a]=0===a?t._data[n[a]]:i[a-1][n[a]];for(let e=a;e[e[i]]));e.push(new r(t,this._datatype))}return e},r.prototype.toArray=function(){return ae(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(e){return Kr(this._data,e)},r.prototype.toString=function(){return Kr(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!h(e)||!ye(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,n=e<0?-e:0,i=this._size[0],o=this._size[1],a=Math.min(i-n,o-t),s=[];for(let e=0;e0?n:0,a=n<0?-n:0,s=e[0],u=e[1],c=Math.min(s-a,u-o);let l;if(N(t)){if(t.length!==c)throw new Error("Invalid value array length");l=function(e){return t[e]}}else if(E(t)){const e=t.size();if(1!==e.length||e[0]!==c)throw new Error("Invalid matrix length");l=function(e){return t.get([e])}}else l=function(){return t};i||(i=g(l(0))?l(0).mul(0):0);let f=[];if(e.length>0){f=dn(f,e,i);for(let e=0;e{let{typed:t}=e;return t(Un,{any:ae})}));function $n(e){const t=e.length,r=e[0].length;let n,i;const o=[];for(i=0;i=n.length)throw new sn(t,n.length);return E(e)?e.create(Wn(e.valueOf(),t,r),e.datatype()):Wn(e,t,r)}function Wn(e,t,r){let n,i,o,a;if(t<=0){if(Array.isArray(e[0])){for(a=$n(e),i=[],n=0;n{let{typed:t}=e;return t(Jn,{number:ye,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Qn="number";function Kn(e){return e<0}function ei(e){return e>0}function ti(e){return Number.isNaN(e)}function ri(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return!e.isNaN()&&!t.isNaN()&&(e.isFinite()&&t.isFinite()?!!e.eq(t)||e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n)):e.eq(t))}Kn.signature=Qn,ei.signature=Qn,ti.signature=Qn;const ni="isNegative",ii=de(ni,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(ni,{number:e=>!_e(e,0,r.relTol,r.absTol)&&Kn(e),BigNumber:e=>!ri(e,new e.constructor(0),r.relTol,r.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),oi="isNumeric",ai=de(oi,["typed"],(e=>{let{typed:t}=e;return t(oi,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),si="hasNumericValue",ui=de(si,["typed","isNumeric"],(e=>{let{typed:t,isNumeric:r}=e;return t(si,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})})),ci="isPositive",li=de(ci,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(ci,{number:e=>!_e(e,0,r.relTol,r.absTol)&&ei(e),BigNumber:e=>!(ri(e,new e.constructor(0),r.relTol,r.absTol)||e.isNeg()||e.isZero()||e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0&&e.n>0,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),fi="isZero",pi=de(fi,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return t(fi,{"number | BigNumber | Complex | Fraction":e=>r(e,0),bigint:e=>0n===e,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),mi="isNaN",di=de(mi,["typed"],(e=>{let{typed:t}=e;return t(mi,{number:ti,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),hi="typeOf",gi=de(hi,["typed"],(e=>{let{typed:t}=e;return t(hi,{any:oe})})),yi=de("compareUnits",["typed"],(e=>{let{typed:t}=e;return{"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)}))}})),xi="equalScalar",bi=de(xi,["typed","config"],(e=>{let{typed:t,config:r}=e;const n=yi({typed:t});return t(xi,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return _e(e,t,r.relTol,r.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||ri(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,r,n){return _e(e.re,t.re,r,n)&&_e(e.im,t.im,r,n)}(e,t,r.relTol,r.absTol)}},n)})),vi=(de(xi,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(xi,{"number, number":function(e,t){return _e(e,t,r.relTol,r.absTol)}})})),de("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{let{typed:t,equalScalar:r,Matrix:n}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(E(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?ae(t._values):void 0,e._index=ae(t._index),e._ptr=ae(t._ptr),e._size=ae(t._size),e._datatype=r||t._datatype):o(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&N(e.index)&&N(e.ptr)&&N(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(N(e))o(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+oe(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function o(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;const o=n.length;let a=0,s=r,u=0;if(w(i)&&(s=t.find(r,[i,i])||r,u=t.convert(0,i)),o>0){let t=0;do{e._ptr.push(e._index.length);for(let r=0;rd){for(p=d;pl){if(c){let t=0;for(p=0;pn-1&&(e._values.splice(m,1),e._index.splice(m,1),t++)}e._ptr[p]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function c(e,t,r,n,i){const o=n[0],a=n[1],s=[];let u,c;for(u=0;u");if(1===i.length)t.dimension(0).forEach((function(t,i){pn(t),e.set([t,0],r[i[0]],n)}));else{const i=t.dimension(0),o=t.dimension(1);i.forEach((function(t,i){pn(t),o.forEach((function(o,a){pn(o),e.set([t,o],r[i[0]][a[0]],n)}))}))}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!N(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new an(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");const t=e[0],r=e[1];pn(t,this._size[0]),pn(r,this._size[1]);const n=a(t,this._ptr[r],this._ptr[r+1],this._index);return nl-1||c>f-1)&&(u(this,Math.max(o+1,l),Math.max(c+1,f),i),l=this._size[0],f=this._size[1]),pn(o,l),pn(c,f);const d=a(o,this._ptr[c],this._ptr[c+1],this._index);return dArray.isArray(e)&&1===e.length?e[0]:e));if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach((function(e){if(!h(e)||!ye(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Kr(n)+")")})),u(r?this.clone():this,n[0],n[1],t)},i.prototype.reshape=function(e,t){if(!N(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!h(t)||!ye(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Kr(e)+")")}));const r=this._size[0]*this._size[1];if(r!==(e=yn(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");const n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;const i=[];for(let e=0;e=0&&r<=a&&y(e._values[i],r-0,t-0)}else{const i={};for(let t=r;t "+(this._values?Kr(this._values[o],e):"X")}return i},i.prototype.toString=function(){return Kr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!h(e)||!ye(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,r=e<0?-e:0,n=this._size[0],o=this._size[1],a=Math.min(n-r,o-t),s=[],u=[],c=[];c[0]=0;for(let e=t;e0?o:0,f=o<0?-o:0,p=e[0],m=e[1],d=Math.min(p-f,m-l);let y;if(N(n)){if(n.length!==d)throw new Error("Invalid value array length");y=function(e){return n[e]}}else if(E(n)){const e=n.size();if(1!==e.length||e[0]!==d)throw new Error("Invalid matrix length");y=function(e){return n.get([e])}}else y=function(){return n};const x=[],b=[],v=[];for(let e=0;e=0&&t=u||i[l]!==t)){const e=n?n[c]:void 0;i.splice(l,0,t),n&&n.splice(l,0,e),i.splice(l<=c?c+1:c,1),n&&n.splice(l<=c?c+1:c,1)}else if(l=u||i[c]!==e)){const t=n?n[l]:void 0;i.splice(c,0,e),n&&n.splice(c,0,t),i.splice(c<=l?l+1:l,1),n&&n.splice(c<=l?l+1:l,1)}}},i}),{isClass:!0})),wi=de("number",["typed"],(e=>{let{typed:t}=e;const r=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;const t=function(e){const t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);return t?{input:e,radix:{"0b":2,"0o":8,"0x":16}[t[1]],integerPart:t[2],fractionalPart:t[3]}:null}(e);if(t)return function(e){const t=parseInt(e.integerPart,e.radix);let r=0;for(let t=0;t2**r-1)throw new SyntaxError(`String "${e}" is out of range`);i>=2**(r-1)&&(i-=2**r)}return i},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))});return r.fromJSON=function(e){return parseFloat(e.value)},r})),Ni=de("bigint",["typed"],(e=>{let{typed:t}=e;const r=t("bigint",{"":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},"string | boolean":function(e){return BigInt(e)},null:function(e){return 0n},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))});return r.fromJSON=function(e){return BigInt(e.value)},r})),Ei="string",Ai=de(Ei,["typed"],(e=>{let{typed:t}=e;return t(Ei,{"":function(){return""},number:Me,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e))),any:function(e){return String(e)}})})),Si="boolean",Mi=de(Si,["typed"],(e=>{let{typed:t}=e;return t(Si,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){const t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;const r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Ci=de("bignumber",["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){const t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const n=t[2],i=r(t[1]),o=new r(2).pow(Number(n));if(i.gt(o.sub(1)))throw new SyntaxError(`String "${e}" is out of range`);const a=new r(2).pow(Number(n)-1);return i.gte(a)?i.sub(o):i}return new r(e)},BigNumber:function(e){return e},bigint:function(e){return new r(e.toString())},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Ti=de("complex",["typed","Complex"],(e=>{let{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Di=de("fraction",["typed","Fraction"],(e=>{let{typed:t,Fraction:r}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Fi="matrix",Oi=de(Fi,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{let{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(Fi,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,r){if("dense"===t||"default"===t||void 0===t)return new n(e,r);if("sparse"===t)return new i(e,r);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Bi="matrixFromFunction",_i=de(Bi,["typed","matrix","isZero"],(e=>{let{typed:t,matrix:r,isZero:n}=e;return t(Bi,{"Array | Matrix, function, string, string":function(e,t,r,n){return i(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,t,i,o){let a;return a=void 0!==o?r(i,o):r(i),a.resize(e),a.forEach((function(e,r){const i=t(r);n(i)||a.set(r,i)})),a}})),zi="matrixFromRows",Ii=de(zi,["typed","matrix","flatten","size"],(e=>{let{typed:t,matrix:r,flatten:n,size:i}=e;return t(zi,{"...Array":function(e){return o(e)},"...Matrix":function(e){return r(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");const t=a(e[0]),r=[];for(const i of e){const e=a(i);if(e!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|e));r.push(n(i))}return r}function a(e){const t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),ki="matrixFromColumns",qi=de(ki,["typed","matrix","flatten","size"],(e=>{let{typed:t,matrix:r,flatten:n,size:i}=e;return t(ki,{"...Array":function(e){return o(e)},"...Matrix":function(e){return r(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");const t=a(e[0]),r=[];for(let e=0;e{let{typed:t}=e;return t(Ri,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),ji="number",Ui="number, number";function Li(e){return Math.abs(e)}function $i(e,t){return e+t}function Hi(e,t){return e-t}function Gi(e,t){return e*t}function Zi(e){return-e}function Vi(e){return e}function Wi(e){return Ee(e)}function Yi(e){return e*e*e}function Ji(e){return Math.exp(e)}function Xi(e){return Ae(e)}function Qi(e,t){if(!ye(e)||!ye(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;let r;const n=e*t;for(;0!==t;)r=t,t=e%r,e=r;return Math.abs(n/e)}function Ki(e){return we(e)}function eo(e){return ve(e)}function to(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;let n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function ro(e){return be(e)}function no(e){return e*e}function io(e,t){let r,n,i,o,a=0,s=1,u=1,c=0;if(!ye(e)||!ye(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=s-n*a,s=r,r=u,u=c-n*u,c=r,e=t,t=i;return o=e<0?[-e,-s,-c]:[e,e?s:0,c],o}function oo(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ye(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(De(e,t))}Li.signature=ji,$i.signature=Ui,Hi.signature=Ui,Gi.signature=Ui,Zi.signature=ji,Vi.signature=ji,Wi.signature=ji,Yi.signature=ji,Ji.signature=ji,Xi.signature=ji,Qi.signature=Ui,Ki.signature=ji,eo.signature=ji,ro.signature=ji,no.signature=ji,io.signature=Ui,oo.signature=Ui;const so="unaryMinus",uo=de(so,["typed"],(e=>{let{typed:t}=e;return t(so,{number:Zi,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf((e=>r=>{const n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n})),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0)))})})),co="unaryPlus",lo=de(co,["typed","config","numeric"],(e=>{let{typed:t,config:r,numeric:n}=e;return t(co,{number:Vi,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),boolean:function(e){return n(e?1:0,r.number)},string:function(e){return n(e,xe(e,r))}})})),fo=de("abs",["typed"],(e=>{let{typed:t}=e;return t("abs",{number:Li,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0)))})})),po="apply",mo=de(po,["typed","isInteger"],(e=>{let{typed:t,isInteger:r}=e;return t(po,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");const i=Array.isArray(e)?un(e):e.size();if(t<0||t>=i.length)throw new sn(t,i.length);return E(e)?e.create(ho(e.valueOf(),t,n),e.datatype()):ho(e,t,n)}})}));function ho(e,t,r){let n,i,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){const t=e.length,r=e[0].length;let n,i;const o=[];for(i=0;i{let{typed:t}=e;return t(go,{"number, number":$i,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"bigint, bigint":function(e,t){return e+t},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");const i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))})})),xo="subtractScalar",bo=de(xo,["typed"],(e=>{let{typed:t}=e;return t(xo,{"number, number":Hi,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"bigint, bigint":function(e,t){return e-t},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");const i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))})})),vo="cbrt",wo=de(vo,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{let{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:a,BigNumber:s,Fraction:u}=e;return r(vo,{number:Wi,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&x(e.value)){let t=e.clone();return t.value=1,t=t.pow(1/3),t.value=c(e.value),t}{const t=n(e.value);let r;t&&(e.value=i(e.value)),r=g(e.value)?new s(1).div(3):b(e.value)?new u(1,3):1/3;const o=e.pow(r);return t&&(o.value=i(o.value)),o}}});function c(e,r){const n=e.arg()/3,i=e.abs(),s=new a(Wi(i),0).mul(new a(0,n).exp());if(r){const e=[s,new a(Wi(i),0).mul(new a(0,n+2*Math.PI/3).exp()),new a(Wi(i),0).mul(new a(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?e:o(e)}return s}})),No=de("matAlgo11xS0s",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,d=r,h=0,g=i;"string"==typeof l&&(m=l,d=t.find(r,[m,m]),h=t.convert(0,m),n=t.convert(n,m),g=t.find(i,[m,m]));const y=[],x=[],b=[];for(let e=0;e{let{typed:t,DenseMatrix:r}=e;return function(e,n,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,d=i;"string"==typeof l&&(m=l,n=t.convert(n,m),d=t.find(i,[m,m]));const h=[],g=[],y=[];for(let e=0;e{let{typed:t}=e;return function(e,n,i,o){const a=e._data,s=e._size,u=e._datatype;let c,l=i;"string"==typeof u&&(c=u,n=t.convert(n,c),l=t.find(i,[c,c]));const f=s.length>0?r(l,0,s,s[0],a,n,o):[];return e.createDenseMatrix({data:f,size:ae(s),datatype:c})};function r(e,t,n,i,o,a,s){const u=[];if(t===n.length-1)for(let t=0;t{let{typed:t,config:r,round:n}=e;return t(So,{number:function(e){return _e(e,n(e),r.relTol,r.absTol)?n(e):Math.ceil(e)},"number, number":function(e,t){if(_e(e,n(e,t),r.relTol,r.absTol))return n(e,t);{let[r,n]=`${e}e`.split("e");const i=Math.ceil(Number(`${r}e${Number(n)+t}`));return[r,n]=`${i}e`.split("e"),Number(`${r}e${Number(n)-t}`)}}})})),To=de(So,Mo,(e=>{let{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=No({typed:t,equalScalar:o}),c=Eo({typed:t,DenseMatrix:s}),l=Ao({typed:t}),f=Co({typed:t,config:r,round:n});return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:function(e){return ri(e,n(e),r.relTol,r.absTol)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return ri(e,n(e,t),r.relTol,r.absTol)?n(e,t):e.toDecimalPlaces(t.toNumber(),Or.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>Zn(t,(t=>e(t,r)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>u(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>l(t,r,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>l(i(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>o(t,0)?a(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0)))})})),Do="cube",Fo=de(Do,["typed"],(e=>{let{typed:t}=e;return t(Do,{number:Yi,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})})),Oo=de("exp",["typed"],(e=>{let{typed:t}=e;return t("exp",{number:Ji,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),Bo="expm1",_o=de(Bo,["typed","Complex"],(e=>{let{typed:t,Complex:r}=e;return t(Bo,{number:Xi,Complex:function(e){const t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),zo="fix",Io=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],ko=de(zo,["typed","ceil","floor"],(e=>{let{typed:t,ceil:r,floor:n}=e;return t(zo,{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})})),qo=de(zo,Io,(e=>{let{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:a,zeros:s,DenseMatrix:u}=e;const c=Eo({typed:t,DenseMatrix:u}),l=Ao({typed:t}),f=ko({typed:t,ceil:i,floor:o});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r(e.re>0?o(e.re,t):i(e.re,t),e.im>0?o(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){const n=t.toNumber();return new r(e.re>0?o(e.re,n):i(e.re,n),e.im>0?o(e.im,n):i(e.im,n))},BigNumber:function(e){return e.isNegative()?i(e):o(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):o(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?i(e,t):o(e,t)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),"Array | Matrix, number | BigNumber":t.referToSelf((e=>(t,r)=>Zn(t,(t=>e(t,r)),!0))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>l(n(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>a(t,0)?s(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0)))})})),Ro="floor",Po=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],jo=de(Ro,["typed","config","round"],(e=>{let{typed:t,config:r,round:n}=e;return t(Ro,{number:function(e){return _e(e,n(e),r.relTol,r.absTol)?n(e):Math.floor(e)},"number, number":function(e,t){if(_e(e,n(e,t),r.relTol,r.absTol))return n(e,t);{let[r,n]=`${e}e`.split("e");const i=Math.floor(Number(`${r}e${Number(n)+t}`));return[r,n]=`${i}e`.split("e"),Number(`${r}e${Number(n)-t}`)}}})})),Uo=de(Ro,Po,(e=>{let{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=No({typed:t,equalScalar:o}),c=Eo({typed:t,DenseMatrix:s}),l=Ao({typed:t}),f=jo({typed:t,config:r,round:n});return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:function(e){return ri(e,n(e),r.relTol,r.absTol)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return ri(e,n(e,t),r.relTol,r.absTol)?n(e,t):e.toDecimalPlaces(t.toNumber(),Or.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>Zn(t,(t=>e(t,r)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>u(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>l(t,r,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>l(i(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>o(t,0)?a(r.size(),r.storage()):"dense"===r.storage()?l(r,t,e,!0):c(r,t,e,!0)))})})),Lo=de("matAlgo02xDS0",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i,o){const a=e._data,s=e._size,u=e._datatype||e.getDataType(),c=n._values,l=n._index,f=n._ptr,p=n._size,m=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==p.length)throw new an(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const d=s[0],h=s[1];let g,y=r,x=0,b=i;"string"==typeof u&&u===m&&"mixed"!==u&&(g=u,y=t.find(r,[g,g]),x=t.convert(0,g),b=t.find(i,[g,g]));const v=[],w=[],N=[];for(let e=0;e{let{typed:t}=e;return function(e,r,n,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=r._values,c=r._index,l=r._ptr,f=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==f.length)throw new an(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],d=a[1];let h,g=0,y=n;"string"==typeof s&&s===p&&"mixed"!==s&&(h=s,g=t.convert(0,h),y=t.find(n,[h,h]));const x=[];for(let e=0;e{let{typed:t,equalScalar:r}=e;return function(e,n,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==m.length)throw new an(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");const h=u[0],g=u[1];let y,x=r,b=0,v=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(r,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=o&&l?[]:void 0,N=[],E=[],A=w?[]:void 0,S=w?[]:void 0,M=[],C=[];let T,D,F,O;for(D=0;D{let{typed:t}=e;return function(e,n,i){const o=e._data,a=e._size,s=e._datatype,u=n._data,c=n._size,l=n._datatype,f=[];if(a.length!==c.length)throw new an(a.length,c.length);for(let e=0;e0?r(m,0,f,f[0],o,u):[];return e.createDenseMatrix({data:d,size:f,datatype:p})};function r(e,t,n,i,o,a){const s=[];if(t===n.length-1)for(let t=0;tfunction(e,t){return ce(e.size(),t)?e:e.create(In(e.valueOf(),t),e.datatype())}(e,r)))}const Vo=de("matrixAlgorithmSuite",["typed","matrix"],(e=>{let{typed:t,matrix:r}=e;const n=Go({typed:t}),i=Ao({typed:t});return function(e){const o=e.elop,a=e.SD||e.DS;let s;o?(s={"DenseMatrix, DenseMatrix":(e,t)=>n(...Zo(e,t),o),"Array, Array":(e,t)=>n(...Zo(r(e),r(t)),o).valueOf(),"Array, DenseMatrix":(e,t)=>n(...Zo(r(e),t),o),"DenseMatrix, Array":(e,t)=>n(...Zo(e,r(t)),o)},e.SS&&(s["SparseMatrix, SparseMatrix"]=(t,r)=>e.SS(...Zo(t,r),o,!1)),e.DS&&(s["DenseMatrix, SparseMatrix"]=(t,r)=>e.DS(...Zo(t,r),o,!1),s["Array, SparseMatrix"]=(t,n)=>e.DS(...Zo(r(t),n),o,!1)),a&&(s["SparseMatrix, DenseMatrix"]=(e,t)=>a(...Zo(t,e),o,!0),s["SparseMatrix, Array"]=(e,t)=>a(...Zo(r(t),e),o,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf((e=>(t,r)=>n(...Zo(t,r),e))),"Array, Array":t.referToSelf((e=>(t,i)=>n(...Zo(r(t),r(i)),e).valueOf())),"Array, DenseMatrix":t.referToSelf((e=>(t,i)=>n(...Zo(r(t),i),e))),"DenseMatrix, Array":t.referToSelf((e=>(t,i)=>n(...Zo(t,r(i)),e)))},e.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf((t=>(r,n)=>e.SS(...Zo(r,n),t,!1)))),e.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf((t=>(r,n)=>e.DS(...Zo(r,n),t,!1))),s["Array, SparseMatrix"]=t.referToSelf((t=>(n,i)=>e.DS(...Zo(r(n),i),t,!1)))),a&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf((e=>(t,r)=>a(...Zo(r,t),e,!0))),s["SparseMatrix, Array"]=t.referToSelf((e=>(t,n)=>a(...Zo(r(n),t),e,!0)))));const u=e.scalar||"any";(e.Ds||e.Ss)&&(o?(s["DenseMatrix,"+u]=(e,t)=>i(e,t,o,!1),s[u+", DenseMatrix"]=(e,t)=>i(t,e,o,!0),s["Array,"+u]=(e,t)=>i(r(e),t,o,!1).valueOf(),s[u+", Array"]=(e,t)=>i(r(t),e,o,!0).valueOf()):(s["DenseMatrix,"+u]=t.referToSelf((e=>(t,r)=>i(t,r,e,!1))),s[u+", DenseMatrix"]=t.referToSelf((e=>(t,r)=>i(r,t,e,!0))),s["Array,"+u]=t.referToSelf((e=>(t,n)=>i(r(t),n,e,!1).valueOf())),s[u+", Array"]=t.referToSelf((e=>(t,n)=>i(r(n),t,e,!0).valueOf()))));const c=void 0!==e.sS?e.sS:e.Ss;return o?(e.Ss&&(s["SparseMatrix,"+u]=(t,r)=>e.Ss(t,r,o,!1)),c&&(s[u+", SparseMatrix"]=(e,t)=>c(t,e,o,!0))):(e.Ss&&(s["SparseMatrix,"+u]=t.referToSelf((t=>(r,n)=>e.Ss(r,n,t,!1)))),c&&(s[u+", SparseMatrix"]=t.referToSelf((e=>(t,r)=>c(r,t,e,!0))))),o&&o.signatures&&se(s,o.signatures),s}})),Wo=de("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{let{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s,concat:u}=e;const c=Uo({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}),l=Lo({typed:t,equalScalar:o}),f=$o({typed:t}),p=Ho({typed:t,equalScalar:o}),m=No({typed:t,equalScalar:o}),d=Eo({typed:t,DenseMatrix:s});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*c(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(c(e.div(t))))},"bigint, bigint":function(e,t){if(0n===t)return e;if(e<0){const r=e%t;return 0n===r?r:r+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},Vo({typed:t,matrix:i,concat:u})({SS:p,DS:f,SD:l,Ss:m,sS:d}))})),Yo=de("matAlgo01xDSid",["typed"],(e=>{let{typed:t}=e;return function(e,r,n,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=r._values,c=r._index,l=r._ptr,f=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==f.length)throw new an(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],d=a[1],h="string"==typeof s&&"mixed"!==s&&s===p?s:void 0,g=h?t.find(n,[h,h]):n;let y,x;const b=[];for(y=0;y{let{typed:t,equalScalar:r}=e;return function(e,n,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==m.length)throw new an(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");const h=u[0],g=u[1];let y,x=r,b=0,v=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(r,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=o&&l?[]:void 0,N=[],E=[],A=o&&l?[]:void 0,S=o&&l?[]:void 0,M=[],C=[];let T,D,F,O,B;for(D=0;D{let{typed:t,DenseMatrix:r}=e;return function(e,n,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,d=i;"string"==typeof l&&(m=l,n=t.convert(n,m),d=t.find(i,[m,m]));const h=[],g=[],y=[];for(let e=0;eArray.isArray(e)))}const ra=de("gcd",["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:a,BigNumber:s,DenseMatrix:u,concat:c}=e;const l=Wo({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:a,DenseMatrix:u,concat:c}),f=Yo({typed:t}),p=Jo({typed:t,equalScalar:o}),m=Xo({typed:t,DenseMatrix:u});return t("gcd",{"number, number":function(e,t){if(!ye(e)||!ye(t))throw new Error("Parameters in function gcd must be integer numbers");let r;for(;0!==t;)r=l(e,t),e=t,t=r;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");const r=new s(0);for(;!t.isZero();){const r=l(e,t);e=t,t=r}return e.lt(r)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},Vo({typed:t,matrix:r,concat:c})({SS:p,DS:f,Ss:m}),{[ea]:t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;tt=>{if(1===t.length&&Array.isArray(t[0])&&ta(t[0]))return e(...t[0]);if(ta(t))return e(...t);throw new Qo("gcd() supports only 1d matrices!")})),Matrix:t.referToSelf((e=>t=>e(t.toArray())))})})),na=de("matAlgo06xS0S0",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i){const o=e._values,a=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=n._values,c=n._size,l=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(a.length!==c.length)throw new an(a.length,c.length);if(a[0]!==c[0]||a[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+c+")");const f=a[0],p=a[1];let m,d=r,h=0,g=i;"string"==typeof s&&s===l&&"mixed"!==s&&(m=s,d=t.find(r,[m,m]),h=t.convert(0,m),g=t.find(i,[m,m]));const y=o&&u?[]:void 0,x=[],b=[],v=y?[]:void 0,w=[],N=[];for(let t=0;t{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const o=Lo({typed:t,equalScalar:n}),a=na({typed:t,equalScalar:n}),s=No({typed:t,equalScalar:n}),u=Vo({typed:t,matrix:r,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",l={};return l[`${c}, ${c}, ...${c}`]=t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;te.lcm(t)},u({SS:a,DS:o,Ss:s}),l)})),oa="log10",aa=de(oa,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(oa,{number:function(e){return e>=0||r.predictable?Ki(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),sa="log2",ua=de(sa,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(sa,{number:function(e){return e>=0||r.predictable?eo(e):i(new n(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(new n(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))});function i(e){const t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),ca=de("multiplyScalar",["typed"],(e=>{let{typed:t}=e;return t("multiplyScalar",{"number, number":Gi,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"bigint, bigint":function(e,t){return e*t},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":(e,t)=>t.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,t)=>e.multiply(t)})})),la="multiply",fa=de(la,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(e=>{let{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:a}=e;const s=No({typed:t,equalScalar:o}),u=Ao({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}const l=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=r._data,c=r._datatype||r.getDataType(),l=a[0],f=a[1];let p,m=n,d=i;s&&c&&s===c&&"string"==typeof s&&"mixed"!==s&&(p=s,m=t.find(n,[p,p]),d=t.find(i,[p,p]));const h=[];for(let e=0;et){let e=0;for(let n=0;n(t,n)=>{c(un(t),un(n));const i=e(r(t),r(n));return E(i)?i.valueOf():i})),"Matrix, Matrix":function(e,r){const o=e.size(),s=r.size();return c(o,s),1===o.length?1===s.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return a(e,t)}(e,r,o[0]):function(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=r._data,c=r._size,l=r._datatype||r.getDataType(),f=a[0],p=c[1];let m,d=n,h=i;s&&l&&s===l&&"string"==typeof s&&"mixed"!==s&&(m=s,d=t.find(n,[m,m]),h=t.find(i,[m,m]));const g=[];for(let e=0;e(t,n)=>e(t,r(n)))),"Array, Matrix":t.referToSelf((e=>(t,n)=>e(r(t,n.storage()),n))),"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return u(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return u(t,e,i,!0)},"Array, any":function(e,t){return u(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t{let{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e;const a=Yo({typed:t}),s=Lo({typed:t,equalScalar:n}),u=na({typed:t,equalScalar:n}),c=No({typed:t,equalScalar:n}),l=Vo({typed:t,matrix:r,concat:o});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(pa,{number:to,"number, number":to,BigNumber:e=>p(e,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",(e=>t=>e(r(t),2).valueOf())),DenseMatrix:t.referTo("DenseMatrix,number",(e=>t=>e(t,2))),SparseMatrix:t.referTo("SparseMatrix,number",(e=>t=>e(t,2))),"SparseMatrix, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return u(t,r,e);throw new Error("Root must be non-zero")})),"DenseMatrix, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return a(t,r,e,!1);throw new Error("Root must be non-zero")})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(e=>(t,n)=>e(r(t),n))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return c(r,t,e,!0);throw new Error("Root must be non-zero")}))},l({scalar:"number | BigNumber",SD:s,Ss:c,sS:!1}));function p(e,t){const r=i.precision,n=i.clone({precision:r+2}),o=new i(0),a=new n(1),s=t.isNegative();if(s&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return s?new n(1/0):0;if(!e.isFinite())return s?o:e;let u=e.abs().pow(a.div(t));return u=e.isNeg()?u.neg():u,new i((s?a.div(u):u).toPrecision(r))}})),da="sign",ha=de(da,["typed","BigNumber","Fraction","complex"],(e=>{let{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(da,{number:ro,Complex:function(e){return 0===e.im?n(ro(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),Unit:t.referToSelf((e=>r=>{if(!r._isDerived()&&0!==r.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,r.valueType())(r.value)}))})})),ga=de("sqrt",["config","typed","Complex"],(e=>{let{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}})),ya="square",xa=de(ya,["typed"],(e=>{let{typed:t}=e;return t(ya,{number:no,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})})),ba="subtract",va=de(ba,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:a,concat:s}=e;const u=Yo({typed:t}),c=$o({typed:t}),l=Ho({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:a}),p=Eo({typed:t,DenseMatrix:a}),m=Vo({typed:t,matrix:r,concat:s});return t(ba,{"any, any":i},m({elop:i,SS:l,DS:u,SD:c,Ss:p,sS:f}))})),wa="xgcd",Na=de(wa,["typed","config","matrix","BigNumber"],(e=>{let{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(wa,{"number, number":function(e,t){const i=io(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){let o,a,s;const u=new i(0),c=new i(1);let l,f=u,p=c,m=c,d=u;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)a=e.div(t).floor(),s=e.mod(t),o=f,f=p.minus(a.times(f)),p=o,o=m,m=d.minus(a.times(m)),d=o,e=t,t=s;return l=e.lt(u)?[e.neg(),p.neg(),d.neg()]:[e,e.isZero()?0:p,d],"Array"===r.matrix?l:n(l)}})})),Ea="invmod",Aa=de(Ea,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],(e=>{let{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:a,mod:s,add:u,isInteger:c}=e;return t(Ea,{"number, number":l,"BigNumber, BigNumber":l});function l(e,t){if(!c(e)||!c(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=s(e,t),o(t,0))throw new Error("Divisor must be non zero");let r=i(e,t);r=r.valueOf();let[l,f]=r;return o(l,n(1))?(f=s(f,t),a(f,n(0))&&(f=u(f,t)),f):NaN}})),Sa=de("matAlgo09xS0Sf",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==m.length)throw new an(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");const h=u[0],g=u[1];let y,x=r,b=0,v=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(r,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=o&&l?[]:void 0,N=[],E=[],A=w?[]:void 0,S=[];let M,C,T,D,F;for(C=0;C{let{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e;const a=Lo({typed:t,equalScalar:n}),s=Sa({typed:t,equalScalar:n}),u=No({typed:t,equalScalar:n}),c=Vo({typed:t,matrix:r,concat:o});return t(Ma,c({elop:i,SS:s,DS:a,Ss:u}))}));function Ta(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return Oa(e,t,(function(e,t){return e&t}))}function Da(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");const t=e.constructor,r=t.precision;t.config({precision:1e9});const n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function Fa(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);const n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?Oa(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function Oa(e,t,r){const n=e.constructor;let i,o;const a=+(e.s<0),s=+(t.s<0);if(a){i=Ba(Da(e));for(let e=0;e0;)r(u[--f],c[--p])===m&&(d=d.plus(h)),h=h.times(g);for(;p>0;)r(l,c[--p])===m&&(d=d.plus(h)),h=h.times(g);return n.config({precision:y}),0===m&&(d.s=-d.s),d}function Ba(e){const t=e.d;let r=t[0]+"";for(let e=1;e0)if(++i>a)for(i-=a;i--;)o+="0";else i1&&(null!==s[e+1]&&void 0!==s[e+1]||(s[e+1]=0),s[e+1]+=s[e]>>1,s[e]&=1)}return s.reverse()}function _a(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);const n=new r(-1);return e.eq(n)?Da(t):t.eq(n)?Da(e):e.isFinite()&&t.isFinite()?Oa(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function za(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function Ia(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}const ka="number, number";function qa(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitAnd");return e&t}function Ra(e){if(!ye(e))throw new Error("Integer expected in function bitNot");return~e}function Pa(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitOr");return e|t}function ja(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitXor");return e^t}function Ua(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function leftShift");return e<>t}function $a(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}qa.signature=ka,Ra.signature="number",Pa.signature=ka,ja.signature=ka,Ua.signature=ka,La.signature=ka,$a.signature=ka;const Ha="bitAnd",Ga=de(Ha,["typed","matrix","equalScalar","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const o=Lo({typed:t,equalScalar:n}),a=na({typed:t,equalScalar:n}),s=No({typed:t,equalScalar:n}),u=Vo({typed:t,matrix:r,concat:i});return t(Ha,{"number, number":qa,"BigNumber, BigNumber":Ta,"bigint, bigint":(e,t)=>e&t},u({SS:a,DS:o,Ss:s}))})),Za="bitNot",Va=de(Za,["typed"],(e=>{let{typed:t}=e;return t(Za,{number:Ra,BigNumber:Da,bigint:e=>~e,"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Wa="bitOr",Ya=de(Wa,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e;const a=Yo({typed:t}),s=Jo({typed:t,equalScalar:n}),u=Xo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:r,concat:o});return t(Wa,{"number, number":Pa,"BigNumber, BigNumber":Fa,"bigint, bigint":(e,t)=>e|t},c({SS:s,DS:a,Ss:u}))})),Ja=de("matAlgo07xSSf",["typed","DenseMatrix"],(e=>{let{typed:t,DenseMatrix:r}=e;return function(e,i,o){const a=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=i._size,c=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(a.length!==u.length)throw new an(a.length,u.length);if(a[0]!==u[0]||a[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");const l=a[0],f=a[1];let p,m,d,h=0,g=o;"string"==typeof s&&s===c&&"mixed"!==s&&(p=s,h=t.convert(0,p),g=t.find(o,[p,p]));const y=[];for(m=0;m{let{typed:t,matrix:r,DenseMatrix:n,concat:i}=e;const o=$o({typed:t}),a=Ja({typed:t,DenseMatrix:n}),s=Eo({typed:t,DenseMatrix:n}),u=Vo({typed:t,matrix:r,concat:i});return t(Xa,{"number, number":ja,"BigNumber, BigNumber":_a,"bigint, bigint":(e,t)=>e^t},u({SS:a,DS:o,Ss:s}))})),Ka=de("arg",["typed"],(e=>{let{typed:t}=e;return t("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),es="conj",ts=de(es,["typed"],(e=>{let{typed:t}=e;return t(es,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),rs=de("im",["typed"],(e=>{let{typed:t}=e;return t("im",{number:()=>0,"BigNumber | Fraction":e=>e.mul(0),Complex:e=>e.im,"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),ns=de("re",["typed"],(e=>{let{typed:t}=e;return t("re",{"number | BigNumber | Fraction":e=>e,Complex:e=>e.re,"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),is="number, number";function os(e){return!e}function as(e,t){return!(!e&&!t)}function ss(e,t){return!!e!=!!t}function us(e,t){return!(!e||!t)}os.signature="number",as.signature=is,ss.signature=is,us.signature=is;const cs=de("not",["typed"],(e=>{let{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:os,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),ls=de("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ho({typed:t,equalScalar:n}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:r,concat:o});return t("or",{"number, number":as,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"bigint, bigint":as,"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0)))},c({SS:s,DS:a,Ss:u}))})),fs=de("xor",["typed","matrix","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,DenseMatrix:n,concat:i}=e;const o=$o({typed:t}),a=Ja({typed:t,DenseMatrix:n}),s=Eo({typed:t,DenseMatrix:n}),u=Vo({typed:t,matrix:r,concat:i});return t("xor",{"number, number":ss,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":ss,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0)))},u({SS:a,DS:o,Ss:s}))})),ps="concat",ms=de(ps,["typed","matrix","isInteger"],(e=>{let{typed:t,matrix:r,isInteger:n}=e;return t(ps,{"...Array | Matrix | number | BigNumber":function(e){let t;const i=e.length;let o,a=-1,s=!1;const u=[];for(t=0;t0&&a>o)throw new sn(a,o+1)}else{const e=ae(r).valueOf(),n=un(e);if(u[t]=e,o=a,a=n.length-1,t>0&&a!==o)throw new an(o+1,a+1)}}if(0===u.length)throw new SyntaxError("At least one matrix expected");let c=u.shift();for(;u.length;)c=Bn(c,u.shift(),a);return s?r(c):c},"...string":function(e){return e.join("")}})})),ds="column",hs=de(ds,["typed","Index","matrix","range"],(e=>{let{typed:t,Index:r,matrix:n,range:i}=e;return t(ds,{"Matrix, number":o,"Array, number":function(e,t){return o(n(ae(e)),t).valueOf()}});function o(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");pn(t,e.size()[1]);const o=i(0,e.size()[0]),a=new r(o,t),s=e.subset(a);return E(s)?s:n([[s]])}})),gs="count",ys=de(gs,["typed","size","prod"],(e=>{let{typed:t,size:r,prod:n}=e;return t(gs,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})})),xs="cross",bs=de(xs,["typed","matrix","subtract","multiply"],(e=>{let{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(xs,{"Matrix, Matrix":function(e,t){return r(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(o(e.toArray(),t))},"Array, Matrix":function(e,t){return r(o(e,t.toArray()))},"Array, Array":o});function o(e,t){const r=Math.max(un(e).length,un(t).length);e=bn(e),t=bn(t);const o=un(e),a=un(t);if(1!==o.length||1!==a.length||3!==o[0]||3!==a[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+a.join(", ")+"])");const s=[n(i(e[1],t[2]),i(e[2],t[1])),n(i(e[2],t[0]),i(e[0],t[2])),n(i(e[0],t[1]),i(e[1],t[0]))];return r>1?[s]:s}})),vs="diag",ws=de(vs,["typed","matrix","DenseMatrix","SparseMatrix"],(e=>{let{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(vs,{Array:function(e){return o(e,0,un(e),null)},"Array, number":function(e,t){return o(e,t,un(e),null)},"Array, BigNumber":function(e,t){return o(e,t.toNumber(),un(e),null)},"Array, string":function(e,t){return o(e,0,un(e),t)},"Array, number, string":function(e,t,r){return o(e,t,un(e),r)},"Array, BigNumber, string":function(e,t,r){return o(e,t.toNumber(),un(e),r)},Matrix:function(e){return o(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return o(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return o(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return o(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return o(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return o(e,t.toNumber(),e.size(),r)}});function o(e,t,o,a){if(!ye(t))throw new TypeError("Second parameter in function diag must be an integer");const s=t>0?t:0,u=t<0?-t:0;switch(o.length){case 1:return function(e,t,r,o,a,s){const u=[o+a,o+s];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError(`Unknown matrix type ${r}"`);const c="sparse"===r?i.diagonal(u,e,t):n.diagonal(u,e,t);return null!==r?c:c.valueOf()}(e,t,a,o[0],u,s);case 2:return function(e,t,n,i,o,a){if(E(e)){const i=e.diagonal(t);return null!==n?n!==i.storage()?r(i,n):i:i.valueOf()}const s=Math.min(i[0]-o,i[1]-a),u=[];for(let t=0;t{let{typed:t}=e;return t("filter",{"Array, function":Es,"Matrix, function":function(e,t){return e.create(Es(e.valueOf(),t),e.datatype())},"Array, RegExp":Mn,"Matrix, RegExp":function(e,t){return e.create(Mn(e.valueOf(),t),e.datatype())}})}));function Es(e,t){const r=Rn(t,e,"filter");return function(e){if(1!==un(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(function(e,t,n){return r(e,[t],n)}))}(e)}const As="flatten",Ss=de(As,["typed"],(e=>{let{typed:t}=e;return t(As,{Array:function(e){return En(e)},Matrix:function(e){return e.create(En(e.toArray()),e.datatype())}})})),Ms="forEach",Cs=de(Ms,["typed"],(e=>{let{typed:t}=e;return t(Ms,{"Array, function":Ts,"Matrix, function":function(e,t){e.forEach(t)}})}));function Ts(e,t){qn(e,[],e,Rn(t,e,Ms))}const Ds="getMatrixDataType",Fs=de(Ds,["typed"],(e=>{let{typed:t}=e;return t(Ds,{Array:function(e){return Fn(e,oe)},Matrix:function(e){return e.getDataType()}})})),Os="identity",Bs=de(Os,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(e=>{let{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:a}=e;return t(Os,{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return u(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return u(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return u(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return u(e,t,r)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return u(e[0],e[0],t);case 2:return u(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function u(e,t,r){const n=g(e)||g(t)?i:null;if(g(e)&&(e=e.toNumber()),g(t)&&(t=t.toNumber()),!ye(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!ye(t)||t<1)throw new Error("Parameters in function identity must be positive integers");const s=n?new i(1):1,u=n?new n(0):0,c=[e,t];if(r){if("sparse"===r)return a.diagonal(c,s,0,u);if("dense"===r)return o.diagonal(c,s,0,u);throw new TypeError(`Unknown matrix type "${r}"`)}const l=dn([],c,u),f=e{let{typed:t,matrix:r,multiplyScalar:n}=e;return t(_s,{"Matrix, Matrix":function(e,t){return r(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(i(e.toArray(),t))},"Array, Matrix":function(e,t){return r(i(e,t.toArray()))},"Array, Array":i});function i(e,t){if(1===un(e).length&&(e=[e]),1===un(t).length&&(t=[t]),un(e).length>2||un(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");const r=[];let i=[];return e.map((function(e){return t.map((function(t){return i=[],r.push(i),e.map((function(e){return t.map((function(t){return i.push(n(e,t))}))}))}))}))&&r}})),Is="map",ks=de(Is,["typed"],(e=>{let{typed:t}=e;return t(Is,{"Array, function":r,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,n,i)=>function(e,n){if("function"!=typeof n)throw new Error("Last argument must be a callback function");const i=e[0].isMatrix,o=_n(...e.map((e=>e.isMatrix?e.size():un(e)))),a=i?(e,t)=>e.get(t):kn,s=i?e.map((t=>t.isMatrix?t.create(In(t.toArray(),o),t.datatype()):e[0].create(In(t.valueOf(),o)))):e.map((e=>e.isMatrix?In(e.toArray(),o):In(e,o)));let u;if(t.isTypedFunction(n)){const e=o.map((()=>0)),r=s.map((t=>a(t,e))),i=function(e,r,n,i){return null!==t.resolve(e,[...r,n,...i])?2:null!==t.resolve(e,[...r,n])?1:(t.resolve(e,r),0)}(n,r,e,s);u=l(i)}else{const t=e.length,r=function(e,t){return e.length>t+1?2:e.length===t+1?1:0}(n,t);u=l(r)}const c=(e,t)=>u([e,...s.slice(1).map((e=>a(e,t)))],t);return i?s[0].map(c):r(s[0],c);function l(e){switch(e){case 0:return e=>n(...e);case 1:return(e,t)=>n(...e,t);case 2:return(e,t)=>n(...e,t,...s)}}}([e,n,...i.slice(0,i.length-1)],i[i.length-1])});function r(e,t){return qn(e,[],e,Rn(t,e,Is))}})),qs="diff",Rs=de(qs,["typed","matrix","subtract","number"],(e=>{let{typed:t,matrix:r,subtract:n,number:i}=e;return t(qs,{"Array | Matrix":function(e){return E(e)?r(a(e.toArray())):a(e)},"Array | Matrix, number":function(e,t){if(!ye(t))throw new RangeError("Dimension must be a whole number");return E(e)?r(o(e.toArray(),t)):o(e,t)},"Array, BigNumber":t.referTo("Array,number",(e=>(t,r)=>e(t,i(r)))),"Matrix, BigNumber":t.referTo("Matrix,number",(e=>(t,r)=>e(t,i(r))))});function o(e,t){if(E(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){const r=[];return e.forEach((e=>{r.push(o(e,t-1))})),r}if(0===t)return a(e);throw RangeError("Cannot have negative dimension")}function a(e){const t=[],r=e.length;for(let n=1;n{let{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){const t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){const t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){const r=function(e){let t=!1;return e.forEach((function(e,r,n){g(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!ye(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){const r=n(t);return e.length>0?r.resize(e,o):r}{const t=[];return e.length>0?dn(t,e,o):t}}}));function js(){throw new Error('No "bignumber" implementation available')}function Us(){throw new Error('No "fraction" implementation available')}function Ls(){throw new Error('No "matrix" implementation available')}const $s="range",Hs=de($s,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(e=>{let{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:a,larger:s,largerEq:u,add:c,isPositive:l}=e;return t($s,{string:p,"string, boolean":p,"number, number":function(e,t){return f(m(e,t,1,!1))},"number, number, number":function(e,t,r){return f(m(e,t,r,!1))},"number, number, boolean":function(e,t,r){return f(m(e,t,1,r))},"number, number, number, boolean":function(e,t,r,n){return f(m(e,t,r,n))},"BigNumber, BigNumber":function(e,t){return f(m(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return f(m(e,t,r,!1))},"BigNumber, BigNumber, boolean":function(e,t,r){return f(m(e,t,new(0,e.constructor)(1),r))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return f(m(e,t,r,n))},"Unit, Unit, Unit":function(e,t,r){return f(m(e,t,r,!1))},"Unit, Unit, Unit, boolean":function(e,t,r,n){return f(m(e,t,r,n))}});function f(e){return"Matrix"===r.matrix?n?n(e):Ls():e}function p(e,t){const n=function(e){const t=e.split(":").map((function(e){return Number(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===i&&js(),f(m(i(n.start),i(n.end),i(n.step)))):f(m(n.start,n.end,n.step,t))}function m(e,t,r,n){const i=[],f=l(r)?n?a:o:n?u:s;let p=e;for(;f(p,t);)i.push(p),p=c(p,r);return i}})),Gs="reshape",Zs=de(Gs,["typed","isInteger","matrix"],(e=>{let{typed:t,isInteger:r}=e;return t(Gs,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)})),gn(e,t)}})})),Vs=de("resize",["config","matrix"],(e=>{let{config:t,matrix:r}=e;return function(e,n,i){if(2!==arguments.length&&3!==arguments.length)throw new Qo("resize",arguments.length,2,3);if(E(n)&&(n=n.valueOf()),g(n[0])&&(n=n.map((function(e){return g(e)?e.toNumber():e}))),E(e))return e.resize(n,i,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new an(t.length,1);const n=t[0];if("number"!=typeof n||!ye(n))throw new TypeError("Invalid size, must contain positive integers (size: "+Kr(t)+")");if(e.length>n)return e.substring(0,n);if(e.length{let{typed:t,multiply:r,rotationMatrix:n}=e;return t(Ws,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,o){return i(e,3),r(n(t,o),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,o){return i(e,3),r(n(t,o),e)}});function i(e,t){const r=Array.isArray(e)?un(e):e.size();if(r.length>2)throw new RangeError(`Vector must be of dimensions 1x${t}`);if(2===r.length&&1!==r[1])throw new RangeError(`Vector must be of dimensions 1x${t}`);if(r[0]!==t)throw new RangeError(`Vector must be of dimensions 1x${t}`)}})),Js="rotationMatrix",Xs=de(Js,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(e=>{let{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:o,norm:a,BigNumber:s,matrix:u,DenseMatrix:c,SparseMatrix:l,cos:f,sin:p}=e;return t(Js,{"":function(){return"Matrix"===r.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return m(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return m(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){const r=u(t);return d(r),x(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){d(t);const n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return x(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){const n=u(t);return d(n),x(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return d(t),x(e,t,r)}});function m(e,t){const r=g(e)?new s(-1):-1,i=f(e),o=p(e);return y([[i,n(r,o)],[o,i]],t)}function d(e){const t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function h(e){return e.reduce(((e,t)=>n(e,t)))}function y(e,t){if(t){if("sparse"===t)return new l(e);if("dense"===t)return new c(e);throw new TypeError(`Unknown matrix type "${t}"`)}return e}function x(e,t,r){const n=a(t);if(0===n)throw new RangeError("Rotation around zero vector");const u=g(e)?s:null,c=u?new u(1):1,l=u?new u(-1):-1,m=u?new u(t.get([0])/n):t.get([0])/n,d=u?new u(t.get([1])/n):t.get([1])/n,x=u?new u(t.get([2])/n):t.get([2])/n,b=f(e),v=i(c,o(b)),w=p(e);return y([[i(b,h([m,m,v])),i(h([m,d,v]),h([l,x,w])),i(h([m,x,v]),h([d,w]))],[i(h([m,d,v]),h([x,w])),i(b,h([d,d,v])),i(h([d,x,v]),h([l,m,w]))],[i(h([m,x,v]),h([l,d,w])),i(h([d,x,v]),h([m,w])),i(b,h([x,x,v]))]],r)}})),Qs=de("row",["typed","Index","matrix","range"],(e=>{let{typed:t,Index:r,matrix:n,range:i}=e;return t("row",{"Matrix, number":o,"Array, number":function(e,t){return o(n(ae(e)),t).valueOf()}});function o(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");pn(t,e.size()[0]);const o=i(0,e.size()[1]),a=new r(t,o),s=e.subset(a);return E(s)?s:n([[s]])}})),Ks="size",eu=de(Ks,["typed","config","?matrix"],(e=>{let{typed:t,config:r,matrix:n}=e;return t(Ks,{Matrix:function(e){return e.create(e.size(),"number")},Array:un,string:function(e){return"Array"===r.matrix?[e.length]:n([e.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:n?n([],"dense","number"):Ls()}})})),tu="squeeze",ru=de(tu,["typed"],(e=>{let{typed:t}=e;return t(tu,{Array:function(e){return bn(ae(e))},Matrix:function(e){const t=bn(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return ae(e)}})})),nu="subset",iu=de(nu,["typed","matrix","zeros","add"],(e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;return t(nu,{"Matrix, Index":function(e,t){return mn(t)?r():(fn(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,n){const i=e(r(t),n);return n.isScalar()?i:i.valueOf()}})),"Object, Index":su,"string, Index":ou,"Matrix, Index, any, any":function(e,t,r,o){return mn(t)?e:(fn(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;const r=t.size();if(!r.every((e=>e>0)))return e;try{return i(e,n(r))}catch(t){return e}}(r,t),o))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i,o){const a=e(r(t),n,i,o);return a.isMatrix?a.valueOf():a}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,n){return e(t,r,n,void 0)}})),"string, Index, string":au,"string, Index, string, string":au,"Object, Index, any":uu})}));function ou(e,t){if(!T(t))throw new TypeError("Index expected");if(mn(t))return"";if(fn(Array.from(e),t),1!==t.size().length)throw new an(t.size().length,1);const r=e.length;pn(t.min()[0],r),pn(t.max()[0],r);const n=t.dimension(0);let i="";return n.forEach((function(t){i+=e.charAt(t)})),i}function au(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(mn(t))return e;if(fn(Array.from(e),t),1!==t.size().length)throw new an(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";const i=t.dimension(0);if(i.size()[0]!==r.length)throw new an(i.size()[0],r.length);const o=e.length;pn(t.min()[0]),pn(t.max()[0]);const a=[];for(let t=0;to)for(let e=o-1,t=a.length;e{let{typed:t,matrix:r}=e;return t(cu,{Array:e=>n(r(e)).valueOf(),Matrix:n,any:ae});function n(e){const t=e.size();let r;switch(t.length){case 1:r=e.clone();break;case 2:{const n=t[0],i=t[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Kr(t)+")");switch(e.storage()){case"dense":r=function(e,t,r){const n=e._data,i=[];let o;for(let e=0;e{let{typed:t,transpose:r,conj:n}=e;return t(fu,{any:function(e){return n(r(e))}})})),mu="zeros",du=de(mu,["typed","config","matrix","BigNumber"],(e=>{let{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(mu,{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){const t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){const t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){const r=function(e){let t=!1;return e.forEach((function(e,r,n){g(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!ye(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){const r=n(t);return e.length>0?r.resize(e,o):r}{const t=[];return e.length>0?dn(t,e,o):t}}})),hu=de("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],(e=>{let{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:o,exp:a,tau:s,i:u,dotDivide:c,conj:l,pow:f,ceil:p,log2:m}=e;return t("fft",{Array:d,Matrix:function(e){return e.create(d(e.valueOf()),e.datatype())}});function d(e){const t=un(e);return 1===t.length?g(e,t[0]):h(e.map((e=>d(e,t.slice(1)))),0)}function h(e,t){const r=un(e);if(0!==t)return new Array(r[0]).fill(0).map(((r,n)=>h(e[n],t-1)));if(1===r.length)return g(e);function n(e){const t=un(e);return new Array(t[1]).fill(0).map(((r,n)=>new Array(t[0]).fill(0).map(((t,r)=>e[r][n]))))}return n(h(n(e),1))}function g(e){const t=e.length;if(1===t)return[e[0]];if(t%2==0){const r=[...g(e.filter(((e,t)=>t%2==0))),...g(e.filter(((e,t)=>t%2==1)))];for(let e=0;ei(e[o],n[t-1+o]))),...new Array(h-t).fill(0)],x=[...new Array(t+t-1).fill(0).map(((e,t)=>o(1,n[t]))),...new Array(h-(t+t-1)).fill(0)],b=g(y),v=g(x),w=new Array(h).fill(0).map(((e,t)=>i(b[t],v[t]))),N=c(l(d(l(w))),h),E=[];for(let e=t-1;e{let{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(gu,{"Array | Matrix":function(e){const t=E(e)?e.size():un(e);return n(i(r(i(e))),t.reduce(((e,t)=>e*t),1))}})})),xu=de("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],(e=>{let{typed:t,add:r,subtract:n,multiply:i,divide:o,max:a,map:s,abs:u,isPositive:c,isNegative:l,larger:f,smaller:p,matrix:m,bignumber:d,unaryMinus:y}=e;function x(e){return function(t,m,h,x){if(2!==m.length||!m.every(E)&&!m.every(v))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');const b=m[0],w=m[1],N=f(w,b),A=x.firstStep;if(void 0!==A&&!c(A))throw new Error('"firstStep" must be positive');const S=x.maxStep;if(void 0!==S&&!c(S))throw new Error('"maxStep" must be positive');const M=x.minStep;if(M&&l(M))throw new Error('"minStep" must be positive or zero');const C=[b,w,A,M,S].filter((e=>void 0!==e));if(!C.every(E)&&!C.every(v))throw new Error('Inconsistent type of "t" dependant variables');const T=x.tol?x.tol:1e-4,D=x.minDelta?x.minDelta:.2,F=x.maxDelta?x.maxDelta:5,O=x.maxIter?x.maxIter:1e4,B=[b,w,...h,S,M].some(g),[_,z,I,k]=B?[d(e.a),d(e.c),d(e.b),d(e.bp)]:[e.a,e.c,e.b,e.bp];let q=A?N?A:y(A):o(n(w,b),1);const R=[b],P=[h],j=n(I,k);let U=0,L=0;const $=function(e){return e?p:f}(N),H=function(e){const t=e?f:p;return function(e,i,o){const a=r(e,o);return t(a,i)?n(i,e):o}}(N);for(;$(R[U],w);){const e=[];q=H(R[U],w,q),e.push(t(R[U],P[U]));for(let n=1;nv(e)?e.value:e))));n1/4&&(R.push(r(R[U],q)),P.push(r(P[U],i(q,I,e))),U++);let o=.84*(T/n)**.2;if(p(o,D)?o=D:f(o,F)&&(o=F),o=B?d(o):o,q=i(q,o),S&&f(u(q),S)?q=N?S:y(S):M&&p(u(q),M)&&(q=N?M:y(M)),L++,L>O)throw new Error("Maximum number of iterations reached, try changing options")}return{t:R,y:P}}}function b(e,t,r,n){return x({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,r,n)}function w(e,t,r,n){return x({a:[[],[.2],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,t,r,n)}function N(e,t,r,n){const i=n.method?n.method:"RK45",o={RK23:b,RK45:w};if(i.toUpperCase()in o){const a={...n};return delete a.method,o[i.toUpperCase()](e,t,r,a)}{const e=Object.keys(o).map((e=>`"${e}"`)),t=`${e.slice(0,-1).join(", ")} and ${e.slice(-1)}`;throw new Error(`Unavailable method "${i}". Available methods are ${t}`)}}function E(e){return g(e)||h(e)}function A(e,t,r,n){const i=N(e,t.toArray(),r.toArray(),n);return{t:m(i.t),y:m(i.y)}}return t("solveODE",{"function, Array, Array, Object":N,"function, Matrix, Matrix, Object":A,"function, Array, Array":(e,t,r)=>N(e,t,r,{}),"function, Matrix, Matrix":(e,t,r)=>A(e,t,r,{}),"function, Array, number | BigNumber | Unit":(e,t,r)=>{const n=N(e,t,[r],{});return{t:n.t,y:n.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit":(e,t,r)=>{const n=N(e,t.toArray(),[r],{});return{t:m(n.t),y:m(n.y.map((e=>e[0])))}},"function, Array, number | BigNumber | Unit, Object":(e,t,r,n)=>{const i=N(e,t,[r],n);return{t:i.t,y:i.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,r,n)=>{const i=N(e,t.toArray(),[r],n);return{t:m(i.t),y:m(i.y.map((e=>e[0])))}}})})),bu=de("erf",["typed"],(e=>{let{typed:t}=e;return t("name",{number:function(e){const t=Math.abs(e);return t>=Au?be(e):t<=vu?be(e)*function(e){const t=e*e;let r,n=Nu[0][4]*t,i=t;for(r=0;r<3;r+=1)n=(n+Nu[0][r])*t,i=(i+Eu[0][r])*t;return e*(n+Nu[0][3])/(i+Eu[0][3])}(t):t<=4?be(e)*(1-function(e){let t,r=Nu[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+Nu[1][t])*e,n=(n+Eu[1][t])*e;const i=(r+Nu[1][7])/(n+Eu[1][7]),o=parseInt(16*e)/16,a=(e-o)*(e+o);return Math.exp(-o*o)*Math.exp(-a)*i}(t)):be(e)*(1-function(e){let t,r=1/(e*e),n=Nu[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+Nu[2][t])*r,i=(i+Eu[2][t])*r;let o=r*(n+Nu[2][4])/(i+Eu[2][4]);o=(wu-o)/e,r=parseInt(16*e)/16;const a=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-a)*o}(t))},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),vu=.46875,wu=.5641895835477563,Nu=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Eu=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Au=Math.pow(2,53),Su="zeta",Mu=de(Su,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],(e=>{let{typed:t,config:r,multiply:n,pow:i,divide:o,factorial:a,equal:s,smallerEq:u,isNegative:c,gamma:l,sin:f,subtract:p,add:m,Complex:d,BigNumber:h,pi:g}=e;return t(Su,{number:e=>y(e,(e=>e),(()=>20)),BigNumber:e=>y(e,(e=>new h(e)),(()=>Math.abs(Math.log10(r.relTol)))),Complex:function(e){return 0===e.re&&0===e.im?new d(-.5):1===e.re?new d(NaN,NaN):e.re===1/0&&0===e.im?new d(1):e.im===1/0||e.re===-1/0?new d(NaN,NaN):x(e,(e=>e),(e=>Math.round(19.5+.9*Math.abs(e.im))),(e=>e.re))}});function y(e,t,r){return s(e,0)?t(-.5):s(e,1)?t(NaN):isFinite(e)?x(e,t,r,(e=>e)):c(e)?t(NaN):t(1)}function x(e,t,r,a){const s=r(e);if(a(e)>-(s-1)/2)return function(e,t,r){const a=o(1,n(b(r(0),t),p(1,i(2,p(1,e)))));let s=r(0);for(let a=r(1);u(a,t);a=m(a,1))s=m(s,o(n((-1)**(a-1),b(a,t)),i(a,e)));return n(a,s)}(e,t(s),t);{let s=n(i(2,e),i(t(g),p(e,1)));return s=n(s,f(n(o(t(g),2),e))),s=n(s,l(p(1,e))),n(s,x(p(1,e),t,r,a))}}function b(e,t){let r=e;for(let s=e;u(s,t);s=m(s,1)){const e=o(n(a(m(t,p(s,1))),i(4,s)),n(a(p(t,s)),a(n(2,s))));r=m(r,e)}return n(t,r)}})),Cu="mode",Tu=de(Cu,["typed","isNaN","isNumeric"],(e=>{let{typed:t,isNaN:r,isNumeric:n}=e;return t(Cu,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=En(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");const t={};let i=[],o=0;for(let a=0;ao&&(o=t[s],i=[s])}return i}}));function Du(e,t,r){let n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+oe(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+oe(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}const Fu="prod",Ou=de(Fu,["typed","config","multiplyScalar","numeric"],(e=>{let{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(Fu,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return o(e)}});function o(e){let t;if(Gn(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw Du(t,"prod",e)}})),"string"==typeof t&&(t=i(t,xe(t,r))),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),Bu="format",_u=de(Bu,["typed"],(e=>{let{typed:t}=e;return t(Bu,{any:Kr,"any, Object | function | number | BigNumber":Kr})})),zu=de("bin",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"bin",wordSize:t})}})})),Iu=de("oct",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"oct",wordSize:t})}})})),ku=de("hex",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"hex",wordSize:t})}})})),qu=/\$([\w.]+)/g,Ru="print",Pu=de(Ru,["typed"],(e=>{let{typed:t}=e;return t(Ru,{"string, Object | Array":ju,"string, Object | Array, number | Object":ju})}));function ju(e,t,r){return e.replace(qu,(function(e,n){const i=n.split(".");let o=t[i.shift()];for(void 0!==o&&o.isMatrix&&(o=o.toArray());i.length&&void 0!==o;){const e=i.shift();o=e?o[e]:o+"."}return void 0!==o?w(o)?o:Kr(o,r):e}))}const Uu=de("to",["typed","matrix","concat"],(e=>{let{typed:t,matrix:r,concat:n}=e;return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},Vo({typed:t,matrix:r,concat:n})({Ds:!0}))})),Lu="isPrime",$u=de(Lu,["typed"],(e=>{let{typed:t}=e;return t(Lu,{number:function(e){if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(let t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},bigint:function(e){if(e<=3n)return e>1n;if(e%2n===0n||e%3n===0n)return!1;for(let t=5n;t*t<=e;t+=6n)if(e%t===0n||e%(t+2n)===0n)return!1;return!0},BigNumber:function(e){if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){const t=e.toNumber();for(let e=5;e*e<=t;e+=6)if(t%e==0||t%(e+2)==0)return!1;return!0}function t(e,t,r){let n=1;for(;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}const r=e.constructor.clone({precision:2*e.toFixed(0).length});let n=0,i=(e=new r(e)).sub(1);for(;i.mod(2).eq(0);)i=i.div(2),n+=1;let o=null;if(e.lt("3317044064679887385961981"))o=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((t=>tt=>Zn(t,e)))})})),Hu=de("numeric",["number","?bignumber","?fraction"],(e=>{let{number:t,bignumber:r,fraction:n}=e;const i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:e=>t(e),BigNumber:r?e=>r(e):js,bigint:e=>BigInt(e),Fraction:n?e=>n(e):Us};return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");const r=oe(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in o))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(o).join(", "));return t===r?e:o[t](e)}})),Gu="divideScalar",Zu=de(Gu,["typed","numeric"],(e=>{let{typed:t,numeric:r}=e;return t(Gu,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"bigint, bigint":function(e,t){return e/t},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,t)=>e.divide(t),"number | Fraction | Complex | BigNumber, Unit":(e,t)=>t.divideInto(e)})})),Vu=de("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(e=>{let{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:a,number:s,fraction:u,Complex:c}=e;return t("pow",{"number, number":l,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new c(e.toNumber(),0).pow(t.toNumber(),0)},"bigint, bigint":(e,t)=>e**t,"Fraction, Fraction":function(e,t){const n=e.pow(t);if(null!=n)return n;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return l(e.valueOf(),t.valueOf())},"Array, number":f,"Array, BigNumber":function(e,t){return f(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function l(e,t){if(r.predictable&&!ye(t)&&e<0)try{const r=u(t),n=s(r);if((t===n||Math.abs((t-n)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:ye(t)||e>=0||r.predictable?oo(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function f(e,t){if(!ye(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");const r=un(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return f(a(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}let o=n(r[0]).valueOf(),s=e;for(;t>=1;)1&~t||(o=i(s,o)),t>>=1,s=i(s,s);return o}function p(e,t){return o(f(e.valueOf(),t))}})),Wu="Number of decimals in function round must be an integer",Yu="round",Ju=de(Yu,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(e=>{let{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:a,DenseMatrix:s}=e;const u=No({typed:t,equalScalar:i}),c=Eo({typed:t,DenseMatrix:s}),l=Ao({typed:t});function f(e){return Math.abs(Te(e).exponent)}return t(Yu,{number:function(e){const t=ao(e,f(r.relTol));return ao(_e(e,t,r.relTol,r.absTol)?t:e)},"number, number":function(e,t){const n=f(r.relTol);if(t>=n)return ao(e,t);const i=ao(e,n);return ao(_e(e,i,r.relTol,r.absTol)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Wu);return new a(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Wu);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Wu);const r=t.toNumber();return e.round(r)},BigNumber:function(e){const t=new a(e).toDecimalPlaces(f(r.relTol));return(ri(e,t,r.relTol,r.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Wu);const n=f(r.relTol);if(t>=n)return e.toDecimalPlaces(t.toNumber());const i=e.toDecimalPlaces(n);return(ri(e,i,r.relTol,r.absTol)?i:e).toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Wu);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Wu);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,r,n){const i=t.toNumeric(n);return n.multiply(e(i,r))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,r,n)=>e(t,r.toNumber(),n))),"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t,0,r))),"Array | Matrix, number, Unit":t.referToSelf((e=>(t,r,n)=>Zn(t,(t=>e(t,r,n)),!0))),"Array | Matrix, BigNumber, Unit":t.referToSelf((e=>(t,r,n)=>e(t,r.toNumber(),n))),"Array | Matrix, Unit":t.referToSelf((e=>(t,r)=>e(t,0,r))),"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e,!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>u(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>l(t,r,e,!1))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>l(n(t),r,e,!1).valueOf())),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((e=>(t,r)=>i(t,0)?o(r.size(),r.storage()):c(r,t,e,!0))),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((e=>(t,r)=>i(t,0)?o(r.size(),r.storage()):l(r,t,e,!0))),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((e=>(t,r)=>l(n(r),t,e,!0).valueOf()))})})),Xu=de("log",["config","typed","divideScalar","Complex"],(e=>{let{typed:t,config:r,divideScalar:n,Complex:i}=e;return t("log",{number:function(e){return e>=0||r.predictable?function(e){return Math.log(e)}(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new i(e.toNumber(),0).log()},"any, any":t.referToSelf((e=>(t,r)=>n(e(t),e(r))))})})),Qu="log1p",Ku=de(Qu,["typed","config","divideScalar","log","Complex"],(e=>{let{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(Qu,{number:function(e){return e>=-1||r.predictable?Ne(e):a(new o(e,0))},Complex:a,BigNumber:function(e){const t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():a(new o(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e))),"any, any":t.referToSelf((e=>(t,r)=>n(e(t),i(r))))});function a(e){const t=e.re+1;return new o(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}})),ec="nthRoots",tc=de(ec,["config","typed","divideScalar","Complex"],(e=>{let{typed:t,config:r,divideScalar:n,Complex:i}=e;const o=[function(e){return new i(e,0)},function(e){return new i(0,e)},function(e){return new i(-e,0)},function(e){return new i(0,-e)}];function a(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new i(0,0)];const r="number"==typeof e;let n;(r||0===e.re||0===e.im)&&(n=r?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);const a=e.arg(),s=e.abs(),u=[],c=Math.pow(s,1/t);for(let e=0;e{let{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:a}=e;const s=$o({typed:t}),u=Ja({typed:t,DenseMatrix:o}),c=No({typed:t,equalScalar:r}),l=Eo({typed:t,DenseMatrix:o}),f=Vo({typed:t,matrix:n,concat:a}),p={};for(const e in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,e)&&(e.includes("Matrix")||e.includes("Array")||(p[e]=i.signatures[e]));const m=t(p);return t(rc,f({elop:m,SS:u,DS:s,Ss:c,sS:l}))})),ic="dotDivide",oc=de(ic,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:a}=e;const s=Lo({typed:t,equalScalar:n}),u=$o({typed:t}),c=Ja({typed:t,DenseMatrix:o}),l=No({typed:t,equalScalar:n}),f=Eo({typed:t,DenseMatrix:o}),p=Vo({typed:t,matrix:r,concat:a});return t(ic,p({elop:i,SS:c,DS:u,SD:s,Ss:l,sS:f}))}));function ac(e){let{DenseMatrix:t}=e;return function(e,r,n){const i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+Kr(i)+")");const o=i[0];if(o!==i[1])throw new RangeError("Matrix must be square (size: "+Kr(i)+")");let a=[];if(E(r)){const e=r.size(),i=r._data;if(1===e.length){if(e[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(let e=0;e{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=ac({DenseMatrix:s});return t(sc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],f=e._values,p=e._index,m=e._ptr,d=[];for(let e=0;ee&&(u.push(f[t]),c.push(r))}if(a(s,0))throw new Error("Linear system cannot be solved since matrix is singular");const g=n(t,s);for(let e=0,t=c.length;e{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=ac({DenseMatrix:s});return t(cc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],f=e._values,p=e._index,m=e._ptr,d=[];for(let e=l-1;e>=0;e--){const t=r[e][0]||0;if(a(t,0))d[e]=[0];else{let s=0;const u=[],c=[],l=m[e];for(let t=m[e+1]-1;t>=l;t--){const r=p[t];r===e?s=f[t]:r=0;e--){const t=r[e][0]||0;let s;if(a(t,0))s=0;else{const u=p[e][e];if(a(u,0))throw new Error("Linear system cannot be solved since matrix is singular");s=n(t,u);for(let t=e-1;t>=0;t--)r[t]=[o(r[t][0]||0,i(s,p[t][e]))]}f[e]=[s]}return new s({data:f,size:[c,1]})}})),fc="lsolveAll",pc=de(fc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=ac({DenseMatrix:s});return t(fc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],f=e._values,p=e._index,m=e._ptr;for(let e=0;ee&&(c.push(f[t]),l.push(r))}if(a(g,0))if(a(u[e],0)){if(0===s){const t=[...u];t[e]=1;for(let e=0,r=l.length;enew s({data:e.map((e=>[e])),size:[c,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((e=>e.valueOf()))}});function c(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0],f=e._size[1];for(let e=0;enew s({data:e.map((e=>[e])),size:[l,1]})))}})),mc="usolveAll",dc=de(mc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=ac({DenseMatrix:s});return t(mc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],f=e._values,p=e._index,m=e._ptr;for(let e=l-1;e>=0;e--){let t=r.length;for(let s=0;s=d;t--){const r=p[t];r===e?h=f[t]:rnew s({data:e.map((e=>[e])),size:[c,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((e=>e.valueOf()))}});function c(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0];for(let t=e._size[1]-1;t>=0;t--){let e=r.length;for(let s=0;s=0;r--)e[r]=o(e[r],c[r][t]);r.push(e)}}else{if(0===s)return[];r.splice(s,1),s-=1,e-=1}else{u[t]=n(u[t],c[t][t]);for(let e=t-1;e>=0;e--)u[e]=o(u[e],i(u[t],c[e][t]))}}}return r.map((e=>new s({data:e.map((e=>[e])),size:[l,1]})))}})),hc=de("matAlgo08xS0Sid",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==m.length)throw new an(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");if(!o||!l)throw new Error("Cannot perform operation on Pattern Sparse Matrices");const h=u[0],g=u[1];let y,x=r,b=0,v=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(r,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=[],N=[],E=[],A=[],S=[];let M,C,T,D;for(let e=0;e{let{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",(e=>(t,n)=>e(r(t),n).valueOf())),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(e=>(t,n)=>e(r(t),n).valueOf())),"number, Array":t.referTo("number, DenseMatrix",(e=>(t,n)=>e(t,r(n)).valueOf())),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(e=>(t,n)=>e(t,r(n)).valueOf()))}})),yc="leftShift",xc=de(yc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:a}=e;const s=Yo({typed:t}),u=Lo({typed:t,equalScalar:n}),c=hc({typed:t,equalScalar:n}),l=Xo({typed:t,DenseMatrix:o}),f=No({typed:t,equalScalar:n}),p=Ao({typed:t}),m=Vo({typed:t,matrix:r,concat:a}),d=gc({typed:t,matrix:r});return t(yc,{"number, number":Ua,"BigNumber, BigNumber":za,"bigint, bigint":(e,t)=>e<(t,r)=>n(r,0)?t.clone():f(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)))},d,m({SS:c,DS:s,SD:u}))})),bc="rightArithShift",vc=de(bc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:a}=e;const s=Yo({typed:t}),u=Lo({typed:t,equalScalar:n}),c=hc({typed:t,equalScalar:n}),l=Xo({typed:t,DenseMatrix:o}),f=No({typed:t,equalScalar:n}),p=Ao({typed:t}),m=Vo({typed:t,matrix:r,concat:a}),d=gc({typed:t,matrix:r});return t(bc,{"number, number":La,"BigNumber, BigNumber":Ia,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>n(r,0)?t.clone():f(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)))},d,m({SS:c,DS:s,SD:u}))})),wc="rightLogShift",Nc=de(wc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:a}=e;const s=Yo({typed:t}),u=Lo({typed:t,equalScalar:n}),c=hc({typed:t,equalScalar:n}),l=Xo({typed:t,DenseMatrix:o}),f=No({typed:t,equalScalar:n}),p=Ao({typed:t}),m=Vo({typed:t,matrix:r,concat:a}),d=gc({typed:t,matrix:r});return t(wc,{"number, number":$a,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>n(r,0)?t.clone():f(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>n(r,0)?t.clone():p(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):l(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)))},d,m({SS:c,DS:s,SD:u}))})),Ec=de("and",["typed","matrix","equalScalar","zeros","not","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:a}=e;const s=Lo({typed:t,equalScalar:n}),u=na({typed:t,equalScalar:n}),c=No({typed:t,equalScalar:n}),l=Ao({typed:t}),f=Vo({typed:t,matrix:r,concat:a});return t("and",{"number, number":us,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"bigint, bigint":us,"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0))),"SparseMatrix, any":t.referToSelf((e=>(t,r)=>o(r)?i(t.size(),t.storage()):c(t,r,e,!1))),"DenseMatrix, any":t.referToSelf((e=>(t,r)=>o(r)?i(t.size(),t.storage()):l(t,r,e,!1))),"any, SparseMatrix":t.referToSelf((e=>(t,r)=>o(t)?i(t.size(),t.storage()):c(r,t,e,!0))),"any, DenseMatrix":t.referToSelf((e=>(t,r)=>o(t)?i(t.size(),t.storage()):l(r,t,e,!0))),"Array, any":t.referToSelf((e=>(t,n)=>e(r(t),n).valueOf())),"any, Array":t.referToSelf((e=>(t,n)=>e(t,r(n)).valueOf()))},f({SS:u,DS:s}))})),Ac="compare",Sc=de(Ac,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(e=>{let{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:a,DenseMatrix:s,concat:u}=e;const c=$o({typed:t}),l=Ho({typed:t,equalScalar:n}),f=Eo({typed:t,DenseMatrix:s}),p=Vo({typed:t,matrix:i,concat:u}),m=yi({typed:t});return t(Ac,Mc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return ri(e,t,r.relTol,r.absTol)?new o(0):new o(e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new a(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:l,DS:c,Ss:f}))})),Mc=de(Ac,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(Ac,{"number, number":function(e,t){return _e(e,t,r.relTol,r.absTol)?0:e>t?1:-1}})}));var Cc=r(1880);const Tc="compareNatural",Dc=de(Tc,["typed","compare"],(e=>{let{typed:t,compare:r}=e;const n=r.signatures["boolean,boolean"];return t(Tc,{"any, any":function e(t,a){const s=oe(t),u=oe(a);let c;if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u))return c=r(t,a),"0"!==c.toString()?c>0?1:-1:Cc(s,u);const l=["Array","DenseMatrix","SparseMatrix"];if(l.includes(s)||l.includes(u))return c=i(e,t,a),0!==c?c:Cc(s,u);if(s!==u)return Cc(s,u);if("Complex"===s)return function(e,t){return e.re>t.re?1:e.ret.im?1:e.imr.length?1:t.length{let{typed:t,matrix:r,concat:n}=e;const i=Vo({typed:t,matrix:r,concat:n});return t(Fc,on,i({elop:on,Ds:!0}))})),_c="equal",zc=de(_c,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ja({typed:t,DenseMatrix:i}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:r,concat:o});return t(_c,Ic({typed:t,equalScalar:n}),c({elop:n,SS:s,DS:a,Ss:u}))})),Ic=de(_c,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return t(_c,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})})),kc="equalText",qc=de(kc,["typed","compareText","isZero"],(e=>{let{typed:t,compareText:r,isZero:n}=e;return t(kc,{"any, any":function(e,t){return n(r(e,t))}})})),Rc="smaller",Pc=de(Rc,["typed","config","matrix","DenseMatrix","concat"],(e=>{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ja({typed:t,DenseMatrix:i}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:n,concat:o}),l=yi({typed:t});return t(Rc,jc({typed:t,config:r}),{"boolean, boolean":(e,t)=>ee-1===e.compare(t),"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:a,Ss:u}))})),jc=de(Rc,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(Rc,{"number, number":function(e,t){return e{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ja({typed:t,DenseMatrix:i}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:n,concat:o}),l=yi({typed:t});return t(Uc,$c({typed:t,config:r}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||ri(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:a,Ss:u}))})),$c=de(Uc,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(Uc,{"number, number":function(e,t){return e<=t||_e(e,t,r.relTol,r.absTol)}})})),Hc="larger",Gc=de(Hc,["typed","config","matrix","DenseMatrix","concat"],(e=>{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ja({typed:t,DenseMatrix:i}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:n,concat:o}),l=yi({typed:t});return t(Hc,Zc({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!ri(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:a,Ss:u}))})),Zc=de(Hc,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(Hc,{"number, number":function(e,t){return e>t&&!_e(e,t,r.relTol,r.absTol)}})})),Vc="largerEq",Wc=de(Vc,["typed","config","matrix","DenseMatrix","concat"],(e=>{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e;const a=$o({typed:t}),s=Ja({typed:t,DenseMatrix:i}),u=Eo({typed:t,DenseMatrix:i}),c=Vo({typed:t,matrix:n,concat:o}),l=yi({typed:t});return t(Vc,Yc({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||ri(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>-1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:a,Ss:u}))})),Yc=de(Vc,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(Vc,{"number, number":function(e,t){return e>=t||_e(e,t,r.relTol,r.absTol)}})})),Jc="deepEqual",Xc=de(Jc,["typed","equal"],(e=>{let{typed:t,equal:r}=e;return t(Jc,{"any, any":function(e,t){return n(e.valueOf(),t.valueOf())}});function n(e,t){if(Array.isArray(e)){if(Array.isArray(t)){const r=e.length;if(r!==t.length)return!1;for(let i=0;i{let{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:o,concat:a}=e;const s=$o({typed:t}),u=Ja({typed:t,DenseMatrix:o}),c=Eo({typed:t,DenseMatrix:o}),l=Vo({typed:t,matrix:i,concat:a});return t(Qc,el({typed:t,equalScalar:n}),l({elop:function(e,t){return!n(e,t)},SS:u,DS:s,Ss:c}))})),el=de(Qc,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return t(Qc,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})})),tl="partitionSelect",rl=de(tl,["typed","isNumeric","isNaN","compare"],(e=>{let{typed:t,isNumeric:r,isNaN:n,compare:i}=e;const o=i,a=(e,t)=>-i(e,t);return t(tl,{"Array | Matrix, number":function(e,t){return s(e,t,o)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return s(e,t,o);if("desc"===r)return s(e,t,a);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(e,t,r){if(!ye(t)||t<0)throw new Error("k must be a non-negative integer");if(E(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return u(e.valueOf(),t,r)}if(Array.isArray(e))return u(e,t,r)}function u(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(let t=0;t=0){const t=e[n];e[n]=e[r],e[r]=t,--n}else++r;i(e[r],s)>0&&--r,t<=r?a=r:o=r+1}return e[t]}})),nl="sort",il=de(nl,["typed","matrix","compare","compareNatural"],(e=>{let{typed:t,matrix:r,compare:n,compareNatural:i}=e;const o=n,a=(e,t)=>-n(e,t);return t(nl,{Array:function(e){return u(e),e.sort(o)},Matrix:function(e){return c(e),r(e.toArray().sort(o),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(s(t))},"Matrix, string":function(e,t){return c(e),r(e.toArray().sort(s(t)),e.storage())}});function s(e){if("asc"===e)return o;if("desc"===e)return a;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==un(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),ol=de("max",["typed","config","numeric","larger"],(e=>{let{typed:t,config:r,numeric:n,larger:i}=e;return t("max",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){return Vn(e,t.valueOf(),o)},"...":function(e){if(Hn(e))throw new TypeError("Scalar values expected in function max");return a(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw Du(e,"max",t)}}function a(e){let t;if(Gn(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw Du(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=n(t,xe(t,r))),t}})),al=de("min",["typed","config","numeric","smaller"],(e=>{let{typed:t,config:r,numeric:n,smaller:i}=e;return t("min",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){return Vn(e,t.valueOf(),o)},"...":function(e){if(Hn(e))throw new TypeError("Scalar values expected in function min");return a(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw Du(e,"min",t)}}function a(e){let t;if(Gn(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw Du(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=n(t,xe(t,r))),t}})),sl=de("ImmutableDenseMatrix",["smaller","DenseMatrix"],(e=>{let{smaller:t,DenseMatrix:r}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(E(e)||N(e)){const n=new r(e,t);this._data=n._data,this._size=n._size,this._datatype=n._datatype,this._min=null,this._max=null}else if(e&&N(e.data)&&N(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+oe(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:{const t=r.prototype.subset.call(this,e);return E(t)?new n({data:t._data,size:t._size,datatype:t._datatype}):t}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:ae(this._data),size:ae(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){let e=null;this.forEach((function(r){(null===e||t(r,e))&&(e=r)})),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){let e=null;this.forEach((function(r){(null===e||t(e,r))&&(e=r)})),this._max=null!==e?e:void 0}return this._max},n}),{isClass:!0}),ul=de("Index",["ImmutableDenseMatrix","getMatrixDataType"],(e=>{let{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(let e=0,t=arguments.length;e{e&&t.push(r)})),t}const ll=de("FibonacciHeap",["smaller","larger"],(e=>{let{smaller:t,larger:r}=e;const n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function o(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function a(e,t){const r=t.parent;r&&(t.mark?(o(e,t,r),a(r)):t.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,r){const n={key:e,value:r,degree:0};if(this._minimum){const r=this._minimum;n.left=r,n.right=r.right,r.right=n,n.right.left=n,t(e,r.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){const e=this._minimum;if(null===e)return e;let i=this._minimum,o=e.degree,a=e.child;for(;o>0;){const e=a.right;a.left.right=a.right,a.right.left=a.left,a.left=i,a.right=i.right,i.right=a,a.right.left=a,a.parent=null,a=e,o--}return e.left.right=e.right,e.right.left=e.left,e===e.right?i=null:(i=e.right,i=function(e,i){const o=Math.floor(Math.log(i)*n)+1,a=new Array(o);let u,c=0,l=e;if(l)for(c++,l=l.right;l!==e;)c++,l=l.right;for(;c>0;){let e=l.degree;const t=l.right;for(;u=a[e],u;){if(r(l.key,u.key)){const e=u;u=l,l=e}s(u,l),a[e]=null,e++}a[e]=l,l=t,c--}e=null;for(let r=0;r{let{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{const r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){const t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,r){let n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},i.prototype.forEach=function(e,t,n){const i=this._heap,o=this._values,a=[];let s=i.extractMinimum();for(s&&a.push(s);s&&s.key<=t;)s.key>=e&&(r(s.value,0)||n(s.key,s.value,this)),s=i.extractMinimum(),s&&a.push(s);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return r=null==r?Number.POSITIVE_INFINITY:r,t=null==t?JSON.stringify:t,function n(){"object"!=typeof n.cache&&(n.cache={values:new Map,lru:pl(r||Number.POSITIVE_INFINITY)});const i=[];for(let e=0;e{let{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:o,divideScalar:a,pow:s,abs:u,fix:c,round:l,equal:f,isNumeric:p,format:m,number:d,Complex:h,BigNumber:g,Fraction:y}=e;const b=d;function w(e,t){if(!(this instanceof w))throw new Error("Constructor must be called with the new operator");if(null!=e&&!p(e)&&!x(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=I.map((e=>0));else if("string"==typeof t){const e=w.parse(t);this.units=e.units,this.dimensions=e.dimensions}else{if(!v(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((e=>Wr({},e)))}this.value=this._normalize(e)}let N,E,A;function S(){for(;" "===A||"\t"===A;)C()}function M(e){return e>="0"&&e<="9"}function C(){E++,A=N.charAt(E)}function T(e){E=e,A=N.charAt(E)}function D(){let e="";const t=E;if("+"===A?C():"-"===A&&(e+=A,C()),!function(e){return e>="0"&&e<="9"||"."===e}(A))return T(t),null;if("."===A){if(e+=A,C(),!M(A))return T(t),null}else{for(;M(A);)e+=A,C();"."===A&&(e+=A,C())}for(;M(A);)e+=A,C();if("E"===A||"e"===A){let t="";const r=E;if(t+=A,C(),"+"!==A&&"-"!==A||(t+=A,C()),!M(A))return T(r),e;for(e+=t;M(A);)e+=A,C()}return e}function F(){let e="";for(;M(A)||w.isValidAlpha(A);)e+=A,C();const t=e.charAt(0);return w.isValidAlpha(t)?e:null}function O(e){return A===e?(C(),e):null}Object.defineProperty(w,"name",{value:"Unit"}),w.prototype.constructor=w,w.prototype.type="Unit",w.prototype.isUnit=!0,w.parse=function(e,t){if(t=t||{},N=e,E=-1,A="","string"!=typeof N)throw new TypeError("Invalid argument in Unit.parse, string expected");const n=new w;n.units=[];let i=1,o=!1;C(),S();const a=D();let s=null;if(a){if("BigNumber"===r.number)s=new g(a);else if("Fraction"===r.number)try{s=new y(a)}catch(e){s=parseFloat(a)}else s=parseFloat(a);S(),O("*")?(i=1,o=!0):O("/")&&(i=-1,o=!0)}const u=[];let c=1;for(;;){for(S();"("===A;)u.push(i),c*=i,i=1,C(),S();let t;if(!A)break;{const e=A;if(t=F(),null===t)throw new SyntaxError('Unexpected "'+e+'" in "'+N+'" at index '+E.toString())}const r=B(t);if(null===r)throw new SyntaxError('Unit "'+t+'" not found.');let a=i*c;if(S(),O("^")){S();const t=D();if(null===t)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');a*=t}n.units.push({unit:r.unit,prefix:r.prefix,power:a});for(let e=0;e1||Math.abs(this.units[0].power-1)>1e-15)},w.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;let t=e;const r=w._getNumberConverter(oe(e));for(let e=0;e{if(me(R,e)){const t=R[e];return{unit:t,prefix:t.prefixes[""]}}for(const t in R)if(me(R,t)&&Qr(e,t)){const r=R[t],n=e.length-t.length,i=e.substring(0,n),o=me(r.prefixes,i)?r.prefixes[i]:void 0;if(void 0!==o)return{unit:r,prefix:o}}return null}),{hasher:e=>e[0],limit:100});function _(e){return e.equalBase(k.NONE)&&null!==e.value&&!r.predictable?e.value:e}w.isValuelessUnit=function(e){return null!==B(e)},w.prototype.hasBase=function(e){if("string"==typeof e&&(e=k[e]),!e)return!1;for(let t=0;t1e-12)return!1;return!0},w.prototype.equalBase=function(e){for(let t=0;t1e-12)return!1;return!0},w.prototype.equals=function(e){return this.equalBase(e)&&f(this.value,e.value)},w.prototype.multiply=function(e){const t=this.clone(),r=v(e)?e:new w(e);for(let e=0;e0?this.formatUnits():null,fixPrefix:this.fixPrefix}},w.fromJSON=function(e){var t;const r=new w(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return r.fixPrefix=e.fixPrefix||!1,r},w.prototype.valueOf=w.prototype.toString,w.prototype.simplify=function(){const e=this.clone(),t=[];let r;for(const t in L)if(me(L,t)&&e.hasBase(k[t])){r=t;break}if("NONE"===r)e.units=[];else{let n;if(r&&me(L,r)&&(n=L[r]),n)e.units=[{unit:n.unit,prefix:n.prefix,power:1}];else{let r=!1;for(let n=0;n1e-12&&(me(L,i)?t.push({unit:L[i].unit,prefix:L[i].prefix,power:e.dimensions[n]||0}):r=!0)}t.length1e-12){if(!me(U.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:U.si[n].unit,prefix:U.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},w.prototype.formatUnits=function(){let e="",t="",r=0,n=0;for(let t=0;t0?(r++,e+=" "+this.units[t].prefix.name+this.units[t].unit.name,Math.abs(this.units[t].power-1)>1e-15&&(e+="^"+this.units[t].power)):this.units[t].power<0&&n++;if(n>0)for(let e=0;e0?(t+=" "+this.units[e].prefix.name+this.units[e].unit.name,Math.abs(this.units[e].power+1)>1e-15&&(t+="^"+-this.units[e].power)):(t+=" "+this.units[e].prefix.name+this.units[e].unit.name,t+="^"+this.units[e].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");let i=e;return r>0&&n>0&&(i+=" / "),i+=t,i},w.prototype.format=function(e){const t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify();let r=!1;void 0!==t.value&&null!==t.value&&x(t.value)&&(r=Math.abs(t.value.re)<1e-14);for(const e in t.units)me(t.units,e)&&t.units[e].unit&&("VA"===t.units[e].unit.name&&r?t.units[e].unit=R.VAR:"VAR"!==t.units[e].unit.name||r||(t.units[e].unit=R.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());const n=t._denormalize(t.value);let i=null!==t.value?m(n,e||{}):"";const o=t.formatUnits();return t.value&&x(t.value)&&(i="("+i+")"),o.length>0&&i.length>0&&(i+=" "),i+=o,i},w.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");const e=null!==this.value?u(this.value):0,t=u(this.units[0].unit.value);let r=this.units[0].prefix;if(0===e)return r;const n=this.units[0].power;let i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return r;i=Math.abs(i);const o=this.units[0].unit.prefixes;for(const a in o)if(me(o,a)){const s=o[a];if(s.scientific){const o=Math.abs(Math.log(e/Math.pow(s.value*t,n))/Math.LN10-1.2);(o0))},R={meter:{name:"meter",base:k.LENGTH,prefixes:z.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:z.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:z.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:z.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:z.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:z.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:z.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:z.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:z.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:z.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:z.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:z.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:z.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:z.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:z.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:z.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:z.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:z.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:z.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:z.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:z.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:z.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:z.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:z.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:z.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:z.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:z.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:z.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:z.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:z.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:z.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:z.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:z.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:z.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:z.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:z.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:z.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:z.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:z.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:z.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:z.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:z.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:z.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:z.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:z.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:z.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:z.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:z.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:z.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:z.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:z.NONE,value:.238480942392,offset:0},g:{name:"g",base:k.MASS,prefixes:z.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:z.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:z.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:z.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:z.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:z.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:z.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:z.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:z.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:z.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:z.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:z.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:z.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:z.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:z.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:z.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:z.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:z.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:z.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:z.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:z.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:z.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:z.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:z.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:z.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:z.NONE,value:604800,offset:0},month:{name:"month",base:k.TIME,prefixes:z.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:z.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:z.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:z.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:z.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:z.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:z.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:z.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:z.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:z.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:z.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:z.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:z.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:z.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:z.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:z.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:z.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:z.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:z.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:z.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:z.SHORT,value:new y(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:z.SHORT,value:new y(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:z.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:z.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:z.LONG,value:new y(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:z.LONG,value:new y(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:z.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:z.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:z.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:z.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:z.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:z.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:z.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:z.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:z.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:z.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:z.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:z.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:z.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:z.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:z.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:z.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:z.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:z.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:z.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:z.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:z.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:z.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:z.SHORT,value:h.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:z.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:z.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:z.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:z.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:z.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:z.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:z.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:z.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:z.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:z.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:z.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:z.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:z.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:z.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:z.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:z.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:z.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:z.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:z.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:z.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:z.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:z.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:z.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:z.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:z.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:z.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:z.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:z.BINARY_LONG,value:8,offset:0}},P={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function j(e){if("BigNumber"===e.number){const e=gl(g);R.rad.value=new g(1),R.deg.value=e.div(180),R.grad.value=e.div(200),R.cycle.value=e.times(2),R.arcsec.value=e.div(648e3),R.arcmin.value=e.div(10800)}else R.rad.value=1,R.deg.value=Math.PI/180,R.grad.value=Math.PI/200,R.cycle.value=2*Math.PI,R.arcsec.value=Math.PI/648e3,R.arcmin.value=Math.PI/10800;R.radian.value=R.rad.value,R.degree.value=R.deg.value,R.gradian.value=R.grad.value}j(r),t&&t("config",(function(e,t){e.number!==t.number&&j(e)}));const U={si:{NONE:{unit:q,prefix:z.NONE[""]},LENGTH:{unit:R.m,prefix:z.SHORT[""]},MASS:{unit:R.g,prefix:z.SHORT.k},TIME:{unit:R.s,prefix:z.SHORT[""]},CURRENT:{unit:R.A,prefix:z.SHORT[""]},TEMPERATURE:{unit:R.K,prefix:z.SHORT[""]},LUMINOUS_INTENSITY:{unit:R.cd,prefix:z.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:R.mol,prefix:z.SHORT[""]},ANGLE:{unit:R.rad,prefix:z.SHORT[""]},BIT:{unit:R.bits,prefix:z.SHORT[""]},FORCE:{unit:R.N,prefix:z.SHORT[""]},ENERGY:{unit:R.J,prefix:z.SHORT[""]},POWER:{unit:R.W,prefix:z.SHORT[""]},PRESSURE:{unit:R.Pa,prefix:z.SHORT[""]},ELECTRIC_CHARGE:{unit:R.C,prefix:z.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:R.F,prefix:z.SHORT[""]},ELECTRIC_POTENTIAL:{unit:R.V,prefix:z.SHORT[""]},ELECTRIC_RESISTANCE:{unit:R.ohm,prefix:z.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:R.H,prefix:z.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:R.S,prefix:z.SHORT[""]},MAGNETIC_FLUX:{unit:R.Wb,prefix:z.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:R.T,prefix:z.SHORT[""]},FREQUENCY:{unit:R.Hz,prefix:z.SHORT[""]}}};U.cgs=JSON.parse(JSON.stringify(U.si)),U.cgs.LENGTH={unit:R.m,prefix:z.SHORT.c},U.cgs.MASS={unit:R.g,prefix:z.SHORT[""]},U.cgs.FORCE={unit:R.dyn,prefix:z.SHORT[""]},U.cgs.ENERGY={unit:R.erg,prefix:z.NONE[""]},U.us=JSON.parse(JSON.stringify(U.si)),U.us.LENGTH={unit:R.ft,prefix:z.NONE[""]},U.us.MASS={unit:R.lbm,prefix:z.NONE[""]},U.us.TEMPERATURE={unit:R.degF,prefix:z.NONE[""]},U.us.FORCE={unit:R.lbf,prefix:z.NONE[""]},U.us.ENERGY={unit:R.BTU,prefix:z.BTU[""]},U.us.POWER={unit:R.hp,prefix:z.NONE[""]},U.us.PRESSURE={unit:R.psi,prefix:z.NONE[""]},U.auto=JSON.parse(JSON.stringify(U.si));let L=U.auto;w.setUnitSystem=function(e){if(!me(U,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(U).join(", "));L=U[e]},w.getUnitSystem=function(){for(const e in U)if(me(U,e)&&U[e]===L)return e},w.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new g(e.n).div(e.d).times(e.s):new g(e+"")},Fraction:function(e){return new y(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?d(e):e}},w.prototype._numberConverter=function(){const e=w.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},w._getNumberConverter=function(e){if(!w.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return w.typeConverters[e]};for(const e in R)if(me(R,e)){const t=R[e];t.dimensions=t.base.dimensions}for(const e in P)if(me(P,e)){const t=R[P[e]],r={};for(const e in t)me(t,e)&&(r[e]=t[e]);r.name=e,R[e]=r}return w.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},w.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(const t in e)if(me(e,t)&&w.deleteUnit(t),e[t].aliases)for(let r=0;r0&&!w.isValidAlpha(A)&&!M(A))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);let r,n,i,o=null,a=[],s=0;if(t&&"Unit"===t.type)o=t.clone();else if("string"==typeof t)""!==t&&(r=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');r=t.definition,n=t.prefixes,s=t.offset,i=t.baseName,t.aliases&&(a=t.aliases.valueOf())}if(a)for(let e=0;e1e-12){r=!1;break}if(r){t=!0,u.base=k[e];break}}if(!t){i=i||e+"_STUFF";const t={dimensions:o.dimensions.slice(0)};t.key=i,k[i]=t,L[i]={unit:u,prefix:z.NONE[""]},u.base=k[i]}}else{if(i=i||e+"_STUFF",I.indexOf(i)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');I.push(i);for(const e in k)me(k,e)&&(k[e].dimensions[I.length-1]=0);const t={dimensions:[]};for(let e=0;e{let{typed:t,Unit:r}=e;return t(vl,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new r(e,t)},"number | BigNumber | Fraction":function(e){return new r(e)},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),Nl="sparse",El=de(Nl,["typed","SparseMatrix"],(e=>{let{typed:t,SparseMatrix:r}=e;return t(Nl,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})})),Al="createUnit",Sl=de(Al,["typed","Unit"],(e=>{let{typed:t,Unit:r}=e;return t(Al,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){const i={};return i[e]=t,r.createUnit(i,n)},"string, Unit | string | Object":function(e,t){const n={};return n[e]=t,r.createUnit(n,{})},string:function(e){const t={};return t[e]={},r.createUnit(t,{})}})})),Ml="acos",Cl=de(Ml,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(Ml,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),Tl="number";function Dl(e){return ze(e)}function Fl(e){return Math.atan(1/e)}function Ol(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Bl(e){return Math.asin(1/e)}function _l(e){const t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function zl(e){return Math.acos(1/e)}function Il(e){const t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function kl(e){return Ie(e)}function ql(e){return ke(e)}function Rl(e){return 1/Math.tan(e)}function Pl(e){const t=Math.exp(2*e);return(t+1)/(t-1)}function jl(e){return 1/Math.sin(e)}function Ul(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*be(e)}function Ll(e){return 1/Math.cos(e)}function $l(e){return 2/(Math.exp(e)+Math.exp(-e))}function Hl(e){return Re(e)}Dl.signature=Tl,Fl.signature=Tl,Ol.signature=Tl,Bl.signature=Tl,_l.signature=Tl,zl.signature=Tl,Il.signature=Tl,kl.signature=Tl,ql.signature=Tl,Rl.signature=Tl,Pl.signature=Tl,jl.signature=Tl,Ul.signature=Tl,Ll.signature=Tl,$l.signature=Tl,Hl.signature=Tl;const Gl="acosh",Zl=de(Gl,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(Gl,{number:function(e){return e>=1||r.predictable?Dl(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),Vl="acot",Wl=de(Vl,["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t(Vl,{number:Fl,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})})),Yl="acoth",Jl=de(Yl,["typed","config","Complex","BigNumber"],(e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Yl,{number:function(e){return e>=1||e<=-1||r.predictable?Ol(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})})),Xl="acsc",Ql=de(Xl,["typed","config","Complex","BigNumber"],(e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Xl,{number:function(e){return e<=-1||e>=1||r.predictable?Bl(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})})),Kl="acsch",ef=de(Kl,["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t(Kl,{number:_l,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})})),tf="asec",rf=de(tf,["typed","config","Complex","BigNumber"],(e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(tf,{number:function(e){return e<=-1||e>=1||r.predictable?zl(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})})),nf="asech",of=de(nf,["typed","config","Complex","BigNumber"],(e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(nf,{number:function(e){if(e<=1&&e>=-1||r.predictable){const t=1/e;if(t>0||r.predictable)return Il(e);const i=Math.sqrt(t*t-1);return new n(Math.log(i-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})})),af="asin",sf=de(af,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(af,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),uf=de("asinh",["typed"],(e=>{let{typed:t}=e;return t("asinh",{number:kl,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),cf=de("atan",["typed"],(e=>{let{typed:t}=e;return t("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})})),lf="atan2",ff=de(lf,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:a}=e;const s=Lo({typed:t,equalScalar:n}),u=$o({typed:t}),c=Sa({typed:t,equalScalar:n}),l=No({typed:t,equalScalar:n}),f=Eo({typed:t,DenseMatrix:o}),p=Vo({typed:t,matrix:r,concat:a});return t(lf,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>i.atan2(e,t)},p({scalar:"number | BigNumber",SS:c,DS:u,SD:s,Ss:l,sS:f}))})),pf="atanh",mf=de(pf,["typed","config","Complex"],(e=>{let{typed:t,config:r,Complex:n}=e;return t(pf,{number:function(e){return e<=1&&e>=-1||r.predictable?ql(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),df=de("trigUnit",["typed"],(e=>{let{typed:t}=e;return{Unit:t.referToSelf((e=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,r.valueType())(r.value)}))}})),hf=de("cos",["typed"],(e=>{let{typed:t}=e;const r=df({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},r)})),gf="cosh",yf=de(gf,["typed"],(e=>{let{typed:t}=e;return t(gf,{number:qe,"Complex | BigNumber":e=>e.cosh()})})),xf=de("cot",["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t("cot",{number:Rl,Complex:e=>e.cot(),BigNumber:e=>new r(1).div(e.tan())},df({typed:t}))})),bf="coth",vf=de(bf,["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t(bf,{number:Pl,Complex:e=>e.coth(),BigNumber:e=>new r(1).div(e.tanh())})})),wf=de("csc",["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t("csc",{number:jl,Complex:e=>e.csc(),BigNumber:e=>new r(1).div(e.sin())},df({typed:t}))})),Nf="csch",Ef=de(Nf,["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t(Nf,{number:Ul,Complex:e=>e.csch(),BigNumber:e=>new r(1).div(e.sinh())})})),Af=de("sec",["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t("sec",{number:Ll,Complex:e=>e.sec(),BigNumber:e=>new r(1).div(e.cos())},df({typed:t}))})),Sf="sech",Mf=de(Sf,["typed","BigNumber"],(e=>{let{typed:t,BigNumber:r}=e;return t(Sf,{number:$l,Complex:e=>e.sech(),BigNumber:e=>new r(1).div(e.cosh())})})),Cf=de("sin",["typed"],(e=>{let{typed:t}=e;const r=df({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},r)})),Tf="sinh",Df=de(Tf,["typed"],(e=>{let{typed:t}=e;return t(Tf,{number:Hl,"Complex | BigNumber":e=>e.sinh()})})),Ff=de("tan",["typed"],(e=>{let{typed:t}=e;const r=df({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},r)})),Of=de("tanh",["typed"],(e=>{let{typed:t}=e;return t("tanh",{number:Pe,"Complex | BigNumber":e=>e.tanh()})})),Bf="setCartesian",_f=de(Bf,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{let{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(Bf,{"Array | Matrix, Array | Matrix":function(e,t){let s=[];if(0!==n(r(e),new o(0))&&0!==n(r(t),new o(0))){const r=En(Array.isArray(e)?e:e.toArray()).sort(i),n=En(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(let e=0;e{let{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(zf,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===n(r(e),new o(0)))s=[];else{if(0===n(r(t),new o(0)))return En(e.toArray());{const r=Tn(En(Array.isArray(e)?e:e.toArray()).sort(i)),n=Tn(En(Array.isArray(t)?t:t.toArray()).sort(i));let o;s=[];for(let e=0;e{let{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(kf,{"Array | Matrix":function(e){let t;if(0===n(r(e),new o(0)))t=[];else{const r=En(Array.isArray(e)?e:e.toArray()).sort(i);t=[],t.push(r[0]);for(let e=1;e{let{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(Rf,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===n(r(e),new o(0))||0===n(r(t),new o(0)))s=[];else{const r=Tn(En(Array.isArray(e)?e:e.toArray()).sort(i)),n=Tn(En(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(let e=0;e{let{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(jf,{"Array | Matrix, Array | Matrix":function(e,t){if(0===n(r(e),new o(0)))return!0;if(0===n(r(t),new o(0)))return!1;const a=Tn(En(Array.isArray(e)?e:e.toArray()).sort(i)),s=Tn(En(Array.isArray(t)?t:t.toArray()).sort(i));let u;for(let e=0;e{let{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(Lf,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===n(r(t),new o(0)))return 0;const a=En(Array.isArray(t)?t:t.toArray());let s=0;for(let t=0;t{let{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(Hf,{"Array | Matrix":function(e){if(0===n(r(e),new o(0)))return[];const t=En(Array.isArray(e)?e:e.toArray()).sort(i),s=[];let u=0;for(;u.toString(2).length<=t.length;)s.push(a(t,u.toString(2).split("").reverse())),u++;return function(e){let t=[];for(let r=e.length-1;r>0;r--)for(let n=0;ne[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(s)}});function a(e,t){const r=[];for(let n=0;n{let{typed:t,compareNatural:r}=e;return t(Zf,{"Array | Matrix":function(e){return Array.isArray(e)?En(e).length:En(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?En(e).length:En(e.toArray()).length;{const t=En(Array.isArray(e)?e:e.toArray()).sort(r);let n=1;for(let e=1;e{let{typed:t,size:r,concat:n,subset:i,setDifference:o,Index:a}=e;return t(Wf,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new a(0)))return En(t);if(0===i(r(t),new a(0)))return En(e);const s=En(e),u=En(t);return n(o(s,u),o(u,s))}})})),Jf="setUnion",Xf=de(Jf,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(e=>{let{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:a,Index:s}=e;return t(Jf,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new s(0)))return En(t);if(0===i(r(t),new s(0)))return En(e);const u=En(e),c=En(t);return n(a(u,c),o(u,c))}})})),Qf=de("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(e=>{let{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:a,concat:s}=e;const u=Yo({typed:t}),c=Jo({typed:t,equalScalar:i}),l=Xo({typed:t,DenseMatrix:o}),f=Vo({typed:t,matrix:r,concat:s});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t{let{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:a,smaller:s,isPositive:u}=e;return t(Kf,{"... number | BigNumber":c,Array:c,Matrix:e=>c(En(e.toArray()))});function c(e){let t=0,c=0;for(let a=0;a{let{typed:t,abs:r,add:n,pow:i,conj:o,sqrt:a,multiply:s,equalScalar:u,larger:c,smaller:l,matrix:f,ctranspose:p,eigs:m}=e;return t(tp,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return d(f(e),2)},Matrix:function(e){return d(e,2)},"Array, number | BigNumber | string":function(e,t){return d(f(e),t)},"Matrix, number | BigNumber | string":function(e,t){return d(e,t)}});function d(e,t){const f=e.size();if(1===f.length)return function(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){let t=0;return e.forEach((function(e){const n=r(e);c(n,t)&&(t=n)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){let t;return e.forEach((function(e){const n=r(e);t&&!l(n,t)||(t=n)}),!0),t||0}(e);if("fro"===t)return d(e,2);if("number"==typeof t&&!isNaN(t)){if(!u(t,0)){let o=0;return e.forEach((function(e){o=n(i(r(e),t),o)}),!0),i(o,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}(e,t);if(2===f.length){if(f[0]&&f[1])return function(e,t){if(1===t)return function(e){const t=[];let i=0;return e.forEach((function(e,o){const a=o[1],s=n(t[a]||0,r(e));c(s,i)&&(i=s),t[a]=s}),!0),i}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){const t=[];let i=0;return e.forEach((function(e,o){const a=o[0],s=n(t[a]||0,r(e));c(s,i)&&(i=s),t[a]=s}),!0),i}(e);if("fro"===t)return function(e){let t=0;return e.forEach((function(e,r){t=n(t,s(e,o(e)))})),r(a(t))}(e);if(2===t)return function(e){const t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");const n=p(e),i=s(n,e),o=m(i).values.toArray(),u=o[o.length-1];return r(a(u))}(e);throw new Error("Unsupported parameter value "+t)}(e,t);throw new RangeError("Invalid matrix dimensions")}}})),np=de("dot",["typed","addScalar","multiplyScalar","conj","size"],(e=>{let{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,o){const u=a(e,o),c=E(e)?e._data:e,l=E(e)?e._datatype||e.getDataType():void 0,f=E(o)?o._data:o,p=E(o)?o._datatype||o.getDataType():void 0,m=2===s(e).length,d=2===s(o).length;let h=r,g=n;if(l&&p&&l===p&&"string"==typeof l&&"mixed"!==l){const e=l;h=t.find(r,[e,e]),g=t.find(n,[e,e])}if(!m&&!d){let e=g(i(c[0]),f[0]);for(let t=1;tt?m++:e===t&&(c=l(c,f(o[p],u[m])),p++,m++)}return c}});function a(e,t){const r=s(e),n=s(t);let i,o;if(1===r.length)i=r[0];else{if(2!==r.length||1!==r[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+r.join(", ")+")");i=r[0]}if(1===n.length)o=n[0];else{if(2!==n.length||1!==n[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+n.join(", ")+")");o=n[0]}if(i!==o)throw new RangeError("Vectors must have equal length ("+i+" != "+o+")");if(0===i)throw new RangeError("Cannot calculate the dot product of empty vectors");return i}function s(e){return E(e)?e.size():o(e)}})),ip=de("trace",["typed","matrix","add"],(e=>{let{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(e){return i(r(e))},SparseMatrix:function(e){const t=e._values,r=e._index,i=e._ptr,o=e._size,a=o[0],s=o[1];if(a===s){let e=0;if(t.length>0)for(let o=0;oo)break}}return e}throw new RangeError("Matrix must be square (size: "+Kr(o)+")")},DenseMatrix:i,any:ae});function i(e){const t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return ae(r[0]);throw new RangeError("Matrix must be square (size: "+Kr(t)+")");case 2:{const e=t[0];if(e===t[1]){let t=0;for(let i=0;i{let{typed:t,Index:r}=e;return t(op,{"...number | string | BigNumber | Range | Array | Matrix":function(e){const t=e.map((function(e){return g(e)?e.toNumber():N(e)||E(e)?e.map((function(e){return g(e)?e.toNumber():e})):e})),n=new r;return r.apply(n,t),n}})})),sp=new Set(["end"]),up=de("Node",["mathWithTransform"],(e=>{let{mathWithTransform:t}=e;return class{get type(){return"Node"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){const e=this._compile(t,{}),r={};return{evaluate:function(t){const n=d(t);return function(e){for(const t of[...sp])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(n),e(n,r,null)}}}_compile(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!X(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(t,r){t.forEach((function(t,n,i){r(t,n,i),e(t,r)}))}(this,e)}transform(e){return function t(r,n,i){const o=e(r,n,i);return o!==r?o:r.map(t)}(this,null,null)}filter(e){const t=[];return this.traverse((function(r,n,i){e(r,n,i)&&t.push(r)})),t}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map((function(e){return e.cloneDeep()}))}equals(e){return!!e&&this.type===e.type&&ce(this,e)}toString(e){const t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e){const t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(e){const t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(e){if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}}),{isClass:!0,isNode:!0});function cp(e){return cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(e)}function lp(e,t,r){return(t=function(e){var t=function(e){if("object"!=cp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=cp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cp(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fp(e){return e&&e.isIndexError?new sn(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function pp(e){let{subset:t}=e;return function(e,r){try{if(Array.isArray(e))return t(e,r);if(e&&"function"==typeof e.subset)return e.subset(r);if("string"==typeof e)return t(e,r);if("object"==typeof e){if(!r.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return i(e,r.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw fp(e)}}}const mp="AccessorNode",dp=de(mp,["subset","Node"],(e=>{let{subset:t,Node:r}=e;const n=pp({subset:t});function o(e){return!(U(e)||L(e)||Z(e)||Y(e)||Q(e)||ee(e)||ne(e))}class a extends r{constructor(e,t){if(super(),!X(e))throw new TypeError('Node expected for parameter "object"');if(!J(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return mp}get isAccessorNode(){return!0}_compile(e,t){const r=this.object._compile(e,t),o=this.index._compile(e,t);if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,n,o){return i(r(t,n,o),e)}}return function(e,t,i){const a=r(e,t,i),s=o(e,t,a);return n(a,s)}}forEach(e){e(this.object,"object",this),e(this.index,"index",this)}map(e){return new a(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(e){let t=this.object.toString(e);return o(this.object)&&(t="("+t+")"),t+this.index.toString(e)}_toHTML(e){let t=this.object.toHTML(e);return o(this.object)&&(t='('+t+')'),t+this.index.toHTML(e)}_toTex(e){let t=this.object.toTex(e);return o(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:mp,object:this.object,index:this.index}}static fromJSON(e){return new a(e.object,e.index)}}return lp(a,"name",mp),a}),{isClass:!0,isNode:!0}),hp="ArrayNode",gp=de(hp,["Node"],(e=>{let{Node:t}=e;class r extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(X))throw new TypeError("Array containing Nodes expected")}get type(){return hp}get isArrayNode(){return!0}_compile(e,t){const r=An(this.items,(function(r){return r._compile(e,t)}));if("Array"!==e.config.matrix){const t=e.matrix;return function(e,n,i){return t(An(r,(function(t){return t(e,n,i)})))}}return function(e,t,n){return An(r,(function(r){return r(e,t,n)}))}}forEach(e){for(let t=0;t['+this.items.map((function(t){return t.toHTML(e)})).join(',')+']'}_toTex(e){return function t(r,n){const i=r.some(L)&&!r.every(L),o=n||i,a=o?"&":"\\\\",s=r.map((function(r){return r.items?t(r.items,!n):r.toTex(e)})).join(a);return i||!o||o&&!n?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}(this.items,!1)}}return lp(r,"name",hp),r}),{isClass:!0,isNode:!0}),yp=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function xp(e,t){if(!t||"auto"!==t)return e;let r=e;for(;ee(r);)r=r.content;return r}function bp(e,t,r,n){let i=e;"keep"!==t&&(i=e.getContent());const o=i.getIdentifier();let a=null;for(let e=0;e{let{subset:t,matrix:r,Node:n}=e;const a=pp({subset:t}),s=function(e){let{subset:t,matrix:r}=e;return function(e,n,i){try{if(Array.isArray(e))return r(e).subset(n,i).valueOf().forEach(((t,r)=>{e[r]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(n,i);if("string"==typeof e)return t(e,n,i);if("object"==typeof e){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return o(e,n.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw fp(e)}}}({subset:t,matrix:r});function u(e,t,r){t||(t="keep");const n=bp(e,t,r),i=bp(e.value,t,r);return"all"===t||null!==i&&i<=n}class c extends n{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!ne(e)&&!U(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(ne(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!J(this.index))throw new TypeError('IndexNode expected as "index"');if(!X(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Np}get isAssignmentNode(){return!0}_compile(e,t){const r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,u=this.value._compile(e,t),c=this.object.name;if(this.index){if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,n,i){const a=r(t,n,i),s=u(t,n,i);return o(a,e,s),s}}if(ne(this.object))return function(e,t,i){const o=r(e,t,i),a=u(e,t,i),l=n(e,t,o);return e.set(c,s(o,l,a)),a};{const r=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){const e=this.object.index.getObjectProperty();return function(t,a,c){const l=r(t,a,c),f=i(l,e),p=n(t,a,f),m=u(t,a,c);return o(l,e,s(f,p,m)),m}}{const i=this.object.index._compile(e,t);return function(e,t,o){const c=r(e,t,o),l=i(e,t,c),f=a(c,l),p=n(e,t,f),m=u(e,t,o);return s(c,l,s(f,p,m)),m}}}}if(!ne(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){const n=u(e,t,r);return e.set(c,n),n}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){const t=this._ifNode(e(this.object,"object",this)),r=this.index?this._ifNode(e(this.index,"index",this)):null,n=this._ifNode(e(this.value,"value",this));return new c(t,r,n)}clone(){return new c(this.object,this.index,this.value)}_toString(e){const t=this.object.toString(e),r=this.index?this.index.toString(e):"";let n=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}toJSON(){return{mathjs:Np,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new c(e.object,e.index,e.value)}_toHTML(e){const t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"";let n=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n='('+n+')'),t+r+'='+n}_toTex(e){const t=this.object.toTex(e),r=this.index?this.index.toTex(e):"";let n=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n=`\\left(${n}\\right)`),t+r+"="+n}}return lp(c,"name",Np),c}),{isClass:!0,isNode:!0}),Ap="BlockNode",Sp=de(Ap,["ResultSet","Node"],(e=>{let{ResultSet:t,Node:r}=e;class n extends r{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){const t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!X(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}}))}get type(){return Ap}get isBlockNode(){return!0}_compile(e,r){const n=An(this.blocks,(function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}}));return function(e,r,i){const o=[];return Sn(n,(function(t){const n=t.evaluate(e,r,i);t.visible&&o.push(n)})),new t(o)}}forEach(e){for(let t=0;t;')})).join('
    ')}_toTex(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")}}return lp(n,"name",Ap),n}),{isClass:!0,isNode:!0}),Mp="ConditionalNode",Cp=de(Mp,["Node"],(e=>{let{Node:t}=e;class r extends t{constructor(e,t,r){if(super(),!X(e))throw new TypeError("Parameter condition must be a Node");if(!X(t))throw new TypeError("Parameter trueExpr must be a Node");if(!X(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return Mp}get isConditionalNode(){return!0}_compile(e,t){const r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,o){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(g(e))return!e.isZero();if(x(e))return!(!e.re&&!e.im);if(v(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+oe(e)+'"')}(r(e,t,o))?n(e,t,o):i(e,t,o)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new r(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new r(this.condition,this.trueExpr,this.falseExpr)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=bp(this,t,e&&e.implicit);let n=this.condition.toString(e);const i=bp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");let o=this.trueExpr.toString(e);const a=bp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=r)&&(o="("+o+")");let s=this.falseExpr.toString(e);const u=bp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s="("+s+")"),n+" ? "+o+" : "+s}toJSON(){return{mathjs:Mp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new r(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=bp(this,t,e&&e.implicit);let n=this.condition.toHTML(e);const i=bp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='('+n+')');let o=this.trueExpr.toHTML(e);const a=bp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=r)&&(o='('+o+')');let s=this.falseExpr.toHTML(e);const u=bp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s='('+s+')'),n+'?'+o+':'+s}_toTex(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return lp(r,"name",Mp),r}),{isClass:!0,isNode:!0});var Tp=r(3144);const Dp={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Fp={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},Op={abs:{1:"\\left|${args[0]}\\right|"},add:{2:`\\left(\${args[0]}${Fp.add}\${args[1]}\\right)`},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:`\\left(\${args[0]}${Fp.dotDivide}\${args[1]}\\right)`},dotMultiply:{2:`\\left(\${args[0]}${Fp.dotMultiply}\${args[1]}\\right)`},dotPow:{2:`\\left(\${args[0]}${Fp.dotPow}\${args[1]}\\right)`},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:`\\left(e${Fp.pow}{\${args[0]}}-1\\right)`,fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:`\\left(\${args[0]}${Fp.mod}\${args[1]}\\right)`},multiply:{2:`\\left(\${args[0]}${Fp.multiply}\${args[1]}\\right)`},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:`\\left(\${args[0]}\\right)${Fp.pow}{\${args[1]}}`},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:`\\left(\${args[0]}${Fp.subtract}\${args[1]}\\right)`},unaryMinus:{1:`${Fp.unaryMinus}\\left(\${args[0]}\\right)`},unaryPlus:{1:`${Fp.unaryPlus}\\left(\${args[0]}\\right)`},bitAnd:{2:`\\left(\${args[0]}${Fp.bitAnd}\${args[1]}\\right)`},bitNot:{1:Fp.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:`\\left(\${args[0]}${Fp.bitOr}\${args[1]}\\right)`},bitXor:{2:`\\left(\${args[0]}${Fp.bitXor}\${args[1]}\\right)`},leftShift:{2:`\\left(\${args[0]}${Fp.leftShift}\${args[1]}\\right)`},rightArithShift:{2:`\\left(\${args[0]}${Fp.rightArithShift}\${args[1]}\\right)`},rightLogShift:{2:`\\left(\${args[0]}${Fp.rightLogShift}\${args[1]}\\right)`},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:`\\left(\${args[0]}${Fp.and}\${args[1]}\\right)`},not:{1:Fp.not+"\\left(${args[0]}\\right)"},or:{2:`\\left(\${args[0]}${Fp.or}\${args[1]}\\right)`},xor:{2:`\\left(\${args[0]}${Fp.xor}\${args[1]}\\right)`},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:`\\left(\${args[0]}\\right)${Fp.ctranspose}`},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:`{\${args[0]}}${Fp.pow}{\\frac{1}{2}}`},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:`\\left(\${args[0]}\\right)${Fp.transpose}`},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:`\\left(\${args[0]}\\right)${Fp.factorial}`},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:`\\left(\${args[0]}${Fp.equal}\${args[1]}\\right)`},larger:{2:`\\left(\${args[0]}${Fp.larger}\${args[1]}\\right)`},largerEq:{2:`\\left(\${args[0]}${Fp.largerEq}\${args[1]}\\right)`},smaller:{2:`\\left(\${args[0]}${Fp.smaller}\${args[1]}\\right)`},smallerEq:{2:`\\left(\${args[0]}${Fp.smallerEq}\${args[1]}\\right)`},unequal:{2:`\\left(\${args[0]}${Fp.unequal}\${args[1]}\\right)`},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:`\\left(\${args[0]}${Fp.to}\${args[1]}\\right)`},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:`\\left(\\left(\${args[0]}\\right)+${Dp.i}\\cdot\\left(\${args[1]}\\right)\\right)`},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Bp={deg:"^\\circ"};function _p(e){return Tp(e,{preserveFormatting:!0})}function zp(e,t){return(t=void 0!==t&&t)?me(Bp,e)?Bp[e]:"\\mathrm{"+_p(e)+"}":me(Dp,e)?Dp[e]:_p(e)}const Ip="ConstantNode",kp=de(Ip,["Node"],(e=>{let{Node:t}=e;class r extends t{constructor(e){super(),this.value=e}get type(){return Ip}get isConstantNode(){return!0}_compile(e,t){const r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new r(this.value)}_toString(e){return Kr(this.value,e)}_toHTML(e){const t=this._toString(e);switch(oe(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+t+"";case"string":return''+t+"";case"boolean":return''+t+"";case"null":return''+t+"";case"undefined":return''+t+"";default:return''+t+""}}toJSON(){return{mathjs:Ip,value:this.value}}static fromJSON(e){return new r(e.value)}_toTex(e){const t=this._toString(e),r=oe(this.value);switch(r){case"string":return"\\mathtt{"+_p(t)+"}";case"number":case"BigNumber":{if(!("BigNumber"===r?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?"-\\infty":"\\infty";const e=t.toLowerCase().indexOf("e");return-1!==e?t.substring(0,e)+"\\cdot10^{"+t.substring(e+1)+"}":t}case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return lp(r,"name",Ip),r}),{isClass:!0,isNode:!0}),qp="FunctionAssignmentNode",Rp=de(qp,["typed","Node"],(e=>{let{typed:t,Node:r}=e;function n(e,t,r){const n=bp(e,t,r),i=bp(e.expr,t,r);return"all"===t||null!==i&&i<=n}class i extends r{constructor(e,t,r){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!X(r))throw new TypeError('Node expected for parameter "expr"');if(sp.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');const n=new Set;for(const e of t){const t="string"==typeof e?e:e.name;if(n.has(t))throw new Error(`Duplicate parameter name "${t}"`);n.add(t)}this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=r}get type(){return qp}get isFunctionAssignmentNode(){return!0}_compile(e,r){const n=Object.create(r);Sn(this.params,(function(e){n[e]=!0}));const i=this.expr._compile(e,n),o=this.name,a=this.params,s=Cn(this.types,","),u=o+"("+Cn(this.params,", ")+")";return function(e,r,n){const c={};c[s]=function(){const t=Object.create(r);for(let e=0;e'+rn(this.params[e])+"");let i=this.expr.toHTML(e);return n(this,t,e&&e.implicit)&&(i='('+i+')'),''+rn(this.name)+'('+r.join(',')+')='+i}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep";let r=this.expr.toTex(e);return n(this,t,e&&e.implicit)&&(r=`\\left(${r}\\right)`),"\\mathrm{"+this.name+"}\\left("+this.params.map(zp).join(",")+"\\right)="+r}}return lp(i,"name",qp),i}),{isClass:!0,isNode:!0}),Pp="IndexNode",jp=de(Pp,["Node","size"],(e=>{let{Node:t,size:r}=e;class n extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(X))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Pp}get isIndexNode(){return!0}_compile(e,t){const n=An(this.dimensions,(function(n,i){if(n.filter((e=>e.isSymbolNode&&"end"===e.name)).length>0){const o=Object.create(t);o.end=!0;const a=n._compile(e,o);return function(e,t,n){if(!E(n)&&!N(n)&&!w(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+oe(n));const o=r(n).valueOf(),s=Object.create(t);return s.end=o[i],a(e,s,n)}}return n._compile(e,t)})),o=i(e,"index");return function(e,t,r){const i=An(n,(function(n){return n(e,t,r)}));return o(...i)}}forEach(e){for(let t=0;t.'+rn(this.getObjectProperty())+"":'['+t.join(',')+']'}_toTex(e){const t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}return lp(n,"name",Pp),n}),{isClass:!0,isNode:!0}),Up="ObjectNode",Lp=de(Up,["Node"],(e=>{let{Node:t}=e;class r extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(t){return X(e[t])}))))throw new TypeError("Object containing Nodes expected")}get type(){return Up}get isObjectNode(){return!0}_compile(e,t){const r={};for(const n in this.properties)if(me(this.properties,n)){const o=en(n),a=JSON.parse(o),s=i(this.properties,n);r[a]=s._compile(e,t)}return function(e,t,n){const i={};for(const o in r)me(r,o)&&(i[o]=r[o](e,t,n));return i}}forEach(e){for(const t in this.properties)me(this.properties,t)&&e(this.properties[t],"properties["+en(t)+"]",this)}map(e){const t={};for(const r in this.properties)me(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+en(r)+"]",this)));return new r(t)}clone(){const e={};for(const t in this.properties)me(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}_toString(e){const t=[];for(const r in this.properties)me(this.properties,r)&&t.push(en(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:Up,properties:this.properties}}static fromJSON(e){return new r(e.properties)}_toHTML(e){const t=[];for(const r in this.properties)me(this.properties,r)&&t.push(''+rn(r)+':'+this.properties[r].toHTML(e));return'{'+t.join(',')+'}'}_toTex(e){const t=[];for(const r in this.properties)me(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return lp(r,"name",Up),r}),{isClass:!0,isNode:!0});function $p(e,t){return new f(e,new l(t),new Set(Object.keys(t)))}const Hp="OperatorNode",Gp=de(Hp,["Node"],(e=>{let{Node:t}=e;function r(e,t){let n=e;if("auto"===t)for(;ee(n);)n=n.content;return!!Z(n)||!!K(n)&&r(n.args[0],t)}function n(e,t,n,i,o){const a=bp(e,t,n),s=vp(e,t);if("all"===t||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));let u;switch(i.length){case 0:u=[];break;case 1:{const r=bp(i[0],t,n,e);if(o&&null!==r){let n,o;if("keep"===t?(n=i[0].getIdentifier(),o=e.getIdentifier()):(n=i[0].getContent().getIdentifier(),o=e.getContent().getIdentifier()),!1===yp[a][o].latexLeftParens){u=[!1];break}if(!1===yp[r][n].latexParens){u=[!1];break}}if(null===r){u=[!1];break}if(r<=a){u=[!0];break}u=[!1]}break;case 2:{let r;const c=bp(i[0],t,n,e),l=wp(e,i[0],t);let f;r=null!==c&&(c===a&&"right"===s&&!l||c=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===n)for(let e=1;e2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){const t=i.map((function(t,r){return t=t.toString(e),o[r]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t.join(" "):t.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Hp,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new o(e.op,e.fn,e.args,e.implicit,e.isPercentage)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,o=n(this,t,r,i,!1);if(1===i.length){const r=vp(this,t);let n=i[0].toHTML(e);return o[0]&&(n='('+n+')'),"right"===r?''+rn(this.op)+""+n:n+''+rn(this.op)+""}if(2===i.length){let t=i[0].toHTML(e),n=i[1].toHTML(e);return o[0]&&(t='('+t+')'),o[1]&&(n='('+n+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t+''+n:t+''+rn(this.op)+""+n}{const t=i.map((function(t,r){return t=t.toHTML(e),o[r]&&(t='('+t+')'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t.join(''):t.join(''+rn(this.op)+""):''+rn(this.fn)+'('+t.join(',')+')'}}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,o=n(this,t,r,i,!0);let a=Fp[this.fn];if(a=void 0===a?this.op:a,1===i.length){const r=vp(this,t);let n=i[0].toTex(e);return o[0]&&(n=`\\left(${n}\\right)`),"right"===r?a+n:n+a}if(2===i.length){const n=i[0];let s=n.toTex(e);o[0]&&(s=`\\left(${s}\\right)`);let u,c=i[1].toTex(e);switch(o[1]&&(c=`\\left(${c}\\right)`),u="keep"===t?n.getIdentifier():n.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return a+"{"+s+"}{"+c+"}";case"OperatorNode:pow":switch(s="{"+s+"}",c="{"+c+"}",u){case"ConditionalNode":case"OperatorNode:divide":s=`\\left(${s}\\right)`}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===r)return s+"~"+c}return s+a+c}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){const t=i.map((function(t,r){return t=t.toTex(e),o[r]&&(t=`\\left(${t}\\right)`),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===r?t.join("~"):t.join(a)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return lp(o,"name",Hp),o}),{isClass:!0,isNode:!0}),Zp="ParenthesisNode",Vp=de(Zp,["Node"],(e=>{let{Node:t}=e;class r extends t{constructor(e){if(super(),!X(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return Zp}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,"content",this)}map(e){const t=e(this.content,"content",this);return new r(t)}clone(){return new r(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:Zp,content:this.content}}static fromJSON(e){return new r(e.content)}_toHTML(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?`\\left(${this.content.toTex(e)}\\right)`:this.content.toTex(e)}}return lp(r,"name",Zp),r}),{isClass:!0,isNode:!0}),Wp="RangeNode",Yp=de(Wp,["Node"],(e=>{let{Node:t}=e;function r(e,t,r){const n=bp(e,t,r),i={},o=bp(e.start,t,r);if(i.start=null!==o&&o<=n||"all"===t,e.step){const o=bp(e.step,t,r);i.step=null!==o&&o<=n||"all"===t}const a=bp(e.end,t,r);return i.end=null!==a&&a<=n||"all"===t,i}class n extends t{constructor(e,t,r){if(super(),!X(e))throw new TypeError("Node expected");if(!X(t))throw new TypeError("Node expected");if(r&&!X(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}get type(){return Wp}get isRangeNode(){return!0}needsEnd(){return this.filter((function(e){return ne(e)&&"end"===e.name})).length>0}_compile(e,t){const r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){const o=this.step._compile(e,t);return function(e,t,a){return r(n(e,t,a),i(e,t,a),o(e,t,a))}}return function(e,t,o){return r(n(e,t,o),i(e,t,o))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n,i=this.start.toString(e);if(t.start&&(i="("+i+")"),n=i,this.step){let r=this.step.toString(e);t.step&&(r="("+r+")"),n+=":"+r}let o=this.end.toString(e);return t.end&&(o="("+o+")"),n+=":"+o,n}toJSON(){return{mathjs:Wp,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new n(e.start,e.end,e.step)}_toHTML(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n,i=this.start.toHTML(e);if(t.start&&(i='('+i+')'),n=i,this.step){let r=this.step.toHTML(e);t.step&&(r='('+r+')'),n+=':'+r}let o=this.end.toHTML(e);return t.end&&(o='('+o+')'),n+=':'+o,n}_toTex(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n=this.start.toTex(e);if(t.start&&(n=`\\left(${n}\\right)`),this.step){let r=this.step.toTex(e);t.step&&(r=`\\left(${r}\\right)`),n+=":"+r}let i=this.end.toTex(e);return t.end&&(i=`\\left(${i}\\right)`),n+=":"+i,n}}return lp(n,"name",Wp),n}),{isClass:!0,isNode:!0}),Jp="RelationalNode",Xp=de(Jp,["Node"],(e=>{let{Node:t}=e;const r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return Jp}get isRelationalNode(){return!0}_compile(e,t){const r=this,n=this.params.map((r=>r._compile(e,t)));return function(t,o,a){let s,u=n[0](t,o,a);for(let c=0;ce(t,"params["+r+"]",this)),this)}map(e){return new n(this.conditionals.slice(),this.params.map(((t,r)=>this._ifNode(e(t,"params["+r+"]",this))),this))}clone(){return new n(this.conditionals,this.params)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=bp(this,t,e&&e.implicit),i=this.params.map((function(r,i){const o=bp(r,t,e&&e.implicit);return"all"===t||null!==o&&o<=n?"("+r.toString(e)+")":r.toString(e)}));let o=i[0];for(let e=0;e('+r.toHTML(e)+')':r.toHTML(e)}));let o=i[0];for(let e=0;e'+rn(r[this.conditionals[e]])+""+i[e+1];return o}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=bp(this,t,e&&e.implicit),n=this.params.map((function(n,i){const o=bp(n,t,e&&e.implicit);return"all"===t||null!==o&&o<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)}));let i=n[0];for(let e=0;e{let{math:t,Unit:r,Node:n}=e;function o(e){return!!r&&r.isValuelessUnit(e)}class a extends n{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){const n=this.name;if(!0===t[n])return function(e,t,r){return i(t,n)};if(n in e)return function(t,r,o){return t.has(n)?t.get(n):i(e,n)};{const e=o(n);return function(t,i,o){return t.has(n)?t.get(n):e?new r(null,n):a.onUndefinedSymbol(n)}}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new a(this.name)}_toString(e){return this.name}_toHTML(e){const t=rn(this.name);return"true"===t||"false"===t?''+t+"":"i"===t?''+t+"":"Infinity"===t?''+t+"":"NaN"===t?''+t+"":"null"===t?''+t+"":"undefined"===t?''+t+"":''+t+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){let r=!1;void 0===t[this.name]&&o(this.name)&&(r=!0);const n=zp(this.name,r);return"\\"===n[0]?n:" "+n}}return a}),{isClass:!0,isNode:!0}),Kp="FunctionNode",em=de(Kp,["math","Node","SymbolNode"],(e=>{var t;let{math:r,Node:n,SymbolNode:o}=e;const a=e=>Kr(e,{truncate:78});function u(e,t,r){let n="";const i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi;let o,a=0;for(;null!==(o=i.exec(e));)if(n+=e.substring(a,o.index),a=o.index,"$$"===o[0])n+="$",a++;else{a+=o[0].length;const e=t[o[1]];if(!e)throw new ReferenceError("Template: Property "+o[1]+" does not exist.");if(void 0===o[2])switch(typeof e){case"string":n+=e;break;case"object":if(X(e))n+=e.toTex(r);else{if(!Array.isArray(e))throw new TypeError("Template: "+o[1]+" has to be a Node, String or array of Nodes");n+=e.map((function(e,t){if(X(e))return e.toTex(r);throw new TypeError("Template: "+o[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+o[1]+" has to be a Node, String or array of Nodes")}else{if(!X(e[o[2]]&&e[o[2]]))throw new TypeError("Template: "+o[1]+"["+o[2]+"] is not a Node.");n+=e[o[2]].toTex(r)}}return n+=e.slice(a),n}class c extends n{constructor(e,t){if(super(),"string"==typeof e&&(e=new o(e)),!X(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(X))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||""}get type(){return Kp}get isFunctionNode(){return!0}_compile(e,t){const r=this.args.map((r=>r._compile(e,t)));if(!ne(this.fn)){if(U(this.fn)&&J(this.fn.index)&&this.fn.index.isObjectProperty()){const n=this.fn.object._compile(e,t),i=this.fn.index.getObjectProperty(),o=this.args;return function(t,a,u){const c=n(t,a,u),l=function(e,t){if(!s(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(c,i);if(null!=l&&l.rawArgs)return l(o,e,$p(t,a));{const e=r.map((e=>e(t,a,u)));return l.apply(c,e)}}}{const n=this.fn.toString(),i=this.fn._compile(e,t),o=this.args;return function(t,s,u){const c=i(t,s,u);if("function"!=typeof c)throw new TypeError(`Expression '${n}' did not evaluate to a function; value is:\n ${a(c)}`);if(c.rawArgs)return c(o,e,$p(t,s));{const e=r.map((e=>e(t,s,u)));return c.apply(c,e)}}}}{const n=this.fn.name;if(t[n]){const t=this.args;return function(o,s,u){const c=i(s,n);if("function"!=typeof c)throw new TypeError(`Argument '${n}' was not a function; received: ${a(c)}`);if(c.rawArgs)return c(t,e,$p(o,s));{const e=r.map((e=>e(o,s,u)));return c.apply(c,e)}}}{const t=n in e?i(e,n):void 0,o="function"==typeof t&&!0===t.rawArgs,s=t=>{let r;if(t.has(n))r=t.get(n);else{if(!(n in e))return c.onUndefinedFunction(n);r=i(e,n)}if("function"==typeof r)return r;throw new TypeError(`'${n}' is not a function; its value is:\n ${a(r)}`)};if(o){const t=this.args;return function(n,i,o){const a=s(n);return!0===a.rawArgs?a(t,e,$p(n,i)):a(...r.map((e=>e(n,i,o))))}}switch(r.length){case 0:return function(e,t,r){return s(e)()};case 1:return function(e,t,n){return s(e)((0,r[0])(e,t,n))};case 2:return function(e,t,n){const i=s(e),o=r[0],a=r[1];return i(o(e,t,n),a(e,t,n))};default:return function(e,t,n){return s(e)(...r.map((r=>r(e,t,n))))}}}}}forEach(e){e(this.fn,"fn",this);for(let t=0;t'+rn(this.fn)+'('+t.join(',')+')'}toTex(e){let t;return e&&"object"==typeof e.handler&&me(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:super.toTex(e)}_toTex(e){const t=this.args.map((function(t){return t.toTex(e)}));let n,i;switch(Op[this.name]&&(n=Op[this.name]),!r[this.name]||"function"!=typeof r[this.name].toTex&&"object"!=typeof r[this.name].toTex&&"string"!=typeof r[this.name].toTex||(n=r[this.name].toTex),typeof n){case"function":i=n(this,e);break;case"string":i=u(n,this,e);break;case"object":switch(typeof n[t.length]){case"function":i=n[t.length](this,e);break;case"string":i=u(n[t.length],this,e)}}return void 0!==i?i:u("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return t=c,lp(c,"name",Kp),lp(c,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),lp(c,"fromJSON",(function(e){return new t(e.fn,e.args)})),c}),{isClass:!0,isNode:!0}),tm="parse",rm=de(tm,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(e=>{let{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:o,AssignmentNode:a,BlockNode:s,ConditionalNode:u,ConstantNode:c,FunctionAssignmentNode:l,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:d,ParenthesisNode:h,RangeNode:g,RelationalNode:y,SymbolNode:x}=e;const b=t(tm,{string:function(e){return k(e,{})},"Array | Matrix":function(e){return v(e,{})},"string, Object":function(e,t){return k(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":v});function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=void 0!==t.nodes?t.nodes:{};return Zn(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return k(e,r)}))}const w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},E={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},S=["NaN","Infinity"],M={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function C(e,t){return e.expression.substr(e.index,t)}function T(e){return C(e,1)}function D(e){e.index++}function F(e){return e.expression.charAt(e.index-1)}function O(e){return e.expression.charAt(e.index+1)}function B(e){for(e.tokenType=w.NULL,e.token="",e.comment="";;){if("#"===T(e))for(;"\n"!==T(e)&&""!==T(e);)e.comment+=T(e),D(e);if(!b.isWhitespace(T(e),e.nestingLevel))break;D(e)}if(""===T(e))return void(e.tokenType=w.DELIMITER);if("\n"===T(e)&&!e.nestingLevel)return e.tokenType=w.DELIMITER,e.token=T(e),void D(e);const t=T(e),r=C(e,2),n=C(e,3);if(3===n.length&&N[n])return e.tokenType=w.DELIMITER,e.token=n,D(e),D(e),void D(e);if(2===r.length&&N[r])return e.tokenType=w.DELIMITER,e.token=r,D(e),void D(e);if(N[t])return e.tokenType=w.DELIMITER,e.token=t,void D(e);if(b.isDigitDot(t)){e.tokenType=w.NUMBER;const t=C(e,2);if("0b"===t||"0o"===t||"0x"===t){for(e.token+=T(e),D(e),e.token+=T(e),D(e);b.isHexDigit(T(e));)e.token+=T(e),D(e);if("."===T(e))for(e.token+=".",D(e);b.isHexDigit(T(e));)e.token+=T(e),D(e);else if("i"===T(e))for(e.token+="i",D(e);b.isDigit(T(e));)e.token+=T(e),D(e);return}if("."===T(e)){if(e.token+=T(e),D(e),!b.isDigit(T(e)))return void(e.tokenType=w.DELIMITER)}else{for(;b.isDigit(T(e));)e.token+=T(e),D(e);b.isDecimalMark(T(e),O(e))&&(e.token+=T(e),D(e))}for(;b.isDigit(T(e));)e.token+=T(e),D(e);if("E"===T(e)||"e"===T(e))if(b.isDigit(O(e))||"-"===O(e)||"+"===O(e)){if(e.token+=T(e),D(e),"+"!==T(e)&&"-"!==T(e)||(e.token+=T(e),D(e)),!b.isDigit(T(e)))throw ce(e,'Digit expected, got "'+T(e)+'"');for(;b.isDigit(T(e));)e.token+=T(e),D(e);if(b.isDecimalMark(T(e),O(e)))throw ce(e,'Digit expected, got "'+T(e)+'"')}else if("."===O(e))throw D(e),ce(e,'Digit expected, got "'+T(e)+'"')}else{if(!b.isAlpha(T(e),F(e),O(e))){for(e.tokenType=w.UNKNOWN;""!==T(e);)e.token+=T(e),D(e);throw ce(e,'Syntax error in part "'+e.token+'"')}for(;b.isAlpha(T(e),F(e),O(e))||b.isDigit(T(e));)e.token+=T(e),D(e);me(E,e.token)?e.tokenType=w.DELIMITER:e.tokenType=w.SYMBOL}}function _(e){do{B(e)}while("\n"===e.token)}function z(e){e.nestingLevel++}function I(e){e.nestingLevel--}function k(e,t){const r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null};Wr(r,{expression:e,extraNodes:t}),B(r);const n=function(e){let t;const r=[];let n;for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=q(e),e.comment&&(t.comment=e.comment));"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),B(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=q(e),e.comment&&(t.comment=e.comment),n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new s(r):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)throw r.tokenType===w.DELIMITER?le(r,"Unexpected operator "+r.token):ce(r,'Unexpected part "'+r.token+'"');return n}function q(e){let t,r,n,i;const o=function(e){let t=function(e){let t=R(e);for(;"or"===e.token;)_(e),t=new d("or","or",[t,R(e)]);return t}(e);for(;"?"===e.token;){const r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,_(e);const n=t,i=q(e);if(":"!==e.token)throw ce(e,"False part of conditional expression expected");e.conditionalLevel=null,_(e);const o=q(e);t=new u(n,i,o),e.conditionalLevel=r}return t}(e);if("="===e.token){if(ne(o))return t=o.name,_(e),n=q(e),new a(new x(t),n);if(U(o))return _(e),n=q(e),new a(o.object,o.index,n);if(Y(o)&&ne(o.fn)&&(i=!0,r=[],t=o.name,o.args.forEach((function(e,t){ne(e)?r[t]=e.name:i=!1})),i))return _(e),n=q(e),new l(t,r,n);throw ce(e,"Invalid left hand side of assignment operator =")}return o}function R(e){let t=P(e);for(;"xor"===e.token;)_(e),t=new d("xor","xor",[t,P(e)]);return t}function P(e){let t=j(e);for(;"and"===e.token;)_(e),t=new d("and","and",[t,j(e)]);return t}function j(e){let t=L(e);for(;"|"===e.token;)_(e),t=new d("|","bitOr",[t,L(e)]);return t}function L(e){let t=$(e);for(;"^|"===e.token;)_(e),t=new d("^|","bitXor",[t,$(e)]);return t}function $(e){let t=H(e);for(;"&"===e.token;)_(e),t=new d("&","bitAnd",[t,H(e)]);return t}function H(e){const t=[G(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};for(;me(n,e.token);){const i={name:e.token,fn:n[e.token]};r.push(i),_(e),t.push(G(e))}return 1===t.length?t[0]:2===t.length?new d(r[0].name,r[0].fn,t):new y(r.map((e=>e.fn)),t)}function G(e){let t,r,n,i;t=W(e);const o={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};for(;me(o,e.token);)r=e.token,n=o[r],_(e),i=[t,W(e)],t=new d(r,n,i);return t}function W(e){let t,r,n,i;t=J(e);const o={to:"to",in:"to"};for(;me(o,e.token);)r=e.token,n=o[r],_(e),"in"===r&&""===e.token?t=new d("*","multiply",[t,new x("in")],!0):(i=[t,J(e)],t=new d(r,n,i));return t}function J(e){let t;const r=[];if(t=":"===e.token?new c(1):X(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)_(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new x("end")):r.push(X(e));t=3===r.length?new g(r[0],r[2],r[1]):new g(r[0],r[1])}return t}function X(e){let t,r,n,i;t=Q(e);const o={"+":"add","-":"subtract"};for(;me(o,e.token);){r=e.token,n=o[r],_(e);const a=Q(e);i=a.isPercentage?[t,new d("*","multiply",[t,a])]:[t,a],t=new d(r,n,i)}return t}function Q(e){let t,r,n,i;t=ee(e),r=t;const o={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};for(;me(o,e.token);)n=e.token,i=o[n],_(e),r=ee(e),t=new d(n,i,[t,r]);return t}function ee(e){let t,r;for(t=te(e),r=t;e.tokenType===w.SYMBOL||"in"===e.token&&Z(t)||"in"===e.token&&K(t)&&"unaryMinus"===t.fn&&Z(t.args[0])||!(e.tokenType!==w.NUMBER||Z(r)||K(r)&&"!"!==r.op)||"("===e.token;)r=te(e),t=new d("*","multiply",[t,r],!0);return t}function te(e){let t=re(e),r=t;const n=[];for(;"/"===e.token&&V(r);){if(n.push(Wr({},e)),_(e),e.tokenType!==w.NUMBER){Wr(e,n.pop());break}if(n.push(Wr({},e)),_(e),e.tokenType!==w.SYMBOL&&"("!==e.token){n.pop(),Wr(e,n.pop());break}Wr(e,n.pop()),n.pop(),r=re(e),t=new d("/","divide",[t,r])}return t}function re(e){let t,r,n,i;t=ie(e);const o={"%":"mod",mod:"mod"};for(;me(o,e.token);)r=e.token,n=o[r],_(e),"%"===r&&e.tokenType===w.DELIMITER&&"("!==e.token?t=new d("/","divide",[t,new c(100)],!1,!0):(i=[t,ie(e)],t=new d(r,n,i));return t}function ie(e){let t,i,a;const s={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return me(s,e.token)?(a=s[e.token],t=e.token,_(e),i=[ie(e)],new d(t,a,i)):function(e){let t,i,a,s;return t=function(e){let t,i,a,s;t=function(e){let t=[];if(e.tokenType===w.SYMBOL&&me(e.extraNodes,e.token)){const r=e.extraNodes[e.token];if(B(e),"("===e.token){if(t=[],z(e),B(e),")"!==e.token)for(t.push(q(e));","===e.token;)B(e),t.push(q(e));if(")"!==e.token)throw ce(e,"Parenthesis ) expected");I(e),B(e)}return new r(t)}return function(e){let t,i;return e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in E?(i=e.token,B(e),t=me(A,i)?new c(A[i]):S.includes(i)?new c(r(i,"number")):new x(i),t=oe(e,t),t):function(e){let t,i;return'"'===e.token||"'"===e.token?(i=ae(e,e.token),t=new c(i),t=oe(e,t),t):function(e){let t,i,a,s;if("["===e.token){if(z(e),B(e),"]"!==e.token){const r=se(e);if(";"===e.token){for(a=1,i=[r];";"===e.token;)B(e),"]"!==e.token&&(i[a]=se(e),a++);if("]"!==e.token)throw ce(e,"End of matrix ] expected");I(e),B(e),s=i[0].items.length;for(let t=1;t0},b.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},b.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},b.isDigit=function(e){return e>="0"&&e<="9"},b.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:b}),b})),nm="compile",im=de(nm,["typed","parse"],(e=>{let{typed:t,parse:r}=e;return t(nm,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return Zn(e,(function(e){return r(e).compile()}))}})})),om="evaluate",am=de(om,["typed","parse"],(e=>{let{typed:t,parse:r}=e;return t(om,{string:function(e){const t=m();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){const t=m();return Zn(e,(function(e){return r(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return Zn(e,(function(e){return r(e).compile().evaluate(t)}))}})})),sm=de("Parser",["evaluate"],(e=>{let{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:m(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(e){return t(e,this.scope)},r.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},r.prototype.getAll=function(){return function(e){if(e instanceof l)return e.wrappedObject;const t={};for(const r of e.keys())o(t,r,e.get(r));return t}(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r}),{isClass:!0}),um="parser",cm=de(um,["typed","Parser"],(e=>{let{typed:t,Parser:r}=e;return t(um,{"":function(){return new r}})})),lm=de("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(e=>{let{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:o,multiplyScalar:a,subtractScalar:s,larger:u,equalScalar:c,unaryMinus:l,DenseMatrix:f,SparseMatrix:p,Spa:m}=e;return t("lup",{DenseMatrix:function(e){return d(e)},SparseMatrix:function(e){return function(e){const t=e._size[0],r=e._size[1],i=Math.min(t,r),s=e._values,f=e._index,d=e._ptr,h=[],g=[],y=[],x=[t,i],b=[],v=[],w=[],N=[i,r];let E,A,S;const M=[],C=[];for(E=0;E0&&e.forEach(0,A-1,(function(t,r){p._forEachRow(t,h,g,y,(function(n,i){n>t&&e.accumulate(n,l(a(i,r)))}))}));let C=A,D=e.get(A),F=n(D);e.forEach(A+1,t-1,(function(e,t){const r=n(t);u(r,F)&&(C=e,F=r,D=t)})),A!==C&&(p._swapRows(A,C,x[1],h,g,y),p._swapRows(A,C,N[1],b,v,w),e.swap(A,C),T(A,C)),e.forEach(0,t-1,(function(e,t){e<=A?(b.push(t),v.push(e)):(t=o(t,D),c(t,0)||(h.push(t),g.push(e)))}))}return w.push(b.length),y.push(h.length),{L:new p({values:h,index:g,ptr:y,size:x}),U:new p({values:b,index:v,ptr:w,size:N}),p:M,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){const t=d(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function d(e){const t=e._size[0],r=e._size[1];let l=Math.min(t,r);const p=ae(e._data),m=[],d=[t,l],h=[],g=[l,r];let y,x,b;const v=[];for(y=0;y0)for(y=0;y{let{typed:t,matrix:r,zeros:n,identity:i,isZero:o,equal:a,sign:s,sqrt:u,conj:c,unaryMinus:l,addScalar:f,divideScalar:p,multiplyScalar:m,subtractScalar:d,complex:h}=e;return Wr(t("qr",{DenseMatrix:function(e){return y(e)},SparseMatrix:function(e){return function(){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){const t=y(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:g});function g(e){const t=e._size[0],r=e._size[1],h=i([t],"dense"),g=h._data,y=e.clone(),x=y._data;let b,v,w;const N=n([t],"");for(w=0;w0){const e="Complex"===r[0][0].type?h(0):0;for(let t=0;t=0;){const e=r[a+s],u=r[n+e];-1===u?(s--,o[t++]=e):(r[n+e]=r[i+u],++s,r[a+s]=u)}return t}function mm(e){return-e-2}const dm=de("csAmd",["add","multiply","transpose"],(e=>{let{add:t,multiply:r,transpose:n}=e;return function(e,a){if(!a||e<=0||e>3)return null;const s=a._size,u=s[0],c=s[1];let l=0,f=Math.max(16,10*Math.sqrt(c));f=Math.min(c-2,f);const p=function(e,i,o,a,s){const u=n(i);if(1===e&&a===o)return t(i,u);if(2===e){const e=u._index,t=u._ptr;let a=0;for(let r=0;rs))for(const i=t[r+1];na)r[s+p]=0,r[i+p]=-1,f++,t[p]=mm(e),r[s+e]++;else{const e=r[u+m];-1!==e&&(c[e]=p),r[l+p]=r[u+m],r[u+m]=p}}return f}(c,d,y,N,w,E,f,x,v,S,b),H=0;for(;$e?(O=T,B=n,_=y[0+T]-e):(O=m[n++],B=d[O],_=y[0+O]),F=1;F<=_;F++)M=m[B++],(z=y[x+M])<=0||(r+=z,y[x+M]=-z,m[a++]=M,-1!==y[b+M]&&(S[y[b+M]]=S[M]),-1!==S[M]?y[b+S[M]]=y[b+M]:y[v+y[N+M]]=y[b+M]);O!==T&&(d[O]=mm(T),y[E+O]=0)}for(0!==e&&(h=a),y[N+T]=r,d[T]=o,y[0+T]=a-o,y[w+T]=-2,L=i(L,l,y,E,c),I=o;I=L?y[E+O]-=z:0!==y[E+O]&&(y[E+O]=y[N+O]+e)}for(I=o;I0?(U+=e,m[P++]=O,j+=O):(d[O]=mm(T),y[E+O]=0)}y[w+M]=P-q+1;const e=P,i=q+y[0+M];for(n=R+1;n=0))for(j=S[M],M=y[A+j],y[A+j]=-1;-1!==M&&-1!==y[b+M];M=y[b+M],L++){for(_=y[0+M],k=y[w+M],n=d[M]+1;n<=d[M]+_-1;n++)y[E+m[n]]=L;let e=M;for(C=y[b+M];-1!==C;){let t=y[0+C]===_&&y[w+C]===k;for(n=d[C]+1;t&&n<=d[C]+_-1;n++)y[E+m[n]]!==L&&(t=0);t?(d[C]=mm(M),y[x+M]+=y[x+C],y[x+C]=0,y[w+C]=-1,C=y[b+C],y[b+e]=C):(e=C,C=y[b+C])}}for(n=o,I=o;I=0;C--)y[x+C]>0||(y[b+C]=y[v+d[C]],y[v+d[C]]=C);for(O=c;O>=0;O--)y[x+O]<=0||-1!==d[O]&&(y[b+O]=y[v+d[O]],y[v+d[O]]=O);for(T=0,M=0;M<=c;M++)-1===d[M]&&(T=pm(M,T,y,v,b,g,E));return g.splice(g.length-1,1),g};function i(e,t,r,n,i){if(e<2||e+t<0){for(let e=0;e{let{transpose:t}=e;return function(e,r,n,i){if(!e||!r||!n)return null;const o=e._size,a=o[0],s=o[1];let u,c,l,f,p,m,d;const h=4*s+(i?s+a+1:0),g=[],y=s,x=2*s,b=3*s,v=4*s,w=5*s+1;for(l=0;l=1&&N[c]++,2===e.jleaf&&N[e.q]--}-1!==r[c]&&(g[0+c]=r[c])}for(c=0;c{let{add:t,multiply:r,transpose:n}=e;const i=dm({add:t,multiply:r,transpose:n}),o=gm({transpose:n});return function(e,t,r){const n=t._ptr,a=t._size[1];let s;const u={};if(u.q=i(e,t),e&&!u.q)return null;if(r){const r=e?function(e,t,r){const n=e._values,i=e._index,o=e._ptr,a=e._size,s=e._datatype,u=a[0],c=a[1],l=null,f=[],p=[];let m=0;for(let e=0;e=0;r--)-1!==e[r]&&(o[a+r]=o[0+e[r]],o[0+e[r]]=r);for(r=0;r=0;h--)for(y=r[h],x=r[h+1],g=y;g=0;d--)u[d]=-1,h=c[d],-1!==h&&(0==l[m+h]++&&(l[p+h]=d),l[0+d]=l[f+h],l[f+h]=d);for(t.lnz=0,t.m2=o,h=0;h=0;){e=n[f];const t=i?i[e]:e;xm(a,e)||(bm(a,e),n[s+f]=t<0?0:vm(a[t]));let p=1;for(c=n[s+f],l=t<0?0:vm(a[t+1]);c{let{divideScalar:t,multiply:r,subtract:n}=e;return function(e,i,o,a,s,u,c){const l=e._values,f=e._index,p=e._ptr,m=e._size[1],d=i._values,h=i._index,g=i._ptr;let y,x,b,v;const w=function(e,t,r,n,i){const o=e._ptr,a=e._size,s=t._index,u=t._ptr,c=a[1];let l,f,p,m=c;for(f=u[r],p=u[r+1],l=f;l{let{abs:t,divideScalar:r,multiply:n,subtract:i,larger:o,largerEq:a,SparseMatrix:s}=e;const u=Nm({divideScalar:r,multiply:n,subtract:i});return function(e,i,c){if(!e)return null;const l=e._size[1];let f,p=100,m=100;i&&(f=i.q,p=i.lnz||p,m=i.unz||m);const d=[],h=[],g=[],y=new s({values:d,index:h,ptr:g,size:[l,l]}),x=[],b=[],v=[],w=new s({values:x,index:b,ptr:v,size:[l,l]}),N=[];let E,A;const S=[],M=[];for(E=0;E{let{typed:t,abs:r,add:n,multiply:i,transpose:o,divideScalar:a,subtract:s,larger:u,largerEq:c,SparseMatrix:l}=e;const f=ym({add:n,multiply:i,transpose:o}),p=Em({abs:r,divideScalar:a,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:l});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!ye(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");const n=f(t,e,!1),i=p(e,n,r);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function Sm(e,t){let r;const n=t.length,i=[];if(e)for(r=0;r{let{typed:t,matrix:r,lup:n,slu:i,usolve:o,lsolve:a,DenseMatrix:s}=e;const u=ac({DenseMatrix:s});return t(Mm,{"Array, Array | Matrix":function(e,t){e=r(e);const i=n(e);return l(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){const r=n(e);return l(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){const r=n(e);return l(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){const o=i(e,r,n);return l(o.L,o.U,o.p,o.q,t)},"Object, Array | Matrix":function(e,t){return l(e.L,e.U,e.p,e.q,t)}});function c(e){if(E(e))return e;if(N(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function l(e,t,r,n,i){e=c(e),t=c(t),r&&((i=u(e,i,!0))._data=Sm(r,i._data));const s=a(e,i),l=o(t,s);return n&&(l._data=Sm(n,l._data)),l}})),Tm="polynomialRoot",Dm=de(Tm,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],(e=>{let{typed:t,isZero:r,equalScalar:n,add:i,subtract:o,multiply:a,divide:s,sqrt:u,unaryMinus:c,cbrt:l,typeOf:f,im:p,re:m}=e;return t(Tm,{"number|Complex, ...number|Complex":(e,t)=>{const d=[e,...t];for(;d.length>0&&r(d[d.length-1]);)d.pop();if(d.length<2)throw new RangeError(`Polynomial [${e}, ${t}] must have a non-zero non-constant coefficient`);switch(d.length){case 2:return[c(s(d[0],d[1]))];case 3:{const[e,t,r]=d,i=a(2,r),l=a(t,t),f=a(4,r,e);if(n(l,f))return[s(c(t),i)];const p=u(o(l,f));return[s(o(p,t),i),s(o(c(p),t),i)]}case 4:{const[e,t,r,h]=d,g=c(a(3,h)),y=a(r,r),x=a(3,h,t),b=i(a(2,r,r,r),a(27,h,h,e)),v=a(9,h,r,t);if(n(y,x)&&n(b,v))return[s(r,g)];const w=o(y,x),N=o(b,v),E=i(a(18,h,r,t,e),a(r,r,t,t)),A=i(a(4,r,r,r,e),a(4,h,t,t,t),a(27,h,h,e,e));if(n(E,A))return[s(o(a(4,h,r,t),i(a(9,h,h,e),a(r,r,r))),a(h,w)),s(o(a(9,h,e),a(r,t)),a(2,w))];let S;return S=n(y,x)?N:s(i(N,u(o(a(N,N),a(4,w,w,w)))),2),l(S,!0).toArray().map((e=>s(i(r,e,s(w,e)),g))).map((e=>"Complex"===f(e)&&n(m(e),m(e)+p(e))?m(e):e))}default:throw new RangeError(`only implemented for cubic or lower-order polynomials, not ${d}`)}}})}));r(9463);const Fm=de("Help",["evaluate"],(e=>{let{evaluate:t}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){const e=this.doc||{};let r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){r+="Examples:\n";let n=!1;const i=t("config()"),o={config:e=>(n=!0,t("config(newConfig)",{newConfig:e}))};for(let n=0;n"mathjs"!==e)).forEach((r=>{t[r]=e[r]})),new r(t)},r.prototype.valueOf=r.prototype.toString,r}),{isClass:!0}),Om=de("Chain",["?on","math","typed"],(e=>{let{on:t,math:r,typed:n}=e;function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");ie(e)?this.value=e.value:this.value=e}function o(e,t){pe(i.prototype,e,(function(){const e=t();if("function"==typeof e)return a(e)}))}function a(e){return function(){if(0===arguments.length)return new i(e(this.value));const t=[this.value];for(let e=0;ee[t]));var r,n};const s={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",(function(e,t,r){r||o(e,t)})),i}),{isClass:!0}),Bm={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},_m={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},zm={bignumber:{name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]},bigint:{name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]},boolean:{name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},complex:{name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},createUnit:{name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},fraction:{name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},index:{name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},matrix:{name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},number:{name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]},sparse:{name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},splitUnit:{name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},string:{name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},unit:{name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},e:Bm,E:Bm,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Infinity:{name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},LOG10E:{name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:_m,PI:_m,phi:{name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},SQRT1_2:{name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:{name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},lsolve:{name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},lsolveAll:{name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},lup:{name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},lusolve:{name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},leafCount:{name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},polynomialRoot:{name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},resolve:{name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},simplify:{name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},simplifyConstant:{name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},simplifyCore:{name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},symbolicEqual:{name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},rationalize:{name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},slu:{name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},usolve:{name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},usolveAll:{name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qr:{name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},cbrt:{name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},ceil:{name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},cube:{name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},divide:{name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},dotDivide:{name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},dotMultiply:{name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},dotPow:{name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},exp:{name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},expm:{name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},expm1:{name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},fix:{name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},gcd:{name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},hypot:{name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},lcm:{name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},log:{name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},log2:{name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},log1p:{name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},log10:{name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},mod:{name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},multiply:{name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},norm:{name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},nthRoot:{name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},nthRoots:{name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},pow:{name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},sign:{name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},invmod:{name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:{name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},count:{name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diff:{name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pinv:{name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},matrixFromFunction:{name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},matrixFromRows:{name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},matrixFromColumns:{name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},rotate:{name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},rotationMatrix:{name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},fft:{name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ifft:{name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},sylvester:{name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},schur:{name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},lyap:{name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},solveODE:{name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},lgamma:{name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},zpk2tf:{name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},freqz:{name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},zeta:{name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},cumsum:{name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},variance:{name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},corr:{name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},print:{name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},typeOf:{name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]}},Im="help",km=de(Im,["typed","mathWithTransform","Help"],(e=>{let{typed:t,mathWithTransform:r,Help:n}=e;return t(Im,{any:function(e){let t,o=e;if("string"!=typeof e)for(t in r)if(me(r,t)&&e===r[t]){o=t;break}const a=i(zm,o);if(!a){const e="function"==typeof o?o.name:o;throw new Error('No documentation found on "'+e+'"')}return new n(a)}})})),qm="chain",Rm=de(qm,["typed","Chain"],(e=>{let{typed:t,Chain:r}=e;return t(qm,{"":function(){return new r},any:function(e){return new r(e)}})})),Pm=de("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],(e=>{let{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:a,unaryMinus:s}=e;return t("det",{any:function(e){return ae(e)},"Array | Matrix":function(e){let t;switch(t=E(e)?e.size():Array.isArray(e)?(e=r(e)).size():[],t.length){case 0:return ae(e);case 1:if(1===t[0])return ae(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+Kr(t)+")");case 2:{const r=t[0],u=t[1];if(r===u)return function(e,t){if(1===t)return ae(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));{let r=!1;const u=new Array(t).fill(0).map(((e,t)=>t));for(let s=0;s{let{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:a,det:s,identity:u,abs:c}=e;return t("inv",{"Array | Matrix":function(e){const t=E(e)?e.size():un(e);switch(t.length){case 1:if(1===t[0])return E(e)?r([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+Kr(t)+")");case 2:{const n=t[0],i=t[1];if(n===i)return E(e)?r(l(e.valueOf(),n,i),e.storage()):l(e,n,i);throw new RangeError("Matrix must be square (size: "+Kr(t)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Kr(t)+")")}},any:function(e){return n(1,e)}});function l(e,t,r){let l,f,p,m,d;if(1===t){if(m=e[0][0],0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,m)]]}if(2===t){const t=s(e);if(0===t)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],t),n(a(e[0][1]),t)],[n(a(e[1][0]),t),n(e[0][0],t)]]}{const s=e.concat();for(l=0;lu&&(u=c(s[l][e]),h=l),l++;if(0===u)throw Error("Cannot calculate inverse, determinant is zero");l=h,l!==e&&(d=s[e],s[e]=s[l],s[l]=d,d=m[e],m[e]=m[l],m[l]=d);const g=s[e],y=m[e];for(l=0;l{let{typed:t,matrix:r,inv:n,deepEqual:i,equal:o,dotDivide:a,dot:s,ctranspose:u,divideScalar:c,multiply:l,add:f,Complex:p}=e;return t(Um,{"Array | Matrix":function(e){const t=E(e)?e.size():un(e);switch(t.length){case 1:return h(e)?u(e):1===t[0]?n(e):a(u(e),s(e,e));case 2:{if(h(e))return u(e);const i=t[0],o=t[1];if(i===o)try{return n(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return E(e)?r(m(e.valueOf(),i,o),e.storage()):m(e,i,o)}default:throw new RangeError("Matrix must be two dimensional (size: "+Kr(t)+")")}},any:function(e){return o(e,0)?ae(e):c(1,e)}});function m(e,t,r){const{C:i,F:o}=function(e,t,r){const n=function(e,t,r){const n=ae(e);let i=0;for(let e=0;ee.filter(((e,r)=>r!d(s(n[t],n[t]))))}}(e,t,r),c=l(n(l(u(i),i)),u(i)),p=l(u(o),n(l(o,u(o))));return l(p,c)}function d(e){return o(f(e,p(1,1)),f(0,p(1,1)))}function h(e){return i(f(e,p(1,1)),f(l(e,0),p(1,1)))}}));const $m=de("eigs",["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],(e=>{let{config:t,typed:r,matrix:n,addScalar:i,subtract:o,equal:a,abs:s,atan:u,cos:c,sin:l,multiplyScalar:f,divideScalar:p,inv:m,bignumber:d,multiply:y,add:v,larger:w,column:N,flatten:E,number:A,complex:S,sqrt:M,diag:C,size:T,reshape:D,qr:F,usolve:O,usolveAll:B,im:_,re:z,smaller:I,matrixFromColumns:k,dot:q}=e;const R=function(e){let{config:t,addScalar:r,subtract:n,abs:i,atan:o,cos:a,sin:s,multiplyScalar:u,inv:c,bignumber:l,multiply:f,add:p}=e;function m(e,r,n){const i=r-e;return Math.abs(i)<=t.relTol?Math.PI/4:.5*Math.atan(2*n/(r-e))}function d(e,r,a){const s=n(r,e);return i(s)<=t.relTol?l(-1).acos().div(4):u(.5,o(f(2,a,c(s))))}function h(e,t,r,n){const i=e.length,o=Math.cos(t),a=Math.sin(t),s=Array(i).fill(0),u=Array(i).fill(0);for(let t=0;t({value:o[t],vector:e})));return{values:o,eigenvectors:s}}return function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.relTol,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if("number"===o)return function(e,t,r){const n=e.length,i=Math.abs(t/n);let o,a;if(r){a=new Array(n);for(let e=0;e=Math.abs(i);){const t=s[0][0],n=s[0][1];o=m(e[t][t],e[n][n],e[t][n]),e=x(e,o,t,n),r&&(a=h(a,o,t,n)),s=b(e)}const u=Array(n).fill(0);for(let t=0;t=i(o);){const t=u[0][0],n=u[0][1];a=d(e[t][t],e[n][n],e[t][n]),e=y(e,a,t,n),r&&(s=g(s,a,t,n)),u=v(e)}const c=Array(n).fill(0);for(let t=0;t=5)return null;for(s=0;;){const t=h(e,a);if(v(F(D(a,[t])),n))break;if(++s>=10)return null;a=O(t)}return a}function T(e,t,r){const n="BigNumber"===r,i="Complex"===r;let o=Array(e).fill(0).map((e=>2*Math.random()-1));return n&&(o=o.map((e=>c(e)))),i&&(o=o.map((e=>x(e)))),o=D(o,t),O(o,r)}function D(e,t){const n=f(e);for(let o of t)o=p(o,n),e=r(e,i(a(N(o,e),N(o,o)),o));return e}function F(e){return u(s(N(e,e)))}function O(e,t){const r="Complex"===t,n="BigNumber"===t?c(1):r?x(1):1;return i(a(n,F(e)),e)}return function(e,s,f,p){let h=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const w=function(e,r,n,i,s){const f="BigNumber"===i,p="Complex"===i,m=f?c(0):0,d=f?c(1):p?x(1):1,h=f?c(1):1,g=f?c(10):2,w=o(g,g);let N;s&&(N=Array(r).fill(d));let E=!1;for(;!E;){E=!0;for(let n=0;n1&&(N=l(Array(y-1).fill(m)))),y-=1,h.pop();for(let e=0;e2&&(N=l(Array(y-2).fill(m)))),y-=2,h.pop(),h.pop();for(let e=0;e+r(u(e),u(t)))),M>100){const e=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+g.join(", "));throw e.values=g,e.vectors=[],e}const C=s?i(w,function(e,t){const r=[];for(let e=0;ei(p,e))),A.push(...l.map((e=>({value:s,vector:n(e)}))))}return A}(e,s,T,w,N,f,p);return{values:N,eigenvectors:t}}return{values:N}}}({config:t,addScalar:i,subtract:o,multiply:y,multiplyScalar:f,flatten:E,divideScalar:p,sqrt:M,abs:s,bignumber:d,diag:C,size:T,reshape:D,qr:F,inv:m,usolve:O,usolveAll:B,equal:a,complex:S,larger:w,smaller:I,matrixFromColumns:k,dot:q});return r("eigs",{Array:function(e){return j(n(e))},"Array, number|BigNumber":function(e,t){return j(n(e),{precision:t})},"Array, Object":(e,t)=>j(n(e),t),Matrix:function(e){return j(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return j(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){const r={matricize:!0};return Wr(r,t),j(e,r)}});function j(e){var r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=!("eigenvectors"in i)||i.eigenvectors,u=function(e,t,r){const n=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw new RangeError(`Matrix must be square (size: ${Kr(i)})`);const a=i[0];if(function(e,t,r){for(let n=0;n{let{value:t,vector:r}=e;return{value:t,vector:n(r)}})))),a&&Object.defineProperty(u,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),u}function U(e,t,r){const n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;let i=!1,o=!1,a=!1;for(let e=0;e{let{typed:t,abs:r,add:n,identity:i,inv:o,multiply:a}=e;return t(Hm,{Matrix:function(e){const t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+Kr(t)+")");const u=t[0],c=function(e){const t=e.size()[0];let n=0;for(let i=0;i1&&(y=a(y,m),x=-x),g=g*(f-e+1)/((2*f-e+1)*e),d=n(d,a(g,y)),h=n(h,a(g*x,y));let b=a(o(h),d);for(let e=0;e{let{typed:t,abs:r,add:n,multiply:i,map:o,sqrt:a,subtract:s,inv:u,size:c,max:l,identity:f}=e;const p=1e-6;function m(e){let t,o=0,a=e,m=f(c(e));do{const e=a;if(a=i(.5,n(e,u(m))),m=i(.5,n(m,u(e))),t=l(r(s(a,e))),t>p&&++o>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return a}return t(Zm,{"Array | Matrix":function(e){const t=E(e)?e.size():un(e);switch(t.length){case 1:if(1===t[0])return o(e,a);throw new RangeError("Matrix must be square (size: "+Kr(t)+")");case 2:if(t[0]===t[1])return m(e);throw new RangeError("Matrix must be square (size: "+Kr(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+Kr(t)+")")}}})})),Wm="sylvester",Ym=de(Wm,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(e=>{let{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:o,range:a,concat:s,transpose:u,index:c,subset:l,add:f,subtract:p,identity:m,lusolve:d,abs:h}=e;return t(Wm,{"Matrix, Matrix, Matrix":g,"Array, Matrix, Matrix":function(e,t,r){return g(i(e),t,r)},"Array, Array, Matrix":function(e,t,r){return g(i(e),i(t),r)},"Array, Matrix, Array":function(e,t,r){return g(i(e),t,i(r))},"Matrix, Array, Matrix":function(e,t,r){return g(e,i(t),r)},"Matrix, Array, Array":function(e,t,r){return g(e,i(t),i(r))},"Matrix, Matrix, Array":function(e,t,r){return g(e,t,i(r))},"Array, Array, Array":function(e,t,r){return g(i(e),i(t),i(r)).toArray()}});function g(e,t,g){const y=t.size()[0],x=e.size()[0],b=r(e),v=b.T,w=b.U,N=r(o(-1,t)),E=N.T,A=N.U,S=o(o(u(w),g),A),M=a(0,x),C=[],T=(e,t)=>s(e,t,1),D=(e,t)=>s(e,t,0);for(let e=0;e1e-5){let t=D(l(S,c(M,e)),l(S,c(M,e+1)));for(let r=0;r{let{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:a,subtract:s}=e;return t(Jm,{Array:function(e){const t=u(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return u(e)}});function u(e){const t=e.size()[0];let r,u=e,c=n(t),l=0;do{r=u;const e=o(u),t=e.Q,n=e.R;if(u=i(n,t),c=i(c,t),l++>100)break}while(a(s(u,r))>1e-4);return{U:c,T:u}}})),Qm="lyap",Km=de(Qm,["typed","matrix","sylvester","multiply","transpose"],(e=>{let{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(Qm,{"Matrix, Matrix":function(e,t){return n(e,o(e),i(-1,t))},"Array, Matrix":function(e,t){return n(r(e),o(r(e)),i(-1,t))},"Matrix, Array":function(e,t){return n(e,o(r(e)),r(i(-1,t)))},"Array, Array":function(e,t){return n(r(e),o(r(e)),r(i(-1,t))).toArray()}})})),ed=de("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(e=>{let{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:a}=e;const s=No({typed:t,equalScalar:i}),u=Ao({typed:t});return t("divide",se({"Array | Matrix, Array | Matrix":function(e,t){return n(e,a(t))},"DenseMatrix, any":function(e,t){return u(e,t,o,!1)},"SparseMatrix, any":function(e,t){return s(e,t,o,!1)},"Array, any":function(e,t){return u(r(e),t,o,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,a(t))}},o.signatures))})),td="distance",rd=de(td,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],(e=>{let{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:a,sqrt:s,abs:u}=e;return t(td,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(a(t,r))throw new TypeError("LinePoint1 should not be same with LinePoint2");const o=n(r[1],t[1]),s=n(t[0],r[0]),u=n(i(r[0],t[1]),i(t[0],r[1]));return h(e[0],e[1],o,s,u)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(a(d(t),d(r)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){const o=n(r.lineTwoPtY,t.lineOnePtY),a=n(t.lineOnePtX,r.lineTwoPtX),s=n(i(r.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,r.lineTwoPtY));return h(e.pointX,e.pointY,o,a,s)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return h(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!f(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!p(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return x(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return h(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!f(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return y(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return x([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!f(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return x([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&c(e[0][0])&&c(e[0][1])){if(e.some((e=>2!==e.length||!c(e[0])||!c(e[1]))))return!1}else{if(!(3===e[0].length&&c(e[0][0])&&c(e[0][1])&&c(e[0][2])))return!1;if(e.some((e=>3!==e.length||!c(e[0])||!c(e[1])||!c(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){const t=[];let r=[],n=[];for(let i=0;i{let{typed:t,config:r,abs:n,add:i,addScalar:o,matrix:a,multiply:s,multiplyScalar:u,divideScalar:c,subtract:l,smaller:f,equalScalar:p,flatten:m,isZero:d,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":g,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,t,r){const n=g(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:a(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){const i=y(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===i?null:a(i)}});function g(e,t,r){if(e=x(e),t=x(t),r=x(r),!v(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&h(e[0])&&h(e[1])&&h(e[2])&&h(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,a,s,f,p,m){const d=u(e,s),h=u(n,s),g=u(t,f),y=u(i,f),x=u(r,p),b=u(a,p),v=l(l(l(m,d),g),x),w=l(l(l(o(o(h,y),b),d),g),x),N=c(v,w);return[o(e,u(N,l(n,e))),o(t,u(N,l(i,t))),o(r,u(N,l(a,r)))]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])}function y(e,t,a,m){if(e=x(e),t=x(t),a=x(a),m=x(m),2===e.length){if(!b(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(a))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(m))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,a,p){const m=e,h=a,g=l(m,t),y=l(h,p),x=l(u(g[0],y[1]),u(y[0],g[1]));if(d(x))return null;if(f(n(x),r.relTol))return null;const b=u(y[0],m[1]),v=u(y[1],m[0]),w=u(y[0],h[1]),N=u(y[1],h[0]),E=c(o(l(l(b,v),w),N),x);return i(s(g,E),m)}(e,t,a,m)}if(3===e.length){if(!v(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!v(a))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!v(m))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,a,s,f,m,h,g,y){const x=w(e,s,h,s,t,f,g,f,r,m,y,m),b=w(h,s,n,e,g,f,i,t,y,m,a,r),v=w(e,s,n,e,t,f,i,t,r,m,a,r),N=w(h,s,h,s,g,f,g,f,y,m,y,m),E=w(n,e,n,e,i,t,i,t,a,r,a,r),A=l(u(x,b),u(v,N)),S=l(u(E,N),u(b,b));if(d(S))return null;const M=c(A,S),C=c(o(x,u(M,b)),N),T=o(e,u(M,l(n,e))),D=o(t,u(M,l(i,t))),F=o(r,u(M,l(a,r))),O=o(s,u(C,l(h,s))),B=o(f,u(C,l(g,f))),_=o(m,u(C,l(y,m)));return p(T,O)&&p(D,B)&&p(F,_)?[T,D,F]:null}(e[0],e[1],e[2],t[0],t[1],t[2],a[0],a[1],a[2],m[0],m[1],m[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function x(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((e=>Array.isArray(e)&&1===e.length))?m(e):e}function b(e){return 2===e.length&&h(e[0])&&h(e[1])}function v(e){return 3===e.length&&h(e[0])&&h(e[1])&&h(e[2])}function w(e,t,r,n,i,a,s,c,f,p,m,d){const h=u(l(e,t),l(r,n)),g=u(l(i,a),l(s,c)),y=u(l(f,p),l(m,d));return o(o(h,g),y)}})),id=de("sum",["typed","config","add","numeric"],(e=>{let{typed:t,config:r,add:n,numeric:i}=e;return t("sum",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){try{return Vn(e,t,n)}catch(e){throw Du(e,"sum")}},"...":function(e){if(Hn(e))throw new TypeError("Scalar values expected in function sum");return o(e)}});function o(e){let t;return Gn(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw Du(t,"sum",e)}})),void 0===t&&(t=i(0,r.number)),"string"==typeof t&&(t=i(t,xe(t,r))),t}})),od="cumsum",ad=de(od,["typed","add","unaryPlus"],(e=>{let{typed:t,add:r,unaryPlus:n}=e;return t(od,{Array:i,Matrix:function(e){return e.create(i(e.valueOf(),e.datatype()))},"Array, number | BigNumber":a,"Matrix, number | BigNumber":function(e,t){return e.create(a(e.valueOf(),t),e.datatype())},"...":function(e){if(Hn(e))throw new TypeError("All values expected to be scalar in function cumsum");return i(e)}});function i(e){try{return o(e)}catch(e){throw Du(e,od)}}function o(e){if(0===e.length)return[];const t=[n(e[0])];for(let n=1;n=r.length)throw new sn(t,r.length);try{return s(e,t)}catch(e){throw Du(e,od)}}function s(e,t){let r,n,i;if(t<=0){const a=e[0][0];if(Array.isArray(a)){for(i=$n(e),n=[],r=0;r{let{typed:t,add:r,divide:n}=e;return t(sd,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{const i=Vn(e,t,r),o=Array.isArray(e)?un(e):e.size();return n(i,o[t])}catch(e){throw Du(e,"mean")}},"...":function(e){if(Hn(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){let t,i=0;if(Gn(e,(function(e){try{t=void 0===t?e:r(t,e),i++}catch(t){throw Du(t,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return n(t,i)}})),cd="median",ld=de(cd,["typed","add","divide","compare","partitionSelect"],(e=>{let{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function a(e){try{const t=(e=En(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){const r=t/2-1,n=o(e,r+1);let a=e[r];for(let t=0;t0&&(a=e[t]);return u(a,n)}{const r=o(e,(t-1)/2);return s(r)}}catch(e){throw Du(e,"median")}}const s=t({"number | BigNumber | Complex | Unit":function(e){return e}}),u=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return t(cd,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(Hn(e))throw new TypeError("Scalar values expected in function median");return a(e)}})})),fd=de("mad",["typed","abs","map","median","subtract"],(e=>{let{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t("mad",{"Array | Matrix":a,"...":function(e){return a(e)}});function a(e){if(0===(e=En(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{const t=i(e);return i(n(e,(function(e){return r(o(e,t))})))}catch(e){throw e instanceof TypeError&&e.message.includes("median")?new TypeError(e.message.replace("median","mad")):Du(e,"mad")}}})),pd="unbiased",md="variance",dd=de(md,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{let{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:a,isNaN:s}=e;return t(md,{"Array | Matrix":function(e){return u(e,pd)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,pd)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return u(e,pd)}});function u(e,t){let a,u=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Gn(e,(function(e){try{a=void 0===a?e:r(a,e),u++}catch(t){throw Du(t,"variance",e)}})),0===u)throw new Error("Cannot calculate variance of an empty array");const c=o(a,u);if(a=void 0,Gn(e,(function(e){const t=n(e,c);a=void 0===a?i(t,t):r(a,i(t,t))})),s(a))return a;switch(t){case"uncorrected":return o(a,u);case"biased":return o(a,u+1);case"unbiased":{const e=g(a)?a.mul(0):0;return 1===u?e:o(a,u-1)}default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return a(e,t,(e=>u(e,r)))}catch(e){throw Du(e,"variance")}}})),hd="quantileSeq",gd=de(hd,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(e=>{let{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p}=e;const m=mo({typed:t,isInteger:c});return t(hd,{"Array | Matrix, number | BigNumber":(e,t)=>g(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,r)=>d(e,t,!1,r,g),"Array | Matrix, number | BigNumber, boolean":g,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>d(e,t,r,n,g),"Array | Matrix, Array | Matrix":(e,t)=>y(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,r)=>d(e,t,!1,r,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>d(e,t,r,n,y)});function d(e,t,r,n,i){return m(e,n,(e=>i(e,t,r)))}function g(e,t,i){let a;const s=e.valueOf();if(l(t,0))throw new Error("N/prob must be non-negative");if(f(t,1))return h(t)?x(s,t,i):r(x(s,t,i));if(p(t,1)){if(!c(t))throw new Error("N must be a positive integer");if(p(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");const e=n(t,1);a=[];for(let r=0;l(r,t);r++){const t=o(r+1,e);a.push(x(s,t,i))}return h(t)?a:r(a)}}function y(e,t,r){const n=e.valueOf(),i=t.valueOf(),o=[];for(let e=0;e0&&(d=o[e])}return n(a(d,i(1,m)),a(g,m))}})),yd=de("std",["typed","map","sqrt","variance"],(e=>{let{typed:t,map:r,sqrt:n,variance:i}=e;return t("std",{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(e){return o(e)}});function o(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{const e=i.apply(null,arguments);return A(e)?r(e,n):n(e)}catch(e){throw e instanceof TypeError&&e.message.includes(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}})),xd="corr",bd=de(xd,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],(e=>{let{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:a,multiply:s,pow:u,divide:c}=e;return t(xd,{"Array, Array":function(e,t){return l(e,t)},"Matrix, Matrix":function(e,t){const n=l(e.toArray(),t.toArray());return Array.isArray(n)?r(n):n}});function l(e,t){const r=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(let n=0;no(e,s(r,t[n]))),0),m=i(e.map((e=>u(e,2)))),d=i(t.map((e=>u(e,2)))),h=a(s(r,p),s(l,f)),g=n(s(a(s(r,m),u(l,2)),a(s(r,d),u(f,2))));return c(h,g)}}));function vd(e,t){if(t>1;return vd(e,r)*vd(r+1,t)}function wd(e,t){if(!ye(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!ye(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");const r=e-t;let n=1,i=2;const o=t{let{typed:t}=e;return t(Nd,{"number, number":wd,"BigNumber, BigNumber":function(e,t){const r=e.constructor;let n,i;const o=e.minus(t),a=new r(1);if(!Ad(e)||!Ad(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(n=a,t.lt(o))for(i=a;i.lte(o);i=i.plus(a))n=n.times(t.plus(i)).dividedBy(i);else for(i=a;i.lte(t);i=i.plus(a))n=n.times(o.plus(i)).dividedBy(i);return n}})}));function Ad(e){return e.isInteger()&&e.gte(0)}const Sd="combinationsWithRep",Md=de(Sd,["typed"],(e=>{let{typed:t}=e;return t(Sd,{"number, number":function(e,t){if(!ye(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!ye(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t171?1/0:vd(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Td(1-e));if(e>=171.35)return 1/0;if(e>85){const t=e*e,r=t*e,n=r*e,i=n*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*r)-571/(2488320*n)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,t=Fd[0];for(let r=1;r=1;t--)r+=Bd[t]/(e+t);return Od+(e+.5)*Math.log(t)-t+Math.log(r)}_d.signature="number";const zd="gamma",Id=de(zd,["typed","config","multiplyScalar","pow","BigNumber","Complex"],(e=>{let{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:o,Complex:a}=e;return t(zd,{number:Td,Complex:function e(t){if(0===t.im)return Td(t.re);if(t.re<.5){const r=new a(1-t.re,-t.im),n=new a(Math.PI*t.re,Math.PI*t.im);return new a(Math.PI).div(n.sin()).div(e(r))}t=new a(t.re-1,t.im);let r=new a(Fd[0],0);for(let e=1;e2;)i-=2,u+=i,a=a.times(u);return new o(a.toPrecision(o.precision))}})),kd="lgamma",qd=de(kd,["Complex","typed"],(e=>{let{Complex:t,typed:r}=e;const n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(kd,{number:_d,Complex:function e(r){if(r.isNaN())return new t(NaN,NaN);if(0===r.im)return new t(_d(r.re),0);if(r.re>=7||Math.abs(r.im)>=7)return i(r);if(r.re<=.1){const i=(n=6.283185307179586,(!0^((a=r.im)>0||!(a<0)&&1/a==1/0)?-n:n)*Math.floor(.5*r.re+.25)),o=r.mul(Math.PI).sin().log(),s=e(new t(1-r.re,-r.im));return new t(1.1447298858494002,i).sub(o).sub(s)}return r.im>=0?o(r):o(r.conjugate()).conjugate();var n,a},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){const r=e.sub(.5).mul(e.log()).sub(e).add(Od),i=new t(1,0).div(e),o=i.div(e);let a=n[0],s=n[1];const u=2*o.re,c=o.re*o.re+o.im*o.im;for(let e=2;e<8;e++){const t=s;s=-c*a+n[e],a=u*a+t}const l=i.mul(o.mul(a).add(s));return r.add(l)}function o(e){let r=0,n=0,o=e;for(e=e.add(1);e.re<=7;){o=o.mul(e);const t=o.im<0?1:0;0!==t&&0===n&&r++,n=t,e=e.add(1)}return i(e).sub(o.log()).sub(new t(0,2*r*Math.PI*1))}})),Rd="factorial",Pd=de(Rd,["typed","gamma"],(e=>{let{typed:t,gamma:r}=e;return t(Rd,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":t.referToSelf((e=>t=>Zn(t,e)))})})),jd="kldivergence",Ud=de(jd,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],(e=>{let{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:a,dotDivide:s,log:u,isNumeric:c}=e;return t(jd,{"Array, Array":function(e,t){return l(r(e),r(t))},"Matrix, Array":function(e,t){return l(e,r(t))},"Array, Matrix":function(e,t){return l(r(e),t)},"Matrix, Matrix":function(e,t){return l(e,t)}});function l(e,t){const r=t.size().length,l=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(l>1)throw new Error("second object must be one dimensional");if(r!==l)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");const f=n(e,i(e)),p=n(t,i(t)),m=i(o(f,a(s(f,p),(e=>u(e)))));return c(m)?m:Number.NaN}})),Ld="multinomial",$d=de(Ld,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(e=>{let{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:a,isPositive:s}=e;return t(Ld,{"Array | Matrix":function(e){let t=0,u=1;return Gn(e,(function(e){if(!a(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),u=i(u,o(e))})),n(o(t),u)}})})),Hd="permutations",Gd=de(Hd,["typed","factorial"],(e=>{let{typed:t,factorial:r}=e;return t(Hd,{"number | BigNumber":r,"number, number":function(e,t){if(!ye(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!ye(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return vd(e-t+1,e)},"BigNumber, BigNumber":function(e,t){let r,n;if(!Zd(e)||!Zd(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})}));function Zd(e){return e.isInteger()&&e.gte(0)}var Vd=r(7391);const Wd=Vd(Date.now());function Yd(e){let t;var r;return t=null===(r=e)?Wd:Vd(String(r)),function(){return t()}}const Jd="pickRandom",Xd=de(Jd,["typed","config","?on"],(e=>{let{typed:t,config:r,on:n}=e,i=Yd(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yd(e.randomSeed))})),t(Jd,{"Array | Matrix":function(e){return o(e,{})},"Array | Matrix, Object":function(e,t){return o(e,t)},"Array | Matrix, number":function(e,t){return o(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return o(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return o(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return o(e,{number:t,weights:r})}});function o(e,t){let{number:r,weights:n,elementWise:o=!0}=t;const a=void 0===r;a&&(r=1);const s=E(e)?e.create:E(n)?n.create:null;e=e.valueOf(),n&&(n=n.valueOf()),!0===o&&(e=En(e),n=En(n));let u=0;if(void 0!==n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(let e=0,t=n.length;e1)for(let n=0,i=e.shift();n{let{typed:t,config:r,on:n}=e,i=Yd(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yd(e.randomSeed))})),t(Kd,{"":()=>a(0,1),number:e=>a(0,e),"number, number":(e,t)=>a(e,t),"Array | Matrix":e=>o(e,0,1),"Array | Matrix, number":(e,t)=>o(e,0,t),"Array | Matrix, number, number":(e,t,r)=>o(e,t,r)});function o(e,t,r){const n=Qd(e.valueOf(),(()=>a(t,r)));return E(e)?e.create(n,"number"):n}function a(e,t){return e+i()*(t-e)}})),th="randomInt",rh=de(th,["typed","config","?on"],(e=>{let{typed:t,config:r,on:n}=e,i=Yd(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yd(e.randomSeed))})),t(th,{"":()=>a(0,1),number:e=>a(0,e),"number, number":(e,t)=>a(e,t),"Array | Matrix":e=>o(e,0,1),"Array | Matrix, number":(e,t)=>o(e,0,t),"Array | Matrix, number, number":(e,t,r)=>o(e,t,r)});function o(e,t,r){const n=Qd(e.valueOf(),(()=>a(t,r)));return E(e)?e.create(n,"number"):n}function a(e,t){return Math.floor(e+i()*(t-e))}})),nh="stirlingS2",ih=de(nh,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(e=>{let{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,pow:a,factorial:s,combinations:u,isNegative:c,isInteger:l,number:f,bignumber:p,larger:m}=e;const d=[],g=[];return t(nh,{"number | BigNumber, number | BigNumber":function(e,t){if(!l(e)||c(e)||!l(t)||c(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");const n=!(h(e)&&h(t)),o=n?g:d,a=n?p:f,s=f(e),u=f(t);if(o[s]&&o[s].length>u)return o[s][u];for(let e=0;e<=s;++e){if(o[e]||(o[e]=[a(0===e?1:0)]),0===e)continue;const t=o[e],n=o[e-1];for(let o=t.length;o<=e&&o<=u;++o)t[o]=o===e?1:r(i(a(o),n[o]),n[o-1])}return o[s][u]}})})),oh="bellNumbers",ah=de(oh,["typed","addScalar","isNegative","isInteger","stirlingS2"],(e=>{let{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(oh,{"number | BigNumber":function(e){if(!i(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");let t=0;for(let n=0;n<=e;n++)t=r(t,o(e,n));return t}})})),sh="catalan",uh=de(sh,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(e=>{let{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:a,isInteger:s}=e;return t(sh,{"number | BigNumber":function(e){if(!s(e)||a(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(e,2),e),r(e,1))}})})),ch="composition",lh=de(ch,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(e=>{let{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:a,larger:s}=e;return t(ch,{"number | BigNumber, number | BigNumber":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(s(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})})),fh="leafCount",ph=de(fh,["parse","typed"],(e=>{let{parse:t,typed:r}=e;function n(e){let t=0;return e.forEach((e=>{t+=n(e)})),t||1}return r(fh,{Node:function(e){return n(e)}})}));function mh(e){return Z(e)||K(e)&&e.isUnary()&&Z(e.args[0])}function dh(e){return!!Z(e)||!(!Y(e)&&!K(e)||!e.args.every(dh))||!(!ee(e)||!dh(e.content))}const hh=de("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(e=>{let{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e;const i=!0,o=!1,a="defaultF",s={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:o,total:i,commutative:o,associative:o},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:o,total:i,commutative:o,associative:o},paren:{trivial:i,total:i,commutative:i,associative:o},defaultF:{trivial:o,total:i,commutative:o,associative:o}};function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,n=a;if("string"==typeof e?n=e:K(e)?n=e.fn.toString():Y(e)?n=e.name:ee(e)&&(n="paren"),me(r,n)){const e=r[n];if(me(e,t))return e[t];if(me(s,n))return s[n][t]}if(me(r,a)){const e=r[a];return me(e,t)?e[t]:s[a][t]}if(me(s,n)){const e=s[n];if(me(e,t))return e[t]}return s[a][t]}function c(e){return u(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:s)}function l(e,t){let r;const n=[],i=function(e){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:s)},isAssociative:c,mergeContext:function(e,t){const r={...e};for(const n in t)me(e,n)?r[n]={...t[n],...e[n]}:r[n]=t[n];return r},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=l(t,r);for(let n=0;n2&&c(t,r)){let e=t.args.pop();for(;t.args.length>0;)e=n([t.args.pop(),e]);t.args=e.args}},unflattenl:function e(t,r){if(!t.args||0===t.args.length)return;const n=f(t),i=t.args.length;for(let n=0;n2&&c(t,r)){let e=t.args.shift();for(;t.args.length>0;)e=n([e,t.args.shift()]);t.args=e.args}},defaultContext:s,realContext:{divide:{total:o},log:{total:o}},positiveContext:{subtract:{total:o},abs:{trivial:i},log:{total:i}}}})),gh=de("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{let{config:t,typed:r,parse:n,add:i,subtract:o,multiply:a,divide:s,pow:u,isZero:c,equal:l,resolve:f,simplifyConstant:p,simplifyCore:h,fraction:g,bignumber:y,mathWithTransform:x,matrix:b,AccessorNode:v,ArrayNode:w,ConstantNode:N,FunctionNode:E,IndexNode:A,ObjectNode:S,OperatorNode:M,ParenthesisNode:C,SymbolNode:T}=e;const{hasProperty:D,isCommutative:F,isAssociative:O,mergeContext:B,flatten:_,unflattenr:z,unflattenl:I,createMakeNodeFunction:k,defaultContext:q,realContext:R,positiveContext:P}=hh({FunctionNode:E,OperatorNode:M,SymbolNode:T});r.addConversion({from:"Object",to:"Map",convert:d});const j=r("simplify",{Node:V,"Node, Map":(e,t)=>V(e,!1,t),"Node, Map, Object":(e,t,r)=>V(e,!1,t,r),"Node, Array":V,"Node, Array, Map":V,"Node, Array, Map, Object":V});function U(e){return e.transform((function(e,t,r){return ee(e)?U(e.content):e}))}r.removeConversion({from:"Object",to:"Map",convert:d}),j.defaultContext=q,j.realContext=R,j.positiveContext=P;const L={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};function $(e,t){const r={};if(e.s){const t=e.s.split("->");if(2!==t.length)throw SyntaxError("Could not parse rule: "+e.s);r.l=t[0],r.r=t[1]}else r.l=e.l,r.r=e.r;r.l=U(n(r.l)),r.r=U(n(r.r));for(const t of["imposeContext","repeat","assuming"])t in e&&(r[t]=e[t]);if(e.evaluate&&(r.evaluate=n(e.evaluate)),O(r.l,t)){const e=!F(r.l,t);let n;e&&(n=G());const i=k(r.l),o=G();r.expanded={},r.expanded.l=i([r.l,o]),_(r.expanded.l,t),z(r.expanded.l,t),r.expanded.r=i([r.r,o]),e&&(r.expandedNC1={},r.expandedNC1.l=i([n,r.l]),r.expandedNC1.r=i([n,r.r]),r.expandedNC2={},r.expandedNC2.l=i([n,r.expanded.l]),r.expandedNC2.r=i([n,r.expanded.r]))}return r}j.rules=[h,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},p,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},p,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];let H=0;function G(){return new T("_p"+H++)}function V(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=n.consoleDebug;t=function(e,t){const r=[];for(let n=0;n ${t[r].r.toString()}`)),i){const t=o.toString({parenthesis:"all"});t!==e&&(console.log("Applying",a,"produced",t),e=t)}I(o,n.context)}s=o.toString({parenthesis:"all"})}return o}function W(e,t,r){let n=e;if(e)for(let i=0;i=2&&2===e.args.length){const n=function(e,t){const r=[];let n,i;const o=k(e);if(F(e,t))for(let t=0;t1&&(a=o(e.args.slice(0,t))),i=e.args.slice(t),n=1===i.length?i[0]:o(i),r.push(o([a,n]))}return r}(t,r);let i=[];for(let t=0;t2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}{let n=[];for(let i=0;i2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");const i=Q(e.args[0],t.args[1],r);if(0===i.length)return[];const o=Q(e.args[1],t.args[0],r);if(0===o.length)return[];n=[i,o]}i=function(e){if(0===e.length)return e;const t=e.reduce(X),r=[],n={};for(let e=0;e="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":i[0].placeholders[e.name]=t;break;case"c":case"cl":if(!Z(t))return[];i[0].placeholders[e.name]=t;break;case"v":if(Z(t))return[];i[0].placeholders[e.name]=t;break;case"vl":if(!ne(t))return[];i[0].placeholders[e.name]=t;break;case"cd":if(!mh(t))return[];i[0].placeholders[e.name]=t;break;case"vd":if(mh(t))return[];i[0].placeholders[e.name]=t;break;case"ce":if(!dh(t))return[];i[0].placeholders[e.name]=t;break;case"ve":if(dh(t))return[];i[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof N))return[];if(!l(e.value,t.value))return[]}return i}function K(e,t){if(e instanceof N&&t instanceof N){if(!l(e.value,t.value))return!1}else if(e instanceof T&&t instanceof T){if(e.name!==t.name)return!1}else{if(!(e instanceof M&&t instanceof M||e instanceof E&&t instanceof E))return!1;if(e instanceof M){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof E&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(let r=0;r{let{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:o,bignumber:a,AccessorNode:s,ArrayNode:u,ConstantNode:c,FunctionNode:l,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:d}=e;const{isCommutative:h,isAssociative:g,allChildren:y,createMakeNodeFunction:x}=hh({FunctionNode:l,OperatorNode:m,SymbolNode:d}),v=t("simplifyConstant",{Node:e=>S(F(e,{})),"Node, Object":function(e,t){return S(F(e,t))}});function w(e){return b(e)?e.valueOf():e instanceof Array?e.map(w):E(e)?i(w(e.valueOf())):e}function N(e,t,r){try{return n[e].apply(null,t)}catch(i){return t=t.map(w),C(n[e].apply(null,t),r)}}const A=t({Fraction:function(e){let t;const r=e.s*e.n;return t=r<0?new m("-","unaryMinus",[new c(-r)]):new c(r),1===e.d?t:new m("/","divide",[t,new c(e.d)])},number:function(e){return e<0?T(new c(-e)):new c(e)},BigNumber:function(e){return e<0?T(new c(-e)):new c(e)},bigint:function(e){return e<0n?T(new c(-e)):new c(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new c(e)},Matrix:function(e){return new u(e.valueOf().map((e=>A(e))))}});function S(e){return X(e)?e:A(e)}function M(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&o){const r=o(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n{if(!X(i)){const r=t.pop();if(X(r))return[r,i];try{return t.push(N(e,[r,i],n)),t}catch(e){t.push(r)}}t.push(S(t.pop()));const o=1===t.length?t[0]:r(t);return[r([o,S(i)])]}),[i]);return 1===o.length?o[0]:r([o[0],A(o[1])])}function F(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return C(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return C(e.value,t)}return e;case"FunctionNode":if(n[e.name]&&n[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){const r=e.args.map((e=>F(e,t)));if(!r.some(X))try{return N(e.name,r,t)}catch(e){}if("size"===e.name&&1===r.length&&L(r[0])){const e=[];let t=r[0];for(;L(t);)e.push(t.items.length),t=t.items[0];return i(e)}return new l(e.name,r.map(S))}case"OperatorNode":{const r=e.fn.toString();let n,i;const o=x(e);if(K(e)&&e.isUnary())n=[F(e.args[0],t)],i=X(n[0])?o(n):N(r,n,t);else if(g(e,t.context))if(n=y(e,t.context),n=n.map((e=>F(e,t))),h(r,t.context)){const e=[],a=[];for(let t=0;t1?(i=D(r,e,o,t),a.unshift(i),i=D(r,a,o,t)):i=D(r,n,o,t)}else i=D(r,n,o,t);else n=e.args.map((e=>F(e,t))),i=D(r,n,o,t);return i}case"ParenthesisNode":return F(e.content,t);case"AccessorNode":return function(e,t,r){if(!J(t))return new s(S(e),S(t));if(L(e)||E(e)){const n=Array.from(t.dimensions);for(;n.length>0;)if(Z(n[0])&&"string"!=typeof n[0].value){const t=C(n.shift().value,r);L(e)?e=e.items[t-1]:(e=e.valueOf()[t-1])instanceof Array&&(e=i(e))}else{if(!(n.length>1&&Z(n[1])&&"string"!=typeof n[1].value))break;{const t=C(n[1].value,r),o=[],a=L(e)?e.items:e.valueOf();for(const r of a)if(L(r))o.push(r.items[t-1]);else{if(!E(e))break;o.push(r[t-1])}if(o.length!==a.length)break;e=L(e)?new u(o):i(o),n.splice(1,1)}}return n.length===t.dimensions.length?new s(S(e),t):n.length>0?(t=new f(n),new s(S(e),t)):e}if(Q(e)&&1===t.dimensions.length&&Z(t.dimensions[0])){const r=t.dimensions[0].value;return r in e.properties?e.properties[r]:new c}return new s(S(e),t)}(F(e.object,t),F(e.index,t),t);case"ArrayNode":{const r=e.items.map((e=>F(e,t)));return r.some(X)?new u(r.map(S)):i(r)}case"IndexNode":return new f(e.dimensions.map((e=>v(e,t))));case"ObjectNode":{const r={};for(const n in e.properties)r[n]=v(e.properties[n],t);return new p(r)}default:throw new Error(`Unimplemented node type in simplifyConstant: ${e.type}`)}}return v})),xh="simplifyCore",bh=de(xh,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{let{typed:t,parse:r,equal:n,isZero:i,add:o,subtract:a,multiply:s,divide:u,pow:c,AccessorNode:l,ArrayNode:f,ConstantNode:p,FunctionNode:m,IndexNode:d,ObjectNode:h,OperatorNode:g,ParenthesisNode:y,SymbolNode:x}=e;const b=new p(0),v=new p(1),w=new p(!0),N=new p(!1);function E(e){return K(e)&&["and","not","or"].includes(e.op)}const{hasProperty:A,isCommutative:S}=hh({FunctionNode:m,OperatorNode:g,SymbolNode:x});function M(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t?t.context:void 0;if(A(e,"trivial",r)){if(Y(e)&&1===e.args.length)return M(e.args[0],t);let r=!1,n=0;if(e.forEach((e=>{++n,1===n&&(r=M(e,t))})),1===n)return r}let o=e;if(Y(o)){const e=function(e){const t="OperatorNode:"+e;for(const e of yp)if(t in e)return e[t].op;return null}(o.name);if(!e)return new m(M(o.fn),o.args.map((e=>M(e,t))));if(o.args.length>2&&A(o,"associative",r))for(;o.args.length>2;){const t=o.args.pop(),r=o.args.pop();o.args.push(new g(e,o.name,[t,r]))}o=new g(e,o.name,o.args)}if(K(o)&&o.isUnary()){const e=M(o.args[0],t);if("~"===o.op&&K(e)&&e.isUnary()&&"~"===e.op)return e.args[0];if("not"===o.op&&K(e)&&e.isUnary()&&"not"===e.op&&E(e.args[0]))return e.args[0];let r=!0;if("-"===o.op&&K(e)&&(e.isBinary()&&"subtract"===e.fn&&(o=new g("-","subtract",[e.args[1],e.args[0]]),r=!1),e.isUnary()&&"-"===e.op))return e.args[0];if(r)return new g(o.op,o.fn,[e])}if(K(o)&&o.isBinary()){const e=M(o.args[0],t);let a=M(o.args[1],t);if("+"===o.op){if(Z(e)&&i(e.value))return a;if(Z(a)&&i(a.value))return e;K(a)&&a.isUnary()&&"-"===a.op&&(a=a.args[0],o=new g("-","subtract",[e,a]))}if("-"===o.op)return K(a)&&a.isUnary()&&"-"===a.op?M(new g("+","add",[e,a.args[0]]),t):Z(e)&&i(e.value)?M(new g("-","unaryMinus",[a])):Z(a)&&i(a.value)?e:new g(o.op,o.fn,[e,a]);if("*"===o.op){if(Z(e)){if(i(e.value))return b;if(n(e.value,1))return a}if(Z(a)){if(i(a.value))return b;if(n(a.value,1))return e;if(S(o,r))return new g(o.op,o.fn,[a,e],o.implicit)}return new g(o.op,o.fn,[e,a],o.implicit)}if("/"===o.op)return Z(e)&&i(e.value)?b:Z(a)&&n(a.value,1)?e:new g(o.op,o.fn,[e,a]);if("^"===o.op&&Z(a)){if(i(a.value))return v;if(n(a.value,1))return e}if("and"===o.op){if(Z(e)){if(!e.value)return N;if(E(a))return a;if(Z(a))return a.value?w:N}if(Z(a)){if(!a.value)return N;if(E(e))return e}}if("or"===o.op){if(Z(e)){if(e.value)return w;if(E(a))return a}if(Z(a)){if(a.value)return w;if(E(e))return e}}return new g(o.op,o.fn,[e,a])}if(K(o))return new g(o.op,o.fn,o.args.map((e=>M(e,t))));if(L(o))return new f(o.items.map((e=>M(e,t))));if(U(o))return new l(M(o.object,t),M(o.index,t));if(J(o))return new d(o.dimensions.map((e=>M(e,t))));if(Q(o)){const e={};for(const r in o.properties)e[r]=M(o.properties[r],t);return new h(e)}return o}return t(xh,{Node:M,"Node,Object":M})})),vh=de("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(e=>{let{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:o,ParenthesisNode:a}=e;function s(e,t){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(ne(e)){if(u.has(e.name)){const e=Array.from(u).join(", ");throw new ReferenceError(`recursive loop of variable definitions among {${e}}`)}const i=t.get(e.name);if(X(i)){const r=new Set(u);return r.add(e.name),s(i,t,r)}return"number"==typeof i?r(String(i)):void 0!==i?new n(i):e}if(K(e)){const r=e.args.map((function(e){return s(e,t,u)}));return new o(e.op,e.fn,r,e.implicit)}if(ee(e))return new a(s(e.content,t,u));if(Y(e)){const r=e.args.map((function(e){return s(e,t,u)}));return new i(e.name,r)}return e.map((e=>s(e,t,u)))}return t("resolve",{Node:s,"Node, Map | null | undefined":s,"Node, Object":(e,t)=>s(e,d(t)),"Array | Matrix":t.referToSelf((e=>t=>t.map((t=>e(t))))),"Array | Matrix, null | undefined":t.referToSelf((e=>t=>t.map((t=>e(t))))),"Array, Object":t.referTo("Array,Map",(e=>(t,r)=>e(t,d(r)))),"Matrix, Object":t.referTo("Matrix,Map",(e=>(t,r)=>e(t,d(r)))),"Array | Matrix, Map":t.referToSelf((e=>(t,r)=>t.map((t=>e(t,r)))))})})),wh="symbolicEqual",Nh=de(wh,["parse","simplify","typed","OperatorNode"],(e=>{let{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=new i("-","subtract",[e,t]),a=r(o,{},n);return Z(a)&&!a.value}return n(wh,{"Node, Node":o,"Node, Node, Object":o})})),Eh="derivative",Ah=de(Eh,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{let{typed:t,config:r,parse:n,simplify:i,equal:o,isZero:a,numeric:s,ConstantNode:u,FunctionNode:c,OperatorNode:l,ParenthesisNode:f,SymbolNode:p}=e;function m(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0};const n={};y(n,e,t.name);const o=x(e,n);return r.simplify?i(o):o}function d(e){const t=n(e);if(!t.isSymbolNode)throw new TypeError(`Invalid variable. Cannot parse ${JSON.stringify(e)} into a variable in function derivative`);return t}const h=t(Eh,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m,"Node, string":(e,t)=>m(e,d(t)),"Node, string, Object":(e,t,r)=>m(e,d(t),r)});h._simplify=!0,h.toTex=function(e){return g.apply(null,e.args)};const g=t("_derivTex",{"Node, SymbolNode":function(e,t){return Z(e)&&"string"===oe(e.value)?g(n(e.value).toString(),t.toString(),1):g(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===oe(t.value))return g(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return g(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){let n;return n=1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}",n+`\\left[${e}\\right]`}}),y=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,r){return y(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return t.params.includes(r)?y(e,t.expr,r):(e[t]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(t.args.length>0){let n=y(e,t.args[0],r);for(let i=1;i0){const n=e.args.filter((function(e){return void 0===t[e]})),i=1===n.length?n[0]:new l("*","multiply",n),o=r.concat(x(i,t));return new l("*","multiply",o)}return new l("+","add",e.args.map((function(r){return new l("*","multiply",e.args.map((function(e){return e===r?x(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){const r=e.args[0],n=e.args[1];return void 0!==t[n]?new l("/","divide",[x(r,t),n]):void 0!==t[r]?new l("*","multiply",[new l("-","unaryMinus",[r]),new l("/","divide",[x(n,t),new l("^","pow",[n.clone(),b(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[x(r,t),n.clone()]),new l("*","multiply",[r.clone(),x(n,t)])]),new l("^","pow",[n.clone(),b(2)])])}if("^"===e.op&&e.isBinary()){const r=e.args[0],n=e.args[1];if(void 0!==t[r])return Z(r)&&(a(r.value)||o(r.value,1))?b(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[r.clone()]),x(n.clone(),t)])]);if(void 0!==t[n]){if(Z(n)){if(a(n.value))return b(0);if(o(n.value,1))return x(r,t)}const e=new l("^","pow",[r.clone(),new l("-","subtract",[n,b(1)])]);return new l("*","multiply",[n.clone(),new l("*","multiply",[x(r,t),e])])}return new l("*","multiply",[new l("^","pow",[r.clone(),n.clone()]),new l("+","add",[new l("*","multiply",[x(r,t),new l("/","divide",[n.clone(),r.clone()])]),new l("*","multiply",[x(n,t),new c("log",[r.clone()])])])])}throw new Error('Cannot process operator "'+e.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function b(e,t){return new u(s(e,t||xe(String(e),r)))}return h})),Sh="rationalize",Mh=de(Sh,["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],(e=>{let{config:t,typed:r,equal:n,isZero:i,add:o,subtract:a,multiply:s,divide:u,pow:c,parse:l,simplifyConstant:f,simplifyCore:p,simplify:m,fraction:d,bignumber:h,mathWithTransform:g,matrix:y,AccessorNode:x,ArrayNode:b,ConstantNode:v,FunctionNode:w,IndexNode:N,ObjectNode:E,OperatorNode:A,SymbolNode:S,ParenthesisNode:M}=e;function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=function(){const e=[p,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(t,r),n.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],n.sucDivRules=r,n.firstRulesAgain=e.concat(t),n.finalRules=[p,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],n}(),i=function(e,t,r,n){const i=[],o=m(e,n,t,{exactFractions:!1}),a="+-*"+((r=!!r)?"/":"");!function e(t){const r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!ye(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(!a.includes(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(let r=0;r=1){let t,r;e=T(e);let i,o=!0,u=!1;for(e=m(e,n.firstRules,{},a);r=o?n.distrDivRules:n.sucDivRules,o=!o,i=(e=m(e,r,{},s)).toString(),i!==t;)u=!0,t=i;u&&(e=m(e,n.firstRulesAgain,{},a)),e=m(e,n.finalRules,{},a)}const u=[],c={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=D(e.args[0],u),e.args[1]=D(e.args[1])),r&&(c.numerator=e.args[0],c.denominator=e.args[1])):(1===o&&(e=D(e,u)),r&&(c.numerator=e,c.denominator=null)),r?(c.coefficients=u,c.variables=i.variables,c.expression=e,c):e}return r(Sh,{Node:C,"Node, boolean":(e,t)=>C(e,{},t),"Node, Object":C,"Node, Object, boolean":C});function T(e,t,r){const n=e.type,i=arguments.length>1;if("OperatorNode"===n&&e.isBinary()){let n,o=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(n=parseFloat(e.args[1].value),o=n>=2&&ye(n))),o){if(n>2){const t=e.args[0],r=new A("^","pow",[e.args[0].cloneDeep(),new v(n-1)]);e=new A("*","multiply",[t,r])}else e=new A("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===r?t.content=e:t.args[r]=e)}}if("ParenthesisNode"===n)T(e.content,e,"content");else if("ConstantNode"!==n&&"SymbolNode"!==n)for(let t=0;tr&&(t[e]=0),t[e]+=a.cte*("+"===a.oper?1:-1),void(r=Math.max(e,r))}a.cte=e,""===a.fire&&(t[0]+=a.cte*("+"===a.oper?1:-1))}}}(e,null,{cte:1,oper:"+",fire:""}),r=t.length-1;let i,o=!0;for(let e=r;e>=0;e--){if(0===t[e])continue;let r=new v(o?t[e]:Math.abs(t[e]));const a=t[e]<0?"-":"+";if(e>0){let i=new S(n);if(e>1){const t=new v(e);i=new A("^","pow",[i,t])}r=-1===t[e]&&o?new A("-","unaryMinus",[i]):1===Math.abs(t[e])?i:new A("*","multiply",[r,i])}i=o?r:"+"===a?new A("+","add",[i,r]):new A("-","subtract",[i,r]),o=!1}return o?new v(0):i}})),Ch="zpk2tf",Th=de(Ch,["typed","add","multiply","Complex","number"],(e=>{let{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(Ch,{"Array,Array,number":function(e,t,r){return a(e,t,r)},"Array,Array":function(e,t){return a(e,t,1)},"Matrix,Matrix,number":function(e,t,r){return a(e.valueOf(),t.valueOf(),r)},"Matrix,Matrix":function(e,t){return a(e.valueOf(),t.valueOf(),1)}});function a(e,t,r){e.some((e=>"BigNumber"===e.type))&&(e=e.map((e=>o(e)))),t.some((e=>"BigNumber"===e.type))&&(t=t.map((e=>o(e))));let a=[i(1,0)],u=[i(1,0)];for(let t=0;t=0&&a-i{let{typed:t,add:r,multiply:n,Complex:i,divide:o,matrix:a}=e;return t(Dh,{"Array, Array":function(e,t){return s(e,t,u(512))},"Array, Array, Array":function(e,t,r){return s(e,t,r)},"Array, Array, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");return s(e,t,u(r))},"Matrix, Matrix":function(e,t){const r=u(512),{w:n,h:i}=s(e.valueOf(),t.valueOf(),r);return{w:a(n),h:a(i)}},"Matrix, Matrix, Matrix":function(e,t,r){const{h:n}=s(e.valueOf(),t.valueOf(),r.valueOf());return{h:a(n),w:a(r)}},"Matrix, Matrix, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");const n=u(r),{h:i}=s(e.valueOf(),t.valueOf(),n);return{h:a(i),w:a(n)}}});function s(e,t,a){const s=[],u=[];for(let o=0;o{let{classes:t}=e;return function(e,r){const n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}})),Bh=de("replacer",[],(()=>function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t:{mathjs:"number",value:String(t)}})),_h=Math.PI,zh=2*Math.PI,Ih=Math.E,kh=de("true",[],(()=>!0)),qh=de("false",[],(()=>!1)),Rh=de("null",[],(()=>null)),Ph=tg("Infinity",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1/0):1/0})),jh=tg("NaN",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(NaN):NaN})),Uh=tg("pi",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?gl(r):_h})),Lh=tg("tau",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?yl(r):zh})),$h=tg("e",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?dl(r):Ih})),Hh=tg("phi",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?hl(r):1.618033988749895})),Gh=tg("LN2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).ln():Math.LN2})),Zh=tg("LN10",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(10).ln():Math.LN10})),Vh=tg("LOG2E",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E})),Wh=tg("LOG10E",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E})),Yh=tg("SQRT1_2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2})),Jh=tg("SQRT2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2})),Xh=tg("i",["Complex"],(e=>{let{Complex:t}=e;return t.I})),Qh=de("PI",["pi"],(e=>{let{pi:t}=e;return t})),Kh=de("E",["e"],(e=>{let{e:t}=e;return t})),eg=de("version",[],(()=>"13.2.0"));function tg(e,t,r){return de(e,t,r,{recreateOnConfigChange:!0})}const rg=Qg("speedOfLight","299792458","m s^-1"),ng=Qg("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),ig=Qg("planckConstant","6.62607015e-34","J s"),og=Qg("reducedPlanckConstant","1.0545718176461565e-34","J s"),ag=Qg("magneticConstant","1.25663706212e-6","N A^-2"),sg=Qg("electricConstant","8.8541878128e-12","F m^-1"),ug=Qg("vacuumImpedance","376.730313667","ohm"),cg=Qg("coulomb","8.987551792261171e9","N m^2 C^-2"),lg=Qg("elementaryCharge","1.602176634e-19","C"),fg=Qg("bohrMagneton","9.2740100783e-24","J T^-1"),pg=Qg("conductanceQuantum","7.748091729863649e-5","S"),mg=Qg("inverseConductanceQuantum","12906.403729652257","ohm"),dg=Qg("magneticFluxQuantum","2.0678338484619295e-15","Wb"),hg=Qg("nuclearMagneton","5.0507837461e-27","J T^-1"),gg=Qg("klitzing","25812.807459304513","ohm"),yg=Qg("bohrRadius","5.29177210903e-11","m"),xg=Qg("classicalElectronRadius","2.8179403262e-15","m"),bg=Qg("electronMass","9.1093837015e-31","kg"),vg=Qg("fermiCoupling","1.1663787e-5","GeV^-2"),wg=Kg("fineStructure",.0072973525693),Ng=Qg("hartreeEnergy","4.3597447222071e-18","J"),Eg=Qg("protonMass","1.67262192369e-27","kg"),Ag=Qg("deuteronMass","3.3435830926e-27","kg"),Sg=Qg("neutronMass","1.6749271613e-27","kg"),Mg=Qg("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Cg=Qg("rydberg","10973731.568160","m^-1"),Tg=Qg("thomsonCrossSection","6.6524587321e-29","m^2"),Dg=Kg("weakMixingAngle",.2229),Fg=Kg("efimovFactor",22.7),Og=Qg("atomicMass","1.66053906660e-27","kg"),Bg=Qg("avogadro","6.02214076e23","mol^-1"),_g=Qg("boltzmann","1.380649e-23","J K^-1"),zg=Qg("faraday","96485.33212331001","C mol^-1"),Ig=Qg("firstRadiation","3.7417718521927573e-16","W m^2"),kg=Qg("loschmidt","2.686780111798444e25","m^-3"),qg=Qg("gasConstant","8.31446261815324","J K^-1 mol^-1"),Rg=Qg("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Pg=Qg("molarVolume","0.022413969545014137","m^3 mol^-1"),jg=Kg("sackurTetrode",-1.16487052358),Ug=Qg("secondRadiation","0.014387768775039337","m K"),Lg=Qg("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),$g=Qg("wienDisplacement","2.897771955e-3","m K"),Hg=Qg("molarMass","0.99999999965e-3","kg mol^-1"),Gg=Qg("molarMassC12","11.9999999958e-3","kg mol^-1"),Zg=Qg("gravity","9.80665","m s^-2"),Vg=Qg("planckLength","1.616255e-35","m"),Wg=Qg("planckMass","2.176435e-8","kg"),Yg=Qg("planckTime","5.391245e-44","s"),Jg=Qg("planckCharge","1.87554603778e-18","C"),Xg=Qg("planckTemperature","1.416785e+32","K");function Qg(e,t,r){return de(e,["config","Unit","BigNumber"],(e=>{let{config:n,Unit:i,BigNumber:o}=e;const a=new i("BigNumber"===n.number?new o(t):parseFloat(t),r);return a.fixPrefix=!0,a}))}function Kg(e,t){return de(e,["config","BigNumber"],(e=>{let{config:r,BigNumber:n}=e;return"BigNumber"===r.number?new n(t):t}))}const ey=de("apply",["typed","isInteger"],(e=>{let{typed:t,isInteger:r}=e;const n=mo({typed:t,isInteger:r});return t("apply",{"...any":function(e){const t=e[1];h(t)?e[1]=t-1:g(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),ty=de("column",["typed","Index","matrix","range"],(e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const o=hs({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(e){const t=e.length-1,r=e[t];h(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0});function ry(e,t,r){const n=e.filter((function(e){return ne(e)&&!(e.name in t)&&!r.has(e.name)}))[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');const i=n.name,o=new Map,a=new f(r,o,new Set([i])),s=e.compile();return function(e){return o.set(i,e),s.evaluate(a)}}r(3921);const ny=de("transformCallback",["typed"],(e=>{let{typed:t}=e;return function(e,n){return t.isTypedFunction(e)?r(e,n):iy(e,e.length,n)};function r(e,n){const i=Object.fromEntries(Object.entries(e.signatures).map((e=>{let[i,o]=e;const a=i.split(",").length;return t.isTypedFunction(o)?[i,r(o,n)]:[i,iy(o,a,n)]})));return"string"==typeof e.name?t(e.name,i):t(i)}}));function iy(e,t,r){return t===r?e:t===r+1?function(){for(var t=arguments.length,n=new Array(t),i=0;ir+1?function(){for(var t=arguments.length,n=new Array(t),i=0;ie+1))}const ay=de("filter",["typed"],(e=>{let{typed:t}=e;function r(e,r,i){const o=Ns({typed:t}),a=ny({typed:t});if(0===e.length)return o();let s=e[0];if(1===e.length)return o(s);const u=e.length-1;let c=e[u];return s&&(s=n(s,i)),c&&(c=ne(c)||W(c)?n(c,i):ry(c,r,i)),o(s,a(c,u))}function n(e,t){return e.compile().evaluate(t)}return r.rawArgs=!0,r}),{isTransformFunction:!0}),sy=de("forEach",["typed"],(e=>{let{typed:t}=e;const r=Cs({typed:t}),n=ny({typed:t});function i(e,t,i){if(0===e.length)return r();let a=e[0];if(1===e.length)return r(a);const s=e.length-1;let u=e[s];return a&&(a=o(a,i)),u&&(u=ne(u)||W(u)?o(u,i):ry(u,t,i)),r(a,n(u,s))}function o(e,t){return e.compile().evaluate(t)}return i.rawArgs=!0,i}),{isTransformFunction:!0}),uy=de("index",["Index","getMatrixDataType"],(e=>{let{Index:t,getMatrixDataType:r}=e;return function(){const e=[];for(let t=0,n=arguments.length;t0?0:2;else if(n&&!0===n.isSet)n=n.map((function(e){return e-1}));else if(N(n)||E(n))"boolean"!==r(n)&&(n=n.map((function(e){return e-1})));else if(h(n))n--;else if(g(n))n=n.toNumber()-1;else if("string"!=typeof n)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=n}const n=new t;return t.apply(n,e),n}}),{isTransformFunction:!0}),cy=de("map",["typed"],(e=>{let{typed:t}=e;const r=ks({typed:t}),n=ny({typed:t});function i(e,t,i){if(0===e.length)return r();if(1===e.length)return r(e[0]);const o=e.length-1;let a=e.slice(0,o),s=e[o];return a=a.map((e=>u(e,i))),s&&(s=ne(s)||W(s)?u(s,i):ry(s,t,i)),r(...a,n(s,o));function u(e,t){return e.compile().evaluate(t)}}return i.rawArgs=!0,i}),{isTransformFunction:!0});function ly(e){if(2===e.length&&A(e[0])){const r=(e=e.slice())[1];(h(t=r)||g(t))&&(e[1]=function(e){return h(e)?e-1:g(e)?e.minus(1):e}(r))}var t;return e}const fy=de("max",["typed","config","numeric","larger"],(e=>{let{typed:t,config:r,numeric:n,larger:i}=e;const o=ol({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(e){e=ly(e);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),py=de("mean",["typed","add","divide"],(e=>{let{typed:t,add:r,divide:n}=e;const i=ud({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=ly(e);try{return i.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),my=de("min",["typed","config","numeric","smaller"],(e=>{let{typed:t,config:r,numeric:n,smaller:i}=e;const o=al({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(e){e=ly(e);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),dy=de("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(e=>{let{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:a,larger:s,largerEq:u,add:c,isPositive:l}=e;const f=Hs({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:a,larger:s,largerEq:u,add:c,isPositive:l});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),f.apply(null,e)}})}),{isTransformFunction:!0}),hy=de("row",["typed","Index","matrix","range"],(e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const o=Qs({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(e){const t=e.length-1,r=e[t];h(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),gy=de("subset",["typed","matrix","zeros","add"],(e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const o=iu({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(e){try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),yy=de("concat",["typed","matrix","isInteger"],(e=>{let{typed:t,matrix:r,isInteger:n}=e;const i=ms({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(e){const t=e.length-1,r=e[t];h(r)?e[t]=r-1:g(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),xy="diff",by=de(xy,["typed","matrix","subtract","number","bignumber"],(e=>{let{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e;const a=Rs({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(xy,{"...any":function(e){e=ly(e);try{return a.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),vy=de("std",["typed","map","sqrt","variance"],(e=>{let{typed:t,map:r,sqrt:n,variance:i}=e;const o=yd({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(e){e=ly(e);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),wy=de("sum",["typed","config","add","numeric"],(e=>{let{typed:t,config:r,add:n,numeric:i}=e;const o=id({typed:t,config:r,add:n,numeric:i});return t("sum",{"...any":function(e){e=ly(e);try{return o.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),Ny=de("quantileSeq",["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(e=>{let{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p}=e;const m=gd({typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(e,t,r)=>m(e,t,d(r)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>m(e,t,r,d(n)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(e,t,r)=>m(e,t,d(r)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>m(e,t,r,d(n))});function d(e){return ly([[],e])[1]}}),{isTransformFunction:!0}),Ey="cumsum",Ay=de(Ey,["typed","add","unaryPlus"],(e=>{let{typed:t,add:r,unaryPlus:n}=e;const i=ad({typed:t,add:r,unaryPlus:n});return t(Ey,{"...any":function(e){if(2===e.length&&A(e[0])){const t=e[1];h(t)?e[1]=t-1:g(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),Sy="variance",My=de(Sy,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{let{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:a,isNaN:s}=e;const u=dd({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:a,isNaN:s});return t(Sy,{"...any":function(e){e=ly(e);try{return u.apply(null,e)}catch(e){throw fp(e)}}})}),{isTransformFunction:!0}),Cy="print",Ty=de(Cy,["typed","matrix","zeros","add"],(e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const o=Pu({typed:t,matrix:r,zeros:n,add:i});return t(Cy,{"string, Object | Array":function(e,t){return o(a(e),t)},"string, Object | Array, number | Object":function(e,t,r){return o(a(e),t,r)}});function a(e){return e.replace(qu,(e=>"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")))}}),{isTransformFunction:!0}),Dy=de("and",["typed","matrix","zeros","add","equalScalar","not","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:a}=e;const s=Ec({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:a});function u(e,t,r){const n=e[0].compile().evaluate(r);if(!A(n)&&!s(n,!0))return!1;const i=e[1].compile().evaluate(r);return s(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0}),Fy=de("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e;const a=ls({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function s(e,t,r){const n=e[0].compile().evaluate(r);if(!A(n)&&a(n,!1))return!0;const i=e[1].compile().evaluate(r);return a(n,i)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Oy=de("bitAnd",["typed","matrix","zeros","add","equalScalar","not","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:a}=e;const s=Ga({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:a});function u(e,t,r){const n=e[0].compile().evaluate(r);if(!A(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}const i=e[1].compile().evaluate(r);return s(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0}),By=de("bitOr",["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e;const a=Ya({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function s(e,t,r){const n=e[0].compile().evaluate(r);if(!A(n)){if(isNaN(n))return NaN;if(-1===n)return-1;if(!0===n)return 1}const i=e[1].compile().evaluate(r);return a(n,i)}return s.rawArgs=!0,s}),{isTransformFunction:!0});var _y=r(1504);const zy={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null},Iy=["Matrix","Array"],ky=["number","BigNumber","Fraction"];function qy(e,t){function r(n){if(n){if(void 0!==n.epsilon){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');const e=ae(n);return e.relTol=n.epsilon,e.absTol=.001*n.epsilon,delete e.epsilon,r(e)}const i=ae(e);Ry(n,"matrix",Iy),Ry(n,"number",ky),ue(e,n);const o=ae(e),a=ae(n);return t("config",o,i,a),o}return ae(e)}return r.MATRIX_OPTIONS=Iy,r.NUMBER_OPTIONS=ky,Object.keys(zy).forEach((t=>{Object.defineProperty(r,t,{get:()=>e[t],enumerable:!0,configurable:!0})})),r}function Ry(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map((e=>JSON.stringify(e))).join(", ")+".")}const Py=function e(r,n){const i=Wr({},zy,n);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");const o=function(e){const t=new _y;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}({isNumber:h,isComplex:x,isBigNumber:g,isBigInt:y,isFraction:b,isUnit:v,isString:w,isArray:N,isMatrix:E,isCollection:A,isDenseMatrix:S,isSparseMatrix:M,isRange:C,isIndex:T,isBoolean:D,isResultSet:F,isHelp:O,isFunction:B,isDate:_,isRegExp:z,isObject:I,isMap:k,isPartitionedMap:q,isObjectWrappingMap:R,isNull:P,isUndefined:j,isAccessorNode:U,isArrayNode:L,isAssignmentNode:$,isBlockNode:H,isConditionalNode:G,isConstantNode:Z,isFunctionAssignmentNode:W,isFunctionNode:Y,isIndexNode:J,isNode:X,isObjectNode:Q,isOperatorNode:K,isParenthesisNode:ee,isRangeNode:te,isRelationalNode:re,isSymbolNode:ne,isChain:ie});o.config=qy(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};const a={};function s(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:t.fn;if(o.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(o));const s=l(t)?r.expression.transform:r,u=o in r.expression.transform,f=me(s,o)?s[o]:void 0,p=function(){const n={};t.dependencies.map(ge).forEach((e=>{if(e.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=r:"mathWithTransform"===e?n.mathWithTransform=r.expression.mathWithTransform:"classes"===e?n.classes=r:n[e]=r[e]}));const a=t(n);if(a&&"function"==typeof a.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(void 0===f||i.override)return a;if(e.isTypedFunction(f)&&e.isTypedFunction(a))return e(f,a);if(i.silent)return f;throw new Error('Cannot import "'+o+'": already exists')};t.meta&&!1===t.meta.lazy?(s[o]=p(),f&&u?a(o):(l(t)||c(t))&&pe(r.expression.mathWithTransform,o,(()=>s[o]))):(pe(s,o,p),f&&u?a(o):(l(t)||c(t))&&pe(r.expression.mathWithTransform,o,(()=>s[o]))),n[o]=t,r.emit("import",o,p)}function u(e){return!me(f,e)}function c(e){return!(e.fn.includes(".")||me(f,e.fn)||e.meta&&e.meta.isClass)}function l(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}const f={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,t){const r=arguments.length;if(1!==r&&2!==r)throw new Qo("import",r,1,2);t||(t={});const n={};!function e(r,n,i){if(Array.isArray(n))n.forEach((t=>e(r,t)));else if("object"==typeof n)for(const t in n)me(n,t)&&e(r,n[t],t);else if(he(n)||void 0!==i){const e=he(n)?l(n)?n.fn+".transform":n.fn:i;if(me(r,e)&&r[e]!==n&&!t.silent)throw new Error('Cannot import "'+e+'" twice');r[e]=n}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}(n,e);for(const e in n)if(me(n,e)){const r=n[e];if(he(r))s(r,t);else if("function"==typeof(o=r)||"number"==typeof o||"string"==typeof o||"boolean"==typeof o||null===o||v(o)||x(o)||g(o)||b(o)||E(o)||Array.isArray(o))i(e,r,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}var o}}(s,0,o,a);return o.import=u,o.on("config",(()=>{Object.values(a).forEach((e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&u(e,{override:!0})}))})),o.create=e.bind(null,r),o.factory=de,o.import(Object.values(le(r))),o.ArgumentsError=Qo,o.DimensionError=an,o.IndexError=sn,o}(e)})(),n.default})())); +//# sourceMappingURL=math.js.map \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.LICENSE.txt b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.LICENSE.txt new file mode 100644 index 0000000..0730d65 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.LICENSE.txt @@ -0,0 +1,49 @@ +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ + +/** + * @license Complex.js v2.1.1 12/05/2020 + * + * Copyright (c) 2020, Robert Eisele (robert@xarg.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + +/** + * @license Fraction.js v4.3.7 31/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + +/** + * math.js + * https://github.com/josdejong/mathjs + * + * Math.js is an extensive math library for JavaScript and Node.js, + * It features real and complex numbers, units, matrices, a large set of + * mathematical functions, and a flexible expression parser. + * + * @version 13.2.0 + * @date 2024-10-02 + * + * @license + * Copyright (C) 2013-2024 Jos de Jong + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.map b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.map new file mode 100644 index 0000000..52766a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/math.js.map @@ -0,0 +1 @@ +{"version":3,"file":"math.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAc,KAAID,IAElBD,EAAW,KAAIC,GAChB,CATD,CASGK,MAAM,IACT,gCCVA,OAmCA,WAEE,aAEA,IAAIC,EAAOC,KAAKD,MAAQ,SAASE,GAC/B,OAAOD,KAAKE,IAAID,GAAK,KAAO,EAAIA,EAAmC,IAA9BD,KAAKG,IAAIF,GAAKD,KAAKG,KAAKF,GAC/D,EAEIG,EAAOJ,KAAKI,MAAQ,SAASH,GAC/B,OAAOD,KAAKE,IAAID,GAAK,KAAOA,EAAmC,IAA9BD,KAAKG,IAAIF,GAAKD,KAAKG,KAAKF,GAC3D,EA+DII,EAAc,WAChB,MAAMC,YAAY,gBACpB,EASA,SAASC,EAASC,EAAGC,GAEnB,IAAIC,EAAKV,KAAKE,IAAIM,GACdG,EAAKX,KAAKE,IAAIO,GAElB,OAAU,IAAND,EACKR,KAAKY,IAAID,GAGR,I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7XsB,CACtBt/B,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,WAEFluB,YAAa,gFACbqrF,SAAU,CACR,gBACA,WACA,qBACA,aAEFK,QAAS,CACP,MACA,QACA,MACA,UhE6WFxzE,MiE9XuB,CACvBz/B,KAAM,QACNiuB,SAAU,aACVwnB,OAAQ,CACN,WACA,kBAEFluB,YAAa,yCACbqrF,SAAU,CACR,aACA,kBACA,aACA,kBACA,yBAEFK,QAAS,CACP,MACA,MACA,OACA,UjE4WF1zE,MkE/XuB,CACvBv/B,KAAM,QACNiuB,SAAU,aACVwnB,OAAQ,CACN,YAEFluB,YAAa,4CACbqrF,SAAU,CACR,iBACA,eACA,SACA,uBACA,kBAEFK,QAAS,CACP,MACA,QlEgXFvnE,ImEhYqB,CACrB1rC,KAAM,MACNiuB,SAAU,YACVwnB,OAAQ,CACN,QACA,UACA,aAEFluB,YACI,gEACJqrF,SAAU,CACR,QACA,SACA,WACA,mBACA,WACA,YAEFK,QAAS,CAAC,WnE+WVvkD,SoEjY0B,CAC1B1uD,KAAM,WACNiuB,SAAU,YACVwnB,OAAQ,CACN,QACA,kBAEFluB,YAAa,uBACbqrF,SAAU,CACR,gBACA,UACA,YACA,cACA,cAEFK,QAAS,CACP,WpEkXFt3C,KqElYsB,CACtB37D,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,UACA,cAEFluB,YAAa,oDACbqrF,SAAU,CACR,YACA,aACA,eACA,6BACA,8BACA,kBACA,4BACA,gCACA,kCrEkXF/V,QsEnYyB,CACzB78F,KAAM,UACNiuB,SAAU,aACVwnB,OAAQ,CACN,aACA,oBAEFluB,YAAa,qJAGbqrF,SAAU,CACR,QACA,iBACA,gBACA,WAEFK,QAAS,CACP,WACA,MACA,StEiXFnW,SuEpY0B,CAC1B98F,KAAM,WACNiuB,SAAU,aACVwnB,OAAQ,CACN,cACA,qBAEFluB,YAAc,2LAMdqrF,SAAU,CACR,cACA,kBAEFK,QAAS,CACP,OACA,MACA,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,SACNiuB,SAAU,SACVwnB,OAAQ,CACN,mBAEFluB,YAAa,2DACbqrF,SAAU,CACR,8BACA,2BACA,sCAEFK,QAAS,IxLqgBT8G,MyLjhBuB,CACvB/5G,KAAM,QACNiuB,SAAU,SACVwnB,OAAQ,CACN,cACA,kBAEFluB,YAAa,kGACbqrF,SAAU,CACR,2BACA,mCACA,iCAEFK,QAAS,IzLugBTrV,I0LphBqB,CACrB59F,KAAM,MACNiuB,SAAU,UACVwnB,OAAQ,CACN,UAEFluB,YAAa,6GACbqrF,SAAU,CACR,WACA,YACA,UAEFK,QAAS,I1LygBTzvC,K2LrhBsB,CACtBxjE,KAAM,OACNiuB,SAAU,UACVwnB,OAAQ,CACN,WAEFluB,YAAa,4HACbqrF,SAAU,CACR,YACA,aACA,WAEFK,QAAS,I3L4gBT+G,O4LxhBwB,CACxBh6G,KAAM,SACNiuB,SAAU,aACVwnB,OAAQ,CACN,uBACA,aAEFluB,YAAa,4CACbqrF,SAAU,CACR,qBACA,uBACA,uBACA,0BACA,2BAEFK,QAAS,CACP,MACA,OACA,SACA,MACA,OACA,MACA,MACA,a5LkgBFgH,I6LzhBqB,CACrBj6G,KAAM,MACNiuB,SAAU,aACVwnB,OAAQ,CACN,oBACA,UAEFluB,YAAa,8KACbqrF,SAAU,CACR,kBACA,kBAEFK,QAAS,CACP,OACA,SACA,MACA,Q7L0gBF14G,I8L1hBqB,CACrByF,KAAM,MACNiuB,SAAU,aACVwnB,OAAQ,CACN,oBACA,SACA,qBAEFluB,YAAa,iDACbqrF,SAAU,CACR,kBACA,oBACA,oBACA,uBACA,uBACA,gCACA,iCAEFK,QAAS,CACP,OACA,SACA,MACA,OACA,MACA,MACA,a9LkgBFiH,K+L3hBsB,CACtBl6G,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,qBACA,UACA,sBAEFluB,YAAa,mDACbqrF,SAAU,CACR,mBACA,qBACA,qBACA,wBACA,wBACA,8BAEFK,QAAS,CACP,MACA,SACA,MACA,OACA,MACA,MACA,a/LogBFkH,OgM5hBwB,CACxBn6G,KAAM,SACNiuB,SAAU,aACVwnB,OAAQ,CACN,uBACA,aAEFluB,YAAa,mLACbqrF,SAAU,CACR,kBACA,yBAEFK,QAAS,CACP,MACA,OACA,MACA,OACA,MACA,MACA,WACA,gBhMygBFt1F,IiM7hBqB,CACrB3d,KAAM,MACNiuB,SAAU,aACVwnB,OAAQ,CACN,oBACA,SACA,qBAEFluB,YAAa,iDACbqrF,SAAU,CACR,kBACA,oBACA,oBACA,uBACA,uBACA,gCACA,iCAEFK,QAAS,CACP,MACA,OACA,SACA,OACA,MACA,MACA,ajMqgBFp4F,KkM9hBsB,CACtB7a,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,qBACA,UACA,4BAEFluB,YAAa,2HACbqrF,SAAU,CACR,sBACA,8BACA,uBAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,OACA,MACA,MACA,alMygBF7kE,KmM/hBsB,CACtBpuC,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,qBACA,WAEFluB,YAAa,qCACbqrF,SAAU,CACR,gBACA,kBACA,sBAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,MACA,MACA,anM2gBFmH,YoMhiB6B,CAC7Bp6G,KAAM,cACNiuB,SAAU,aACVwnB,OAAQ,CACN,iCACA,gDACA,+BAEFluB,YAAa,uWACbqrF,SAAU,CACR,kCACA,yCACA,gCACA,yCAEFK,QAAS,CACP,OACA,SACA,MACA,MACA,OACA,MACA,MACA,apM0gBFoH,IqMjiBqB,CACrBr6G,KAAM,MACNiuB,SAAU,aACVwnB,OAAQ,CACN,oBACA,SACA,oBACA,wBACA,oCAEFluB,YAAa,iLACbqrF,SAAU,CACR,eACA,oBACA,mCACA,8BACA,2BAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,OACA,MACA,arMygBFvjE,IsMliBqB,CACrB1vC,KAAM,MACNiuB,SAAU,aACVwnB,OAAQ,CACN,oBACA,SACA,qBAEFluB,YAAa,iCACbqrF,SAAU,CACR,kBACA,oBACA,qBAEFK,QAAS,CACP,MACA,OACA,SACA,MACA,OACA,MACA,MACA,atM6gBFpV,SuMniB0B,CAC1B79F,KAAM,WACNiuB,SAAU,aACVwnB,OAAQ,CACN,yBACA,cACA,yBACA,6BACA,yCAEFluB,YAAa,gIACbqrF,SAAU,CACR,oBACA,yBACA,wCACA,mCACA,gCAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,OACA,MACA,QvM0gBFqH,KwMpiBsB,CACtBt6G,KAAM,OACNiuB,SAAU,aACVwnB,OAAQ,CACN,aAEFluB,YAAa,iIACbqrF,SAAU,CACR,kCACA,wGAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,OACA,MACA,QxMohBF98G,KyMviBsB,CACtB6J,KAAM,OACNiuB,SAAU,eACVwnB,OAAQ,CACN,WAEFluB,YAAa,oDACbqrF,SAAU,CACR,YACA,kBAEFK,QAAS,CACP,MACA,OACA,SzM0hBFr8G,M0MxiBuB,CACvBoJ,KAAM,QACNiuB,SAAU,eACVwnB,OAAQ,CACN,YAEFluB,YAAa,6FACbqrF,SAAU,CACR,cAEFK,QAAS,CACP,OACA,QACA,U1M4hBF5mB,K2MziBsB,CACtBrsF,KAAM,OACNiuB,SAAU,eACVwnB,OAAQ,CACN,WAEFluB,YAAa,8CACbqrF,SAAU,CACR,YACA,iBACA,WAEFK,QAAS,CACP,MACA,S3M4hBF1mB,M4M1iBuB,CACvBvsF,KAAM,QACNiuB,SAAU,eACVwnB,OAAQ,CACN,YAEFluB,YAAa,gHACbqrF,SAAU,CACR,WACA,cAEFK,QAAS,CACP,QACA,U5M8hBFxmB,K6M3iBsB,CACtBzsF,KAAM,OACNiuB,SAAU,eACVwnB,OAAQ,CACN,WAEFluB,YAAa,8CACbqrF,SAAU,CACR,UACA,iBACA,aAEFK,QAAS,CACP,MACA,OACA,S7M6hBFtmB,M8M5iBuB,CACvB3sF,KAAM,QACNiuB,SAAU,e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AOkqB,OAAOmc,GAAYmtG,KAEtC5tI,EAAKkwD,eAAiBA,GACtBlwD,EAAK84C,eAAiBA,GACtB94C,EAAKi5C,WAAaA,GAEXj5C,CACT,CD3PA,CAAsBqR,kB5yBOtB","sources":["webpack://math/webpack/universalModuleDefinition","webpack://math/./node_modules/complex.js/complex.js","webpack://math/./node_modules/escape-latex/dist/index.js","webpack://math/./node_modules/javascript-natural-sort/naturalSort.js","webpack://math/./node_modules/seedrandom/index.js","webpack://math/./node_modules/seedrandom/lib/alea.js","webpack://math/./node_modules/seedrandom/lib/tychei.js","webpack://math/./node_modules/seedrandom/lib/xor128.js","webpack://math/./node_modules/seedrandom/lib/xor4096.js","webpack://math/./node_modules/seedrandom/lib/xorshift7.js","webpack://math/./node_modules/seedrandom/lib/xorwow.js","webpack://math/./node_modules/seedrandom/seedrandom.js","webpack://math/./node_modules/tiny-emitter/index.js","webpack://math/./node_modules/core-js/internals/a-callable.js","webpack://math/./node_modules/core-js/internals/a-constructor.js","webpack://math/./node_modules/core-js/internals/a-possible-prototype.js","webpack://math/./node_modules/core-js/internals/add-to-unscopables.js","webpack://math/./node_modules/core-js/internals/advance-string-index.js","webpack://math/./node_modules/core-js/internals/an-instance.js","webpack://math/./node_modules/core-js/internals/an-object.js","webpack://math/./node_modules/core-js/internals/array-includes.js","webpack://math/./node_modules/core-js/internals/array-method-is-strict.js","webpack://math/./node_modules/core-js/internals/array-reduce.js","webpack://math/./node_modules/core-js/internals/array-slice.js","webpack://math/./node_modules/core-js/internals/array-sort.js","webpack://math/./node_modules/core-js/internals/check-correctness-of-iteration.js","webpack://math/./node_modules/core-js/internals/classof-raw.js","webpack://math/./node_modules/core-js/internals/classof.js","webpack://math/./node_modules/core-js/internals/copy-constructor-properties.js","webpack://math/./node_modules/core-js/internals/create-non-enumerable-property.js","webpack://math/./node_modules/core-js/internals/create-property-descriptor.js","webpack://math/./node_modules/core-js/internals/create-property.js","webpack://math/./node_modules/core-js/internals/define-built-in-accessor.js","webpack://math/./node_modules/core-js/internals/define-built-in.js","webpack://math/./node_modules/core-js/internals/define-global-property.js","webpack://math/./node_modules/core-js/internals/delete-property-or-throw.js","webpack://math/./node_modules/core-js/internals/descriptors.js","webpack://math/./node_modules/core-js/internals/document-create-element.js","webpack://math/./node_modules/core-js/internals/enum-bug-keys.js","webpack://math/./node_modules/core-js/internals/environment-ff-version.js","webpack://math/./node_modules/core-js/internals/environment-is-ie-or-edge.js","webpack://math/./node_modules/core-js/internals/environment-is-ios-pebble.js","webpack://math/./node_modules/core-js/internals/environment-is-ios.js","webpack://math/./node_modules/core-js/internals/environment-is-node.js","webpack://math/./node_modules/core-js/internals/environment-is-webos-webkit.js","webpack://math/./node_modules/core-js/internals/environment-user-agent.js","webpack://math/./node_modules/core-js/internals/environment-v8-version.js","webpack://math/./node_modules/core-js/internals/environment-webkit-version.js","webpack://math/./node_modules/core-js/internals/environment.js","webpack://math/./node_modules/core-js/internals/export.js","webpack://math/./node_modules/core-js/internals/fails.js","webpack://math/./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js","webpack://math/./node_modules/core-js/internals/function-apply.js","webpack://math/./node_modules/core-js/internals/function-bind-context.js","webpack://math/./node_modules/core-js/internals/function-bind-native.js","webpack://math/./node_modules/core-js/internals/function-call.js","webpack://math/./node_modules/core-js/internals/function-name.js","webpack://math/./node_modules/core-js/internals/function-uncurry-this-accessor.js","webpack://math/./node_modules/core-js/internals/function-uncurry-this-clause.js","webpack://math/./node_modules/core-js/internals/function-uncurry-this.js","webpack://math/./node_modules/core-js/internals/get-built-in.js","webpack://math/./node_modules/core-js/internals/get-iterator-method.js","webpack://math/./node_modules/core-js/internals/get-iterator.js","webpack://math/./node_modules/core-js/internals/get-json-replacer-function.js","webpack://math/./node_modules/core-js/internals/get-method.js","webpack://math/./node_modules/core-js/internals/get-substitution.js","webpack://math/./node_modules/core-js/internals/global-this.js","webpack://math/./node_modules/core-js/internals/has-own-property.js","webpack://math/./node_modules/core-js/internals/hidden-keys.js","webpack://math/./node_modules/core-js/internals/host-report-errors.js","webpack://math/./node_modules/core-js/internals/html.js","webpack://math/./node_modules/core-js/internals/ie8-dom-define.js","webpack://math/./node_modules/core-js/internals/indexed-object.js","webpack://math/./node_modules/core-js/internals/inherit-if-required.js","webpack://math/./node_modules/core-js/internals/inspect-source.js","webpack://math/./node_modules/core-js/internals/internal-state.js","webpack://math/./node_modules/core-js/internals/is-array-iterator-method.js","webpack://math/./node_modules/core-js/internals/is-array.js","webpack://math/./node_modules/core-js/internals/is-callable.js","webpack://math/./node_modules/core-js/internals/is-constructor.js","webpack://math/./node_modules/core-js/internals/is-forced.js","webpack://math/./node_modules/core-js/internals/is-null-or-undefined.js","webpack://math/./node_modules/core-js/internals/is-object.js","webpack://math/./node_modules/core-js/internals/is-possible-prototype.js","webpack://math/./node_modules/core-js/internals/is-pure.js","webpack://math/./node_modules/core-js/internals/is-regexp.js","webpack://math/./node_modules/core-js/internals/is-symbol.js","webpack://math/./node_modules/core-js/internals/iterate.js","webpack://math/./node_modules/core-js/internals/iterator-close.js","webpack://math/./node_modules/core-js/internals/iterators.js","webpack://math/./node_modules/core-js/internals/length-of-array-like.js","webpack://math/./node_modules/core-js/internals/make-built-in.js","webpack://math/./node_modules/core-js/internals/math-trunc.js","webpack://math/./node_modules/core-js/internals/microtask.js","webpack://math/./node_modules/core-js/internals/new-promise-capability.js","webpack://math/./node_modules/core-js/internals/object-create.js","webpack://math/./node_modules/core-js/internals/object-define-properties.js","webpack://math/./node_modules/core-js/internals/object-define-property.js","webpack://math/./node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://math/./node_modules/core-js/internals/object-get-own-property-names.js","webpack://math/./node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://math/./node_modules/core-js/internals/object-is-prototype-of.js","webpack://math/./node_modules/core-js/internals/object-keys-internal.js","webpack://math/./node_modules/core-js/internals/object-keys.js","webpack://math/./node_modules/core-js/internals/object-property-is-enumerable.js","webpack://math/./node_modules/core-js/internals/object-set-prototype-of.js","webpack://math/./node_modules/core-js/internals/ordinary-to-primitive.js","webpack://math/./node_modules/core-js/internals/own-keys.js","webpack://math/./node_modules/core-js/internals/perform.js","webpack://math/./node_modules/core-js/internals/promise-constructor-detection.js","webpack://math/./node_modules/core-js/internals/promise-native-constructor.js","webpack://math/./node_modules/core-js/internals/promise-resolve.js","webpack://math/./node_modules/core-js/internals/promise-statics-incorrect-iteration.js","webpack://math/./node_modules/core-js/internals/proxy-accessor.js","webpack://math/./node_modules/core-js/internals/queue.js","webpack://math/./node_modules/core-js/internals/regexp-exec-abstract.js","webpack://math/./node_modules/core-js/internals/regexp-exec.js","webpack://math/./node_modules/core-js/internals/regexp-flags.js","webpack://math/./node_modules/core-js/internals/regexp-get-flags.js","webpack://math/./node_modules/core-js/internals/regexp-sticky-helpers.js","webpack://math/./node_modules/core-js/internals/regexp-unsupported-dot-all.js","webpack://math/./node_modules/core-js/internals/regexp-unsupported-ncg.js","webpack://math/./node_modules/core-js/internals/require-object-coercible.js","webpack://math/./node_modules/core-js/internals/safe-get-built-in.js","webpack://math/./node_modules/core-js/internals/set-species.js","webpack://math/./node_modules/core-js/internals/set-to-string-tag.js","webpack://math/./node_modules/core-js/internals/shared-key.js","webpack://math/./node_modules/core-js/internals/shared-store.js","webpack://math/./node_modules/core-js/internals/shared.js","webpack://math/./node_modules/core-js/internals/species-constructor.js","webpack://math/./node_modules/core-js/internals/string-multibyte.js","webpack://math/./node_modules/core-js/internals/symbol-constructor-detection.js","webpack://math/./node_modules/core-js/internals/task.js","webpack://math/./node_modules/core-js/internals/to-absolute-index.js","webpack://math/./node_modules/core-js/internals/to-indexed-object.js","webpack://math/./node_modules/core-js/internals/to-integer-or-infinity.js","webpack://math/./node_modules/core-js/internals/to-length.js","webpack://math/./node_modules/core-js/internals/to-object.js","webpack://math/./node_modules/core-js/internals/to-primitive.js","webpack://math/./node_modules/core-js/internals/to-property-key.js","webpack://math/./node_modules/core-js/internals/to-string-tag-support.js","webpack://math/./node_modules/core-js/internals/to-string.js","webpack://math/./node_modules/core-js/internals/try-to-string.js","webpack://math/./node_modules/core-js/internals/uid.js","webpack://math/./node_modules/core-js/internals/use-symbol-as-uid.js","webpack://math/./node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://math/./node_modules/core-js/internals/validate-arguments-length.js","webpack://math/./node_modules/core-js/internals/weak-map-basic-detection.js","webpack://math/./node_modules/core-js/internals/well-known-symbol.js","webpack://math/./node_modules/core-js/modules/es.array.includes.js","webpack://math/./node_modules/core-js/modules/es.array.reduce.js","webpack://math/./node_modules/core-js/modules/es.array.sort.js","webpack://math/./node_modules/core-js/modules/es.json.stringify.js","webpack://math/./node_modules/core-js/modules/es.object.from-entries.js","webpack://math/./node_modules/core-js/modules/es.promise.all.js","webpack://math/./node_modules/core-js/modules/es.promise.catch.js","webpack://math/./node_modules/core-js/modules/es.promise.constructor.js","webpack://math/./node_modules/core-js/modules/es.promise.js","webpack://math/./node_modules/core-js/modules/es.promise.race.js","webpack://math/./node_modules/core-js/modules/es.promise.reject.js","webpack://math/./node_modules/core-js/modules/es.promise.resolve.js","webpack://math/./node_modules/core-js/modules/es.regexp.constructor.js","webpack://math/./node_modules/core-js/modules/es.regexp.dot-all.js","webpack://math/./node_modules/core-js/modules/es.regexp.exec.js","webpack://math/./node_modules/core-js/modules/es.string.replace.js","webpack://math/./node_modules/core-js/modules/es.symbol.description.js","webpack://math/./node_modules/typed-function/lib/umd/typed-function.js","webpack://math/webpack/bootstrap","webpack://math/webpack/runtime/amd define","webpack://math/webpack/runtime/amd options","webpack://math/webpack/runtime/define property getters","webpack://math/webpack/runtime/hasOwnProperty shorthand","webpack://math/webpack/runtime/make namespace object","webpack://math/webpack/runtime/node module decorator","webpack://math/./src/utils/customs.js","webpack://math/./src/utils/map.js","webpack://math/./src/utils/is.js","webpack://math/./src/utils/object.js","webpack://math/./src/utils/factory.js","webpack://math/./src/utils/number.js","webpack://math/./src/core/function/typed.js","webpack://math/./src/type/resultset/ResultSet.js","webpack://math/./node_modules/decimal.js/decimal.mjs","webpack://math/./src/type/bignumber/BigNumber.js","webpack://math/./src/type/complex/Complex.js","webpack://math/./node_modules/fraction.js/fraction.js","webpack://math/./src/type/fraction/Fraction.js","webpack://math/./src/type/matrix/Range.js","webpack://math/./src/type/matrix/Matrix.js","webpack://math/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://math/./src/utils/bignumber/formatter.js","webpack://math/./src/utils/string.js","webpack://math/./src/error/DimensionError.js","webpack://math/./src/error/IndexError.js","webpack://math/./src/utils/array.js","webpack://math/./src/utils/optimizeCallback.js","webpack://math/./src/type/matrix/DenseMatrix.js","webpack://math/./src/function/utils/clone.js","webpack://math/./src/utils/switch.js","webpack://math/./src/utils/collection.js","webpack://math/./src/function/utils/isInteger.js","webpack://math/./src/plain/number/utils.js","webpack://math/./src/utils/bignumber/nearlyEqual.js","webpack://math/./src/function/utils/isNegative.js","webpack://math/./src/function/utils/isNumeric.js","webpack://math/./src/function/utils/hasNumericValue.js","webpack://math/./src/function/utils/isPositive.js","webpack://math/./src/function/utils/isZero.js","webpack://math/./src/function/utils/isNaN.js","webpack://math/./src/function/utils/typeOf.js","webpack://math/./src/function/relational/compareUnits.js","webpack://math/./src/function/relational/equalScalar.js","webpack://math/./src/utils/complex.js","webpack://math/./src/type/matrix/SparseMatrix.js","webpack://math/./src/type/number.js","webpack://math/./src/type/bigint.js","webpack://math/./src/type/string.js","webpack://math/./src/type/boolean.js","webpack://math/./src/type/bignumber/function/bignumber.js","webpack://math/./src/type/complex/function/complex.js","webpack://math/./src/type/fraction/function/fraction.js","webpack://math/./src/type/matrix/function/matrix.js","webpack://math/./src/function/matrix/matrixFromFunction.js","webpack://math/./src/function/matrix/matrixFromRows.js","webpack://math/./src/function/matrix/matrixFromColumns.js","webpack://math/./src/type/unit/function/splitUnit.js","webpack://math/./src/plain/number/arithmetic.js","webpack://math/./src/function/arithmetic/unaryMinus.js","webpack://math/./src/function/arithmetic/unaryPlus.js","webpack://math/./src/function/arithmetic/abs.js","webpack://math/./src/function/matrix/apply.js","webpack://math/./src/function/arithmetic/addScalar.js","webpack://math/./src/function/arithmetic/subtractScalar.js","webpack://math/./src/function/arithmetic/cbrt.js","webpack://math/./src/type/matrix/utils/matAlgo11xS0s.js","webpack://math/./src/type/matrix/utils/matAlgo12xSfs.js","webpack://math/./src/type/matrix/utils/matAlgo14xDs.js","webpack://math/./src/function/arithmetic/ceil.js","webpack://math/./src/function/arithmetic/cube.js","webpack://math/./src/function/arithmetic/exp.js","webpack://math/./src/function/arithmetic/expm1.js","webpack://math/./src/function/arithmetic/fix.js","webpack://math/./src/function/arithmetic/floor.js","webpack://math/./src/type/matrix/utils/matAlgo02xDS0.js","webpack://math/./src/type/matrix/utils/matAlgo03xDSf.js","webpack://math/./src/type/matrix/utils/matAlgo05xSfSf.js","webpack://math/./src/type/matrix/utils/matAlgo13xDD.js","webpack://math/./src/type/matrix/utils/broadcast.js","webpack://math/./src/type/matrix/utils/matrixAlgorithmSuite.js","webpack://math/./src/function/arithmetic/mod.js","webpack://math/./src/type/matrix/utils/matAlgo01xDSid.js","webpack://math/./src/type/matrix/utils/matAlgo04xSidSid.js","webpack://math/./src/type/matrix/utils/matAlgo10xSids.js","webpack://math/./src/error/ArgumentsError.js","webpack://math/./src/function/arithmetic/gcd.js","webpack://math/./src/type/matrix/utils/matAlgo06xS0S0.js","webpack://math/./src/function/arithmetic/lcm.js","webpack://math/./src/function/arithmetic/log10.js","webpack://math/./src/function/arithmetic/log2.js","webpack://math/./src/function/arithmetic/multiplyScalar.js","webpack://math/./src/function/arithmetic/multiply.js","webpack://math/./src/function/arithmetic/nthRoot.js","webpack://math/./src/function/arithmetic/sign.js","webpack://math/./src/function/arithmetic/sqrt.js","webpack://math/./src/function/arithmetic/square.js","webpack://math/./src/function/arithmetic/subtract.js","webpack://math/./src/function/arithmetic/xgcd.js","webpack://math/./src/function/arithmetic/invmod.js","webpack://math/./src/type/matrix/utils/matAlgo09xS0Sf.js","webpack://math/./src/function/arithmetic/dotMultiply.js","webpack://math/./src/utils/bignumber/bitwise.js","webpack://math/./src/plain/number/bitwise.js","webpack://math/./src/function/bitwise/bitAnd.js","webpack://math/./src/function/bitwise/bitNot.js","webpack://math/./src/function/bitwise/bitOr.js","webpack://math/./src/type/matrix/utils/matAlgo07xSSf.js","webpack://math/./src/function/bitwise/bitXor.js","webpack://math/./src/function/complex/arg.js","webpack://math/./src/function/complex/conj.js","webpack://math/./src/function/complex/im.js","webpack://math/./src/function/complex/re.js","webpack://math/./src/plain/number/logical.js","webpack://math/./src/function/logical/not.js","webpack://math/./src/function/logical/or.js","webpack://math/./src/function/logical/xor.js","webpack://math/./src/function/matrix/concat.js","webpack://math/./src/function/matrix/column.js","webpack://math/./src/function/matrix/count.js","webpack://math/./src/function/matrix/cross.js","webpack://math/./src/function/matrix/diag.js","webpack://math/./src/function/matrix/filter.js","webpack://math/./src/function/matrix/flatten.js","webpack://math/./src/function/matrix/forEach.js","webpack://math/./src/function/matrix/getMatrixDataType.js","webpack://math/./src/function/matrix/identity.js","webpack://math/./src/function/matrix/kron.js","webpack://math/./src/function/matrix/map.js","webpack://math/./src/function/matrix/diff.js","webpack://math/./src/function/matrix/ones.js","webpack://math/./src/utils/noop.js","webpack://math/./src/function/matrix/range.js","webpack://math/./src/function/matrix/reshape.js","webpack://math/./src/function/matrix/resize.js","webpack://math/./src/function/matrix/rotate.js","webpack://math/./src/function/matrix/rotationMatrix.js","webpack://math/./src/function/matrix/row.js","webpack://math/./src/function/matrix/size.js","webpack://math/./src/function/matrix/squeeze.js","webpack://math/./src/function/matrix/subset.js","webpack://math/./src/function/matrix/transpose.js","webpack://math/./src/function/matrix/ctranspose.js","webpack://math/./src/function/matrix/zeros.js","webpack://math/./src/function/matrix/fft.js","webpack://math/./src/function/matrix/ifft.js","webpack://math/./src/function/numeric/solveODE.js","webpack://math/./src/function/special/erf.js","webpack://math/./src/function/special/zeta.js","webpack://math/./src/function/statistics/mode.js","webpack://math/./src/function/statistics/utils/improveErrorMessage.js","webpack://math/./src/function/statistics/prod.js","webpack://math/./src/function/string/format.js","webpack://math/./src/function/string/bin.js","webpack://math/./src/function/string/oct.js","webpack://math/./src/function/string/hex.js","webpack://math/./src/utils/print.js","webpack://math/./src/function/string/print.js","webpack://math/./src/function/unit/to.js","webpack://math/./src/function/utils/isPrime.js","webpack://math/./src/function/utils/numeric.js","webpack://math/./src/function/arithmetic/divideScalar.js","webpack://math/./src/function/arithmetic/pow.js","webpack://math/./src/function/arithmetic/round.js","webpack://math/./src/function/arithmetic/log.js","webpack://math/./src/function/arithmetic/log1p.js","webpack://math/./src/function/arithmetic/nthRoots.js","webpack://math/./src/function/arithmetic/dotPow.js","webpack://math/./src/function/arithmetic/dotDivide.js","webpack://math/./src/function/algebra/solver/utils/solveValidation.js","webpack://math/./src/function/algebra/solver/lsolve.js","webpack://math/./src/function/algebra/solver/usolve.js","webpack://math/./src/function/algebra/solver/lsolveAll.js","webpack://math/./src/function/algebra/solver/usolveAll.js","webpack://math/./src/type/matrix/utils/matAlgo08xS0Sid.js","webpack://math/./src/function/bitwise/useMatrixForArrayScalar.js","webpack://math/./src/function/bitwise/leftShift.js","webpack://math/./src/function/bitwise/rightArithShift.js","webpack://math/./src/function/bitwise/rightLogShift.js","webpack://math/./src/function/logical/and.js","webpack://math/./src/function/relational/compare.js","webpack://math/./src/function/relational/compareNatural.js","webpack://math/./src/function/relational/compareText.js","webpack://math/./src/function/relational/equal.js","webpack://math/./src/function/relational/equalText.js","webpack://math/./src/function/relational/smaller.js","webpack://math/./src/function/relational/smallerEq.js","webpack://math/./src/function/relational/larger.js","webpack://math/./src/function/relational/largerEq.js","webpack://math/./src/function/relational/deepEqual.js","webpack://math/./src/function/relational/unequal.js","webpack://math/./src/function/matrix/partitionSelect.js","webpack://math/./src/function/matrix/sort.js","webpack://math/./src/function/statistics/max.js","webpack://math/./src/function/statistics/min.js","webpack://math/./src/type/matrix/ImmutableDenseMatrix.js","webpack://math/./src/type/matrix/MatrixIndex.js","webpack://math/./src/type/matrix/FibonacciHeap.js","webpack://math/./src/type/matrix/Spa.js","webpack://math/./src/utils/lruQueue.js","webpack://math/./src/utils/function.js","webpack://math/./src/utils/bignumber/constants.js","webpack://math/./src/type/unit/Unit.js","webpack://math/./src/type/unit/function/unit.js","webpack://math/./src/type/matrix/function/sparse.js","webpack://math/./src/type/unit/function/createUnit.js","webpack://math/./src/function/trigonometry/acos.js","webpack://math/./src/plain/number/trigonometry.js","webpack://math/./src/function/trigonometry/acosh.js","webpack://math/./src/function/trigonometry/acot.js","webpack://math/./src/function/trigonometry/acoth.js","webpack://math/./src/function/trigonometry/acsc.js","webpack://math/./src/function/trigonometry/acsch.js","webpack://math/./src/function/trigonometry/asec.js","webpack://math/./src/function/trigonometry/asech.js","webpack://math/./src/function/trigonometry/asin.js","webpack://math/./src/function/trigonometry/asinh.js","webpack://math/./src/function/trigonometry/atan.js","webpack://math/./src/function/trigonometry/atan2.js","webpack://math/./src/function/trigonometry/atanh.js","webpack://math/./src/function/trigonometry/trigUnit.js","webpack://math/./src/function/trigonometry/cos.js","webpack://math/./src/function/trigonometry/cosh.js","webpack://math/./src/function/trigonometry/cot.js","webpack://math/./src/function/trigonometry/coth.js","webpack://math/./src/function/trigonometry/csc.js","webpack://math/./src/function/trigonometry/csch.js","webpack://math/./src/function/trigonometry/sec.js","webpack://math/./src/function/trigonometry/sech.js","webpack://math/./src/function/trigonometry/sin.js","webpack://math/./src/function/trigonometry/sinh.js","webpack://math/./src/function/trigonometry/tan.js","webpack://math/./src/function/trigonometry/tanh.js","webpack://math/./src/function/set/setCartesian.js","webpack://math/./src/function/set/setDifference.js","webpack://math/./src/function/set/setDistinct.js","webpack://math/./src/function/set/setIntersect.js","webpack://math/./src/function/set/setIsSubset.js","webpack://math/./src/function/set/setMultiplicity.js","webpack://math/./src/function/set/setPowerset.js","webpack://math/./src/function/set/setSize.js","webpack://math/./src/function/set/setSymDifference.js","webpack://math/./src/function/set/setUnion.js","webpack://math/./src/function/arithmetic/add.js","webpack://math/./src/function/arithmetic/hypot.js","webpack://math/./src/function/arithmetic/norm.js","webpack://math/./src/function/matrix/dot.js","webpack://math/./src/function/matrix/trace.js","webpack://math/./src/type/matrix/function/index.js","webpack://math/./src/expression/keywords.js","webpack://math/./src/expression/node/Node.js","webpack://math/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://math/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://math/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://math/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://math/./src/expression/transform/utils/errorTransform.js","webpack://math/./src/expression/node/utils/access.js","webpack://math/./src/expression/node/AccessorNode.js","webpack://math/./src/expression/node/ArrayNode.js","webpack://math/./src/expression/operators.js","webpack://math/./src/expression/node/AssignmentNode.js","webpack://math/./src/expression/node/utils/assign.js","webpack://math/./src/expression/node/BlockNode.js","webpack://math/./src/expression/node/ConditionalNode.js","webpack://math/./src/utils/latex.js","webpack://math/./src/expression/node/ConstantNode.js","webpack://math/./src/expression/node/FunctionAssignmentNode.js","webpack://math/./src/expression/node/IndexNode.js","webpack://math/./src/expression/node/ObjectNode.js","webpack://math/./src/utils/scope.js","webpack://math/./src/expression/node/OperatorNode.js","webpack://math/./src/expression/node/ParenthesisNode.js","webpack://math/./src/expression/node/RangeNode.js","webpack://math/./src/expression/node/RelationalNode.js","webpack://math/./src/expression/node/SymbolNode.js","webpack://math/./src/expression/node/FunctionNode.js","webpack://math/./src/expression/parse.js","webpack://math/./src/expression/function/compile.js","webpack://math/./src/expression/function/evaluate.js","webpack://math/./src/expression/Parser.js","webpack://math/./src/expression/function/parser.js","webpack://math/./src/function/algebra/decomposition/lup.js","webpack://math/./src/function/algebra/decomposition/qr.js","webpack://math/./src/function/algebra/sparse/csTdfs.js","webpack://math/./src/function/algebra/sparse/csFlip.js","webpack://math/./src/function/algebra/sparse/csAmd.js","webpack://math/./src/function/algebra/sparse/csFkeep.js","webpack://math/./src/function/algebra/sparse/csLeaf.js","webpack://math/./src/function/algebra/sparse/csCounts.js","webpack://math/./src/function/algebra/sparse/csSqr.js","webpack://math/./src/function/algebra/sparse/csPermute.js","webpack://math/./src/function/algebra/sparse/csEtree.js","webpack://math/./src/function/algebra/sparse/csPost.js","webpack://math/./src/function/algebra/sparse/csMarked.js","webpack://math/./src/function/algebra/sparse/csMark.js","webpack://math/./src/function/algebra/sparse/csUnflip.js","webpack://math/./src/function/algebra/sparse/csDfs.js","webpack://math/./src/function/algebra/sparse/csSpsolve.js","webpack://math/./src/function/algebra/sparse/csReach.js","webpack://math/./src/function/algebra/sparse/csLu.js","webpack://math/./src/function/algebra/decomposition/slu.js","webpack://math/./src/function/algebra/sparse/csIpvec.js","webpack://math/./src/function/algebra/solver/lusolve.js","webpack://math/./src/function/algebra/polynomialRoot.js","webpack://math/./src/expression/Help.js","webpack://math/./src/type/chain/Chain.js","webpack://math/./src/expression/embeddedDocs/constants/e.js","webpack://math/./src/expression/embeddedDocs/constants/pi.js","webpack://math/./src/expression/embeddedDocs/embeddedDocs.js","webpack://math/./src/expression/embeddedDocs/construction/bignumber.js","webpack://math/./src/expression/embeddedDocs/construction/bigint.js","webpack://math/./src/expression/embeddedDocs/construction/boolean.js","webpack://math/./src/expression/embeddedDocs/construction/complex.js","webpack://math/./src/expression/embeddedDocs/construction/createUnit.js","webpack://math/./src/expression/embeddedDocs/construction/fraction.js","webpack://math/./src/expression/embeddedDocs/construction/index.js","webpack://math/./src/expression/embeddedDocs/construction/matrix.js","webpack://math/./src/expression/embeddedDocs/construction/number.js","webpack://math/./src/expression/embeddedDocs/construction/sparse.js","webpack://math/./src/expression/embeddedDocs/construction/splitUnit.js","webpack://math/./src/expression/embeddedDocs/construction/string.js","webpack://math/./src/expression/embeddedDocs/construction/unit.js","webpack://math/./src/expression/embeddedDocs/constants/false.js","webpack://math/./src/expression/embeddedDocs/constants/i.js","webpack://math/./src/expression/embeddedDocs/constants/Infinity.js","webpack://math/./src/expression/embeddedDocs/constants/LN2.js","webpack://math/./src/expression/embeddedDocs/constants/LN10.js","webpack://math/./src/expression/embeddedDocs/constants/LOG2E.js","webpack://math/./src/expression/embeddedDocs/constants/LOG10E.js","webpack://math/./src/expression/embeddedDocs/constants/NaN.js","webpack://math/./src/expression/embeddedDocs/constants/null.js","webpack://math/./src/expression/embeddedDocs/constants/phi.js","webpack://math/./src/expression/embeddedDocs/constants/SQRT1_2.js","webpack://math/./src/expression/embeddedDocs/constants/SQRT2.js","webpack://math/./src/expression/embeddedDocs/constants/tau.js","webpack://math/./src/expression/embeddedDocs/constants/true.js","webpack://math/./src/expression/embeddedDocs/constants/version.js","webpack://math/./src/expression/embeddedDocs/function/algebra/derivative.js","webpack://math/./src/expression/embeddedDocs/function/algebra/lsolve.js","webpack://math/./src/expression/embeddedDocs/function/algebra/lsolveAll.js","webpack://math/./src/expression/embeddedDocs/function/algebra/lup.js","webpack://math/./src/expression/embeddedDocs/function/algebra/lusolve.js","webpack://math/./src/expression/embeddedDocs/function/algebra/leafCount.js","webpack://math/./src/expression/embeddedDocs/function/algebra/polynomialRoot.js","webpack://math/./src/expression/embeddedDocs/function/algebra/resolve.js","webpack://math/./src/expression/embeddedDocs/function/algebra/simplify.js","webpack://math/./src/expression/embeddedDocs/function/algebra/simplifyConstant.js","webpack://math/./src/expression/embeddedDocs/function/algebra/simplifyCore.js","webpack://math/./src/expression/embeddedDocs/function/algebra/symbolicEqual.js","webpack://math/./src/expression/embeddedDocs/function/algebra/rationalize.js","webpack://math/./src/expression/embeddedDocs/function/algebra/slu.js","webpack://math/./src/expression/embeddedDocs/function/algebra/usolve.js","webpack://math/./src/expression/embeddedDocs/function/algebra/usolveAll.js","webpack://math/./src/expression/embeddedDocs/function/algebra/qr.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/abs.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/add.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/cbrt.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/ceil.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/cube.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/divide.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/dotDivide.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/dotMultiply.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/dotPow.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/exp.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/expm.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/expm1.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/fix.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/floor.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/gcd.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/hypot.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/lcm.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/log.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/log2.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/log1p.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/log10.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/mod.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/multiply.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/norm.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/nthRoot.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/nthRoots.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/pow.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/round.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/sign.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/sqrt.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/sqrtm.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/square.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/subtract.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/unaryMinus.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/unaryPlus.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/xgcd.js","webpack://math/./src/expression/embeddedDocs/function/arithmetic/invmod.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/bitAnd.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/bitNot.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/bitOr.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/bitXor.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/leftShift.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/rightArithShift.js","webpack://math/./src/expression/embeddedDocs/function/bitwise/rightLogShift.js","webpack://math/./src/expression/embeddedDocs/function/combinatorics/bellNumbers.js","webpack://math/./src/expression/embeddedDocs/function/combinatorics/catalan.js","webpack://math/./src/expression/embeddedDocs/function/combinatorics/composition.js","webpack://math/./src/expression/embeddedDocs/function/combinatorics/stirlingS2.js","webpack://math/./src/expression/embeddedDocs/core/config.js","webpack://math/./src/expression/embeddedDocs/core/import.js","webpack://math/./src/expression/embeddedDocs/core/typed.js","webpack://math/./src/expression/embeddedDocs/function/complex/arg.js","webpack://math/./src/expression/embeddedDocs/function/complex/conj.js","webpack://math/./src/expression/embeddedDocs/function/complex/re.js","webpack://math/./src/expression/embeddedDocs/function/complex/im.js","webpack://math/./src/expression/embeddedDocs/function/expression/evaluate.js","webpack://math/./src/expression/embeddedDocs/function/expression/help.js","webpack://math/./src/expression/embeddedDocs/function/geometry/distance.js","webpack://math/./src/expression/embeddedDocs/function/geometry/intersect.js","webpack://math/./src/expression/embeddedDocs/function/logical/and.js","webpack://math/./src/expression/embeddedDocs/function/logical/not.js","webpack://math/./src/expression/embeddedDocs/function/logical/or.js","webpack://math/./src/expression/embeddedDocs/function/logical/xor.js","webpack://math/./src/expression/embeddedDocs/function/matrix/concat.js","webpack://math/./src/expression/embeddedDocs/function/matrix/count.js","webpack://math/./src/expression/embeddedDocs/function/matrix/cross.js","webpack://math/./src/expression/embeddedDocs/function/matrix/column.js","webpack://math/./src/expression/embeddedDocs/function/matrix/ctranspose.js","webpack://math/./src/expression/embeddedDocs/function/matrix/det.js","webpack://math/./src/expression/embeddedDocs/function/matrix/diag.js","webpack://math/./src/expression/embeddedDocs/function/matrix/diff.js","webpack://math/./src/expression/embeddedDocs/function/matrix/dot.js","webpack://math/./src/expression/embeddedDocs/function/matrix/getMatrixDataType.js","webpack://math/./src/expression/embeddedDocs/function/matrix/identity.js","webpack://math/./src/expression/embeddedDocs/function/matrix/filter.js","webpack://math/./src/expression/embeddedDocs/function/matrix/flatten.js","webpack://math/./src/expression/embeddedDocs/function/matrix/forEach.js","webpack://math/./src/expression/embeddedDocs/function/matrix/inv.js","webpack://math/./src/expression/embeddedDocs/function/matrix/pinv.js","webpack://math/./src/expression/embeddedDocs/function/matrix/eigs.js","webpack://math/./src/expression/embeddedDocs/function/matrix/kron.js","webpack://math/./src/expression/embeddedDocs/function/matrix/matrixFromFunction.js","webpack://math/./src/expression/embeddedDocs/function/matrix/matrixFromRows.js","webpack://math/./src/expression/embeddedDocs/function/matrix/matrixFromColumns.js","webpack://math/./src/expression/embeddedDocs/function/matrix/map.js","webpack://math/./src/expression/embeddedDocs/function/matrix/ones.js","webpack://math/./src/expression/embeddedDocs/function/matrix/partitionSelect.js","webpack://math/./src/expression/embeddedDocs/function/matrix/range.js","webpack://math/./src/expression/embeddedDocs/function/matrix/resize.js","webpack://math/./src/expression/embeddedDocs/function/matrix/reshape.js","webpack://math/./src/expression/embeddedDocs/function/matrix/rotate.js","webpack://math/./src/expression/embeddedDocs/function/matrix/rotationMatrix.js","webpack://math/./src/expression/embeddedDocs/function/matrix/row.js","webpack://math/./src/expression/embeddedDocs/function/matrix/size.js","webpack://math/./src/expression/embeddedDocs/function/matrix/sort.js","webpack://math/./src/expression/embeddedDocs/function/matrix/squeeze.js","webpack://math/./src/expression/embeddedDocs/function/matrix/subset.js","webpack://math/./src/expression/embeddedDocs/function/matrix/trace.js","webpack://math/./src/expression/embeddedDocs/function/matrix/transpose.js","webpack://math/./src/expression/embeddedDocs/function/matrix/zeros.js","webpack://math/./src/expression/embeddedDocs/function/matrix/fft.js","webpack://math/./src/expression/embeddedDocs/function/matrix/ifft.js","webpack://math/./src/expression/embeddedDocs/function/algebra/sylvester.js","webpack://math/./src/expression/embeddedDocs/function/algebra/schur.js","webpack://math/./src/expression/embeddedDocs/function/algebra/lyap.js","webpack://math/./src/expression/embeddedDocs/function/numeric/solveODE.js","webpack://math/./src/expression/embeddedDocs/function/probability/combinations.js","webpack://math/./src/expression/embeddedDocs/function/probability/combinationsWithRep.js","webpack://math/./src/expression/embeddedDocs/function/probability/factorial.js","webpack://math/./src/expression/embeddedDocs/function/probability/gamma.js","webpack://math/./src/expression/embeddedDocs/function/probability/kldivergence.js","webpack://math/./src/expression/embeddedDocs/function/probability/lgamma.js","webpack://math/./src/expression/embeddedDocs/function/probability/multinomial.js","webpack://math/./src/expression/embeddedDocs/function/probability/permutations.js","webpack://math/./src/expression/embeddedDocs/function/probability/pickRandom.js","webpack://math/./src/expression/embeddedDocs/function/probability/random.js","webpack://math/./src/expression/embeddedDocs/function/probability/randomInt.js","webpack://math/./src/expression/embeddedDocs/function/relational/compare.js","webpack://math/./src/expression/embeddedDocs/function/relational/compareNatural.js","webpack://math/./src/expression/embeddedDocs/function/relational/compareText.js","webpack://math/./src/expression/embeddedDocs/function/relational/deepEqual.js","webpack://math/./src/expression/embeddedDocs/function/relational/equal.js","webpack://math/./src/expression/embeddedDocs/function/relational/equalText.js","webpack://math/./src/expression/embeddedDocs/function/relational/larger.js","webpack://math/./src/expression/embeddedDocs/function/relational/largerEq.js","webpack://math/./src/expression/embeddedDocs/function/relational/smaller.js","webpack://math/./src/expression/embeddedDocs/function/relational/smallerEq.js","webpack://math/./src/expression/embeddedDocs/function/relational/unequal.js","webpack://math/./src/expression/embeddedDocs/function/set/setCartesian.js","webpack://math/./src/expression/embeddedDocs/function/set/setDifference.js","webpack://math/./src/expression/embeddedDocs/function/set/setDistinct.js","webpack://math/./src/expression/embeddedDocs/function/set/setIntersect.js","webpack://math/./src/expression/embeddedDocs/function/set/setIsSubset.js","webpack://math/./src/expression/embeddedDocs/function/set/setMultiplicity.js","webpack://math/./src/expression/embeddedDocs/function/set/setPowerset.js","webpack://math/./src/expression/embeddedDocs/function/set/setSize.js","webpack://math/./src/expression/embeddedDocs/function/set/setSymDifference.js","webpack://math/./src/expression/embeddedDocs/function/set/setUnion.js","webpack://math/./src/expression/embeddedDocs/function/signal/zpk2tf.js","webpack://math/./src/expression/embeddedDocs/function/signal/freqz.js","webpack://math/./src/expression/embeddedDocs/function/special/erf.js","webpack://math/./src/expression/embeddedDocs/function/special/zeta.js","webpack://math/./src/expression/embeddedDocs/function/statistics/cumsum.js","webpack://math/./src/expression/embeddedDocs/function/statistics/mad.js","webpack://math/./src/expression/embeddedDocs/function/statistics/max.js","webpack://math/./src/expression/embeddedDocs/function/statistics/mean.js","webpack://math/./src/expression/embeddedDocs/function/statistics/median.js","webpack://math/./src/expression/embeddedDocs/function/statistics/min.js","webpack://math/./src/expression/embeddedDocs/function/statistics/mode.js","webpack://math/./src/expression/embeddedDocs/function/statistics/prod.js","webpack://math/./src/expression/embeddedDocs/function/statistics/quantileSeq.js","webpack://math/./src/expression/embeddedDocs/function/statistics/std.js","webpack://math/./src/expression/embeddedDocs/function/statistics/sum.js","webpack://math/./src/expression/embeddedDocs/function/statistics/variance.js","webpack://math/./src/expression/embeddedDocs/function/statistics/corr.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acos.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acosh.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acot.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acoth.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acsc.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/acsch.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/asec.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/asech.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/asin.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/asinh.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/atan.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/atanh.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/atan2.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/cos.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/cosh.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/cot.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/coth.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/csc.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/csch.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/sec.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/sech.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/sin.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/sinh.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/tan.js","webpack://math/./src/expression/embeddedDocs/function/trigonometry/tanh.js","webpack://math/./src/expression/embeddedDocs/function/units/to.js","webpack://math/./src/expression/embeddedDocs/function/utils/clone.js","webpack://math/./src/expression/embeddedDocs/function/utils/format.js","webpack://math/./src/expression/embeddedDocs/function/utils/bin.js","webpack://math/./src/expression/embeddedDocs/function/utils/oct.js","webpack://math/./src/expression/embeddedDocs/function/utils/hex.js","webpack://math/./src/expression/embeddedDocs/function/utils/isNaN.js","webpack://math/./src/expression/embeddedDocs/function/utils/isInteger.js","webpack://math/./src/expression/embeddedDocs/function/utils/isNegative.js","webpack://math/./src/expression/embeddedDocs/function/utils/isNumeric.js","webpack://math/./src/expression/embeddedDocs/function/utils/hasNumericValue.js","webpack://math/./src/expression/embeddedDocs/function/utils/isPositive.js","webpack://math/./src/expression/embeddedDocs/function/utils/isPrime.js","webpack://math/./src/expression/embeddedDocs/function/utils/isZero.js","webpack://math/./src/expression/embeddedDocs/function/utils/print.js","webpack://math/./src/expression/embeddedDocs/function/utils/typeOf.js","webpack://math/./src/expression/embeddedDocs/function/utils/numeric.js","webpack://math/./src/expression/function/help.js","webpack://math/./src/type/chain/function/chain.js","webpack://math/./src/function/matrix/det.js","webpack://math/./src/function/matrix/inv.js","webpack://math/./src/function/matrix/pinv.js","webpack://math/./src/function/matrix/eigs.js","webpack://math/./src/function/matrix/eigs/realSymmetric.js","webpack://math/./src/function/matrix/eigs/complexEigs.js","webpack://math/./src/function/matrix/expm.js","webpack://math/./src/function/matrix/sqrtm.js","webpack://math/./src/function/algebra/sylvester.js","webpack://math/./src/function/algebra/decomposition/schur.js","webpack://math/./src/function/algebra/lyap.js","webpack://math/./src/function/arithmetic/divide.js","webpack://math/./src/function/geometry/distance.js","webpack://math/./src/function/geometry/intersect.js","webpack://math/./src/function/statistics/sum.js","webpack://math/./src/function/statistics/cumsum.js","webpack://math/./src/function/statistics/mean.js","webpack://math/./src/function/statistics/median.js","webpack://math/./src/function/statistics/mad.js","webpack://math/./src/function/statistics/variance.js","webpack://math/./src/function/statistics/quantileSeq.js","webpack://math/./src/function/statistics/std.js","webpack://math/./src/function/statistics/corr.js","webpack://math/./src/utils/product.js","webpack://math/./src/plain/number/combinations.js","webpack://math/./src/function/probability/combinations.js","webpack://math/./src/function/probability/combinationsWithRep.js","webpack://math/./src/plain/number/probability.js","webpack://math/./src/function/probability/gamma.js","webpack://math/./src/function/probability/lgamma.js","webpack://math/./src/function/probability/factorial.js","webpack://math/./src/function/probability/kldivergence.js","webpack://math/./src/function/probability/multinomial.js","webpack://math/./src/function/probability/permutations.js","webpack://math/./src/function/probability/util/seededRNG.js","webpack://math/./src/function/probability/pickRandom.js","webpack://math/./src/function/probability/util/randomMatrix.js","webpack://math/./src/function/probability/random.js","webpack://math/./src/function/probability/randomInt.js","webpack://math/./src/function/combinatorics/stirlingS2.js","webpack://math/./src/function/combinatorics/bellNumbers.js","webpack://math/./src/function/combinatorics/catalan.js","webpack://math/./src/function/combinatorics/composition.js","webpack://math/./src/function/algebra/leafCount.js","webpack://math/./src/function/algebra/simplify/wildcards.js","webpack://math/./src/function/algebra/simplify/util.js","webpack://math/./src/function/algebra/simplify.js","webpack://math/./src/function/algebra/simplifyConstant.js","webpack://math/./src/function/algebra/simplifyCore.js","webpack://math/./src/function/algebra/resolve.js","webpack://math/./src/function/algebra/symbolicEqual.js","webpack://math/./src/function/algebra/derivative.js","webpack://math/./src/function/algebra/rationalize.js","webpack://math/./src/function/signal/zpk2tf.js","webpack://math/./src/function/signal/freqz.js","webpack://math/./src/json/reviver.js","webpack://math/./src/json/replacer.js","webpack://math/./src/plain/number/constants.js","webpack://math/./src/constants.js","webpack://math/./src/version.js","webpack://math/./src/type/unit/physicalConstants.js","webpack://math/./src/expression/transform/apply.transform.js","webpack://math/./src/expression/transform/column.transform.js","webpack://math/./src/expression/transform/utils/compileInlineExpression.js","webpack://math/./src/expression/transform/utils/transformCallback.js","webpack://math/./src/expression/transform/filter.transform.js","webpack://math/./src/expression/transform/forEach.transform.js","webpack://math/./src/expression/transform/index.transform.js","webpack://math/./src/expression/transform/map.transform.js","webpack://math/./src/expression/transform/utils/lastDimToZeroBase.js","webpack://math/./src/expression/transform/utils/dimToZeroBase.js","webpack://math/./src/expression/transform/max.transform.js","webpack://math/./src/expression/transform/mean.transform.js","webpack://math/./src/expression/transform/min.transform.js","webpack://math/./src/expression/transform/range.transform.js","webpack://math/./src/expression/transform/row.transform.js","webpack://math/./src/expression/transform/subset.transform.js","webpack://math/./src/expression/transform/concat.transform.js","webpack://math/./src/expression/transform/diff.transform.js","webpack://math/./src/expression/transform/std.transform.js","webpack://math/./src/expression/transform/sum.transform.js","webpack://math/./src/expression/transform/quantileSeq.transform.js","webpack://math/./src/expression/transform/cumsum.transform.js","webpack://math/./src/expression/transform/variance.transform.js","webpack://math/./src/expression/transform/print.transform.js","webpack://math/./src/expression/transform/and.transform.js","webpack://math/./src/expression/transform/or.transform.js","webpack://math/./src/expression/transform/bitAnd.transform.js","webpack://math/./src/expression/transform/bitOr.transform.js","webpack://math/./src/core/config.js","webpack://math/./src/core/function/config.js","webpack://math/./src/defaultInstance.js","webpack://math/./src/core/create.js","webpack://math/./src/utils/emitter.js","webpack://math/./src/core/function/import.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"math\"] = factory();\n\telse\n\t\troot[\"math\"] = factory();\n})(this, () => {\nreturn ","/**\n * @license Complex.js v2.1.1 12/05/2020\n *\n * Copyright (c) 2020, Robert Eisele (robert@xarg.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n/**\n *\n * This class allows the manipulation of complex numbers.\n * You can pass a complex number in different formats. Either as object, double, string or two integer parameters.\n *\n * Object form\n * { re: , im: }\n * { arg: , abs: }\n * { phi: , r: }\n *\n * Array / Vector form\n * [ real, imaginary ]\n *\n * Double form\n * 99.3 - Single double value\n *\n * String form\n * '23.1337' - Simple real number\n * '15+3i' - a simple complex number\n * '3-i' - a simple complex number\n *\n * Example:\n *\n * var c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n(function(root) {\n\n 'use strict';\n\n var cosh = Math.cosh || function(x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n };\n\n var sinh = Math.sinh || function(x) {\n return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5;\n };\n\n /**\n * Calculates cos(x) - 1 using Taylor series if x is small (-¼π ≤ x ≤ ¼π).\n *\n * @param {number} x\n * @returns {number} cos(x) - 1\n */\n var cosm1 = function(x) {\n\n var b = Math.PI / 4;\n if (-b > x || x > b) {\n return Math.cos(x) - 1.0;\n }\n\n /* Calculate horner form of polynomial of taylor series in Q\n var fac = 1, alt = 1, pol = {};\n for (var i = 0; i <= 16; i++) {\n fac*= i || 1;\n if (i % 2 == 0) {\n pol[i] = new Fraction(1, alt * fac);\n alt = -alt;\n }\n }\n console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1\n */\n\n var xx = x * x;\n return xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx / 20922789888000\n - 1 / 87178291200)\n + 1 / 479001600)\n - 1 / 3628800)\n + 1 / 40320)\n - 1 / 720)\n + 1 / 24)\n - 1 / 2);\n };\n\n var hypot = function(x, y) {\n\n var a = Math.abs(x);\n var b = Math.abs(y);\n\n if (a < 3000 && b < 3000) {\n return Math.sqrt(a * a + b * b);\n }\n\n if (a < b) {\n a = b;\n b = x / y;\n } else {\n b = y / x;\n }\n return a * Math.sqrt(1 + b * b);\n };\n\n var parser_exit = function() {\n throw SyntaxError('Invalid Param');\n };\n\n /**\n * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\n function logHypot(a, b) {\n\n var _a = Math.abs(a);\n var _b = Math.abs(b);\n\n if (a === 0) {\n return Math.log(_b);\n }\n\n if (b === 0) {\n return Math.log(_a);\n }\n\n if (_a < 3000 && _b < 3000) {\n return Math.log(a * a + b * b) * 0.5;\n }\n\n /* I got 4 ideas to compute this property without overflow:\n *\n * Testing 1000000 times with random samples for a,b ∈ [1, 1000000000] against a big decimal library to get an error estimate\n *\n * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11)\n\n Math.log(a * a + b * b) / 2\n\n *\n *\n * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10)\n\n var fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n var t = Math.min(a, b);\n a = Math.max(a, b);\n t = t / a;\n\n return Math.log(a) + Math.log(1 + t * t) / 2;\n };\n\n * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10)\n\n Math.log(a / Math.cos(Math.atan2(b, a)))\n\n * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9)\n\n Math.log(a) - Math.log(Math.cos(Math.atan2(b, a)))\n\n */\n\n a = a / 2;\n b = b / 2;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n }\n\n var parse = function(a, b) {\n\n var z = { 're': 0, 'im': 0 };\n\n if (a === undefined || a === null) {\n z['re'] =\n z['im'] = 0;\n } else if (b !== undefined) {\n z['re'] = a;\n z['im'] = b;\n } else\n switch (typeof a) {\n\n case 'object':\n\n if ('im' in a && 're' in a) {\n z['re'] = a['re'];\n z['im'] = a['im'];\n } else if ('abs' in a && 'arg' in a) {\n if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['abs'] * Math.cos(a['arg']);\n z['im'] = a['abs'] * Math.sin(a['arg']);\n } else if ('r' in a && 'phi' in a) {\n if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['r'] * Math.cos(a['phi']);\n z['im'] = a['r'] * Math.sin(a['phi']);\n } else if (a.length === 2) { // Quick array check\n z['re'] = a[0];\n z['im'] = a[1];\n } else {\n parser_exit();\n }\n break;\n\n case 'string':\n\n z['im'] = /* void */\n z['re'] = 0;\n\n var tokens = a.match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n var plus = 1;\n var minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (var i = 0; i < tokens.length; i++) {\n\n var c = tokens[i];\n\n if (c === ' ' || c === '\\t' || c === '\\n') {\n /* void */\n } else if (c === '+') {\n plus++;\n } else if (c === '-') {\n minus++;\n } else if (c === 'i' || c === 'I') {\n\n if (plus + minus === 0) {\n parser_exit();\n }\n\n if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]);\n i++;\n } else {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + '1');\n }\n plus = minus = 0;\n\n } else {\n\n if (plus + minus === 0 || isNaN(c)) {\n parser_exit();\n }\n\n if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + c);\n i++;\n } else {\n z['re'] += parseFloat((minus % 2 ? '-' : '') + c);\n }\n plus = minus = 0;\n }\n }\n\n // Still something on the stack\n if (plus + minus > 0) {\n parser_exit();\n }\n break;\n\n case 'number':\n z['im'] = 0;\n z['re'] = a;\n break;\n\n default:\n parser_exit();\n }\n\n if (isNaN(z['re']) || isNaN(z['im'])) {\n // If a calculation is NaN, we treat it as NaN and don't throw\n //parser_exit();\n }\n\n return z;\n };\n\n /**\n * @constructor\n * @returns {Complex}\n */\n function Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n var z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n }\n\n Complex.prototype = {\n\n 're': 0,\n 'im': 0,\n\n /**\n * Calculates the sign of a complex number, which is a normalized complex\n *\n * @returns {Complex}\n */\n 'sign': function() {\n\n var abs = this['abs']();\n\n return new Complex(\n this['re'] / abs,\n this['im'] / abs);\n },\n\n /**\n * Adds two complex numbers\n *\n * @returns {Complex}\n */\n 'add': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity + Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity + z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] + z['re'],\n this['im'] + z['im']);\n },\n\n /**\n * Subtracts two complex numbers\n *\n * @returns {Complex}\n */\n 'sub': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity - Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity - z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] - z['re'],\n this['im'] - z['im']);\n },\n\n /**\n * Multiplies two complex numbers\n *\n * @returns {Complex}\n */\n 'mul': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity * 0 = NaN\n if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n // Short circuit for real values\n if (z['im'] === 0 && this['im'] === 0) {\n return new Complex(this['re'] * z['re'], 0);\n }\n\n return new Complex(\n this['re'] * z['re'] - this['im'] * z['im'],\n this['re'] * z['im'] + this['im'] * z['re']);\n },\n\n /**\n * Divides two complex numbers\n *\n * @returns {Complex}\n */\n 'div': function(a, b) {\n\n var z = new Complex(a, b);\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (this['isInfinite']() || z['isZero']()) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (this['isZero']() || z['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n a = this['re'];\n b = this['im'];\n\n var c = z['re'];\n var d = z['im'];\n var t, x;\n\n if (0 === d) {\n // Divisor is real\n return new Complex(a / c, b / c);\n }\n\n if (Math.abs(c) < Math.abs(d)) {\n\n x = c / d;\n t = c * x + d;\n\n return new Complex(\n (a * x + b) / t,\n (b * x - a) / t);\n\n } else {\n\n x = d / c;\n t = d * x + c;\n\n return new Complex(\n (a + b * x) / t,\n (b - a * x) / t);\n }\n },\n\n /**\n * Calculate the power of two complex numbers\n *\n * @returns {Complex}\n */\n 'pow': function(a, b) {\n\n var z = new Complex(a, b);\n\n a = this['re'];\n b = this['im'];\n\n if (z['isZero']()) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (b === 0 && a > 0) {\n\n return new Complex(Math.pow(a, z['re']), 0);\n\n } else if (a === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(b, z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(b, z['re']));\n case 2:\n return new Complex(-Math.pow(b, z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(b, z['re']));\n }\n }\n }\n\n /* I couldn't find a good formula, so here is a derivation and optimization\n *\n * z_1^z_2 = (a + bi)^(c + di)\n * = exp((c + di) * log(a + bi)\n * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a))\n * =>...\n * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n *\n * =>...\n * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n *\n * =>\n * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1))\n * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1))\n *\n */\n\n if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) {\n return Complex['ZERO'];\n }\n\n var arg = Math.atan2(b, a);\n var loh = logHypot(a, b);\n\n a = Math.exp(z['re'] * loh - z['im'] * arg);\n b = z['im'] * loh + z['re'] * arg;\n return new Complex(\n a * Math.cos(b),\n a * Math.sin(b));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function() {\n\n var a = this['re'];\n var b = this['im'];\n var r = this['abs']();\n\n var re, im;\n\n if (a >= 0) {\n\n if (b === 0) {\n return new Complex(Math.sqrt(a), 0);\n }\n\n re = 0.5 * Math.sqrt(2.0 * (r + a));\n } else {\n re = Math.abs(b) / Math.sqrt(2 * (r - a));\n }\n\n if (a <= 0) {\n im = 0.5 * Math.sqrt(2.0 * (r - a));\n } else {\n im = Math.abs(b) / Math.sqrt(2 * (r + a));\n }\n\n return new Complex(re, b < 0 ? -im : im);\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function() {\n\n var tmp = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n //return new Complex(tmp, 0);\n }\n return new Complex(\n tmp * Math.cos(this['im']),\n tmp * Math.sin(this['im']));\n },\n\n /**\n * Calculate the complex exponent and subtracts one.\n *\n * This may be more accurate than `Complex(x).exp().sub(1)` if\n * `x` is small.\n *\n * @returns {Complex}\n */\n 'expm1': function() {\n\n /**\n * exp(a + i*b) - 1\n = exp(a) * (cos(b) + j*sin(b)) - 1\n = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b)\n */\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.expm1(a) * Math.cos(b) + cosm1(b),\n Math.exp(a) * Math.sin(b));\n },\n\n /**\n * Calculate the natural log\n *\n * @returns {Complex}\n */\n 'log': function() {\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0 && a > 0) {\n //return new Complex(Math.log(a), 0);\n }\n\n return new Complex(\n logHypot(a, b),\n Math.atan2(b, a));\n },\n\n /**\n * Calculate the magnitude of the complex number\n *\n * @returns {number}\n */\n 'abs': function() {\n\n return hypot(this['re'], this['im']);\n },\n\n /**\n * Calculate the angle of the complex number\n *\n * @returns {number}\n */\n 'arg': function() {\n\n return Math.atan2(this['im'], this['re']);\n },\n\n /**\n * Calculate the sine of the complex number\n *\n * @returns {Complex}\n */\n 'sin': function() {\n\n // sin(z) = ( e^iz - e^-iz ) / 2i \n // = sin(a)cosh(b) + i cos(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.sin(a) * cosh(b),\n Math.cos(a) * sinh(b));\n },\n\n /**\n * Calculate the cosine\n *\n * @returns {Complex}\n */\n 'cos': function() {\n\n // cos(z) = ( e^iz + e^-iz ) / 2 \n // = cos(a)cosh(b) - i sin(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.cos(a) * cosh(b),\n -Math.sin(a) * sinh(b));\n },\n\n /**\n * Calculate the tangent\n *\n * @returns {Complex}\n */\n 'tan': function() {\n\n // tan(z) = sin(z) / cos(z) \n // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) )\n // = ( e^2iz - 1 ) / i( e^2iz + 1 )\n // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) )\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) + cosh(b);\n\n return new Complex(\n Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the cotangent\n *\n * @returns {Complex}\n */\n 'cot': function() {\n\n // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci))\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) - cosh(b);\n\n return new Complex(\n -Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the secant\n *\n * @returns {Complex}\n */\n 'sec': function() {\n\n // sec(c) = 2 / (e^(ci) + e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.cos(a) * cosh(b) / d,\n Math.sin(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the cosecans\n *\n * @returns {Complex}\n */\n 'csc': function() {\n\n // csc(c) = 2i / (e^(ci) - e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.sin(a) * cosh(b) / d,\n -Math.cos(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the complex arcus sinus\n *\n * @returns {Complex}\n */\n 'asin': function() {\n\n // asin(c) = -i * log(ci + sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(t2['im'], -t2['re']);\n },\n\n /**\n * Calculate the complex arcus cosinus\n *\n * @returns {Complex}\n */\n 'acos': function() {\n\n // acos(c) = i * log(c - i * sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(Math.PI / 2 - t2['im'], t2['re']);\n },\n\n /**\n * Calculate the complex arcus tangent\n *\n * @returns {Complex}\n */\n 'atan': function() {\n\n // atan(c) = i / 2 log((i + x) / (i - x))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0) {\n\n if (b === 1) {\n return new Complex(0, Infinity);\n }\n\n if (b === -1) {\n return new Complex(0, -Infinity);\n }\n }\n\n var d = a * a + (1.0 - b) * (1.0 - b);\n\n var t1 = new Complex(\n (1 - b * b - a * a) / d,\n -2 * a / d).log();\n\n return new Complex(-0.5 * t1['im'], 0.5 * t1['re']);\n },\n\n /**\n * Calculate the complex arcus cotangent\n *\n * @returns {Complex}\n */\n 'acot': function() {\n\n // acot(c) = i / 2 log((c - i) / (c + i))\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atan()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atan();\n },\n\n /**\n * Calculate the complex arcus secant\n *\n * @returns {Complex}\n */\n 'asec': function() {\n\n // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acos()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acos();\n },\n\n /**\n * Calculate the complex arcus cosecans\n *\n * @returns {Complex}\n */\n 'acsc': function() {\n\n // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asin()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asin();\n },\n\n /**\n * Calculate the complex sinh\n *\n * @returns {Complex}\n */\n 'sinh': function() {\n\n // sinh(c) = (e^c - e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n sinh(a) * Math.cos(b),\n cosh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex cosh\n *\n * @returns {Complex}\n */\n 'cosh': function() {\n\n // cosh(c) = (e^c + e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n cosh(a) * Math.cos(b),\n sinh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex tanh\n *\n * @returns {Complex}\n */\n 'tanh': function() {\n\n // tanh(c) = (e^c - e^-c) / (e^c + e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) + Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'coth': function() {\n\n // coth(c) = (e^c + e^-c) / (e^c - e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) - Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n -Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'csch': function() {\n\n // csch(c) = 2 / (e^c - e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) - cosh(2 * a);\n\n return new Complex(\n -2 * sinh(a) * Math.cos(b) / d,\n 2 * cosh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex sech\n *\n * @returns {Complex}\n */\n 'sech': function() {\n\n // sech(c) = 2 / (e^c + e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) + cosh(2 * a);\n\n return new Complex(\n 2 * cosh(a) * Math.cos(b) / d,\n -2 * sinh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex asinh\n *\n * @returns {Complex}\n */\n 'asinh': function() {\n\n // asinh(c) = log(c + sqrt(c^2 + 1))\n\n var tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n var res = this['asin']();\n\n this['re'] = -this['im'];\n this['im'] = tmp;\n tmp = res['re'];\n\n res['re'] = -res['im'];\n res['im'] = tmp;\n return res;\n },\n\n /**\n * Calculate the complex acosh\n *\n * @returns {Complex}\n */\n 'acosh': function() {\n\n // acosh(c) = log(c + sqrt(c^2 - 1))\n\n var res = this['acos']();\n if (res['im'] <= 0) {\n var tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n var tmp = res['im'];\n res['im'] = -res['re'];\n res['re'] = tmp;\n }\n return res;\n },\n\n /**\n * Calculate the complex atanh\n *\n * @returns {Complex}\n */\n 'atanh': function() {\n\n // atanh(c) = log((1+c) / (1-c)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n var noIM = a > 1 && b === 0;\n var oneMinus = 1 - a;\n var onePlus = 1 + a;\n var d = oneMinus * oneMinus + b * b;\n\n var x = (d !== 0)\n ? new Complex(\n (onePlus * oneMinus - b * b) / d,\n (b * oneMinus + onePlus * b) / d)\n : new Complex(\n (a !== -1) ? (a / 0) : 0,\n (b !== 0) ? (b / 0) : 0);\n\n var temp = x['re'];\n x['re'] = logHypot(x['re'], x['im']) / 2;\n x['im'] = Math.atan2(x['im'], temp) / 2;\n if (noIM) {\n x['im'] = -x['im'];\n }\n return x;\n },\n\n /**\n * Calculate the complex acoth\n *\n * @returns {Complex}\n */\n 'acoth': function() {\n\n // acoth(c) = log((c+1) / (c-1)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atanh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atanh();\n },\n\n /**\n * Calculate the complex acsch\n *\n * @returns {Complex}\n */\n 'acsch': function() {\n\n // acsch(c) = log((1+sqrt(1+c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n\n return new Complex(\n (a !== 0)\n ? Math.log(a + Math.sqrt(a * a + 1))\n : Infinity, 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asinh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asinh();\n },\n\n /**\n * Calculate the complex asech\n *\n * @returns {Complex}\n */\n 'asech': function() {\n\n // asech(c) = log((1+sqrt(1-c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acosh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acosh();\n },\n\n /**\n * Calculate the complex inverse 1/z\n *\n * @returns {Complex}\n */\n 'inverse': function() {\n\n // 1 / 0 = Infinity and 1 / Infinity = 0\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n if (this['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n var a = this['re'];\n var b = this['im'];\n\n var d = a * a + b * b;\n\n return new Complex(a / d, -b / d);\n },\n\n /**\n * Returns the complex conjugate\n *\n * @returns {Complex}\n */\n 'conjugate': function() {\n\n return new Complex(this['re'], -this['im']);\n },\n\n /**\n * Gets the negated complex number\n *\n * @returns {Complex}\n */\n 'neg': function() {\n\n return new Complex(-this['re'], -this['im']);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'ceil': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.ceil(this['re'] * places) / places,\n Math.ceil(this['im'] * places) / places);\n },\n\n /**\n * Floors the actual complex number\n *\n * @returns {Complex}\n */\n 'floor': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.floor(this['re'] * places) / places,\n Math.floor(this['im'] * places) / places);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'round': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.round(this['re'] * places) / places,\n Math.round(this['im'] * places) / places);\n },\n\n /**\n * Compares two complex numbers\n *\n * **Note:** new Complex(Infinity).equals(Infinity) === false\n *\n * @returns {boolean}\n */\n 'equals': function(a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n },\n\n /**\n * Clones the actual object\n *\n * @returns {Complex}\n */\n 'clone': function() {\n\n return new Complex(this['re'], this['im']);\n },\n\n /**\n * Gets a string of the actual complex number\n *\n * @returns {string}\n */\n 'toString': function() {\n\n var a = this['re'];\n var b = this['im'];\n var ret = \"\";\n\n if (this['isNaN']()) {\n return 'NaN';\n }\n\n if (this['isInfinite']()) {\n return 'Infinity';\n }\n\n if (Math.abs(a) < Complex['EPSILON']) {\n a = 0;\n }\n\n if (Math.abs(b) < Complex['EPSILON']) {\n b = 0;\n }\n\n // If is real number\n if (b === 0) {\n return ret + a;\n }\n\n if (a !== 0) {\n ret += a;\n ret += \" \";\n if (b < 0) {\n b = -b;\n ret += \"-\";\n } else {\n ret += \"+\";\n }\n ret += \" \";\n } else if (b < 0) {\n b = -b;\n ret += \"-\";\n }\n\n if (1 !== b) { // b is the absolute imaginary part\n ret += b;\n }\n return ret + \"i\";\n },\n\n /**\n * Returns the actual number as a vector\n *\n * @returns {Array}\n */\n 'toVector': function() {\n\n return [this['re'], this['im']];\n },\n\n /**\n * Returns the actual real value of the current object\n *\n * @returns {number|null}\n */\n 'valueOf': function() {\n\n if (this['im'] === 0) {\n return this['re'];\n }\n return null;\n },\n\n /**\n * Determines whether a complex number is not on the Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isNaN': function() {\n return isNaN(this['re']) || isNaN(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the zero pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isZero': function() {\n return this['im'] === 0 && this['re'] === 0;\n },\n\n /**\n * Determines whether a complex number is not at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isFinite': function() {\n return isFinite(this['re']) && isFinite(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isInfinite': function() {\n return !(this['isNaN']() || this['isFinite']());\n }\n };\n\n Complex['ZERO'] = new Complex(0, 0);\n Complex['ONE'] = new Complex(1, 0);\n Complex['I'] = new Complex(0, 1);\n Complex['PI'] = new Complex(Math.PI, 0);\n Complex['E'] = new Complex(Math.E, 0);\n Complex['INFINITY'] = new Complex(Infinity, Infinity);\n Complex['NAN'] = new Complex(NaN, NaN);\n Complex['EPSILON'] = 1e-15;\n\n if (typeof define === 'function' && define['amd']) {\n define([], function() {\n return Complex;\n });\n } else if (typeof exports === 'object') {\n Object.defineProperty(Complex, \"__esModule\", { 'value': true });\n Complex['default'] = Complex;\n Complex['Complex'] = Complex;\n module['exports'] = Complex;\n } else {\n root['Complex'] = Complex;\n }\n\n})(this);\n","\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};","/*\r\n * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license\r\n * Author: Jim Palmer (based on chunking idea from Dave Koelle)\r\n */\r\n/*jshint unused:false */\r\nmodule.exports = function naturalSort (a, b) {\r\n\t\"use strict\";\r\n\tvar re = /(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,\r\n\t\tsre = /(^[ ]*|[ ]*$)/g,\r\n\t\tdre = /(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,\r\n\t\thre = /^0x[0-9a-f]+$/i,\r\n\t\tore = /^0/,\r\n\t\ti = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; },\r\n\t\t// convert all to strings strip whitespace\r\n\t\tx = i(a).replace(sre, '') || '',\r\n\t\ty = i(b).replace(sre, '') || '',\r\n\t\t// chunk/tokenize\r\n\t\txN = x.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\tyN = y.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\t// numeric, hex or date detection\r\n\t\txD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),\r\n\t\tyD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,\r\n\t\toFxNcL, oFyNcL;\r\n\t// first try and sort Hex codes or Dates\r\n\tif (yD) {\r\n\t\tif ( xD < yD ) { return -1; }\r\n\t\telse if ( xD > yD ) { return 1; }\r\n\t}\r\n\t// natural sorting through split numeric strings and default strings\r\n\tfor(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {\r\n\t\t// find floats not starting with '0', string or 0 if not defined (Clint Priest)\r\n\t\toFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;\r\n\t\toFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;\r\n\t\t// handle numeric vs string comparison - number < string - (Kyle Adams)\r\n\t\tif (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }\r\n\t\t// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'\r\n\t\telse if (typeof oFxNcL !== typeof oFyNcL) {\r\n\t\t\toFxNcL += '';\r\n\t\t\toFyNcL += '';\r\n\t\t}\r\n\t\tif (oFxNcL < oFyNcL) { return -1; }\r\n\t\tif (oFxNcL > oFyNcL) { return 1; }\r\n\t}\r\n\treturn 0;\r\n};\r\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","'use strict';\nvar isPossiblePrototype = require('../internals/is-possible-prototype');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (isPossiblePrototype(argument)) return argument;\n throw new $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] === undefined) {\n defineProperty(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","'use strict';\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw new $TypeError('Incorrect invocation');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n if (length === 0) return !IS_INCLUDES && -1;\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call -- required for testing\n method.call(null, argument || function () { return 1; }, 1);\n });\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nvar $TypeError = TypeError;\n\nvar REDUCE_EMPTY = 'Reduce of empty array with no initial value';\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n aCallable(callbackfn);\n if (length === 0 && argumentsLength < 2) throw new $TypeError(REDUCE_EMPTY);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw new $TypeError(REDUCE_EMPTY);\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","'use strict';\nvar arraySlice = require('../internals/array-slice');\n\nvar floor = Math.floor;\n\nvar sort = function (array, comparefn) {\n var length = array.length;\n\n if (length < 8) {\n // insertion sort\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n }\n } else {\n // merge sort\n var middle = floor(length / 2);\n var left = sort(arraySlice(array, 0, middle), comparefn);\n var right = sort(arraySlice(array, middle), comparefn);\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n }\n }\n\n return array;\n};\n\nmodule.exports = sort;\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n try {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n } catch (error) { return false; } // workaround of old WebKit + `eval` bug\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));\n else object[key] = value;\n};\n","'use strict';\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(globalThis, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n globalThis[key] = value;\n } return value;\n};\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isObject = require('../internals/is-object');\n\nvar document = globalThis.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar UA = require('../internals/environment-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","'use strict';\nvar ENVIRONMENT = require('../internals/environment');\n\nmodule.exports = ENVIRONMENT === 'NODE';\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nvar navigator = globalThis.navigator;\nvar userAgent = navigator && navigator.userAgent;\n\nmodule.exports = userAgent ? String(userAgent) : '';\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar userAgent = require('../internals/environment-user-agent');\n\nvar process = globalThis.process;\nvar Deno = globalThis.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nvar userAgent = require('../internals/environment-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\n/* global Bun, Deno -- detection */\nvar globalThis = require('../internals/global-this');\nvar userAgent = require('../internals/environment-user-agent');\nvar classof = require('../internals/classof-raw');\n\nvar userAgentStartsWith = function (string) {\n return userAgent.slice(0, string.length) === string;\n};\n\nmodule.exports = (function () {\n if (userAgentStartsWith('Bun/')) return 'BUN';\n if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';\n if (userAgentStartsWith('Deno/')) return 'DENO';\n if (userAgentStartsWith('Node.js/')) return 'NODE';\n if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';\n if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';\n if (classof(globalThis.process) === 'process') return 'NODE';\n if (globalThis.window && globalThis.document) return 'BROWSER';\n return 'REST';\n})();\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = globalThis;\n } else if (STATIC) {\n target = globalThis[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = globalThis[TARGET] && globalThis[TARGET].prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegExp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) !== 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () {\n execCalled = true;\n return null;\n };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };\n }\n return { done: true, value: call(nativeMethod, str, regexp, arg2) };\n }\n return { done: false };\n });\n\n defineBuiltIn(String.prototype, KEY, methods[0]);\n defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];\n};\n","'use strict';\nvar classof = require('../internals/classof');\nvar getMethod = require('../internals/get-method');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw new $TypeError(tryToString(argument) + ' is not iterable');\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar floor = Math.floor;\nvar charAt = uncurryThis(''.charAt);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d{1,2}|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d{1,2})/g;\n\n// `GetSubstitution` abstract operation\n// https://tc39.es/ecma262/#sec-getsubstitution\nmodule.exports = function (matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return replace(replacement, symbols, function (match, ch) {\n var capture;\n switch (charAt(ch, 0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return stringSlice(str, 0, position);\n case \"'\": return stringSlice(str, tailPos);\n case '<':\n capture = namedCaptures[stringSlice(ch, 1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n};\n","'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nmodule.exports = function (a, b) {\n try {\n // eslint-disable-next-line no-console -- safe\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar globalThis = require('../internals/global-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = globalThis.TypeError;\nvar WeakMap = globalThis.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw new TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) === 'Array';\n};\n","'use strict';\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.test(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, [], argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nmodule.exports = function (argument) {\n return isObject(argument) || argument === null;\n};\n","'use strict';\nmodule.exports = false;\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nvar toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\).*$/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar safeGetBuiltIn = require('../internals/safe-get-built-in');\nvar bind = require('../internals/function-bind-context');\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/environment-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/environment-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/environment-is-webos-webkit');\nvar IS_NODE = require('../internals/environment-is-node');\n\nvar MutationObserver = globalThis.MutationObserver || globalThis.WebKitMutationObserver;\nvar document = globalThis.document;\nvar process = globalThis.process;\nvar Promise = globalThis.Promise;\nvar microtask = safeGetBuiltIn('queueMicrotask');\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, globalThis);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n // eslint-disable-next-line no-useless-assignment -- avoid memory leak\n activeXDocument = null;\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","'use strict';\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar isObject = require('../internals/is-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n requireObjectCoercible(O);\n aPossiblePrototype(proto);\n if (!isObject(O)) return O;\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar isCallable = require('../internals/is-callable');\nvar isForced = require('../internals/is-forced');\nvar inspectSource = require('../internals/inspect-source');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar ENVIRONMENT = require('../internals/environment');\nvar IS_PURE = require('../internals/is-pure');\nvar V8_VERSION = require('../internals/environment-v8-version');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(globalThis.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nmodule.exports = globalThis.Promise;\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","'use strict';\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar regexpExec = require('../internals/regexp-exec');\n\nvar $TypeError = TypeError;\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (isCallable(exec)) {\n var result = call(exec, R, S);\n if (result !== null) anObject(result);\n return result;\n }\n if (classof(R) === 'RegExp') return call(regexpExec, R, S);\n throw new $TypeError('RegExp#exec called on incompatible receiver');\n};\n","'use strict';\n/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\nvar nativeExec = RegExp.prototype.exec;\nvar patchedExec = nativeExec;\nvar charAt = uncurryThis(''.charAt);\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n call(nativeExec, re1, 'a');\n call(nativeExec, re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = call(patchedExec, raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = call(regexpFlags, re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = replace(flags, 'y', '');\n if (indexOf(flags, 'g') === -1) {\n flags += 'g';\n }\n\n strCopy = stringSlice(str, re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = call(nativeExec, sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = stringSlice(match.input, charsAdded);\n match[0] = stringSlice(match[0], charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/\n call(nativeReplace, match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.hasIndices) result += 'd';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.unicodeSets) result += 'v';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar hasOwn = require('../internals/has-own-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar regExpFlags = require('../internals/regexp-flags');\n\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (R) {\n var flags = R.flags;\n return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R)\n ? call(regExpFlags, R) : flags;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nvar UNSUPPORTED_Y = fails(function () {\n var re = $RegExp('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') !== null;\n});\n\n// UC Browser bug\n// https://github.com/zloirock/core-js/issues/1008\nvar MISSED_STICKY = UNSUPPORTED_Y || fails(function () {\n return !$RegExp('a', 'y').sticky;\n});\n\nvar BROKEN_CARET = UNSUPPORTED_Y || fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = $RegExp('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') !== null;\n});\n\nmodule.exports = {\n BROKEN_CARET: BROKEN_CARET,\n MISSED_STICKY: MISSED_STICKY,\n UNSUPPORTED_Y: UNSUPPORTED_Y\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('.', 's');\n return !(re.dotAll && re.test('\\n') && re.flags === 's');\n});\n","'use strict';\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\n// babel-minify and Closure Compiler transpiles RegExp('(?
    b)', 'g') -> /(?b)/g and it causes SyntaxError\nvar $RegExp = globalThis.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('(?b)', 'g');\n return re.exec('b').groups.a !== 'b' ||\n 'b'.replace(re, '$c') !== 'bc';\n});\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar DESCRIPTORS = require('../internals/descriptors');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Avoid NodeJS experimental warning\nmodule.exports = function (name) {\n if (!DESCRIPTORS) return globalThis[name];\n var descriptor = getOwnPropertyDescriptor(globalThis, name);\n return descriptor && descriptor.value;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineBuiltInAccessor(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar globalThis = require('../internals/global-this');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});\n\n(store.versions || (store.versions = [])).push({\n version: '3.38.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar store = require('../internals/shared-store');\n\nmodule.exports = function (key, value) {\n return store[key] || (store[key] = value || {});\n};\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/environment-v8-version');\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\nvar $String = globalThis.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar apply = require('../internals/function-apply');\nvar bind = require('../internals/function-bind-context');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar fails = require('../internals/fails');\nvar html = require('../internals/html');\nvar arraySlice = require('../internals/array-slice');\nvar createElement = require('../internals/document-create-element');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar IS_IOS = require('../internals/environment-is-ios');\nvar IS_NODE = require('../internals/environment-is-node');\n\nvar set = globalThis.setImmediate;\nvar clear = globalThis.clearImmediate;\nvar process = globalThis.process;\nvar Dispatch = globalThis.Dispatch;\nvar Function = globalThis.Function;\nvar MessageChannel = globalThis.MessageChannel;\nvar String = globalThis.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\nfails(function () {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = globalThis.location;\n});\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar eventListener = function (event) {\n run(event.data);\n};\n\nvar globalPostMessageDefer = function (id) {\n // old engines have not location.origin\n globalThis.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = eventListener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n globalThis.addEventListener &&\n isCallable(globalThis.postMessage) &&\n !globalThis.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(globalPostMessageDefer)\n ) {\n defer = globalPostMessageDefer;\n globalThis.addEventListener('message', eventListener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n var len = toIntegerOrInfinity(argument);\n return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw new $TypeError('Not enough arguments');\n return passed;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = globalThis.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = globalThis.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar fails = require('../internals/fails');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// FF99+ bug\nvar BROKEN_ON_SPARSE = fails(function () {\n // eslint-disable-next-line es/no-array-prototype-includes -- detection\n return !Array(1).includes();\n});\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","'use strict';\nvar $ = require('../internals/export');\nvar $reduce = require('../internals/array-reduce').left;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar CHROME_VERSION = require('../internals/environment-v8-version');\nvar IS_NODE = require('../internals/environment-is-node');\n\n// Chrome 80-82 has a critical bug\n// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982\nvar CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;\nvar FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');\n\n// `Array.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: FORCED }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/environment-ff-version');\nvar IE_OR_EDGE = require('../internals/environment-is-ie-or-edge');\nvar V8 = require('../internals/environment-v8-version');\nvar WEBKIT = require('../internals/environment-webkit-version');\n\nvar test = [];\nvar nativeSort = uncurryThis(test.sort);\nvar push = uncurryThis(test.push);\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);\n\n var items = [];\n var arrayLength = lengthOfArrayLike(array);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) push(items, array[index]);\n }\n\n internalSort(items, getSortCompare(comparefn));\n\n itemsLength = lengthOfArrayLike(items);\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) deletePropertyOrThrow(array, index++);\n\n return array;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')('stringify detection');\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) !== '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) !== '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) !== '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar createProperty = require('../internals/create-property');\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n fromEntries: function fromEntries(iterable) {\n var obj = {};\n iterate(iterable, function (k, v) {\n createProperty(obj, k, v);\n }, { AS_ENTRIES: true });\n return obj;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar IS_NODE = require('../internals/environment-is-node');\nvar globalThis = require('../internals/global-this');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar perform = require('../internals/perform');\nvar Queue = require('../internals/queue');\nvar InternalStateModule = require('../internals/internal-state');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar PromiseConstructorDetection = require('../internals/promise-constructor-detection');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = globalThis.TypeError;\nvar document = globalThis.document;\nvar process = globalThis.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && globalThis.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state === FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(new TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n globalThis.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, globalThis, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, globalThis, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw new TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: null\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state === PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.promise.constructor');\nrequire('../modules/es.promise.all');\nrequire('../modules/es.promise.catch');\nrequire('../modules/es.promise.race');\nrequire('../modules/es.promise.reject');\nrequire('../modules/es.promise.resolve');\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n var capabilityReject = capability.reject;\n capabilityReject(r);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar promiseResolve = require('../internals/promise-resolve');\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isForced = require('../internals/is-forced');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar create = require('../internals/object-create');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar isRegExp = require('../internals/is-regexp');\nvar toString = require('../internals/to-string');\nvar getRegExpFlags = require('../internals/regexp-get-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar proxyAccessor = require('../internals/proxy-accessor');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar fails = require('../internals/fails');\nvar hasOwn = require('../internals/has-own-property');\nvar enforceInternalState = require('../internals/internal-state').enforce;\nvar setSpecies = require('../internals/set-species');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar MATCH = wellKnownSymbol('match');\nvar NativeRegExp = globalThis.RegExp;\nvar RegExpPrototype = NativeRegExp.prototype;\nvar SyntaxError = globalThis.SyntaxError;\nvar exec = uncurryThis(RegExpPrototype.exec);\nvar charAt = uncurryThis(''.charAt);\nvar replace = uncurryThis(''.replace);\nvar stringIndexOf = uncurryThis(''.indexOf);\nvar stringSlice = uncurryThis(''.slice);\n// TODO: Use only proper RegExpIdentifierName\nvar IS_NCG = /^\\?<[^\\s\\d!#%&*+<=>@^][^\\s!#%&*+<=>@^]*>/;\nvar re1 = /a/g;\nvar re2 = /a/g;\n\n// \"new\" should create a new object, old webkit bug\nvar CORRECT_NEW = new NativeRegExp(re1) !== re1;\n\nvar MISSED_STICKY = stickyHelpers.MISSED_STICKY;\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\n\nvar BASE_FORCED = DESCRIPTORS &&\n (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () {\n re2[MATCH] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n // eslint-disable-next-line sonar/inconsistent-function-call -- required for testing\n return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i';\n }));\n\nvar handleDotAll = function (string) {\n var length = string.length;\n var index = 0;\n var result = '';\n var brackets = false;\n var chr;\n for (; index <= length; index++) {\n chr = charAt(string, index);\n if (chr === '\\\\') {\n result += chr + charAt(string, ++index);\n continue;\n }\n if (!brackets && chr === '.') {\n result += '[\\\\s\\\\S]';\n } else {\n if (chr === '[') {\n brackets = true;\n } else if (chr === ']') {\n brackets = false;\n } result += chr;\n }\n } return result;\n};\n\nvar handleNCG = function (string) {\n var length = string.length;\n var index = 0;\n var result = '';\n var named = [];\n var names = create(null);\n var brackets = false;\n var ncg = false;\n var groupid = 0;\n var groupname = '';\n var chr;\n for (; index <= length; index++) {\n chr = charAt(string, index);\n if (chr === '\\\\') {\n chr += charAt(string, ++index);\n } else if (chr === ']') {\n brackets = false;\n } else if (!brackets) switch (true) {\n case chr === '[':\n brackets = true;\n break;\n case chr === '(':\n result += chr;\n // ignore non-capturing groups\n if (stringSlice(string, index + 1, index + 3) === '?:') {\n continue;\n }\n if (exec(IS_NCG, stringSlice(string, index + 1))) {\n index += 2;\n ncg = true;\n }\n groupid++;\n continue;\n case chr === '>' && ncg:\n if (groupname === '' || hasOwn(names, groupname)) {\n throw new SyntaxError('Invalid capture group name');\n }\n names[groupname] = true;\n named[named.length] = [groupname, groupid];\n ncg = false;\n groupname = '';\n continue;\n }\n if (ncg) groupname += chr;\n else result += chr;\n } return [result, named];\n};\n\n// `RegExp` constructor\n// https://tc39.es/ecma262/#sec-regexp-constructor\nif (isForced('RegExp', BASE_FORCED)) {\n var RegExpWrapper = function RegExp(pattern, flags) {\n var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);\n var patternIsRegExp = isRegExp(pattern);\n var flagsAreUndefined = flags === undefined;\n var groups = [];\n var rawPattern = pattern;\n var rawFlags, dotAll, sticky, handled, result, state;\n\n if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {\n return pattern;\n }\n\n if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {\n pattern = pattern.source;\n if (flagsAreUndefined) flags = getRegExpFlags(rawPattern);\n }\n\n pattern = pattern === undefined ? '' : toString(pattern);\n flags = flags === undefined ? '' : toString(flags);\n rawPattern = pattern;\n\n if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {\n dotAll = !!flags && stringIndexOf(flags, 's') > -1;\n if (dotAll) flags = replace(flags, /s/g, '');\n }\n\n rawFlags = flags;\n\n if (MISSED_STICKY && 'sticky' in re1) {\n sticky = !!flags && stringIndexOf(flags, 'y') > -1;\n if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');\n }\n\n if (UNSUPPORTED_NCG) {\n handled = handleNCG(pattern);\n pattern = handled[0];\n groups = handled[1];\n }\n\n result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);\n\n if (dotAll || sticky || groups.length) {\n state = enforceInternalState(result);\n if (dotAll) {\n state.dotAll = true;\n state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);\n }\n if (sticky) state.sticky = true;\n if (groups.length) state.groups = groups;\n }\n\n if (pattern !== rawPattern) try {\n // fails in old engines, but we have no alternatives for unsupported regex syntax\n createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);\n } catch (error) { /* empty */ }\n\n return result;\n };\n\n for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {\n proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);\n }\n\n RegExpPrototype.constructor = RegExpWrapper;\n RegExpWrapper.prototype = RegExpPrototype;\n defineBuiltIn(globalThis, 'RegExp', RegExpWrapper, { constructor: true });\n}\n\n// https://tc39.es/ecma262/#sec-get-regexp-@@species\nsetSpecies('RegExp');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar classof = require('../internals/classof-raw');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar getInternalState = require('../internals/internal-state').get;\n\nvar RegExpPrototype = RegExp.prototype;\nvar $TypeError = TypeError;\n\n// `RegExp.prototype.dotAll` getter\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall\nif (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {\n defineBuiltInAccessor(RegExpPrototype, 'dotAll', {\n configurable: true,\n get: function dotAll() {\n if (this === RegExpPrototype) return;\n // We can't use InternalStateModule.getterFor because\n // we don't add metadata for regexps created by a literal.\n if (classof(this) === 'RegExp') {\n return !!getInternalState(this).dotAll;\n }\n throw new $TypeError('Incompatible receiver, RegExp required');\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar fails = require('../internals/fails');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar getMethod = require('../internals/get-method');\nvar getSubstitution = require('../internals/get-substitution');\nvar regExpExec = require('../internals/regexp-exec-abstract');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar REPLACE = wellKnownSymbol('replace');\nvar max = Math.max;\nvar min = Math.min;\nvar concat = uncurryThis([].concat);\nvar push = uncurryThis([].push);\nvar stringIndexOf = uncurryThis(''.indexOf);\nvar stringSlice = uncurryThis(''.slice);\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// IE <= 11 replaces $0 with the whole match, as if it was $&\n// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\nvar REPLACE_KEEPS_$0 = (function () {\n // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing\n return 'a'.replace(/./, '$0') === '$0';\n})();\n\n// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\nvar REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n})();\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive\n return ''.replace(re, '$') !== '7';\n});\n\n// @@replace logic\nfixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.es/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);\n return replacer\n ? call(replacer, searchValue, O, replaceValue)\n : call(nativeReplace, toString(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace\n function (string, replaceValue) {\n var rx = anObject(this);\n var S = toString(string);\n\n if (\n typeof replaceValue == 'string' &&\n stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&\n stringIndexOf(replaceValue, '$<') === -1\n ) {\n var res = maybeCallNative(nativeReplace, rx, S, replaceValue);\n if (res.done) return res.value;\n }\n\n var functionalReplace = isCallable(replaceValue);\n if (!functionalReplace) replaceValue = toString(replaceValue);\n\n var global = rx.global;\n var fullUnicode;\n if (global) {\n fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n\n var results = [];\n var result;\n while (true) {\n result = regExpExec(rx, S);\n if (result === null) break;\n\n push(results, result);\n if (!global) break;\n\n var matchStr = toString(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = toString(result[0]);\n var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);\n var captures = [];\n var replacement;\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = concat([matched], captures, position, S);\n if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);\n replacement = toString(apply(replaceValue, undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n\n return accumulatedResult + stringSlice(S, nextSourcePosition);\n }\n ];\n}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);\n","// `Symbol.prototype.description` getter\n// https://tc39.es/ecma262/#sec-symbol.prototype.description\n'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar toString = require('../internals/to-string');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\n\nvar NativeSymbol = globalThis.Symbol;\nvar SymbolPrototype = NativeSymbol && NativeSymbol.prototype;\n\nif (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||\n // Safari 12 bug\n NativeSymbol().description !== undefined\n)) {\n var EmptyStringDescriptionStore = {};\n // wrap Symbol constructor for correct work with undefined description\n var SymbolWrapper = function Symbol() {\n var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);\n var result = isPrototypeOf(SymbolPrototype, this)\n // eslint-disable-next-line sonar/inconsistent-function-call -- ok\n ? new NativeSymbol(description)\n // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'\n : description === undefined ? NativeSymbol() : NativeSymbol(description);\n if (description === '') EmptyStringDescriptionStore[result] = true;\n return result;\n };\n\n copyConstructorProperties(SymbolWrapper, NativeSymbol);\n SymbolWrapper.prototype = SymbolPrototype;\n SymbolPrototype.constructor = SymbolWrapper;\n\n var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';\n var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);\n var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);\n var regexp = /^Symbol\\((.*)\\)[^)]+$/;\n var replace = uncurryThis(''.replace);\n var stringSlice = uncurryThis(''.slice);\n\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n var symbol = thisSymbolValue(this);\n if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';\n var string = symbolDescriptiveString(symbol);\n var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');\n return desc === '' ? undefined : desc;\n }\n });\n\n $({ global: true, constructor: true, forced: true }, {\n Symbol: SymbolWrapper\n });\n}\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global[\"'typed'\"] = factory());\n})(this, (function () { 'use strict';\n\n function ok() {\n return true;\n }\n function notOk() {\n return false;\n }\n function undef() {\n return undefined;\n }\n const NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n /**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n /**\n * @returns {() => function}\n */\n function create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n }\n var typedFunction = create();\n\n return typedFunction;\n\n}));\n//# sourceMappingURL=typed-function.js.map\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import { hasOwnProperty } from './object.js'\n\n/**\n * Get a property of a plain object\n * Throws an error in case the object is not a plain object or the\n * property is not defined on the object itself\n * @param {Object} object\n * @param {string} prop\n * @return {*} Returns the property value when safe\n */\nfunction getSafeProperty (object, prop) {\n // only allow getting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n return object[prop]\n }\n\n if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) {\n throw new Error('Cannot access method \"' + prop + '\" as a property')\n }\n\n throw new Error('No access to property \"' + prop + '\"')\n}\n\n/**\n * Set a property on a plain object.\n * Throws an error in case the object is not a plain object or the\n * property would override an inherited property like .constructor or .toString\n * @param {Object} object\n * @param {string} prop\n * @param {*} value\n * @return {*} Returns the value\n */\n// TODO: merge this function into access.js?\nfunction setSafeProperty (object, prop, value) {\n // only allow setting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n object[prop] = value\n return value\n }\n\n throw new Error('No access to property \"' + prop + '\"')\n}\n\n/**\n * Test whether a property is safe to use on an object or Array.\n * For example .toString and .constructor are not safe\n * @param {Object | Array} object\n * @param {string} prop\n * @return {boolean} Returns true when safe\n */\nfunction isSafeProperty (object, prop) {\n if (!isPlainObject(object) && !Array.isArray(object)) {\n return false\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (prop in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false\n }\n return true\n}\n\n/**\n * Validate whether a method is safe.\n * Throws an error when that's not the case.\n * @param {Object} object\n * @param {string} method\n * @return {function} Returns the method when valid\n */\nfunction getSafeMethod (object, method) {\n if (!isSafeMethod(object, method)) {\n throw new Error('No access to method \"' + method + '\"')\n }\n\n return object[method]\n}\n\n/**\n * Check whether a method is safe.\n * Throws an error when that's not the case (for example for `constructor`).\n * @param {Object} object\n * @param {string} method\n * @return {boolean} Returns true when safe, false otherwise\n */\nfunction isSafeMethod (object, method) {\n if (object === null || object === undefined || typeof object[method] !== 'function') {\n return false\n }\n // UNSAFE: ghosted\n // e.g overridden toString\n // Note that IE10 doesn't support __proto__ and we can't do this check there.\n if (hasOwnProperty(object, method) &&\n (Object.getPrototypeOf && (method in Object.getPrototypeOf(object)))) {\n return false\n }\n // SAFE: whitelisted\n // e.g toString\n if (hasOwnProperty(safeNativeMethods, method)) {\n return true\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (method in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (method in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false\n }\n return true\n}\n\nfunction isPlainObject (object) {\n return typeof object === 'object' && object && object.constructor === Object\n}\n\nconst safeNativeProperties = {\n length: true,\n name: true\n}\n\nconst safeNativeMethods = {\n toString: true,\n valueOf: true,\n toLocaleString: true\n}\n\nexport { getSafeProperty }\nexport { setSafeProperty }\nexport { isSafeProperty }\nexport { getSafeMethod }\nexport { isSafeMethod }\nexport { isPlainObject }\n","import { getSafeProperty, isSafeProperty, setSafeProperty } from './customs.js'\nimport { isMap, isObject } from './is.js'\n\n/**\n * A map facade on a bare object.\n *\n * The small number of methods needed to implement a scope,\n * forwarding on to the SafeProperty functions. Over time, the codebase\n * will stop using this method, as all objects will be Maps, rather than\n * more security prone objects.\n */\nexport class ObjectWrappingMap {\n constructor (object) {\n this.wrappedObject = object\n\n this[Symbol.iterator] = this.entries\n }\n\n keys () {\n return Object.keys(this.wrappedObject)\n .filter(key => this.has(key))\n .values()\n }\n\n get (key) {\n return getSafeProperty(this.wrappedObject, key)\n }\n\n set (key, value) {\n setSafeProperty(this.wrappedObject, key, value)\n return this\n }\n\n has (key) {\n return isSafeProperty(this.wrappedObject, key) && key in this.wrappedObject\n }\n\n entries () {\n return mapIterator(this.keys(), key => [key, this.get(key)])\n }\n\n forEach (callback) {\n for (const key of this.keys()) {\n callback(this.get(key), key, this)\n }\n }\n\n delete (key) {\n if (isSafeProperty(this.wrappedObject, key)) {\n delete this.wrappedObject[key]\n }\n }\n\n clear () {\n for (const key of this.keys()) {\n this.delete(key)\n }\n }\n\n get size () {\n return Object.keys(this.wrappedObject).length\n }\n}\n\n/**\n * Create a map with two partitions: a and b.\n * The set with bKeys determines which keys/values are read/written to map b,\n * all other values are read/written to map a\n *\n * For example:\n *\n * const a = new Map()\n * const b = new Map()\n * const p = new PartitionedMap(a, b, new Set(['x', 'y']))\n *\n * In this case, values `x` and `y` are read/written to map `b`,\n * all other values are read/written to map `a`.\n */\nexport class PartitionedMap {\n /**\n * @param {Map} a\n * @param {Map} b\n * @param {Set} bKeys\n */\n constructor (a, b, bKeys) {\n this.a = a\n this.b = b\n this.bKeys = bKeys\n\n this[Symbol.iterator] = this.entries\n }\n\n get (key) {\n return this.bKeys.has(key)\n ? this.b.get(key)\n : this.a.get(key)\n }\n\n set (key, value) {\n if (this.bKeys.has(key)) {\n this.b.set(key, value)\n } else {\n this.a.set(key, value)\n }\n return this\n }\n\n has (key) {\n return this.b.has(key) || this.a.has(key)\n }\n\n keys () {\n return new Set([\n ...this.a.keys(),\n ...this.b.keys()\n ])[Symbol.iterator]()\n }\n\n entries () {\n return mapIterator(this.keys(), key => [key, this.get(key)])\n }\n\n forEach (callback) {\n for (const key of this.keys()) {\n callback(this.get(key), key, this)\n }\n }\n\n delete (key) {\n return this.bKeys.has(key)\n ? this.b.delete(key)\n : this.a.delete(key)\n }\n\n clear () {\n this.a.clear()\n this.b.clear()\n }\n\n get size () {\n return [...this.keys()].length\n }\n}\n\n/**\n * Create a new iterator that maps over the provided iterator, applying a mapping function to each item\n */\nfunction mapIterator (it, callback) {\n return {\n next: () => {\n const n = it.next()\n return (n.done)\n ? n\n : {\n value: callback(n.value),\n done: false\n }\n }\n }\n}\n\n/**\n * Creates an empty map, or whatever your platform's polyfill is.\n *\n * @returns an empty Map or Map like object.\n */\nexport function createEmptyMap () {\n return new Map()\n}\n\n/**\n * Creates a Map from the given object.\n *\n * @param { Map | { [key: string]: unknown } | undefined } mapOrObject\n * @returns\n */\nexport function createMap (mapOrObject) {\n if (!mapOrObject) {\n return createEmptyMap()\n }\n if (isMap(mapOrObject)) {\n return mapOrObject\n }\n if (isObject(mapOrObject)) {\n return new ObjectWrappingMap(mapOrObject)\n }\n\n throw new Error('createMap can create maps from objects or Maps')\n}\n\n/**\n * Unwraps a map into an object.\n *\n * @param {Map} map\n * @returns { [key: string]: unknown }\n */\nexport function toObject (map) {\n if (map instanceof ObjectWrappingMap) {\n return map.wrappedObject\n }\n const object = {}\n for (const key of map.keys()) {\n const value = map.get(key)\n setSafeProperty(object, key, value)\n }\n return object\n}\n\n/**\n * Copies the contents of key-value pairs from each `objects` in to `map`.\n *\n * Object is `objects` can be a `Map` or object.\n *\n * This is the `Map` analog to `Object.assign`.\n */\nexport function assign (map, ...objects) {\n for (const args of objects) {\n if (!args) {\n continue\n }\n if (isMap(args)) {\n for (const key of args.keys()) {\n map.set(key, args.get(key))\n }\n } else if (isObject(args)) {\n for (const key of Object.keys(args)) {\n map.set(key, args[key])\n }\n }\n }\n return map\n}\n","// type checks for all known types\n//\n// note that:\n//\n// - check by duck-typing on a property like `isUnit`, instead of checking instanceof.\n// instanceof cannot be used because that would not allow to pass data from\n// one instance of math.js to another since each has it's own instance of Unit.\n// - check the `isUnit` property via the constructor, so there will be no\n// matches for \"fake\" instances like plain objects with a property `isUnit`.\n// That is important for security reasons.\n// - It must not be possible to override the type checks used internally,\n// for security reasons, so these functions are not exposed in the expression\n// parser.\n\nimport { ObjectWrappingMap } from './map.js'\n\nexport function isNumber (x) {\n return typeof x === 'number'\n}\n\nexport function isBigNumber (x) {\n if (\n !x || typeof x !== 'object' ||\n typeof x.constructor !== 'function'\n ) {\n return false\n }\n\n if (\n x.isBigNumber === true &&\n typeof x.constructor.prototype === 'object' &&\n x.constructor.prototype.isBigNumber === true\n ) {\n return true\n }\n\n if (\n typeof x.constructor.isDecimal === 'function' &&\n x.constructor.isDecimal(x) === true\n ) {\n return true\n }\n\n return false\n}\n\nexport function isBigInt (x) {\n return typeof x === 'bigint'\n}\n\nexport function isComplex (x) {\n return (x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true) || false\n}\n\nexport function isFraction (x) {\n return (x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true) || false\n}\n\nexport function isUnit (x) {\n return (x && x.constructor.prototype.isUnit === true) || false\n}\n\nexport function isString (x) {\n return typeof x === 'string'\n}\n\nexport const isArray = Array.isArray\n\nexport function isMatrix (x) {\n return (x && x.constructor.prototype.isMatrix === true) || false\n}\n\n/**\n * Test whether a value is a collection: an Array or Matrix\n * @param {*} x\n * @returns {boolean} isCollection\n */\nexport function isCollection (x) {\n return Array.isArray(x) || isMatrix(x)\n}\n\nexport function isDenseMatrix (x) {\n return (x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true) || false\n}\n\nexport function isSparseMatrix (x) {\n return (x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true) || false\n}\n\nexport function isRange (x) {\n return (x && x.constructor.prototype.isRange === true) || false\n}\n\nexport function isIndex (x) {\n return (x && x.constructor.prototype.isIndex === true) || false\n}\n\nexport function isBoolean (x) {\n return typeof x === 'boolean'\n}\n\nexport function isResultSet (x) {\n return (x && x.constructor.prototype.isResultSet === true) || false\n}\n\nexport function isHelp (x) {\n return (x && x.constructor.prototype.isHelp === true) || false\n}\n\nexport function isFunction (x) {\n return typeof x === 'function'\n}\n\nexport function isDate (x) {\n return x instanceof Date\n}\n\nexport function isRegExp (x) {\n return x instanceof RegExp\n}\n\nexport function isObject (x) {\n return !!(x &&\n typeof x === 'object' &&\n x.constructor === Object &&\n !isComplex(x) &&\n !isFraction(x))\n}\n\n/**\n * Returns `true` if the passed object appears to be a Map (i.e. duck typing).\n *\n * Methods looked for are `get`, `set`, `keys` and `has`.\n *\n * @param {Map | object} object\n * @returns\n */\nexport function isMap (object) {\n // We can use the fast instanceof, or a slower duck typing check.\n // The duck typing method needs to cover enough methods to not be confused with DenseMatrix.\n if (!object) {\n return false\n }\n return object instanceof Map ||\n object instanceof ObjectWrappingMap ||\n (\n typeof object.set === 'function' &&\n typeof object.get === 'function' &&\n typeof object.keys === 'function' &&\n typeof object.has === 'function'\n )\n}\n\nexport function isPartitionedMap (object) {\n return isMap(object) && isMap(object.a) && isMap(object.b)\n}\n\nexport function isObjectWrappingMap (object) {\n return isMap(object) && isObject(object.wrappedObject)\n}\n\nexport function isNull (x) {\n return x === null\n}\n\nexport function isUndefined (x) {\n return x === undefined\n}\n\nexport function isAccessorNode (x) {\n return (x && x.isAccessorNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isArrayNode (x) {\n return (x && x.isArrayNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isAssignmentNode (x) {\n return (x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isBlockNode (x) {\n return (x && x.isBlockNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isConditionalNode (x) {\n return (x && x.isConditionalNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isConstantNode (x) {\n return (x && x.isConstantNode === true && x.constructor.prototype.isNode === true) || false\n}\n\n/* Very specialized: returns true for those nodes which in the numerator of\n a fraction means that the division in that fraction has precedence over implicit\n multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but\n 6!/8 x parses as 6! / (8x). It is located here because it is shared between\n parse.js and OperatorNode.js (for parsing and printing, respectively).\n\n This should *not* be exported from mathjs, unlike most of the tests here.\n Its name does not start with 'is' to prevent utils/snapshot.js from thinking\n it should be exported.\n*/\nexport function rule2Node (node) {\n return isConstantNode(node) ||\n (isOperatorNode(node) &&\n node.args.length === 1 &&\n isConstantNode(node.args[0]) &&\n '-+~'.includes(node.op))\n}\n\nexport function isFunctionAssignmentNode (x) {\n return (x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isFunctionNode (x) {\n return (x && x.isFunctionNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isIndexNode (x) {\n return (x && x.isIndexNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isNode (x) {\n return (x && x.isNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isObjectNode (x) {\n return (x && x.isObjectNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isOperatorNode (x) {\n return (x && x.isOperatorNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isParenthesisNode (x) {\n return (x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isRangeNode (x) {\n return (x && x.isRangeNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isRelationalNode (x) {\n return (x && x.isRelationalNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isSymbolNode (x) {\n return (x && x.isSymbolNode === true && x.constructor.prototype.isNode === true) || false\n}\n\nexport function isChain (x) {\n return (x && x.constructor.prototype.isChain === true) || false\n}\n\nexport function typeOf (x) {\n const t = typeof x\n\n if (t === 'object') {\n if (x === null) return 'null'\n if (isBigNumber(x)) return 'BigNumber' // Special: weird mashup with Decimal\n if (x.constructor && x.constructor.name) return x.constructor.name\n\n return 'Object' // just in case\n }\n\n return t // can be 'string', 'number', 'boolean', 'function', 'bigint', ...\n}\n","import { isBigNumber, isObject } from './is.js'\n\n/**\n * Clone an object\n *\n * clone(x)\n *\n * Can clone any primitive type, array, and object.\n * If x has a function clone, this function will be invoked to clone the object.\n *\n * @param {*} x\n * @return {*} clone\n */\nexport function clone (x) {\n const type = typeof x\n\n // immutable primitive types\n if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' ||\n x === null || x === undefined) {\n return x\n }\n\n // use clone function of the object when available\n if (typeof x.clone === 'function') {\n return x.clone()\n }\n\n // array\n if (Array.isArray(x)) {\n return x.map(function (value) {\n return clone(value)\n })\n }\n\n if (x instanceof Date) return new Date(x.valueOf())\n if (isBigNumber(x)) return x // bignumbers are immutable\n\n // object\n if (isObject(x)) {\n return mapObject(x, clone)\n }\n\n throw new TypeError(`Cannot clone: unknown type of value (value: ${x})`)\n}\n\n/**\n * Apply map to all properties of an object\n * @param {Object} object\n * @param {function} callback\n * @return {Object} Returns a copy of the object with mapped properties\n */\nexport function mapObject (object, callback) {\n const clone = {}\n\n for (const key in object) {\n if (hasOwnProperty(object, key)) {\n clone[key] = callback(object[key])\n }\n }\n\n return clone\n}\n\n/**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexport function extend (a, b) {\n for (const prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop]\n }\n }\n return a\n}\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @returns {Object}\n */\nexport function deepExtend (a, b) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend')\n }\n\n for (const prop in b) {\n // We check against prop not being in Object.prototype or Function.prototype\n // to prevent polluting for example Object.__proto__.\n if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {}\n }\n if (a[prop] && a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop])\n } else {\n a[prop] = b[prop]\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend')\n } else {\n a[prop] = b[prop]\n }\n }\n }\n return a\n}\n\n/**\n * Deep test equality of all fields in two pairs of arrays or objects.\n * Compares values and functions strictly (ie. 2 is not the same as '2').\n * @param {Array | Object} a\n * @param {Array | Object} b\n * @returns {boolean}\n */\nexport function deepStrictEqual (a, b) {\n let prop, i, len\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false\n }\n\n if (a.length !== b.length) {\n return false\n }\n\n for (i = 0, len = a.length; i < len; i++) {\n if (!deepStrictEqual(a[i], b[i])) {\n return false\n }\n }\n return true\n } else if (typeof a === 'function') {\n return (a === b)\n } else if (a instanceof Object) {\n if (Array.isArray(b) || !(b instanceof Object)) {\n return false\n }\n\n for (prop in a) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) {\n return false\n }\n }\n for (prop in b) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in a)) {\n return false\n }\n }\n return true\n } else {\n return (a === b)\n }\n}\n\n/**\n * Recursively flatten a nested object.\n * @param {Object} nestedObject\n * @return {Object} Returns the flattened object\n */\nexport function deepFlatten (nestedObject) {\n const flattenedObject = {}\n\n _deepFlatten(nestedObject, flattenedObject)\n\n return flattenedObject\n}\n\n// helper function used by deepFlatten\nfunction _deepFlatten (nestedObject, flattenedObject) {\n for (const prop in nestedObject) {\n if (hasOwnProperty(nestedObject, prop)) {\n const value = nestedObject[prop]\n if (typeof value === 'object' && value !== null) {\n _deepFlatten(value, flattenedObject)\n } else {\n flattenedObject[prop] = value\n }\n }\n }\n}\n\n/**\n * Test whether the current JavaScript engine supports Object.defineProperty\n * @returns {boolean} returns true if supported\n */\nexport function canDefineProperty () {\n // test needed for broken IE8 implementation\n try {\n if (Object.defineProperty) {\n Object.defineProperty({}, 'x', { get: function () { return null } })\n return true\n }\n } catch (e) {}\n\n return false\n}\n\n/**\n * Attach a lazy loading property to a constant.\n * The given function `fn` is called once when the property is first requested.\n *\n * @param {Object} object Object where to add the property\n * @param {string} prop Property name\n * @param {Function} valueResolver Function returning the property value. Called\n * without arguments.\n */\nexport function lazy (object, prop, valueResolver) {\n let _uninitialized = true\n let _value\n\n Object.defineProperty(object, prop, {\n get: function () {\n if (_uninitialized) {\n _value = valueResolver()\n _uninitialized = false\n }\n return _value\n },\n\n set: function (value) {\n _value = value\n _uninitialized = false\n },\n\n configurable: true,\n enumerable: true\n })\n}\n\n/**\n * Traverse a path into an object.\n * When a namespace is missing, it will be created\n * @param {Object} object\n * @param {string | string[]} path A dot separated string like 'name.space'\n * @return {Object} Returns the object at the end of the path\n */\nexport function traverse (object, path) {\n if (path && typeof path === 'string') {\n return traverse(object, path.split('.'))\n }\n\n let obj = object\n\n if (path) {\n for (let i = 0; i < path.length; i++) {\n const key = path[i]\n if (!(key in obj)) {\n obj[key] = {}\n }\n obj = obj[key]\n }\n }\n\n return obj\n}\n\n/**\n * A safe hasOwnProperty\n * @param {Object} object\n * @param {string} property\n */\nexport function hasOwnProperty (object, property) {\n return object && Object.hasOwnProperty.call(object, property)\n}\n\n/**\n * Test whether an object is a factory. a factory has fields:\n *\n * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required)\n * - name: string (optional)\n * - path: string A dot separated path (optional)\n * - math: boolean If true (false by default), the math namespace is passed\n * as fifth argument of the factory function\n *\n * @param {*} object\n * @returns {boolean}\n */\nexport function isLegacyFactory (object) {\n return object && typeof object.factory === 'function'\n}\n\n/**\n * Get a nested property from an object\n * @param {Object} object\n * @param {string | string[]} path\n * @returns {Object}\n */\nexport function get (object, path) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return get(object, path.split('.'))\n } else {\n return object[path]\n }\n }\n\n let child = object\n\n for (let i = 0; i < path.length; i++) {\n const key = path[i]\n child = child ? child[key] : undefined\n }\n\n return child\n}\n\n/**\n * Set a nested property in an object\n * Mutates the object itself\n * If the path doesn't exist, it will be created\n * @param {Object} object\n * @param {string | string[]} path\n * @param {*} value\n * @returns {Object}\n */\nexport function set (object, path, value) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return set(object, path.split('.'), value)\n } else {\n object[path] = value\n return object\n }\n }\n\n let child = object\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i]\n if (child[key] === undefined) {\n child[key] = {}\n }\n child = child[key]\n }\n\n if (path.length > 0) {\n const lastKey = path[path.length - 1]\n child[lastKey] = value\n }\n\n return object\n}\n\n/**\n * Create an object composed of the picked object properties\n * @param {Object} object\n * @param {string[]} properties\n * @param {function} [transform] Optional value to transform a value when picking it\n * @return {Object}\n */\nexport function pick (object, properties, transform) {\n const copy = {}\n\n for (let i = 0; i < properties.length; i++) {\n const key = properties[i]\n const value = get(object, key)\n if (value !== undefined) {\n set(copy, key, transform ? transform(value, key) : value)\n }\n }\n\n return copy\n}\n\n/**\n * Shallow version of pick, creating an object composed of the picked object properties\n * but not for nested properties\n * @param {Object} object\n * @param {string[]} properties\n * @return {Object}\n */\nexport function pickShallow (object, properties) {\n const copy = {}\n\n for (let i = 0; i < properties.length; i++) {\n const key = properties[i]\n const value = object[key]\n if (value !== undefined) {\n copy[key] = value\n }\n }\n\n return copy\n}\n\n// helper function to test whether a string contains a path like 'user.name'\nfunction isPath (str) {\n return str.includes('.')\n}\n","import { pickShallow } from './object.js'\n\n/**\n * Create a factory function, which can be used to inject dependencies.\n *\n * The created functions are memoized, a consecutive call of the factory\n * with the exact same inputs will return the same function instance.\n * The memoized cache is exposed on `factory.cache` and can be cleared\n * if needed.\n *\n * Example:\n *\n * const name = 'log'\n * const dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n *\n * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n * // ... create the function log here and return it\n * }\n *\n * @param {string} name Name of the function to be created\n * @param {string[]} dependencies The names of all required dependencies\n * @param {function} create Callback function called with an object with all dependencies\n * @param {Object} [meta] Optional object with meta information that will be attached\n * to the created factory function as property `meta`.\n * @returns {function}\n */\nexport function factory (name, dependencies, create, meta) {\n function assertAndCreate (scope) {\n // we only pass the requested dependencies to the factory function\n // to prevent functions to rely on dependencies that are not explicitly\n // requested.\n const deps = pickShallow(scope, dependencies.map(stripOptionalNotation))\n\n assertDependencies(name, dependencies, scope)\n\n return create(deps)\n }\n\n assertAndCreate.isFactory = true\n assertAndCreate.fn = name\n assertAndCreate.dependencies = dependencies.slice().sort()\n if (meta) {\n assertAndCreate.meta = meta\n }\n\n return assertAndCreate\n}\n\n/**\n * Sort all factories such that when loading in order, the dependencies are resolved.\n *\n * @param {Array} factories\n * @returns {Array} Returns a new array with the sorted factories.\n */\nexport function sortFactories (factories) {\n const factoriesByName = {}\n\n factories.forEach(factory => {\n factoriesByName[factory.fn] = factory\n })\n\n function containsDependency (factory, dependency) {\n // TODO: detect circular references\n if (isFactory(factory)) {\n if (factory.dependencies.includes(dependency.fn || dependency.name)) {\n return true\n }\n\n if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) {\n return true\n }\n }\n\n return false\n }\n\n const sorted = []\n\n function addFactory (factory) {\n let index = 0\n while (index < sorted.length && !containsDependency(sorted[index], factory)) {\n index++\n }\n\n sorted.splice(index, 0, factory)\n }\n\n // sort regular factory functions\n factories\n .filter(isFactory)\n .forEach(addFactory)\n\n // sort legacy factory functions AFTER the regular factory functions\n factories\n .filter(factory => !isFactory(factory))\n .forEach(addFactory)\n\n return sorted\n}\n\n// TODO: comment or cleanup if unused in the end\nexport function create (factories, scope = {}) {\n sortFactories(factories)\n .forEach(factory => factory(scope))\n\n return scope\n}\n\n/**\n * Test whether an object is a factory. This is the case when it has\n * properties name, dependencies, and a function create.\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isFactory (obj) {\n return typeof obj === 'function' &&\n typeof obj.fn === 'string' &&\n Array.isArray(obj.dependencies)\n}\n\n/**\n * Assert that all dependencies of a list with dependencies are available in the provided scope.\n *\n * Will throw an exception when there are dependencies missing.\n *\n * @param {string} name Name for the function to be created. Used to generate a useful error message\n * @param {string[]} dependencies\n * @param {Object} scope\n */\nexport function assertDependencies (name, dependencies, scope) {\n const allDefined = dependencies\n .filter(dependency => !isOptionalDependency(dependency)) // filter optionals\n .every(dependency => scope[dependency] !== undefined)\n\n if (!allDefined) {\n const missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined)\n\n // TODO: create a custom error class for this, a MathjsError or something like that\n throw new Error(`Cannot create function \"${name}\", ` +\n `some dependencies are missing: ${missingDependencies.map(d => `\"${d}\"`).join(', ')}.`)\n }\n}\n\nexport function isOptionalDependency (dependency) {\n return dependency && dependency[0] === '?'\n}\n\nexport function stripOptionalNotation (dependency) {\n return dependency && dependency[0] === '?'\n ? dependency.slice(1)\n : dependency\n}\n","import { isBigNumber, isNumber, isObject } from './is.js'\n\n/**\n * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue\n */\n\n/**\n * Check if a number is integer\n * @param {number | boolean} value\n * @return {boolean} isInteger\n */\nexport function isInteger (value) {\n if (typeof value === 'boolean') {\n return true\n }\n\n return isFinite(value)\n ? (value === Math.round(value))\n : false\n}\n\n/**\n * Check if a string contains an integer\n * @param {string} str\n * @return {boolean} isInteger\n */\nexport function isIntegerStr (str) {\n // regex matching strings like \"123\" and \"-123\"\n return /^-?\\d+$/.test(str)\n}\n\n/**\n * Ensure the number type is compatible with the provided value.\n * If not, return 'number' instead.\n *\n * For example:\n *\n * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })\n *\n * will return 'number' and not 'bigint' because trying to create a bigint with\n * value 2.3 would throw an exception.\n *\n * @param {string} numberStr\n * @param {{\n * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'\n * numberFallback: 'number' | 'BigNumber'\n * }} config\n * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}\n */\nexport function safeNumberType (numberStr, config) {\n if (config.number === 'bigint' && !isIntegerStr(numberStr)) {\n return config.numberFallback\n }\n\n return config.number\n}\n\n/**\n * Calculate the sign of a number\n * @param {number} x\n * @returns {number}\n */\nexport const sign = Math.sign || function (x) {\n if (x > 0) {\n return 1\n } else if (x < 0) {\n return -1\n } else {\n return 0\n }\n}\n\n/**\n * Calculate the base-2 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport const log2 = Math.log2 || function log2 (x) {\n return Math.log(x) / Math.LN2\n}\n\n/**\n * Calculate the base-10 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport const log10 = Math.log10 || function log10 (x) {\n return Math.log(x) / Math.LN10\n}\n\n/**\n * Calculate the natural logarithm of a number + 1\n * @param {number} x\n * @returns {number}\n */\nexport const log1p = Math.log1p || function (x) {\n return Math.log(x + 1)\n}\n\n/**\n * Calculate cubic root for a number\n *\n * Code from es6-shim.js:\n * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577\n *\n * @param {number} x\n * @returns {number} Returns the cubic root of x\n */\nexport const cbrt = Math.cbrt || function cbrt (x) {\n if (x === 0) {\n return x\n }\n\n const negate = x < 0\n let result\n if (negate) {\n x = -x\n }\n\n if (isFinite(x)) {\n result = Math.exp(Math.log(x) / 3)\n // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods\n result = (x / (result * result) + (2 * result)) / 3\n } else {\n result = x\n }\n\n return negate ? -result : result\n}\n\n/**\n * Calculates exponentiation minus 1\n * @param {number} x\n * @return {number} res\n */\nexport const expm1 = Math.expm1 || function expm1 (x) {\n return (x >= 2e-4 || x <= -2e-4)\n ? Math.exp(x) - 1\n : x + x * x / 2 + x * x * x / 6\n}\n\n/**\n * Formats a number in a given base\n * @param {number} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatNumberToBase (n, base, size) {\n const prefixes = { 2: '0b', 8: '0o', 16: '0x' }\n const prefix = prefixes[base]\n let suffix = ''\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0')\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer')\n }\n if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) {\n throw new Error(`Value must be in range [-2^${size - 1}, 2^${size - 1}-1]`)\n }\n if (!isInteger(n)) {\n throw new Error('Value must be an integer')\n }\n if (n < 0) {\n n = n + 2 ** size\n }\n suffix = `i${size}`\n }\n let sign = ''\n if (n < 0) {\n n = -n\n sign = '-'\n }\n return `${sign}${prefix}${n.toString(base)}${suffix}`\n}\n\n/**\n * Convert a number to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'engineering' Always use engineering notation.\n * For example '123.4e+0' and '14.0e+6'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lowerExp` and `upperExp` bounds, and\n * uses exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default,\n * not rounding any digits.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12.071, {notation: 'fixed'}) // '12'\n * format(2.3, {notation: 'fixed', precision: 2}) // '2.30'\n * format(52.8, {notation: 'exponential'}) // '5.28e+1'\n * format(12345678, {notation: 'engineering'}) // '12.345678e+6'\n *\n * @param {number} value\n * @param {Object | Function | number} [options]\n * @return {string} str The formatted value\n */\nexport function format (value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value)\n }\n\n // handle special cases\n if (value === Infinity) {\n return 'Infinity'\n } else if (value === -Infinity) {\n return '-Infinity'\n } else if (isNaN(value)) {\n return 'NaN'\n }\n\n const { notation, precision, wordSize } = normalizeFormatOptions(options)\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision)\n\n case 'exponential':\n return toExponential(value, precision)\n\n case 'engineering':\n return toEngineering(value, precision)\n\n case 'bin':\n return formatNumberToBase(value, 2, wordSize)\n\n case 'oct':\n return formatNumberToBase(value, 8, wordSize)\n\n case 'hex':\n return formatNumberToBase(value, 16, wordSize)\n\n case 'auto':\n // remove trailing zeros after the decimal point\n return toPrecision(value, precision, options)\n .replace(/((\\.\\d*?)(0+))($|e)/, function () {\n const digits = arguments[2]\n const e = arguments[4]\n return (digits !== '.') ? digits + e : e\n })\n\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' +\n 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.')\n }\n}\n\n/**\n * Normalize format options into an object:\n * {\n * notation: string,\n * precision: number | undefined,\n * wordSize: number | undefined\n * }\n */\nexport function normalizeFormatOptions (options) {\n // default values for options\n let notation = 'auto'\n let precision\n let wordSize\n\n if (options !== undefined) {\n if (isNumber(options)) {\n precision = options\n } else if (isBigNumber(options)) {\n precision = options.toNumber()\n } else if (isObject(options)) {\n if (options.precision !== undefined) {\n precision = _toNumberOrThrow(options.precision, () => {\n throw new Error('Option \"precision\" must be a number or BigNumber')\n })\n }\n\n if (options.wordSize !== undefined) {\n wordSize = _toNumberOrThrow(options.wordSize, () => {\n throw new Error('Option \"wordSize\" must be a number or BigNumber')\n })\n }\n\n if (options.notation) {\n notation = options.notation\n }\n } else {\n throw new Error('Unsupported type of options, number, BigNumber, or object expected')\n }\n }\n\n return { notation, precision, wordSize }\n}\n\n/**\n * Split a number into sign, coefficients, and exponent\n * @param {number | string} value\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n */\nexport function splitNumber (value) {\n // parse the input value\n const match = String(value).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/)\n if (!match) {\n throw new SyntaxError('Invalid number ' + value)\n }\n\n const sign = match[1]\n const digits = match[2]\n let exponent = parseFloat(match[4] || '0')\n\n const dot = digits.indexOf('.')\n exponent += (dot !== -1) ? (dot - 1) : (digits.length - 1)\n\n const coefficients = digits\n .replace('.', '') // remove the dot (must be removed before removing leading zeros)\n .replace(/^0*/, function (zeros) {\n // remove leading zeros, add their count to the exponent\n exponent -= zeros.length\n return ''\n })\n .replace(/0*$/, '') // remove trailing zeros\n .split('')\n .map(function (d) {\n return parseInt(d)\n })\n\n if (coefficients.length === 0) {\n coefficients.push(0)\n exponent++\n }\n\n return { sign, coefficients, exponent }\n}\n\n/**\n * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering (value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value)\n }\n\n const split = splitNumber(value)\n const rounded = roundDigits(split, precision)\n\n const e = rounded.exponent\n const c = rounded.coefficients\n\n // find nearest lower multiple of 3 for exponent\n const newExp = e % 3 === 0 ? e : (e < 0 ? (e - 3) - (e % 3) : e - (e % 3))\n\n if (isNumber(precision)) {\n // add zeroes to give correct sig figs\n while (precision > c.length || (e - newExp) + 1 > c.length) {\n c.push(0)\n }\n } else {\n // concatenate coefficients with necessary zeros\n // add zeros if necessary (for example: 1e+8 -> 100e+6)\n const missingZeros = Math.abs(e - newExp) - (c.length - 1)\n for (let i = 0; i < missingZeros; i++) {\n c.push(0)\n }\n }\n\n // find difference in exponents\n let expDiff = Math.abs(e - newExp)\n let decimalIdx = 1\n\n // push decimal index over by expDiff times\n while (expDiff > 0) {\n decimalIdx++\n expDiff--\n }\n\n // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value.\n // otherwise concat with the rest of the coefficients\n const decimals = c.slice(decimalIdx).join('')\n const decimalVal = ((isNumber(precision) && decimals.length) || decimals.match(/[1-9]/)) ? ('.' + decimals) : ''\n\n const str = c.slice(0, decimalIdx).join('') +\n decimalVal +\n 'e' + (e >= 0 ? '+' : '') + newExp.toString()\n return rounded.sign + str\n}\n\n/**\n * Format a number with fixed notation.\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. null by default.\n */\nexport function toFixed (value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value)\n }\n\n const splitValue = splitNumber(value)\n const rounded = (typeof precision === 'number')\n ? roundDigits(splitValue, splitValue.exponent + 1 + precision)\n : splitValue\n let c = rounded.coefficients\n let p = rounded.exponent + 1 // exponent may have changed\n\n // append zeros if needed\n const pp = p + (precision || 0)\n if (c.length < pp) {\n c = c.concat(zeros(pp - c.length))\n }\n\n // prepend zeros if needed\n if (p < 0) {\n c = zeros(-p + 1).concat(c)\n p = 1\n }\n\n // insert a dot if needed\n if (p < c.length) {\n c.splice(p, 0, (p === 0) ? '0.' : '.')\n }\n\n return rounded.sign + c.join('')\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n */\nexport function toExponential (value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value)\n }\n\n // round if needed, else create a clone\n const split = splitNumber(value)\n const rounded = precision ? roundDigits(split, precision) : split\n let c = rounded.coefficients\n const e = rounded.exponent\n\n // append zeros if needed\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length))\n }\n\n // format as `C.CCCe+EEE` or `C.CCCe-EEE`\n const first = c.shift()\n return rounded.sign + first + (c.length > 0 ? ('.' + c.join('')) : '') +\n 'e' + (e >= 0 ? '+' : '') + e\n}\n\n/**\n * Format a number with a certain precision\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of digits.\n * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options]\n * By default:\n * lowerExp = -3 (incl)\n * upper = +5 (excl)\n * @return {string}\n */\nexport function toPrecision (value, precision, options) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value)\n }\n\n // determine lower and upper bound for exponential notation.\n const lowerExp = _toNumberOrDefault(options?.lowerExp, -3)\n const upperExp = _toNumberOrDefault(options?.upperExp, 5)\n\n const split = splitNumber(value)\n const rounded = precision ? roundDigits(split, precision) : split\n if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) {\n // exponential notation\n return toExponential(value, precision)\n } else {\n let c = rounded.coefficients\n const e = rounded.exponent\n\n // append trailing zeros\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length))\n }\n\n // append trailing zeros\n // TODO: simplify the next statement\n c = c.concat(zeros(e - c.length + 1 +\n (c.length < precision ? precision - c.length : 0)))\n\n // prepend zeros\n c = zeros(-e).concat(c)\n\n const dot = e > 0 ? e : 0\n if (dot < c.length - 1) {\n c.splice(dot + 1, 0, '.')\n }\n\n return rounded.sign + c.join('')\n }\n}\n\n/**\n * Round the number of digits of a number *\n * @param {SplitValue} split A value split with .splitNumber(value)\n * @param {number} precision A positive integer\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n * with rounded digits\n */\nexport function roundDigits (split, precision) {\n // create a clone\n const rounded = {\n sign: split.sign,\n coefficients: split.coefficients,\n exponent: split.exponent\n }\n const c = rounded.coefficients\n\n // prepend zeros if needed\n while (precision <= 0) {\n c.unshift(0)\n rounded.exponent++\n precision++\n }\n\n if (c.length > precision) {\n const removed = c.splice(precision, c.length - precision)\n\n if (removed[0] >= 5) {\n let i = precision - 1\n c[i]++\n while (c[i] === 10) {\n c.pop()\n if (i === 0) {\n c.unshift(0)\n rounded.exponent++\n i++\n }\n i--\n c[i]++\n }\n }\n }\n\n return rounded\n}\n\n/**\n * Create an array filled with zeros.\n * @param {number} length\n * @return {Array}\n */\nfunction zeros (length) {\n const arr = []\n for (let i = 0; i < length; i++) {\n arr.push(0)\n }\n return arr\n}\n\n/**\n * Count the number of significant digits of a number.\n *\n * For example:\n * 2.34 returns 3\n * 0.0034 returns 2\n * 120.5e+30 returns 4\n *\n * @param {number} value\n * @return {number} digits Number of significant digits\n */\nexport function digits (value) {\n return value\n .toExponential()\n .replace(/e.*$/, '') // remove exponential notation\n .replace(/^0\\.?0*|\\./, '') // remove decimal point and leading zeros\n .length\n}\n\n/**\n * Minimum number added to one that makes the result different than one\n */\nexport const DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16\n\n/**\n * Compares two floating point numbers.\n * @param {number} a - First value to compare\n * @param {number} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @return {boolean} whether the two numbers are nearly equal\n *\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-8); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.01); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual (a, b, relTol = 1e-8, absTol = 0) {\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0')\n }\n\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0')\n }\n\n // NaN\n if (isNaN(a) || isNaN(b)) {\n return false\n }\n\n if (!isFinite(a) || !isFinite(b)) {\n return a === b\n }\n\n if (a === b) {\n return true\n }\n\n // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)\n return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol)\n}\n\n/**\n * Calculate the hyperbolic arccos of a number\n * @param {number} x\n * @return {number}\n */\nexport const acosh = Math.acosh || function (x) {\n return Math.log(Math.sqrt(x * x - 1) + x)\n}\n\nexport const asinh = Math.asinh || function (x) {\n return Math.log(Math.sqrt(x * x + 1) + x)\n}\n\n/**\n * Calculate the hyperbolic arctangent of a number\n * @param {number} x\n * @return {number}\n */\nexport const atanh = Math.atanh || function (x) {\n return Math.log((1 + x) / (1 - x)) / 2\n}\n\n/**\n * Calculate the hyperbolic cosine of a number\n * @param {number} x\n * @returns {number}\n */\nexport const cosh = Math.cosh || function (x) {\n return (Math.exp(x) + Math.exp(-x)) / 2\n}\n\n/**\n * Calculate the hyperbolic sine of a number\n * @param {number} x\n * @returns {number}\n */\nexport const sinh = Math.sinh || function (x) {\n return (Math.exp(x) - Math.exp(-x)) / 2\n}\n\n/**\n * Calculate the hyperbolic tangent of a number\n * @param {number} x\n * @returns {number}\n */\nexport const tanh = Math.tanh || function (x) {\n const e = Math.exp(2 * x)\n return (e - 1) / (e + 1)\n}\n\n/**\n * Returns a value with the magnitude of x and the sign of y.\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\nexport function copysign (x, y) {\n const signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity\n const signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity\n return signx ^ signy ? -x : x\n}\n\nfunction _toNumberOrThrow (value, onError) {\n if (isNumber(value)) {\n return value\n } else if (isBigNumber(value)) {\n return value.toNumber()\n } else {\n onError()\n }\n}\n\nfunction _toNumberOrDefault (value, defaultValue) {\n if (isNumber(value)) {\n return value\n } else if (isBigNumber(value)) {\n return value.toNumber()\n } else {\n return defaultValue\n }\n}\n","/**\n * Create a typed-function which checks the types of the arguments and\n * can match them against multiple provided signatures. The typed-function\n * automatically converts inputs in order to find a matching signature.\n * Typed functions throw informative errors in case of wrong input arguments.\n *\n * See the library [typed-function](https://github.com/josdejong/typed-function)\n * for detailed documentation.\n *\n * Syntax:\n *\n * math.typed(name, signatures) : function\n * math.typed(signatures) : function\n *\n * Examples:\n *\n * // create a typed function with multiple types per argument (type union)\n * const fn2 = typed({\n * 'number | boolean': function (b) {\n * return 'b is a number or boolean'\n * },\n * 'string, number | boolean': function (a, b) {\n * return 'a is a string, b is a number or boolean'\n * }\n * })\n *\n * // create a typed function with an any type argument\n * const log = typed({\n * 'string, any': function (event, data) {\n * console.log('event: ' + event + ', data: ' + JSON.stringify(data))\n * }\n * })\n *\n * @param {string} [name] Optional name for the typed-function\n * @param {Object} signatures Object with one or multiple function signatures\n * @returns {function} The created typed-function.\n */\n\nimport typedFunction from 'typed-function'\nimport { factory } from '../../utils/factory.js'\nimport {\n isAccessorNode,\n isArray,\n isArrayNode,\n isAssignmentNode,\n isBigInt,\n isBigNumber,\n isBlockNode,\n isBoolean,\n isChain,\n isCollection,\n isComplex,\n isConditionalNode,\n isConstantNode,\n isDate,\n isDenseMatrix,\n isFraction,\n isFunction,\n isFunctionAssignmentNode,\n isFunctionNode,\n isHelp,\n isIndex,\n isIndexNode,\n isMap,\n isMatrix,\n isNode,\n isNull,\n isNumber,\n isObject,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRange,\n isRangeNode,\n isRegExp,\n isRelationalNode,\n isResultSet,\n isSparseMatrix,\n isString,\n isSymbolNode,\n isUndefined,\n isUnit\n} from '../../utils/is.js'\nimport { digits } from '../../utils/number.js'\n\n// returns a new instance of typed-function\nlet _createTyped = function () {\n // initially, return the original instance of typed-function\n // consecutively, return a new instance from typed.create.\n _createTyped = typedFunction.create\n return typedFunction\n}\n\nconst dependencies = [\n '?BigNumber',\n '?Complex',\n '?DenseMatrix',\n '?Fraction'\n]\n\n/**\n * Factory function for creating a new typed instance\n * @param {Object} dependencies Object with data types like Complex and BigNumber\n * @returns {Function}\n */\nexport const createTyped = /* #__PURE__ */ factory('typed', dependencies, function createTyped ({ BigNumber, Complex, DenseMatrix, Fraction }) {\n // TODO: typed-function must be able to silently ignore signatures with unknown data types\n\n // get a new instance of typed-function\n const typed = _createTyped()\n\n // define all types. The order of the types determines in which order function\n // arguments are type-checked (so for performance it's important to put the\n // most used types first).\n typed.clear()\n typed.addTypes([\n { name: 'number', test: isNumber },\n { name: 'Complex', test: isComplex },\n { name: 'BigNumber', test: isBigNumber },\n { name: 'bigint', test: isBigInt },\n { name: 'Fraction', test: isFraction },\n { name: 'Unit', test: isUnit },\n // The following type matches a valid variable name, i.e., an alphanumeric\n // string starting with an alphabetic character. It is used (at least)\n // in the definition of the derivative() function, as the argument telling\n // what to differentiate over must (currently) be a variable.\n // TODO: deprecate the identifier type (it's not used anymore, see https://github.com/josdejong/mathjs/issues/3253)\n {\n name: 'identifier',\n test: s => isString && /^\\p{L}[\\p{L}\\d]*$/u.test(s)\n },\n { name: 'string', test: isString },\n { name: 'Chain', test: isChain },\n { name: 'Array', test: isArray },\n { name: 'Matrix', test: isMatrix },\n { name: 'DenseMatrix', test: isDenseMatrix },\n { name: 'SparseMatrix', test: isSparseMatrix },\n { name: 'Range', test: isRange },\n { name: 'Index', test: isIndex },\n { name: 'boolean', test: isBoolean },\n { name: 'ResultSet', test: isResultSet },\n { name: 'Help', test: isHelp },\n { name: 'function', test: isFunction },\n { name: 'Date', test: isDate },\n { name: 'RegExp', test: isRegExp },\n { name: 'null', test: isNull },\n { name: 'undefined', test: isUndefined },\n\n { name: 'AccessorNode', test: isAccessorNode },\n { name: 'ArrayNode', test: isArrayNode },\n { name: 'AssignmentNode', test: isAssignmentNode },\n { name: 'BlockNode', test: isBlockNode },\n { name: 'ConditionalNode', test: isConditionalNode },\n { name: 'ConstantNode', test: isConstantNode },\n { name: 'FunctionNode', test: isFunctionNode },\n { name: 'FunctionAssignmentNode', test: isFunctionAssignmentNode },\n { name: 'IndexNode', test: isIndexNode },\n { name: 'Node', test: isNode },\n { name: 'ObjectNode', test: isObjectNode },\n { name: 'OperatorNode', test: isOperatorNode },\n { name: 'ParenthesisNode', test: isParenthesisNode },\n { name: 'RangeNode', test: isRangeNode },\n { name: 'RelationalNode', test: isRelationalNode },\n { name: 'SymbolNode', test: isSymbolNode },\n\n { name: 'Map', test: isMap },\n { name: 'Object', test: isObject } // order 'Object' last, it matches on other classes too\n ])\n\n typed.addConversions([\n {\n from: 'number',\n to: 'BigNumber',\n convert: function (x) {\n if (!BigNumber) {\n throwNoBignumber(x)\n }\n\n // note: conversion from number to BigNumber can fail if x has >15 digits\n if (digits(x) > 15) {\n throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' +\n '(value: ' + x + '). ' +\n 'Use function bignumber(x) to convert to BigNumber.')\n }\n return new BigNumber(x)\n }\n }, {\n from: 'number',\n to: 'Complex',\n convert: function (x) {\n if (!Complex) {\n throwNoComplex(x)\n }\n\n return new Complex(x, 0)\n }\n }, {\n from: 'BigNumber',\n to: 'Complex',\n convert: function (x) {\n if (!Complex) {\n throwNoComplex(x)\n }\n\n return new Complex(x.toNumber(), 0)\n }\n }, {\n from: 'bigint',\n to: 'number',\n convert: function (x) {\n if (x > Number.MAX_SAFE_INTEGER) {\n throw new TypeError('Cannot implicitly convert bigint to number: ' +\n 'value exceeds the max safe integer value (value: ' + x + ')')\n }\n\n return Number(x)\n }\n }, {\n from: 'bigint',\n to: 'BigNumber',\n convert: function (x) {\n if (!BigNumber) {\n throwNoBignumber(x)\n }\n\n return new BigNumber(x.toString())\n }\n }, {\n from: 'bigint',\n to: 'Fraction',\n convert: function (x) {\n if (!Fraction) {\n throwNoFraction(x)\n }\n\n return new Fraction(x.toString())\n }\n }, {\n from: 'Fraction',\n to: 'BigNumber',\n convert: function (x) {\n throw new TypeError('Cannot implicitly convert a Fraction to BigNumber or vice versa. ' +\n 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.')\n }\n }, {\n from: 'Fraction',\n to: 'Complex',\n convert: function (x) {\n if (!Complex) {\n throwNoComplex(x)\n }\n\n return new Complex(x.valueOf(), 0)\n }\n }, {\n from: 'number',\n to: 'Fraction',\n convert: function (x) {\n if (!Fraction) {\n throwNoFraction(x)\n }\n\n const f = new Fraction(x)\n if (f.valueOf() !== x) {\n throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' +\n '(value: ' + x + '). ' +\n 'Use function fraction(x) to convert to Fraction.')\n }\n return f\n }\n }, {\n // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))`\n // from: 'Fraction',\n // to: 'number',\n // convert: function (x) {\n // return x.valueOf()\n // }\n // }, {\n from: 'string',\n to: 'number',\n convert: function (x) {\n const n = Number(x)\n if (isNaN(n)) {\n throw new Error('Cannot convert \"' + x + '\" to a number')\n }\n return n\n }\n }, {\n from: 'string',\n to: 'BigNumber',\n convert: function (x) {\n if (!BigNumber) {\n throwNoBignumber(x)\n }\n\n try {\n return new BigNumber(x)\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigNumber')\n }\n }\n }, {\n from: 'string',\n to: 'bigint',\n convert: function (x) {\n try {\n return BigInt(x)\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigInt')\n }\n }\n }, {\n from: 'string',\n to: 'Fraction',\n convert: function (x) {\n if (!Fraction) {\n throwNoFraction(x)\n }\n\n try {\n return new Fraction(x)\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Fraction')\n }\n }\n }, {\n from: 'string',\n to: 'Complex',\n convert: function (x) {\n if (!Complex) {\n throwNoComplex(x)\n }\n\n try {\n return new Complex(x)\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Complex')\n }\n }\n }, {\n from: 'boolean',\n to: 'number',\n convert: function (x) {\n return +x\n }\n }, {\n from: 'boolean',\n to: 'BigNumber',\n convert: function (x) {\n if (!BigNumber) {\n throwNoBignumber(x)\n }\n\n return new BigNumber(+x)\n }\n }, {\n from: 'boolean',\n to: 'bigint',\n convert: function (x) {\n return BigInt(+x)\n }\n }, {\n from: 'boolean',\n to: 'Fraction',\n convert: function (x) {\n if (!Fraction) {\n throwNoFraction(x)\n }\n\n return new Fraction(+x)\n }\n }, {\n from: 'boolean',\n to: 'string',\n convert: function (x) {\n return String(x)\n }\n }, {\n from: 'Array',\n to: 'Matrix',\n convert: function (array) {\n if (!DenseMatrix) {\n throwNoMatrix()\n }\n\n return new DenseMatrix(array)\n }\n }, {\n from: 'Matrix',\n to: 'Array',\n convert: function (matrix) {\n return matrix.valueOf()\n }\n }\n ])\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n const usualError = typed.createError(name, args, signatures)\n if (['wrongType', 'mismatch'].includes(usualError.data.category) &&\n args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n const err = new TypeError(\n `Function '${name}' doesn't apply to matrices. To call it ` +\n `elementwise on a matrix 'M', try 'map(M, ${name})'.`)\n err.data = usualError.data\n throw err\n }\n throw usualError\n }\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n const usualError = typed.createError(name, args, signatures)\n if (['wrongType', 'mismatch'].includes(usualError.data.category) &&\n args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n const err = new TypeError(\n `Function '${name}' doesn't apply to matrices. To call it ` +\n `elementwise on a matrix 'M', try 'map(M, ${name})'.`)\n err.data = usualError.data\n throw err\n }\n throw usualError\n }\n\n return typed\n})\n\nfunction throwNoBignumber (x) {\n throw new Error(`Cannot convert value ${x} into a BigNumber: no class 'BigNumber' provided`)\n}\n\nfunction throwNoComplex (x) {\n throw new Error(`Cannot convert value ${x} into a Complex number: no class 'Complex' provided`)\n}\n\nfunction throwNoMatrix () {\n throw new Error('Cannot convert array into a Matrix: no class \\'DenseMatrix\\' provided')\n}\n\nfunction throwNoFraction (x) {\n throw new Error(`Cannot convert value ${x} into a Fraction, no class 'Fraction' provided.`)\n}\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'ResultSet'\nconst dependencies = []\n\nexport const createResultSet = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * A ResultSet contains a list or results\n * @class ResultSet\n * @param {Array} entries\n * @constructor ResultSet\n */\n function ResultSet (entries) {\n if (!(this instanceof ResultSet)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n this.entries = entries || []\n }\n\n /**\n * Attach type information\n */\n ResultSet.prototype.type = 'ResultSet'\n ResultSet.prototype.isResultSet = true\n\n /**\n * Returns the array with results hold by this ResultSet\n * @memberof ResultSet\n * @returns {Array} entries\n */\n ResultSet.prototype.valueOf = function () {\n return this.entries\n }\n\n /**\n * Returns the stringified results of the ResultSet\n * @memberof ResultSet\n * @returns {string} string\n */\n ResultSet.prototype.toString = function () {\n return '[' + this.entries.join(', ') + ']'\n }\n\n /**\n * Get a JSON representation of the ResultSet\n * @memberof ResultSet\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n */\n ResultSet.prototype.toJSON = function () {\n return {\n mathjs: 'ResultSet',\n entries: this.entries\n }\n }\n\n /**\n * Instantiate a ResultSet from a JSON object\n * @memberof ResultSet\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n * @return {ResultSet}\n */\n ResultSet.fromJSON = function (json) {\n return new ResultSet(json.entries)\n }\n\n return ResultSet\n}, { isClass: true })\n","/*!\r\n * decimal.js v10.4.3\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2022 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or ±Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is ±Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with different signs.\r\n // Return NaN if both are ±Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is ±Infinity or x is ±0.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with the same sign.\r\n // Return NaN if both are ±Infinity with different signs.\r\n // Return y if x is finite and y is ±Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, ±Infinity or ±0...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n ? NaN\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n // Return ±0 if either is ±0.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, ±0) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, ±Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either ±Infinity, NaN or ±0?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(±0) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// ±Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(±0, -0) = ±pi\r\n * atan2(±0, +0) = ±0\r\n * atan2(±0, -x) = ±pi for x > 0\r\n * atan2(±0, x) = ±0 for x > 0\r\n * atan2(-y, ±0) = -pi/2 for y > 0\r\n * atan2(y, ±0) = pi/2 for y > 0\r\n * atan2(±y, -Infinity) = ±pi for finite y > 0\r\n * atan2(±y, +Infinity) = ±0 for finite y > 0\r\n * atan2(±Infinity, x) = ±pi/2 for finite x\r\n * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n * atan2(±Infinity, +Infinity) = ±pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both ±Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is ±Infinity or y is ±0\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is ±Infinity or x is ±0\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n","import Decimal from 'decimal.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'BigNumber'\nconst dependencies = ['?on', 'config']\n\nexport const createBigNumberClass = /* #__PURE__ */ factory(name, dependencies, ({ on, config }) => {\n const BigNumber = Decimal.clone({ precision: config.precision, modulo: Decimal.EUCLID })\n BigNumber.prototype = Object.create(BigNumber.prototype)\n\n /**\n * Attach type information\n */\n BigNumber.prototype.type = 'BigNumber'\n BigNumber.prototype.isBigNumber = true\n\n /**\n * Get a JSON representation of a BigNumber containing\n * type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n */\n BigNumber.prototype.toJSON = function () {\n return {\n mathjs: 'BigNumber',\n value: this.toString()\n }\n }\n\n /**\n * Instantiate a BigNumber from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n * @return {BigNumber}\n */\n BigNumber.fromJSON = function (json) {\n return new BigNumber(json.value)\n }\n\n if (on) {\n // listen for changed in the configuration, automatically apply changed precision\n on('config', function (curr, prev) {\n if (curr.precision !== prev.precision) {\n BigNumber.config({ precision: curr.precision })\n }\n })\n }\n\n return BigNumber\n}, { isClass: true })\n","import Complex from 'complex.js'\nimport { format } from '../../utils/number.js'\nimport { isNumber, isUnit } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'Complex'\nconst dependencies = []\n\nexport const createComplexClass = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Complex, 'name', { value: 'Complex' })\n Complex.prototype.constructor = Complex\n Complex.prototype.type = 'Complex'\n Complex.prototype.isComplex = true\n\n /**\n * Get a JSON representation of the complex number\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}`\n */\n Complex.prototype.toJSON = function () {\n return {\n mathjs: 'Complex',\n re: this.re,\n im: this.im\n }\n }\n\n /*\n * Return the value of the complex number in polar notation\n * The angle phi will be set in the interval of [-pi, pi].\n * @return {{r: number, phi: number}} Returns and object with properties r and phi.\n */\n Complex.prototype.toPolar = function () {\n return {\n r: this.abs(),\n phi: this.arg()\n }\n }\n\n /**\n * Get a string representation of the complex number,\n * with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string} str\n */\n Complex.prototype.format = function (options) {\n let str = ''\n let im = this.im\n let re = this.re\n const strRe = format(this.re, options)\n const strIm = format(this.im, options)\n\n // round either re or im when smaller than the configured precision\n const precision = isNumber(options) ? options : options ? options.precision : null\n if (precision !== null) {\n const epsilon = Math.pow(10, -precision)\n if (Math.abs(re / im) < epsilon) {\n re = 0\n }\n if (Math.abs(im / re) < epsilon) {\n im = 0\n }\n }\n\n if (im === 0) {\n // real value\n str = strRe\n } else if (re === 0) {\n // purely complex value\n if (im === 1) {\n str = 'i'\n } else if (im === -1) {\n str = '-i'\n } else {\n str = strIm + 'i'\n }\n } else {\n // complex value\n if (im < 0) {\n if (im === -1) {\n str = strRe + ' - i'\n } else {\n str = strRe + ' - ' + strIm.substring(1) + 'i'\n }\n } else {\n if (im === 1) {\n str = strRe + ' + i'\n } else {\n str = strRe + ' + ' + strIm + 'i'\n }\n }\n }\n return str\n }\n\n /**\n * Create a complex number from polar coordinates\n *\n * Usage:\n *\n * Complex.fromPolar(r: number, phi: number) : Complex\n * Complex.fromPolar({r: number, phi: number}) : Complex\n *\n * @param {*} args...\n * @return {Complex}\n */\n Complex.fromPolar = function (args) {\n switch (arguments.length) {\n case 1:\n {\n const arg = arguments[0]\n if (typeof arg === 'object') {\n return Complex(arg)\n } else {\n throw new TypeError('Input has to be an object with r and phi keys.')\n }\n }\n case 2:\n {\n const r = arguments[0]\n let phi = arguments[1]\n if (isNumber(r)) {\n if (isUnit(phi) && phi.hasBase('ANGLE')) {\n // convert unit to a number in radians\n phi = phi.toNumber('rad')\n }\n\n if (isNumber(phi)) {\n return new Complex({ r, phi })\n }\n\n throw new TypeError('Phi is not a number nor an angle unit.')\n } else {\n throw new TypeError('Radius r is not a number.')\n }\n }\n\n default:\n throw new SyntaxError('Wrong number of arguments in function fromPolar')\n }\n }\n\n Complex.prototype.valueOf = Complex.prototype.toString\n\n /**\n * Create a Complex number from a JSON object\n * @param {Object} json A JSON Object structured as\n * {\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}\n * All properties are optional, default values\n * for `re` and `im` are 0.\n * @return {Complex} Returns a new Complex number\n */\n Complex.fromJSON = function (json) {\n return new Complex(json)\n }\n\n /**\n * Compare two complex numbers, `a` and `b`:\n *\n * - Returns 1 when the real part of `a` is larger than the real part of `b`\n * - Returns -1 when the real part of `a` is smaller than the real part of `b`\n * - Returns 1 when the real parts are equal\n * and the imaginary part of `a` is larger than the imaginary part of `b`\n * - Returns -1 when the real parts are equal\n * and the imaginary part of `a` is smaller than the imaginary part of `b`\n * - Returns 0 when both real and imaginary parts are equal.\n *\n * @params {Complex} a\n * @params {Complex} b\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n Complex.compare = function (a, b) {\n if (a.re > b.re) { return 1 }\n if (a.re < b.re) { return -1 }\n\n if (a.im > b.im) { return 1 }\n if (a.im < b.im) { return -1 }\n\n return 0\n }\n\n return Complex\n}, { isClass: true })\n","/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n\n// Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n// Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\nvar MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nvar P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n};\n\nfunction assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n}\n\nfunction factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n}\n\nvar parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n};\n\nfunction modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\n\nfunction cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n}\n\n\nfunction cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n}\n\nfunction gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n};\n\n/**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\nexport default function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n}\n\nvar DivisionByZero = function() { return new Error(\"Division by Zero\"); };\nvar InvalidParameter = function() { return new Error(\"Invalid argument\"); };\nvar NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\nFraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y ≤ a/b < (k+1) * x/y\n ⇔ k ≤ a/b / (x/y) < (k+1)\n ⇔ k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180°\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n};\n","import Fraction from 'fraction.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'Fraction'\nconst dependencies = []\n\nexport const createFractionClass = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Fraction, 'name', { value: 'Fraction' })\n Fraction.prototype.constructor = Fraction\n Fraction.prototype.type = 'Fraction'\n Fraction.prototype.isFraction = true\n\n /**\n * Get a JSON representation of a Fraction containing type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n */\n Fraction.prototype.toJSON = function () {\n return {\n mathjs: 'Fraction',\n n: this.s * this.n,\n d: this.d\n }\n }\n\n /**\n * Instantiate a Fraction from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n * @return {BigNumber}\n */\n Fraction.fromJSON = function (json) {\n return new Fraction(json)\n }\n\n return Fraction\n}, { isClass: true })\n","import { isBigNumber } from '../../utils/is.js'\nimport { format, sign } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'Range'\nconst dependencies = []\n\nexport const createRangeClass = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * Create a range. A range has a start, step, and end, and contains functions\n * to iterate over the range.\n *\n * A range can be constructed as:\n *\n * const range = new Range(start, end)\n * const range = new Range(start, end, step)\n *\n * To get the result of the range:\n * range.forEach(function (x) {\n * console.log(x)\n * })\n * range.map(function (x) {\n * return math.sin(x)\n * })\n * range.toArray()\n *\n * Example usage:\n *\n * const c = new Range(2, 6) // 2:1:5\n * c.toArray() // [2, 3, 4, 5]\n * const d = new Range(2, -3, -1) // 2:-1:-2\n * d.toArray() // [2, 1, 0, -1, -2]\n *\n * @class Range\n * @constructor Range\n * @param {number} start included lower bound\n * @param {number} end excluded upper bound\n * @param {number} [step] step size, default value is 1\n */\n function Range (start, end, step) {\n if (!(this instanceof Range)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n const hasStart = start !== null && start !== undefined\n const hasEnd = end !== null && end !== undefined\n const hasStep = step !== null && step !== undefined\n\n if (hasStart) {\n if (isBigNumber(start)) {\n start = start.toNumber()\n } else if (typeof start !== 'number') {\n throw new TypeError('Parameter start must be a number')\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber()\n } else if (typeof end !== 'number') {\n throw new TypeError('Parameter end must be a number')\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber()\n } else if (typeof step !== 'number') {\n throw new TypeError('Parameter step must be a number')\n }\n }\n\n this.start = hasStart ? parseFloat(start) : 0\n this.end = hasEnd ? parseFloat(end) : 0\n this.step = hasStep ? parseFloat(step) : 1\n }\n\n /**\n * Attach type information\n */\n Range.prototype.type = 'Range'\n Range.prototype.isRange = true\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @memberof Range\n * @param {string} str\n * @return {Range | null} range\n */\n Range.parse = function (str) {\n if (typeof str !== 'string') {\n return null\n }\n\n const args = str.split(':')\n const nums = args.map(function (arg) {\n return parseFloat(arg)\n })\n\n const invalid = nums.some(function (num) {\n return isNaN(num)\n })\n if (invalid) {\n return null\n }\n\n switch (nums.length) {\n case 2:\n return new Range(nums[0], nums[1])\n case 3:\n return new Range(nums[0], nums[2], nums[1])\n default:\n return null\n }\n }\n\n /**\n * Create a clone of the range\n * @return {Range} clone\n */\n Range.prototype.clone = function () {\n return new Range(this.start, this.end, this.step)\n }\n\n /**\n * Retrieve the size of the range.\n * Returns an array containing one number, the number of elements in the range.\n * @memberof Range\n * @returns {number[]} size\n */\n Range.prototype.size = function () {\n let len = 0\n const start = this.start\n const step = this.step\n const end = this.end\n const diff = end - start\n\n if (sign(step) === sign(diff)) {\n len = Math.ceil((diff) / step)\n } else if (diff === 0) {\n len = 0\n }\n\n if (isNaN(len)) {\n len = 0\n }\n return [len]\n }\n\n /**\n * Calculate the minimum value in the range\n * @memberof Range\n * @return {number | undefined} min\n */\n Range.prototype.min = function () {\n const size = this.size()[0]\n\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start\n } else {\n // negative step\n return this.start + (size - 1) * this.step\n }\n } else {\n return undefined\n }\n }\n\n /**\n * Calculate the maximum value in the range\n * @memberof Range\n * @return {number | undefined} max\n */\n Range.prototype.max = function () {\n const size = this.size()[0]\n\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start + (size - 1) * this.step\n } else {\n // negative step\n return this.start\n }\n } else {\n return undefined\n }\n }\n\n /**\n * Execute a callback function for each value in the range.\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Range being traversed.\n */\n Range.prototype.forEach = function (callback) {\n let x = this.start\n const step = this.step\n const end = this.end\n let i = 0\n\n if (step > 0) {\n while (x < end) {\n callback(x, [i], this)\n x += step\n i++\n }\n } else if (step < 0) {\n while (x > end) {\n callback(x, [i], this)\n x += step\n i++\n }\n }\n }\n\n /**\n * Execute a callback function for each value in the Range, and return the\n * results as an array\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @returns {Array} array\n */\n Range.prototype.map = function (callback) {\n const array = []\n this.forEach(function (value, index, obj) {\n array[index[0]] = callback(value, index, obj)\n })\n return array\n }\n\n /**\n * Create an Array with a copy of the Ranges data\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.toArray = function () {\n const array = []\n this.forEach(function (value, index) {\n array[index[0]] = value\n })\n return array\n }\n\n /**\n * Get the primitive value of the Range, a one dimensional array\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.valueOf = function () {\n // TODO: implement a caching mechanism for range.valueOf()\n return this.toArray()\n }\n\n /**\n * Get a string representation of the range, with optional formatting options.\n * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'\n * @memberof Range\n * @param {Object | number | function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Range.prototype.format = function (options) {\n let str = format(this.start, options)\n\n if (this.step !== 1) {\n str += ':' + format(this.step, options)\n }\n str += ':' + format(this.end, options)\n return str\n }\n\n /**\n * Get a string representation of the range.\n * @memberof Range\n * @returns {string}\n */\n Range.prototype.toString = function () {\n return this.format()\n }\n\n /**\n * Get a JSON representation of the range\n * @memberof Range\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n */\n Range.prototype.toJSON = function () {\n return {\n mathjs: 'Range',\n start: this.start,\n end: this.end,\n step: this.step\n }\n }\n\n /**\n * Instantiate a Range from a JSON object\n * @memberof Range\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n * @return {Range}\n */\n Range.fromJSON = function (json) {\n return new Range(json.start, json.end, json.step)\n }\n\n return Range\n}, { isClass: true })\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'Matrix'\nconst dependencies = []\n\nexport const createMatrixClass = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * @constructor Matrix\n *\n * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional\n * array. A matrix can be constructed as:\n *\n * let matrix = math.matrix(data)\n *\n * Matrix contains the functions to resize, get and set values, get the size,\n * clone the matrix and to convert the matrix to a vector, array, or scalar.\n * Furthermore, one can iterate over the matrix using map and forEach.\n * The internal Array of the Matrix can be accessed using the function valueOf.\n *\n * Example usage:\n *\n * let matrix = math.matrix([[1, 2], [3, 4]])\n * matix.size() // [2, 2]\n * matrix.resize([3, 2], 5)\n * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]]\n * matrix.subset([1,2]) // 3 (indexes are zero-based)\n *\n */\n function Matrix () {\n if (!(this instanceof Matrix)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n }\n\n /**\n * Attach type information\n */\n Matrix.prototype.type = 'Matrix'\n Matrix.prototype.isMatrix = true\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @return {string} The storage format.\n */\n Matrix.prototype.storage = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke storage on a Matrix interface')\n }\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @return {string} The datatype.\n */\n Matrix.prototype.datatype = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke datatype on a Matrix interface')\n }\n\n /**\n * Create a new Matrix With the type of the current matrix instance\n * @param {Array | Object} data\n * @param {string} [datatype]\n */\n Matrix.prototype.create = function (data, datatype) {\n throw new Error('Cannot invoke create on a Matrix interface')\n }\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n Matrix.prototype.subset = function (index, replacement, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke subset on a Matrix interface')\n }\n\n /**\n * Get a single element from the matrix.\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n Matrix.prototype.get = function (index) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke get on a Matrix interface')\n }\n\n /**\n * Replace a single element in the matrix.\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {Matrix} self\n */\n Matrix.prototype.set = function (index, value, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke set on a Matrix interface')\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n Matrix.prototype.resize = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke resize on a Matrix interface')\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n Matrix.prototype.reshape = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke reshape on a Matrix interface')\n }\n\n /**\n * Create a clone of the matrix\n * @return {Matrix} clone\n */\n Matrix.prototype.clone = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke clone on a Matrix interface')\n }\n\n /**\n * Retrieve the size of the matrix.\n * @returns {number[]} size\n */\n Matrix.prototype.size = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke size on a Matrix interface')\n }\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Matrix} matrix\n */\n Matrix.prototype.map = function (callback, skipZeros) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke map on a Matrix interface')\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n Matrix.prototype.forEach = function (callback) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke forEach on a Matrix interface')\n }\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n Matrix.prototype[Symbol.iterator] = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot iterate a Matrix interface')\n }\n\n /**\n * Create an Array with a copy of the data of the Matrix\n * @returns {Array} array\n */\n Matrix.prototype.toArray = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toArray on a Matrix interface')\n }\n\n /**\n * Get the primitive value of the Matrix: a multidimensional array\n * @returns {Array} array\n */\n Matrix.prototype.valueOf = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke valueOf on a Matrix interface')\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Matrix.prototype.format = function (options) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke format on a Matrix interface')\n }\n\n /**\n * Get a string representation of the matrix\n * @returns {string} str\n */\n Matrix.prototype.toString = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toString on a Matrix interface')\n }\n\n return Matrix\n}, { isClass: true })\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import { isBigNumber, isNumber } from '../is.js'\nimport { isInteger, normalizeFormatOptions } from '../number.js'\n\n/**\n * Formats a BigNumber in a given base\n * @param {BigNumber} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatBigNumberToBase (n, base, size) {\n const BigNumberCtor = n.constructor\n const big2 = new BigNumberCtor(2)\n let suffix = ''\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0')\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer')\n }\n if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {\n throw new Error(`Value must be in range [-2^${size - 1}, 2^${size - 1}-1]`)\n }\n if (!n.isInteger()) {\n throw new Error('Value must be an integer')\n }\n if (n.lessThan(0)) {\n n = n.add(big2.pow(size))\n }\n suffix = `i${size}`\n }\n switch (base) {\n case 2: return `${n.toBinary()}${suffix}`\n case 8: return `${n.toOctal()}${suffix}`\n case 16: return `${n.toHexadecimal()}${suffix}`\n default: throw new Error(`Base ${base} not supported `)\n }\n}\n\n/**\n * Convert a BigNumber to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lower` and `upper` bounds, and uses\n * exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * format(12400, {notation: 'engineering'}) // returns '12.400e+3'\n *\n * @param {BigNumber} value\n * @param {Object | Function | number | BigNumber} [options]\n * @return {string} str The formatted value\n */\nexport function format (value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value)\n }\n\n // handle special cases\n if (!value.isFinite()) {\n return value.isNaN() ? 'NaN' : (value.gt(0) ? 'Infinity' : '-Infinity')\n }\n\n const { notation, precision, wordSize } = normalizeFormatOptions(options)\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision)\n\n case 'exponential':\n return toExponential(value, precision)\n\n case 'engineering':\n return toEngineering(value, precision)\n\n case 'bin':\n return formatBigNumberToBase(value, 2, wordSize)\n\n case 'oct':\n return formatBigNumberToBase(value, 8, wordSize)\n\n case 'hex':\n return formatBigNumberToBase(value, 16, wordSize)\n\n case 'auto':\n {\n // determine lower and upper bound for exponential notation.\n // TODO: implement support for upper and lower to be BigNumbers themselves\n const lowerExp = _toNumberOrDefault(options?.lowerExp, -3)\n const upperExp = _toNumberOrDefault(options?.upperExp, 5)\n\n // handle special case zero\n if (value.isZero()) return '0'\n\n // determine whether or not to output exponential notation\n let str\n const rounded = value.toSignificantDigits(precision)\n const exp = rounded.e\n if (exp >= lowerExp && exp < upperExp) {\n // normal number notation\n str = rounded.toFixed()\n } else {\n // exponential notation\n str = toExponential(value, precision)\n }\n\n // remove trailing zeros after the decimal point\n return str.replace(/((\\.\\d*?)(0+))($|e)/, function () {\n const digits = arguments[2]\n const e = arguments[4]\n return (digits !== '.') ? digits + e : e\n })\n }\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' +\n 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.')\n }\n}\n\n/**\n * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering (value, precision) {\n // find nearest lower multiple of 3 for exponent\n const e = value.e\n const newExp = e % 3 === 0 ? e : (e < 0 ? (e - 3) - (e % 3) : e - (e % 3))\n\n // find difference in exponents, and calculate the value without exponent\n const valueWithoutExp = value.mul(Math.pow(10, -newExp))\n\n let valueStr = valueWithoutExp.toPrecision(precision)\n if (valueStr.includes('e')) {\n const BigNumber = value.constructor\n valueStr = new BigNumber(valueStr).toFixed()\n }\n\n return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString()\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n * @returns {string} str\n */\nexport function toExponential (value, precision) {\n if (precision !== undefined) {\n return value.toExponential(precision - 1) // Note the offset of one\n } else {\n return value.toExponential()\n }\n}\n\n/**\n * Format a number with fixed notation.\n * @param {BigNumber} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. Undefined by default.\n */\nexport function toFixed (value, precision) {\n return value.toFixed(precision)\n}\n\nfunction _toNumberOrDefault (value, defaultValue) {\n if (isNumber(value)) {\n return value\n } else if (isBigNumber(value)) {\n return value.toNumber()\n } else {\n return defaultValue\n }\n}\n","import { isBigNumber, isString, typeOf } from './is.js'\nimport { format as formatNumber } from './number.js'\nimport { format as formatBigNumber } from './bignumber/formatter.js'\n\n/**\n * Check if a text ends with a certain string.\n * @param {string} text\n * @param {string} search\n */\nexport function endsWith (text, search) {\n const start = text.length - search.length\n const end = text.length\n return (text.substring(start, end) === search)\n}\n\n/**\n * Format a value of any type into a string.\n *\n * Usage:\n * math.format(value)\n * math.format(value, precision)\n * math.format(value, options)\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this\n * function is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * Example usage:\n * math.format(2/7) // '0.2857142857142857'\n * math.format(math.pi, 3) // '3.14'\n * math.format(new Complex(2, 3)) // '2 + 3i'\n * math.format('hello') // '\"hello\"'\n *\n * @param {*} value Value to be stringified\n * @param {Object | number | Function} [options]\n * Formatting options. See src/utils/number.js:format for a\n * description of the available options controlling number output.\n * This generic \"format\" also supports the option property `truncate: NN`\n * giving the maximum number NN of characters to return (if there would\n * have been more, they are deleted and replaced by an ellipsis).\n * @return {string} str\n */\nexport function format (value, options) {\n const result = _format(value, options)\n if (options && typeof options === 'object' && 'truncate' in options &&\n result.length > options.truncate) {\n return result.substring(0, options.truncate - 3) + '...'\n }\n return result\n}\n\nfunction _format (value, options) {\n if (typeof value === 'number') {\n return formatNumber(value, options)\n }\n\n if (isBigNumber(value)) {\n return formatBigNumber(value, options)\n }\n\n // note: we use unsafe duck-typing here to check for Fractions, this is\n // ok here since we're only invoking toString or concatenating its values\n if (looksLikeFraction(value)) {\n if (!options || options.fraction !== 'decimal') {\n // output as ratio, like '1/3'\n return (value.s * value.n) + '/' + value.d\n } else {\n // output as decimal, like '0.(3)'\n return value.toString()\n }\n }\n\n if (Array.isArray(value)) {\n return formatArray(value, options)\n }\n\n if (isString(value)) {\n return stringify(value)\n }\n\n if (typeof value === 'function') {\n return value.syntax ? String(value.syntax) : 'function'\n }\n\n if (value && typeof value === 'object') {\n if (typeof value.format === 'function') {\n return value.format(options)\n } else if (value && value.toString(options) !== {}.toString()) {\n // this object has a non-native toString method, use that one\n return value.toString(options)\n } else {\n const entries = Object.keys(value).map(key => {\n return stringify(key) + ': ' + format(value[key], options)\n })\n\n return '{' + entries.join(', ') + '}'\n }\n }\n\n return String(value)\n}\n\n/**\n * Stringify a value into a string enclosed in double quotes.\n * Unescaped double quotes and backslashes inside the value are escaped.\n * @param {*} value\n * @return {string}\n */\nexport function stringify (value) {\n const text = String(value)\n let escaped = ''\n let i = 0\n while (i < text.length) {\n const c = text.charAt(i)\n escaped += (c in controlCharacters) ? controlCharacters[c] : c\n i++\n }\n\n return '\"' + escaped + '\"'\n}\n\nconst controlCharacters = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n}\n\n/**\n * Escape special HTML characters\n * @param {*} value\n * @return {string}\n */\nexport function escape (value) {\n let text = String(value)\n text = text.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>')\n\n return text\n}\n\n/**\n * Recursively format an n-dimensional matrix\n * Example output: \"[[1, 2], [3, 4]]\"\n * @param {Array} array\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\nfunction formatArray (array, options) {\n if (Array.isArray(array)) {\n let str = '['\n const len = array.length\n for (let i = 0; i < len; i++) {\n if (i !== 0) {\n str += ', '\n }\n str += formatArray(array[i], options)\n }\n str += ']'\n return str\n } else {\n return format(array, options)\n }\n}\n\n/**\n * Check whether a value looks like a Fraction (unsafe duck-type check)\n * @param {*} value\n * @return {boolean}\n */\nfunction looksLikeFraction (value) {\n return (value &&\n typeof value === 'object' &&\n typeof value.s === 'number' &&\n typeof value.n === 'number' &&\n typeof value.d === 'number') || false\n}\n\n/**\n * Compare two strings\n * @param {string} x\n * @param {string} y\n * @returns {number}\n */\nexport function compareText (x, y) {\n // we don't want to convert numbers to string, only accept string input\n if (!isString(x)) {\n throw new TypeError('Unexpected type of argument in function compareText ' +\n '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)')\n }\n if (!isString(y)) {\n throw new TypeError('Unexpected type of argument in function compareText ' +\n '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)')\n }\n\n return (x === y)\n ? 0\n : (x > y ? 1 : -1)\n}\n","/**\n * Create a range error with the message:\n * 'Dimension mismatch ( != )'\n * @param {number | number[]} actual The actual size\n * @param {number | number[]} expected The expected size\n * @param {string} [relation='!='] Optional relation between actual\n * and expected size: '!=', '<', etc.\n * @extends RangeError\n */\nexport function DimensionError (actual, expected, relation) {\n if (!(this instanceof DimensionError)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n this.actual = actual\n this.expected = expected\n this.relation = relation\n\n this.message = 'Dimension mismatch (' +\n (Array.isArray(actual) ? ('[' + actual.join(', ') + ']') : actual) +\n ' ' + (this.relation || '!=') + ' ' +\n (Array.isArray(expected) ? ('[' + expected.join(', ') + ']') : expected) +\n ')'\n\n this.stack = (new Error()).stack\n}\n\nDimensionError.prototype = new RangeError()\nDimensionError.prototype.constructor = RangeError\nDimensionError.prototype.name = 'DimensionError'\nDimensionError.prototype.isDimensionError = true\n","/**\n * Create a range error with the message:\n * 'Index out of range (index < min)'\n * 'Index out of range (index < max)'\n *\n * @param {number} index The actual index\n * @param {number} [min=0] Minimum index (included)\n * @param {number} [max] Maximum index (excluded)\n * @extends RangeError\n */\nexport function IndexError (index, min, max) {\n if (!(this instanceof IndexError)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n this.index = index\n if (arguments.length < 3) {\n this.min = 0\n this.max = min\n } else {\n this.min = min\n this.max = max\n }\n\n if (this.min !== undefined && this.index < this.min) {\n this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')'\n } else if (this.max !== undefined && this.index >= this.max) {\n this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')'\n } else {\n this.message = 'Index out of range (' + this.index + ')'\n }\n\n this.stack = (new Error()).stack\n}\n\nIndexError.prototype = new RangeError()\nIndexError.prototype.constructor = RangeError\nIndexError.prototype.name = 'IndexError'\nIndexError.prototype.isIndexError = true\n","import { isInteger } from './number.js'\nimport { isNumber, isBigNumber, isArray, isString } from './is.js'\nimport { format } from './string.js'\nimport { DimensionError } from '../error/DimensionError.js'\nimport { IndexError } from '../error/IndexError.js'\nimport { deepStrictEqual } from './object.js'\n\n/**\n * Calculate the size of a multi dimensional array.\n * This function checks the size of the first entry, it does not validate\n * whether all dimensions match. (use function `validate` for that)\n * @param {Array} x\n * @Return {Number[]} size\n */\nexport function arraySize (x) {\n const s = []\n\n while (Array.isArray(x)) {\n s.push(x.length)\n x = x[0]\n }\n\n return s\n}\n\n/**\n * Recursively validate whether each element in a multi dimensional array\n * has a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @throws DimensionError\n * @private\n */\nfunction _validate (array, size, dim) {\n let i\n const len = array.length\n\n if (len !== size[dim]) {\n throw new DimensionError(len, size[dim])\n }\n\n if (dim < size.length - 1) {\n // recursively validate each child array\n const dimNext = dim + 1\n for (i = 0; i < len; i++) {\n const child = array[i]\n if (!Array.isArray(child)) {\n throw new DimensionError(size.length - 1, size.length, '<')\n }\n _validate(array[i], size, dimNext)\n }\n } else {\n // last dimension. none of the childs may be an array\n for (i = 0; i < len; i++) {\n if (Array.isArray(array[i])) {\n throw new DimensionError(size.length + 1, size.length, '>')\n }\n }\n }\n}\n\n/**\n * Validate whether each element in a multi dimensional array has\n * a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @throws DimensionError\n */\nexport function validate (array, size) {\n const isScalar = (size.length === 0)\n if (isScalar) {\n // scalar\n if (Array.isArray(array)) {\n throw new DimensionError(array.length, 0)\n }\n } else {\n // array\n _validate(array, size, 0)\n }\n}\n\n/**\n * Validate whether the source of the index matches the size of the Array\n * @param {Array | Matrix} array Array to be validated\n * @param {Index} index Index with the source information to validate\n * @throws DimensionError\n */\nexport function validateIndexSourceSize (value, index) {\n const valueSize = value.isMatrix ? value._size : arraySize(value)\n const sourceSize = index._sourceSize\n // checks if the source size is not null and matches the valueSize\n sourceSize.forEach((sourceDim, i) => {\n if (sourceDim !== null && sourceDim !== valueSize[i]) { throw new DimensionError(sourceDim, valueSize[i]) }\n })\n}\n\n/**\n * Test whether index is an integer number with index >= 0 and index < length\n * when length is provided\n * @param {number} index Zero-based index\n * @param {number} [length] Length of the array\n */\nexport function validateIndex (index, length) {\n if (index !== undefined) {\n if (!isNumber(index) || !isInteger(index)) {\n throw new TypeError('Index must be an integer (value: ' + index + ')')\n }\n if (index < 0 || (typeof length === 'number' && index >= length)) {\n throw new IndexError(index, length)\n }\n }\n}\n\n/**\n * Test if and index has empty values\n * @param {number} index Zero-based index\n */\nexport function isEmptyIndex (index) {\n for (let i = 0; i < index._dimensions.length; ++i) {\n const dimension = index._dimensions[i]\n if (dimension._data && isArray(dimension._data)) {\n if (dimension._size[0] === 0) {\n return true\n }\n } else if (dimension.isRange) {\n if (dimension.start === dimension.end) {\n return true\n }\n } else if (isString(dimension)) {\n if (dimension.length === 0) {\n return true\n }\n }\n }\n return false\n}\n\n/**\n * Resize a multi dimensional array. The resized array is returned.\n * @param {Array | number} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {*} [defaultValue=0] Value to be filled in in new entries,\n * zero by default. Specify for example `null`,\n * to clearly see entries that are not explicitly\n * set.\n * @return {Array} array The resized array\n */\nexport function resize (array, size, defaultValue) {\n // check the type of the arguments\n if (!Array.isArray(size)) {\n throw new TypeError('Array expected')\n }\n if (size.length === 0) {\n throw new Error('Resizing to scalar is not supported')\n }\n\n // check whether size contains positive integers\n size.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' +\n '(size: ' + format(size) + ')')\n }\n })\n\n // convert number to an array\n if (isNumber(array) || isBigNumber(array)) {\n array = [array]\n }\n\n // recursively resize the array\n const _defaultValue = (defaultValue !== undefined) ? defaultValue : 0\n _resize(array, size, 0, _defaultValue)\n\n return array\n}\n\n/**\n * Recursively resize a multi dimensional array\n * @param {Array} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @param {*} [defaultValue] Value to be filled in in new entries,\n * undefined by default.\n * @private\n */\nfunction _resize (array, size, dim, defaultValue) {\n let i\n let elem\n const oldLen = array.length\n const newLen = size[dim]\n const minLen = Math.min(oldLen, newLen)\n\n // apply new length\n array.length = newLen\n\n if (dim < size.length - 1) {\n // non-last dimension\n const dimNext = dim + 1\n\n // resize existing child arrays\n for (i = 0; i < minLen; i++) {\n // resize child array\n elem = array[i]\n if (!Array.isArray(elem)) {\n elem = [elem] // add a dimension\n array[i] = elem\n }\n _resize(elem, size, dimNext, defaultValue)\n }\n\n // create new child arrays\n for (i = minLen; i < newLen; i++) {\n // get child array\n elem = []\n array[i] = elem\n\n // resize new child array\n _resize(elem, size, dimNext, defaultValue)\n }\n } else {\n // last dimension\n\n // remove dimensions of existing values\n for (i = 0; i < minLen; i++) {\n while (Array.isArray(array[i])) {\n array[i] = array[i][0]\n }\n }\n\n // fill new elements with the default value\n for (i = minLen; i < newLen; i++) {\n array[i] = defaultValue\n }\n }\n}\n\n/**\n * Re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n *\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\nexport function reshape (array, sizes) {\n const flatArray = flatten(array)\n const currentLength = flatArray.length\n\n if (!Array.isArray(array) || !Array.isArray(sizes)) {\n throw new TypeError('Array expected')\n }\n\n if (sizes.length === 0) {\n throw new DimensionError(0, currentLength, '!=')\n }\n\n sizes = processSizesWildcard(sizes, currentLength)\n const newLength = product(sizes)\n if (currentLength !== newLength) {\n throw new DimensionError(\n newLength,\n currentLength,\n '!='\n )\n }\n\n try {\n return _reshape(flatArray, sizes)\n } catch (e) {\n if (e instanceof DimensionError) {\n throw new DimensionError(\n newLength,\n currentLength,\n '!='\n )\n }\n throw e\n }\n}\n\n/**\n * Replaces the wildcard -1 in the sizes array.\n * @param {number[]} sizes List of sizes for each dimension. At most on wildcard.\n * @param {number} currentLength Number of elements in the array.\n * @throws {Error} If more than one wildcard or unable to replace it.\n * @returns {number[]} The sizes array with wildcard replaced.\n */\nexport function processSizesWildcard (sizes, currentLength) {\n const newLength = product(sizes)\n const processedSizes = sizes.slice()\n const WILDCARD = -1\n const wildCardIndex = sizes.indexOf(WILDCARD)\n\n const isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0\n if (isMoreThanOneWildcard) {\n throw new Error('More than one wildcard in sizes')\n }\n\n const hasWildcard = wildCardIndex >= 0\n const canReplaceWildcard = currentLength % newLength === 0\n\n if (hasWildcard) {\n if (canReplaceWildcard) {\n processedSizes[wildCardIndex] = -currentLength / newLength\n } else {\n throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + (-newLength))\n }\n }\n return processedSizes\n}\n\n/**\n * Computes the product of all array elements.\n * @param {number[]} array Array of factors\n * @returns {number} Product of all elements\n */\nfunction product (array) {\n return array.reduce((prev, curr) => prev * curr, 1)\n}\n\n/**\n * Iteratively re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n */\n\nfunction _reshape (array, sizes) {\n // testing if there are enough elements for the requested shape\n let tmpArray = array\n let tmpArray2\n // for each dimensions starting by the last one and ignoring the first one\n for (let sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {\n const size = sizes[sizeIndex]\n tmpArray2 = []\n\n // aggregate the elements of the current tmpArray in elements of the requested size\n const length = tmpArray.length / size\n for (let i = 0; i < length; i++) {\n tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size))\n }\n // set it as the new tmpArray for the next loop turn or for return\n tmpArray = tmpArray2\n }\n\n return tmpArray\n}\n\n/**\n * Squeeze a multi dimensional array\n * @param {Array} array\n * @param {Array} [size]\n * @returns {Array} returns the array itself\n */\nexport function squeeze (array, size) {\n const s = size || arraySize(array)\n\n // squeeze outer dimensions\n while (Array.isArray(array) && array.length === 1) {\n array = array[0]\n s.shift()\n }\n\n // find the first dimension to be squeezed\n let dims = s.length\n while (s[dims - 1] === 1) {\n dims--\n }\n\n // squeeze inner dimensions\n if (dims < s.length) {\n array = _squeeze(array, dims, 0)\n s.length = dims\n }\n\n return array\n}\n\n/**\n * Recursively squeeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _squeeze (array, dims, dim) {\n let i, ii\n\n if (dim < dims) {\n const next = dim + 1\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _squeeze(array[i], dims, next)\n }\n } else {\n while (Array.isArray(array)) {\n array = array[0]\n }\n }\n\n return array\n}\n\n/**\n * Unsqueeze a multi dimensional array: add dimensions when missing\n *\n * Paramter `size` will be mutated to match the new, unqueezed matrix size.\n *\n * @param {Array} array\n * @param {number} dims Desired number of dimensions of the array\n * @param {number} [outer] Number of outer dimensions to be added\n * @param {Array} [size] Current size of array.\n * @returns {Array} returns the array itself\n * @private\n */\nexport function unsqueeze (array, dims, outer, size) {\n const s = size || arraySize(array)\n\n // unsqueeze outer dimensions\n if (outer) {\n for (let i = 0; i < outer; i++) {\n array = [array]\n s.unshift(1)\n }\n }\n\n // unsqueeze inner dimensions\n array = _unsqueeze(array, dims, 0)\n while (s.length < dims) {\n s.push(1)\n }\n\n return array\n}\n\n/**\n * Recursively unsqueeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _unsqueeze (array, dims, dim) {\n let i, ii\n\n if (Array.isArray(array)) {\n const next = dim + 1\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _unsqueeze(array[i], dims, next)\n }\n } else {\n for (let d = dim; d < dims; d++) {\n array = [array]\n }\n }\n\n return array\n}\n/**\n * Flatten a multi dimensional array, put all elements in a one dimensional\n * array\n * @param {Array} array A multi dimensional array\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten (array) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array\n }\n const flat = []\n\n array.forEach(function callback (value) {\n if (Array.isArray(value)) {\n value.forEach(callback) // traverse through sub-arrays recursively\n } else {\n flat.push(value)\n }\n })\n\n return flat\n}\n\n/**\n * A safe map\n * @param {Array} array\n * @param {function} callback\n */\nexport function map (array, callback) {\n return Array.prototype.map.call(array, callback)\n}\n\n/**\n * A safe forEach\n * @param {Array} array\n * @param {function} callback\n */\nexport function forEach (array, callback) {\n Array.prototype.forEach.call(array, callback)\n}\n\n/**\n * A safe filter\n * @param {Array} array\n * @param {function} callback\n */\nexport function filter (array, callback) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported')\n }\n\n return Array.prototype.filter.call(array, callback)\n}\n\n/**\n * Filter values in a callback given a regular expression\n * @param {Array} array\n * @param {RegExp} regexp\n * @return {Array} Returns the filtered array\n * @private\n */\nexport function filterRegExp (array, regexp) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported')\n }\n\n return Array.prototype.filter.call(array, (entry) => regexp.test(entry))\n}\n\n/**\n * A safe join\n * @param {Array} array\n * @param {string} separator\n */\nexport function join (array, separator) {\n return Array.prototype.join.call(array, separator)\n}\n\n/**\n * Assign a numeric identifier to every element of a sorted array\n * @param {Array} a An array\n * @return {Array} An array of objects containing the original value and its identifier\n */\nexport function identify (a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected')\n }\n\n if (a.length === 0) {\n return a\n }\n\n const b = []\n let count = 0\n b[0] = { value: a[0], identifier: 0 }\n for (let i = 1; i < a.length; i++) {\n if (a[i] === a[i - 1]) {\n count++\n } else {\n count = 0\n }\n b.push({ value: a[i], identifier: count })\n }\n return b\n}\n\n/**\n * Remove the numeric identifier from the elements\n * @param {array} a An array\n * @return {array} An array of values without identifiers\n */\nexport function generalize (a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected')\n }\n\n if (a.length === 0) {\n return a\n }\n\n const b = []\n for (let i = 0; i < a.length; i++) {\n b.push(a[i].value)\n }\n return b\n}\n\n/**\n * Check the datatype of a given object\n * This is a low level implementation that should only be used by\n * parent Matrix classes such as SparseMatrix or DenseMatrix\n * This method does not validate Array Matrix shape\n * @param {Array} array\n * @param {function} typeOf Callback function to use to determine the type of a value\n * @return {string}\n */\nexport function getArrayDataType (array, typeOf) {\n let type // to hold type info\n let length = 0 // to hold length value to ensure it has consistent sizes\n\n for (let i = 0; i < array.length; i++) {\n const item = array[i]\n const isArray = Array.isArray(item)\n\n // Saving the target matrix row size\n if (i === 0 && isArray) {\n length = item.length\n }\n\n // If the current item is an array but the length does not equal the targetVectorSize\n if (isArray && item.length !== length) {\n return undefined\n }\n\n const itemType = isArray\n ? getArrayDataType(item, typeOf) // recurse into a nested array\n : typeOf(item)\n\n if (type === undefined) {\n type = itemType // first item\n } else if (type !== itemType) {\n return 'mixed'\n } else {\n // we're good, everything has the same type so far\n }\n }\n\n return type\n}\n\n/**\n * Return the last item from an array\n * @param {array}\n * @returns {*}\n */\nexport function last (array) {\n return array[array.length - 1]\n}\n\n/**\n * Get all but the last element of array.\n * @param {array}\n * @returns {*}\n */\nexport function initial (array) {\n return array.slice(0, array.length - 1)\n}\n\n/**\n * Recursively concatenate two matrices.\n * The contents of the matrices is not cloned.\n * @param {Array} a Multi dimensional array\n * @param {Array} b Multi dimensional array\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @param {number} dim The current dim (zero-based)\n * @return {Array} c The concatenated matrix\n * @private\n */\nfunction concatRecursive (a, b, concatDim, dim) {\n if (dim < concatDim) {\n // recurse into next dimension\n if (a.length !== b.length) {\n throw new DimensionError(a.length, b.length)\n }\n\n const c = []\n for (let i = 0; i < a.length; i++) {\n c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1)\n }\n return c\n } else {\n // concatenate this dimension\n return a.concat(b)\n }\n}\n\n/**\n * Concatenates many arrays in the specified direction\n * @param {...Array} arrays All the arrays to concatenate\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @returns\n*/\nexport function concat () {\n const arrays = Array.prototype.slice.call(arguments, 0, -1)\n const concatDim = Array.prototype.slice.call(arguments, -1)\n\n if (arrays.length === 1) {\n return arrays[0]\n }\n if (arrays.length > 1) {\n return arrays.slice(1).reduce(function (A, B) { return concatRecursive(A, B, concatDim, 0) }, arrays[0])\n } else {\n throw new Error('Wrong number of arguments in function concat')\n }\n}\n\n/**\n * Receives two or more sizes and get's the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns\n */\nexport function broadcastSizes (...sizes) {\n const dimensions = sizes.map((s) => s.length)\n const N = Math.max(...dimensions)\n const sizeMax = new Array(N).fill(null)\n // check for every size\n for (let i = 0; i < sizes.length; i++) {\n const size = sizes[i]\n const dim = dimensions[i]\n for (let j = 0; j < dim; j++) {\n const n = N - dim + j\n if (size[j] > sizeMax[n]) {\n sizeMax[n] = size[j]\n }\n }\n }\n for (let i = 0; i < sizes.length; i++) {\n checkBroadcastingRules(sizes[i], sizeMax)\n }\n return sizeMax\n}\n\n/**\n * Checks if it's possible to broadcast a size to another size\n * @param {number[]} size The size of the array to check\n * @param {number[]} toSize The size of the array to validate if it can be broadcasted to\n */\nexport function checkBroadcastingRules (size, toSize) {\n const N = toSize.length\n const dim = size.length\n for (let j = 0; j < dim; j++) {\n const n = N - dim + j\n if ((size[j] < toSize[n] && size[j] > 1) || (size[j] > toSize[n])) {\n throw new Error(\n `shape missmatch: missmatch is found in arg with shape (${size}) not possible to broadcast dimension ${dim} with size ${size[j]} to size ${toSize[n]}`\n )\n }\n }\n}\n\n/**\n * Broadcasts a single array to a certain size\n * @param {array} array Array to be broadcasted\n * @param {number[]} toSize Size to broadcast the array\n * @returns The broadcasted array\n */\nexport function broadcastTo (array, toSize) {\n let Asize = arraySize(array)\n if (deepStrictEqual(Asize, toSize)) {\n return array\n }\n checkBroadcastingRules(Asize, toSize)\n const broadcastedSize = broadcastSizes(Asize, toSize)\n const N = broadcastedSize.length\n const paddedSize = [...Array(N - Asize.length).fill(1), ...Asize]\n\n let A = clone(array)\n // reshape A if needed to make it ready for concat\n if (Asize.length < N) {\n A = reshape(A, paddedSize)\n Asize = arraySize(A)\n }\n\n // stretches the array on each dimension to make it the same size as index\n for (let dim = 0; dim < N; dim++) {\n if (Asize[dim] < broadcastedSize[dim]) {\n A = stretch(A, broadcastedSize[dim], dim)\n Asize = arraySize(A)\n }\n }\n return A\n}\n\n/**\n * Broadcasts arrays and returns the broadcasted arrays in an array\n * @param {...Array | any} arrays\n * @returns\n */\nexport function broadcastArrays (...arrays) {\n if (arrays.length === 0) {\n throw new Error('Insuficient number of argumnets in function broadcastArrays')\n }\n if (arrays.length === 1) {\n return arrays[0]\n }\n const sizes = arrays.map(function (array) { return arraySize(array) })\n const broadcastedSize = broadcastSizes(...sizes)\n const broadcastedArrays = []\n arrays.forEach(function (array) { broadcastedArrays.push(broadcastTo(array, broadcastedSize)) })\n return broadcastedArrays\n}\n\n/**\n * stretches a matrix up to a certain size in a certain dimension\n * @param {Array} arrayToStretch\n * @param {number[]} sizeToStretch\n * @param {number} dimToStretch\n * @returns\n */\nexport function stretch (arrayToStretch, sizeToStretch, dimToStretch) {\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch)\n}\n\n/**\n* Retrieves a single element from an array given an index.\n*\n* @param {Array} array - The array from which to retrieve the value.\n* @param {Array} idx - An array of indices specifying the position of the desired element in each dimension.\n* @returns {*} - The value at the specified position in the array.\n*\n* @example\n* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];\n* const index = [1, 0, 1];\n* console.log(getValue(arr, index)); // 6\n*/\nexport function get (array, index) {\n if (!Array.isArray(array)) { throw new Error('Array expected') }\n const size = arraySize(array)\n if (index.length !== size.length) { throw new DimensionError(index.length, size.length) }\n for (let x = 0; x < index.length; x++) { validateIndex(index[x], size[x]) }\n return index.reduce((acc, curr) => acc[curr], array)\n}\n\n/**\n * Recursive function to map a multi-dimensional array.\n *\n * @param {*} value - The current value being processed in the array.\n * @param {Array} index - The index of the current value being processed in the array.\n * @param {Array} array - The array being processed.\n * @param {Function} callback - Function that produces the element of the new Array, taking three arguments: the value of the element, the index of the element, and the Array being processed.\n * @returns {*} The new array with each element being the result of the callback function.\n */\nexport function recurse (value, index, array, callback) {\n if (Array.isArray(value)) {\n return value.map(function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i), array, callback)\n })\n } else {\n // invoke the callback function with the right number of arguments\n return callback(value, index, array)\n }\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns cloned array\n */\nexport function clone (array) {\n return Object.assign([], array)\n}\n","import typed from 'typed-function'\nimport { get, arraySize } from './array.js'\nimport { typeOf as _typeOf } from './is.js'\n\n/**\n * Simplifies a callback function by reducing its complexity and potentially improving its performance.\n *\n * @param {Function} callback The original callback function to simplify.\n * @param {Array|Matrix} array The array that will be used with the callback function.\n * @param {string} name The name of the function that is using the callback.\n * @returns {Function} Returns a simplified version of the callback function.\n */\nexport function optimizeCallback (callback, array, name) {\n if (typed.isTypedFunction(callback)) {\n const firstIndex = (array.isMatrix ? array.size() : arraySize(array)).map(() => 0)\n const firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex)\n const hasSingleSignature = Object.keys(callback.signatures).length === 1\n const numberOfArguments = _findNumberOfArguments(callback, firstValue, firstIndex, array)\n const fastCallback = hasSingleSignature ? Object.values(callback.signatures)[0] : callback\n if (numberOfArguments >= 1 && numberOfArguments <= 3) {\n return (...args) => _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name)\n }\n return (...args) => _tryFunctionWithArgs(fastCallback, args, name, callback.name)\n }\n return callback\n}\n\nfunction _findNumberOfArguments (callback, value, index, array) {\n const testArgs = [value, index, array]\n for (let i = 3; i > 0; i--) {\n const args = testArgs.slice(0, i)\n if (typed.resolve(callback, args) !== null) {\n return i\n }\n }\n}\n\n/**\n * @param {function} func The selected function taken from one of the signatures of the callback function\n * @param {Array} args List with arguments to apply to the selected signature\n * @param {string} mappingFnName the name of the function that is using the callback\n * @param {string} callbackName the name of the callback function\n * @returns {*} Returns the return value of the invoked signature\n * @throws {TypeError} Throws an error when no matching signature was found\n */\nfunction _tryFunctionWithArgs (func, args, mappingFnName, callbackName) {\n try {\n return func(...args)\n } catch (err) {\n _createCallbackError(err, args, mappingFnName, callbackName)\n }\n}\n\n/**\n * Creates and throws a detailed TypeError when a callback function fails.\n *\n * @param {Error} err The original error thrown by the callback function.\n * @param {Array} args The arguments that were passed to the callback function.\n * @param {string} mappingFnName The name of the function that is using the callback.\n * @param {string} callbackName The name of the callback function.\n * @throws {TypeError} Throws a detailed TypeError with enriched error message.\n */\nfunction _createCallbackError (err, args, mappingFnName, callbackName) {\n // Enrich the error message so the user understands that it took place inside the callback function\n if (err instanceof TypeError && err.data?.category === 'wrongType') {\n const argsDesc = []\n argsDesc.push(`value: ${_typeOf(args[0])}`)\n if (args.length >= 2) { argsDesc.push(`index: ${_typeOf(args[1])}`) }\n if (args.length >= 3) { argsDesc.push(`array: ${_typeOf(args[2])}`) }\n\n throw new TypeError(`Function ${mappingFnName} cannot apply callback arguments ` +\n `${callbackName}(${argsDesc.join(', ')}) at index ${JSON.stringify(args[1])}`)\n } else {\n throw new TypeError(`Function ${mappingFnName} cannot apply callback arguments ` +\n `to function ${callbackName}: ${err.message}`)\n }\n}\n","// deno-lint-ignore-file no-this-alias\nimport { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js'\nimport { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo, get } from '../../utils/array.js'\nimport { format } from '../../utils/string.js'\nimport { isInteger } from '../../utils/number.js'\nimport { clone, deepStrictEqual } from '../../utils/object.js'\nimport { DimensionError } from '../../error/DimensionError.js'\nimport { factory } from '../../utils/factory.js'\nimport { optimizeCallback } from '../../utils/optimizeCallback.js'\n\nconst name = 'DenseMatrix'\nconst dependencies = [\n 'Matrix'\n]\n\nexport const createDenseMatrixClass = /* #__PURE__ */ factory(name, dependencies, ({ Matrix }) => {\n /**\n * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.\n * @class DenseMatrix\n * @enum {{ value, index: number[] }}\n */\n function DenseMatrix (data, datatype) {\n if (!(this instanceof DenseMatrix)) { throw new SyntaxError('Constructor must be called with the new operator') }\n if (datatype && !isString(datatype)) { throw new Error('Invalid datatype: ' + datatype) }\n\n if (isMatrix(data)) {\n // check data is a DenseMatrix\n if (data.type === 'DenseMatrix') {\n // clone data & size\n this._data = clone(data._data)\n this._size = clone(data._size)\n this._datatype = datatype || data._datatype\n } else {\n // build data from existing matrix\n this._data = data.toArray()\n this._size = data.size()\n this._datatype = datatype || data._datatype\n }\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data\n this._size = data.size\n // verify the dimensions of the array\n validate(this._data, this._size)\n this._datatype = datatype || data.datatype\n } else if (isArray(data)) {\n // replace nested Matrices with Arrays\n this._data = preprocess(data)\n // get the dimensions of the array\n this._size = arraySize(this._data)\n // verify the dimensions of the array, TODO: compute size while processing array\n validate(this._data, this._size)\n // data type unknown\n this._datatype = datatype\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')')\n } else {\n // nothing provided\n this._data = []\n this._size = [0]\n this._datatype = datatype\n }\n }\n\n DenseMatrix.prototype = new Matrix()\n\n /**\n * Create a new DenseMatrix\n */\n DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {\n return new DenseMatrix(data, datatype)\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(DenseMatrix, 'name', { value: 'DenseMatrix' })\n DenseMatrix.prototype.constructor = DenseMatrix\n DenseMatrix.prototype.type = 'DenseMatrix'\n DenseMatrix.prototype.isDenseMatrix = true\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf DenseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n DenseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._data, typeOf)\n }\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof DenseMatrix\n * @return {string} The storage format.\n */\n DenseMatrix.prototype.storage = function () {\n return 'dense'\n }\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof DenseMatrix\n * @return {string} The datatype.\n */\n DenseMatrix.prototype.datatype = function () {\n return this._datatype\n }\n\n /**\n * Create a new DenseMatrix\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n DenseMatrix.prototype.create = function (data, datatype) {\n return new DenseMatrix(data, datatype)\n }\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof DenseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n switch (arguments.length) {\n case 1:\n return _get(this, index)\n\n // intentional fall through\n case 2:\n case 3:\n return _set(this, index, replacement, defaultValue)\n\n default:\n throw new SyntaxError('Wrong number of arguments')\n }\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n DenseMatrix.prototype.get = function (index) {\n return get(this._data, index)\n }\n\n /**\n * Replace a single element in the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {DenseMatrix} self\n */\n DenseMatrix.prototype.set = function (index, value, defaultValue) {\n if (!isArray(index)) { throw new TypeError('Array expected') }\n if (index.length < this._size.length) { throw new DimensionError(index.length, this._size.length, '<') }\n\n let i, ii, indexI\n\n // enlarge matrix when needed\n const size = index.map(function (i) {\n return i + 1\n })\n _fit(this, size, defaultValue)\n\n // traverse over the dimensions\n let data = this._data\n for (i = 0, ii = index.length - 1; i < ii; i++) {\n indexI = index[i]\n validateIndex(indexI, data.length)\n data = data[indexI]\n }\n\n // set new value\n indexI = index[index.length - 1]\n validateIndex(indexI, data.length)\n data[indexI] = value\n\n return this\n }\n\n /**\n * Get a submatrix of this matrix\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index Zero-based index\n * @private\n */\n function _get (matrix, index) {\n if (!isIndex(index)) {\n throw new TypeError('Invalid index')\n }\n\n const isScalar = index.isScalar()\n if (isScalar) {\n // return a scalar\n return matrix.get(index.min())\n } else {\n // validate dimensions\n const size = index.size()\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length)\n }\n\n // validate if any of the ranges in the index is out of range\n const min = index.min()\n const max = index.max()\n for (let i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i])\n validateIndex(max[i], matrix._size[i])\n }\n\n // retrieve submatrix\n // TODO: more efficient when creating an empty matrix and setting _data and _size manually\n return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype)\n }\n }\n\n /**\n * Recursively get a submatrix of a multi dimensional matrix.\n * Index is not checked for correct number or length of dimensions.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {number} dims Total number of dimensions\n * @param {number} dim Current dimension\n * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix (data, index, dims, dim) {\n const last = (dim === dims - 1)\n const range = index.dimension(dim)\n\n if (last) {\n return range.map(function (i) {\n validateIndex(i, data.length)\n return data[i]\n }).valueOf()\n } else {\n return range.map(function (i) {\n validateIndex(i, data.length)\n const child = data[i]\n return _getSubmatrix(child, index, dims, dim + 1)\n }).valueOf()\n }\n }\n\n /**\n * Replace a submatrix in this matrix\n * Indexes are zero-based.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index\n * @param {DenseMatrix | Array | *} submatrix\n * @param {*} defaultValue Default value, filled in on new entries when\n * the matrix is resized.\n * @return {DenseMatrix} matrix\n * @private\n */\n function _set (matrix, index, submatrix, defaultValue) {\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index')\n }\n\n // get index size and check whether the index contains a single value\n const iSize = index.size()\n const isScalar = index.isScalar()\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n let sSize\n if (isMatrix(submatrix)) {\n sSize = submatrix.size()\n submatrix = submatrix.valueOf()\n } else {\n sSize = arraySize(submatrix)\n }\n\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected')\n }\n matrix.set(index.min(), submatrix, defaultValue)\n } else {\n // set a submatrix\n\n // broadcast submatrix\n if (!deepStrictEqual(sSize, iSize)) {\n try {\n if (sSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize)\n } else {\n submatrix = broadcastTo(submatrix, iSize)\n }\n sSize = arraySize(submatrix)\n } catch {\n }\n }\n\n // validate dimensions\n if (iSize.length < matrix._size.length) {\n throw new DimensionError(iSize.length, matrix._size.length, '<')\n }\n\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n let i = 0\n let outer = 0\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++\n }\n while (iSize[i] === 1) {\n outer++\n i++\n }\n\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize)\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>')\n }\n\n // enlarge matrix when needed\n const size = index.max().map(function (i) {\n return i + 1\n })\n _fit(matrix, size, defaultValue)\n\n // insert the sub matrix\n const dims = iSize.length\n const dim = 0\n _setSubmatrix(matrix._data, index, submatrix, dims, dim)\n }\n\n return matrix\n }\n\n /**\n * Replace a submatrix of a multi dimensional matrix.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {Array} submatrix\n * @param {number} dims Total number of dimensions\n * @param {number} dim\n * @private\n */\n function _setSubmatrix (data, index, submatrix, dims, dim) {\n const last = (dim === dims - 1)\n const range = index.dimension(dim)\n\n if (last) {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex)\n data[dataIndex] = submatrix[subIndex[0]]\n })\n } else {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex)\n _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1)\n })\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof DenseMatrix\n * @param {number[] || Matrix} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n DenseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected')\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n const sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1\n ? value[0]\n : value\n })\n\n // matrix to resize\n const m = copy ? this.clone() : this\n // resize matrix\n return _resize(m, sizeArray, defaultValue)\n }\n\n function _resize (matrix, size, defaultValue) {\n // check size\n if (size.length === 0) {\n // first value in matrix\n let v = matrix._data\n // go deep\n while (isArray(v)) {\n v = v[0]\n }\n return v\n }\n // resize matrix\n matrix._size = size.slice(0) // copy the array\n matrix._data = resize(matrix._data, matrix._size, defaultValue)\n // return matrix\n return matrix\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof DenseMatrix\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n DenseMatrix.prototype.reshape = function (size, copy) {\n const m = copy ? this.clone() : this\n\n m._data = reshape(m._data, size)\n const currentLength = m._size.reduce((length, size) => length * size)\n m._size = processSizesWildcard(size, currentLength)\n return m\n }\n\n /**\n * Enlarge the matrix when it is smaller than given size.\n * If the matrix is larger or equal sized, nothing is done.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix The matrix to be resized\n * @param {number[]} size\n * @param {*} defaultValue Default value, filled in on new entries.\n * @private\n */\n function _fit (matrix, size, defaultValue) {\n const // copy the array\n newSize = matrix._size.slice(0)\n\n let changed = false\n\n // add dimensions when needed\n while (newSize.length < size.length) {\n newSize.push(0)\n changed = true\n }\n\n // enlarge size when needed\n for (let i = 0, ii = size.length; i < ii; i++) {\n if (size[i] > newSize[i]) {\n newSize[i] = size[i]\n changed = true\n }\n }\n\n if (changed) {\n // resize only when size is changed\n _resize(matrix, newSize, defaultValue)\n }\n }\n\n /**\n * Create a clone of the matrix\n * @memberof DenseMatrix\n * @return {DenseMatrix} clone\n */\n DenseMatrix.prototype.clone = function () {\n const m = new DenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n })\n return m\n }\n\n /**\n * Retrieve the size of the matrix.\n * @memberof DenseMatrix\n * @returns {number[]} size\n */\n DenseMatrix.prototype.size = function () {\n return this._size.slice(0) // return a clone of _size\n }\n\n /**\n * Applies a callback function to a reference to each element of the matrix\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: an array, an integer index to that\n * array, and the Matrix being traversed.\n */\n DenseMatrix.prototype._forEach = function (callback) {\n // matrix instance\n const me = this\n const s = me.size()\n\n // if there is only one dimension, just loop through it\n if (s.length === 1) {\n for (let i = 0; i < s[0]; i++) {\n callback(me._data, i, [i])\n }\n return\n }\n\n // keep track of the current index permutation\n const index = Array(s.length).fill(0)\n\n // store a reference of each dimension of the matrix for faster access\n const data = Array(s.length - 1)\n const last = data.length - 1\n\n data[0] = me._data[0]\n for (let i = 0; i < last; i++) {\n data[i + 1] = data[i][0]\n }\n\n index[last] = -1\n while (true) {\n let i\n for (i = last; i >= 0; i--) {\n // march index to the next permutation\n index[i]++\n if (index[i] === s[i]) {\n index[i] = 0\n continue\n }\n\n // update references to matrix dimensions\n data[i] = i === 0 ? me._data[index[i]] : data[i - 1][index[i]]\n for (let j = i; j < last; j++) {\n data[j + 1] = data[j][0]\n }\n\n // loop through the last dimension and map each value\n for (let j = 0; j < s[data.length]; j++) {\n index[data.length] = j\n callback(data[last], j, index.slice(0))\n }\n break\n }\n\n if (i === -1) {\n break\n }\n }\n }\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback) {\n const me = this\n const result = new DenseMatrix(me)\n const fastCallback = optimizeCallback(callback, me._data, 'map')\n\n result._forEach(function (arr, i, index) {\n arr[i] = fastCallback(arr[i], index, me)\n })\n\n return result\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n DenseMatrix.prototype.forEach = function (callback) {\n const me = this\n const fastCallback = optimizeCallback(callback, me._data, 'map')\n me._forEach(function (arr, i, index) {\n fastCallback(arr[i], index, me)\n })\n }\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n DenseMatrix.prototype[Symbol.iterator] = function * () {\n const recurse = function * (value, index) {\n if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n yield * recurse(value[i], index.concat(i))\n }\n } else {\n yield ({ value, index })\n }\n }\n yield * recurse(this._data, [])\n }\n\n /**\n * Returns an array containing the rows of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.rows = function () {\n const result = []\n\n const s = this.size()\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.')\n }\n\n const data = this._data\n for (const row of data) {\n result.push(new DenseMatrix([row], this._datatype))\n }\n\n return result\n }\n\n /**\n * Returns an array containing the columns of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.columns = function () {\n const result = []\n\n const s = this.size()\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.')\n }\n\n const data = this._data\n for (let i = 0; i < s[1]; i++) {\n const col = data.map(row => [row[i]])\n result.push(new DenseMatrix(col, this._datatype))\n }\n\n return result\n }\n\n /**\n * Create an Array with a copy of the data of the DenseMatrix\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.toArray = function () {\n return clone(this._data)\n }\n\n /**\n * Get the primitive value of the DenseMatrix: a multidimensional array\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.valueOf = function () {\n return this._data\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof DenseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n DenseMatrix.prototype.format = function (options) {\n return format(this._data, options)\n }\n\n /**\n * Get a string representation of the matrix\n * @memberof DenseMatrix\n * @returns {string} str\n */\n DenseMatrix.prototype.toString = function () {\n return format(this._data)\n }\n\n /**\n * Get a JSON representation of the matrix\n * @memberof DenseMatrix\n * @returns {Object}\n */\n DenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'DenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n }\n }\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof DenseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix with the diagonal values.\n */\n DenseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) { k = k.toNumber() }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number')\n }\n } else {\n // default value\n k = 0\n }\n\n const kSuper = k > 0 ? k : 0\n const kSub = k < 0 ? -k : 0\n\n // rows & columns\n const rows = this._size[0]\n const columns = this._size[1]\n\n // number diagonal values\n const n = Math.min(rows - kSub, columns - kSuper)\n\n // x is a matrix get diagonal from matrix\n const data = []\n\n // loop rows\n for (let i = 0; i < n; i++) {\n data[i] = this._data[i + kSub][i + kSuper]\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [n],\n datatype: this._datatype\n })\n }\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof DenseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Matrix | Array } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The datatype for the diagonal\n *\n * @returns {DenseMatrix}\n */\n DenseMatrix.diagonal = function (size, value, k, defaultValue) {\n if (!isArray(size)) { throw new TypeError('Array expected, size parameter') }\n if (size.length !== 2) { throw new Error('Only two dimensions matrix are supported') }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber()\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers')\n }\n return s\n })\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) { k = k.toNumber() }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number')\n }\n } else {\n // default value\n k = 0\n }\n\n const kSuper = k > 0 ? k : 0\n const kSub = k < 0 ? -k : 0\n\n // rows and columns\n const rows = size[0]\n const columns = size[1]\n\n // number of non-zero items\n const n = Math.min(rows - kSub, columns - kSuper)\n\n // value extraction function\n let _value\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length')\n }\n // define function\n _value = function (i) {\n // return value @ i\n return value[i]\n }\n } else if (isMatrix(value)) {\n // matrix size\n const ms = value.size()\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length')\n }\n // define function\n _value = function (i) {\n // return value @ i\n return value.get([i])\n }\n } else {\n // define function\n _value = function () {\n // return value\n return value\n }\n }\n\n // discover default value if needed\n if (!defaultValue) {\n // check first value in array\n defaultValue = isBigNumber(_value(0))\n ? _value(0).mul(0) // trick to create a BigNumber with value zero\n : 0\n }\n\n // empty array\n let data = []\n\n // check we need to resize array\n if (size.length > 0) {\n // resize array\n data = resize(data, size, defaultValue)\n // fill diagonal\n for (let d = 0; d < n; d++) {\n data[d + kSub][d + kSuper] = _value(d)\n }\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [rows, columns]\n })\n }\n\n /**\n * Generate a matrix from a JSON object\n * @memberof DenseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"DenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {DenseMatrix}\n */\n DenseMatrix.fromJSON = function (json) {\n return new DenseMatrix(json)\n }\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof DenseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n DenseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers')\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported')\n }\n // validate index\n validateIndex(i, this._size[0])\n validateIndex(j, this._size[0])\n\n // swap rows\n DenseMatrix._swapRows(i, j, this._data)\n // return current instance\n return this\n }\n\n /**\n * Swap rows i and j in Dense Matrix data structure.\n *\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n * @param {Array} data Matrix data\n */\n DenseMatrix._swapRows = function (i, j, data) {\n // swap values i <-> j\n const vi = data[i]\n data[i] = data[j]\n data[j] = vi\n }\n\n /**\n * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and\n * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays\n * @memberof DenseMatrix\n * @param {Array | Matrix} data\n * @return {Array} data\n */\n function preprocess (data) {\n if (isMatrix(data)) {\n return preprocess(data.valueOf())\n }\n\n if (isArray(data)) {\n return data.map(preprocess)\n }\n\n return data\n }\n\n return DenseMatrix\n}, { isClass: true })\n","import { clone as objectClone } from '../../utils/object.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'clone'\nconst dependencies = ['typed']\n\nexport const createClone = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Clone an object. Will make a deep copy of the data.\n *\n * Syntax:\n *\n * math.clone(x)\n *\n * Examples:\n *\n * math.clone(3.5) // returns number 3.5\n * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i\n * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg\n * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]\n * math.clone(\"hello world\") // returns string \"hello world\"\n *\n * @param {*} x Object to be cloned\n * @return {*} A clone of object x\n */\n return typed(name, {\n any: objectClone\n })\n})\n","/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nexport function _switch (mat) {\n const I = mat.length\n const J = mat[0].length\n let i, j\n const ret = []\n for (j = 0; j < J; j++) {\n const tmp = []\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j])\n }\n ret.push(tmp)\n }\n return ret\n}\n","import { isCollection, isMatrix } from './is.js'\nimport { IndexError } from '../error/IndexError.js'\nimport { arraySize } from './array.js'\nimport { _switch } from './switch.js'\n\n/**\n * Test whether an array contains collections\n * @param {Array} array\n * @returns {boolean} Returns true when the array contains one or multiple\n * collections (Arrays or Matrices). Returns false otherwise.\n */\nexport function containsCollections (array) {\n for (let i = 0; i < array.length; i++) {\n if (isCollection(array[i])) {\n return true\n }\n }\n return false\n}\n\n/**\n * Recursively loop over all elements in a given multi dimensional array\n * and invoke the callback on each of the elements.\n * @param {Array | Matrix} array\n * @param {Function} callback The callback method is invoked with one\n * parameter: the current element in the array\n */\nexport function deepForEach (array, callback) {\n if (isMatrix(array)) {\n array = array.valueOf()\n }\n\n for (let i = 0, ii = array.length; i < ii; i++) {\n const value = array[i]\n\n if (Array.isArray(value)) {\n deepForEach(value, callback)\n } else {\n callback(value)\n }\n }\n}\n\n/**\n * Execute the callback function element wise for each element in array and any\n * nested array\n * Returns an array with the results\n * @param {Array | Matrix} array\n * @param {Function} callback The callback is called with two parameters:\n * value1 and value2, which contain the current\n * element of both arrays.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Array | Matrix} res\n */\nexport function deepMap (array, callback, skipZeros) {\n if (array && (typeof array.map === 'function')) {\n // TODO: replace array.map with a for loop to improve performance\n return array.map(function (x) {\n return deepMap(x, callback, skipZeros)\n })\n } else {\n return callback(array)\n }\n}\n\n/**\n * Reduce a given matrix or array to a new matrix or\n * array with one less dimension, applying the given\n * callback in the selected dimension.\n * @param {Array | Matrix} mat\n * @param {number} dim\n * @param {Function} callback\n * @return {Array | Matrix} res\n */\nexport function reduce (mat, dim, callback) {\n const size = Array.isArray(mat) ? arraySize(mat) : mat.size()\n if (dim < 0 || (dim >= size.length)) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length)\n }\n\n if (isMatrix(mat)) {\n return mat.create(_reduce(mat.valueOf(), dim, callback), mat.datatype())\n } else {\n return _reduce(mat, dim, callback)\n }\n}\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _reduce (mat, dim, callback) {\n let i, ret, val, tran\n\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n val = mat[0]\n for (i = 1; i < mat.length; i++) {\n val = callback(val, mat[i])\n }\n return val\n } else {\n tran = _switch(mat)\n ret = []\n for (i = 0; i < tran.length; i++) {\n ret[i] = _reduce(tran[i], dim - 1, callback)\n }\n return ret\n }\n } else {\n ret = []\n for (i = 0; i < mat.length; i++) {\n ret[i] = _reduce(mat[i], dim - 1, callback)\n }\n return ret\n }\n}\n\n// TODO: document function scatter\nexport function scatter (a, j, w, x, u, mark, cindex, f, inverse, update, value) {\n // a arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n\n // vars\n let k, k0, k1, i\n\n // check we need to process values (pattern matrix)\n if (x) {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k]\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark\n // add i to pattern of C\n cindex.push(i)\n // x(i) = A, check we need to call function this time\n if (update) {\n // copy value to workspace calling callback function\n x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k])\n // function was called on current row\n u[i] = mark\n } else {\n // copy value to workspace\n x[i] = avalues[k]\n }\n } else {\n // i exists in C already\n x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k])\n // function was called on current row\n u[i] = mark\n }\n }\n } else {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k]\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark\n // add i to pattern of C\n cindex.push(i)\n } else {\n // indicate function was called on current row\n u[i] = mark\n }\n }\n }\n}\n","import { deepMap } from '../../utils/collection.js'\nimport { isInteger as isIntegerNumber } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'isInteger'\nconst dependencies = ['typed']\n\nexport const createIsInteger = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Test whether a value is an integer number.\n * The function supports `number`, `BigNumber`, and `Fraction`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isInteger(x)\n *\n * Examples:\n *\n * math.isInteger(2) // returns true\n * math.isInteger(0) // returns true\n * math.isInteger(0.5) // returns false\n * math.isInteger(math.bignumber(500)) // returns true\n * math.isInteger(math.fraction(4)) // returns true\n * math.isInteger('3') // returns true\n * math.isInteger([3, 0.5, -2]) // returns [true, false, true]\n * math.isInteger(math.complex('2-4i')) // throws an error\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isZero\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` contains a numeric, integer value.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isIntegerNumber, // TODO: what to do with isInteger(add(0.1, 0.2)) ?\n\n BigNumber: function (x) {\n return x.isInt()\n },\n\n bigint: function (x) {\n return true\n },\n\n Fraction: function (x) {\n return x.d === 1 && isFinite(x.n)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { isInteger } from '../../utils/number.js'\n\nconst n1 = 'number'\n\nexport function isIntegerNumber (x) {\n return isInteger(x)\n}\nisIntegerNumber.signature = n1\n\nexport function isNegativeNumber (x) {\n return x < 0\n}\nisNegativeNumber.signature = n1\n\nexport function isPositiveNumber (x) {\n return x > 0\n}\nisPositiveNumber.signature = n1\n\nexport function isZeroNumber (x) {\n return x === 0\n}\nisZeroNumber.signature = n1\n\nexport function isNaNNumber (x) {\n return Number.isNaN(x)\n}\nisNaNNumber.signature = n1\n","/**\n * Compares two BigNumbers.\n * @param {BigNumber} a - First value to compare\n * @param {BigNumber} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @returns {boolean} whether the two numbers are nearly equal\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-9); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.02); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual (a, b, relTol = 1e-9, absTol = 0) {\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0')\n }\n\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0')\n }\n // NaN\n if (a.isNaN() || b.isNaN()) {\n return false\n }\n\n if (!a.isFinite() || !b.isFinite()) {\n return a.eq(b)\n }\n // use \"==\" operator, handles infinities\n if (a.eq(b)) {\n return true\n }\n // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol)\n return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol))\n}\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { isNegativeNumber } from '../../plain/number/index.js'\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\n\nconst name = 'isNegative'\nconst dependencies = ['typed', 'config']\n\nexport const createIsNegative = /* #__PURE__ */ factory(name, dependencies, ({ typed, config }) => {\n /**\n * Test whether a value is negative: smaller than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNegative(x)\n *\n * Examples:\n *\n * math.isNegative(3) // returns false\n * math.isNegative(-2) // returns true\n * math.isNegative(0) // returns false\n * math.isNegative(-0) // returns false\n * math.isNegative(math.bignumber(2)) // returns false\n * math.isNegative(math.fraction(-2, 5)) // returns true\n * math.isNegative('-2') // returns true\n * math.isNegative([2, 0, -3]) // returns [false, false, true]\n *\n * See also:\n *\n * isNumeric, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),\n\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol)\n ? false\n : x.isNeg() && !x.isZero() && !x.isNaN(),\n\n bigint: x => x < 0n,\n\n Fraction: x => x.s < 0, // It's enough to decide on the sign\n\n Unit: typed.referToSelf(self =>\n x => typed.find(self, x.valueType())(x.value)),\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'isNumeric'\nconst dependencies = ['typed']\n\nexport const createIsNumeric = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Test whether a value is an numeric value.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNumeric(x)\n *\n * Examples:\n *\n * math.isNumeric(2) // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue('2') // returns true\n * math.isNumeric(0) // returns true\n * math.isNumeric(math.bignumber('42')) // returns true\n * math.isNumeric(math.bigint('42')) // returns true\n * math.isNumeric(math.fraction(4)) // returns true\n * math.isNumeric(math.complex('2-4i')) // returns false\n * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, hasNumericValue\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, or `boolean`. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n 'number | BigNumber | bigint | Fraction | boolean': () => true,\n 'Complex | Unit | string | null | undefined | Node': () => false,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'hasNumericValue'\nconst dependencies = ['typed', 'isNumeric']\n\nexport const createHasNumericValue = /* #__PURE__ */ factory(name, dependencies, ({ typed, isNumeric }) => {\n /**\n * Test whether a value is an numeric value.\n *\n * In case of a string, true is returned if the string contains a numeric value.\n *\n * Syntax:\n *\n * math.hasNumericValue(x)\n *\n * Examples:\n *\n * math.hasNumericValue(2) // returns true\n * math.hasNumericValue('2') // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue(0) // returns true\n * math.hasNumericValue(math.bignumber('500')) // returns true\n * math.hasNumericValue(math.bigint('42')) // returns true\n * math.hasNumericValue(42n) // returns true\n * math.hasNumericValue(math.fraction(4)) // returns true\n * math.hasNumericValue(math.complex('2-4i')) // returns false\n * math.hasNumericValue(false) // returns true\n * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, isNumeric\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n boolean: () => true,\n string: function (x) {\n return x.trim().length > 0 && !isNaN(Number(x))\n },\n any: function (x) {\n return isNumeric(x)\n }\n })\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { isPositiveNumber } from '../../plain/number/index.js'\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\n\nconst name = 'isPositive'\nconst dependencies = ['typed', 'config']\n\nexport const createIsPositive = /* #__PURE__ */ factory(name, dependencies, ({ typed, config }) => {\n /**\n * Test whether a value is positive: larger than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPositive(x)\n *\n * Examples:\n *\n * math.isPositive(3) // returns true\n * math.isPositive(-2) // returns false\n * math.isPositive(0) // returns false\n * math.isPositive(-0) // returns false\n * math.isPositive(0.5) // returns true\n * math.isPositive(math.bignumber(2)) // returns true\n * math.isPositive(math.fraction(-2, 5)) // returns false\n * math.isPositive(math.fraction(1, 3)) // returns true\n * math.isPositive('2') // returns true\n * math.isPositive([2, 0, -3]) // returns [true, false, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),\n\n BigNumber: x =>\n bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol)\n ? false\n : !x.isNeg() && !x.isZero() && !x.isNaN(),\n\n bigint: x => x > 0n,\n\n Fraction: x => x.s > 0 && x.n > 0,\n\n Unit: typed.referToSelf(self =>\n x => typed.find(self, x.valueType())(x.value)),\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'isZero'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createIsZero = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Test whether a value is zero.\n * The function can check for zero for types `number`, `BigNumber`, `Fraction`,\n * `Complex`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isZero(x)\n *\n * Examples:\n *\n * math.isZero(0) // returns true\n * math.isZero(2) // returns false\n * math.isZero(0.5) // returns false\n * math.isZero(math.bignumber(0)) // returns true\n * math.isZero(math.fraction(0)) // returns true\n * math.isZero(math.fraction(1,3)) // returns false\n * math.isZero(math.complex('2 - 4i')) // returns false\n * math.isZero(math.complex('0i')) // returns true\n * math.isZero('0') // returns true\n * math.isZero('2') // returns false\n * math.isZero([2, 0, -3]) // returns [false, true, false]\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0),\n\n bigint: x => x === 0n,\n\n Unit: typed.referToSelf(self =>\n x => typed.find(self, x.valueType())(x.value)),\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { isNaNNumber } from '../../plain/number/index.js'\n\nconst name = 'isNaN'\nconst dependencies = ['typed']\n\nexport const createIsNaN = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Test whether a value is NaN (not a number).\n * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNaN(x)\n *\n * Examples:\n *\n * math.isNaN(3) // returns false\n * math.isNaN(NaN) // returns true\n * math.isNaN(0) // returns false\n * math.isNaN(math.bignumber(NaN)) // returns true\n * math.isNaN(math.bignumber(0)) // returns false\n * math.isNaN(math.fraction(-2, 5)) // returns false\n * math.isNaN('-2') // returns false\n * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]\n *\n * See also:\n *\n * isNumeric, isNegative, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is NaN.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isNaNNumber,\n\n BigNumber: function (x) {\n return x.isNaN()\n },\n\n bigint: function (x) {\n return false\n },\n\n Fraction: function (x) {\n return false\n },\n\n Complex: function (x) {\n return x.isNaN()\n },\n\n Unit: function (x) {\n return Number.isNaN(x.value)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { typeOf as _typeOf } from '../../utils/is.js'\n\nconst name = 'typeOf'\nconst dependencies = ['typed']\n\nexport const createTypeOf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Determine the type of an entity.\n *\n * Syntax:\n *\n * math.typeOf(x)\n *\n * Examples:\n *\n * // This list is intended to include all relevant types, for testing\n * // purposes:\n * math.typeOf(3.5) // returns 'number'\n * math.typeOf(42n) // returns 'bigint'\n * math.typeOf(math.complex('2-4i')) // returns 'Complex'\n * math.typeOf(math.unit('45 deg')) // returns 'Unit'\n * math.typeOf('hello world') // returns 'string'\n * math.typeOf(null) // returns 'null'\n * math.typeOf(true) // returns 'boolean'\n * math.typeOf([1, 2, 3]) // returns 'Array'\n * math.typeOf(new Date()) // returns 'Date'\n * math.typeOf(function () {}) // returns 'function'\n * math.typeOf({a: 2, b: 3}) // returns 'Object'\n * math.typeOf(/a regexp/) // returns 'RegExp'\n * math.typeOf(undefined) // returns 'undefined'\n * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber'\n * math.typeOf(math.chain(2)) // returns 'Chain'\n * math.typeOf(math.fraction(1, 3)) // returns 'Fraction'\n * math.typeOf(math.help('sqrt')) // returns 'Help'\n * math.typeOf(math.index(1, 3)) // returns 'Index'\n * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix'\n * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix'\n * math.typeOf(new math.Range(0, 10)) // returns 'Range'\n * math.typeOf(math.evaluate('a=2\\na')) // returns 'ResultSet'\n * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode'\n * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode'\n * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode'\n * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode'\n * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode'\n * math.typeOf(math.parse('2.3')) // returns 'ConstantNode'\n * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode'\n * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode'\n * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode'\n * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode'\n * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode'\n * math.typeOf(math.parse('1:10')) // returns 'RangeNode'\n * math.typeOf(math.parse('a ({\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (!x.equalBase(y)) {\n throw new Error('Cannot compare units with different base')\n }\n return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value)\n })\n })\n)\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { complexEquals } from '../../utils/complex.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'equalScalar'\nconst dependencies = ['typed', 'config']\n\nexport const createEqualScalar = /* #__PURE__ */ factory(name, dependencies, ({ typed, config }) => {\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Test whether two scalar values are nearly equal.\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare\n * @return {boolean} Returns true when the compared values are equal, else returns false\n * @private\n */\n return typed(name, {\n\n 'boolean, boolean': function (x, y) {\n return x === y\n },\n\n 'number, number': function (x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'bigint, bigint': function (x, y) {\n return x === y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return x.equals(y)\n },\n\n 'Complex, Complex': function (x, y) {\n return complexEquals(x, y, config.relTol, config.absTol)\n }\n }, compareUnits)\n})\n\nexport const createEqualScalarNumber = factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol)\n }\n })\n})\n","import { nearlyEqual } from './number.js'\n\n/**\n * Test whether two complex values are equal provided a given relTol and absTol.\n * Does not use or change the global Complex.EPSILON setting\n * @param {Complex} x - The first complex number for comparison.\n * @param {Complex} y - The second complex number for comparison.\n * @param {number} relTol - The relative tolerance for comparison.\n * @param {number} absTol - The absolute tolerance for comparison.\n * @returns {boolean} - Returns true if the two complex numbers are equal within the given tolerances, otherwise returns false.\n */\nexport function complexEquals (x, y, relTol, absTol) {\n return nearlyEqual(x.re, y.re, relTol, absTol) && nearlyEqual(x.im, y.im, relTol, absTol)\n}\n","import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js'\nimport { isInteger } from '../../utils/number.js'\nimport { format } from '../../utils/string.js'\nimport { clone, deepStrictEqual } from '../../utils/object.js'\nimport { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { DimensionError } from '../../error/DimensionError.js'\nimport { optimizeCallback } from '../../utils/optimizeCallback.js'\n\nconst name = 'SparseMatrix'\nconst dependencies = [\n 'typed',\n 'equalScalar',\n 'Matrix'\n]\n\nexport const createSparseMatrixClass = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar, Matrix }) => {\n /**\n * Sparse Matrix implementation. This type implements\n * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS))\n * format for two-dimensional sparse matrices.\n * @class SparseMatrix\n */\n function SparseMatrix (data, datatype) {\n if (!(this instanceof SparseMatrix)) { throw new SyntaxError('Constructor must be called with the new operator') }\n if (datatype && !isString(datatype)) { throw new Error('Invalid datatype: ' + datatype) }\n\n if (isMatrix(data)) {\n // create from matrix\n _createFromMatrix(this, data, datatype)\n } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) {\n // initialize fields\n this._values = data.values\n this._index = data.index\n this._ptr = data.ptr\n this._size = data.size\n this._datatype = datatype || data.datatype\n } else if (isArray(data)) {\n // create from array\n _createFromArray(this, data, datatype)\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')')\n } else {\n // nothing provided\n this._values = []\n this._index = []\n this._ptr = [0]\n this._size = [0, 0]\n this._datatype = datatype\n }\n }\n\n function _createFromMatrix (matrix, source, datatype) {\n // check matrix type\n if (source.type === 'SparseMatrix') {\n // clone arrays\n matrix._values = source._values ? clone(source._values) : undefined\n matrix._index = clone(source._index)\n matrix._ptr = clone(source._ptr)\n matrix._size = clone(source._size)\n matrix._datatype = datatype || source._datatype\n } else {\n // build from matrix data\n _createFromArray(matrix, source.valueOf(), datatype || source._datatype)\n }\n }\n\n function _createFromArray (matrix, data, datatype) {\n // initialize fields\n matrix._values = []\n matrix._index = []\n matrix._ptr = []\n matrix._datatype = datatype\n // discover rows & columns, do not use math.size() to avoid looping array twice\n const rows = data.length\n let columns = 0\n\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype)\n }\n\n // check we have rows (empty array)\n if (rows > 0) {\n // column index\n let j = 0\n do {\n // store pointer to values index\n matrix._ptr.push(matrix._index.length)\n // loop rows\n for (let i = 0; i < rows; i++) {\n // current row\n const row = data[i]\n // check row is an array\n if (isArray(row)) {\n // update columns if needed (only on first column)\n if (j === 0 && columns < row.length) { columns = row.length }\n // check row has column\n if (j < row.length) {\n // value\n const v = row[j]\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n matrix._values.push(v)\n // index\n matrix._index.push(i)\n }\n }\n } else {\n // update columns if needed (only on first column)\n if (j === 0 && columns < 1) { columns = 1 }\n // check value != 0 (row is a scalar)\n if (!eq(row, zero)) {\n // store value\n matrix._values.push(row)\n // index\n matrix._index.push(i)\n }\n }\n }\n // increment index\n j++\n }\n while (j < columns)\n }\n // store number of values in ptr\n matrix._ptr.push(matrix._index.length)\n // size\n matrix._size = [rows, columns]\n }\n\n SparseMatrix.prototype = new Matrix()\n\n /**\n * Create a new SparseMatrix\n */\n SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {\n return new SparseMatrix(data, datatype)\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(SparseMatrix, 'name', { value: 'SparseMatrix' })\n SparseMatrix.prototype.constructor = SparseMatrix\n SparseMatrix.prototype.type = 'SparseMatrix'\n SparseMatrix.prototype.isSparseMatrix = true\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf SparseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n SparseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._values, typeOf)\n }\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof SparseMatrix\n * @return {string} The storage format.\n */\n SparseMatrix.prototype.storage = function () {\n return 'sparse'\n }\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof SparseMatrix\n * @return {string} The datatype.\n */\n SparseMatrix.prototype.datatype = function () {\n return this._datatype\n }\n\n /**\n * Create a new SparseMatrix\n * @memberof SparseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n SparseMatrix.prototype.create = function (data, datatype) {\n return new SparseMatrix(data, datatype)\n }\n\n /**\n * Get the matrix density.\n *\n * Usage:\n * const density = matrix.density() // retrieve matrix density\n *\n * @memberof SparseMatrix\n * @return {number} The matrix density.\n */\n SparseMatrix.prototype.density = function () {\n // rows & columns\n const rows = this._size[0]\n const columns = this._size[1]\n // calculate density\n return rows !== 0 && columns !== 0 ? (this._index.length / (rows * columns)) : 0\n }\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof SparseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n SparseMatrix.prototype.subset = function (index, replacement, defaultValue) { // check it is a pattern matrix\n if (!this._values) { throw new Error('Cannot invoke subset on a Pattern only matrix') }\n\n // check arguments\n switch (arguments.length) {\n case 1:\n return _getsubset(this, index)\n\n // intentional fall through\n case 2:\n case 3:\n return _setsubset(this, index, replacement, defaultValue)\n\n default:\n throw new SyntaxError('Wrong number of arguments')\n }\n }\n\n function _getsubset (matrix, idx) {\n // check idx\n if (!isIndex(idx)) {\n throw new TypeError('Invalid index')\n }\n\n const isScalar = idx.isScalar()\n if (isScalar) {\n // return a scalar\n return matrix.get(idx.min())\n }\n // validate dimensions\n const size = idx.size()\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length)\n }\n\n // vars\n let i, ii, k, kk\n\n // validate if any of the ranges in the index is out of range\n const min = idx.min()\n const max = idx.max()\n for (i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i])\n validateIndex(max[i], matrix._size[i])\n }\n\n // matrix arrays\n const mvalues = matrix._values\n const mindex = matrix._index\n const mptr = matrix._ptr\n\n // rows & columns dimensions for result matrix\n const rows = idx.dimension(0)\n const columns = idx.dimension(1)\n\n // workspace & permutation vector\n const w = []\n const pv = []\n\n // loop rows in resulting matrix\n rows.forEach(function (i, r) {\n // update permutation vector\n pv[i] = r[0]\n // mark i in workspace\n w[i] = true\n })\n\n // result matrix arrays\n const values = mvalues ? [] : undefined\n const index = []\n const ptr = []\n\n // loop columns in result matrix\n columns.forEach(function (j) {\n // update ptr\n ptr.push(index.length)\n // loop values in column j\n for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) {\n // row\n i = mindex[k]\n // check row is in result matrix\n if (w[i] === true) {\n // push index\n index.push(pv[i])\n // check we need to process values\n if (values) { values.push(mvalues[k]) }\n }\n }\n })\n // update ptr\n ptr.push(index.length)\n\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size,\n datatype: matrix._datatype\n })\n }\n\n function _setsubset (matrix, index, submatrix, defaultValue) {\n // check index\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index')\n }\n\n // get index size and check whether the index contains a single value\n const iSize = index.size()\n const isScalar = index.isScalar()\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n let sSize\n if (isMatrix(submatrix)) {\n // submatrix size\n sSize = submatrix.size()\n // use array representation\n submatrix = submatrix.toArray()\n } else {\n // get submatrix size (array, scalar)\n sSize = arraySize(submatrix)\n }\n\n // check index is a scalar\n if (isScalar) {\n // verify submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected')\n }\n // set value\n matrix.set(index.min(), submatrix, defaultValue)\n } else {\n // validate dimensions, index size must be one or two dimensions\n if (iSize.length !== 1 && iSize.length !== 2) {\n throw new DimensionError(iSize.length, matrix._size.length, '<')\n }\n\n // check submatrix and index have the same dimensions\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n let i = 0\n let outer = 0\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++\n }\n while (iSize[i] === 1) {\n outer++\n i++\n }\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize)\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>')\n }\n\n // insert the sub matrix\n if (iSize.length === 1) {\n // if the replacement index only has 1 dimension, go trough each one and set its value\n const range = index.dimension(0)\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex)\n matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue)\n })\n } else {\n // if the replacement index has 2 dimensions, go through each one and set the value in the correct index\n const firstDimensionRange = index.dimension(0)\n const secondDimensionRange = index.dimension(1)\n firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) {\n validateIndex(firstDataIndex)\n secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) {\n validateIndex(secondDataIndex)\n matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue)\n })\n })\n }\n }\n return matrix\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n SparseMatrix.prototype.get = function (index) {\n if (!isArray(index)) { throw new TypeError('Array expected') }\n if (index.length !== this._size.length) { throw new DimensionError(index.length, this._size.length) }\n\n // check it is a pattern matrix\n if (!this._values) { throw new Error('Cannot invoke get on a Pattern only matrix') }\n\n // row and column\n const i = index[0]\n const j = index[1]\n\n // check i, j are valid\n validateIndex(i, this._size[0])\n validateIndex(j, this._size[1])\n\n // find value index\n const k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index)\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) { return this._values[k] }\n\n return 0\n }\n\n /**\n * Replace a single element in the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} v\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be set to zero.\n * @return {SparseMatrix} self\n */\n SparseMatrix.prototype.set = function (index, v, defaultValue) {\n if (!isArray(index)) { throw new TypeError('Array expected') }\n if (index.length !== this._size.length) { throw new DimensionError(index.length, this._size.length) }\n\n // check it is a pattern matrix\n if (!this._values) { throw new Error('Cannot invoke set on a Pattern only matrix') }\n\n // row and column\n const i = index[0]\n const j = index[1]\n\n // rows & columns\n let rows = this._size[0]\n let columns = this._size[1]\n\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n if (isString(this._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar\n // convert 0 to the same datatype\n zero = typed.convert(0, this._datatype)\n }\n\n // check we need to resize matrix\n if (i > rows - 1 || j > columns - 1) {\n // resize matrix\n _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue)\n // update rows & columns\n rows = this._size[0]\n columns = this._size[1]\n }\n\n // check i, j are valid\n validateIndex(i, rows)\n validateIndex(j, columns)\n\n // find value index\n const k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index)\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n // check value != 0\n if (!eq(v, zero)) {\n // update value\n this._values[k] = v\n } else {\n // remove value from matrix\n _remove(k, j, this._values, this._index, this._ptr)\n }\n } else {\n if (!eq(v, zero)) {\n // insert value @ (i, j)\n _insert(k, i, j, v, this._values, this._index, this._ptr)\n }\n }\n\n return this\n }\n\n function _getValueIndex (i, top, bottom, index) {\n // check row is on the bottom side\n if (bottom - top === 0) { return bottom }\n // loop rows [top, bottom[\n for (let r = top; r < bottom; r++) {\n // check we found value index\n if (index[r] === i) { return r }\n }\n // we did not find row\n return top\n }\n\n function _remove (k, j, values, index, ptr) {\n // remove value @ k\n values.splice(k, 1)\n index.splice(k, 1)\n // update pointers\n for (let x = j + 1; x < ptr.length; x++) { ptr[x]-- }\n }\n\n function _insert (k, i, j, v, values, index, ptr) {\n // insert value\n values.splice(k, 0, v)\n // update row for k\n index.splice(k, 0, i)\n // update column pointers\n for (let x = j + 1; x < ptr.length; x++) { ptr[x]++ }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof SparseMatrix\n * @param {number[] | Matrix} size The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n SparseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected')\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n const sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1\n ? value[0]\n : value\n })\n\n if (sizeArray.length !== 2) { throw new Error('Only two dimensions matrix are supported') }\n\n // check sizes\n sizeArray.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' +\n '(size: ' + format(sizeArray) + ')')\n }\n })\n\n // matrix to resize\n const m = copy ? this.clone() : this\n // resize matrix\n return _resize(m, sizeArray[0], sizeArray[1], defaultValue)\n }\n\n function _resize (matrix, rows, columns, defaultValue) {\n // value to insert at the time of growing matrix\n let value = defaultValue || 0\n\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype)\n // convert value to the same datatype\n value = typed.convert(value, matrix._datatype)\n }\n\n // should we insert the value?\n const ins = !eq(value, zero)\n\n // old columns and rows\n const r = matrix._size[0]\n let c = matrix._size[1]\n\n let i, j, k\n\n // check we need to increase columns\n if (columns > c) {\n // loop new columns\n for (j = c; j < columns; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length\n // check we need to insert matrix._values\n if (ins) {\n // loop rows\n for (i = 0; i < r; i++) {\n // add new matrix._values\n matrix._values.push(value)\n // update matrix._index\n matrix._index.push(i)\n }\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[columns] = matrix._values.length\n } else if (columns < c) {\n // truncate matrix._ptr\n matrix._ptr.splice(columns + 1, c - columns)\n // truncate matrix._values and matrix._index\n matrix._values.splice(matrix._ptr[columns], matrix._values.length)\n matrix._index.splice(matrix._ptr[columns], matrix._index.length)\n }\n // update columns\n c = columns\n\n // check we need to increase rows\n if (rows > r) {\n // check we have to insert values\n if (ins) {\n // inserts\n let n = 0\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] + n\n // where to insert matrix._values\n k = matrix._ptr[j + 1] + n\n // pointer\n let p = 0\n // loop new rows, initialize pointer\n for (i = r; i < rows; i++, p++) {\n // add value\n matrix._values.splice(k + p, 0, value)\n // update matrix._index\n matrix._index.splice(k + p, 0, i)\n // increment inserts\n n++\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[c] = matrix._values.length\n }\n } else if (rows < r) {\n // deletes\n let d = 0\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] - d\n // where matrix._values start for next column\n const k0 = matrix._ptr[j]\n const k1 = matrix._ptr[j + 1] - d\n // loop matrix._index\n for (k = k0; k < k1; k++) {\n // row\n i = matrix._index[k]\n // check we need to delete value and matrix._index\n if (i > rows - 1) {\n // remove value\n matrix._values.splice(k, 1)\n // remove item from matrix._index\n matrix._index.splice(k, 1)\n // increase deletes\n d++\n }\n }\n }\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length\n }\n // update matrix._size\n matrix._size[0] = rows\n matrix._size[1] = columns\n // return matrix\n return matrix\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof SparseMatrix\n * @param {number[]} sizes The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n SparseMatrix.prototype.reshape = function (sizes, copy) {\n // validate arguments\n if (!isArray(sizes)) { throw new TypeError('Array expected') }\n if (sizes.length !== 2) { throw new Error('Sparse matrices can only be reshaped in two dimensions') }\n\n // check sizes\n sizes.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {\n throw new TypeError('Invalid size, must contain positive integers or -1 ' +\n '(size: ' + format(sizes) + ')')\n }\n })\n\n const currentLength = this._size[0] * this._size[1]\n sizes = processSizesWildcard(sizes, currentLength)\n const newLength = sizes[0] * sizes[1]\n\n // m * n must not change\n if (currentLength !== newLength) {\n throw new Error('Reshaping sparse matrix will result in the wrong number of elements')\n }\n\n // matrix to reshape\n const m = copy ? this.clone() : this\n\n // return unchanged if the same shape\n if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) {\n return m\n }\n\n // Convert to COO format (generate a column index)\n const colIndex = []\n for (let i = 0; i < m._ptr.length; i++) {\n for (let j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) {\n colIndex.push(i)\n }\n }\n\n // Clone the values array\n const values = m._values.slice()\n\n // Clone the row index array\n const rowIndex = m._index.slice()\n\n // Transform the (row, column) indices\n for (let i = 0; i < m._index.length; i++) {\n const r1 = rowIndex[i]\n const c1 = colIndex[i]\n const flat = r1 * m._size[1] + c1\n colIndex[i] = flat % sizes[1]\n rowIndex[i] = Math.floor(flat / sizes[1])\n }\n\n // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored\n // in column-major order, so we have to reorder the value array now. One option is to use a multisort,\n // sorting several arrays based on some other array.\n\n // OR, we could easily just:\n\n // 1. Remove all values from the matrix\n m._values.length = 0\n m._index.length = 0\n m._ptr.length = sizes[1] + 1\n m._size = sizes.slice()\n for (let i = 0; i < m._ptr.length; i++) {\n m._ptr[i] = 0\n }\n\n // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set)\n // This step is probably the most time-consuming\n for (let h = 0; h < values.length; h++) {\n const i = rowIndex[h]\n const j = colIndex[h]\n const v = values[h]\n const k = _getValueIndex(i, m._ptr[j], m._ptr[j + 1], m._index)\n _insert(k, i, j, v, m._values, m._index, m._ptr)\n }\n\n // The value indices are inserted out of order, but apparently that's... still OK?\n\n return m\n }\n\n /**\n * Create a clone of the matrix\n * @memberof SparseMatrix\n * @return {SparseMatrix} clone\n */\n SparseMatrix.prototype.clone = function () {\n const m = new SparseMatrix({\n values: this._values ? clone(this._values) : undefined,\n index: clone(this._index),\n ptr: clone(this._ptr),\n size: clone(this._size),\n datatype: this._datatype\n })\n return m\n }\n\n /**\n * Retrieve the size of the matrix.\n * @memberof SparseMatrix\n * @returns {number[]} size\n */\n SparseMatrix.prototype.size = function () {\n return this._size.slice(0) // copy the Array\n }\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {SparseMatrix} matrix\n */\n SparseMatrix.prototype.map = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) { throw new Error('Cannot invoke map on a Pattern only matrix') }\n // matrix instance\n const me = this\n // rows and columns\n const rows = this._size[0]\n const columns = this._size[1]\n const fastCallback = optimizeCallback(callback, me, 'map')\n // invoke callback\n const invoke = function (v, i, j) {\n // invoke callback\n return fastCallback(v, [i, j], me)\n }\n // invoke _map\n return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros)\n }\n\n /**\n * Create a new matrix with the results of the callback function executed on the interval\n * [minRow..maxRow, minColumn..maxColumn].\n */\n function _map (matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {\n // result arrays\n const values = []\n const index = []\n const ptr = []\n\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype)\n }\n\n // invoke callback\n const invoke = function (v, x, y) {\n // invoke callback\n const value = callback(v, x, y)\n // check value != 0\n if (!eq(value, zero)) {\n // store value\n values.push(value)\n // index\n index.push(x)\n }\n }\n // loop columns\n for (let j = minColumn; j <= maxColumn; j++) {\n // store pointer to values index\n ptr.push(values.length)\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = matrix._ptr[j]\n const k1 = matrix._ptr[j + 1]\n\n if (skipZeros) {\n // loop k within [k0, k1[\n for (let k = k0; k < k1; k++) {\n // row index\n const i = matrix._index[k]\n // check i is in range\n if (i >= minRow && i <= maxRow) {\n // value @ k\n invoke(matrix._values[k], i - minRow, j - minColumn)\n }\n }\n } else {\n // create a cache holding all defined values\n const values = {}\n for (let k = k0; k < k1; k++) {\n const i = matrix._index[k]\n values[i] = matrix._values[k]\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (let i = minRow; i <= maxRow; i++) {\n const value = (i in values) ? values[i] : 0\n invoke(value, i - minRow, j - minColumn)\n }\n }\n }\n\n // store number of values in ptr\n ptr.push(values.length)\n // return sparse matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [maxRow - minRow + 1, maxColumn - minColumn + 1]\n })\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n * If false, the indices are guaranteed to be in order,\n * if true, the indices can be unordered.\n */\n SparseMatrix.prototype.forEach = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) { throw new Error('Cannot invoke forEach on a Pattern only matrix') }\n // matrix instance\n const me = this\n // rows and columns\n const rows = this._size[0]\n const columns = this._size[1]\n const fastCallback = optimizeCallback(callback, me, 'forEach')\n // loop columns\n for (let j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = this._ptr[j]\n const k1 = this._ptr[j + 1]\n\n if (skipZeros) {\n // loop k within [k0, k1[\n for (let k = k0; k < k1; k++) {\n // row index\n const i = this._index[k]\n\n // value @ k\n fastCallback(this._values[k], [i, j], me)\n }\n } else {\n // create a cache holding all defined values\n const values = {}\n for (let k = k0; k < k1; k++) {\n const i = this._index[k]\n values[i] = this._values[k]\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (let i = 0; i < rows; i++) {\n const value = (i in values) ? values[i] : 0\n fastCallback(value, [i, j], me)\n }\n }\n }\n }\n\n /**\n * Iterate over the matrix elements, skipping zeros\n * @return {Iterable<{ value, index: number[] }>}\n */\n SparseMatrix.prototype[Symbol.iterator] = function * () {\n if (!this._values) { throw new Error('Cannot iterate a Pattern only matrix') }\n\n const columns = this._size[1]\n\n for (let j = 0; j < columns; j++) {\n const k0 = this._ptr[j]\n const k1 = this._ptr[j + 1]\n\n for (let k = k0; k < k1; k++) {\n // row index\n const i = this._index[k]\n\n yield ({ value: this._values[k], index: [i, j] })\n }\n }\n }\n\n /**\n * Create an Array with a copy of the data of the SparseMatrix\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.toArray = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, true)\n }\n\n /**\n * Get the primitive value of the SparseMatrix: a two dimensions array\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.valueOf = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, false)\n }\n\n function _toArray (values, index, ptr, size, copy) {\n // rows and columns\n const rows = size[0]\n const columns = size[1]\n // result\n const a = []\n // vars\n let i, j\n // initialize array\n for (i = 0; i < rows; i++) {\n a[i] = []\n for (j = 0; j < columns; j++) { a[i][j] = 0 }\n }\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = ptr[j]\n const k1 = ptr[j + 1]\n // loop k within [k0, k1[\n for (let k = k0; k < k1; k++) {\n // row index\n i = index[k]\n // set value (use one for pattern matrix)\n a[i][j] = values ? (copy ? clone(values[k]) : values[k]) : 1\n }\n }\n return a\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof SparseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n SparseMatrix.prototype.format = function (options) {\n // rows and columns\n const rows = this._size[0]\n const columns = this._size[1]\n // density\n const density = this.density()\n // rows & columns\n let str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\\n'\n // loop columns\n for (let j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = this._ptr[j]\n const k1 = this._ptr[j + 1]\n // loop k within [k0, k1[\n for (let k = k0; k < k1; k++) {\n // row index\n const i = this._index[k]\n // append value\n str += '\\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X')\n }\n }\n return str\n }\n\n /**\n * Get a string representation of the matrix\n * @memberof SparseMatrix\n * @returns {string} str\n */\n SparseMatrix.prototype.toString = function () {\n return format(this.toArray())\n }\n\n /**\n * Get a JSON representation of the matrix\n * @memberof SparseMatrix\n * @returns {Object}\n */\n SparseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'SparseMatrix',\n values: this._values,\n index: this._index,\n ptr: this._ptr,\n size: this._size,\n datatype: this._datatype\n }\n }\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof SparseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix vector with the diagonal values.\n */\n SparseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) { k = k.toNumber() }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number')\n }\n } else {\n // default value\n k = 0\n }\n\n const kSuper = k > 0 ? k : 0\n const kSub = k < 0 ? -k : 0\n\n // rows & columns\n const rows = this._size[0]\n const columns = this._size[1]\n\n // number diagonal values\n const n = Math.min(rows - kSub, columns - kSuper)\n\n // diagonal arrays\n const values = []\n const index = []\n const ptr = []\n // initial ptr value\n ptr[0] = 0\n // loop columns\n for (let j = kSuper; j < columns && values.length < n; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = this._ptr[j]\n const k1 = this._ptr[j + 1]\n // loop x within [k0, k1[\n for (let x = k0; x < k1; x++) {\n // row index\n const i = this._index[x]\n // check row\n if (i === j - kSuper + kSub) {\n // value on this column\n values.push(this._values[x])\n // store row\n index[values.length - 1] = i - kSub\n // exit loop\n break\n }\n }\n }\n // close ptr\n ptr.push(values.length)\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [n, 1]\n })\n }\n\n /**\n * Generate a matrix from a JSON object\n * @memberof SparseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SparseMatrix\", \"values\": [], \"index\": [], \"ptr\": [], \"size\": []}`,\n * where mathjs is optional\n * @returns {SparseMatrix}\n */\n SparseMatrix.fromJSON = function (json) {\n return new SparseMatrix(json)\n }\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof SparseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Array | Matrix } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The Matrix datatype, values must be of this datatype.\n *\n * @returns {SparseMatrix}\n */\n SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {\n if (!isArray(size)) { throw new TypeError('Array expected, size parameter') }\n if (size.length !== 2) { throw new Error('Only two dimensions matrix are supported') }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber()\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers')\n }\n return s\n })\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) { k = k.toNumber() }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number')\n }\n } else {\n // default value\n k = 0\n }\n\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype)\n }\n\n const kSuper = k > 0 ? k : 0\n const kSub = k < 0 ? -k : 0\n\n // rows and columns\n const rows = size[0]\n const columns = size[1]\n\n // number of non-zero items\n const n = Math.min(rows - kSub, columns - kSuper)\n\n // value extraction function\n let _value\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length')\n }\n // define function\n _value = function (i) {\n // return value @ i\n return value[i]\n }\n } else if (isMatrix(value)) {\n // matrix size\n const ms = value.size()\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length')\n }\n // define function\n _value = function (i) {\n // return value @ i\n return value.get([i])\n }\n } else {\n // define function\n _value = function () {\n // return value\n return value\n }\n }\n\n // create arrays\n const values = []\n const index = []\n const ptr = []\n\n // loop items\n for (let j = 0; j < columns; j++) {\n // number of rows with value\n ptr.push(values.length)\n // diagonal index\n const i = j - kSuper\n // check we need to set diagonal value\n if (i >= 0 && i < n) {\n // get value @ i\n const v = _value(i)\n // check for zero\n if (!eq(v, zero)) {\n // column\n index.push(i + kSub)\n // add value\n values.push(v)\n }\n }\n }\n // last value should be number of values\n ptr.push(values.length)\n // create SparseMatrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [rows, columns]\n })\n }\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof SparseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n SparseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers')\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported')\n }\n // validate index\n validateIndex(i, this._size[0])\n validateIndex(j, this._size[0])\n\n // swap rows\n SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr)\n // return current instance\n return this\n }\n\n /**\n * Loop rows with data in column j.\n *\n * @param {number} j Column\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n * @param {Function} callback Callback function invoked for every row in column j\n */\n SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {\n // indeces for column j\n const k0 = ptr[j]\n const k1 = ptr[j + 1]\n\n // loop\n for (let k = k0; k < k1; k++) {\n // invoke callback\n callback(index[k], values[k])\n }\n }\n\n /**\n * Swap rows x and y in Sparse Matrix data structures.\n *\n * @param {number} x Matrix row index 1\n * @param {number} y Matrix row index 2\n * @param {number} columns Number of columns in matrix\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n */\n SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {\n // loop columns\n for (let j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = ptr[j]\n const k1 = ptr[j + 1]\n // find value index @ x\n const kx = _getValueIndex(x, k0, k1, index)\n // find value index @ x\n const ky = _getValueIndex(y, k0, k1, index)\n // check both rows exist in matrix\n if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {\n // swap values (check for pattern matrix)\n if (values) {\n const v = values[kx]\n values[kx] = values[ky]\n values[ky] = v\n }\n // next column\n continue\n }\n // check x row exist & no y row\n if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {\n // value @ x (check for pattern matrix)\n const vx = values ? values[kx] : undefined\n // insert value @ y\n index.splice(ky, 0, y)\n if (values) { values.splice(ky, 0, vx) }\n // remove value @ x (adjust array index if needed)\n index.splice(ky <= kx ? kx + 1 : kx, 1)\n if (values) { values.splice(ky <= kx ? kx + 1 : kx, 1) }\n // next column\n continue\n }\n // check y row exist & no x row\n if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {\n // value @ y (check for pattern matrix)\n const vy = values ? values[ky] : undefined\n // insert value @ x\n index.splice(kx, 0, x)\n if (values) { values.splice(kx, 0, vy) }\n // remove value @ y (adjust array index if needed)\n index.splice(kx <= ky ? ky + 1 : ky, 1)\n if (values) { values.splice(kx <= ky ? ky + 1 : ky, 1) }\n }\n }\n }\n\n return SparseMatrix\n}, { isClass: true })\n","import { factory } from '../utils/factory.js'\nimport { deepMap } from '../utils/collection.js'\n\nconst name = 'number'\nconst dependencies = ['typed']\n\n/**\n * Separates the radix, integer part, and fractional part of a non decimal number string\n * @param {string} input string to parse\n * @returns {object} the parts of the string or null if not a valid input\n */\nfunction getNonDecimalNumberParts (input) {\n const nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/)\n if (nonDecimalWithRadixMatch) {\n const radix = ({ '0b': 2, '0o': 8, '0x': 16 })[nonDecimalWithRadixMatch[1]]\n const integerPart = nonDecimalWithRadixMatch[2]\n const fractionalPart = nonDecimalWithRadixMatch[3]\n return { input, radix, integerPart, fractionalPart }\n } else {\n return null\n }\n}\n\n/**\n * Makes a number from a radix, and integer part, and a fractional part\n * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts)\n * @returns {number} the number\n */\nfunction makeNumberFromNonDecimalParts (parts) {\n const n = parseInt(parts.integerPart, parts.radix)\n let f = 0\n for (let i = 0; i < parts.fractionalPart.length; i++) {\n const digitValue = parseInt(parts.fractionalPart[i], parts.radix)\n f += digitValue / Math.pow(parts.radix, i + 1)\n }\n const result = n + f\n if (isNaN(result)) {\n throw new SyntaxError('String \"' + parts.input + '\" is not a valid number')\n }\n return result\n}\n\nexport const createNumber = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Create a number or convert a string, boolean, or unit to a number.\n * When value is a matrix, all elements will be converted to number.\n *\n * Syntax:\n *\n * math.number(value)\n * math.number(unit, valuelessUnit)\n *\n * Examples:\n *\n * math.number(2) // returns number 2\n * math.number('7.2') // returns number 7.2\n * math.number(true) // returns number 1\n * math.number([true, false, true, true]) // returns [1, 0, 1, 1]\n * math.number(math.unit('52cm'), 'm') // returns 0.52\n *\n * See also:\n *\n * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted\n * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number\n * @return {number | Array | Matrix} The created number\n */\n const number = typed('number', {\n '': function () {\n return 0\n },\n\n number: function (x) {\n return x\n },\n\n string: function (x) {\n if (x === 'NaN') return NaN\n const nonDecimalNumberParts = getNonDecimalNumberParts(x)\n if (nonDecimalNumberParts) {\n return makeNumberFromNonDecimalParts(nonDecimalNumberParts)\n }\n let size = 0\n const wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/)\n if (wordSizeSuffixMatch) {\n // x includes a size suffix like 0xffffi32, so we extract\n // the suffix and remove it from x\n size = Number(wordSizeSuffixMatch[2])\n x = wordSizeSuffixMatch[1]\n }\n let num = Number(x)\n if (isNaN(num)) {\n throw new SyntaxError('String \"' + x + '\" is not a valid number')\n }\n if (wordSizeSuffixMatch) {\n // x is a signed bin, oct, or hex literal\n // num is the value of string x if x is interpreted as unsigned\n if (num > 2 ** size - 1) {\n // literal is too large for size suffix\n throw new SyntaxError(`String \"${x}\" is out of range`)\n }\n // check if the bit at index size - 1 is set and if so do the twos complement\n if (num >= 2 ** (size - 1)) {\n num = num - 2 ** size\n }\n }\n return num\n },\n\n BigNumber: function (x) {\n return x.toNumber()\n },\n\n bigint: function (x) {\n return Number(x)\n },\n\n Fraction: function (x) {\n return x.valueOf()\n },\n\n Unit: typed.referToSelf(self => (x) => {\n const clone = x.clone()\n clone.value = self(x.value)\n return clone\n }),\n\n null: function (x) {\n return 0\n },\n\n 'Unit, string | Unit': function (unit, valuelessUnit) {\n return unit.toNumber(valuelessUnit)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"number\",\"value\":\"2.3\"}\n //\n // into a number 2.3\n number.fromJSON = function (json) {\n return parseFloat(json.value)\n }\n\n return number\n})\n","import { factory } from '../utils/factory.js'\nimport { deepMap } from '../utils/collection.js'\n\nconst name = 'bigint'\nconst dependencies = ['typed']\n\nexport const createBigint = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Create a bigint or convert a string, boolean, or unit to a bigint.\n * When value is a matrix, all elements will be converted to bigint.\n *\n * Syntax:\n *\n * math.bigint(value)\n *\n * Examples:\n *\n * math.bigint(2) // returns 2n\n * math.bigint('123') // returns 123n\n * math.bigint(true) // returns 1n\n * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]\n *\n * See also:\n *\n * number, bignumber, boolean, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted\n * @return {bigint | Array | Matrix} The created bigint\n */\n const bigint = typed('bigint', {\n '': function () {\n return 0n\n },\n\n bigint: function (x) {\n return x\n },\n\n number: function (x) {\n return BigInt(x.toFixed())\n },\n\n BigNumber: function (x) {\n return BigInt(x.round().toString())\n },\n\n Fraction: function (x) {\n return BigInt(x.valueOf().toFixed())\n },\n\n 'string | boolean': function (x) {\n return BigInt(x)\n },\n\n null: function (x) {\n return 0n\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"bigint\",\"value\":\"123\"}\n //\n // into a bigint 123n\n bigint.fromJSON = function (json) {\n return BigInt(json.value)\n }\n\n return bigint\n})\n","import { factory } from '../utils/factory.js'\nimport { deepMap } from '../utils/collection.js'\nimport { format } from '../utils/number.js'\n\nconst name = 'string'\nconst dependencies = ['typed']\n\nexport const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Create a string or convert any object into a string.\n * Elements of Arrays and Matrices are processed element wise.\n *\n * Syntax:\n *\n * math.string(value)\n *\n * Examples:\n *\n * math.string(4.2) // returns string '4.2'\n * math.string(math.complex(3, 2) // returns string '3 + 2i'\n *\n * const u = math.unit(5, 'km')\n * math.string(u.to('m')) // returns string '5000 m'\n *\n * math.string([true, false]) // returns ['true', 'false']\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, unit\n *\n * @param {* | Array | Matrix | null} [value] A value to convert to a string\n * @return {string | Array | Matrix} The created string\n */\n return typed(name, {\n '': function () {\n return ''\n },\n\n number: format,\n\n null: function (x) {\n return 'null'\n },\n\n boolean: function (x) {\n return x + ''\n },\n\n string: function (x) {\n return x\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n\n any: function (x) {\n return String(x)\n }\n })\n})\n","import { factory } from '../utils/factory.js'\nimport { deepMap } from '../utils/collection.js'\n\nconst name = 'boolean'\nconst dependencies = ['typed']\n\nexport const createBoolean = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Create a boolean or convert a string or number to a boolean.\n * In case of a number, `true` is returned for non-zero numbers, and `false` in\n * case of zero.\n * Strings can be `'true'` or `'false'`, or can contain a number.\n * When value is a matrix, all elements will be converted to boolean.\n *\n * Syntax:\n *\n * math.boolean(x)\n *\n * Examples:\n *\n * math.boolean(0) // returns false\n * math.boolean(1) // returns true\n * math.boolean(-3) // returns true\n * math.boolean('true') // returns true\n * math.boolean('false') // returns false\n * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true]\n *\n * See also:\n *\n * bignumber, complex, index, matrix, string, unit\n *\n * @param {string | number | boolean | Array | Matrix | null} value A value of any type\n * @return {boolean | Array | Matrix} The boolean value\n */\n return typed(name, {\n '': function () {\n return false\n },\n\n boolean: function (x) {\n return x\n },\n\n number: function (x) {\n return !!x\n },\n\n null: function (x) {\n return false\n },\n\n BigNumber: function (x) {\n return !x.isZero()\n },\n\n string: function (x) {\n // try case insensitive\n const lcase = x.toLowerCase()\n if (lcase === 'true') {\n return true\n } else if (lcase === 'false') {\n return false\n }\n\n // test whether value is a valid number\n const num = Number(x)\n if (x !== '' && !isNaN(num)) {\n return !!num\n }\n\n throw new Error('Cannot convert \"' + x + '\" to a boolean')\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../../utils/factory.js'\nimport { deepMap } from '../../../utils/collection.js'\n\nconst name = 'bignumber'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createBignumber = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Create a BigNumber, which can store numbers with arbitrary precision.\n * When a matrix is provided, all elements will be converted to BigNumber.\n *\n * Syntax:\n *\n * math.bignumber(x)\n *\n * Examples:\n *\n * 0.1 + 0.2 // returns number 0.30000000000000004\n * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3\n *\n *\n * 7.2e500 // returns number Infinity\n * math.bignumber('7.2e500') // returns BigNumber 7.2e500\n *\n * See also:\n *\n * number, bigint, boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number,\n * 0 by default.\n * @returns {BigNumber} The created bignumber\n */\n return typed('bignumber', {\n '': function () {\n return new BigNumber(0)\n },\n\n number: function (x) {\n // convert to string to prevent errors in case of >15 digits\n return new BigNumber(x + '')\n },\n\n string: function (x) {\n const wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/)\n if (wordSizeSuffixMatch) {\n // x has a word size suffix\n const size = wordSizeSuffixMatch[2]\n const n = BigNumber(wordSizeSuffixMatch[1])\n const twoPowSize = new BigNumber(2).pow(Number(size))\n if (n.gt(twoPowSize.sub(1))) {\n throw new SyntaxError(`String \"${x}\" is out of range`)\n }\n const twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1)\n if (n.gte(twoPowSizeSubOne)) {\n return n.sub(twoPowSize)\n } else {\n return n\n }\n }\n return new BigNumber(x)\n },\n\n BigNumber: function (x) {\n // we assume a BigNumber is immutable\n return x\n },\n\n bigint: function (x) {\n return new BigNumber(x.toString())\n },\n\n Unit: typed.referToSelf(self => (x) => {\n const clone = x.clone()\n clone.value = self(x.value)\n return clone\n }),\n\n Fraction: function (x) {\n return new BigNumber(x.n).div(x.d).times(x.s)\n },\n\n null: function (x) {\n return new BigNumber(0)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../../utils/factory.js'\nimport { deepMap } from '../../../utils/collection.js'\n\nconst name = 'complex'\nconst dependencies = ['typed', 'Complex']\n\nexport const createComplex = /* #__PURE__ */ factory(name, dependencies, ({ typed, Complex }) => {\n /**\n * Create a complex value or convert a value to a complex value.\n *\n * Syntax:\n *\n * math.complex() // creates a complex value with zero\n * // as real and imaginary part.\n * math.complex(re : number, im : string) // creates a complex value with provided\n * // values for real and imaginary part.\n * math.complex(re : number) // creates a complex value with provided\n * // real value and zero imaginary part.\n * math.complex(complex : Complex) // clones the provided complex value.\n * math.complex(arg : string) // parses a string into a complex value.\n * math.complex(array : Array) // converts the elements of the array\n * // or matrix element wise into a\n * // complex value.\n * math.complex({re: number, im: number}) // creates a complex value with provided\n * // values for real an imaginary part.\n * math.complex({r: number, phi: number}) // creates a complex value with provided\n * // polar coordinates\n *\n * Examples:\n *\n * const a = math.complex(3, -4) // a = Complex 3 - 4i\n * a.re = 5 // a = Complex 5 - 4i\n * const i = a.im // Number -4\n * const b = math.complex('2 + 6i') // Complex 2 + 6i\n * const c = math.complex() // Complex 0 + 0i\n * const d = math.add(a, b) // Complex 5 + 2i\n *\n * See also:\n *\n * bignumber, boolean, index, matrix, number, string, unit\n *\n * @param {* | Array | Matrix} [args]\n * Arguments specifying the real and imaginary part of the complex number\n * @return {Complex | Array | Matrix} Returns a complex value\n */\n return typed('complex', {\n '': function () {\n return Complex.ZERO\n },\n\n number: function (x) {\n return new Complex(x, 0)\n },\n\n 'number, number': function (re, im) {\n return new Complex(re, im)\n },\n\n // TODO: this signature should be redundant\n 'BigNumber, BigNumber': function (re, im) {\n return new Complex(re.toNumber(), im.toNumber())\n },\n\n Fraction: function (x) {\n return new Complex(x.valueOf(), 0)\n },\n\n Complex: function (x) {\n return x.clone()\n },\n\n string: function (x) {\n return Complex(x) // for example '2 + 3i'\n },\n\n null: function (x) {\n return Complex(0)\n },\n\n Object: function (x) {\n if ('re' in x && 'im' in x) {\n return new Complex(x.re, x.im)\n }\n\n if (('r' in x && 'phi' in x) || ('abs' in x && 'arg' in x)) {\n return new Complex(x)\n }\n\n throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)')\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../../utils/factory.js'\nimport { deepMap } from '../../../utils/collection.js'\n\nconst name = 'fraction'\nconst dependencies = ['typed', 'Fraction']\n\nexport const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typed, Fraction }) => {\n /**\n * Create a fraction or convert a value to a fraction.\n *\n * With one numeric argument, produces the closest rational approximation to the\n * input.\n * With two arguments, the first is the numerator and the second is the denominator,\n * and creates the corresponding fraction. Both numerator and denominator must be\n * integers.\n * With one object argument, looks for the integer numerator as the value of property\n * 'n' and the integer denominator as the value of property 'd'.\n * With a matrix argument, creates a matrix of the same shape with entries\n * converted into fractions.\n *\n * Syntax:\n * math.fraction(value)\n * math.fraction(numerator, denominator)\n * math.fraction({n: numerator, d: denominator})\n * math.fraction(matrix: Array | Matrix)\n *\n * Examples:\n *\n * math.fraction(6.283) // returns Fraction 6283/1000\n * math.fraction(1, 3) // returns Fraction 1/3\n * math.fraction('2/3') // returns Fraction 2/3\n * math.fraction({n: 2, d: 3}) // returns Fraction 2/3\n * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4]\n * math.fraction(4, 5.1) // throws Error: Parameters must be integer\n *\n * See also:\n *\n * bignumber, number, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args]\n * Arguments specifying the value, or numerator and denominator of\n * the fraction\n * @return {Fraction | Array | Matrix} Returns a fraction\n */\n return typed('fraction', {\n number: function (x) {\n if (!isFinite(x) || isNaN(x)) {\n throw new Error(x + ' cannot be represented as a fraction')\n }\n\n return new Fraction(x)\n },\n\n string: function (x) {\n return new Fraction(x)\n },\n\n 'number, number': function (numerator, denominator) {\n return new Fraction(numerator, denominator)\n },\n\n null: function (x) {\n return new Fraction(0)\n },\n\n BigNumber: function (x) {\n return new Fraction(x.toString())\n },\n\n bigint: function (x) {\n return new Fraction(x.toString())\n },\n\n Fraction: function (x) {\n return x // fractions are immutable\n },\n\n Unit: typed.referToSelf(self => (x) => {\n const clone = x.clone()\n clone.value = self(x.value)\n return clone\n }),\n\n Object: function (x) {\n return new Fraction(x)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'matrix'\nconst dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix']\n\nexport const createMatrix = /* #__PURE__ */ factory(name, dependencies, ({ typed, Matrix, DenseMatrix, SparseMatrix }) => {\n /**\n * Create a Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Supported storage formats are 'dense' and 'sparse'.\n *\n * Syntax:\n *\n * math.matrix() // creates an empty matrix using default storage format (dense).\n * math.matrix(data) // creates a matrix with initial data using default storage format (dense).\n * math.matrix('dense') // creates an empty matrix using the given storage format.\n * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format.\n * math.matrix(data, 'sparse') // creates a sparse matrix with initial data.\n * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type.\n *\n * Examples:\n *\n * let m = math.matrix([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, sparse\n *\n * @param {Array | Matrix} [data] A multi dimensional array\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function () {\n return _create([])\n },\n\n string: function (format) {\n return _create([], format)\n },\n\n 'string, string': function (format, datatype) {\n return _create([], format, datatype)\n },\n\n Array: function (data) {\n return _create(data)\n },\n\n Matrix: function (data) {\n return _create(data, data.storage())\n },\n\n 'Array | Matrix, string': _create,\n\n 'Array | Matrix, string, string': _create\n })\n\n /**\n * Create a new Matrix with given storage format\n * @param {Array} data\n * @param {string} [format]\n * @param {string} [datatype]\n * @returns {Matrix} Returns a new Matrix\n * @private\n */\n function _create (data, format, datatype) {\n // get storage format constructor\n if (format === 'dense' || format === 'default' || format === undefined) {\n return new DenseMatrix(data, datatype)\n }\n\n if (format === 'sparse') {\n return new SparseMatrix(data, datatype)\n }\n\n throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.')\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'matrixFromFunction'\nconst dependencies = ['typed', 'matrix', 'isZero']\n\nexport const createMatrixFromFunction = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, isZero }) => {\n /**\n * Create a matrix by evaluating a generating function at each index.\n * The simplest overload returns a multi-dimensional array as long as `size` is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.\n *\n * Syntax:\n *\n * math.matrixFromFunction(size, fn)\n * math.matrixFromFunction(size, fn, format)\n * math.matrixFromFunction(size, fn, format, datatype)\n * math.matrixFromFunction(size, format, fn)\n * math.matrixFromFunction(size, format, datatype, fn)\n *\n * Examples:\n *\n * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix\n * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix\n * math.matrixFromFunction([5], i => math.random()) // a random vector\n *\n * See also:\n *\n * matrix, zeros\n *\n * @param {Array | Matrix} size The size of the matrix to be created\n * @param {function} fn Callback function invoked for every entry in the matrix\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n * @return {Array | Matrix} Returns the created matrix\n */\n return typed(name, {\n 'Array | Matrix, function, string, string': function (size, fn, format, datatype) {\n return _create(size, fn, format, datatype)\n },\n 'Array | Matrix, function, string': function (size, fn, format) {\n return _create(size, fn, format)\n },\n 'Matrix, function': function (size, fn) {\n return _create(size, fn, 'dense')\n },\n 'Array, function': function (size, fn) {\n return _create(size, fn, 'dense').toArray()\n },\n 'Array | Matrix, string, function': function (size, format, fn) {\n return _create(size, fn, format)\n },\n 'Array | Matrix, string, string, function': function (size, format, datatype, fn) {\n return _create(size, fn, format, datatype)\n }\n })\n\n function _create (size, fn, format, datatype) {\n let m\n if (datatype !== undefined) {\n m = matrix(format, datatype)\n } else {\n m = matrix(format)\n }\n\n m.resize(size)\n m.forEach(function (_, index) {\n const val = fn(index)\n if (isZero(val)) return\n m.set(index, val)\n })\n\n return m\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'matrixFromRows'\nconst dependencies = ['typed', 'matrix', 'flatten', 'size']\n\nexport const createMatrixFromRows = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, flatten, size }) => {\n /**\n * Create a dense matrix from vectors as individual rows.\n * If you pass column vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromRows(...arr)\n * math.matrixFromRows(row1, row2)\n * math.matrixFromRows(row1, row2, row3)\n *\n * Examples:\n *\n * math.matrixFromRows([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromRows(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromColumns, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} rows Multiple rows\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function (arr) {\n return _createArray(arr)\n },\n '...Matrix': function (arr) {\n return matrix(_createArray(arr.map(m => m.toArray())))\n }\n\n // TODO implement this properly for SparseMatrix\n })\n\n function _createArray (arr) {\n if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.')\n const N = checkVectorTypeAndReturnLength(arr[0])\n\n const result = []\n for (const row of arr) {\n const rowLength = checkVectorTypeAndReturnLength(row)\n\n if (rowLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (rowLength | 0))\n }\n\n result.push(flatten(row))\n }\n\n return result\n }\n\n function checkVectorTypeAndReturnLength (vec) {\n const s = size(vec)\n\n if (s.length === 1) { // 1D vector\n return s[0]\n } else if (s.length === 2) { // 2D vector\n if (s[0] === 1) { // row vector\n return s[1]\n } else if (s[1] === 1) { // col vector\n return s[0]\n } else {\n throw new TypeError('At least one of the arguments is not a vector.')\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.')\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'matrixFromColumns'\nconst dependencies = ['typed', 'matrix', 'flatten', 'size']\n\nexport const createMatrixFromColumns = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, flatten, size }) => {\n /**\n * Create a dense matrix from vectors as individual columns.\n * If you pass row vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromColumns(...arr)\n * math.matrixFromColumns(col1, col2)\n * math.matrixFromColumns(col1, col2, col3)\n *\n * Examples:\n *\n * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromColumns(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromRows, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} cols Multiple columns\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function (arr) {\n return _createArray(arr)\n },\n '...Matrix': function (arr) {\n return matrix(_createArray(arr.map(m => m.toArray())))\n }\n\n // TODO implement this properly for SparseMatrix\n })\n\n function _createArray (arr) {\n if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.')\n const N = checkVectorTypeAndReturnLength(arr[0])\n\n // create an array with empty rows\n const result = []\n for (let i = 0; i < N; i++) {\n result[i] = []\n }\n\n // loop columns\n for (const col of arr) {\n const colLength = checkVectorTypeAndReturnLength(col)\n\n if (colLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (colLength | 0))\n }\n\n const f = flatten(col)\n\n // push a value to each row\n for (let i = 0; i < N; i++) {\n result[i].push(f[i])\n }\n }\n\n return result\n }\n\n function checkVectorTypeAndReturnLength (vec) {\n const s = size(vec)\n\n if (s.length === 1) { // 1D vector\n return s[0]\n } else if (s.length === 2) { // 2D vector\n if (s[0] === 1) { // row vector\n return s[1]\n } else if (s[1] === 1) { // col vector\n return s[0]\n } else {\n throw new TypeError('At least one of the arguments is not a vector.')\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.')\n }\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'splitUnit'\nconst dependencies = ['typed']\n\nexport const createSplitUnit = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Split a unit in an array of units whose sum is equal to the original unit.\n *\n * Syntax:\n *\n * math.splitUnit(unit: Unit, parts: Array.)\n *\n * Example:\n *\n * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])\n * // [ 3 feet, 3.3700787401575 inch ]\n *\n * See also:\n *\n * unit\n *\n * @param {Array} [parts] An array of strings or valueless units.\n * @return {Array} An array of units.\n */\n return typed(name, {\n 'Unit, Array': function (unit, parts) {\n return unit.splitUnit(parts)\n }\n })\n})\n","import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js'\n\nconst n1 = 'number'\nconst n2 = 'number, number'\n\nexport function absNumber (a) {\n return Math.abs(a)\n}\nabsNumber.signature = n1\n\nexport function addNumber (a, b) {\n return a + b\n}\naddNumber.signature = n2\n\nexport function subtractNumber (a, b) {\n return a - b\n}\nsubtractNumber.signature = n2\n\nexport function multiplyNumber (a, b) {\n return a * b\n}\nmultiplyNumber.signature = n2\n\nexport function divideNumber (a, b) {\n return a / b\n}\ndivideNumber.signature = n2\n\nexport function unaryMinusNumber (x) {\n return -x\n}\nunaryMinusNumber.signature = n1\n\nexport function unaryPlusNumber (x) {\n return x\n}\nunaryPlusNumber.signature = n1\n\nexport function cbrtNumber (x) {\n return cbrt(x)\n}\ncbrtNumber.signature = n1\n\nexport function cubeNumber (x) {\n return x * x * x\n}\ncubeNumber.signature = n1\n\nexport function expNumber (x) {\n return Math.exp(x)\n}\nexpNumber.signature = n1\n\nexport function expm1Number (x) {\n return expm1(x)\n}\nexpm1Number.signature = n1\n\n/**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n */\nexport function gcdNumber (a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers')\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n let r\n while (b !== 0) {\n r = a % b\n a = b\n b = r\n }\n return (a < 0) ? -a : a\n}\ngcdNumber.signature = n2\n\n/**\n * Calculate lcm for two numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the least common multiple of a and b\n */\nexport function lcmNumber (a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function lcm must be integer numbers')\n }\n\n if (a === 0 || b === 0) {\n return 0\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n let t\n const prod = a * b\n while (b !== 0) {\n t = b\n b = a % t\n a = t\n }\n return Math.abs(prod / a)\n}\nlcmNumber.signature = n2\n\n/**\n * Calculate the logarithm of a value, optionally to a given base.\n * @param {number} x\n * @param {number | null | undefined} base\n * @return {number}\n */\nexport function logNumber (x, y) {\n if (y) { return Math.log(x) / Math.log(y) }\n return Math.log(x)\n}\n\n/**\n * Calculate the 10-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log10Number (x) {\n return log10(x)\n}\nlog10Number.signature = n1\n\n/**\n * Calculate the 2-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log2Number (x) {\n return log2(x)\n}\nlog2Number.signature = n1\n\n/**\n * Calculate the natural logarithm of a `number+1`\n * @param {number} x\n * @returns {number}\n */\nexport function log1pNumber (x) {\n return log1p(x)\n}\nlog1pNumber.signature = n1\n\n/**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\nexport function modNumber (x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n return (y === 0) ? x : x - y * Math.floor(x / y)\n}\nmodNumber.signature = n2\n\n/**\n * Calculate the nth root of a, solve x^root == a\n * http://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {number} a\n * @param {number} [2] root\n * @private\n */\nexport function nthRootNumber (a, root = 2) {\n const inv = root < 0\n if (inv) {\n root = -root\n }\n\n if (root === 0) {\n throw new Error('Root must be non-zero')\n }\n if (a < 0 && (Math.abs(root) % 2 !== 1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return inv ? Infinity : 0\n }\n if (!isFinite(a)) {\n return inv ? 0 : a\n }\n\n let x = Math.pow(Math.abs(a), 1 / root)\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x\n return inv ? 1 / x : x\n\n // Very nice algorithm, but fails with nthRoot(-2, 3).\n // Newton's method has some well-known problems at times:\n // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis\n /*\n let x = 1 // Initial guess\n let xPrev = 1\n let i = 0\n const iMax = 10000\n do {\n const delta = (a / Math.pow(x, root - 1) - x) / root\n xPrev = x\n x = x + delta\n i++\n }\n while (xPrev !== x && i < iMax)\n\n if (xPrev !== x) {\n throw new Error('Function nthRoot failed to converge')\n }\n\n return inv ? 1 / x : x\n */\n}\n\nexport function signNumber (x) {\n return sign(x)\n}\nsignNumber.signature = n1\n\nexport function sqrtNumber (x) {\n return Math.sqrt(x)\n}\nsqrtNumber.signature = n1\n\nexport function squareNumber (x) {\n return x * x\n}\nsquareNumber.signature = n1\n\n/**\n * Calculate xgcd for two numbers\n * @param {number} a\n * @param {number} b\n * @return {number} result\n * @private\n */\nexport function xgcdNumber (a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n let t // used to swap two variables\n let q // quotient\n let r // remainder\n let x = 0\n let lastx = 1\n let y = 1\n let lasty = 0\n\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function xgcd must be integer numbers')\n }\n\n while (b) {\n q = Math.floor(a / b)\n r = a - q * b\n\n t = x\n x = lastx - q * x\n lastx = t\n\n t = y\n y = lasty - q * y\n lasty = t\n\n a = b\n b = r\n }\n\n let res\n if (a < 0) {\n res = [-a, -lastx, -lasty]\n } else {\n res = [a, a ? lastx : 0, lasty]\n }\n return res\n}\nxgcdNumber.signature = n2\n\n/**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number} res\n */\nexport function powNumber (x, y) {\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if ((x * x < 1 && y === Infinity) ||\n (x * x > 1 && y === -Infinity)) {\n return 0\n }\n\n return Math.pow(x, y)\n}\npowNumber.signature = n2\n\n/**\n * round a number to the given number of decimals, or to zero if decimals is\n * not provided\n * @param {number} value\n * @param {number} decimals number of decimals, between 0 and 15 (0 by default)\n * @return {number} roundedValue\n */\nexport function roundNumber (value, decimals = 0) {\n if (!isInteger(decimals) || decimals < 0 || decimals > 15) {\n throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive')\n }\n return parseFloat(toFixed(value, decimals))\n}\n\n/**\n * Calculate the norm of a number, the absolute value.\n * @param {number} x\n * @return {number}\n */\nexport function normNumber (x) {\n return Math.abs(x)\n}\nnormNumber.signature = n1\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { unaryMinusNumber } from '../../plain/number/index.js'\n\nconst name = 'unaryMinus'\nconst dependencies = ['typed']\n\nexport const createUnaryMinus = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Inverse the sign of a value, apply a unary minus operation.\n *\n * For matrices, the function is evaluated element wise. Boolean values and\n * strings will be converted to a number. For complex numbers, both real and\n * complex value are inverted.\n *\n * Syntax:\n *\n * math.unaryMinus(x)\n *\n * Examples:\n *\n * math.unaryMinus(3.5) // returns -3.5\n * math.unaryMinus(-4.2) // returns 4.2\n *\n * See also:\n *\n * add, subtract, unaryPlus\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign.\n */\n return typed(name, {\n number: unaryMinusNumber,\n\n 'Complex | BigNumber | Fraction': x => x.neg(),\n\n bigint: x => -x,\n\n Unit: typed.referToSelf(self => x => {\n const res = x.clone()\n res.value = typed.find(self, res.valueType())(x.value)\n return res\n }),\n\n // deep map collection, skip zeros since unaryMinus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n\n // TODO: add support for string\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { unaryPlusNumber } from '../../plain/number/index.js'\nimport { safeNumberType } from '../../utils/number.js'\n\nconst name = 'unaryPlus'\nconst dependencies = ['typed', 'config', 'numeric']\n\nexport const createUnaryPlus = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric }) => {\n /**\n * Unary plus operation.\n * Boolean values and strings will be converted to a number, numeric values will be returned as is.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.unaryPlus(x)\n *\n * Examples:\n *\n * math.unaryPlus(3.5) // returns 3.5\n * math.unaryPlus(1) // returns 1\n *\n * See also:\n *\n * unaryMinus, add, subtract\n *\n * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix}\n * Returns the input value when numeric, converts to a number when input is non-numeric.\n */\n return typed(name, {\n number: unaryPlusNumber,\n\n Complex: function (x) {\n return x // complex numbers are immutable\n },\n\n BigNumber: function (x) {\n return x // bignumbers are immutable\n },\n\n bigint: function (x) {\n return x\n },\n\n Fraction: function (x) {\n return x // fractions are immutable\n },\n\n Unit: function (x) {\n return x.clone()\n },\n\n // deep map collection, skip zeros since unaryPlus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n\n boolean: function (x) {\n return numeric(x ? 1 : 0, config.number)\n },\n\n string: function (x) {\n return numeric(x, safeNumberType(x, config))\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { absNumber } from '../../plain/number/index.js'\n\nconst name = 'abs'\nconst dependencies = ['typed']\n\nexport const createAbs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the absolute value of a number. For matrices, the function is\n * evaluated element wise.\n *\n * Syntax:\n *\n * math.abs(x)\n *\n * Examples:\n *\n * math.abs(3.5) // returns number 3.5\n * math.abs(-4.2) // returns number 4.2\n *\n * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]\n *\n * See also:\n *\n * sign\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * Absolute value of `x`\n */\n return typed(name, {\n number: absNumber,\n\n 'Complex | BigNumber | Fraction | Unit': x => x.abs(),\n\n bigint: x => x < 0n ? -x : x,\n\n // deep map collection, skip zeros since abs(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { arraySize } from '../../utils/array.js'\nimport { isMatrix } from '../../utils/is.js'\nimport { IndexError } from '../../error/IndexError.js'\n\nconst name = 'apply'\nconst dependencies = ['typed', 'isInteger']\n\nexport const createApply = /* #__PURE__ */ factory(name, dependencies, ({ typed, isInteger }) => {\n /**\n * Apply a function that maps an array to a scalar\n * along a given axis of a matrix or array.\n * Returns a new matrix or array with one less dimension than the input.\n *\n * Syntax:\n *\n * math.apply(A, dim, callback)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [3, 4]]\n * const sum = math.sum\n *\n * math.apply(A, 0, sum) // returns [4, 6]\n * math.apply(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * @param {Array | Matrix} array The input Matrix\n * @param {number} dim The dimension along which the callback is applied\n * @param {Function} callback The callback function that is applied. This Function\n * should take an array or 1-d matrix as an input and\n * return a number.\n * @return {Array | Matrix} res The residual matrix with the function applied over some dimension.\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber, function': function (mat, dim, callback) {\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension')\n }\n\n const size = Array.isArray(mat) ? arraySize(mat) : mat.size()\n if (dim < 0 || (dim >= size.length)) {\n throw new IndexError(dim, size.length)\n }\n\n if (isMatrix(mat)) {\n return mat.create(_apply(mat.valueOf(), dim, callback), mat.datatype())\n } else {\n return _apply(mat, dim, callback)\n }\n }\n })\n})\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _apply (mat, dim, callback) {\n let i, ret, tran\n\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n return callback(mat)\n } else {\n tran = _switch(mat)\n ret = []\n for (i = 0; i < tran.length; i++) {\n ret[i] = _apply(tran[i], dim - 1, callback)\n }\n return ret\n }\n } else {\n ret = []\n for (i = 0; i < mat.length; i++) {\n ret[i] = _apply(mat[i], dim - 1, callback)\n }\n return ret\n }\n}\n\n/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nfunction _switch (mat) {\n const I = mat.length\n const J = mat[0].length\n let i, j\n const ret = []\n for (j = 0; j < J; j++) {\n const tmp = []\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j])\n }\n ret.push(tmp)\n }\n return ret\n}\n","import { factory } from '../../utils/factory.js'\nimport { addNumber } from '../../plain/number/index.js'\n\nconst name = 'addScalar'\nconst dependencies = ['typed']\n\nexport const createAddScalar = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Add two scalar values, `x + y`.\n * This function is meant for internal use: it is used by the public function\n * `add`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y`\n * @private\n */\n return typed(name, {\n\n 'number, number': addNumber,\n\n 'Complex, Complex': function (x, y) {\n return x.add(y)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.plus(y)\n },\n\n 'bigint, bigint': function (x, y) {\n return x + y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return x.add(y)\n },\n\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value')\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value')\n }\n if (!x.equalBase(y)) throw new Error('Units do not match')\n\n const res = x.clone()\n res.value =\n typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value)\n res.fixPrefix = false\n return res\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { subtractNumber } from '../../plain/number/index.js'\n\nconst name = 'subtractScalar'\nconst dependencies = ['typed']\n\nexport const createSubtractScalar = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Subtract two scalar values, `x - y`.\n * This function is meant for internal use: it is used by the public function\n * `subtract`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y`\n * @private\n */\n return typed(name, {\n\n 'number, number': subtractNumber,\n\n 'Complex, Complex': function (x, y) {\n return x.sub(y)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.minus(y)\n },\n\n 'bigint, bigint': function (x, y) {\n return x - y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return x.sub(y)\n },\n\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value')\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value')\n }\n if (!x.equalBase(y)) throw new Error('Units do not match')\n\n const res = x.clone()\n res.value =\n typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value)\n res.fixPrefix = false\n return res\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { isBigNumber, isComplex, isFraction } from '../../utils/is.js'\nimport { cbrtNumber } from '../../plain/number/index.js'\n\nconst name = 'cbrt'\nconst dependencies = [\n 'config',\n 'typed',\n 'isNegative',\n 'unaryMinus',\n 'matrix',\n 'Complex',\n 'BigNumber',\n 'Fraction'\n]\n\nexport const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, typed, isNegative, unaryMinus, matrix, Complex, BigNumber, Fraction }) => {\n /**\n * Calculate the cubic root of a value.\n *\n * To avoid confusion with the matrix cube root, this function does not\n * apply to matrices. For a matrix, to take the cube root elementwise,\n * see the examples.\n *\n * Syntax:\n *\n * math.cbrt(x)\n * math.cbrt(x, allRoots)\n *\n * Examples:\n *\n * math.cbrt(27) // returns 3\n * math.cube(3) // returns 27\n * math.cbrt(-64) // returns -4\n * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m\n * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]\n *\n * const x = math.complex('8i')\n * math.cbrt(x) // returns Complex 1.7320508075689 + i\n * math.cbrt(x, true) // returns Matrix [\n * // 1.7320508075689 + i\n * // -1.7320508075689 + i\n * // -2i\n * // ]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the cubic root.\n * @param {boolean} [allRoots] Optional, false by default. Only applicable\n * when `x` is a number or complex number. If true, all complex\n * roots are returned, if false (default) the principal root is\n * returned.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the cubic root of `x`\n */\n return typed(name, {\n number: cbrtNumber,\n // note: signature 'number, boolean' is also supported,\n // created by typed as it knows how to convert number to Complex\n\n Complex: _cbrtComplex,\n\n 'Complex, boolean': _cbrtComplex,\n\n BigNumber: function (x) {\n return x.cbrt()\n },\n\n Unit: _cbrtUnit\n })\n\n /**\n * Calculate the cubic root for a complex number\n * @param {Complex} x\n * @param {boolean} [allRoots] If true, the function will return an array\n * with all three roots. If false or undefined,\n * the principal root is returned.\n * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x\n * @private\n */\n function _cbrtComplex (x, allRoots) {\n // https://www.wikiwand.com/en/Cube_root#/Complex_numbers\n\n const arg3 = x.arg() / 3\n const abs = x.abs()\n\n // principal root:\n const principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp())\n\n if (allRoots) {\n const all = [\n principal,\n new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()),\n new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())\n ]\n\n return (config.matrix === 'Array') ? all : matrix(all)\n } else {\n return principal\n }\n }\n\n /**\n * Calculate the cubic root for a Unit\n * @param {Unit} x\n * @return {Unit} Returns the cubic root of x\n * @private\n */\n function _cbrtUnit (x) {\n if (x.value && isComplex(x.value)) {\n let result = x.clone()\n result.value = 1.0\n result = result.pow(1.0 / 3) // Compute the units\n result.value = _cbrtComplex(x.value) // Compute the value\n return result\n } else {\n const negate = isNegative(x.value)\n if (negate) {\n x.value = unaryMinus(x.value)\n }\n\n // TODO: create a helper function for this\n let third\n if (isBigNumber(x.value)) {\n third = new BigNumber(1).div(3)\n } else if (isFraction(x.value)) {\n third = new Fraction(1, 3)\n } else {\n third = 1 / 3\n }\n\n const result = x.pow(third)\n\n if (negate) {\n result.value = unaryMinus(result.value)\n }\n\n return result\n }\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'matAlgo11xS0s'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo11xS0s = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * ┌ f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo11xS0s (s, b, callback, inverse) {\n // sparse matrix arrays\n const avalues = s._values\n const aindex = s._index\n const aptr = s._ptr\n const asize = s._size\n const adt = s._datatype\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) { throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // convert b to the same datatype\n b = typed.convert(b, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = []\n const cindex = []\n const cptr = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n // initialize ptr\n cptr[j] = cindex.length\n // values in j\n for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n const i = aindex[k]\n // invoke callback\n const v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b)\n // check value is zero\n if (!eq(v, zero)) {\n // push index & value\n cindex.push(i)\n cvalues.push(v)\n }\n }\n }\n // update ptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return s.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: dt\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'matAlgo12xSfs'\nconst dependencies = ['typed', 'DenseMatrix']\n\nexport const createMatAlgo12xSfs = /* #__PURE__ */ factory(name, dependencies, ({ typed, DenseMatrix }) => {\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked MxN times.\n *\n *\n * ┌ f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ f(0, b) ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo12xSfs (s, b, callback, inverse) {\n // sparse matrix arrays\n const avalues = s._values\n const aindex = s._index\n const aptr = s._ptr\n const asize = s._size\n const adt = s._datatype\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) { throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt\n // convert b to the same datatype\n b = typed.convert(b, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cdata = []\n\n // workspaces\n const x = []\n // marks indicating we have a value in x for a given column\n const w = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n // columns mark\n const mark = j + 1\n // values in j\n for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n const r = aindex[k]\n // update workspace\n x[r] = avalues[k]\n w[r] = mark\n }\n // loop rows\n for (let i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = []\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b)\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = inverse ? cf(b, 0) : cf(0, b)\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { clone } from '../../../utils/object.js'\n\nconst name = 'matAlgo14xDs'\nconst dependencies = ['typed']\n\nexport const createMatAlgo14xDs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, b)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij..z,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042\n */\n return function matAlgo14xDs (a, b, callback, inverse) {\n // a arrays\n const adata = a._data\n const asize = a._size\n const adt = a._datatype\n\n // datatype\n let dt\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt\n // convert b to the same datatype\n b = typed.convert(b, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // populate cdata, iterate through dimensions\n const cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : []\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: clone(asize),\n datatype: dt\n })\n }\n\n // recursive function\n function _iterate (f, level, s, n, av, bv, inverse) {\n // initialize array for this level\n const cv = []\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (let i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv)\n }\n } else {\n // iterate current level\n for (let j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse)\n }\n }\n return cv\n }\n})\n","import Decimal from 'decimal.js'\nimport { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\n\nconst name = 'ceil'\nconst dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']\n\nexport const createCeilNumber = /* #__PURE__ */ factory(\n name, ['typed', 'config', 'round'], ({ typed, config, round }) => {\n return typed(name, {\n number: function (x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x)\n } else {\n return Math.ceil(x)\n }\n },\n\n 'number, number': function (x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n)\n } else {\n let [number, exponent] = `${x}e`.split('e')\n const result = Math.ceil(Number(`${number}e${Number(exponent) + n}`));\n [number, exponent] = `${result}e`.split('e')\n return Number(`${number}e${Number(exponent) - n}`)\n }\n }\n })\n }\n)\n\nexport const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, round, matrix, equalScalar, zeros, DenseMatrix }) => {\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n const ceilNumber = createCeilNumber({ typed, config, round })\n /**\n * Round a value towards plus infinity\n * If `x` is complex, both real and imaginary part are rounded towards plus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.ceil(x)\n * math.ceil(x, n)\n *\n * Examples:\n *\n * math.ceil(3.2) // returns number 4\n * math.ceil(3.8) // returns number 4\n * math.ceil(-4.2) // returns number -4\n * math.ceil(-4.7) // returns number -4\n *\n * math.ceil(3.212, 2) // returns number 3.22\n * math.ceil(3.288, 2) // returns number 3.29\n * math.ceil(-4.212, 2) // returns number -4.21\n * math.ceil(-4.782, 2) // returns number -4.78\n *\n * const c = math.complex(3.24, -2.71)\n * math.ceil(c) // returns Complex 4 - 2i\n * math.ceil(c, 1) // returns Complex 3.3 - 2.7i\n *\n * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]\n * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7]\n *\n * See also:\n *\n * floor, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('ceil', {\n number: ceilNumber.signatures.number,\n 'number,number': ceilNumber.signatures['number,number'],\n\n Complex: function (x) {\n return x.ceil()\n },\n\n 'Complex, number': function (x, n) {\n return x.ceil(n)\n },\n\n 'Complex, BigNumber': function (x, n) {\n return x.ceil(n.toNumber())\n },\n\n BigNumber: function (x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x)\n } else {\n return x.ceil()\n }\n },\n\n 'BigNumber, BigNumber': function (x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n)\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL)\n }\n },\n\n Fraction: function (x) {\n return x.ceil()\n },\n\n 'Fraction, number': function (x, n) {\n return x.ceil(n)\n },\n\n 'Fraction, BigNumber': function (x, n) {\n return x.ceil(n.toNumber())\n },\n\n 'Array | Matrix': typed.referToSelf(self => (x) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, self, true)\n }),\n\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true)\n }),\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'number | Complex | Fraction | BigNumber, Array':\n typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf()\n }),\n\n 'number | Complex | Fraction | BigNumber, Matrix':\n typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage())\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true)\n }\n return matAlgo12xSfs(y, x, self, true)\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { cubeNumber } from '../../plain/number/index.js'\n\nconst name = 'cube'\nconst dependencies = ['typed']\n\nexport const createCube = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the cube of a value, `x * x * x`.\n * To avoid confusion with `pow(M,3)`, this function does not apply to matrices.\n * If you wish to cube every entry of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.cube(x)\n *\n * Examples:\n *\n * math.cube(2) // returns number 8\n * math.pow(2, 3) // returns number 8\n * math.cube(4) // returns number 64\n * 4 * 4 * 4 // returns number 64\n *\n * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64]\n *\n * See also:\n *\n * multiply, square, pow, cbrt\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x\n */\n return typed(name, {\n number: cubeNumber,\n\n Complex: function (x) {\n return x.mul(x).mul(x) // Is faster than pow(x, 3)\n },\n\n BigNumber: function (x) {\n return x.times(x).times(x)\n },\n\n bigint: function (x) {\n return x * x * x\n },\n\n Fraction: function (x) {\n return x.pow(3) // Is faster than mul()mul()mul()\n },\n\n Unit: function (x) {\n return x.pow(3)\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { expNumber } from '../../plain/number/index.js'\n\nconst name = 'exp'\nconst dependencies = ['typed']\n\nexport const createExp = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the exponential of a value.\n * For matrices, if you want the matrix exponential of square matrix, use\n * the `expm` function; if you want to take the exponential of each element,\n * see the examples.\n *\n * Syntax:\n *\n * math.exp(x)\n *\n * Examples:\n *\n * math.exp(2) // returns number 7.3890560989306495\n * math.pow(math.e, 2) // returns number 7.3890560989306495\n * math.log(math.exp(2)) // returns number 2\n *\n * math.map([1, 2, 3], math.exp)\n * // returns Array [\n * // 2.718281828459045,\n * // 7.3890560989306495,\n * // 20.085536923187668\n * // ]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x A number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`\n */\n return typed(name, {\n number: expNumber,\n\n Complex: function (x) {\n return x.exp()\n },\n\n BigNumber: function (x) {\n return x.exp()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { expm1Number } from '../../plain/number/index.js'\n\nconst name = 'expm1'\nconst dependencies = ['typed', 'Complex']\n\nexport const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, Complex }) => {\n /**\n * Calculate the value of subtracting 1 from the exponential value.\n * This function is more accurate than `math.exp(x)-1` when `x` is near 0\n * To avoid ambiguity with the matrix exponential `expm`, this function\n * does not operate on matrices; if you wish to apply it elementwise, see\n * the examples.\n *\n * Syntax:\n *\n * math.expm1(x)\n *\n * Examples:\n *\n * math.expm1(2) // returns number 6.38905609893065\n * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495\n * math.expm1(1e-8) // returns number 1.0000000050000001e-8\n * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9\n * math.log(math.expm1(2) + 1) // returns number 2\n *\n * math.map([1, 2, 3], math.expm1)\n * // returns Array [\n * // 1.718281828459045,\n * // 6.3890560989306495,\n * // 19.085536923187668\n * // ]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x The number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`, minus one\n */\n return typed(name, {\n number: expm1Number,\n\n Complex: function (x) {\n const r = Math.exp(x.re)\n return new Complex(\n r * Math.cos(x.im) - 1,\n r * Math.sin(x.im)\n )\n },\n\n BigNumber: function (x) {\n return x.exp().minus(1)\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\n\nconst name = 'fix'\nconst dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix']\n\nexport const createFixNumber = /* #__PURE__ */ factory(\n name, ['typed', 'ceil', 'floor'], ({ typed, ceil, floor }) => {\n return typed(name, {\n number: function (x) {\n return (x > 0) ? floor(x) : ceil(x)\n },\n\n 'number, number': function (x, n) {\n return (x > 0) ? floor(x, n) : ceil(x, n)\n }\n })\n }\n)\n\nexport const createFix = /* #__PURE__ */ factory(name, dependencies, ({ typed, Complex, matrix, ceil, floor, equalScalar, zeros, DenseMatrix }) => {\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n const fixNumber = createFixNumber({ typed, ceil, floor })\n /**\n * Round a value towards zero.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.fix(x)\n * math.fix(x,n)\n *\n * Examples:\n *\n * math.fix(3.2) // returns number 3\n * math.fix(3.8) // returns number 3\n * math.fix(-4.2) // returns number -4\n * math.fix(-4.7) // returns number -4\n *\n * math.fix(3.12, 1) // returns number 3.1\n * math.fix(3.18, 1) // returns number 3.1\n * math.fix(-4.12, 1) // returns number -4.1\n * math.fix(-4.17, 1) // returns number -4.1\n *\n * const c = math.complex(3.22, -2.78)\n * math.fix(c) // returns Complex 3 - 2i\n * math.fix(c, 1) // returns Complex 3.2 -2.7i\n *\n * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4]\n * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7]\n *\n * See also:\n *\n * ceil, floor, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('fix', {\n number: fixNumber.signatures.number,\n 'number, number | BigNumber': fixNumber.signatures['number,number'],\n\n Complex: function (x) {\n return new Complex(\n (x.re > 0) ? Math.floor(x.re) : Math.ceil(x.re),\n (x.im > 0) ? Math.floor(x.im) : Math.ceil(x.im)\n )\n },\n\n 'Complex, number': function (x, n) {\n return new Complex(\n (x.re > 0) ? floor(x.re, n) : ceil(x.re, n),\n (x.im > 0) ? floor(x.im, n) : ceil(x.im, n)\n )\n },\n\n 'Complex, BigNumber': function (x, bn) {\n const n = bn.toNumber()\n return new Complex(\n (x.re > 0) ? floor(x.re, n) : ceil(x.re, n),\n (x.im > 0) ? floor(x.im, n) : ceil(x.im, n)\n )\n },\n\n BigNumber: function (x) {\n return x.isNegative() ? ceil(x) : floor(x)\n },\n\n 'BigNumber, number | BigNumber': function (x, n) {\n return x.isNegative() ? ceil(x, n) : floor(x, n)\n },\n\n Fraction: function (x) {\n return x.s < 0 ? x.ceil() : x.floor()\n },\n\n 'Fraction, number | BigNumber': function (x, n) {\n return x.s < 0 ? ceil(x, n) : floor(x, n)\n },\n\n 'Array | Matrix': typed.referToSelf(self => (x) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, self, true)\n }),\n\n 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, i => self(i, n), true)\n }),\n\n 'number | Complex | Fraction | BigNumber, Array':\n typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf()\n }),\n\n 'number | Complex | Fraction | BigNumber, Matrix':\n typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage())\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true)\n }\n return matAlgo12xSfs(y, x, self, true)\n })\n })\n})\n","import Decimal from 'decimal.js'\nimport { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\n\nconst name = 'floor'\nconst dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']\n\nexport const createFloorNumber = /* #__PURE__ */ factory(\n name, ['typed', 'config', 'round'], ({ typed, config, round }) => {\n return typed(name, {\n number: function (x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x)\n } else {\n return Math.floor(x)\n }\n },\n\n 'number, number': function (x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n)\n } else {\n let [number, exponent] = `${x}e`.split('e')\n const result = Math.floor(Number(`${number}e${Number(exponent) + n}`));\n [number, exponent] = `${result}e`.split('e')\n return Number(`${number}e${Number(exponent) - n}`)\n }\n }\n })\n }\n)\n\nexport const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, round, matrix, equalScalar, zeros, DenseMatrix }) => {\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n const floorNumber = createFloorNumber({ typed, config, round })\n /**\n * Round a value towards minus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.floor(x)\n * math.floor(x, n)\n *\n * Examples:\n *\n * math.floor(3.2) // returns number 3\n * math.floor(3.8) // returns number 3\n * math.floor(-4.2) // returns number -5\n * math.floor(-4.7) // returns number -5\n *\n * math.floor(3.212, 2) // returns number 3.21\n * math.floor(3.288, 2) // returns number 3.28\n * math.floor(-4.212, 2) // returns number -4.22\n * math.floor(-4.782, 2) // returns number -4.79\n *\n * const c = math.complex(3.24, -2.71)\n * math.floor(c) // returns Complex 3 - 3i\n * math.floor(c, 1) // returns Complex 3.2 -2.8i\n *\n * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]\n * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8]\n *\n * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283]\n *\n * // Note that floor(array, array) currently not implemented.\n *\n * See also:\n *\n * ceil, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('floor', {\n number: floorNumber.signatures.number,\n 'number,number': floorNumber.signatures['number,number'],\n\n Complex: function (x) {\n return x.floor()\n },\n\n 'Complex, number': function (x, n) {\n return x.floor(n)\n },\n\n 'Complex, BigNumber': function (x, n) {\n return x.floor(n.toNumber())\n },\n\n BigNumber: function (x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x)\n } else {\n return x.floor()\n }\n },\n\n 'BigNumber, BigNumber': function (x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n)\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR)\n }\n },\n\n Fraction: function (x) {\n return x.floor()\n },\n\n 'Fraction, number': function (x, n) {\n return x.floor(n)\n },\n\n 'Fraction, BigNumber': function (x, n) {\n return x.floor(n.toNumber())\n },\n\n 'Array | Matrix': typed.referToSelf(self => (x) => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, self, true)\n }),\n\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true)\n }),\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'number | Complex | Fraction | BigNumber, Array':\n typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf()\n }),\n\n 'number | Complex | Fraction | BigNumber, Matrix':\n typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage())\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true)\n }\n return matAlgo12xSfs(y, x, self, true)\n })\n })\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo02xDS0'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo02xDS0 = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * ┌ f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo02xDS0 (denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n const adata = denseMatrix._data\n const asize = denseMatrix._size\n const adt = denseMatrix._datatype || denseMatrix.getDataType()\n // sparse matrix arrays\n const bvalues = sparseMatrix._values\n const bindex = sparseMatrix._index\n const bptr = sparseMatrix._ptr\n const bsize = sparseMatrix._size\n const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) { throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result (SparseMatrix)\n const cvalues = []\n const cindex = []\n const cptr = []\n\n // loop columns in b\n for (let j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // values in column j\n for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n const i = bindex[k]\n // update C(i,j)\n const cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k])\n // check for nonzero\n if (!eq(cij, zero)) {\n // push i & v\n cindex.push(i)\n cvalues.push(cij)\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return sparseMatrix.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo03xDSf'\nconst dependencies = ['typed']\n\nexport const createMatAlgo03xDSf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij).\n * Callback function invoked M*N times.\n *\n *\n * ┌ f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ f(Dij, 0) ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (C)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo03xDSf (denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n const adata = denseMatrix._data\n const asize = denseMatrix._size\n const adt = denseMatrix._datatype || denseMatrix.getDataType()\n // sparse matrix arrays\n const bvalues = sparseMatrix._values\n const bindex = sparseMatrix._index\n const bptr = sparseMatrix._ptr\n const bsize = sparseMatrix._size\n const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) { throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result (DenseMatrix)\n const cdata = []\n\n // initialize dense matrix\n for (let z = 0; z < rows; z++) {\n // initialize row\n cdata[z] = []\n }\n\n // workspace\n const x = []\n // marks indicating we have a value in x for a given column\n const w = []\n\n // loop columns in b\n for (let j = 0; j < columns; j++) {\n // column mark\n const mark = j + 1\n // values in column j\n for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n const i = bindex[k]\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k])\n w[i] = mark\n }\n // process workspace\n for (let y = 0; y < rows; y++) {\n // check we have a calculated value for current row\n if (w[y] === mark) {\n // use calculated value\n cdata[y][j] = x[y]\n } else {\n // calculate value\n cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero)\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo05xSfSf'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo05xSfSf = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * ┌ f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0\n * C(i,j) = ┤\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo05xSfSf (a, b, callback) {\n // sparse matrix arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = avalues && bvalues ? [] : undefined\n const cindex = []\n const cptr = []\n\n // workspaces\n const xa = cvalues ? [] : undefined\n const xb = cvalues ? [] : undefined\n // marks indicating we have a value in x for a given column\n const wa = []\n const wb = []\n\n // vars\n let i, j, k, k1\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // columns mark\n const mark = j + 1\n // loop values A(:,j)\n for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) {\n // row\n i = aindex[k]\n // push index\n cindex.push(i)\n // update workspace\n wa[i] = mark\n // check we need to process values\n if (xa) { xa[i] = avalues[k] }\n }\n // loop values B(:,j)\n for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) {\n // row\n i = bindex[k]\n // check row existed in A\n if (wa[i] !== mark) {\n // push index\n cindex.push(i)\n }\n // update workspace\n wb[i] = mark\n // check we need to process values\n if (xb) { xb[i] = bvalues[k] }\n }\n // check we need to process values (non pattern matrix)\n if (cvalues) {\n // initialize first index in j\n k = cptr[j]\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k]\n // marks\n const wai = wa[i]\n const wbi = wb[i]\n // check Aij or Bij are nonzero\n if (wai === mark || wbi === mark) {\n // matrix values @ i,j\n const va = wai === mark ? xa[i] : zero\n const vb = wbi === mark ? xb[i] : zero\n // Cij\n const vc = cf(va, vb)\n // check for zero\n if (!eq(vc, zero)) {\n // push value\n cvalues.push(vc)\n // increment pointer\n k++\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1)\n }\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo13xDD'\nconst dependencies = ['typed']\n\nexport const createMatAlgo13xDD = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, Bij..z)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Matrix} b The DenseMatrix instance (B)\n * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658\n */\n return function matAlgo13xDD (a, b, callback) {\n // a arrays\n const adata = a._data\n const asize = a._size\n const adt = a._datatype\n // b arrays\n const bdata = b._data\n const bsize = b._size\n const bdt = b._datatype\n // c arrays\n const csize = []\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // validate each one of the dimension sizes\n for (let s = 0; s < asize.length; s++) {\n // must match\n if (asize[s] !== bsize[s]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n // update dimension in c\n csize[s] = asize[s]\n }\n\n // datatype\n let dt\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt) {\n // datatype\n dt = adt\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // populate cdata, iterate through dimensions\n const cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : []\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: csize,\n datatype: dt\n })\n }\n\n // recursive function\n function _iterate (f, level, s, n, av, bv) {\n // initialize array for this level\n const cv = []\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (let i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = f(av[i], bv[i])\n }\n } else {\n // iterate current level\n for (let j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j])\n }\n }\n return cv\n }\n})\n","import { broadcastSizes, broadcastTo } from '../../../utils/array.js'\nimport { deepStrictEqual } from '../../../utils/object.js'\n\n/**\n* Broadcasts two matrices, and return both in an array\n* It checks if it's possible with broadcasting rules\n*\n* @param {Matrix} A First Matrix\n* @param {Matrix} B Second Matrix\n*\n* @return {Matrix[]} [ broadcastedA, broadcastedB ]\n*/\n\nexport function broadcast (A, B) {\n if (deepStrictEqual(A.size(), B.size())) {\n // If matrices have the same size return them\n return [A, B]\n }\n\n // calculate the broadcasted sizes\n const newSize = broadcastSizes(A.size(), B.size())\n\n // return the array with the two broadcasted matrices\n return [A, B].map(M => _broadcastTo(M, newSize))\n}\n\n/**\n * Broadcasts a matrix to the given size.\n *\n * @param {Matrix} M - The matrix to be broadcasted.\n * @param {number[]} size - The desired size of the broadcasted matrix.\n * @returns {Matrix} The broadcasted matrix.\n * @throws {Error} If the size parameter is not an array of numbers.\n */\nfunction _broadcastTo (M, size) {\n if (deepStrictEqual(M.size(), size)) {\n return M\n }\n return M.create(broadcastTo(M.valueOf(), size), M.datatype())\n}\n","import { factory } from '../../../utils/factory.js'\nimport { extend } from '../../../utils/object.js'\nimport { createMatAlgo13xDD } from './matAlgo13xDD.js'\nimport { createMatAlgo14xDs } from './matAlgo14xDs.js'\nimport { broadcast } from './broadcast.js'\n\nconst name = 'matrixAlgorithmSuite'\nconst dependencies = ['typed', 'matrix']\n\nexport const createMatrixAlgorithmSuite = /* #__PURE__ */ factory(\n name, dependencies, ({ typed, matrix }) => {\n const matAlgo13xDD = createMatAlgo13xDD({ typed })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n /**\n * Return a signatures object with the usual boilerplate of\n * matrix algorithms, based on a plain options object with the\n * following properties:\n * elop: function -- the elementwise operation to use, defaults to self\n * SS: function -- the algorithm to apply for two sparse matrices\n * DS: function -- the algorithm to apply for a dense and a sparse matrix\n * SD: function -- algo for a sparse and a dense; defaults to SD flipped\n * Ss: function -- the algorithm to apply for a sparse matrix and scalar\n * sS: function -- algo for scalar and sparse; defaults to Ss flipped\n * scalar: string -- typed-function type for scalars, defaults to 'any'\n *\n * If Ss is not specified, no matrix-scalar signatures are generated.\n *\n * @param {object} options\n * @return {Object} signatures\n */\n return function matrixAlgorithmSuite (options) {\n const elop = options.elop\n const SD = options.SD || options.DS\n let matrixSignatures\n if (elop) {\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop),\n 'Array, Array': (x, y) =>\n matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(),\n 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop),\n 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop)\n }\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] =\n (x, y) => options.SS(...broadcast(x, y), elop, false)\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] =\n (x, y) => options.DS(...broadcast(x, y), elop, false)\n matrixSignatures['Array, SparseMatrix'] =\n (x, y) => options.DS(...broadcast(matrix(x), y), elop, false)\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] =\n (x, y) => SD(...broadcast(y, x), elop, true)\n matrixSignatures['SparseMatrix, Array'] =\n (x, y) => SD(...broadcast(matrix(y), x), elop, true)\n }\n } else {\n // No elop, use this\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, y), self)\n }),\n 'Array, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf()\n }),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), y), self)\n }),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, matrix(y)), self)\n })\n }\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return options.SS(...broadcast(x, y), self, false)\n })\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(x, y), self, false)\n })\n matrixSignatures['Array, SparseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(matrix(x), y), self, false)\n })\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(y, x), self, true)\n })\n matrixSignatures['SparseMatrix, Array'] =\n typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(matrix(y), x), self, true)\n })\n }\n }\n\n // Now add the scalars\n const scalar = options.scalar || 'any'\n const Ds = options.Ds || options.Ss\n if (Ds) {\n if (elop) {\n matrixSignatures['DenseMatrix,' + scalar] =\n (x, y) => matAlgo14xDs(x, y, elop, false)\n matrixSignatures[scalar + ', DenseMatrix'] =\n (x, y) => matAlgo14xDs(y, x, elop, true)\n matrixSignatures['Array,' + scalar] =\n (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf()\n matrixSignatures[scalar + ', Array'] =\n (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf()\n } else {\n matrixSignatures['DenseMatrix,' + scalar] =\n typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false)\n })\n matrixSignatures[scalar + ', DenseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(y, x, self, true)\n })\n matrixSignatures['Array,' + scalar] =\n typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(x), y, self, false).valueOf()\n })\n matrixSignatures[scalar + ', Array'] =\n typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(y), x, self, true).valueOf()\n })\n }\n }\n const sS = (options.sS !== undefined) ? options.sS : options.Ss\n if (elop) {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] =\n (x, y) => options.Ss(x, y, elop, false)\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] =\n (x, y) => sS(y, x, elop, true)\n }\n } else {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] =\n typed.referToSelf(self => (x, y) => {\n return options.Ss(x, y, self, false)\n })\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] =\n typed.referToSelf(self => (x, y) => {\n return sS(y, x, self, true)\n })\n }\n }\n // Also pull in the scalar signatures if the operator is a typed function\n if (elop && elop.signatures) {\n extend(matrixSignatures, elop.signatures)\n }\n return matrixSignatures\n }\n })\n","import { factory } from '../../utils/factory.js'\nimport { createFloor } from './floor.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'mod'\nconst dependencies = [\n 'typed',\n 'config',\n 'round',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createMod = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, round, matrix, equalScalar, zeros, DenseMatrix, concat }) => {\n const floor = createFloor({ typed, config, round, matrix, equalScalar, zeros, DenseMatrix })\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Calculates the modulus, the remainder of an integer division.\n *\n * For matrices, the function is evaluated element wise.\n *\n * The modulus is defined as:\n *\n * x - y * floor(x / y)\n *\n * See https://en.wikipedia.org/wiki/Modulo_operation.\n *\n * Syntax:\n *\n * math.mod(x, y)\n *\n * Examples:\n *\n * math.mod(8, 3) // returns 2\n * math.mod(11, 2) // returns 1\n *\n * function isOdd(x) {\n * return math.mod(x, 2) != 0\n * }\n *\n * isOdd(2) // returns false\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`.\n */\n return typed(\n name,\n {\n 'number, number': _modNumber,\n\n 'BigNumber, BigNumber': function (x, y) {\n return y.isZero() ? x : x.sub(y.mul(floor(x.div(y))))\n },\n\n 'bigint, bigint': function (x, y) {\n if (y === 0n) {\n return x\n }\n\n if (x < 0) {\n const m = x % y\n return m === 0n ? m : m + y\n }\n\n return x % y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y))))\n }\n },\n matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n })\n )\n\n /**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\n function _modNumber (x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n\n // We use mathjs floor to handle errors associated with\n // precision float approximation\n return (y === 0) ? x : x - y * floor(x / y)\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo01xDSid'\nconst dependencies = ['typed']\n\nexport const createMatAlgo01xDSid = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * ┌ f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ Dij ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function algorithm1 (denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n const adata = denseMatrix._data\n const asize = denseMatrix._size\n const adt = denseMatrix._datatype || denseMatrix.getDataType()\n // sparse matrix arrays\n const bvalues = sparseMatrix._values\n const bindex = sparseMatrix._index\n const bptr = sparseMatrix._ptr\n const bsize = sparseMatrix._size\n const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) { throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // process data types\n const dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined\n // callback function\n const cf = dt ? typed.find(callback, [dt, dt]) : callback\n\n // vars\n let i, j\n\n // result (DenseMatrix)\n const cdata = []\n // initialize c\n for (i = 0; i < rows; i++) { cdata[i] = [] }\n\n // workspace\n const x = []\n // marks indicating we have a value in x for a given column\n const w = []\n\n // loop columns in b\n for (j = 0; j < columns; j++) {\n // column mark\n const mark = j + 1\n // values in column j\n for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k]\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k])\n // mark i as updated\n w[i] = mark\n }\n // loop rows\n for (i = 0; i < rows; i++) {\n // check row is in workspace\n if (w[i] === mark) {\n // c[i][j] was already calculated\n cdata[i][j] = x[i]\n } else {\n // item does not exist in S\n cdata[i][j] = adata[i][j]\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo04xSidSid'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo04xSidSid = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * └ B(i,j) ; A(i,j) === 0\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo04xSidSid (a, b, callback) {\n // sparse matrix arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = avalues && bvalues ? [] : undefined\n const cindex = []\n const cptr = []\n\n // workspace\n const xa = avalues && bvalues ? [] : undefined\n const xb = avalues && bvalues ? [] : undefined\n // marks indicating we have a value in x for a given column\n const wa = []\n const wb = []\n\n // vars\n let i, j, k, k0, k1\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // columns mark\n const mark = j + 1\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k]\n // update c\n cindex.push(i)\n // update workspace\n wa[i] = mark\n // check we need to process values\n if (xa) { xa[i] = avalues[k] }\n }\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k]\n // check row exists in A\n if (wa[i] === mark) {\n // update record in xa @ i\n if (xa) {\n // invoke callback\n const v = cf(xa[i], bvalues[k])\n // check for zero\n if (!eq(v, zero)) {\n // update workspace\n xa[i] = v\n } else {\n // remove mark (index will be removed later)\n wa[i] = null\n }\n }\n } else {\n // update c\n cindex.push(i)\n // update workspace\n wb[i] = mark\n // check we need to process values\n if (xb) { xb[i] = bvalues[k] }\n }\n }\n // check we need to process values (non pattern matrix)\n if (xa && xb) {\n // initialize first index in j\n k = cptr[j]\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k]\n // check workspace has value @ i\n if (wa[i] === mark) {\n // push value (Aij != 0 || (Aij != 0 && Bij != 0))\n cvalues[k] = xa[i]\n // increment pointer\n k++\n } else if (wb[i] === mark) {\n // push value (bij != 0)\n cvalues[k] = xb[i]\n // increment pointer\n k++\n } else {\n // remove index @ k\n cindex.splice(k, 1)\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'matAlgo10xSids'\nconst dependencies = ['typed', 'DenseMatrix']\n\nexport const createMatAlgo10xSids = /* #__PURE__ */ factory(name, dependencies, ({ typed, DenseMatrix }) => {\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * ┌ f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = ┤\n * └ b ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo10xSids (s, b, callback, inverse) {\n // sparse matrix arrays\n const avalues = s._values\n const aindex = s._index\n const aptr = s._ptr\n const asize = s._size\n const adt = s._datatype\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) { throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt\n // convert b to the same datatype\n b = typed.convert(b, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cdata = []\n\n // workspaces\n const x = []\n // marks indicating we have a value in x for a given column\n const w = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n // columns mark\n const mark = j + 1\n // values in j\n for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n const r = aindex[k]\n // update workspace\n x[r] = avalues[k]\n w[r] = mark\n }\n // loop rows\n for (let i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = []\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b)\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = b\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n })\n }\n})\n","/**\n * Create a syntax error with the message:\n * 'Wrong number of arguments in function ( provided, - expected)'\n * @param {string} fn Function name\n * @param {number} count Actual argument count\n * @param {number} min Minimum required argument count\n * @param {number} [max] Maximum required argument count\n * @extends Error\n */\nexport function ArgumentsError (fn, count, min, max) {\n if (!(this instanceof ArgumentsError)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n this.fn = fn\n this.count = count\n this.min = min\n this.max = max\n\n this.message = 'Wrong number of arguments in function ' + fn +\n ' (' + count + ' provided, ' +\n min + ((max !== undefined && max !== null) ? ('-' + max) : '') + ' expected)'\n\n this.stack = (new Error()).stack\n}\n\nArgumentsError.prototype = new Error()\nArgumentsError.prototype.constructor = Error\nArgumentsError.prototype.name = 'ArgumentsError'\nArgumentsError.prototype.isArgumentsError = true\n","import { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMod } from './mod.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { ArgumentsError } from '../../error/ArgumentsError.js'\n\nconst name = 'gcd'\nconst dependencies = [\n 'typed',\n 'config',\n 'round',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'BigNumber',\n 'DenseMatrix',\n 'concat'\n]\n\nconst gcdTypes = 'number | BigNumber | Fraction | Matrix | Array'\nconst gcdManyTypesSignature = `${gcdTypes}, ${gcdTypes}, ...${gcdTypes}`\n\nfunction is1d (array) {\n return !array.some(element => Array.isArray(element))\n}\n\nexport const createGcd = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, config, round, equalScalar, zeros, BigNumber, DenseMatrix, concat }) => {\n const mod = createMod({ typed, config, round, matrix, equalScalar, zeros, DenseMatrix, concat })\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo04xSidSid = createMatAlgo04xSidSid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Calculate the greatest common divisor for two or more values or arrays.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.gcd(a, b)\n * math.gcd(a, b, c, ...)\n *\n * Examples:\n *\n * math.gcd(8, 12) // returns 4\n * math.gcd(-4, 6) // returns 2\n * math.gcd(25, 15, -10) // returns 5\n *\n * math.gcd([8, -4], [12, 6]) // returns [4, 2]\n *\n * See also:\n *\n * lcm, xgcd\n *\n * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor\n */\n return typed(\n name,\n {\n 'number, number': _gcdNumber,\n 'BigNumber, BigNumber': _gcdBigNumber,\n 'Fraction, Fraction': (x, y) => x.gcd(y)\n },\n matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }),\n {\n [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => {\n let res = self(a, b)\n for (let i = 0; i < args.length; i++) {\n res = self(res, args[i])\n }\n return res\n }),\n Array: typed.referToSelf(self => (array) => {\n if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) {\n return self(...array[0])\n }\n if (is1d(array)) {\n return self(...array)\n }\n throw new ArgumentsError('gcd() supports only 1d matrices!')\n }),\n Matrix: typed.referToSelf(self => (matrix) => {\n return self(matrix.toArray())\n })\n }\n )\n\n /**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n * @private\n */\n function _gcdNumber (a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers')\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n let r\n while (b !== 0) {\n r = mod(a, b)\n a = b\n b = r\n }\n return (a < 0) ? -a : a\n }\n\n /**\n * Calculate gcd for BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns greatest common denominator of a and b\n * @private\n */\n function _gcdBigNumber (a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function gcd must be integer numbers')\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n const zero = new BigNumber(0)\n while (!b.isZero()) {\n const r = mod(a, b)\n a = b\n b = r\n }\n return a.lt(zero) ? a.neg() : a\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\nimport { scatter } from '../../../utils/collection.js'\n\nconst name = 'matAlgo06xS0S0'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo06xS0S0 = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices.\n *\n *\n * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = ┤\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo06xS0S0 (a, b, callback) {\n // sparse matrix arrays\n const avalues = a._values\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bvalues = b._values\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = avalues && bvalues ? [] : undefined\n const cindex = []\n const cptr = []\n\n // workspaces\n const x = cvalues ? [] : undefined\n // marks indicating we have a value in x for a given column\n const w = []\n // marks indicating value in a given row has been updated\n const u = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // columns mark\n const mark = j + 1\n // scatter the values of A(:,j) into workspace\n scatter(a, j, w, x, u, mark, cindex, cf)\n // scatter the values of B(:,j) into workspace\n scatter(b, j, w, x, u, mark, cindex, cf)\n // check we need to process values (non pattern matrix)\n if (x) {\n // initialize first index in j\n let k = cptr[j]\n // loop index in j\n while (k < cindex.length) {\n // row\n const i = cindex[k]\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[i] === mark) {\n // value @ i\n const v = x[i]\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v)\n // increment pointer\n k++\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1)\n }\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1)\n }\n }\n } else {\n // initialize first index in j\n let p = cptr[j]\n // loop index in j\n while (p < cindex.length) {\n // row\n const r = cindex[p]\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[r] !== mark) {\n // remove value @ i, do not increment pointer\n cindex.splice(p, 1)\n } else {\n // increment pointer\n p++\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { lcmNumber } from '../../plain/number/index.js'\n\nconst name = 'lcm'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'concat'\n]\n\nexport const createLcm = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo06xS0S0 = createMatAlgo06xS0S0({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n const lcmTypes = 'number | BigNumber | Fraction | Matrix | Array'\n const lcmManySignature = {}\n lcmManySignature[`${lcmTypes}, ${lcmTypes}, ...${lcmTypes}`] =\n typed.referToSelf(self => (a, b, args) => {\n let res = self(a, b)\n for (let i = 0; i < args.length; i++) {\n res = self(res, args[i])\n }\n return res\n })\n\n /**\n * Calculate the least common multiple for two or more values or arrays.\n *\n * lcm is defined as:\n *\n * lcm(a, b) = abs(a * b) / gcd(a, b)\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.lcm(a, b)\n * math.lcm(a, b, c, ...)\n *\n * Examples:\n *\n * math.lcm(4, 6) // returns 12\n * math.lcm(6, 21) // returns 42\n * math.lcm(6, 21, 5) // returns 210\n *\n * math.lcm([4, 6], [6, 21]) // returns [12, 42]\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Array | Matrix} The least common multiple\n */\n return typed(\n name, {\n 'number, number': lcmNumber,\n 'BigNumber, BigNumber': _lcmBigNumber,\n 'Fraction, Fraction': (x, y) => x.lcm(y)\n },\n matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }),\n lcmManySignature\n )\n\n /**\n * Calculate lcm for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns the least common multiple of a and b\n * @private\n */\n function _lcmBigNumber (a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function lcm must be integer numbers')\n }\n\n if (a.isZero()) {\n return a\n }\n if (b.isZero()) {\n return b\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n const prod = a.times(b)\n while (!b.isZero()) {\n const t = b\n b = a.mod(t)\n a = t\n }\n return prod.div(a).abs()\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { log10Number } from '../../plain/number/index.js'\n\nconst name = 'log10'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log10(x)\n *\n * Examples:\n *\n * math.log10(0.00001) // returns -5\n * math.log10(10000) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n * math.pow(10, 4) // returns 10000\n *\n * See also:\n *\n * exp, log, log1p, log2\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 10-base logarithm of `x`\n */\n return typed(name, {\n number: function (x) {\n if (x >= 0 || config.predictable) {\n return log10Number(x)\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log().div(Math.LN10)\n }\n },\n\n Complex: function (x) {\n return new Complex(x).log().div(Math.LN10)\n },\n\n BigNumber: function (x) {\n if (!x.isNegative() || config.predictable) {\n return x.log()\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log().div(Math.LN10)\n }\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { log2Number } from '../../plain/number/index.js'\n\nconst name = 'log2'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log2(x)\n *\n * Examples:\n *\n * math.log2(0.03125) // returns -5\n * math.log2(16) // returns 4\n * math.log2(16) / math.log2(2) // returns 4\n * math.pow(2, 4) // returns 16\n *\n * See also:\n *\n * exp, log, log1p, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 2-base logarithm of `x`\n */\n return typed(name, {\n number: function (x) {\n if (x >= 0 || config.predictable) {\n return log2Number(x)\n } else {\n // negative value -> complex value computation\n return _log2Complex(new Complex(x, 0))\n }\n },\n\n Complex: _log2Complex,\n\n BigNumber: function (x) {\n if (!x.isNegative() || config.predictable) {\n return x.log(2)\n } else {\n // downgrade to number, return Complex valued result\n return _log2Complex(new Complex(x.toNumber(), 0))\n }\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n\n /**\n * Calculate log2 for a complex value\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log2Complex (x) {\n const newX = Math.sqrt(x.re * x.re + x.im * x.im)\n return new Complex(\n (Math.log2) ? Math.log2(newX) : Math.log(newX) / Math.LN2,\n Math.atan2(x.im, x.re) / Math.LN2\n )\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { multiplyNumber } from '../../plain/number/index.js'\n\nconst name = 'multiplyScalar'\nconst dependencies = ['typed']\n\nexport const createMultiplyScalar = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Multiply two scalar values, `x * y`.\n * This function is meant for internal use: it is used by the public function\n * `multiply`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y`\n * @private\n */\n return typed('multiplyScalar', {\n\n 'number, number': multiplyNumber,\n\n 'Complex, Complex': function (x, y) {\n return x.mul(y)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.times(y)\n },\n\n 'bigint, bigint': function (x, y) {\n return x * y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return x.mul(y)\n },\n\n 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x),\n\n 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y)\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\nimport { arraySize } from '../../utils/array.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\n\nconst name = 'multiply'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'addScalar',\n 'multiplyScalar',\n 'equalScalar',\n 'dot'\n]\n\nexport const createMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, addScalar, multiplyScalar, equalScalar, dot }) => {\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n function _validateMatrixDimensions (size1, size2) {\n // check left operand dimensions\n switch (size1.length) {\n case 1:\n // check size2\n switch (size2.length) {\n case 1:\n // Vector x Vector\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length')\n }\n break\n case 2:\n // Vector x Matrix\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')')\n }\n break\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)')\n }\n break\n case 2:\n // check size2\n switch (size2.length) {\n case 1:\n // Matrix x Vector\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')')\n }\n break\n case 2:\n // Matrix x Matrix\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')')\n }\n break\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)')\n }\n break\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)')\n }\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (N)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {number} Scalar value\n */\n function _multiplyVectorVector (a, b, n) {\n // check empty vector\n if (n === 0) { throw new Error('Cannot multiply two empty vectors') }\n return dot(a, b)\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorMatrix (a, b) {\n // process storage\n if (b.storage() !== 'dense') {\n throw new Error('Support for SparseMatrix not implemented')\n }\n return _multiplyVectorDenseMatrix(a, b)\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Dense Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorDenseMatrix (a, b) {\n // a dense\n const adata = a._data\n const asize = a._size\n const adt = a._datatype || a.getDataType()\n // b dense\n const bdata = b._data\n const bsize = b._size\n const bdt = b._datatype || b.getDataType()\n // rows & columns\n const alength = asize[0]\n const bcolumns = bsize[1]\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n }\n\n // result\n const c = []\n\n // loop matrix columns\n for (let j = 0; j < bcolumns; j++) {\n // sum (do not initialize it with zero)\n let sum = mf(adata[0], bdata[0][j])\n // loop vector\n for (let i = 1; i < alength; i++) {\n // multiply & accumulate\n sum = af(sum, mf(adata[i], bdata[i][j]))\n }\n c[j] = sum\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n const _multiplyMatrixVector = typed('_multiplyMatrixVector', {\n 'DenseMatrix, any': _multiplyDenseMatrixVector,\n 'SparseMatrix, any': _multiplySparseMatrixVector\n })\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Matrix (NxC)\n *\n * @return {Matrix} Matrix (MxC)\n */\n const _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', {\n 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix,\n 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix,\n 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix,\n 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix\n })\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n function _multiplyDenseMatrixVector (a, b) {\n // a dense\n const adata = a._data\n const asize = a._size\n const adt = a._datatype || a.getDataType()\n // b dense\n const bdata = b._data\n const bdt = b._datatype || b.getDataType()\n // rows & columns\n const arows = asize[0]\n const acolumns = asize[1]\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n }\n\n // result\n const c = []\n\n // loop matrix a rows\n for (let i = 0; i < arows; i++) {\n // current row\n const row = adata[i]\n // sum (do not initialize it with zero)\n let sum = mf(row[0], bdata[0])\n // loop matrix a columns\n for (let j = 1; j < acolumns; j++) {\n // multiply & accumulate\n sum = af(sum, mf(row[j], bdata[j]))\n }\n c[i] = sum\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} DenseMatrix (MxC)\n */\n function _multiplyDenseMatrixDenseMatrix (a, b) { // getDataType()\n // a dense\n const adata = a._data\n const asize = a._size\n const adt = a._datatype || a.getDataType()\n // b dense\n const bdata = b._data\n const bsize = b._size\n const bdt = b._datatype || b.getDataType()\n // rows & columns\n const arows = asize[0]\n const acolumns = asize[1]\n const bcolumns = bsize[1]\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n }\n\n // result\n const c = []\n\n // loop matrix a rows\n for (let i = 0; i < arows; i++) {\n // current row\n const row = adata[i]\n // initialize row array\n c[i] = []\n // loop matrix b columns\n for (let j = 0; j < bcolumns; j++) {\n // sum (avoid initializing sum to zero)\n let sum = mf(row[0], bdata[0][j])\n // loop matrix a columns\n for (let x = 1; x < acolumns; x++) {\n // multiply & accumulate\n sum = af(sum, mf(row[x], bdata[x][j]))\n }\n c[i][j] = sum\n }\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplyDenseMatrixSparseMatrix (a, b) {\n // a dense\n const adata = a._data\n const asize = a._size\n const adt = a._datatype || a.getDataType()\n // b sparse\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n // validate b matrix\n if (!bvalues) { throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix') }\n // rows & columns\n const arows = asize[0]\n const bcolumns = bsize[1]\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n // equalScalar signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n }\n\n // result\n const cvalues = []\n const cindex = []\n const cptr = []\n // c matrix\n const c = b.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n\n // loop b columns\n for (let jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length\n // indeces in column jb\n const kb0 = bptr[jb]\n const kb1 = bptr[jb + 1]\n // do not process column jb if no data exists\n if (kb1 > kb0) {\n // last row mark processed\n let last = 0\n // loop a rows\n for (let i = 0; i < arows; i++) {\n // column mark\n const mark = i + 1\n // C[i, jb]\n let cij\n // values in b column j\n for (let kb = kb0; kb < kb1; kb++) {\n // row\n const ib = bindex[kb]\n // check value has been initialized\n if (last !== mark) {\n // first value in column jb\n cij = mf(adata[i][ib], bvalues[kb])\n // update mark\n last = mark\n } else {\n // accumulate value\n cij = af(cij, mf(adata[i][ib], bvalues[kb]))\n }\n }\n // check column has been processed and value != 0\n if (last === mark && !eq(cij, zero)) {\n // push row & value\n cindex.push(i)\n cvalues.push(cij)\n }\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length\n\n // return sparse matrix\n return c\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} SparseMatrix (M, 1)\n */\n function _multiplySparseMatrixVector (a, b) {\n // a sparse\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // validate a matrix\n if (!avalues) { throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix') }\n // b dense\n const bdata = b._data\n const bdt = b._datatype || b.getDataType()\n // rows & columns\n const arows = a._size[0]\n const brows = b._size[0]\n // result\n const cvalues = []\n const cindex = []\n const cptr = []\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n // equalScalar signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n }\n\n // workspace\n const x = []\n // vector with marks indicating a value x[i] exists in a given column\n const w = []\n\n // update ptr\n cptr[0] = 0\n // rows in b\n for (let ib = 0; ib < brows; ib++) {\n // b[ib]\n const vbi = bdata[ib]\n // check b[ib] != 0, avoid loops\n if (!eq(vbi, zero)) {\n // A values & index in ib column\n for (let ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n const ia = aindex[ka]\n // check value exists in current j\n if (!w[ia]) {\n // ia is new entry in j\n w[ia] = true\n // add i to pattern of C\n cindex.push(ia)\n // x(ia) = A\n x[ia] = mf(vbi, avalues[ka])\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbi, avalues[ka]))\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (let p1 = cindex.length, p = 0; p < p1; p++) {\n // row\n const ic = cindex[p]\n // copy value\n cvalues[p] = x[ic]\n }\n // update ptr\n cptr[1] = cindex.length\n\n // matrix to return\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, 1],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixDenseMatrix (a, b) {\n // a sparse\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // validate a matrix\n if (!avalues) { throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix') }\n // b dense\n const bdata = b._data\n const bdt = b._datatype || b.getDataType()\n // rows & columns\n const arows = a._size[0]\n const brows = b._size[0]\n const bcolumns = b._size[1]\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n // equalScalar signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n }\n\n // result\n const cvalues = []\n const cindex = []\n const cptr = []\n // c matrix\n const c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n\n // workspace\n const x = []\n // vector with marks indicating a value x[i] exists in a given column\n const w = []\n\n // loop b columns\n for (let jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length\n // mark in workspace for current column\n const mark = jb + 1\n // rows in jb\n for (let ib = 0; ib < brows; ib++) {\n // b[ib, jb]\n const vbij = bdata[ib][jb]\n // check b[ib, jb] != 0, avoid loops\n if (!eq(vbij, zero)) {\n // A values & index in ib column\n for (let ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n const ia = aindex[ka]\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark\n // add i to pattern of C\n cindex.push(ia)\n // x(ia) = A\n x[ia] = mf(vbij, avalues[ka])\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbij, avalues[ka]))\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (let p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n const ic = cindex[p]\n // copy value\n cvalues[p] = x[ic]\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length\n\n // return sparse matrix\n return c\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixSparseMatrix (a, b) {\n // a sparse\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // b sparse\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // rows & columns\n const arows = a._size[0]\n const bcolumns = b._size[1]\n // flag indicating both matrices (a & b) contain data\n const values = avalues && bvalues\n\n // datatype\n let dt\n // addScalar signature to use\n let af = addScalar\n // multiplyScalar signature to use\n let mf = multiplyScalar\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt])\n mf = typed.find(multiplyScalar, [dt, dt])\n }\n\n // result\n const cvalues = values ? [] : undefined\n const cindex = []\n const cptr = []\n // c matrix\n const c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n\n // workspace\n const x = values ? [] : undefined\n // vector with marks indicating a value x[i] exists in a given column\n const w = []\n // variables\n let ka, ka0, ka1, kb, kb0, kb1, ia, ib\n // loop b columns\n for (let jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length\n // mark in workspace for current column\n const mark = jb + 1\n // B values & index in j\n for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) {\n // b row\n ib = bindex[kb]\n // check we need to process values\n if (values) {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka]\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark\n // add i to pattern of C\n cindex.push(ia)\n // x(ia) = A\n x[ia] = mf(bvalues[kb], avalues[ka])\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka]))\n }\n }\n } else {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka]\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark\n // add i to pattern of C\n cindex.push(ia)\n }\n }\n }\n }\n // check we need to process matrix values (pattern matrix)\n if (values) {\n // copy values from x to column jb of c\n for (let p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n const ic = cindex[p]\n // copy value\n cvalues[p] = x[ic]\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length\n\n // return sparse matrix\n return c\n }\n\n /**\n * Multiply two or more values, `x * y`.\n * For matrices, the matrix product is calculated.\n *\n * Syntax:\n *\n * math.multiply(x, y)\n * math.multiply(x, y, z, ...)\n *\n * Examples:\n *\n * math.multiply(4, 5.2) // returns number 20.8\n * math.multiply(2, 3, 4) // returns number 24\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.multiply(a, b) // returns Complex 5 + 14i\n *\n * const c = [[1, 2], [4, 3]]\n * const d = [[1, 2, 3], [3, -4, 7]]\n * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]]\n *\n * const e = math.unit('2.1 km')\n * math.multiply(3, e) // returns Unit 6.3 km\n *\n * See also:\n *\n * divide, prod, cross, dot\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, multiplyScalar, {\n // we extend the signatures of multiplyScalar with signatures dealing with matrices\n\n 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => {\n // check dimensions\n _validateMatrixDimensions(arraySize(x), arraySize(y))\n\n // use dense matrix implementation\n const m = selfMM(matrix(x), matrix(y))\n // return array or scalar\n return isMatrix(m) ? m.valueOf() : m\n }),\n\n 'Matrix, Matrix': function (x, y) {\n // dimensions\n const xsize = x.size()\n const ysize = y.size()\n\n // check dimensions\n _validateMatrixDimensions(xsize, ysize)\n\n // process dimensions\n if (xsize.length === 1) {\n // process y dimensions\n if (ysize.length === 1) {\n // Vector * Vector\n return _multiplyVectorVector(x, y, xsize[0])\n }\n // Vector * Matrix\n return _multiplyVectorMatrix(x, y)\n }\n // process y dimensions\n if (ysize.length === 1) {\n // Matrix * Vector\n return _multiplyMatrixVector(x, y)\n }\n // Matrix * Matrix\n return _multiplyMatrixMatrix(x, y)\n },\n\n 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM =>\n (x, y) => selfMM(x, matrix(y))),\n\n 'Array, Matrix': typed.referToSelf(self => (x, y) => {\n // use Matrix * Matrix implementation\n return self(matrix(x, y.storage()), y)\n }),\n\n 'SparseMatrix, any': function (x, y) {\n return matAlgo11xS0s(x, y, multiplyScalar, false)\n },\n\n 'DenseMatrix, any': function (x, y) {\n return matAlgo14xDs(x, y, multiplyScalar, false)\n },\n\n 'any, SparseMatrix': function (x, y) {\n return matAlgo11xS0s(y, x, multiplyScalar, true)\n },\n\n 'any, DenseMatrix': function (x, y) {\n return matAlgo14xDs(y, x, multiplyScalar, true)\n },\n\n 'Array, any': function (x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf()\n },\n\n 'any, Array': function (x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf()\n },\n\n 'any, any': multiplyScalar,\n\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n let result = self(x, y)\n\n for (let i = 0; i < rest.length; i++) {\n result = self(result, rest[i])\n }\n\n return result\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { nthRootNumber } from '../../plain/number/index.js'\n\nconst name = 'nthRoot'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'BigNumber',\n 'concat'\n]\n\nexport const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, BigNumber, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo06xS0S0 = createMatAlgo06xS0S0({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Calculate the nth root of a value.\n * The principal nth root of a positive real number A, is the positive real\n * solution of the equation\n *\n * x^root = A\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nthRoot(a)\n * math.nthRoot(a, root)\n *\n * Examples:\n *\n * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9)\n * math.sqrt(9) // returns 3 (since 3^2 == 9)\n * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64)\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {number | BigNumber | Array | Matrix | Complex} a\n * Value for which to calculate the nth root\n * @param {number | BigNumber} [root=2] The root.\n * @return {number | Complex | Array | Matrix} Returns the nth root of `a`\n */\n function complexErr () {\n throw new Error(\n 'Complex number not supported in function nthRoot. Use nthRoots instead.')\n }\n\n return typed(\n name,\n {\n number: nthRootNumber,\n 'number, number': nthRootNumber,\n\n BigNumber: x => _bigNthRoot(x, new BigNumber(2)),\n 'BigNumber, BigNumber': _bigNthRoot,\n\n Complex: complexErr,\n 'Complex, number': complexErr,\n\n Array: typed.referTo('DenseMatrix,number', selfDn =>\n x => selfDn(matrix(x), 2).valueOf()),\n DenseMatrix: typed.referTo('DenseMatrix,number', selfDn =>\n x => selfDn(x, 2)),\n SparseMatrix: typed.referTo('SparseMatrix,number', selfSn =>\n x => selfSn(x, 2)),\n\n 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse + sparse\n return matAlgo06xS0S0(x, y, self)\n } else {\n // throw exception\n throw new Error('Root must be non-zero')\n }\n }),\n\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // dense + sparse\n return matAlgo01xDSid(x, y, self, false)\n } else {\n // throw exception\n throw new Error('Root must be non-zero')\n }\n }),\n\n 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS =>\n (x, y) => selfDS(matrix(x), y)),\n\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse - scalar\n return matAlgo11xS0s(y, x, self, true)\n } else {\n // throw exception\n throw new Error('Root must be non-zero')\n }\n })\n },\n matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: false\n })\n )\n\n /**\n * Calculate the nth root of a for BigNumbers, solve x^root == a\n * https://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {BigNumber} a\n * @param {BigNumber} root\n * @private\n */\n function _bigNthRoot (a, root) {\n const precision = BigNumber.precision\n const Big = BigNumber.clone({ precision: precision + 2 })\n const zero = new BigNumber(0)\n\n const one = new Big(1)\n const inv = root.isNegative()\n if (inv) {\n root = root.neg()\n }\n\n if (root.isZero()) {\n throw new Error('Root must be non-zero')\n }\n if (a.isNegative() && !root.abs().mod(2).equals(1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a.isZero()) {\n return inv ? new Big(Infinity) : 0\n }\n if (!a.isFinite()) {\n return inv ? zero : a\n }\n\n let x = a.abs().pow(one.div(root))\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a.isNeg() ? x.neg() : x\n return new BigNumber((inv ? one.div(x) : x).toPrecision(precision))\n }\n})\n\nexport const createNthRootNumber = /* #__PURE__ */ factory(name, ['typed'], ({ typed }) => {\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { signNumber } from '../../plain/number/index.js'\n\nconst name = 'sign'\nconst dependencies = ['typed', 'BigNumber', 'Fraction', 'complex']\n\nexport const createSign = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber, complex, Fraction }) => {\n /**\n * Compute the sign of a value. The sign of a value x is:\n *\n * - 1 when x > 0\n * - -1 when x < 0\n * - 0 when x == 0\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.sign(x)\n *\n * Examples:\n *\n * math.sign(3.5) // returns 1\n * math.sign(-4.2) // returns -1\n * math.sign(0) // returns 0\n *\n * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1]\n *\n * See also:\n *\n * abs\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * The sign of `x`\n */\n return typed(name, {\n number: signNumber,\n\n Complex: function (x) {\n return x.im === 0 ? complex(signNumber(x.re)) : x.sign()\n },\n\n BigNumber: function (x) {\n return new BigNumber(x.cmp(0))\n },\n\n bigint: function (x) {\n return x > 0n ? 1n : x < 0n ? -1n : 0n\n },\n\n Fraction: function (x) {\n return new Fraction(x.s, 1)\n },\n\n // deep map collection, skip zeros since sign(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n\n Unit: typed.referToSelf(self => x => {\n if (!x._isDerived() && x.units[0].unit.offset !== 0) {\n throw new TypeError('sign is ambiguous for units with offset')\n }\n return typed.find(self, x.valueType())(x.value)\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'sqrt'\nconst dependencies = ['config', 'typed', 'Complex']\n\nexport const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, typed, Complex }) => {\n /**\n * Calculate the square root of a value.\n *\n * For matrices, if you want the matrix square root of a square matrix,\n * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to\n * a matrix M, use `math.map(M, math.sqrt)`.\n *\n * Syntax:\n *\n * math.sqrt(x)\n *\n * Examples:\n *\n * math.sqrt(25) // returns 5\n * math.square(5) // returns 25\n * math.sqrt(-4) // returns Complex 2i\n *\n * See also:\n *\n * square, multiply, cube, cbrt, sqrtm\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the square root.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the square root of `x`\n */\n return typed('sqrt', {\n number: _sqrtNumber,\n\n Complex: function (x) {\n return x.sqrt()\n },\n\n BigNumber: function (x) {\n if (!x.isNegative() || config.predictable) {\n return x.sqrt()\n } else {\n // negative value -> downgrade to number to do complex value computation\n return _sqrtNumber(x.toNumber())\n }\n },\n\n Unit: function (x) {\n // Someday will work for complex units when they are implemented\n return x.pow(0.5)\n }\n\n })\n\n /**\n * Calculate sqrt for a number\n * @param {number} x\n * @returns {number | Complex} Returns the square root of x\n * @private\n */\n function _sqrtNumber (x) {\n if (isNaN(x)) {\n return NaN\n } else if (x >= 0 || config.predictable) {\n return Math.sqrt(x)\n } else {\n return new Complex(x, 0).sqrt()\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { squareNumber } from '../../plain/number/index.js'\n\nconst name = 'square'\nconst dependencies = ['typed']\n\nexport const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the square of a value, `x * x`.\n * To avoid confusion with multiplying a square matrix by itself,\n * this function does not apply to matrices. If you wish to square\n * every element of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.square(x)\n *\n * Examples:\n *\n * math.square(2) // returns number 4\n * math.square(3) // returns number 9\n * math.pow(3, 2) // returns number 9\n * math.multiply(3, 3) // returns number 9\n *\n * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16]\n *\n * See also:\n *\n * multiply, cube, sqrt, pow\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit}\n * Squared value\n */\n return typed(name, {\n number: squareNumber,\n\n Complex: function (x) {\n return x.mul(x)\n },\n\n BigNumber: function (x) {\n return x.times(x)\n },\n\n bigint: function (x) {\n return x * x\n },\n\n Fraction: function (x) {\n return x.mul(x)\n },\n\n Unit: function (x) {\n return x.pow(2)\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'subtract'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'subtractScalar',\n 'unaryMinus',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createSubtract = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, subtractScalar, unaryMinus, DenseMatrix, concat }) => {\n // TODO: split function subtract in two: subtract and subtractScalar\n\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Subtract two values, `x - y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.subtract(x, y)\n *\n * Examples:\n *\n * math.subtract(5.3, 2) // returns number 3.3\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.subtract(a, b) // returns Complex -2 + 2i\n *\n * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0]\n *\n * const c = math.unit('2.1 km')\n * const d = math.unit('500m')\n * math.subtract(c, d) // returns Unit 1.6 km\n *\n * See also:\n *\n * add\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y`\n */\n return typed(\n name,\n {\n 'any, any': subtractScalar\n },\n matrixAlgorithmSuite({\n elop: subtractScalar,\n SS: matAlgo05xSfSf,\n DS: matAlgo01xDSid,\n SD: matAlgo03xDSf,\n Ss: matAlgo12xSfs,\n sS: matAlgo10xSids\n })\n )\n})\n","import { factory } from '../../utils/factory.js'\nimport { xgcdNumber } from '../../plain/number/index.js'\n\nconst name = 'xgcd'\nconst dependencies = ['typed', 'config', 'matrix', 'BigNumber']\n\nexport const createXgcd = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, BigNumber }) => {\n /**\n * Calculate the extended greatest common divisor for two values.\n * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.\n *\n * Syntax:\n *\n * math.xgcd(a, b)\n *\n * Examples:\n *\n * math.xgcd(8, 12) // returns [4, -1, 1]\n * math.gcd(8, 12) // returns 4\n * math.xgcd(36163, 21199) // returns [1247, -7, 12]\n *\n * See also:\n *\n * gcd, lcm\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {Array} Returns an array containing 3 integers `[div, m, n]`\n * where `div = gcd(a, b)` and `a*m + b*n = div`\n */\n return typed(name, {\n 'number, number': function (a, b) {\n const res = xgcdNumber(a, b)\n\n return (config.matrix === 'Array')\n ? res\n : matrix(res)\n },\n 'BigNumber, BigNumber': _xgcdBigNumber\n // TODO: implement support for Fraction\n })\n\n /**\n * Calculate xgcd for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @return {BigNumber[]} result\n * @private\n */\n function _xgcdBigNumber (a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n let // used to swap two variables\n t\n\n let // quotient\n q\n\n let // remainder\n r\n\n const zero = new BigNumber(0)\n const one = new BigNumber(1)\n let x = zero\n let lastx = one\n let y = one\n let lasty = zero\n\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function xgcd must be integer numbers')\n }\n\n while (!b.isZero()) {\n q = a.div(b).floor()\n r = a.mod(b)\n\n t = x\n x = lastx.minus(q.times(x))\n lastx = t\n\n t = y\n y = lasty.minus(q.times(y))\n lasty = t\n\n a = b\n b = r\n }\n\n let res\n if (a.lt(zero)) {\n res = [a.neg(), lastx.neg(), lasty.neg()]\n } else {\n res = [a, !a.isZero() ? lastx : 0, lasty]\n }\n return (config.matrix === 'Array') ? res : matrix(res)\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'invmod'\nconst dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger']\n\nexport const createInvmod = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, BigNumber, xgcd, equal, smaller, mod, add, isInteger }) => {\n /**\n * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax ≣ 1 (mod b)`\n * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.\n *\n * Syntax:\n *\n * math.invmod(a, b)\n *\n * Examples:\n *\n * math.invmod(8, 12) // returns NaN\n * math.invmod(7, 13) // returns 2\n * math.invmod(15151, 15122) // returns 10429\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {number | BigNumber } Returns an integer number\n * where `invmod(a,b)*a ≣ 1 (mod b)`\n */\n return typed(name, {\n 'number, number': invmod,\n 'BigNumber, BigNumber': invmod\n })\n\n function invmod (a, b) {\n if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers')\n a = mod(a, b)\n if (equal(b, 0)) throw new Error('Divisor must be non zero')\n let res = xgcd(a, b)\n res = res.valueOf()\n let [gcd, inv] = res\n if (!equal(gcd, BigNumber(1))) return NaN\n inv = mod(inv, b)\n if (smaller(inv, BigNumber(0))) inv = add(inv, b)\n return inv\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo09xS0Sf'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo09xS0Sf = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij).\n * Callback function invoked NZA times, number of nonzero elements in A.\n *\n *\n * ┌ f(Aij, Bij) ; A(i,j) !== 0\n * C(i,j) = ┤\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo09xS0Sf (a, b, callback) {\n // sparse matrix arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = avalues && bvalues ? [] : undefined\n const cindex = []\n const cptr = []\n\n // workspaces\n const x = cvalues ? [] : undefined\n // marks indicating we have a value in x for a given column\n const w = []\n\n // vars\n let i, j, k, k0, k1\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // column mark\n const mark = j + 1\n // check we need to process values\n if (x) {\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k]\n // update workspace\n w[i] = mark\n x[i] = bvalues[k]\n }\n }\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k]\n // check we need to process values\n if (x) {\n // b value @ i,j\n const vb = w[i] === mark ? x[i] : zero\n // invoke f\n const vc = cf(avalues[k], vb)\n // check zero value\n if (!eq(vc, zero)) {\n // push index\n cindex.push(i)\n // push value\n cvalues.push(vc)\n }\n } else {\n // push index\n cindex.push(i)\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'dotMultiply'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'multiplyScalar',\n 'concat'\n]\n\nexport const createDotMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, multiplyScalar, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo09xS0Sf = createMatAlgo09xS0Sf({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Multiply two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotMultiply(x, y)\n *\n * Examples:\n *\n * math.dotMultiply(2, 4) // returns 8\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]\n * math.multiply(a, b) // returns [[52, 28], [23, 14]]\n *\n * See also:\n *\n * multiply, divide, dotDivide\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: multiplyScalar,\n SS: matAlgo09xS0Sf,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }))\n})\n","/**\n * Bitwise and for Bignumbers\n *\n * Special Cases:\n * N & n = N\n * n & 0 = 0\n * n & -1 = n\n * n & n = n\n * I & I = I\n * -I & -I = -I\n * I & -I = 0\n * I & n = n\n * I & -n = I\n * -I & n = 0\n * -I & -n = -I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` & `y`, is fully precise\n * @private\n */\nexport function bitAndBigNumber (x, y) {\n if ((x.isFinite() && !x.isInteger()) || (y.isFinite() && !y.isInteger())) {\n throw new Error('Integers expected in function bitAnd')\n }\n\n const BigNumber = x.constructor\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN)\n }\n\n if (x.isZero() || y.eq(-1) || x.eq(y)) {\n return x\n }\n if (y.isZero() || x.eq(-1)) {\n return y\n }\n\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n if (x.isNegative() === y.isNegative()) {\n return x\n }\n return new BigNumber(0)\n }\n if (!x.isFinite()) {\n if (y.isNegative()) {\n return x\n }\n if (x.isNegative()) {\n return new BigNumber(0)\n }\n return y\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return y\n }\n if (y.isNegative()) {\n return new BigNumber(0)\n }\n return x\n }\n }\n return bitwise(x, y, function (a, b) { return a & b })\n}\n\n/**\n * Bitwise not\n * @param {BigNumber} x\n * @return {BigNumber} Result of ~`x`, fully precise\n *\n */\nexport function bitNotBigNumber (x) {\n if (x.isFinite() && !x.isInteger()) {\n throw new Error('Integer expected in function bitNot')\n }\n\n const BigNumber = x.constructor\n const prevPrec = BigNumber.precision\n BigNumber.config({ precision: 1E9 })\n\n const result = x.plus(new BigNumber(1))\n result.s = -result.s || null\n\n BigNumber.config({ precision: prevPrec })\n return result\n}\n\n/**\n * Bitwise OR for BigNumbers\n *\n * Special Cases:\n * N | n = N\n * n | 0 = n\n * n | -1 = -1\n * n | n = n\n * I | I = I\n * -I | -I = -I\n * I | -n = -1\n * I | -I = -1\n * I | n = I\n * -I | n = -I\n * -I | -n = -n\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` | `y`, fully precise\n */\nexport function bitOrBigNumber (x, y) {\n if ((x.isFinite() && !x.isInteger()) || (y.isFinite() && !y.isInteger())) {\n throw new Error('Integers expected in function bitOr')\n }\n\n const BigNumber = x.constructor\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN)\n }\n\n const negOne = new BigNumber(-1)\n if (x.isZero() || y.eq(negOne) || x.eq(y)) {\n return y\n }\n if (y.isZero() || x.eq(negOne)) {\n return x\n }\n\n if (!x.isFinite() || !y.isFinite()) {\n if ((!x.isFinite() && !x.isNegative() && y.isNegative()) ||\n (x.isNegative() && !y.isNegative() && !y.isFinite())) {\n return negOne\n }\n if (x.isNegative() && y.isNegative()) {\n return x.isFinite() ? x : y\n }\n return x.isFinite() ? y : x\n }\n\n return bitwise(x, y, function (a, b) { return a | b })\n}\n\n/**\n * Applies bitwise function to numbers\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @param {function (a, b)} func\n * @return {BigNumber}\n */\nexport function bitwise (x, y, func) {\n const BigNumber = x.constructor\n\n let xBits, yBits\n const xSign = +(x.s < 0)\n const ySign = +(y.s < 0)\n if (xSign) {\n xBits = decCoefficientToBinaryString(bitNotBigNumber(x))\n for (let i = 0; i < xBits.length; ++i) {\n xBits[i] ^= 1\n }\n } else {\n xBits = decCoefficientToBinaryString(x)\n }\n if (ySign) {\n yBits = decCoefficientToBinaryString(bitNotBigNumber(y))\n for (let i = 0; i < yBits.length; ++i) {\n yBits[i] ^= 1\n }\n } else {\n yBits = decCoefficientToBinaryString(y)\n }\n\n let minBits, maxBits, minSign\n if (xBits.length <= yBits.length) {\n minBits = xBits\n maxBits = yBits\n minSign = xSign\n } else {\n minBits = yBits\n maxBits = xBits\n minSign = ySign\n }\n\n let shortLen = minBits.length\n let longLen = maxBits.length\n const expFuncVal = func(xSign, ySign) ^ 1\n let outVal = new BigNumber(expFuncVal ^ 1)\n let twoPower = new BigNumber(1)\n const two = new BigNumber(2)\n\n const prevPrec = BigNumber.precision\n BigNumber.config({ precision: 1E9 })\n\n while (shortLen > 0) {\n if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower)\n }\n twoPower = twoPower.times(two)\n }\n while (longLen > 0) {\n if (func(minSign, maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower)\n }\n twoPower = twoPower.times(two)\n }\n\n BigNumber.config({ precision: prevPrec })\n\n if (expFuncVal === 0) {\n outVal.s = -outVal.s\n }\n return outVal\n}\n\n/* Extracted from decimal.js, and edited to specialize. */\nfunction decCoefficientToBinaryString (x) {\n // Convert to string\n const a = x.d // array with digits\n let r = a[0] + ''\n\n for (let i = 1; i < a.length; ++i) {\n let s = a[i] + ''\n for (let z = 7 - s.length; z--;) {\n s = '0' + s\n }\n\n r += s\n }\n\n let j = r.length\n while (r.charAt(j) === '0') {\n j--\n }\n\n let xe = x.e\n let str = r.slice(0, j + 1 || 1)\n const strL = str.length\n if (xe > 0) {\n if (++xe > strL) {\n // Append zeros.\n xe -= strL\n while (xe--) {\n str += '0'\n }\n } else if (xe < strL) {\n str = str.slice(0, xe) + '.' + str.slice(xe)\n }\n }\n\n // Convert from base 10 (decimal) to base 2\n const arr = [0]\n for (let i = 0; i < str.length;) {\n let arrL = arr.length\n while (arrL--) {\n arr[arrL] *= 10\n }\n\n arr[0] += parseInt(str.charAt(i++)) // convert to int\n for (let j = 0; j < arr.length; ++j) {\n if (arr[j] > 1) {\n if (arr[j + 1] === null || arr[j + 1] === undefined) {\n arr[j + 1] = 0\n }\n\n arr[j + 1] += arr[j] >> 1\n arr[j] &= 1\n }\n }\n }\n\n return arr.reverse()\n}\n\n/**\n * Bitwise XOR for BigNumbers\n *\n * Special Cases:\n * N ^ n = N\n * n ^ 0 = n\n * n ^ n = 0\n * n ^ -1 = ~n\n * I ^ n = I\n * I ^ -n = -I\n * I ^ -I = -1\n * -I ^ n = -I\n * -I ^ -n = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` ^ `y`, fully precise\n *\n */\nexport function bitXor (x, y) {\n if ((x.isFinite() && !x.isInteger()) || (y.isFinite() && !y.isInteger())) {\n throw new Error('Integers expected in function bitXor')\n }\n\n const BigNumber = x.constructor\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN)\n }\n if (x.isZero()) {\n return y\n }\n if (y.isZero()) {\n return x\n }\n\n if (x.eq(y)) {\n return new BigNumber(0)\n }\n\n const negOne = new BigNumber(-1)\n if (x.eq(negOne)) {\n return bitNotBigNumber(y)\n }\n if (y.eq(negOne)) {\n return bitNotBigNumber(x)\n }\n\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n return negOne\n }\n return new BigNumber(x.isNegative() === y.isNegative()\n ? Infinity\n : -Infinity)\n }\n return bitwise(x, y, function (a, b) { return a ^ b })\n}\n\n/**\n * Bitwise left shift\n *\n * Special Cases:\n * n << -n = N\n * n << N = N\n * N << n = N\n * n << 0 = n\n * 0 << n = 0\n * I << I = N\n * I << n = I\n * n << I = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` << `y`\n *\n */\nexport function leftShiftBigNumber (x, y) {\n if ((x.isFinite() && !x.isInteger()) || (y.isFinite() && !y.isInteger())) {\n throw new Error('Integers expected in function leftShift')\n }\n\n const BigNumber = x.constructor\n if (x.isNaN() || y.isNaN() || (y.isNegative() && !y.isZero())) {\n return new BigNumber(NaN)\n }\n if (x.isZero() || y.isZero()) {\n return x\n }\n if (!x.isFinite() && !y.isFinite()) {\n return new BigNumber(NaN)\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.times(Math.pow(2, y.toNumber()) + '')\n }\n return x.times(new BigNumber(2).pow(y))\n}\n\n/*\n * Special Cases:\n * n >> -n = N\n * n >> N = N\n * N >> n = N\n * I >> I = N\n * n >> 0 = n\n * I >> n = I\n * -I >> n = -I\n * -I >> I = -I\n * n >> I = I\n * -n >> I = -1\n * 0 >> n = 0\n *\n * @param {BigNumber} value\n * @param {BigNumber} value\n * @return {BigNumber} Result of `x` >> `y`\n *\n */\nexport function rightArithShiftBigNumber (x, y) {\n if ((x.isFinite() && !x.isInteger()) || (y.isFinite() && !y.isInteger())) {\n throw new Error('Integers expected in function rightArithShift')\n }\n\n const BigNumber = x.constructor\n if (x.isNaN() || y.isNaN() || (y.isNegative() && !y.isZero())) {\n return new BigNumber(NaN)\n }\n if (x.isZero() || y.isZero()) {\n return x\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return new BigNumber(-1)\n }\n if (!x.isFinite()) {\n return new BigNumber(NaN)\n }\n return new BigNumber(0)\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.div(Math.pow(2, y.toNumber()) + '').floor()\n }\n return x.div(new BigNumber(2).pow(y)).floor()\n}\n","import { isInteger } from '../../utils/number.js'\n\nconst n1 = 'number'\nconst n2 = 'number, number'\n\nexport function bitAndNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitAnd')\n }\n\n return x & y\n}\nbitAndNumber.signature = n2\n\nexport function bitNotNumber (x) {\n if (!isInteger(x)) {\n throw new Error('Integer expected in function bitNot')\n }\n\n return ~x\n}\nbitNotNumber.signature = n1\n\nexport function bitOrNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitOr')\n }\n\n return x | y\n}\nbitOrNumber.signature = n2\n\nexport function bitXorNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitXor')\n }\n\n return x ^ y\n}\nbitXorNumber.signature = n2\n\nexport function leftShiftNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function leftShift')\n }\n\n return x << y\n}\nleftShiftNumber.signature = n2\n\nexport function rightArithShiftNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightArithShift')\n }\n\n return x >> y\n}\nrightArithShiftNumber.signature = n2\n\nexport function rightLogShiftNumber (x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightLogShift')\n }\n\n return x >>> y\n}\nrightLogShiftNumber.signature = n2\n","import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { bitAndNumber } from '../../plain/number/index.js'\n\nconst name = 'bitAnd'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'concat'\n]\n\nexport const createBitAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo06xS0S0 = createMatAlgo06xS0S0({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Bitwise AND two values, `x & y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitAnd(x, y)\n *\n * Examples:\n *\n * math.bitAnd(53, 131) // returns number 1\n *\n * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]\n *\n * See also:\n *\n * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to and\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and\n * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y`\n */\n return typed(\n name,\n {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber,\n 'bigint, bigint': (x, y) => x & y\n },\n matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n })\n )\n})\n","import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { bitNotNumber } from '../../plain/number/index.js'\n\nconst name = 'bitNot'\nconst dependencies = ['typed']\n\nexport const createBitNot = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Bitwise NOT value, `~x`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.bitNot(x)\n *\n * Examples:\n *\n * math.bitNot(1) // returns number -2\n *\n * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5]\n *\n * See also:\n *\n * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to not\n * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\n bigint: x => ~x,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { bitOrNumber } from '../../plain/number/index.js'\n\nconst name = 'bitOr'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createBitOr = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo04xSidSid = createMatAlgo04xSidSid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Bitwise OR two values, `x | y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the lowest print base.\n *\n * Syntax:\n *\n * math.bitOr(x, y)\n *\n * Examples:\n *\n * math.bitOr(1, 2) // returns number 3\n *\n * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * See also:\n *\n * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to or\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or\n * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y`\n */\n return typed(\n name,\n {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber,\n 'bigint, bigint': (x, y) => x | y\n },\n matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n })\n )\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo07xSSf'\nconst dependencies = ['typed', 'DenseMatrix']\n\nexport const createMatAlgo07xSSf = /* #__PURE__ */ factory(name, dependencies, ({ typed, DenseMatrix }) => {\n /**\n * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).\n * Callback function invoked MxN times.\n *\n * C(i,j) = f(Aij, Bij)\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo07xSSf (a, b, callback) {\n // sparse matrix arrays\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // vars\n let i, j\n\n // result arrays\n const cdata = []\n // initialize c\n for (i = 0; i < rows; i++) { cdata[i] = [] }\n\n // workspaces\n const xa = []\n const xb = []\n // marks indicating we have a value in x for a given column\n const wa = []\n const wb = []\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // columns mark\n const mark = j + 1\n // scatter the values of A(:,j) into workspace\n _scatter(a, j, wa, xa, mark)\n // scatter the values of B(:,j) into workspace\n _scatter(b, j, wb, xb, mark)\n // loop rows\n for (i = 0; i < rows; i++) {\n // matrix values @ i,j\n const va = wa[i] === mark ? xa[i] : zero\n const vb = wb[i] === mark ? xb[i] : zero\n // invoke callback\n cdata[i][j] = cf(va, vb)\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n\n function _scatter (m, j, w, x, mark) {\n // a arrays\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n // loop values in column j\n for (let k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) {\n // row\n const i = index[k]\n // update workspace\n w[i] = mark\n x[i] = values[k]\n }\n }\n})\n","import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { bitXorNumber } from '../../plain/number/index.js'\n\nconst name = 'bitXor'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createBitXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Bitwise XOR two values, `x ^ y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitXor(x, y)\n *\n * Examples:\n *\n * math.bitXor(1, 2) // returns number 3\n *\n * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y`\n */\n return typed(\n name,\n {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor,\n 'bigint, bigint': (x, y) => x ^ y\n },\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\n\nconst name = 'arg'\nconst dependencies = ['typed']\n\nexport const createArg = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the argument of a complex value.\n * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.arg(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 2)\n * math.arg(a) / math.pi // returns number 0.25\n *\n * const b = math.complex('2 + 3i')\n * math.arg(b) // returns number 0.982793723247329\n * math.atan2(3, 2) // returns number 0.982793723247329\n *\n * See also:\n *\n * re, im, conj, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The argument of x\n */\n return typed(name, {\n number: function (x) {\n return Math.atan2(0, x)\n },\n\n BigNumber: function (x) {\n return x.constructor.atan2(0, x)\n },\n\n Complex: function (x) {\n return x.arg()\n },\n\n // TODO: implement BigNumber support for function arg\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\n\nconst name = 'conj'\nconst dependencies = ['typed']\n\nexport const createConj = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the complex conjugate of a complex value.\n * If `x = a+bi`, the complex conjugate of `x` is `a - bi`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.conj(x)\n *\n * Examples:\n *\n * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i\n * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i\n * math.conj(math.complex('-5.2i')) // returns Complex 5.2i\n *\n * See also:\n *\n * re, im, arg, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\n\nconst name = 'im'\nconst dependencies = ['typed']\n\nexport const createIm = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Get the imaginary part of a complex number.\n * For a complex number `a + bi`, the function returns `b`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.im(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number -5.2\n * math.re(math.complex(2.4)) // returns number 0\n *\n * See also:\n *\n * re, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The imaginary part of x\n */\n return typed(name, {\n number: () => 0,\n 'BigNumber | Fraction': x => x.mul(0),\n Complex: x => x.im,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\n\nconst name = 're'\nconst dependencies = ['typed']\n\nexport const createRe = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Get the real part of a complex number.\n * For a complex number `a + bi`, the function returns `a`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.re(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number 0\n * math.re(math.complex(2.4)) // returns number 2.4\n *\n * See also:\n *\n * im, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The real part of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.re,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","const n1 = 'number'\nconst n2 = 'number, number'\n\nexport function notNumber (x) {\n return !x\n}\nnotNumber.signature = n1\n\nexport function orNumber (x, y) {\n return !!(x || y)\n}\norNumber.signature = n2\n\nexport function xorNumber (x, y) {\n return !!x !== !!y\n}\nxorNumber.signature = n2\n\nexport function andNumber (x, y) {\n return !!(x && y)\n}\nandNumber.signature = n2\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { notNumber } from '../../plain/number/index.js'\n\nconst name = 'not'\nconst dependencies = ['typed']\n\nexport const createNot = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Logical `not`. Flips boolean value of a given parameter.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.not(x)\n *\n * Examples:\n *\n * math.not(2) // returns false\n * math.not(0) // returns true\n * math.not(true) // returns false\n *\n * a = [2, -7, 0]\n * math.not(a) // returns [false, false, true]\n *\n * See also:\n *\n * and, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @return {boolean | Array | Matrix}\n * Returns true when input is a zero or empty value.\n */\n return typed(name, {\n 'null | undefined': () => true,\n\n number: notNumber,\n\n Complex: function (x) {\n return x.re === 0 && x.im === 0\n },\n\n BigNumber: function (x) {\n return x.isZero() || x.isNaN()\n },\n\n bigint: x => !x,\n\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { orNumber } from '../../plain/number/index.js'\n\nconst name = 'or'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createOr = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.or(x, y)\n *\n * Examples:\n *\n * math.or(2, 4) // returns true\n *\n * a = [2, 5, 0]\n * b = [0, 22, 0]\n * c = 0\n *\n * math.or(a, b) // returns [true, true, false]\n * math.or(b, c) // returns [false, true, false]\n *\n * See also:\n *\n * and, not, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one of the inputs is defined with a nonzero/nonempty value.\n */\n return typed(\n name,\n {\n 'number, number': orNumber,\n\n 'Complex, Complex': function (x, y) {\n return (x.re !== 0 || x.im !== 0) || (y.re !== 0 || y.im !== 0)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return (!x.isZero() && !x.isNaN()) || (!y.isZero() && !y.isNaN())\n },\n\n 'bigint, bigint': orNumber,\n\n 'Unit, Unit': typed.referToSelf(self =>\n (x, y) => self(x.value || 0, y.value || 0))\n },\n matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n","import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { xorNumber } from '../../plain/number/index.js'\n\nconst name = 'xor'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.xor(x, y)\n *\n * Examples:\n *\n * math.xor(2, 4) // returns false\n *\n * a = [2, 0, 0]\n * b = [2, 7, 0]\n * c = 0\n *\n * math.xor(a, b) // returns [false, true, false]\n * math.xor(a, c) // returns [true, false, false]\n *\n * See also:\n *\n * and, not, or\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one and only one input is defined with a nonzero/nonempty value.\n */\n return typed(\n name,\n {\n 'number, number': xorNumber,\n\n 'Complex, Complex': function (x, y) {\n return ((x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0))\n },\n\n 'bigint, bigint': xorNumber,\n\n 'BigNumber, BigNumber': function (x, y) {\n return ((!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN()))\n },\n\n 'Unit, Unit': typed.referToSelf(self =>\n (x, y) => self(x.value || 0, y.value || 0))\n },\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n","import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { arraySize, concat as _concat } from '../../utils/array.js'\nimport { IndexError } from '../../error/IndexError.js'\nimport { DimensionError } from '../../error/DimensionError.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'concat'\nconst dependencies = ['typed', 'matrix', 'isInteger']\n\nexport const createConcat = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, isInteger }) => {\n /**\n * Concatenate two or more matrices.\n *\n * Syntax:\n *\n * math.concat(A, B, C, ...)\n * math.concat(A, B, C, ..., dim)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n * By default the last dimension of the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [5, 6]]\n * const B = [[3, 4], [7, 8]]\n *\n * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]]\n * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]]\n * math.concat('hello', ' ', 'world') // returns 'hello world'\n *\n * See also:\n *\n * size, squeeze, subset, transpose\n *\n * @param {... Array | Matrix} args Two or more matrices\n * @return {Array | Matrix} Concatenated matrix\n */\n return typed(name, {\n // TODO: change signature to '...Array | Matrix, dim?' when supported\n '...Array | Matrix | number | BigNumber': function (args) {\n let i\n const len = args.length\n let dim = -1 // zero-based dimension\n let prevDim\n let asMatrix = false\n const matrices = [] // contains multi dimensional arrays\n\n for (i = 0; i < len; i++) {\n const arg = args[i]\n\n // test whether we need to return a Matrix (if not we return an Array)\n if (isMatrix(arg)) {\n asMatrix = true\n }\n\n if (isNumber(arg) || isBigNumber(arg)) {\n if (i !== len - 1) {\n throw new Error('Dimension must be specified as last argument')\n }\n\n // last argument contains the dimension on which to concatenate\n prevDim = dim\n dim = arg.valueOf() // change BigNumber to number\n\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension')\n }\n\n if (dim < 0 || (i > 0 && dim > prevDim)) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, prevDim + 1)\n }\n } else {\n // this is a matrix or array\n const m = clone(arg).valueOf()\n const size = arraySize(m)\n matrices[i] = m\n prevDim = dim\n dim = size.length - 1\n\n // verify whether each of the matrices has the same number of dimensions\n if (i > 0 && dim !== prevDim) {\n throw new DimensionError(prevDim + 1, dim + 1)\n }\n }\n }\n\n if (matrices.length === 0) {\n throw new SyntaxError('At least one matrix expected')\n }\n\n let res = matrices.shift()\n while (matrices.length) {\n res = _concat(res, matrices.shift(), dim)\n }\n\n return asMatrix ? matrix(res) : res\n },\n\n '...string': function (args) {\n return args.join('')\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { validateIndex } from '../../utils/array.js'\n\nconst name = 'column'\nconst dependencies = ['typed', 'Index', 'matrix', 'range']\n\nexport const createColumn = /* #__PURE__ */ factory(name, dependencies, ({ typed, Index, matrix, range }) => {\n /**\n * Return a column from a Matrix.\n *\n * Syntax:\n *\n * math.column(value, index)\n *\n * Example:\n *\n * // get a column\n * const d = [[1, 2], [3, 4]]\n * math.column(d, 1) // returns [[2], [4]]\n *\n * See also:\n *\n * row\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} column The index of the column\n * @return {Array | Matrix} The retrieved column\n */\n return typed(name, {\n 'Matrix, number': _column,\n\n 'Array, number': function (value, column) {\n return _column(matrix(clone(value)), column).valueOf()\n }\n })\n\n /**\n * Retrieve a column of a matrix\n * @param {Matrix } value A matrix\n * @param {number} column The index of the column\n * @return {Matrix} The retrieved column\n */\n function _column (value, column) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported')\n }\n\n validateIndex(column, value.size()[1])\n\n const rowRange = range(0, value.size()[0])\n const index = new Index(rowRange, column)\n const result = value.subset(index)\n return isMatrix(result)\n ? result\n : matrix([[result]])\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'count'\nconst dependencies = ['typed', 'size', 'prod']\n\nexport const createCount = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, prod }) => {\n /**\n * Count the number of elements of a matrix, array or string.\n *\n * Syntax:\n *\n * math.count(x)\n *\n * Examples:\n *\n * math.count('hello world') // returns 11\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.count(A) // returns 6\n * math.count(math.range(1,6)) // returns 5\n *\n * See also:\n *\n * size\n *\n * @param {string | Array | Matrix} x A matrix or string\n * @return {number} An integer with the elements in `x`.\n */\n return typed(name, {\n string: function (x) {\n return x.length\n },\n\n 'Matrix | Array': function (x) {\n return prod(size(x))\n }\n })\n})\n","import { arraySize, squeeze } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'cross'\nconst dependencies = ['typed', 'matrix', 'subtract', 'multiply']\n\nexport const createCross = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtract, multiply }) => {\n /**\n * Calculate the cross product for two vectors in three dimensional space.\n * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined\n * as:\n *\n * cross(A, B) = [\n * a2 * b3 - a3 * b2,\n * a3 * b1 - a1 * b3,\n * a1 * b2 - a2 * b1\n * ]\n *\n * If one of the input vectors has a dimension greater than 1, the output\n * vector will be a 1x3 (2-dimensional) matrix.\n *\n * Syntax:\n *\n * math.cross(x, y)\n *\n * Examples:\n *\n * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]\n * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]\n * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]\n * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]\n *\n * See also:\n *\n * dot, multiply\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the cross product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function (x, y) {\n return matrix(_cross(x.toArray(), y.toArray()))\n },\n\n 'Matrix, Array': function (x, y) {\n return matrix(_cross(x.toArray(), y))\n },\n\n 'Array, Matrix': function (x, y) {\n return matrix(_cross(x, y.toArray()))\n },\n\n 'Array, Array': _cross\n })\n\n /**\n * Calculate the cross product for two arrays\n * @param {Array} x First vector\n * @param {Array} y Second vector\n * @returns {Array} Returns the cross product of x and y\n * @private\n */\n function _cross (x, y) {\n const highestDimension = Math.max(arraySize(x).length, arraySize(y).length)\n\n x = squeeze(x)\n y = squeeze(y)\n\n const xSize = arraySize(x)\n const ySize = arraySize(y)\n\n if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {\n throw new RangeError('Vectors with length 3 expected ' +\n '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])')\n }\n\n const product = [\n subtract(multiply(x[1], y[2]), multiply(x[2], y[1])),\n subtract(multiply(x[2], y[0]), multiply(x[0], y[2])),\n subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))\n ]\n\n if (highestDimension > 1) {\n return [product]\n } else {\n return product\n }\n }\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { arraySize } from '../../utils/array.js'\nimport { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'diag'\nconst dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix']\n\nexport const createDiag = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, DenseMatrix, SparseMatrix }) => {\n /**\n * Create a diagonal matrix or retrieve the diagonal of a matrix\n *\n * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned.\n * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector.\n * When k is positive, the values are placed on the super diagonal.\n * When k is negative, the values are placed on the sub diagonal.\n *\n * Syntax:\n *\n * math.diag(X)\n * math.diag(X, format)\n * math.diag(X, k)\n * math.diag(X, k, format)\n *\n * Examples:\n *\n * // create a diagonal matrix\n * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]]\n * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]]\n * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]]\n *\n * // retrieve the diagonal from a matrix\n * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n * math.diag(a) // returns [1, 5, 9]\n *\n * See also:\n *\n * ones, zeros, identity\n *\n * @param {Matrix | Array} x A two dimensional matrix or a vector\n * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled\n * in or retrieved.\n * @param {string} [format='dense'] The matrix storage format.\n *\n * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix.\n */\n return typed(name, {\n // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments\n\n Array: function (x) {\n return _diag(x, 0, arraySize(x), null)\n },\n\n 'Array, number': function (x, k) {\n return _diag(x, k, arraySize(x), null)\n },\n\n 'Array, BigNumber': function (x, k) {\n return _diag(x, k.toNumber(), arraySize(x), null)\n },\n\n 'Array, string': function (x, format) {\n return _diag(x, 0, arraySize(x), format)\n },\n\n 'Array, number, string': function (x, k, format) {\n return _diag(x, k, arraySize(x), format)\n },\n\n 'Array, BigNumber, string': function (x, k, format) {\n return _diag(x, k.toNumber(), arraySize(x), format)\n },\n\n Matrix: function (x) {\n return _diag(x, 0, x.size(), x.storage())\n },\n\n 'Matrix, number': function (x, k) {\n return _diag(x, k, x.size(), x.storage())\n },\n\n 'Matrix, BigNumber': function (x, k) {\n return _diag(x, k.toNumber(), x.size(), x.storage())\n },\n\n 'Matrix, string': function (x, format) {\n return _diag(x, 0, x.size(), format)\n },\n\n 'Matrix, number, string': function (x, k, format) {\n return _diag(x, k, x.size(), format)\n },\n\n 'Matrix, BigNumber, string': function (x, k, format) {\n return _diag(x, k.toNumber(), x.size(), format)\n }\n })\n\n /**\n * Creeate diagonal matrix from a vector or vice versa\n * @param {Array | Matrix} x\n * @param {number} k\n * @param {string} format Storage format for matrix. If null,\n * an Array is returned\n * @returns {Array | Matrix}\n * @private\n */\n function _diag (x, k, size, format) {\n if (!isInteger(k)) {\n throw new TypeError('Second parameter in function diag must be an integer')\n }\n\n const kSuper = k > 0 ? k : 0\n const kSub = k < 0 ? -k : 0\n\n // check dimensions\n switch (size.length) {\n case 1:\n return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper)\n case 2:\n return _getDiagonal(x, k, format, size, kSub, kSuper)\n }\n throw new RangeError('Matrix for function diag must be 2 dimensional')\n }\n\n function _createDiagonalMatrix (x, k, format, l, kSub, kSuper) {\n // matrix size\n const ms = [l + kSub, l + kSuper]\n\n if (format && format !== 'sparse' && format !== 'dense') {\n throw new TypeError(`Unknown matrix type ${format}\"`)\n }\n\n // create diagonal matrix\n const m = format === 'sparse'\n ? SparseMatrix.diagonal(ms, x, k)\n : DenseMatrix.diagonal(ms, x, k)\n // check we need to return a matrix\n return format !== null ? m : m.valueOf()\n }\n\n function _getDiagonal (x, k, format, s, kSub, kSuper) {\n // check x is a Matrix\n if (isMatrix(x)) {\n // get diagonal matrix\n const dm = x.diagonal(k)\n // check we need to return a matrix\n if (format !== null) {\n // check we need to change matrix format\n if (format !== dm.storage()) { return matrix(dm, format) }\n return dm\n }\n return dm.valueOf()\n }\n // vector size\n const n = Math.min(s[0] - kSub, s[1] - kSuper)\n // diagonal values\n const vector = []\n // loop diagonal\n for (let i = 0; i < n; i++) {\n vector[i] = x[i + kSub][i + kSuper]\n }\n // check we need to return a matrix\n return format !== null ? matrix(vector) : vector\n }\n})\n","import { optimizeCallback } from '../../utils/optimizeCallback.js'\nimport { filter, filterRegExp } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'filter'\nconst dependencies = ['typed']\n\nexport const createFilter = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Filter the items in an array or one dimensional matrix.\n *\n * Syntax:\n *\n * math.filter(x, test)\n *\n * Examples:\n *\n * function isPositive (x) {\n * return x > 0\n * }\n * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3]\n *\n * math.filter([\"23\", \"foo\", \"100\", \"55\", \"bar\"], /[0-9]+/) // returns [\"23\", \"100\", \"55\"]\n *\n * See also:\n *\n * forEach, map, sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to filter\n * @param {Function | RegExp} test\n * A function or regular expression to test items.\n * All entries for which `test` returns true are returned.\n * When `test` is a function, it is invoked with three parameters:\n * the value of the element, the index of the element, and the\n * matrix/array being traversed. The function must return a boolean.\n * @return {Matrix | Array} Returns the filtered matrix.\n */\n return typed('filter', {\n 'Array, function': _filterCallback,\n\n 'Matrix, function': function (x, test) {\n return x.create(_filterCallback(x.valueOf(), test), x.datatype())\n },\n\n 'Array, RegExp': filterRegExp,\n\n 'Matrix, RegExp': function (x, test) {\n return x.create(filterRegExp(x.valueOf(), test), x.datatype())\n }\n })\n})\n\n/**\n * Filter values in a callback given a callback function\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filterCallback (x, callback) {\n const fastCallback = optimizeCallback(callback, x, 'filter')\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return fastCallback(value, [index], array)\n })\n}\n","import { flatten as flattenArray } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'flatten'\nconst dependencies = ['typed']\n\nexport const createFlatten = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Flatten a multidimensional matrix into a single dimensional matrix.\n * A new matrix is returned, the original matrix is left untouched.\n *\n * Syntax:\n *\n * math.flatten(x)\n *\n * Examples:\n *\n * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]\n *\n * See also:\n *\n * concat, resize, size, squeeze\n *\n * @param {Matrix | Array} x Matrix to be flattened\n * @return {Matrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function (x) {\n return flattenArray(x)\n },\n\n Matrix: function (x) {\n // Return the same matrix type as x (Dense or Sparse Matrix)\n // Return the same data type as x\n return x.create(flattenArray(x.toArray()), x.datatype())\n }\n })\n})\n","import { optimizeCallback } from '../../utils/optimizeCallback.js'\nimport { factory } from '../../utils/factory.js'\nimport { recurse } from '../../utils/array.js'\n\nconst name = 'forEach'\nconst dependencies = ['typed']\n\nexport const createForEach = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Iterate over all elements of a matrix/array, and executes the given callback function.\n *\n * Syntax:\n *\n * math.forEach(x, callback)\n *\n * Examples:\n *\n * math.forEach([1, 2, 3], function(value) {\n * console.log(value)\n * })\n * // outputs 1, 2, 3\n *\n * See also:\n *\n * filter, map, sort\n *\n * @param {Matrix | Array} x The matrix to iterate on.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix/array being traversed.\n */\n return typed(name, {\n 'Array, function': _forEach,\n\n 'Matrix, function': function (x, callback) {\n x.forEach(callback)\n }\n })\n})\n\n/**\n * forEach for a multidimensional array\n * @param {Array} array\n * @param {Function} callback\n * @private\n */\nfunction _forEach (array, callback) {\n recurse(array, [], array, optimizeCallback(callback, array, name))\n}\n","import { factory } from '../../utils/factory.js'\nimport { getArrayDataType } from '../../utils/array.js'\nimport { typeOf } from '../../utils/is.js'\n\nconst name = 'getMatrixDataType'\nconst dependencies = ['typed']\n\nexport const createGetMatrixDataType = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Find the data type of all elements in a matrix or array,\n * for example 'number' if all items are a number and 'Complex' if all values\n * are complex numbers.\n * If a matrix contains more than one data type, it will return 'mixed'.\n *\n * Syntax:\n *\n * math.getMatrixDataType(x)\n *\n * Examples:\n *\n * const x = [ [1, 2, 3], [4, 5, 6] ]\n * const mixedX = [ [1, true], [2, 3] ]\n * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ]\n * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ]\n * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ]\n * const sparse = math.sparse(x)\n * const dense = math.matrix(x)\n * math.getMatrixDataType(x) // returns 'number'\n * math.getMatrixDataType(sparse) // returns 'number'\n * math.getMatrixDataType(dense) // returns 'number'\n * math.getMatrixDataType(mixedX) // returns 'mixed'\n * math.getMatrixDataType(fractionX) // returns 'Fraction'\n * math.getMatrixDataType(unitX) // returns 'Unit'\n * math.getMatrixDataType(bigNumberX) // return 'BigNumber'\n *\n * See also:\n * SparseMatrix, DenseMatrix\n *\n * @param {...Matrix | Array} x The Matrix with values.\n *\n * @return {string} A string representation of the matrix type\n */\n return typed(name, {\n Array: function (x) {\n return getArrayDataType(x, typeOf)\n },\n Matrix: function (x) {\n return x.getDataType()\n }\n })\n})\n","import { isBigNumber } from '../../utils/is.js'\nimport { resize } from '../../utils/array.js'\nimport { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'identity'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'BigNumber',\n 'DenseMatrix',\n 'SparseMatrix'\n]\n\nexport const createIdentity = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, BigNumber, DenseMatrix, SparseMatrix }) => {\n /**\n * Create a 2-dimensional identity matrix with size m x n or n x n.\n * The matrix has ones on the diagonal and zeros elsewhere.\n *\n * Syntax:\n *\n * math.identity(n)\n * math.identity(n, format)\n * math.identity(m, n)\n * math.identity(m, n, format)\n * math.identity([m, n])\n * math.identity([m, n], format)\n *\n * Examples:\n *\n * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]]\n *\n * See also:\n *\n * diag, ones, zeros, size, range\n *\n * @param {...number | Matrix | Array} size The size for the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Matrix | Array | number} A matrix with ones on the diagonal.\n */\n return typed(name, {\n '': function () {\n return (config.matrix === 'Matrix') ? matrix([]) : []\n },\n\n string: function (format) {\n return matrix(format)\n },\n\n 'number | BigNumber': function (rows) {\n return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined)\n },\n\n 'number | BigNumber, string': function (rows, format) {\n return _identity(rows, rows, format)\n },\n\n 'number | BigNumber, number | BigNumber': function (rows, cols) {\n return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined)\n },\n\n 'number | BigNumber, number | BigNumber, string': function (rows, cols, format) {\n return _identity(rows, cols, format)\n },\n\n Array: function (size) {\n return _identityVector(size)\n },\n\n 'Array, string': function (size, format) {\n return _identityVector(size, format)\n },\n\n Matrix: function (size) {\n return _identityVector(size.valueOf(), size.storage())\n },\n\n 'Matrix, string': function (size, format) {\n return _identityVector(size.valueOf(), format)\n }\n })\n\n function _identityVector (size, format) {\n switch (size.length) {\n case 0: return format ? matrix(format) : []\n case 1: return _identity(size[0], size[0], format)\n case 2: return _identity(size[0], size[1], format)\n default: throw new Error('Vector containing two values expected')\n }\n }\n\n /**\n * Create an identity matrix\n * @param {number | BigNumber} rows\n * @param {number | BigNumber} cols\n * @param {string} [format]\n * @returns {Matrix}\n * @private\n */\n function _identity (rows, cols, format) {\n // BigNumber constructor with the right precision\n const Big = (isBigNumber(rows) || isBigNumber(cols))\n ? BigNumber\n : null\n\n if (isBigNumber(rows)) rows = rows.toNumber()\n if (isBigNumber(cols)) cols = cols.toNumber()\n\n if (!isInteger(rows) || rows < 1) {\n throw new Error('Parameters in function identity must be positive integers')\n }\n if (!isInteger(cols) || cols < 1) {\n throw new Error('Parameters in function identity must be positive integers')\n }\n\n const one = Big ? new BigNumber(1) : 1\n const defaultValue = Big ? new Big(0) : 0\n const size = [rows, cols]\n\n // check we need to return a matrix\n if (format) {\n // create diagonal matrix (use optimized implementation for storage format)\n if (format === 'sparse') {\n return SparseMatrix.diagonal(size, one, 0, defaultValue)\n }\n if (format === 'dense') {\n return DenseMatrix.diagonal(size, one, 0, defaultValue)\n }\n throw new TypeError(`Unknown matrix type \"${format}\"`)\n }\n\n // create and resize array\n const res = resize([], size, defaultValue)\n // fill in ones on the diagonal\n const minimum = rows < cols ? rows : cols\n // fill diagonal\n for (let d = 0; d < minimum; d++) {\n res[d][d] = one\n }\n return res\n }\n})\n","import { arraySize as size } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'kron'\nconst dependencies = ['typed', 'matrix', 'multiplyScalar']\n\nexport const createKron = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, multiplyScalar }) => {\n /**\n * Calculates the Kronecker product of 2 matrices or vectors.\n *\n * NOTE: If a one dimensional vector / matrix is given, it will be\n * wrapped so its two dimensions.\n * See the examples.\n *\n * Syntax:\n *\n * math.kron(x, y)\n *\n * Examples:\n *\n * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\n * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ]\n *\n * math.kron([1,1], [2,3,4])\n * // returns [ [ 2, 3, 4, 2, 3, 4 ] ]\n *\n * See also:\n *\n * multiply, dot, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the Kronecker product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function (x, y) {\n return matrix(_kron(x.toArray(), y.toArray()))\n },\n\n 'Matrix, Array': function (x, y) {\n return matrix(_kron(x.toArray(), y))\n },\n\n 'Array, Matrix': function (x, y) {\n return matrix(_kron(x, y.toArray()))\n },\n\n 'Array, Array': _kron\n })\n\n /**\n * Calculate the Kronecker product of two matrices / vectors\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} Returns the Kronecker product of x and y\n * @private\n */\n function _kron (a, b) {\n // Deal with the dimensions of the matricies.\n if (size(a).length === 1) {\n // Wrap it in a 2D Matrix\n a = [a]\n }\n if (size(b).length === 1) {\n // Wrap it in a 2D Matrix\n b = [b]\n }\n if (size(a).length > 2 || size(b).length > 2) {\n throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' +\n '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')')\n }\n const t = []\n let r = []\n\n return a.map(function (a) {\n return b.map(function (b) {\n r = []\n t.push(r)\n return a.map(function (y) {\n return b.map(function (x) {\n return r.push(multiplyScalar(y, x))\n })\n })\n })\n }) && t\n }\n})\n","import { optimizeCallback } from '../../utils/optimizeCallback.js'\nimport { arraySize, broadcastSizes, broadcastTo, get, recurse } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'map'\nconst dependencies = ['typed']\n\nexport const createMap = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Create a new matrix or array with the results of a callback function executed on\n * each entry of a given matrix/array.\n *\n * For each entry of the input,\n *\n * the callback is invoked with 2N + 1 arguments:\n * the N values of the entry, the index at which that entry occurs, and the N full\n * broadcasted matrix/array being traversed where N is the number of matrices being traversed.\n * Note that because the matrix/array might be\n * multidimensional, the \"index\" argument is always an array of numbers giving\n * the index in each dimension. This is true even for vectors: the \"index\"\n * argument is an array of length 1, rather than simply a number.\n *\n * Syntax:\n *\n * math.map(x, callback)\n * math.map(x, y, ..., callback)\n *\n * Examples:\n *\n * math.map([1, 2, 3], function(value) {\n * return value * value\n * }) // returns [1, 4, 9]\n * math.map([1, 2], [3, 4], function(a, b) {\n * return a + b\n * }) // returns [4, 6]\n *\n * // The callback is normally called with three arguments:\n * // callback(value, index, Array)\n * // If you want to call with only one argument, use:\n * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3']\n * // It can also be called with 2N + 1 arguments: for N arrays\n * // callback(value1, value2, index, BroadcastedArray1, BroadcastedArray2)\n *\n * See also:\n *\n * filter, forEach, sort\n *\n * @param {Matrix | Array} x The input to iterate on.\n * @param {Function} callback\n * The function to call (as described above) on each entry of the input\n * @return {Matrix | array}\n * Transformed map of x; always has the same type and shape as x\n */\n return typed(name, {\n 'Array, function': _mapArray,\n\n 'Matrix, function': function (x, callback) {\n return x.map(callback)\n },\n\n 'Array|Matrix, Array|Matrix, ...Array|Matrix|function': (A, B, rest) =>\n _mapMultiple([A, B, ...rest.slice(0, rest.length - 1)], rest[rest.length - 1])\n })\n\n /**\n * Maps over multiple arrays or matrices.\n *\n * @param {Array} Arrays - An array of arrays or matrices to map over.\n * @param {function} multiCallback - The callback function to apply to each element.\n * @throws {Error} If the last argument is not a callback function.\n * @returns {Array|Matrix} A new array or matrix with each element being the result of the callback function.\n *\n * @example\n * _mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9]\n */\n function _mapMultiple (Arrays, multiCallback) {\n if (typeof multiCallback !== 'function') {\n throw new Error('Last argument must be a callback function')\n }\n\n const firstArrayIsMatrix = Arrays[0].isMatrix\n\n const newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)))\n\n const _get = firstArrayIsMatrix\n ? (matrix, idx) => matrix.get(idx)\n : get\n\n const broadcastedArrays = firstArrayIsMatrix\n ? Arrays.map(M => M.isMatrix\n ? M.create(broadcastTo(M.toArray(), newSize), M.datatype())\n : Arrays[0].create(broadcastTo(M.valueOf(), newSize)))\n : Arrays.map(M => M.isMatrix\n ? broadcastTo(M.toArray(), newSize)\n : broadcastTo(M, newSize))\n\n let callback\n\n if (typed.isTypedFunction(multiCallback)) {\n const firstIndex = newSize.map(() => 0)\n const firstValues = broadcastedArrays.map(array => _get(array, firstIndex))\n const callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays)\n callback = _getLimitedCallback(callbackCase)\n } else {\n const numberOfArrays = Arrays.length\n const callbackCase = _getCallbackCase(multiCallback, numberOfArrays)\n callback = _getLimitedCallback(callbackCase)\n }\n\n const broadcastedArraysCallback = (x, idx) =>\n callback(\n [x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))],\n idx)\n\n if (firstArrayIsMatrix) {\n return broadcastedArrays[0].map(broadcastedArraysCallback)\n } else {\n return _mapArray(broadcastedArrays[0], broadcastedArraysCallback)\n }\n\n function _getLimitedCallback (callbackCase) {\n switch (callbackCase) {\n case 0:\n return x => multiCallback(...x)\n case 1:\n return (x, idx) => multiCallback(...x, idx)\n case 2:\n return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays)\n }\n }\n\n function _getCallbackCase (callback, numberOfArrays) {\n if (callback.length > numberOfArrays + 1) { return 2 }\n if (callback.length === numberOfArrays + 1) { return 1 }\n return 0\n }\n\n function _getTypedCallbackCase (callback, values, idx, arrays) {\n if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) { return 2 }\n if (typed.resolve(callback, [...values, idx]) !== null) { return 1 }\n if (typed.resolve(callback, values) !== null) { return 0 }\n // this should never happen\n return 0\n }\n }\n /**\n * Map for a multi dimensional array\n * @param {Array} array\n * @param {Function} callback\n * @return {Array}\n * @private\n */\n function _mapArray (array, callback) {\n return recurse(array, [], array, optimizeCallback(callback, array, name))\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { isInteger } from '../../utils/number.js'\nimport { isMatrix } from '../../utils/is.js'\n\nconst name = 'diff'\nconst dependencies = ['typed', 'matrix', 'subtract', 'number']\n\nexport const createDiff = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtract, number }) => {\n /**\n * Create a new matrix or array of the difference between elements of the given array\n * The optional dim parameter lets you specify the dimension to evaluate the difference of\n * If no dimension parameter is passed it is assumed as dimension 0\n *\n * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber\n * Arrays must be 'rectangular' meaning arrays like [1, 2]\n * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\n *\n * Syntax:\n *\n * math.diff(arr)\n * math.diff(arr, dim)\n *\n * Examples:\n *\n * const arr = [1, 2, 4, 7, 0]\n * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed)\n * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7]\n *\n * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]]\n * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n *\n * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3\n * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed\n *\n * // These will all produce the same result\n * math.diff([[1, 2], [3, 4]])\n * math.diff([math.matrix([1, 2]), math.matrix([3, 4])])\n * math.diff([[1, 2], math.matrix([3, 4])])\n * math.diff([math.matrix([1, 2]), [3, 4]])\n * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix\n *\n * See Also:\n *\n * sum\n * subtract\n * partitionSelect\n *\n * @param {Array | Matrix} arr An array or matrix\n * @param {number | BigNumber} dim Dimension\n * @return {Array | Matrix} Difference between array elements in given dimension\n */\n return typed(name, {\n 'Array | Matrix': function (arr) { // No dimension specified => assume dimension 0\n if (isMatrix(arr)) {\n return matrix(_diff(arr.toArray()))\n } else {\n return _diff(arr)\n }\n },\n 'Array | Matrix, number': function (arr, dim) {\n if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number')\n if (isMatrix(arr)) {\n return matrix(_recursive(arr.toArray(), dim))\n } else {\n return _recursive(arr, dim)\n }\n },\n 'Array, BigNumber': typed.referTo('Array,number', selfAn =>\n (arr, dim) => selfAn(arr, number(dim))),\n 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn =>\n (arr, dim) => selfMn(arr, number(dim)))\n })\n\n /**\n * Recursively find the correct dimension in the array/matrix\n * Then Apply _diff to that dimension\n *\n * @param {Array} arr The array\n * @param {number} dim Dimension\n * @return {Array} resulting array\n */\n function _recursive (arr, dim) {\n if (isMatrix(arr)) {\n arr = arr.toArray() // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly\n }\n if (!Array.isArray(arr)) {\n throw RangeError('Array/Matrix does not have that many dimensions')\n }\n if (dim > 0) {\n const result = []\n arr.forEach(element => {\n result.push(_recursive(element, dim - 1))\n })\n return result\n } else if (dim === 0) {\n return _diff(arr)\n } else {\n throw RangeError('Cannot have negative dimension')\n }\n }\n\n /**\n * Difference between elements in the array\n *\n * @param {Array} arr An array\n * @return {Array} resulting array\n */\n function _diff (arr) {\n const result = []\n const size = arr.length\n for (let i = 1; i < size; i++) {\n result.push(_ElementDiff(arr[i - 1], arr[i]))\n }\n return result\n }\n\n /**\n * Difference between 2 objects\n *\n * @param {Object} obj1 First object\n * @param {Object} obj2 Second object\n * @return {Array} resulting array\n */\n function _ElementDiff (obj1, obj2) {\n // Convert matrices to arrays\n if (isMatrix(obj1)) obj1 = obj1.toArray()\n if (isMatrix(obj2)) obj2 = obj2.toArray()\n\n const obj1IsArray = Array.isArray(obj1)\n const obj2IsArray = Array.isArray(obj2)\n if (obj1IsArray && obj2IsArray) {\n return _ArrayDiff(obj1, obj2)\n }\n if (!obj1IsArray && !obj2IsArray) {\n return subtract(obj2, obj1) // Difference is (second - first) NOT (first - second)\n }\n throw TypeError('Cannot calculate difference between 1 array and 1 non-array')\n }\n\n /**\n * Difference of elements in 2 arrays\n *\n * @param {Array} arr1 Array 1\n * @param {Array} arr2 Array 2\n * @return {Array} resulting array\n */\n function _ArrayDiff (arr1, arr2) {\n if (arr1.length !== arr2.length) {\n throw RangeError('Not all sub-arrays have the same length')\n }\n const result = []\n const size = arr1.length\n for (let i = 0; i < size; i++) {\n result.push(_ElementDiff(arr1[i], arr2[i]))\n }\n return result\n }\n})\n","import { isBigNumber } from '../../utils/is.js'\nimport { isInteger } from '../../utils/number.js'\nimport { resize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ones'\nconst dependencies = ['typed', 'config', 'matrix', 'BigNumber']\n\nexport const createOnes = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, BigNumber }) => {\n /**\n * Create a matrix filled with ones. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.ones(m)\n * math.ones(m, format)\n * math.ones(m, n)\n * math.ones(m, n, format)\n * math.ones([m, n])\n * math.ones([m, n], format)\n * math.ones([m, n, p, ...])\n * math.ones([m, n, p, ...], format)\n *\n * Examples:\n *\n * math.ones() // returns []\n * math.ones(3) // returns [1, 1, 1]\n * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]]\n * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]]\n *\n * See also:\n *\n * zeros, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix | number} A matrix filled with ones\n */\n return typed('ones', {\n '': function () {\n return (config.matrix === 'Array')\n ? _ones([])\n : _ones([], 'default')\n },\n\n // math.ones(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function (size) {\n const last = size[size.length - 1]\n if (typeof last === 'string') {\n const format = size.pop()\n return _ones(size, format)\n } else if (config.matrix === 'Array') {\n return _ones(size)\n } else {\n return _ones(size, 'default')\n }\n },\n\n Array: _ones,\n\n Matrix: function (size) {\n const format = size.storage()\n return _ones(size.valueOf(), format)\n },\n\n 'Array | Matrix, string': function (size, format) {\n return _ones(size.valueOf(), format)\n }\n })\n\n /**\n * Create an Array or Matrix with ones\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _ones (size, format) {\n const hasBigNumbers = _normalize(size)\n const defaultValue = hasBigNumbers ? new BigNumber(1) : 1\n _validate(size)\n\n if (format) {\n // return a matrix\n const m = matrix(format)\n if (size.length > 0) {\n return m.resize(size, defaultValue)\n }\n return m\n } else {\n // return an Array\n const arr = []\n if (size.length > 0) {\n return resize(arr, size, defaultValue)\n }\n return arr\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize (size) {\n let hasBigNumbers = false\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true\n arr[index] = value.toNumber()\n }\n })\n return hasBigNumbers\n }\n\n // validate arguments\n function _validate (size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function ones must be positive integers')\n }\n })\n }\n})\n","export function noBignumber () {\n throw new Error('No \"bignumber\" implementation available')\n}\n\nexport function noFraction () {\n throw new Error('No \"fraction\" implementation available')\n}\n\nexport function noMatrix () {\n throw new Error('No \"matrix\" implementation available')\n}\n\nexport function noIndex () {\n throw new Error('No \"index\" implementation available')\n}\n\nexport function noSubset () {\n throw new Error('No \"matrix\" implementation available')\n}\n","import { factory } from '../../utils/factory.js'\nimport { noBignumber, noMatrix } from '../../utils/noop.js'\n\nconst name = 'range'\nconst dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']\n\nexport const createRange = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq, add, isPositive }) => {\n /**\n * Create an array from a range.\n * By default, the range end is excluded. This can be customized by providing\n * an extra parameter `includeEnd`.\n *\n * Syntax:\n *\n * math.range(str [, includeEnd]) // Create a range from a string,\n * // where the string contains the\n * // start, optional step, and end,\n * // separated by a colon.\n * math.range(start, end [, includeEnd]) // Create a range with start and\n * // end and a step size of 1.\n * math.range(start, end, step [, includeEnd]) // Create a range with start, step,\n * // and end.\n *\n * Where:\n *\n * - `str: string`\n * A string 'start:end' or 'start:step:end'\n * - `start: {number | BigNumber | Unit}`\n * Start of the range\n * - `end: number | BigNumber | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | BigNumber | Unit`\n * Step size. Default value is 1.\n * - `includeEnd: boolean`\n * Option to specify whether to include the end or not. False by default.\n *\n * Examples:\n *\n * math.range(2, 6) // [2, 3, 4, 5]\n * math.range(2, -3, -1) // [2, 1, 0, -1, -2]\n * math.range('2:1:6') // [2, 3, 4, 5]\n * math.range(2, 6, true) // [2, 3, 4, 5, 6]\n * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m]\n *\n * See also:\n *\n * ones, zeros, size, subset\n *\n * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`.\n * @return {Array | Matrix} range\n */\n return typed(name, {\n // TODO: simplify signatures when typed-function supports default values and optional arguments\n\n // TODO: a number or boolean should not be converted to string here\n string: _strRange,\n 'string, boolean': _strRange,\n\n 'number, number': function (start, end) {\n return _out(_range(start, end, 1, false))\n },\n 'number, number, number': function (start, end, step) {\n return _out(_range(start, end, step, false))\n },\n 'number, number, boolean': function (start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd))\n },\n 'number, number, number, boolean': function (start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd))\n },\n\n 'BigNumber, BigNumber': function (start, end) {\n const BigNumber = start.constructor\n\n return _out(_range(start, end, new BigNumber(1), false))\n },\n 'BigNumber, BigNumber, BigNumber': function (start, end, step) {\n return _out(_range(start, end, step, false))\n },\n 'BigNumber, BigNumber, boolean': function (start, end, includeEnd) {\n const BigNumber = start.constructor\n\n return _out(_range(start, end, new BigNumber(1), includeEnd))\n },\n 'BigNumber, BigNumber, BigNumber, boolean': function (start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd))\n },\n 'Unit, Unit, Unit': function (start, end, step) {\n return _out(_range(start, end, step, false))\n },\n 'Unit, Unit, Unit, boolean': function (start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd))\n }\n\n })\n\n function _out (arr) {\n if (config.matrix === 'Matrix') {\n return matrix ? matrix(arr) : noMatrix()\n }\n\n return arr\n }\n\n function _strRange (str, includeEnd) {\n const r = _parse(str)\n if (!r) {\n throw new SyntaxError('String \"' + str + '\" is no valid range')\n }\n\n if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber()\n }\n\n return _out(_range(\n bignumber(r.start),\n bignumber(r.end),\n bignumber(r.step)),\n includeEnd)\n } else {\n return _out(_range(r.start, r.end, r.step, includeEnd))\n }\n }\n\n /**\n * Create a range with numbers or BigNumbers\n * @param {number | BigNumber | Unit} start\n * @param {number | BigNumber | Unit} end\n * @param {number | BigNumber | Unit} step\n * @param {boolean} includeEnd\n * @returns {Array} range\n * @private\n */\n function _range (start, end, step, includeEnd) {\n const array = []\n const ongoing = isPositive(step)\n ? includeEnd ? smallerEq : smaller\n : includeEnd ? largerEq : larger\n let x = start\n while (ongoing(x, end)) {\n array.push(x)\n x = add(x, step)\n }\n return array\n }\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @param {string} str\n * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step\n * @private\n */\n function _parse (str) {\n const args = str.split(':')\n\n // number\n const nums = args.map(function (arg) {\n // use Number and not parseFloat as Number returns NaN on invalid garbage in the string\n return Number(arg)\n })\n\n const invalid = nums.some(function (num) {\n return isNaN(num)\n })\n if (invalid) {\n return null\n }\n\n switch (nums.length) {\n case 2:\n return {\n start: nums[0],\n end: nums[1],\n step: 1\n }\n\n case 3:\n return {\n start: nums[0],\n end: nums[2],\n step: nums[1]\n }\n\n default:\n return null\n }\n }\n})\n","import { reshape as arrayReshape } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'reshape'\nconst dependencies = ['typed', 'isInteger', 'matrix']\n\nexport const createReshape = /* #__PURE__ */ factory(name, dependencies, ({ typed, isInteger }) => {\n /**\n * Reshape a multi dimensional array to fit the specified dimensions\n *\n * Syntax:\n *\n * math.reshape(x, sizes)\n *\n * Examples:\n *\n * math.reshape([1, 2, 3, 4, 5, 6], [2, 3])\n * // returns Array [[1, 2, 3], [4, 5, 6]]\n *\n * math.reshape([[1, 2], [3, 4]], [1, 4])\n * // returns Array [[1, 2, 3, 4]]\n *\n * math.reshape([[1, 2], [3, 4]], [4])\n * // returns Array [1, 2, 3, 4]\n *\n * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8])\n * math.reshape(x, [2, 2, 2])\n * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n *\n * math.reshape([1, 2, 3, 4], [-1, 2])\n * // returns Matrix [[1, 2], [3, 4]]\n *\n * See also:\n *\n * size, squeeze, resize\n *\n * @param {Array | Matrix | *} x Matrix to be reshaped\n * @param {number[]} sizes One dimensional array with integral sizes for\n * each dimension. One -1 is allowed as wildcard,\n * which calculates this dimension automatically.\n *\n * @return {* | Array | Matrix} A reshaped clone of matrix `x`\n *\n * @throws {TypeError} If `sizes` does not contain solely integers\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\n return typed(name, {\n\n 'Matrix, Array': function (x, sizes) {\n return x.reshape(sizes, true)\n },\n\n 'Array, Array': function (x, sizes) {\n sizes.forEach(function (size) {\n if (!isInteger(size)) {\n throw new TypeError('Invalid size for dimension: ' + size)\n }\n })\n return arrayReshape(x, sizes)\n }\n\n })\n})\n","import { isBigNumber, isMatrix } from '../../utils/is.js'\nimport { DimensionError } from '../../error/DimensionError.js'\nimport { ArgumentsError } from '../../error/ArgumentsError.js'\nimport { isInteger } from '../../utils/number.js'\nimport { format } from '../../utils/string.js'\nimport { clone } from '../../utils/object.js'\nimport { resize as arrayResize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'resize'\nconst dependencies = ['config', 'matrix']\n\nexport const createResize = /* #__PURE__ */ factory(name, dependencies, ({ config, matrix }) => {\n /**\n * Resize a matrix\n *\n * Syntax:\n *\n * math.resize(x, size)\n * math.resize(x, size, defaultValue)\n *\n * Examples:\n *\n * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3]\n * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0]\n * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]]\n * math.resize(\"hello\", [8], \"!\") // returns string 'hello!!!'\n *\n * See also:\n *\n * size, squeeze, subset, reshape\n *\n * @param {Array | Matrix | *} x Matrix to be resized\n * @param {Array | Matrix} size One dimensional array with numbers\n * @param {number | string} [defaultValue=0] Zero by default, except in\n * case of a string, in that case\n * defaultValue = ' '\n * @return {* | Array | Matrix} A resized clone of matrix `x`\n */\n // TODO: rework resize to a typed-function\n return function resize (x, size, defaultValue) {\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw new ArgumentsError('resize', arguments.length, 2, 3)\n }\n\n if (isMatrix(size)) {\n size = size.valueOf() // get Array\n }\n\n if (isBigNumber(size[0])) {\n // convert bignumbers to numbers\n size = size.map(function (value) {\n return !isBigNumber(value) ? value : value.toNumber()\n })\n }\n\n // check x is a Matrix\n if (isMatrix(x)) {\n // use optimized matrix implementation, return copy\n return x.resize(size, defaultValue, true)\n }\n\n if (typeof x === 'string') {\n // resize string\n return _resizeString(x, size, defaultValue)\n }\n\n // check result should be a matrix\n const asMatrix = Array.isArray(x) ? false : (config.matrix !== 'Array')\n\n if (size.length === 0) {\n // output a scalar\n while (Array.isArray(x)) {\n x = x[0]\n }\n\n return clone(x)\n } else {\n // output an array/matrix\n if (!Array.isArray(x)) {\n x = [x]\n }\n x = clone(x)\n\n const res = arrayResize(x, size, defaultValue)\n return asMatrix ? matrix(res) : res\n }\n }\n\n /**\n * Resize a string\n * @param {string} str\n * @param {number[]} size\n * @param {string} [defaultChar=' ']\n * @private\n */\n function _resizeString (str, size, defaultChar) {\n if (defaultChar !== undefined) {\n if (typeof defaultChar !== 'string' || defaultChar.length !== 1) {\n throw new TypeError('Single character expected as defaultValue')\n }\n } else {\n defaultChar = ' '\n }\n\n if (size.length !== 1) {\n throw new DimensionError(size.length, 1)\n }\n const len = size[0]\n if (typeof len !== 'number' || !isInteger(len)) {\n throw new TypeError('Invalid size, must contain positive integers ' +\n '(size: ' + format(size) + ')')\n }\n\n if (str.length > len) {\n return str.substring(0, len)\n } else if (str.length < len) {\n let res = str\n for (let i = 0, ii = len - str.length; i < ii; i++) {\n res += defaultChar\n }\n return res\n } else {\n return str\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { arraySize } from '../../utils/array.js'\n\nconst name = 'rotate'\nconst dependencies = [\n 'typed',\n 'multiply',\n 'rotationMatrix'\n]\n\nexport const createRotate = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed, multiply, rotationMatrix\n }) => {\n /**\n * Rotate a vector of size 1x2 counter-clockwise by a given angle\n * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis\n *\n * Syntax:\n *\n * math.rotate(w, theta)\n * math.rotate(w, theta, v)\n *\n * Examples:\n *\n * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]\n * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]\n *\n * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]\n * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]\n *\n * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]\n *\n * See also:\n *\n * matrix, rotationMatrix\n *\n * @param {Array | Matrix} w Vector to rotate\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @return {Array | Matrix} Multiplication of the rotation matrix and w\n */\n return typed(name, {\n 'Array , number | BigNumber | Complex | Unit': function (w, theta) {\n _validateSize(w, 2)\n const matrixRes = multiply(rotationMatrix(theta), w)\n return matrixRes.toArray()\n },\n\n 'Matrix , number | BigNumber | Complex | Unit': function (w, theta) {\n _validateSize(w, 2)\n return multiply(rotationMatrix(theta), w)\n },\n\n 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function (w, theta, v) {\n _validateSize(w, 3)\n const matrixRes = multiply(rotationMatrix(theta, v), w)\n return matrixRes\n },\n\n 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function (w, theta, v) {\n _validateSize(w, 3)\n return multiply(rotationMatrix(theta, v), w)\n }\n })\n\n function _validateSize (v, expectedSize) {\n const actualSize = Array.isArray(v) ? arraySize(v) : v.size()\n if (actualSize.length > 2) {\n throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`)\n }\n if (actualSize.length === 2 && actualSize[1] !== 1) {\n throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`)\n }\n if (actualSize[0] !== expectedSize) {\n throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`)\n }\n }\n})\n","import { isBigNumber } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'rotationMatrix'\nconst dependencies = [\n 'typed',\n 'config',\n 'multiplyScalar',\n 'addScalar',\n 'unaryMinus',\n 'norm',\n 'matrix',\n 'BigNumber',\n 'DenseMatrix',\n 'SparseMatrix',\n 'cos',\n 'sin'\n]\n\nexport const createRotationMatrix = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed, config, multiplyScalar,\n addScalar, unaryMinus, norm, BigNumber,\n matrix, DenseMatrix, SparseMatrix, cos, sin\n }) => {\n /**\n * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).\n * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3).\n *\n * Syntax:\n *\n * math.rotationMatrix(theta)\n * math.rotationMatrix(theta, format)\n * math.rotationMatrix(theta, [v])\n * math.rotationMatrix(theta, [v], format)\n *\n * Examples:\n *\n * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]]\n * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]]\n * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]]\n * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]]\n *\n * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n *\n *\n * See also:\n *\n * matrix, cos, sin\n *\n *\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @param {string} [format] Result Matrix storage format\n * @return {Array | Matrix} Rotation matrix\n */\n\n return typed(name, {\n '': function () {\n return (config.matrix === 'Matrix') ? matrix([]) : []\n },\n\n string: function (format) {\n return matrix(format)\n },\n\n 'number | BigNumber | Complex | Unit': function (theta) {\n return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined)\n },\n\n 'number | BigNumber | Complex | Unit, string': function (theta, format) {\n return _rotationMatrix2x2(theta, format)\n },\n\n 'number | BigNumber | Complex | Unit, Array': function (theta, v) {\n const matrixV = matrix(v)\n _validateVector(matrixV)\n return _rotationMatrix3x3(theta, matrixV, undefined)\n },\n\n 'number | BigNumber | Complex | Unit, Matrix': function (theta, v) {\n _validateVector(v)\n const storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined)\n return _rotationMatrix3x3(theta, v, storageType)\n },\n\n 'number | BigNumber | Complex | Unit, Array, string': function (theta, v, format) {\n const matrixV = matrix(v)\n _validateVector(matrixV)\n return _rotationMatrix3x3(theta, matrixV, format)\n },\n\n 'number | BigNumber | Complex | Unit, Matrix, string': function (theta, v, format) {\n _validateVector(v)\n return _rotationMatrix3x3(theta, v, format)\n }\n\n })\n\n /**\n * Returns 2x2 matrix of 2D rotation of angle theta\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {string} format The result Matrix storage format\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix2x2 (theta, format) {\n const Big = isBigNumber(theta)\n\n const minusOne = Big ? new BigNumber(-1) : -1\n const cosTheta = cos(theta)\n const sinTheta = sin(theta)\n const data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]]\n\n return _convertToFormat(data, format)\n }\n\n function _validateVector (v) {\n const size = v.size()\n if (size.length < 1 || size[0] !== 3) {\n throw new RangeError('Vector must be of dimensions 1x3')\n }\n }\n\n function _mul (array) {\n return array.reduce((p, curr) => multiplyScalar(p, curr))\n }\n\n function _convertToFormat (data, format) {\n if (format) {\n if (format === 'sparse') {\n return new SparseMatrix(data)\n }\n if (format === 'dense') {\n return new DenseMatrix(data)\n }\n throw new TypeError(`Unknown matrix type \"${format}\"`)\n }\n return data\n }\n\n /**\n * Returns a 3x3 matrix of rotation of angle theta around vector v\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {Matrix} v The rotation axis vector\n * @param {string} format The storage format of the resulting matrix\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix3x3 (theta, v, format) {\n const normV = norm(v)\n if (normV === 0) {\n throw new RangeError('Rotation around zero vector')\n }\n\n const Big = isBigNumber(theta) ? BigNumber : null\n\n const one = Big ? new Big(1) : 1\n const minusOne = Big ? new Big(-1) : -1\n const vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV\n const vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV\n const vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV\n const c = cos(theta)\n const oneMinusC = addScalar(one, unaryMinus(c))\n const s = sin(theta)\n\n const r11 = addScalar(c, _mul([vx, vx, oneMinusC]))\n const r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s]))\n const r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s]))\n\n const r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s]))\n const r22 = addScalar(c, _mul([vy, vy, oneMinusC]))\n const r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s]))\n\n const r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s]))\n const r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s]))\n const r33 = addScalar(c, _mul([vz, vz, oneMinusC]))\n\n const data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]]\n\n return _convertToFormat(data, format)\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { validateIndex } from '../../utils/array.js'\n\nconst name = 'row'\nconst dependencies = ['typed', 'Index', 'matrix', 'range']\n\nexport const createRow = /* #__PURE__ */ factory(name, dependencies, ({ typed, Index, matrix, range }) => {\n /**\n * Return a row from a Matrix.\n *\n * Syntax:\n *\n * math.row(value, index)\n *\n * Example:\n *\n * // get a row\n * const d = [[1, 2], [3, 4]]\n * math.row(d, 1) // returns [[3, 4]]\n *\n * See also:\n *\n * column\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} row The index of the row\n * @return {Array | Matrix} The retrieved row\n */\n return typed(name, {\n 'Matrix, number': _row,\n\n 'Array, number': function (value, row) {\n return _row(matrix(clone(value)), row).valueOf()\n }\n })\n\n /**\n * Retrieve a row of a matrix\n * @param {Matrix } value A matrix\n * @param {number} row The index of the row\n * @return {Matrix} The retrieved row\n */\n function _row (value, row) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported')\n }\n\n validateIndex(row, value.size()[0])\n\n const columnRange = range(0, value.size()[1])\n const index = new Index(row, columnRange)\n const result = value.subset(index)\n return isMatrix(result)\n ? result\n : matrix([[result]])\n }\n})\n","import { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { noMatrix } from '../../utils/noop.js'\n\nconst name = 'size'\nconst dependencies = ['typed', 'config', '?matrix']\n\nexport const createSize = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix }) => {\n /**\n * Calculate the size of a matrix or scalar.\n *\n * Syntax:\n *\n * math.size(x)\n *\n * Examples:\n *\n * math.size(2.3) // returns []\n * math.size('hello world') // returns [11]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.size(A) // returns [2, 3]\n * math.size(math.range(1,6).toArray()) // returns [5]\n *\n * See also:\n *\n * count, resize, squeeze, subset\n *\n * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix\n * @return {Array | Matrix} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: function (x) {\n return x.create(x.size(), 'number')\n },\n\n Array: arraySize,\n\n string: function (x) {\n return (config.matrix === 'Array') ? [x.length] : matrix([x.length], 'dense', 'number')\n },\n\n 'number | Complex | BigNumber | Unit | boolean | null': function (x) {\n // scalar\n return (config.matrix === 'Array')\n ? []\n : matrix ? matrix([], 'dense', 'number') : noMatrix()\n }\n })\n})\n","import { clone } from '../../utils/object.js'\nimport { squeeze as arraySqueeze } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'squeeze'\nconst dependencies = ['typed']\n\nexport const createSqueeze = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.\n *\n * Syntax:\n *\n * math.squeeze(x)\n *\n * Examples:\n *\n * math.squeeze([3]) // returns 3\n * math.squeeze([[3]]) // returns 3\n *\n * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1)\n * math.squeeze(A) // returns [0, 0, 0] (size 3)\n *\n * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3)\n * math.squeeze(B) // returns [0, 0, 0] (size 3)\n *\n * // only inner and outer dimensions are removed\n * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n *\n * See also:\n *\n * subset\n *\n * @param {Matrix | Array} x Matrix to be squeezed\n * @return {Matrix | Array} Squeezed matrix\n */\n return typed(name, {\n Array: function (x) {\n return arraySqueeze(clone(x))\n },\n\n Matrix: function (x) {\n const res = arraySqueeze(x.toArray())\n // FIXME: return the same type of matrix as the input\n return Array.isArray(res) ? x.create(res, x.datatype()) : res\n },\n\n any: function (x) {\n // scalar\n return clone(x)\n }\n })\n})\n","import { isIndex } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js'\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js'\nimport { DimensionError } from '../../error/DimensionError.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'subset'\nconst dependencies = ['typed', 'matrix', 'zeros', 'add']\n\nexport const createSubset = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, zeros, add }) => {\n /**\n * Get or set a subset of a matrix or string.\n *\n * Syntax:\n * math.subset(value, index) // retrieve a subset\n * math.subset(value, index, replacement [, defaultValue]) // replace a subset\n *\n * Examples:\n *\n * // get a subset\n * const d = [[1, 2], [3, 4]]\n * math.subset(d, math.index(1, 0)) // returns 3\n * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]]\n * math.subset(d, math.index([false, true], 0)) // returns [[3]]\n *\n * // replace a subset\n * const e = []\n * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]]\n * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]]\n * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]]\n *\n * // get submatrix using ranges\n * const M = [\n * [1,2,3],\n * [4,5,6],\n * [7,8,9]\n * ]\n * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]]\n *\n * See also:\n *\n * size, resize, squeeze, index\n *\n * @param {Array | Matrix | string} matrix An array, matrix, or string\n * @param {Index} index\n * For each dimension of the target, specifies an index or a list of\n * indices to fetch or set. `subset` uses the cartesian product of\n * the indices specified in each dimension.\n * @param {*} [replacement] An array, matrix, or scalar.\n * If provided, the subset is replaced with replacement.\n * If not provided, the subset is returned\n * @param {*} [defaultValue=undefined] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * math.matrix elements will be left undefined.\n * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix.\n */\n\n return typed(name, {\n // get subset\n 'Matrix, Index': function (value, index) {\n if (isEmptyIndex(index)) { return matrix() }\n validateIndexSourceSize(value, index)\n return value.subset(index)\n },\n\n 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) {\n return function (value, index) {\n const subsetResult = subsetRef(matrix(value), index)\n return index.isScalar() ? subsetResult : subsetResult.valueOf()\n }\n }),\n\n 'Object, Index': _getObjectProperty,\n\n 'string, Index': _getSubstring,\n\n // set subset\n 'Matrix, Index, any, any': function (value, index, replacement, defaultValue) {\n if (isEmptyIndex(index)) { return value }\n validateIndexSourceSize(value, index)\n return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue)\n },\n\n 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement, defaultValue) {\n const subsetResult = subsetRef(matrix(value), index, replacement, defaultValue)\n return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult\n }\n }),\n\n 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(matrix(value), index, replacement, undefined).valueOf()\n }\n }),\n\n 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) { return subsetRef(value, index, replacement, undefined) }\n }),\n\n 'string, Index, string': _setSubstring,\n 'string, Index, string, string': _setSubstring,\n 'Object, Index, any': _setObjectProperty\n })\n\n /**\n * Broadcasts a replacment value to be the same size as index\n * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast\n * @param {*} index Index value\n * @returns broadcasted replacement that matches the size of index\n */\n\n function _broadcastReplacement (replacement, index) {\n if (typeof replacement === 'string') {\n throw new Error('can\\'t boradcast a string')\n }\n if (index._isScalar) {\n return replacement\n }\n\n const indexSize = index.size()\n if (indexSize.every(d => d > 0)) {\n try {\n return add(replacement, zeros(indexSize))\n } catch (error) {\n return replacement\n }\n } else {\n return replacement\n }\n }\n})\n\n/**\n * Retrieve a subset of a string\n * @param {string} str string from which to get a substring\n * @param {Index} index An index or list of indices (character positions)\n * @returns {string} substring\n * @private\n */\nfunction _getSubstring (str, index) {\n if (!isIndex(index)) {\n // TODO: better error message\n throw new TypeError('Index expected')\n }\n\n if (isEmptyIndex(index)) { return '' }\n validateIndexSourceSize(Array.from(str), index)\n\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1)\n }\n\n // validate whether the range is out of range\n const strLen = str.length\n validateIndex(index.min()[0], strLen)\n validateIndex(index.max()[0], strLen)\n\n const range = index.dimension(0)\n\n let substr = ''\n range.forEach(function (v) {\n substr += str.charAt(v)\n })\n\n return substr\n}\n\n/**\n * Replace a substring in a string\n * @param {string} str string to be replaced\n * @param {Index} index An index or list of indices (character positions)\n * @param {string} replacement Replacement string\n * @param {string} [defaultValue] Default value to be used when resizing\n * the string. is ' ' by default\n * @returns {string} result\n * @private\n */\nfunction _setSubstring (str, index, replacement, defaultValue) {\n if (!index || index.isIndex !== true) {\n // TODO: better error message\n throw new TypeError('Index expected')\n }\n if (isEmptyIndex(index)) { return str }\n validateIndexSourceSize(Array.from(str), index)\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1)\n }\n if (defaultValue !== undefined) {\n if (typeof defaultValue !== 'string' || defaultValue.length !== 1) {\n throw new TypeError('Single character expected as defaultValue')\n }\n } else {\n defaultValue = ' '\n }\n\n const range = index.dimension(0)\n const len = range.size()[0]\n\n if (len !== replacement.length) {\n throw new DimensionError(range.size()[0], replacement.length)\n }\n\n // validate whether the range is out of range\n const strLen = str.length\n validateIndex(index.min()[0])\n validateIndex(index.max()[0])\n\n // copy the string into an array with characters\n const chars = []\n for (let i = 0; i < strLen; i++) {\n chars[i] = str.charAt(i)\n }\n\n range.forEach(function (v, i) {\n chars[v] = replacement.charAt(i[0])\n })\n\n // initialize undefined characters with a space\n if (chars.length > strLen) {\n for (let i = strLen - 1, len = chars.length; i < len; i++) {\n if (!chars[i]) {\n chars[i] = defaultValue\n }\n }\n }\n\n return chars.join('')\n}\n\n/**\n * Retrieve a property from an object\n * @param {Object} object\n * @param {Index} index\n * @return {*} Returns the value of the property\n * @private\n */\nfunction _getObjectProperty (object, index) {\n if (isEmptyIndex(index)) { return undefined }\n\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1)\n }\n\n const key = index.dimension(0)\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property')\n }\n\n return getSafeProperty(object, key)\n}\n\n/**\n * Set a property on an object\n * @param {Object} object\n * @param {Index} index\n * @param {*} replacement\n * @return {*} Returns the updated object\n * @private\n */\nfunction _setObjectProperty (object, index, replacement) {\n if (isEmptyIndex(index)) { return object }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1)\n }\n\n const key = index.dimension(0)\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property')\n }\n\n // clone the object, and apply the property to the clone\n const updated = clone(object)\n setSafeProperty(updated, key, replacement)\n\n return updated\n}\n","import { clone } from '../../utils/object.js'\nimport { format } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'transpose'\nconst dependencies = ['typed', 'matrix']\n\nexport const createTranspose = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix }) => {\n /**\n * Transpose a matrix. All values of the matrix are reflected over its\n * main diagonal. Only applicable to two dimensional matrices containing\n * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional\n * vectors and scalars return the input unchanged.\n *\n * Syntax:\n *\n * math.transpose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]]\n *\n * See also:\n *\n * diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be transposed\n * @return {Array | Matrix} The transposed matrix\n */\n return typed(name, {\n Array: x => transposeMatrix(matrix(x)).valueOf(),\n Matrix: transposeMatrix,\n any: clone // scalars\n })\n\n function transposeMatrix (x) {\n // matrix size\n const size = x.size()\n\n // result\n let c\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n c = x.clone()\n break\n\n case 2:\n {\n // rows and columns\n const rows = size[0]\n const columns = size[1]\n\n // check columns\n if (columns === 0) {\n // throw exception\n throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')')\n }\n\n // process storage format\n switch (x.storage()) {\n case 'dense':\n c = _denseTranspose(x, rows, columns)\n break\n case 'sparse':\n c = _sparseTranspose(x, rows, columns)\n break\n }\n }\n break\n\n default:\n // multi dimensional\n throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')')\n }\n return c\n }\n\n function _denseTranspose (m, rows, columns) {\n // matrix array\n const data = m._data\n // transposed matrix data\n const transposed = []\n let transposedRow\n // loop columns\n for (let j = 0; j < columns; j++) {\n // initialize row\n transposedRow = transposed[j] = []\n // loop rows\n for (let i = 0; i < rows; i++) {\n // set data\n transposedRow[i] = clone(data[i][j])\n }\n }\n // return matrix\n return m.createDenseMatrix({\n data: transposed,\n size: [columns, rows],\n datatype: m._datatype\n })\n }\n\n function _sparseTranspose (m, rows, columns) {\n // matrix arrays\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n // result matrices\n const cvalues = values ? [] : undefined\n const cindex = []\n const cptr = []\n // row counts\n const w = []\n for (let x = 0; x < rows; x++) { w[x] = 0 }\n // vars\n let p, l, j\n // loop values in matrix\n for (p = 0, l = index.length; p < l; p++) {\n // number of values in row\n w[index[p]]++\n }\n // cumulative sum\n let sum = 0\n // initialize cptr with the cummulative sum of row counts\n for (let i = 0; i < rows; i++) {\n // update cptr\n cptr.push(sum)\n // update sum\n sum += w[i]\n // update w\n w[i] = cptr[i]\n }\n // update cptr\n cptr.push(sum)\n // loop columns\n for (j = 0; j < columns; j++) {\n // values & index in column\n for (let k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {\n // C values & index\n const q = w[index[k]]++\n // C[j, i] = A[i, j]\n cindex[q] = j\n // check we need to process values (pattern matrix)\n if (values) { cvalues[q] = clone(values[k]) }\n }\n }\n // return matrix\n return m.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [columns, rows],\n datatype: m._datatype\n })\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'ctranspose'\nconst dependencies = ['typed', 'transpose', 'conj']\n\nexport const createCtranspose = /* #__PURE__ */ factory(name, dependencies, ({ typed, transpose, conj }) => {\n /**\n * Transpose and complex conjugate a matrix. All values of the matrix are\n * reflected over its main diagonal and then the complex conjugate is\n * taken. This is equivalent to complex conjugation for scalars and\n * vectors.\n *\n * Syntax:\n *\n * math.ctranspose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]\n * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]\n *\n * See also:\n *\n * transpose, diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be ctransposed\n * @return {Array | Matrix} The ctransposed matrix\n */\n return typed(name, {\n any: function (x) {\n return conj(transpose(x))\n }\n })\n})\n","import { isBigNumber } from '../../utils/is.js'\nimport { isInteger } from '../../utils/number.js'\nimport { resize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'zeros'\nconst dependencies = ['typed', 'config', 'matrix', 'BigNumber']\n\nexport const createZeros = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, BigNumber }) => {\n /**\n * Create a matrix filled with zeros. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.zeros(m)\n * math.zeros(m, format)\n * math.zeros(m, n)\n * math.zeros(m, n, format)\n * math.zeros([m, n])\n * math.zeros([m, n], format)\n *\n * Examples:\n *\n * math.zeros() // returns []\n * math.zeros(3) // returns [0, 0, 0]\n * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]]\n * math.zeros(3, 'dense') // returns [0, 0, 0]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]]\n *\n * See also:\n *\n * ones, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix} A matrix filled with zeros\n */\n return typed(name, {\n '': function () {\n return (config.matrix === 'Array')\n ? _zeros([])\n : _zeros([], 'default')\n },\n\n // math.zeros(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function (size) {\n const last = size[size.length - 1]\n if (typeof last === 'string') {\n const format = size.pop()\n return _zeros(size, format)\n } else if (config.matrix === 'Array') {\n return _zeros(size)\n } else {\n return _zeros(size, 'default')\n }\n },\n\n Array: _zeros,\n\n Matrix: function (size) {\n const format = size.storage()\n return _zeros(size.valueOf(), format)\n },\n\n 'Array | Matrix, string': function (size, format) {\n return _zeros(size.valueOf(), format)\n }\n })\n\n /**\n * Create an Array or Matrix with zeros\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _zeros (size, format) {\n const hasBigNumbers = _normalize(size)\n const defaultValue = hasBigNumbers ? new BigNumber(0) : 0\n _validate(size)\n\n if (format) {\n // return a matrix\n const m = matrix(format)\n if (size.length > 0) {\n return m.resize(size, defaultValue)\n }\n return m\n } else {\n // return an Array\n const arr = []\n if (size.length > 0) {\n return resize(arr, size, defaultValue)\n }\n return arr\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize (size) {\n let hasBigNumbers = false\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true\n arr[index] = value.toNumber()\n }\n })\n return hasBigNumbers\n }\n\n // validate arguments\n function _validate (size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function zeros must be positive integers')\n }\n })\n }\n})\n\n// TODO: zeros contains almost the same code as ones. Reuse this?\n","import { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'fft'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'addScalar',\n 'multiplyScalar',\n 'divideScalar',\n 'exp',\n 'tau',\n 'i',\n 'dotDivide',\n 'conj',\n 'pow',\n 'ceil',\n 'log2'\n]\n\nexport const createFft = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n divideScalar,\n exp,\n tau,\n i: I,\n dotDivide,\n conj,\n pow,\n ceil,\n log2\n}) => {\n /**\n * Calculate N-dimensional Fourier transform\n *\n * Syntax:\n *\n * math.fft(arr)\n *\n * Examples:\n *\n * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]]\n *\n *\n * See Also:\n *\n * ifft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n Array: _ndFft,\n Matrix: function (matrix) {\n return matrix.create(_ndFft(matrix.valueOf()), matrix.datatype())\n }\n })\n\n /**\n * Perform an N-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _ndFft (arr) {\n const size = arraySize(arr)\n if (size.length === 1) return _fft(arr, size[0])\n // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0\n return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0)\n }\n\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @param {number} dim dimension of the array to perform on\n * @return {Array} resulting array\n */\n function _1dFft (arr, dim) {\n const size = arraySize(arr)\n if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1))\n if (size.length === 1) return _fft(arr)\n function _transpose (arr) { // Swap first 2 dimensions\n const size = arraySize(arr)\n return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]))\n }\n return _transpose(_1dFft(_transpose(arr), 1))\n }\n /**\n * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _czt (arr) {\n const n = arr.length\n const w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n))\n const chirp = []\n for (let i = 1 - n; i < n; i++) {\n chirp.push(pow(w, divideScalar(pow(i, 2), 2)))\n }\n const N2 = pow(2, ceil(log2(n + n - 1)))\n const xp = [\n ...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])),\n ...new Array(N2 - n).fill(0)\n ]\n const ichirp = [\n ...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])),\n ...new Array(N2 - (n + n - 1)).fill(0)\n ]\n const fftXp = _fft(xp)\n const fftIchirp = _fft(ichirp)\n const fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i]))\n const ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2)\n const ret = []\n for (let i = n - 1; i < n + n - 1; i++) {\n ret.push(multiplyScalar(ifftProduct[i], chirp[i]))\n }\n return ret\n }\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _fft (arr) {\n const len = arr.length\n if (len === 1) return [arr[0]]\n if (len % 2 === 0) {\n const ret = [\n ..._fft(arr.filter((_, i) => i % 2 === 0), len / 2),\n ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)\n ]\n for (let k = 0; k < len / 2; k++) {\n const p = ret[k]\n const q = multiplyScalar(\n ret[k + len / 2],\n exp(\n multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len))\n )\n )\n ret[k] = addScalar(p, q)\n ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q))\n }\n return ret\n } else {\n // use chirp-z transform for non-power-of-2 FFT\n return _czt(arr)\n }\n // throw new Error('Can only calculate FFT of power-of-two size')\n }\n})\n","import { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\n\nconst name = 'ifft'\nconst dependencies = [\n 'typed',\n 'fft',\n 'dotDivide',\n 'conj'\n]\n\nexport const createIfft = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n fft,\n dotDivide,\n conj\n}) => {\n /**\n * Calculate N-dimensional inverse Fourier transform\n *\n * Syntax:\n *\n * math.ifft(arr)\n *\n * Examples:\n *\n * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]]\n *\n * See Also:\n *\n * fft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n 'Array | Matrix': function (arr) {\n const size = isMatrix(arr) ? arr.size() : arraySize(arr)\n return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1))\n }\n })\n})\n","import { isUnit, isNumber, isBigNumber } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'solveODE'\nconst dependencies = [\n 'typed',\n 'add',\n 'subtract',\n 'multiply',\n 'divide',\n 'max',\n 'map',\n 'abs',\n 'isPositive',\n 'isNegative',\n 'larger',\n 'smaller',\n 'matrix',\n 'bignumber',\n 'unaryMinus'\n]\n\nexport const createSolveODE = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n add,\n subtract,\n multiply,\n divide,\n max,\n map,\n abs,\n isPositive,\n isNegative,\n larger,\n smaller,\n matrix,\n bignumber,\n unaryMinus\n }\n) => {\n /**\n * Numerical Integration of Ordinary Differential Equations\n *\n * Two variable step methods are provided:\n * - \"RK23\": Bogacki–Shampine method\n * - \"RK45\": Dormand-Prince method RK5(4)7M (default)\n *\n * The arguments are expected as follows.\n *\n * - `func` should be the forcing function `f(t, y)`\n * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]`\n * - `y0` the initial state values, should be a scalar or a flat array\n * - `options` should be an object with the following information:\n * - `method` ('RK45'): ['RK23', 'RK45']\n * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value\n * - `firstStep`: Initial step size\n * - `minStep`: minimum step size of the method\n * - `maxStep`: maximum step size of the method\n * - `minDelta` (0.2): minimum ratio of change for the step\n * - `maxDelta` (5): maximum ratio of change for the step\n * - `maxIter` (1e4): maximum number of iterations\n *\n * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`:\n * - `t` an array of size `[n]`\n * - `y` the states array can be in two ways\n * - **if `y0` is a scalar:** returns an array-like of size `[n]`\n * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]`\n *\n * Syntax:\n *\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, y0, options)\n *\n * Examples:\n *\n * function func(t, y) {return y}\n * const tspan = [0, 4]\n * const y0 = 1\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, [1, 2])\n * math.solveODE(func, tspan, y0, { method:\"RK23\", maxStep:0.1 })\n *\n * See also:\n *\n * derivative, simplifyCore\n *\n * @param {function} func The forcing function f(t,y)\n * @param {Array | Matrix} tspan The time span\n * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value\n * @param {Object} [options] Optional configuration options\n * @return {Object} Return an object with t and y values as arrays\n */\n\n function _rk (butcherTableau) {\n // generates an adaptive runge kutta method from it's butcher tableau\n\n return function (f, tspan, y0, options) {\n // adaptive runge kutta methods\n const wrongTSpan = !((tspan.length === 2) && (tspan.every(isNumOrBig) || tspan.every(isUnit)))\n if (wrongTSpan) {\n throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]')\n }\n const t0 = tspan[0] // initial time\n const tf = tspan[1] // final time\n const isForwards = larger(tf, t0)\n const firstStep = options.firstStep\n if (firstStep !== undefined && !isPositive(firstStep)) {\n throw new Error('\"firstStep\" must be positive')\n }\n const maxStep = options.maxStep\n if (maxStep !== undefined && !isPositive(maxStep)) {\n throw new Error('\"maxStep\" must be positive')\n }\n const minStep = options.minStep\n if (minStep && isNegative(minStep)) {\n throw new Error('\"minStep\" must be positive or zero')\n }\n const timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined)\n if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) {\n throw new Error('Inconsistent type of \"t\" dependant variables')\n }\n const steps = 1 // divide time in this number of steps\n const tol = options.tol ? options.tol : 1e-4 // define a tolerance (must be an option)\n const minDelta = options.minDelta ? options.minDelta : 0.2\n const maxDelta = options.maxDelta ? options.maxDelta : 5\n const maxIter = options.maxIter ? options.maxIter : 10_000 // stop inifite evaluation if something goes wrong\n const hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber)\n const [a, c, b, bp] = hasBigNumbers\n ? [\n bignumber(butcherTableau.a),\n bignumber(butcherTableau.c),\n bignumber(butcherTableau.b),\n bignumber(butcherTableau.bp)\n ]\n : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp]\n\n let h = firstStep\n ? isForwards ? firstStep : unaryMinus(firstStep)\n : divide(subtract(tf, t0), steps) // define the first step size\n const t = [t0] // start the time array\n const y = [y0] // start the solution array\n\n const deltaB = subtract(b, bp) // b - bp\n\n let n = 0\n let iter = 0\n const ongoing = _createOngoing(isForwards)\n const trimStep = _createTrimStep(isForwards)\n // iterate unitil it reaches either the final time or maximum iterations\n while (ongoing(t[n], tf)) {\n const k = []\n\n // trim the time step so that it doesn't overshoot\n h = trimStep(t[n], tf, h)\n\n // calculate the first value of k\n k.push(f(t[n], y[n]))\n\n // calculate the rest of the values of k\n for (let i = 1; i < c.length; ++i) {\n k.push(\n f(\n add(t[n], multiply(c[i], h)),\n add(y[n], multiply(h, a[i], k))\n )\n )\n }\n\n // estimate the error by comparing solutions of different orders\n const TE = max(\n abs(\n map(multiply(deltaB, k), (X) =>\n isUnit(X) ? X.value : X\n )\n )\n )\n\n if (TE < tol && tol / TE > 1 / 4) {\n // push solution if within tol\n t.push(add(t[n], h))\n y.push(add(y[n], multiply(h, b, k)))\n n++\n }\n\n // estimate the delta value that will affect the step size\n let delta = 0.84 * (tol / TE) ** (1 / 5)\n\n if (smaller(delta, minDelta)) {\n delta = minDelta\n } else if (larger(delta, maxDelta)) {\n delta = maxDelta\n }\n\n delta = hasBigNumbers ? bignumber(delta) : delta\n h = multiply(h, delta)\n\n if (maxStep && larger(abs(h), maxStep)) {\n h = isForwards ? maxStep : unaryMinus(maxStep)\n } else if (minStep && smaller(abs(h), minStep)) {\n h = isForwards ? minStep : unaryMinus(minStep)\n }\n iter++\n if (iter > maxIter) {\n throw new Error('Maximum number of iterations reached, try changing options')\n }\n }\n return { t, y }\n }\n }\n\n function _rk23 (f, tspan, y0, options) {\n // Bogacki–Shampine method\n\n // Define the butcher table\n const a = [\n [],\n [1 / 2],\n [0, 3 / 4],\n [2 / 9, 1 / 3, 4 / 9]\n ]\n\n const c = [null, 1 / 2, 3 / 4, 1]\n const b = [2 / 9, 1 / 3, 4 / 9, 0]\n const bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8]\n\n const butcherTableau = { a, c, b, bp }\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options)\n }\n\n function _rk45 (f, tspan, y0, options) {\n // Dormand Prince method\n\n // Define the butcher tableau\n const a = [\n [],\n [1 / 5],\n [3 / 40, 9 / 40],\n [44 / 45, -56 / 15, 32 / 9],\n [19372 / 6561, -25360 / 2187, 64448 / 6561, -212 / 729],\n [9017 / 3168, -355 / 33, 46732 / 5247, 49 / 176, -5103 / 18656],\n [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84]\n ]\n\n const c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1]\n const b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0]\n const bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40]\n\n const butcherTableau = { a, c, b, bp }\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options)\n }\n\n function _solveODE (f, tspan, y0, opt) {\n const method = opt.method ? opt.method : 'RK45'\n const methods = {\n RK23: _rk23,\n RK45: _rk45\n }\n if (method.toUpperCase() in methods) {\n const methodOptions = { ...opt } // clone the options object\n delete methodOptions.method // delete the method as it won't be needed\n return methods[method.toUpperCase()](f, tspan, y0, methodOptions)\n } else {\n // throw an error indicating there is no such method\n const methodsWithQuotes = Object.keys(methods).map(x => `\"${x}\"`)\n // generates a string of methods like: \"BDF\", \"RK23\" and \"RK45\"\n const availableMethodsString = `${methodsWithQuotes.slice(0, -1).join(', ')} and ${methodsWithQuotes.slice(-1)}`\n throw new Error(`Unavailable method \"${method}\". Available methods are ${availableMethodsString}`)\n }\n }\n\n function _createOngoing (isForwards) {\n // returns the correct function to test if it's still iterating\n return isForwards ? smaller : larger\n }\n\n function _createTrimStep (isForwards) {\n const outOfBounds = isForwards ? larger : smaller\n return function (t, tf, h) {\n const next = add(t, h)\n return outOfBounds(next, tf) ? subtract(tf, t) : h\n }\n }\n\n function isNumOrBig (x) {\n // checks if it's a number or bignumber\n return isBigNumber(x) || isNumber(x)\n }\n\n function _matrixSolveODE (f, T, y0, options) {\n // receives matrices and returns matrices\n const sol = _solveODE(f, T.toArray(), y0.toArray(), options)\n return { t: matrix(sol.t), y: matrix(sol.y) }\n }\n\n return typed('solveODE', {\n 'function, Array, Array, Object': _solveODE,\n 'function, Matrix, Matrix, Object': _matrixSolveODE,\n 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}),\n 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}),\n 'function, Array, number | BigNumber | Unit': (f, T, y0) => {\n const sol = _solveODE(f, T, [y0], {})\n return { t: sol.t, y: sol.y.map((Y) => Y[0]) }\n },\n 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => {\n const sol = _solveODE(f, T.toArray(), [y0], {})\n return { t: matrix(sol.t), y: matrix(sol.y.map((Y) => Y[0])) }\n },\n 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n const sol = _solveODE(f, T, [y0], options)\n return { t: sol.t, y: sol.y.map((Y) => Y[0]) }\n },\n 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n const sol = _solveODE(f, T.toArray(), [y0], options)\n return { t: matrix(sol.t), y: matrix(sol.y.map((Y) => Y[0])) }\n }\n })\n})\n","/* eslint-disable no-loss-of-precision */\n\nimport { deepMap } from '../../utils/collection.js'\nimport { sign } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'erf'\nconst dependencies = [\n 'typed'\n]\n\nexport const createErf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the erf function of a value using a rational Chebyshev\n * approximations for different intervals of x.\n *\n * This is a translation of W. J. Cody's Fortran implementation from 1987\n * ( https://www.netlib.org/specfun/erf ). See the AMS publication\n * \"Rational Chebyshev Approximations for the Error Function\" by W. J. Cody\n * for an explanation of this process.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.erf(x)\n *\n * Examples:\n *\n * math.erf(0.2) // returns 0.22270258921047847\n * math.erf(-0.5) // returns -0.5204998778130465\n * math.erf(4) // returns 0.9999999845827421\n *\n * See also:\n * zeta\n *\n * @param {number | Array | Matrix} x A real number\n * @return {number | Array | Matrix} The erf of `x`\n */\n return typed('name', {\n number: function (x) {\n const y = Math.abs(x)\n\n if (y >= MAX_NUM) {\n return sign(x)\n }\n if (y <= THRESH) {\n return sign(x) * erf1(y)\n }\n if (y <= 4.0) {\n return sign(x) * (1 - erfc2(y))\n }\n return sign(x) * (1 - erfc3(y))\n },\n\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n\n // TODO: For complex numbers, use the approximation for the Faddeeva function\n // from \"More Efficient Computation of the Complex Error Function\" (AMS)\n\n })\n\n /**\n * Approximates the error function erf() for x <= 0.46875 using this function:\n * n\n * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j))\n * j=0\n */\n function erf1 (y) {\n const ysq = y * y\n let xnum = P[0][4] * ysq\n let xden = ysq\n let i\n\n for (i = 0; i < 3; i += 1) {\n xnum = (xnum + P[0][i]) * ysq\n xden = (xden + Q[0][i]) * ysq\n }\n return y * (xnum + P[0][3]) / (xden + Q[0][3])\n }\n\n /**\n * Approximates the complement of the error function erfc() for\n * 0.46875 <= x <= 4.0 using this function:\n * n\n * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j)\n * j=0\n */\n function erfc2 (y) {\n let xnum = P[1][8] * y\n let xden = y\n let i\n\n for (i = 0; i < 7; i += 1) {\n xnum = (xnum + P[1][i]) * y\n xden = (xden + Q[1][i]) * y\n }\n const result = (xnum + P[1][7]) / (xden + Q[1][7])\n const ysq = parseInt(y * 16) / 16\n const del = (y - ysq) * (y + ysq)\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result\n }\n\n /**\n * Approximates the complement of the error function erfc() for x > 4.0 using\n * this function:\n *\n * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) +\n * n\n * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ]\n * j=0\n */\n function erfc3 (y) {\n let ysq = 1 / (y * y)\n let xnum = P[2][5] * ysq\n let xden = ysq\n let i\n\n for (i = 0; i < 4; i += 1) {\n xnum = (xnum + P[2][i]) * ysq\n xden = (xden + Q[2][i]) * ysq\n }\n let result = ysq * (xnum + P[2][4]) / (xden + Q[2][4])\n result = (SQRPI - result) / y\n ysq = parseInt(y * 16) / 16\n const del = (y - ysq) * (y + ysq)\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result\n }\n})\n\n/**\n * Upper bound for the first approximation interval, 0 <= x <= THRESH\n * @constant\n */\nconst THRESH = 0.46875\n\n/**\n * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi)\n * @constant\n */\nconst SQRPI = 5.6418958354775628695e-1\n\n/**\n * Coefficients for each term of the numerator sum (p_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nconst P = [[\n 3.16112374387056560e00, 1.13864154151050156e02,\n 3.77485237685302021e02, 3.20937758913846947e03,\n 1.85777706184603153e-1\n], [\n 5.64188496988670089e-1, 8.88314979438837594e00,\n 6.61191906371416295e01, 2.98635138197400131e02,\n 8.81952221241769090e02, 1.71204761263407058e03,\n 2.05107837782607147e03, 1.23033935479799725e03,\n 2.15311535474403846e-8\n], [\n 3.05326634961232344e-1, 3.60344899949804439e-1,\n 1.25781726111229246e-1, 1.60837851487422766e-2,\n 6.58749161529837803e-4, 1.63153871373020978e-2\n]]\n\n/**\n * Coefficients for each term of the denominator sum (q_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nconst Q = [[\n 2.36012909523441209e01, 2.44024637934444173e02,\n 1.28261652607737228e03, 2.84423683343917062e03\n], [\n 1.57449261107098347e01, 1.17693950891312499e02,\n 5.37181101862009858e02, 1.62138957456669019e03,\n 3.29079923573345963e03, 4.36261909014324716e03,\n 3.43936767414372164e03, 1.23033935480374942e03\n], [\n 2.56852019228982242e00, 1.87295284992346047e00,\n 5.27905102951428412e-1, 6.05183413124413191e-2,\n 2.33520497626869185e-3\n]]\n\n/**\n * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is\n * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will\n * return 1\n */\nconst MAX_NUM = Math.pow(2, 53)\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'zeta'\nconst dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi']\n\nexport const createZeta = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, multiply, pow, divide, factorial, equal, smallerEq, isNegative, gamma, sin, subtract, add, Complex, BigNumber, pi }) => {\n /**\n * Compute the Riemann Zeta function of a value using an infinite series for\n * all of the complex plane using Riemann's Functional equation.\n *\n * Based off the paper by Xavier Gourdon and Pascal Sebah\n * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf )\n *\n * Implementation and slight modification by Anik Patel\n *\n * Note: the implementation is accurate up to about 6 digits.\n *\n * Syntax:\n *\n * math.zeta(n)\n *\n * Examples:\n *\n * math.zeta(5) // returns 1.0369277551433895\n * math.zeta(-0.5) // returns -0.2078862249773449\n * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i\n *\n * See also:\n * erf\n *\n * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function\n * @return {number | Complex | BigNumber} The Riemann Zeta of `s`\n */\n return typed(name, {\n number: (s) => zetaNumeric(s, value => value, () => 20),\n BigNumber: (s) => zetaNumeric(\n s,\n value => new BigNumber(value),\n () => {\n // relTol is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.relTol))\n }\n ),\n Complex: zetaComplex\n })\n\n /**\n * @param {number | BigNumber} s\n * @param {(value: number) => number | BigNumber} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @returns {number | BigNumber}\n */\n function zetaNumeric (s, createValue, determineDigits) {\n if (equal(s, 0)) {\n return createValue(-0.5)\n }\n if (equal(s, 1)) {\n return createValue(NaN)\n }\n if (!isFinite(s)) {\n return isNegative(s) ? createValue(NaN) : createValue(1)\n }\n\n return zeta(s, createValue, determineDigits, s => s)\n }\n\n /**\n * @param {Complex} s\n * @returns {Complex}\n */\n function zetaComplex (s) {\n if (s.re === 0 && s.im === 0) {\n return new Complex(-0.5)\n }\n if (s.re === 1) {\n return new Complex(NaN, NaN)\n }\n if (s.re === Infinity && s.im === 0) {\n return new Complex(1)\n }\n if (s.im === Infinity || s.re === -Infinity) {\n return new Complex(NaN, NaN)\n }\n\n return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re)\n }\n\n /**\n * @param {number | BigNumber | Complex} s\n * @param {(value: number) => number | BigNumber | Complex} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @param {(value: number | BigNumber | Complex) => number} getRe\n * @returns {*|number}\n */\n function zeta (s, createValue, determineDigits, getRe) {\n const n = determineDigits(s)\n if (getRe(s) > -(n - 1) / 2) {\n return f(s, createValue(n), createValue)\n } else {\n // Function Equation for reflection to x < 1\n let c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1)))\n c = multiply(c, (sin(multiply(divide(createValue(pi), 2), s))))\n c = multiply(c, gamma(subtract(1, s)))\n return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe))\n }\n }\n\n /**\n * Calculate a portion of the sum\n * @param {number | BigNumber} k a positive integer\n * @param {number | BigNumber} n a positive integer\n * @return {number} the portion of the sum\n **/\n function d (k, n) {\n let S = k\n for (let j = k; smallerEq(j, n); j = add(j, 1)) {\n const factor = divide(\n multiply(factorial(add(n, subtract(j, 1))), pow(4, j)),\n multiply(factorial(subtract(n, j)), factorial(multiply(2, j)))\n )\n S = add(S, factor)\n }\n\n return multiply(n, S)\n }\n\n /**\n * Calculate the positive Riemann Zeta function\n * @param {number} s a real or complex number with s.re > 1\n * @param {number} n a positive integer\n * @param {(number) => number | BigNumber | Complex} createValue\n * @return {number} Riemann Zeta of s\n **/\n function f (s, n, createValue) {\n const c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s)))))\n let S = createValue(0)\n for (let k = createValue(1); smallerEq(k, n); k = add(k, 1)) {\n S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s)))\n }\n return multiply(c, S)\n }\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'mode'\nconst dependencies = ['typed', 'isNaN', 'isNumeric']\n\nexport const createMode = /* #__PURE__ */ factory(name, dependencies, ({ typed, isNaN, isNumeric }) => {\n /**\n * Computes the mode of a set of numbers or a list with values(numbers or characters).\n * If there are multiple modes, it returns a list of those values.\n *\n * Syntax:\n *\n * math.mode(a, b, c, ...)\n * math.mode(A)\n *\n * Examples:\n *\n * math.mode(2, 1, 4, 3, 1) // returns [1]\n * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]\n * math.mode(1, 4, 6, 1, 6) // returns [1, 6]\n * math.mode('a','a','b','c') // returns [\"a\"]\n * math.mode(1, 1.5, 'abc') // returns [1, 1.5, \"abc\"]\n *\n * See also:\n *\n * median,\n * mean\n *\n * @param {... *} args A single matrix\n * @return {*} The mode of all values\n */\n return typed(name, {\n 'Array | Matrix': _mode,\n\n '...': function (args) {\n return _mode(args)\n }\n })\n\n /**\n * Calculates the mode in an 1-dimensional array\n * @param {Array} values\n * @return {Array} mode\n * @private\n */\n function _mode (values) {\n values = flatten(values.valueOf())\n const num = values.length\n if (num === 0) {\n throw new Error('Cannot calculate mode of an empty array')\n }\n\n const count = {}\n let mode = []\n let max = 0\n for (let i = 0; i < values.length; i++) {\n const value = values[i]\n\n if (isNumeric(value) && isNaN(value)) {\n throw new Error('Cannot calculate mode of an array containing NaN values')\n }\n\n if (!(value in count)) {\n count[value] = 0\n }\n\n count[value]++\n\n if (count[value] === max) {\n mode.push(value)\n } else if (count[value] > max) {\n max = count[value]\n mode = [value]\n }\n }\n return mode\n }\n})\n","import { typeOf } from '../../../utils/is.js'\n\n/**\n * Improve error messages for statistics functions. Errors are typically\n * thrown in an internally used function like larger, causing the error\n * not to mention the function (like max) which is actually used by the user.\n *\n * @param {Error} err\n * @param {String} fnName\n * @param {*} [value]\n * @return {Error}\n */\nexport function improveErrorMessage (err, fnName, value) {\n // TODO: add information with the index (also needs transform in expression parser)\n let details\n\n if (String(err).includes('Unexpected type')) {\n details = arguments.length > 2\n ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')'\n : ' (type: ' + err.data.actual + ')'\n\n return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details)\n }\n\n if (String(err).includes('complex numbers')) {\n details = arguments.length > 2\n ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')'\n : ''\n\n return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details)\n }\n\n return err\n}\n","import { deepForEach } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'prod'\nconst dependencies = ['typed', 'config', 'multiplyScalar', 'numeric']\n\nexport const createProd = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, multiplyScalar, numeric }) => {\n /**\n * Compute the product of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.prod(a, b, c, ...)\n * math.prod(A)\n *\n * Examples:\n *\n * math.multiply(2, 3) // returns 6\n * math.prod(2, 3) // returns 6\n * math.prod(2, 3, 4) // returns 24\n * math.prod([2, 3, 4]) // returns 24\n * math.prod([[2, 5], [4, 3]]) // returns 120\n *\n * See also:\n *\n * mean, median, min, max, sum, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The product of all values\n */\n return typed(name, {\n // prod([a, b, c, d, ...])\n 'Array | Matrix': _prod,\n\n // prod([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function (array, dim) {\n // TODO: implement prod(A, dim)\n throw new Error('prod(A, dim) is not yet supported')\n // return reduce(arguments[0], arguments[1], math.prod)\n },\n\n // prod(a, b, c, d, ...)\n '...': function (args) {\n return _prod(args)\n }\n })\n\n /**\n * Recursively calculate the product of an n-dimensional array\n * @param {Array} array\n * @return {number} prod\n * @private\n */\n function _prod (array) {\n let prod\n\n deepForEach(array, function (value) {\n try {\n prod = (prod === undefined) ? value : multiplyScalar(prod, value)\n } catch (err) {\n throw improveErrorMessage(err, 'prod', value)\n }\n })\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof prod === 'string') {\n prod = numeric(prod, safeNumberType(prod, config))\n }\n\n if (prod === undefined) {\n throw new Error('Cannot calculate prod of an empty array')\n }\n\n return prod\n }\n})\n","import { format as formatString } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'format'\nconst dependencies = ['typed']\n\nexport const createFormat = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Format a value of any type into a string.\n *\n * Syntax:\n *\n * math.format(value)\n * math.format(value, options)\n * math.format(value, precision)\n * math.format(value, callback)\n *\n * Where:\n *\n * - `value: *`\n * The value to be formatted\n * - `options: Object`\n * An object with formatting options. Available options:\n * - `notation: string`\n * Number notation. Choose from:\n * - `'fixed'`\n * Always use regular number notation.\n * For example `'123.40'` and `'14000000'`\n * - `'exponential'`\n * Always use exponential notation.\n * For example `'1.234e+2'` and `'1.4e+7'`\n * - `'engineering'`\n * Always use engineering notation: always have exponential notation,\n * and select the exponent to be a multiple of `3`.\n * For example `'123.4e+0'` and `'14.0e+6'`\n * - `'auto'` (default)\n * Regular number notation for numbers having an absolute value between\n * `lower` and `upper` bounds, and uses exponential notation elsewhere.\n * Lower bound is included, upper bound is excluded.\n * For example `'123.4'` and `'1.4e7'`.\n * - `'bin'`, `'oct'`, or `'hex'`\n * Format the number using binary, octal, or hexadecimal notation.\n * For example `'0b1101'` and `'0x10fe'`.\n * - `wordSize: number | BigNumber`\n * The word size in bits to use for formatting in binary, octal, or\n * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'`\n * values for `notation` option. When this option is defined the value\n * is formatted as a signed twos complement integer of the given word\n * size and the size suffix is appended to the output.\n * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`.\n * Default value is undefined.\n * - `precision: number | BigNumber`\n * Limit the number of digits of the formatted value.\n * For regular numbers, must be a number between `0` and `16`.\n * For bignumbers, the maximum depends on the configured precision,\n * see function `config()`.\n * In case of notations `'exponential'`, `'engineering'`, and `'auto'`,\n * `precision` defines the total number of significant digits returned.\n * In case of notation `'fixed'`, `precision` defines the number of\n * significant digits after the decimal point.\n * `precision` is undefined by default.\n * - `lowerExp: number`\n * Exponent determining the lower boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `-3`.\n * - `upperExp: number`\n * Exponent determining the upper boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `5`.\n * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`.\n * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'`\n * is configured, and will output `'0.(3)'` when `'decimal'` is configured.\n * - `truncate: number`. Specifies the maximum allowed length of the\n * returned string. If it had been longer, the excess characters\n * are deleted and replaced with `'...'`.\n * - `callback: function`\n * A custom formatting function, invoked for all numeric elements in `value`,\n * for example all elements of a matrix, or the real and imaginary\n * parts of a complex number. This callback can be used to override the\n * built-in numeric notation with any type of formatting. Function `callback`\n * is called with `value` as parameter and must return a string.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this function\n * is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * Examples:\n *\n * math.format(6.4) // returns '6.4'\n * math.format(1240000) // returns '1.24e+6'\n * math.format(1/3) // returns '0.3333333333333333'\n * math.format(1/3, 3) // returns '0.333'\n * math.format(21385, 2) // returns '21000'\n * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'\n * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'\n *\n * function formatCurrency(value) {\n * // return currency notation with two digits:\n * return '$' + value.toFixed(2)\n *\n * // you could also use math.format inside the callback:\n * // return '$' + math.format(value, {notation: 'fixed', precision: 2})\n * }\n * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]'\n *\n * See also:\n *\n * print\n *\n * @param {*} value Value to be stringified\n * @param {Object | Function | number} [options] Formatting options\n * @return {string} The formatted value\n */\n return typed(name, {\n any: formatString,\n 'any, Object | function | number | BigNumber': formatString\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'bin'\nconst dependencies = ['typed', 'format']\n\n/**\n * Format a number as binary.\n *\n * Syntax:\n *\n * math.bin(value)\n *\n * Examples:\n *\n * //the following outputs \"0b10\"\n * math.bin(2)\n *\n * See also:\n *\n * oct\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport const createBin = factory(name, dependencies, ({ typed, format }) => {\n return typed(name, {\n 'number | BigNumber': function (n) {\n return format(n, { notation: 'bin' })\n },\n 'number | BigNumber, number | BigNumber': function (n, wordSize) {\n return format(n, { notation: 'bin', wordSize })\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'oct'\nconst dependencies = ['typed', 'format']\n\n/**\n * Format a number as octal.\n *\n * Syntax:\n *\n * math.oct(value)\n *\n * Examples:\n *\n * //the following outputs \"0o70\"\n * math.oct(56)\n *\n * See also:\n *\n * bin\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\n\nexport const createOct = factory(name, dependencies, ({ typed, format }) => {\n return typed(name, {\n 'number | BigNumber': function (n) {\n return format(n, { notation: 'oct' })\n },\n 'number | BigNumber, number | BigNumber': function (n, wordSize) {\n return format(n, { notation: 'oct', wordSize })\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'hex'\nconst dependencies = ['typed', 'format']\n\n/**\n * Format a number as hexadecimal.\n *\n * Syntax:\n *\n * math.hex(value)\n *\n * Examples:\n *\n * math.hex(240) // returns \"0xF0\"\n *\n * See also:\n *\n * oct\n * bin\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport const createHex = factory(name, dependencies, ({ typed, format }) => {\n return typed(name, {\n 'number | BigNumber': function (n) {\n return format(n, { notation: 'hex' })\n },\n 'number | BigNumber, number | BigNumber': function (n, wordSize) {\n return format(n, { notation: 'hex', wordSize })\n }\n })\n})\n","export const printTemplate = /\\$([\\w.]+)/g\n","import { format } from '../../utils/string.js'\nimport { isString } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { printTemplate } from '../../utils/print.js'\n\nconst name = 'print'\nconst dependencies = ['typed']\n\nexport const createPrint = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Interpolate values into a string template.\n *\n * Syntax:\n *\n * math.print(template, values)\n * math.print(template, values, precision)\n * math.print(template, values, options)\n *\n * Example usage:\n *\n * // the following outputs: 'Lucy is 5 years old'\n * math.print('Lucy is $age years old', {age: 5})\n *\n * // the following outputs: 'The value of pi is 3.141592654'\n * math.print('The value of pi is $pi', {pi: math.pi}, 10)\n *\n * // the following outputs: 'hello Mary! The date is 2013-03-23'\n * math.print('Hello $user.name! The date is $date', {\n * user: {\n * name: 'Mary',\n * },\n * date: new Date(2013, 2, 23).toISOString().substring(0, 10)\n * })\n *\n * // the following outputs: 'My favorite fruits are apples and bananas !'\n * math.print('My favorite fruits are $0 and $1 !', [\n * 'apples',\n * 'bananas'\n * ])\n *\n * See also:\n *\n * format\n *\n * @param {string} template A string containing variable placeholders.\n * @param {Object | Array | Matrix} values An object or array containing variables\n * which will be filled in in the template.\n * @param {number | Object} [options] Formatting options,\n * or the number of digits to format numbers.\n * See function math.format for a description\n * of all options.\n * @return {string} Interpolated string\n */\n return typed(name, {\n // note: Matrix will be converted automatically to an Array\n 'string, Object | Array': _print,\n 'string, Object | Array, number | Object': _print\n })\n})\n\n/**\n * Interpolate values into a string template.\n * @param {string} template\n * @param {Object} values\n * @param {number | Object} [options]\n * @returns {string} Interpolated string\n * @private\n */\nfunction _print (template, values, options) {\n return template.replace(printTemplate, function (original, key) {\n const keys = key.split('.')\n let value = values[keys.shift()]\n if (value !== undefined && value.isMatrix) {\n value = value.toArray()\n }\n while (keys.length && value !== undefined) {\n const k = keys.shift()\n value = k ? value[k] : value + '.'\n }\n\n if (value !== undefined) {\n if (!isString(value)) {\n return format(value, options)\n } else {\n return value\n }\n }\n\n return original\n }\n )\n}\n","import { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'to'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'concat'\n]\n\nexport const createTo = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, concat }) => {\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Change the unit of a value.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.to(x, unit)\n *\n * Examples:\n *\n * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm\n * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm\n * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits\n *\n * See also:\n *\n * unit\n *\n * @param {Unit | Array | Matrix} x The unit to be converted.\n * @param {Unit | Array | Matrix} unit New unit. Can be a string like \"cm\"\n * or a unit without value.\n * @return {Unit | Array | Matrix} value with changed, fixed unit.\n */\n return typed(\n name,\n { 'Unit, Unit | string': (x, unit) => x.to(unit) },\n matrixAlgorithmSuite({ Ds: true })\n )\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'isPrime'\nconst dependencies = ['typed']\n\nexport const createIsPrime = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Test whether a value is prime: has no divisors other than itself and one.\n * The function supports type `number`, `bignumber`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPrime(x)\n *\n * Examples:\n *\n * math.isPrime(3) // returns true\n * math.isPrime(-2) // returns false\n * math.isPrime(0) // returns false\n * math.isPrime(-0) // returns false\n * math.isPrime(0.5) // returns false\n * math.isPrime('2') // returns true\n * math.isPrime([2, 17, 100]) // returns [true, true, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: function (x) {\n if (x <= 3) {\n return x > 1\n }\n if (x % 2 === 0 || x % 3 === 0) {\n return false\n }\n for (let i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false\n }\n }\n return true\n },\n\n bigint: function (x) {\n if (x <= 3n) {\n return x > 1n\n }\n if (x % 2n === 0n || x % 3n === 0n) {\n return false\n }\n for (let i = 5n; i * i <= x; i += 6n) {\n if (x % i === 0n || x % (i + 2n) === 0n) {\n return false\n }\n }\n return true\n },\n\n BigNumber: function (n) {\n if (n.lte(3)) return n.gt(1)\n if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false\n if (n.lt(Math.pow(2, 32))) {\n const x = n.toNumber()\n for (let i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false\n }\n }\n return true\n }\n\n function modPow (base, exponent, modulus) {\n // exponent can be huge, use non-recursive variant\n let accumulator = 1\n while (!exponent.eq(0)) {\n if (exponent.mod(2).eq(0)) {\n exponent = exponent.div(2)\n base = base.mul(base).mod(modulus)\n } else {\n exponent = exponent.sub(1)\n accumulator = base.mul(accumulator).mod(modulus)\n }\n }\n return accumulator\n }\n\n // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants\n const Decimal = n.constructor.clone({ precision: n.toFixed(0).length * 2 })\n n = new Decimal(n)\n let r = 0\n let d = n.sub(1)\n while (d.mod(2).eq(0)) {\n d = d.div(2)\n r += 1\n }\n let bases = null\n // https://en.wikipedia.org/wiki/Miller–Rabin_primality_test#Testing_against_small_sets_of_bases\n if (n.lt('3317044064679887385961981')) {\n bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n)\n } else {\n const max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)))\n bases = []\n for (let i = 2; i <= max; i += 1) {\n bases.push(max)\n }\n }\n for (let i = 0; i < bases.length; i += 1) {\n const a = bases[i]\n const adn = modPow(n.sub(n).add(a), d, n)\n if (!adn.eq(1)) {\n for (let i = 0, x = adn; !x.eq(n.sub(1)); i += 1, x = x.mul(x).mod(n)) {\n if (i === r - 1) {\n return false\n }\n }\n }\n }\n return true\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { noBignumber, noFraction } from '../../utils/noop.js'\n\nconst name = 'numeric'\nconst dependencies = ['number', '?bignumber', '?fraction']\n\nexport const createNumeric = /* #__PURE__ */ factory(name, dependencies, ({ number, bignumber, fraction }) => {\n const validInputTypes = {\n string: true,\n number: true,\n BigNumber: true,\n Fraction: true\n }\n\n // Load the conversion functions for each output type\n const validOutputTypes = {\n number: (x) => number(x),\n BigNumber: bignumber\n ? (x) => bignumber(x)\n : noBignumber,\n bigint: (x) => BigInt(x),\n Fraction: fraction\n ? (x) => fraction(x)\n : noFraction\n }\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\n *\n * Syntax:\n *\n * math.numeric(x)\n *\n * Examples:\n *\n * math.numeric('4') // returns 4\n * math.numeric('4', 'number') // returns 4\n * math.numeric('4', 'bigint') // returns 4n\n * math.numeric('4', 'BigNumber') // returns BigNumber 4\n * math.numeric('4', 'Fraction') // returns Fraction 4\n * math.numeric(4, 'Fraction') // returns Fraction 4\n * math.numeric(math.fraction(2, 5), 'number') // returns 0.4\n *\n * See also:\n *\n * number, fraction, bignumber, bigint, string, format\n *\n * @param {string | number | BigNumber | bigint | Fraction } value\n * A numeric value or a string containing a numeric value\n * @param {string} outputType\n * Desired numeric output type.\n * Available values: 'number', 'BigNumber', or 'Fraction'\n * @return {number | BigNumber | bigint | Fraction}\n * Returns an instance of the numeric in the requested type\n */\n return function numeric (value, outputType = 'number', check) {\n if (check !== undefined) {\n throw new SyntaxError('numeric() takes one or two arguments')\n }\n const inputType = typeOf(value)\n\n if (!(inputType in validInputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' of type \"' + inputType + '\"; valid input types are ' + Object.keys(validInputTypes).join(', '))\n }\n if (!(outputType in validOutputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' to type \"' + outputType + '\"; valid output types are ' + Object.keys(validOutputTypes).join(', '))\n }\n\n if (outputType === inputType) {\n return value\n } else {\n return validOutputTypes[outputType](value)\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'divideScalar'\nconst dependencies = ['typed', 'numeric']\n\nexport const createDivideScalar = /* #__PURE__ */ factory(name, dependencies, ({ typed, numeric }) => {\n /**\n * Divide two scalar values, `x / y`.\n * This function is meant for internal use: it is used by the public functions\n * `divide` and `inv`.\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y`\n * @private\n */\n return typed(name, {\n 'number, number': function (x, y) {\n return x / y\n },\n\n 'Complex, Complex': function (x, y) {\n return x.div(y)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.div(y)\n },\n\n 'bigint, bigint': function (x, y) {\n return x / y\n },\n\n 'Fraction, Fraction': function (x, y) {\n return x.div(y)\n },\n\n 'Unit, number | Complex | Fraction | BigNumber | Unit':\n (x, y) => x.divide(y),\n\n 'number | Fraction | Complex | BigNumber, Unit':\n (x, y) => y.divideInto(x)\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { isInteger } from '../../utils/number.js'\nimport { arraySize as size } from '../../utils/array.js'\nimport { powNumber } from '../../plain/number/index.js'\n\nconst name = 'pow'\nconst dependencies = [\n 'typed',\n 'config',\n 'identity',\n 'multiply',\n 'matrix',\n 'inv',\n 'fraction',\n 'number',\n 'Complex'\n]\n\nexport const createPow = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, identity, multiply, matrix, inv, number, fraction, Complex }) => {\n /**\n * Calculates the power of x to y, `x ^ y`.\n *\n * Matrix exponentiation is supported for square matrices `x` and integers `y`:\n * when `y` is nonnegative, `x` may be any square matrix; and when `y` is\n * negative, `x` must be invertible, and then this function returns\n * inv(x)^(-y).\n *\n * For cubic roots of negative numbers, the function returns the principal\n * root by default. In order to let the function return the real root,\n * math.js can be configured with `math.config({predictable: true})`.\n * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`.\n *\n * Syntax:\n *\n * math.pow(x, y)\n *\n * Examples:\n *\n * math.pow(2, 3) // returns number 8\n *\n * const a = math.complex(2, 3)\n * math.pow(a, 2) // returns Complex -5 + 12i\n *\n * const b = [[1, 2], [4, 3]]\n * math.pow(b, 2) // returns Array [[9, 8], [16, 17]]\n *\n * const c = [[1, 2], [4, 3]]\n * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]]\n *\n * See also:\n *\n * multiply, sqrt, cbrt, nthRoot\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | bigint | Complex} y The exponent\n * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, {\n 'number, number': _pow,\n\n 'Complex, Complex': function (x, y) {\n return x.pow(y)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n if (y.isInteger() || x >= 0 || config.predictable) {\n return x.pow(y)\n } else {\n return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0)\n }\n },\n\n 'bigint, bigint': (x, y) => x ** y,\n\n 'Fraction, Fraction': function (x, y) {\n const result = x.pow(y)\n\n if (result != null) {\n return result\n }\n\n if (config.predictable) {\n throw new Error('Result of pow is non-rational and cannot be expressed as a fraction')\n } else {\n return _pow(x.valueOf(), y.valueOf())\n }\n },\n\n 'Array, number': _powArray,\n\n 'Array, BigNumber': function (x, y) {\n return _powArray(x, y.toNumber())\n },\n\n 'Matrix, number': _powMatrix,\n\n 'Matrix, BigNumber': function (x, y) {\n return _powMatrix(x, y.toNumber())\n },\n\n 'Unit, number | BigNumber': function (x, y) {\n return x.pow(y)\n }\n\n })\n\n /**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number | Complex} res\n * @private\n */\n function _pow (x, y) {\n // Alternatively could define a 'realmode' config option or something, but\n // 'predictable' will work for now\n if (config.predictable && !isInteger(y) && x < 0) {\n // Check to see if y can be represented as a fraction\n try {\n const yFrac = fraction(y)\n const yNum = number(yFrac)\n if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) {\n if (yFrac.d % 2 === 1) {\n return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y)\n }\n }\n } catch (ex) {\n // fraction() throws an error if y is Infinity, etc.\n }\n\n // Unable to express y as a fraction, so continue on\n }\n\n // **for predictable mode** x^Infinity === NaN if x < -1\n // N.B. this behavour is different from `Math.pow` which gives\n // (-2)^Infinity === Infinity\n if (config.predictable &&\n ((x < -1 && y === Infinity) ||\n (x > -1 && x < 0 && y === -Infinity))) {\n return NaN\n }\n\n if (isInteger(y) || x >= 0 || config.predictable) {\n return powNumber(x, y)\n } else {\n // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow\n\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if ((x * x < 1 && y === Infinity) ||\n (x * x > 1 && y === -Infinity)) {\n return 0\n }\n\n return new Complex(x, 0).pow(y, 0)\n }\n }\n\n /**\n * Calculate the power of a 2d array\n * @param {Array} x must be a 2 dimensional, square matrix\n * @param {number} y a integer value (positive if `x` is not invertible)\n * @returns {Array}\n * @private\n */\n function _powArray (x, y) {\n if (!isInteger(y)) {\n throw new TypeError('For A^b, b must be an integer (value is ' + y + ')')\n }\n // verify that A is a 2 dimensional square matrix\n const s = size(x)\n if (s.length !== 2) {\n throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)')\n }\n if (s[0] !== s[1]) {\n throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')')\n }\n if (y < 0) {\n try {\n return _powArray(inv(x), -y)\n } catch (error) {\n if (error.message === 'Cannot calculate inverse, determinant is zero') {\n throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')')\n }\n throw error\n }\n }\n\n let res = identity(s[0]).valueOf()\n let px = x\n while (y >= 1) {\n if ((y & 1) === 1) {\n res = multiply(px, res)\n }\n y >>= 1\n px = multiply(px, px)\n }\n return res\n }\n\n /**\n * Calculate the power of a 2d matrix\n * @param {Matrix} x must be a 2 dimensional, square matrix\n * @param {number} y a positive, integer value\n * @returns {Matrix}\n * @private\n */\n function _powMatrix (x, y) {\n return matrix(_powArray(x.valueOf(), y))\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { nearlyEqual, splitNumber } from '../../utils/number.js'\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { roundNumber } from '../../plain/number/index.js'\n\nconst NO_INT = 'Number of decimals in function round must be an integer'\n\nconst name = 'round'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'BigNumber',\n 'DenseMatrix'\n]\n\nexport const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, equalScalar, zeros, BigNumber, DenseMatrix }) => {\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n function toExponent (epsilon) {\n return Math.abs(splitNumber(epsilon).exponent)\n }\n\n /**\n * Round a value towards the nearest rounded value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.round(x)\n * math.round(x, n)\n * math.round(unit, valuelessUnit)\n * math.round(unit, n, valuelessUnit)\n *\n * Examples:\n *\n * math.round(3.22) // returns number 3\n * math.round(3.82) // returns number 4\n * math.round(-4.2) // returns number -4\n * math.round(-4.7) // returns number -5\n * math.round(3.22, 1) // returns number 3.2\n * math.round(3.88, 1) // returns number 3.9\n * math.round(-4.21, 1) // returns number -4.2\n * math.round(-4.71, 1) // returns number -4.7\n * math.round(math.pi, 3) // returns number 3.142\n * math.round(123.45678, 2) // returns number 123.46\n *\n * const c = math.complex(3.2, -2.7)\n * math.round(c) // returns Complex 3 - 3i\n *\n * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.round(unit, 1, cm) // returns Unit 3.2 cm\n * math.round(unit, 1, mm) // returns Unit 32.4 mm\n *\n * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5]\n *\n * See also:\n *\n * ceil, fix, floor\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @param {Unit} [valuelessUnit] A valueless unit\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed(name, {\n number: function (x) {\n // Handle round off errors by first rounding to relTol precision\n const xEpsilon = roundNumber(x, toExponent(config.relTol))\n const xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x\n return roundNumber(xSelected)\n },\n\n 'number, number': function (x, n) {\n // Same as number: unless user specifies more decimals than relTol\n const epsilonExponent = toExponent(config.relTol)\n if (n >= epsilonExponent) { return roundNumber(x, n) }\n\n const xEpsilon = roundNumber(x, epsilonExponent)\n const xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x\n return roundNumber(xSelected, n)\n },\n\n 'number, BigNumber': function (x, n) {\n if (!n.isInteger()) { throw new TypeError(NO_INT) }\n\n return new BigNumber(x).toDecimalPlaces(n.toNumber())\n },\n\n Complex: function (x) {\n return x.round()\n },\n\n 'Complex, number': function (x, n) {\n if (n % 1) { throw new TypeError(NO_INT) }\n\n return x.round(n)\n },\n\n 'Complex, BigNumber': function (x, n) {\n if (!n.isInteger()) { throw new TypeError(NO_INT) }\n\n const _n = n.toNumber()\n return x.round(_n)\n },\n\n BigNumber: function (x) {\n // Handle round off errors by first rounding to relTol precision\n const xEpsilon = new BigNumber(x).toDecimalPlaces(toExponent(config.relTol))\n const xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x\n return xSelected.toDecimalPlaces(0)\n },\n\n 'BigNumber, BigNumber': function (x, n) {\n if (!n.isInteger()) { throw new TypeError(NO_INT) }\n\n // Same as BigNumber: unless user specifies more decimals than relTol\n const epsilonExponent = toExponent(config.relTol)\n if (n >= epsilonExponent) { return x.toDecimalPlaces(n.toNumber()) }\n\n const xEpsilon = x.toDecimalPlaces(epsilonExponent)\n const xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x\n return xSelected.toDecimalPlaces(n.toNumber())\n },\n\n Fraction: function (x) {\n return x.round()\n },\n\n 'Fraction, number': function (x, n) {\n if (n % 1) { throw new TypeError(NO_INT) }\n return x.round(n)\n },\n\n 'Fraction, BigNumber': function (x, n) {\n if (!n.isInteger()) { throw new TypeError(NO_INT) }\n return x.round(n.toNumber())\n },\n\n 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) {\n const valueless = x.toNumeric(unit)\n return unit.multiply(self(valueless, n))\n }),\n\n 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n\n 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n\n 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, (value) => self(value, n, unit), true)\n }),\n\n 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n\n 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, self, true)\n }),\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo11xS0s(x, n, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo14xDs(x, n, self, false)\n }),\n\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), n, self, false).valueOf()\n }),\n\n 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage())\n }\n return matAlgo12xSfs(n, x, self, true)\n }),\n\n 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage())\n }\n return matAlgo14xDs(n, x, self, true)\n }),\n\n 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(n), x, self, true).valueOf()\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { logNumber } from '../../plain/number/index.js'\n\nconst name = 'log'\nconst dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n\nexport const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n /**\n * Calculate the logarithm of a value.\n *\n * To avoid confusion with the matrix logarithm, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.log(x)\n * math.log(x, base)\n *\n * Examples:\n *\n * math.log(3.5) // returns 1.252762968495368\n * math.exp(math.log(2.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log(10000, 10) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n *\n * math.log(1024, 2) // returns 10\n * math.pow(2, 10) // returns 1024\n *\n * See also:\n *\n * exp, log2, log10, log1p\n *\n * @param {number | BigNumber | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Complex}\n * Returns the logarithm of `x`\n */\n return typed(name, {\n number: function (x) {\n if (x >= 0 || config.predictable) {\n return logNumber(x)\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log()\n }\n },\n\n Complex: function (x) {\n return x.log()\n },\n\n BigNumber: function (x) {\n if (!x.isNegative() || config.predictable) {\n return x.ln()\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log()\n }\n },\n\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n return divideScalar(self(x), self(base))\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { log1p as _log1p } from '../../utils/number.js'\n\nconst name = 'log1p'\nconst dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex']\n\nexport const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, divideScalar, log, Complex }) => {\n /**\n * Calculate the logarithm of a `value+1`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log1p(x)\n * math.log1p(x, base)\n *\n * Examples:\n *\n * math.log1p(2.5) // returns 1.252762968495368\n * math.exp(math.log1p(1.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log1p(9999, 10) // returns 4\n * math.log1p(9999) / math.log(10) // returns 4\n *\n * See also:\n *\n * exp, log, log2, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm of `x+1`.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x+1` is calculated.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the logarithm of `x+1`\n */\n return typed(name, {\n number: function (x) {\n if (x >= -1 || config.predictable) {\n return _log1p(x)\n } else {\n // negative value -> complex value computation\n return _log1pComplex(new Complex(x, 0))\n }\n },\n\n Complex: _log1pComplex,\n\n BigNumber: function (x) {\n const y = x.plus(1)\n if (!y.isNegative() || config.predictable) {\n return y.ln()\n } else {\n // downgrade to number, return Complex valued result\n return _log1pComplex(new Complex(x.toNumber(), 0))\n }\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log1p(x, base)\n return divideScalar(self(x), log(base))\n })\n })\n\n /**\n * Calculate the natural logarithm of a complex number + 1\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log1pComplex (x) {\n const xRe1p = x.re + 1\n return new Complex(\n Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)),\n Math.atan2(x.im, xRe1p)\n )\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'nthRoots'\nconst dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n\nexport const createNthRoots = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n /**\n * Each function here returns a real multiple of i as a Complex value.\n * @param {number} val\n * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3\n */\n // This is used to fix float artifacts for zero-valued components.\n const _calculateExactResult = [\n function realPos (val) { return new Complex(val, 0) },\n function imagPos (val) { return new Complex(0, val) },\n function realNeg (val) { return new Complex(-val, 0) },\n function imagNeg (val) { return new Complex(0, -val) }\n ]\n\n /**\n * Calculate the nth root of a Complex Number a using De Movire's Theorem.\n * @param {Complex} a\n * @param {number} root\n * @return {Array} array of n Complex Roots\n */\n function _nthComplexRoots (a, root) {\n if (root < 0) throw new Error('Root must be greater than zero')\n if (root === 0) throw new Error('Root must be non-zero')\n if (root % 1 !== 0) throw new Error('Root must be an integer')\n if (a === 0 || a.abs() === 0) return [new Complex(0, 0)]\n const aIsNumeric = typeof (a) === 'number'\n let offset\n // determine the offset (argument of a)/(pi/2)\n if (aIsNumeric || a.re === 0 || a.im === 0) {\n if (aIsNumeric) {\n offset = 2 * (+(a < 0)) // numeric value on the real axis\n } else if (a.im === 0) {\n offset = 2 * (+(a.re < 0)) // complex value on the real axis\n } else {\n offset = 2 * (+(a.im < 0)) + 1 // complex value on the imaginary axis\n }\n }\n const arg = a.arg()\n const abs = a.abs()\n const roots = []\n const r = Math.pow(abs, 1 / root)\n for (let k = 0; k < root; k++) {\n const halfPiFactor = (offset + 4 * k) / root\n /**\n * If (offset + 4*k)/root is an integral multiple of pi/2\n * then we can produce a more exact result.\n */\n if (halfPiFactor === Math.round(halfPiFactor)) {\n roots.push(_calculateExactResult[halfPiFactor % 4](r))\n continue\n }\n roots.push(new Complex({ r, phi: (arg + 2 * Math.PI * k) / root }))\n }\n return roots\n }\n\n /**\n * Calculate the nth roots of a value.\n * An nth root of a positive real number A,\n * is a positive real solution of the equation \"x^root = A\".\n * This function returns an array of complex values.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1)\n * // returns [\n * // {re: 1, im: 0},\n * // {re: -1, im: 0}\n * // ]\n * math.nthRoots(1, 3)\n * // returns [\n * // { re: 1, im: 0 },\n * // { re: -0.4999999999999998, im: 0.8660254037844387 },\n * // { re: -0.5000000000000004, im: -0.8660254037844385 }\n * // ]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * @param {number | BigNumber | Fraction | Complex} x Number to be rounded\n * @param {number} [root=2] Optional root, default value is 2\n * @return {number | BigNumber | Fraction | Complex} Returns the nth roots\n */\n return typed(name, {\n Complex: function (x) {\n return _nthComplexRoots(x, 2)\n },\n 'Complex, number': _nthComplexRoots\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'dotPow'\nconst dependencies = [\n 'typed',\n 'equalScalar',\n 'matrix',\n 'pow',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createDotPow = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar, matrix, pow, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n const powScalarSignatures = {}\n for (const signature in pow.signatures) {\n if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) {\n if (!signature.includes('Matrix') && !signature.includes('Array')) {\n powScalarSignatures[signature] = pow.signatures[signature]\n }\n }\n }\n const powScalar = typed(powScalarSignatures)\n\n /**\n * Calculates the power of x to y element wise.\n *\n * Syntax:\n *\n * math.dotPow(x, y)\n *\n * Examples:\n *\n * math.dotPow(2, 3) // returns number 8\n *\n * const a = [[1, 2], [4, 3]]\n * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]\n * math.pow(a, 2) // returns Array [[9, 8], [16, 17]]\n *\n * See also:\n *\n * pow, sqrt, multiply\n *\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent\n * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: powScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }))\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'dotDivide'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'divideScalar',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createDotDivide = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, divideScalar, DenseMatrix, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Divide two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotDivide(x, y)\n *\n * Examples:\n *\n * math.dotDivide(2, 4) // returns 0.5\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]]\n * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]]\n *\n * See also:\n *\n * divide, multiply, dotMultiply\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: divideScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }))\n})\n","import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js'\nimport { arraySize } from '../../../../utils/array.js'\nimport { format } from '../../../../utils/string.js'\n\nexport function createSolveValidation ({ DenseMatrix }) {\n /**\n * Validates matrix and column vector b for backward/forward substitution algorithms.\n *\n * @param {Matrix} m An N x N matrix\n * @param {Array | Matrix} b A column vector\n * @param {Boolean} copy Return a copy of vector b\n *\n * @return {DenseMatrix} Dense column vector b\n */\n return function solveValidation (m, b, copy) {\n const mSize = m.size()\n\n if (mSize.length !== 2) {\n throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')')\n }\n\n const rows = mSize[0]\n const columns = mSize[1]\n\n if (rows !== columns) {\n throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')')\n }\n\n let data = []\n\n if (isMatrix(b)) {\n const bSize = b.size()\n const bdata = b._data\n\n // 1-dim vector\n if (bSize.length === 1) {\n if (bSize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.')\n }\n\n for (let i = 0; i < rows; i++) {\n data[i] = [bdata[i]]\n }\n\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n })\n }\n\n // 2-dim column\n if (bSize.length === 2) {\n if (bSize[0] !== rows || bSize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.')\n }\n\n if (isDenseMatrix(b)) {\n if (copy) {\n data = []\n\n for (let i = 0; i < rows; i++) {\n data[i] = [bdata[i][0]]\n }\n\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n })\n }\n\n return b\n }\n\n if (isSparseMatrix(b)) {\n for (let i = 0; i < rows; i++) { data[i] = [0] }\n\n const values = b._values\n const index = b._index\n const ptr = b._ptr\n\n for (let k1 = ptr[1], k = ptr[0]; k < k1; k++) {\n const i = index[k]\n data[i][0] = values[k]\n }\n\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n })\n }\n }\n\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.')\n }\n\n if (isArray(b)) {\n const bsize = arraySize(b)\n\n if (bsize.length === 1) {\n if (bsize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.')\n }\n\n for (let i = 0; i < rows; i++) {\n data[i] = [b[i]]\n }\n\n return new DenseMatrix({\n data,\n size: [rows, 1]\n })\n }\n\n if (bsize.length === 2) {\n if (bsize[0] !== rows || bsize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.')\n }\n\n for (let i = 0; i < rows; i++) {\n data[i] = [b[i][0]]\n }\n\n return new DenseMatrix({\n data,\n size: [rows, 1]\n })\n }\n\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.')\n }\n }\n}\n","import { factory } from '../../../utils/factory.js'\nimport { createSolveValidation } from './utils/solveValidation.js'\n\nconst name = 'lsolve'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'equalScalar',\n 'DenseMatrix'\n]\n\nexport const createLsolve = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divideScalar, multiplyScalar, subtractScalar, equalScalar, DenseMatrix }) => {\n const solveValidation = createSolveValidation({ DenseMatrix })\n\n /**\n * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolve(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolve(a, b) // [[-5.5], [20]]\n *\n * See also:\n *\n * lsolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n\n 'SparseMatrix, Array | Matrix': function (m, b) {\n return _sparseForwardSubstitution(m, b)\n },\n\n 'DenseMatrix, Array | Matrix': function (m, b) {\n return _denseForwardSubstitution(m, b)\n },\n\n 'Array, Array | Matrix': function (a, b) {\n const m = matrix(a)\n const r = _denseForwardSubstitution(m, b)\n return r.valueOf()\n }\n })\n\n function _denseForwardSubstitution (m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true)\n const bdata = b._data\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n // result\n const x = []\n\n const mdata = m._data\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n const bj = bdata[j][0] || 0\n let xj\n\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n const vjj = mdata[j][j]\n\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular')\n }\n\n xj = divideScalar(bj, vjj)\n\n // loop rows\n for (let i = j + 1; i < rows; i++) {\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]\n }\n } else {\n // degenerate row, we can choose any value\n xj = 0\n }\n\n x[j] = [xj]\n }\n\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n })\n }\n\n function _sparseForwardSubstitution (m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true)\n\n const bdata = b._data\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n\n // result\n const x = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n const bj = bdata[j][0] || 0\n\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n let vjj = 0\n // matrix values & indices (column j)\n const jValues = []\n const jIndices = []\n\n // first and last index in the column\n const firstIndex = ptr[j]\n const lastIndex = ptr[j + 1]\n\n // values in column, find value at [j, j]\n for (let k = firstIndex; k < lastIndex; k++) {\n const i = index[k]\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k]\n } else if (i > j) {\n // store lower triangular\n jValues.push(values[k])\n jIndices.push(i)\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular')\n }\n\n const xj = divideScalar(bj, vjj)\n\n for (let k = 0, l = jIndices.length; k < l; k++) {\n const i = jIndices[k]\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, jValues[k]))]\n }\n\n x[j] = [xj]\n } else {\n // degenerate row, we can choose any value\n x[j] = [0]\n }\n }\n\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { createSolveValidation } from './utils/solveValidation.js'\n\nconst name = 'usolve'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'equalScalar',\n 'DenseMatrix'\n]\n\nexport const createUsolve = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divideScalar, multiplyScalar, subtractScalar, equalScalar, DenseMatrix }) => {\n const solveValidation = createSolveValidation({ DenseMatrix })\n\n /**\n * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolve(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolve(a, b) // [[8], [9]]\n *\n * See also:\n *\n * usolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n\n 'SparseMatrix, Array | Matrix': function (m, b) {\n return _sparseBackwardSubstitution(m, b)\n },\n\n 'DenseMatrix, Array | Matrix': function (m, b) {\n return _denseBackwardSubstitution(m, b)\n },\n\n 'Array, Array | Matrix': function (a, b) {\n const m = matrix(a)\n const r = _denseBackwardSubstitution(m, b)\n return r.valueOf()\n }\n })\n\n function _denseBackwardSubstitution (m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true)\n\n const bdata = b._data\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n // result\n const x = []\n\n const mdata = m._data\n // loop columns backwards\n for (let j = columns - 1; j >= 0; j--) {\n // b[j]\n const bj = bdata[j][0] || 0\n // x[j]\n let xj\n\n if (!equalScalar(bj, 0)) {\n // value at [j, j]\n const vjj = mdata[j][j]\n\n if (equalScalar(vjj, 0)) {\n // system cannot be solved\n throw new Error('Linear system cannot be solved since matrix is singular')\n }\n\n xj = divideScalar(bj, vjj)\n\n // loop rows\n for (let i = j - 1; i >= 0; i--) {\n // update copy of b\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]\n }\n } else {\n // zero value at j\n xj = 0\n }\n // update x\n x[j] = [xj]\n }\n\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n })\n }\n\n function _sparseBackwardSubstitution (m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true)\n\n const bdata = b._data\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n\n // result\n const x = []\n\n // loop columns backwards\n for (let j = columns - 1; j >= 0; j--) {\n const bj = bdata[j][0] || 0\n\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n let vjj = 0\n\n // upper triangular matrix values & index (column j)\n const jValues = []\n const jIndices = []\n\n // first & last indeces in column\n const firstIndex = ptr[j]\n const lastIndex = ptr[j + 1]\n\n // values in column, find value at [j, j], loop backwards\n for (let k = lastIndex - 1; k >= firstIndex; k--) {\n const i = index[k]\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k]\n } else if (i < j) {\n // store upper triangular\n jValues.push(values[k])\n jIndices.push(i)\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular')\n }\n\n const xj = divideScalar(bj, vjj)\n\n for (let k = 0, lastIndex = jIndices.length; k < lastIndex; k++) {\n const i = jIndices[k]\n bdata[i] = [subtractScalar(bdata[i][0], multiplyScalar(xj, jValues[k]))]\n }\n\n x[j] = [xj]\n } else {\n // degenerate row, we can choose any value\n x[j] = [0]\n }\n }\n\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n })\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { createSolveValidation } from './utils/solveValidation.js'\n\nconst name = 'lsolveAll'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'equalScalar',\n 'DenseMatrix'\n]\n\nexport const createLsolveAll = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divideScalar, multiplyScalar, subtractScalar, equalScalar, DenseMatrix }) => {\n const solveValidation = createSolveValidation({ DenseMatrix })\n\n /**\n * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolveAll(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ]\n *\n * See also:\n *\n * lsolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n\n 'SparseMatrix, Array | Matrix': function (m, b) {\n return _sparseForwardSubstitution(m, b)\n },\n\n 'DenseMatrix, Array | Matrix': function (m, b) {\n return _denseForwardSubstitution(m, b)\n },\n\n 'Array, Array | Matrix': function (a, b) {\n const m = matrix(a)\n const R = _denseForwardSubstitution(m, b)\n return R.map(r => r.valueOf())\n }\n })\n\n function _denseForwardSubstitution (m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n const B = [solveValidation(m, b_, true)._data.map(e => e[0])]\n\n const M = m._data\n const rows = m._size[0]\n const columns = m._size[1]\n\n // loop columns\n for (let i = 0; i < columns; i++) {\n let L = B.length\n\n // loop right-hand sides\n for (let k = 0; k < L; k++) {\n const b = B[k]\n\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i])\n\n for (let j = i + 1; j < columns; j++) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]))\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return []\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1)\n k -= 1\n L -= 1\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n const bNew = [...b]\n bNew[i] = 1\n\n for (let j = i + 1; j < columns; j++) {\n bNew[j] = subtractScalar(bNew[j], M[j][i])\n }\n\n B.push(bNew)\n }\n }\n }\n\n return B.map(x => new DenseMatrix({ data: x.map(e => [e]), size: [rows, 1] }))\n }\n\n function _sparseForwardSubstitution (m, b_) {\n // array of right-hand sides\n const B = [solveValidation(m, b_, true)._data.map(e => e[0])]\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n\n // loop columns\n for (let i = 0; i < columns; i++) {\n let L = B.length\n\n // loop right-hand sides\n for (let k = 0; k < L; k++) {\n const b = B[k]\n\n // values & indices (column i)\n const iValues = []\n const iIndices = []\n\n // first & last indeces in column\n const firstIndex = ptr[i]\n const lastIndex = ptr[i + 1]\n\n // find the value at [i, i]\n let Mii = 0\n for (let j = firstIndex; j < lastIndex; j++) {\n const J = index[j]\n // check row\n if (J === i) {\n Mii = values[j]\n } else if (J > i) {\n // store lower triangular\n iValues.push(values[j])\n iIndices.push(J)\n }\n }\n\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii)\n\n for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) {\n const J = iIndices[j]\n b[J] = subtractScalar(b[J], multiplyScalar(b[i], iValues[j]))\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return []\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1)\n k -= 1\n L -= 1\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n const bNew = [...b]\n bNew[i] = 1\n\n for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) {\n const J = iIndices[j]\n bNew[J] = subtractScalar(bNew[J], iValues[j])\n }\n\n B.push(bNew)\n }\n }\n }\n\n return B.map(x => new DenseMatrix({ data: x.map(e => [e]), size: [rows, 1] }))\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { createSolveValidation } from './utils/solveValidation.js'\n\nconst name = 'usolveAll'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'equalScalar',\n 'DenseMatrix'\n]\n\nexport const createUsolveAll = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divideScalar, multiplyScalar, subtractScalar, equalScalar, DenseMatrix }) => {\n const solveValidation = createSolveValidation({ DenseMatrix })\n\n /**\n * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolveAll(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolveAll(a, b) // [ [[8], [9]] ]\n *\n * See also:\n *\n * usolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n\n 'SparseMatrix, Array | Matrix': function (m, b) {\n return _sparseBackwardSubstitution(m, b)\n },\n\n 'DenseMatrix, Array | Matrix': function (m, b) {\n return _denseBackwardSubstitution(m, b)\n },\n\n 'Array, Array | Matrix': function (a, b) {\n const m = matrix(a)\n const R = _denseBackwardSubstitution(m, b)\n return R.map(r => r.valueOf())\n }\n })\n\n function _denseBackwardSubstitution (m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n const B = [solveValidation(m, b_, true)._data.map(e => e[0])]\n\n const M = m._data\n const rows = m._size[0]\n const columns = m._size[1]\n\n // loop columns backwards\n for (let i = columns - 1; i >= 0; i--) {\n let L = B.length\n\n // loop right-hand sides\n for (let k = 0; k < L; k++) {\n const b = B[k]\n\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i])\n\n for (let j = i - 1; j >= 0; j--) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]))\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return []\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1)\n k -= 1\n L -= 1\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n const bNew = [...b]\n bNew[i] = 1\n\n for (let j = i - 1; j >= 0; j--) {\n bNew[j] = subtractScalar(bNew[j], M[j][i])\n }\n\n B.push(bNew)\n }\n }\n }\n\n return B.map(x => new DenseMatrix({ data: x.map(e => [e]), size: [rows, 1] }))\n }\n\n function _sparseBackwardSubstitution (m, b_) {\n // array of right-hand sides\n const B = [solveValidation(m, b_, true)._data.map(e => e[0])]\n\n const rows = m._size[0]\n const columns = m._size[1]\n\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n\n // loop columns backwards\n for (let i = columns - 1; i >= 0; i--) {\n let L = B.length\n\n // loop right-hand sides\n for (let k = 0; k < L; k++) {\n const b = B[k]\n\n // values & indices (column i)\n const iValues = []\n const iIndices = []\n\n // first & last indeces in column\n const firstIndex = ptr[i]\n const lastIndex = ptr[i + 1]\n\n // find the value at [i, i]\n let Mii = 0\n for (let j = lastIndex - 1; j >= firstIndex; j--) {\n const J = index[j]\n // check row\n if (J === i) {\n Mii = values[j]\n } else if (J < i) {\n // store upper triangular\n iValues.push(values[j])\n iIndices.push(J)\n }\n }\n\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii)\n\n // loop upper triangular\n for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) {\n const J = iIndices[j]\n b[J] = subtractScalar(b[J], multiplyScalar(b[i], iValues[j]))\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return []\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1)\n k -= 1\n L -= 1\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n const bNew = [...b]\n bNew[i] = 1\n\n // loop upper triangular\n for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) {\n const J = iIndices[j]\n bNew[J] = subtractScalar(bNew[J], iValues[j])\n }\n\n B.push(bNew)\n }\n }\n }\n\n return B.map(x => new DenseMatrix({ data: x.map(e => [e]), size: [rows, 1] }))\n }\n})\n","import { factory } from '../../../utils/factory.js'\nimport { DimensionError } from '../../../error/DimensionError.js'\n\nconst name = 'matAlgo08xS0Sid'\nconst dependencies = ['typed', 'equalScalar']\n\nexport const createMatAlgo08xS0Sid = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar }) => {\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * └ 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo08xS0Sid (a, b, callback) {\n // sparse matrix arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType()\n // sparse matrix arrays\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n const bsize = b._size\n const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType()\n\n // validate dimensions\n if (asize.length !== bsize.length) { throw new DimensionError(asize.length, bsize.length) }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')') }\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues || !bvalues) { throw new Error('Cannot perform operation on Pattern Sparse Matrices') }\n\n // rows & columns\n const rows = asize[0]\n const columns = asize[1]\n\n // datatype\n let dt\n // equal signature to use\n let eq = equalScalar\n // zero value\n let zero = 0\n // callback signature to use\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt])\n // convert 0 to the same datatype\n zero = typed.convert(0, dt)\n // callback\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays\n const cvalues = []\n const cindex = []\n const cptr = []\n\n // workspace\n const x = []\n // marks indicating we have a value in x for a given column\n const w = []\n\n // vars\n let k, k0, k1, i\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length\n // columns mark\n const mark = j + 1\n // loop values in a\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k]\n // mark workspace\n w[i] = mark\n // set value\n x[i] = avalues[k]\n // add index\n cindex.push(i)\n }\n // loop values in b\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k]\n // check value exists in workspace\n if (w[i] === mark) {\n // evaluate callback\n x[i] = cf(x[i], bvalues[k])\n }\n }\n // initialize first index in j\n k = cptr[j]\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k]\n // value @ i\n const v = x[i]\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v)\n // increment pointer\n k++\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1)\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n })\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nexport const createUseMatrixForArrayScalar = /* #__PURE__ */ factory('useMatrixForArrayScalar', ['typed', 'matrix'], ({ typed, matrix }) => ({\n 'Array, number': typed.referTo('DenseMatrix, number',\n selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),\n\n 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber',\n selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),\n\n 'number, Array': typed.referTo('number, DenseMatrix',\n selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),\n\n 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix',\n selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())\n}))\n","import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'\nimport { leftShiftNumber } from '../../plain/number/index.js'\nimport { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js'\n\nconst name = 'leftShift'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, DenseMatrix, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const useMatrixForArrayScalar = createUseMatrixForArrayScalar({ typed, matrix })\n\n /**\n * Bitwise left logical shift of a value x by y number of bits, `x << y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.leftShift(x, y)\n *\n * Examples:\n *\n * math.leftShift(1, 2) // returns number 4\n *\n * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64]\n *\n * See also:\n *\n * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times\n */\n return typed(\n name,\n {\n 'number, number': leftShiftNumber,\n\n 'BigNumber, BigNumber': leftShiftBigNumber,\n\n 'bigint, bigint': (x, y) => x << y,\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo10xSids(y, x, self, true)\n }),\n\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo14xDs(y, x, self, true)\n })\n },\n useMatrixForArrayScalar,\n matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n })\n )\n})\n","import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'\nimport { rightArithShiftNumber } from '../../plain/number/index.js'\n\nconst name = 'rightArithShift'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, DenseMatrix, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const useMatrixForArrayScalar = createUseMatrixForArrayScalar({ typed, matrix })\n\n /**\n * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightArithShift(x, y)\n *\n * Examples:\n *\n * math.rightArithShift(4, 2) // returns number 1\n *\n * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(\n name,\n {\n 'number, number': rightArithShiftNumber,\n\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\n\n 'bigint, bigint': (x, y) => x >> y,\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo10xSids(y, x, self, true)\n }),\n\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo14xDs(y, x, self, true)\n })\n },\n useMatrixForArrayScalar,\n matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n })\n )\n})\n","import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { rightLogShiftNumber } from '../../plain/number/index.js'\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'\n\nconst name = 'rightLogShift'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, DenseMatrix, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const useMatrixForArrayScalar = createUseMatrixForArrayScalar({ typed, matrix })\n\n /**\n * Bitwise right logical shift of value x by y number of bits, `x >>> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightLogShift(x, y)\n *\n * Examples:\n *\n * math.rightLogShift(4, 2) // returns number 1\n *\n * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift\n *\n * @param {number | Array | Matrix} x Value to be shifted\n * @param {number} y Amount of shifts\n * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n\n return typed(\n name,\n {\n 'number, number': rightLogShiftNumber,\n\n // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone()\n }\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo10xSids(y, x, self, true)\n }),\n\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage())\n }\n return matAlgo14xDs(y, x, self, true)\n })\n },\n useMatrixForArrayScalar,\n matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n })\n )\n})\n","import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { andNumber } from '../../plain/number/index.js'\n\nconst name = 'and'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'zeros',\n 'not',\n 'concat'\n]\n\nexport const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, not, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo06xS0S0 = createMatAlgo06xS0S0({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.and(x, y)\n *\n * Examples:\n *\n * math.and(2, 4) // returns true\n *\n * a = [2, 0, 0]\n * b = [3, 7, 0]\n * c = 0\n *\n * math.and(a, b) // returns [true, false, false]\n * math.and(a, c) // returns [false, false, false]\n *\n * See also:\n *\n * not, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when both inputs are defined with a nonzero/nonempty value.\n */\n return typed(\n name,\n {\n 'number, number': andNumber,\n\n 'Complex, Complex': function (x, y) {\n return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN()\n },\n\n 'bigint, bigint': andNumber,\n\n 'Unit, Unit': typed.referToSelf(self =>\n (x, y) => self(x.value || 0, y.value || 0)),\n\n 'SparseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage())\n }\n return matAlgo11xS0s(x, y, self, false)\n }),\n\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage())\n }\n return matAlgo14xDs(x, y, self, false)\n }),\n\n 'any, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage())\n }\n return matAlgo11xS0s(y, x, self, true)\n }),\n\n 'any, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage())\n }\n return matAlgo14xDs(y, x, self, true)\n }),\n\n 'Array, any': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(matrix(x), y).valueOf()\n }),\n\n 'any, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(x, matrix(y)).valueOf()\n })\n },\n matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0\n })\n )\n})\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'compare'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'equalScalar',\n 'BigNumber',\n 'Fraction',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createCompare = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, equalScalar, matrix, BigNumber, Fraction, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * x and y are considered equal when the relative difference between x and y\n * is smaller than the configured absTol and relTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.compare(x, y)\n *\n * Examples:\n *\n * math.compare(6, 1) // returns 1\n * math.compare(2, 3) // returns -1\n * math.compare(7, 7) // returns 0\n * math.compare('10', '2') // returns 1\n * math.compare('1000', '1e3') // returns 0\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compare(a, b) // returns 1\n *\n * math.compare(2, [1, 2, 3]) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(\n name,\n createCompareNumber({ typed, config }),\n {\n 'boolean, boolean': function (x, y) {\n return x === y ? 0 : (x > y ? 1 : -1)\n },\n\n 'BigNumber, BigNumber': function (x, y) {\n return bigNearlyEqual(x, y, config.relTol, config.absTol)\n ? new BigNumber(0)\n : new BigNumber(x.cmp(y))\n },\n\n 'bigint, bigint': function (x, y) {\n return x === y ? 0n : (x > y ? 1n : -1n)\n },\n\n 'Fraction, Fraction': function (x, y) {\n return new Fraction(x.compare(y))\n },\n\n 'Complex, Complex': function () {\n throw new TypeError('No ordering relation is defined for complex numbers')\n }\n },\n compareUnits,\n matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createCompareNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol)\n ? 0\n : (x > y ? 1 : -1)\n }\n })\n})\n","import naturalSort from 'javascript-natural-sort'\nimport { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'compareNatural'\nconst dependencies = [\n 'typed',\n 'compare'\n]\n\nexport const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, ({ typed, compare }) => {\n const compareBooleans = compare.signatures['boolean,boolean']\n\n /**\n * Compare two values of any type in a deterministic, natural way.\n *\n * For numeric values, the function works the same as `math.compare`.\n * For types of values that can't be compared mathematically,\n * the function compares in a natural way.\n *\n * For numeric values, x and y are considered equal when the relative\n * difference between x and y is smaller than the configured relTol and absTol.\n * The function cannot be used to compare values smaller than\n * approximately 2.22e-16.\n *\n * For Complex numbers, first the real parts are compared. If equal,\n * the imaginary parts are compared.\n *\n * Strings are compared with a natural sorting algorithm, which\n * orders strings in a \"logic\" way following some heuristics.\n * This differs from the function `compare`, which converts the string\n * into a numeric value and compares that. The function `compareText`\n * on the other hand compares text lexically.\n *\n * Arrays and Matrices are compared value by value until there is an\n * unequal pair of values encountered. Objects are compared by sorted\n * keys until the keys or their values are unequal.\n *\n * Syntax:\n *\n * math.compareNatural(x, y)\n *\n * Examples:\n *\n * math.compareNatural(6, 1) // returns 1\n * math.compareNatural(2, 3) // returns -1\n * math.compareNatural(7, 7) // returns 0\n *\n * math.compareNatural('10', '2') // returns 1\n * math.compareText('10', '2') // returns -1\n * math.compare('10', '2') // returns 1\n *\n * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1\n * math.compareText('Answer: 10', 'Answer: 2') // returns -1\n * math.compare('Answer: 10', 'Answer: 2')\n * // Error: Cannot convert \"Answer: 10\" to a number\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compareNatural(a, b) // returns 1\n *\n * const c = math.complex('2 + 3i')\n * const d = math.complex('2 + 4i')\n * math.compareNatural(c, d) // returns -1\n *\n * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2, 3], [1, 2]) // returns 1\n * math.compareNatural([1, 5], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2], [1, 2]) // returns 0\n *\n * math.compareNatural({a: 2}, {a: 4}) // returns -1\n *\n * See also:\n *\n * compare, compareText\n *\n * @param {*} x First value to compare\n * @param {*} y Second value to compare\n * @return {number} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, { 'any, any': _compareNatural }) // just to check # args\n\n function _compareNatural (x, y) {\n const typeX = typeOf(x)\n const typeY = typeOf(y)\n let c\n\n // numeric types\n if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') &&\n (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) {\n c = compare(x, y)\n if (c.toString() !== '0') {\n // c can be number, BigNumber, or Fraction\n return c > 0 ? 1 : -1 // return a number\n } else {\n return naturalSort(typeX, typeY)\n }\n }\n\n // matrix types\n const matTypes = ['Array', 'DenseMatrix', 'SparseMatrix']\n if (matTypes.includes(typeX) || matTypes.includes(typeY)) {\n c = compareMatricesAndArrays(_compareNatural, x, y)\n if (c !== 0) {\n return c\n } else {\n return naturalSort(typeX, typeY)\n }\n }\n\n // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex'\n if (typeX !== typeY) {\n return naturalSort(typeX, typeY)\n }\n\n if (typeX === 'Complex') {\n return compareComplexNumbers(x, y)\n }\n\n if (typeX === 'Unit') {\n if (x.equalBase(y)) {\n return _compareNatural(x.value, y.value)\n }\n\n // compare by units\n return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits())\n }\n\n if (typeX === 'boolean') {\n return compareBooleans(x, y)\n }\n\n if (typeX === 'string') {\n return naturalSort(x, y)\n }\n\n if (typeX === 'Object') {\n return compareObjects(_compareNatural, x, y)\n }\n\n if (typeX === 'null') {\n return 0\n }\n\n if (typeX === 'undefined') {\n return 0\n }\n\n // this should not occur...\n throw new TypeError('Unsupported type of value \"' + typeX + '\"')\n }\n\n /**\n * Compare mixed matrix/array types, by converting to same-shaped array.\n * This comparator is non-deterministic regarding input types.\n * @param {Array | SparseMatrix | DenseMatrix | *} x\n * @param {Array | SparseMatrix | DenseMatrix | *} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareMatricesAndArrays (compareNatural, x, y) {\n if (isSparseMatrix(x) && isSparseMatrix(y)) {\n return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values)\n }\n if (isSparseMatrix(x)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x.toArray(), y)\n }\n if (isSparseMatrix(y)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x, y.toArray())\n }\n\n // convert DenseArray into Array\n if (isDenseMatrix(x)) {\n return compareMatricesAndArrays(compareNatural, x.toJSON().data, y)\n }\n if (isDenseMatrix(y)) {\n return compareMatricesAndArrays(compareNatural, x, y.toJSON().data)\n }\n\n // convert scalars to array\n if (!Array.isArray(x)) {\n return compareMatricesAndArrays(compareNatural, [x], y)\n }\n if (!Array.isArray(y)) {\n return compareMatricesAndArrays(compareNatural, x, [y])\n }\n\n return compareArrays(compareNatural, x, y)\n }\n\n /**\n * Compare two Arrays\n *\n * - First, compares value by value\n * - Next, if all corresponding values are equal,\n * look at the length: longest array will be considered largest\n *\n * @param {Array} x\n * @param {Array} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareArrays (compareNatural, x, y) {\n // compare each value\n for (let i = 0, ii = Math.min(x.length, y.length); i < ii; i++) {\n const v = compareNatural(x[i], y[i])\n if (v !== 0) {\n return v\n }\n }\n\n // compare the size of the arrays\n if (x.length > y.length) { return 1 }\n if (x.length < y.length) { return -1 }\n\n // both Arrays have equal size and content\n return 0\n }\n\n /**\n * Compare two objects\n *\n * - First, compare sorted property names\n * - Next, compare the property values\n *\n * @param {Object} x\n * @param {Object} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareObjects (compareNatural, x, y) {\n const keysX = Object.keys(x)\n const keysY = Object.keys(y)\n\n // compare keys\n keysX.sort(naturalSort)\n keysY.sort(naturalSort)\n const c = compareArrays(compareNatural, keysX, keysY)\n if (c !== 0) {\n return c\n }\n\n // compare values\n for (let i = 0; i < keysX.length; i++) {\n const v = compareNatural(x[keysX[i]], y[keysY[i]])\n if (v !== 0) {\n return v\n }\n }\n\n return 0\n }\n})\n\n/**\n * Compare two complex numbers, `x` and `y`:\n *\n * - First, compare the real values of `x` and `y`\n * - If equal, compare the imaginary values of `x` and `y`\n *\n * @params {Complex} x\n * @params {Complex} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\nfunction compareComplexNumbers (x, y) {\n if (x.re > y.re) { return 1 }\n if (x.re < y.re) { return -1 }\n\n if (x.im > y.im) { return 1 }\n if (x.im < y.im) { return -1 }\n\n return 0\n}\n","import { compareText as _compareText } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'compareText'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'concat'\n]\n\n_compareText.signature = 'any, any'\n\nexport const createCompareText = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, concat }) => {\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Compare two strings lexically. Comparison is case sensitive.\n * Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.compareText(x, y)\n *\n * Examples:\n *\n * math.compareText('B', 'A') // returns 1\n * math.compareText('2', '10') // returns 1\n * math.compare('2', '10') // returns -1\n * math.compareNatural('2', '10') // returns -1\n *\n * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, equalText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, _compareText, matrixAlgorithmSuite({\n elop: _compareText,\n Ds: true\n }))\n})\n\nexport const createCompareTextNumber = /* #__PURE__ */ factory(\n name, ['typed'], ({ typed }) => typed(name, _compareText)\n)\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'equal'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Test whether two values are equal.\n *\n * The function tests whether the relative difference between x and y is\n * smaller than the configured relTol and absTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is only\n * equal to `null` and nothing else, and `undefined` is only equal to\n * `undefined` and nothing else. Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.equal(x, y)\n *\n * Examples:\n *\n * math.equal(2 + 2, 3) // returns false\n * math.equal(2 + 2, 4) // returns true\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.equal(a, b) // returns true\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.equal(c, d) // returns [true, false, true]\n * math.deepEqual(c, d) // returns false\n *\n * math.equal(\"1000\", \"1e3\") // returns true\n * math.equal(0, null) // returns false\n *\n * See also:\n *\n * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText\n *\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false\n */\n return typed(\n name,\n createEqualNumber({ typed, equalScalar }),\n matrixAlgorithmSuite({\n elop: equalScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createEqualNumber = factory(name, ['typed', 'equalScalar'], ({ typed, equalScalar }) => {\n return typed(name, {\n 'any, any': function (x, y) {\n // strict equality for null and undefined?\n if (x === null) { return y === null }\n if (y === null) { return x === null }\n if (x === undefined) { return y === undefined }\n if (y === undefined) { return x === undefined }\n\n return equalScalar(x, y)\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'equalText'\nconst dependencies = [\n 'typed',\n 'compareText',\n 'isZero'\n]\n\nexport const createEqualText = /* #__PURE__ */ factory(name, dependencies, ({ typed, compareText, isZero }) => {\n /**\n * Check equality of two strings. Comparison is case sensitive.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.equalText(x, y)\n *\n * Examples:\n *\n * math.equalText('Hello', 'Hello') // returns true\n * math.equalText('a', 'A') // returns false\n * math.equal('2e3', '2000') // returns true\n * math.equalText('2e3', '2000') // returns false\n *\n * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false]\n *\n * See also:\n *\n * equal, compareText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.\n */\n return typed(name, {\n 'any, any': function (x, y) {\n return isZero(compareText(x, y))\n }\n })\n})\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'smaller'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createSmaller = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Test whether value x is smaller than y.\n *\n * The function returns true when x is smaller than y and the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smaller(x, y)\n *\n * Examples:\n *\n * math.smaller(2, 3) // returns true\n * math.smaller(5, 2 * 2) // returns false\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.smaller(a, b) // returns true\n *\n * See also:\n *\n * equal, unequal, smallerEq, smaller, smallerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(\n name,\n createSmallerNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => x < y,\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'bigint, bigint': (x, y) => x < y,\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) === -1),\n\n 'Complex, Complex': function (x, y) {\n throw new TypeError('No ordering relation is defined for complex numbers')\n }\n },\n compareUnits,\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createSmallerNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return x < y && !nearlyEqual(x, y, config.relTol, config.absTol)\n }\n })\n})\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'smallerEq'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createSmallerEq = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Test whether value x is smaller or equal to y.\n *\n * The function returns true when x is smaller than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smallerEq(x, y)\n *\n * Examples:\n *\n * math.smaller(1 + 2, 3) // returns false\n * math.smallerEq(1 + 2, 3) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, larger, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(\n name,\n createSmallerEqNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => (x <= y),\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'bigint, bigint': (x, y) => (x <= y),\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) !== 1),\n\n 'Complex, Complex': function () {\n throw new TypeError('No ordering relation is defined for complex numbers')\n }\n },\n compareUnits,\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createSmallerEqNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return x <= y || nearlyEqual(x, y, config.relTol, config.absTol)\n }\n })\n})\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'larger'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createLarger = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Test whether value x is larger than y.\n *\n * The function returns true when x is larger than y and the relative\n * difference between x and y is larger than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.larger(x, y)\n *\n * Examples:\n *\n * math.larger(2, 3) // returns false\n * math.larger(5, 2 + 2) // returns true\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.larger(a, b) // returns false\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false\n */\n return typed(\n name,\n createLargerNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => x > y,\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'bigint, bigint': (x, y) => x > y,\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) === 1),\n\n 'Complex, Complex': function () {\n throw new TypeError('No ordering relation is defined for complex numbers')\n }\n },\n compareUnits,\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createLargerNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return x > y && !nearlyEqual(x, y, config.relTol, config.absTol)\n }\n })\n})\n","import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'\nimport { nearlyEqual } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\nimport { createCompareUnits } from './compareUnits.js'\n\nconst name = 'largerEq'\nconst dependencies = [\n 'typed',\n 'config',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createLargerEq = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n const compareUnits = createCompareUnits({ typed })\n\n /**\n * Test whether value x is larger or equal to y.\n *\n * The function returns true when x is larger than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.largerEq(x, y)\n *\n * Examples:\n *\n * math.larger(2, 1 + 1) // returns false\n * math.largerEq(2, 1 + 1) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false\n */\n return typed(\n name,\n createLargerEqNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => x >= y,\n\n 'BigNumber, BigNumber': function (x, y) {\n return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol)\n },\n\n 'bigint, bigint': function (x, y) {\n return x >= y\n },\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) !== -1),\n\n 'Complex, Complex': function () {\n throw new TypeError('No ordering relation is defined for complex numbers')\n }\n },\n compareUnits,\n matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n})\n\nexport const createLargerEqNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => {\n return typed(name, {\n 'number, number': function (x, y) {\n return x >= y || nearlyEqual(x, y, config.relTol, config.absTol)\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'deepEqual'\nconst dependencies = [\n 'typed',\n 'equal'\n]\n\nexport const createDeepEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, equal }) => {\n /**\n * Test element wise whether two matrices are equal.\n * The function accepts both matrices and scalar values.\n *\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.deepEqual(x, y)\n *\n * Examples:\n *\n * math.deepEqual(2, 4) // returns false\n *\n * a = [2, 5, 1]\n * b = [2, 7, 1]\n *\n * math.deepEqual(a, b) // returns false\n * math.equal(a, b) // returns [true, false, true]\n *\n * See also:\n *\n * equal, unequal\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix}\n * Returns true when the input matrices have the same size and each of their elements is equal.\n */\n return typed(name, {\n 'any, any': function (x, y) {\n return _deepEqual(x.valueOf(), y.valueOf())\n }\n })\n\n /**\n * Test whether two arrays have the same size and all elements are equal\n * @param {Array | *} x\n * @param {Array | *} y\n * @return {boolean} Returns true if both arrays are deep equal\n */\n function _deepEqual (x, y) {\n if (Array.isArray(x)) {\n if (Array.isArray(y)) {\n const len = x.length\n if (len !== y.length) {\n return false\n }\n\n for (let i = 0; i < len; i++) {\n if (!_deepEqual(x[i], y[i])) {\n return false\n }\n }\n\n return true\n } else {\n return false\n }\n } else {\n if (Array.isArray(y)) {\n return false\n } else {\n return equal(x, y)\n }\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'unequal'\nconst dependencies = [\n 'typed',\n 'config',\n 'equalScalar',\n 'matrix',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createUnequal = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, equalScalar, matrix, DenseMatrix, concat }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, DenseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Test whether two values are unequal.\n *\n * The function tests whether the relative difference between x and y is\n * larger than the configured relTol and absTol. The function cannot be used to compare\n * values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im.\n * Strings are compared by their numerical value.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is unequal\n * with everything except `null`, and `undefined` is unequal with everything\n * except `undefined`.\n *\n * Syntax:\n *\n * math.unequal(x, y)\n *\n * Examples:\n *\n * math.unequal(2 + 2, 3) // returns true\n * math.unequal(2 + 2, 4) // returns false\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.unequal(a, b) // returns false\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.unequal(c, d) // returns [false, true, false]\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false\n */\n return typed(\n name,\n createUnequalNumber({ typed, equalScalar }),\n matrixAlgorithmSuite({\n elop: _unequal,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n })\n )\n\n function _unequal (x, y) {\n return !equalScalar(x, y)\n }\n})\n\nexport const createUnequalNumber = factory(name, ['typed', 'equalScalar'], ({ typed, equalScalar }) => {\n return typed(name, {\n 'any, any': function (x, y) {\n // strict equality for null and undefined?\n if (x === null) { return y !== null }\n if (y === null) { return x !== null }\n if (x === undefined) { return y !== undefined }\n if (y === undefined) { return x !== undefined }\n\n return !equalScalar(x, y)\n }\n })\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'partitionSelect'\nconst dependencies = ['typed', 'isNumeric', 'isNaN', 'compare']\n\nexport const createPartitionSelect = /* #__PURE__ */ factory(name, dependencies, ({ typed, isNumeric, isNaN, compare }) => {\n const asc = compare\n const desc = (a, b) => -compare(a, b)\n\n /**\n * Partition-based selection of an array or 1D matrix.\n * Will find the kth smallest value, and mutates the input array.\n * Uses Quickselect.\n *\n * Syntax:\n *\n * math.partitionSelect(x, k)\n * math.partitionSelect(x, k, compare)\n *\n * Examples:\n *\n * math.partitionSelect([5, 10, 1], 2) // returns 10\n * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B'\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon'\n *\n * // the input array is mutated\n * arr = [5, 2, 1]\n * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5]\n * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1]\n *\n * See also:\n *\n * sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Number} k The kth smallest value to be retrieved zero-based index\n * @param {Function | 'asc' | 'desc'} [compare='asc']\n * An optional comparator function. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {*} Returns the kth lowest value.\n */\n return typed(name, {\n 'Array | Matrix, number': function (x, k) {\n return _partitionSelect(x, k, asc)\n },\n\n 'Array | Matrix, number, string': function (x, k, compare) {\n if (compare === 'asc') {\n return _partitionSelect(x, k, asc)\n } else if (compare === 'desc') {\n return _partitionSelect(x, k, desc)\n } else {\n throw new Error('Compare string must be \"asc\" or \"desc\"')\n }\n },\n\n 'Array | Matrix, number, function': _partitionSelect\n })\n\n function _partitionSelect (x, k, compare) {\n if (!isInteger(k) || k < 0) {\n throw new Error('k must be a non-negative integer')\n }\n\n if (isMatrix(x)) {\n const size = x.size()\n if (size.length > 1) {\n throw new Error('Only one dimensional matrices supported')\n }\n return quickSelect(x.valueOf(), k, compare)\n }\n\n if (Array.isArray(x)) {\n return quickSelect(x, k, compare)\n }\n }\n\n /**\n * Quickselect algorithm.\n * Code adapted from:\n * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html\n *\n * @param {Array} arr\n * @param {Number} k\n * @param {Function} compare\n * @private\n */\n function quickSelect (arr, k, compare) {\n if (k >= arr.length) {\n throw new Error('k out of bounds')\n }\n\n // check for NaN values since these can cause an infinite while loop\n for (let i = 0; i < arr.length; i++) {\n if (isNumeric(arr[i]) && isNaN(arr[i])) {\n return arr[i] // return NaN\n }\n }\n\n let from = 0\n let to = arr.length - 1\n\n // if from == to we reached the kth element\n while (from < to) {\n let r = from\n let w = to\n const pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]\n\n // stop if the reader and writer meets\n while (r < w) {\n // arr[r] >= pivot\n if (compare(arr[r], pivot) >= 0) { // put the large values at the end\n const tmp = arr[w]\n arr[w] = arr[r]\n arr[r] = tmp\n --w\n } else { // the value is smaller than the pivot, skip\n ++r\n }\n }\n\n // if we stepped up (r++) we need to step one down (arr[r] > pivot)\n if (compare(arr[r], pivot) > 0) {\n --r\n }\n\n // the r pointer is on the end of the first k elements\n if (k <= r) {\n to = r\n } else {\n from = r + 1\n }\n }\n\n return arr[k]\n }\n})\n","import { arraySize as size } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'sort'\nconst dependencies = ['typed', 'matrix', 'compare', 'compareNatural']\n\nexport const createSort = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, compare, compareNatural }) => {\n const compareAsc = compare\n const compareDesc = (a, b) => -compare(a, b)\n\n /**\n * Sort the items in a matrix.\n *\n * Syntax:\n *\n * math.sort(x)\n * math.sort(x, compare)\n *\n * Examples:\n *\n * math.sort([5, 10, 1]) // returns [1, 5, 10]\n * math.sort(['C', 'B', 'A', 'D'], math.compareNatural)\n * // returns ['A', 'B', 'C', 'D']\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength)\n * // returns ['Tom', 'Sara', 'Langdon']\n *\n * See also:\n *\n * filter, forEach, map, compare, compareNatural\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc']\n * An optional _comparator function or name. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {Matrix | Array} Returns the sorted matrix.\n */\n return typed(name, {\n Array: function (x) {\n _arrayIsVector(x)\n return x.sort(compareAsc)\n },\n\n Matrix: function (x) {\n _matrixIsVector(x)\n return matrix(x.toArray().sort(compareAsc), x.storage())\n },\n\n 'Array, function': function (x, _comparator) {\n _arrayIsVector(x)\n return x.sort(_comparator)\n },\n\n 'Matrix, function': function (x, _comparator) {\n _matrixIsVector(x)\n return matrix(x.toArray().sort(_comparator), x.storage())\n },\n\n 'Array, string': function (x, order) {\n _arrayIsVector(x)\n return x.sort(_comparator(order))\n },\n\n 'Matrix, string': function (x, order) {\n _matrixIsVector(x)\n return matrix(x.toArray().sort(_comparator(order)), x.storage())\n }\n })\n\n /**\n * Get the comparator for given order ('asc', 'desc', 'natural')\n * @param {'asc' | 'desc' | 'natural'} order\n * @return {Function} Returns a _comparator function\n */\n function _comparator (order) {\n if (order === 'asc') {\n return compareAsc\n } else if (order === 'desc') {\n return compareDesc\n } else if (order === 'natural') {\n return compareNatural\n } else {\n throw new Error('String \"asc\", \"desc\", or \"natural\" expected')\n }\n }\n\n /**\n * Validate whether an array is one dimensional\n * Throws an error when this is not the case\n * @param {Array} array\n * @private\n */\n function _arrayIsVector (array) {\n if (size(array).length !== 1) {\n throw new Error('One dimensional array expected')\n }\n }\n\n /**\n * Validate whether a matrix is one dimensional\n * Throws an error when this is not the case\n * @param {Matrix} matrix\n * @private\n */\n function _matrixIsVector (matrix) {\n if (matrix.size().length !== 1) {\n throw new Error('One dimensional matrix expected')\n }\n }\n})\n","import { deepForEach, reduce, containsCollections } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'max'\nconst dependencies = ['typed', 'config', 'numeric', 'larger']\n\nexport const createMax = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger }) => {\n /**\n * Compute the maximum value of a matrix or a list with values.\n * In case of a multidimensional array, the maximum of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.max(a, b, c, ...)\n * math.max(A)\n * math.max(A, dimension)\n *\n * Examples:\n *\n * math.max(2, 1, 4, 3) // returns 4\n * math.max([2, 1, 4, 3]) // returns 4\n *\n * // maximum over a specified dimension (zero-based)\n * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7]\n * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, min, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The maximum value\n */\n return typed(name, {\n // max([a, b, c, d, ...])\n 'Array | Matrix': _max,\n\n // max([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function (array, dim) {\n return reduce(array, dim.valueOf(), _largest)\n },\n\n // max(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function max')\n }\n\n return _max(args)\n }\n })\n\n /**\n * Return the largest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is largest, or y when y is largest\n * @private\n */\n function _largest (x, y) {\n try {\n return larger(x, y) ? x : y\n } catch (err) {\n throw improveErrorMessage(err, 'max', y)\n }\n }\n\n /**\n * Recursively calculate the maximum value in an n-dimensional array\n * @param {Array} array\n * @return {number} max\n * @private\n */\n function _max (array) {\n let res\n\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n res = NaN\n } else if (res === undefined || larger(value, res)) {\n res = value\n }\n } catch (err) {\n throw improveErrorMessage(err, 'max', value)\n }\n })\n\n if (res === undefined) {\n throw new Error('Cannot calculate max of an empty array')\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof res === 'string') {\n res = numeric(res, safeNumberType(res, config))\n }\n\n return res\n }\n})\n","import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'min'\nconst dependencies = ['typed', 'config', 'numeric', 'smaller']\n\nexport const createMin = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller }) => {\n /**\n * Compute the minimum value of a matrix or a list of values.\n * In case of a multidimensional array, the minimum of the flattened array\n * will be calculated. When `dim` is provided, the minimum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.min(a, b, c, ...)\n * math.min(A)\n * math.min(A, dimension)\n *\n * Examples:\n *\n * math.min(2, 1, 4, 3) // returns 1\n * math.min([2, 1, 4, 3]) // returns 1\n *\n * // minimum over a specified dimension (zero-based)\n * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3]\n * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, max, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The minimum value\n */\n return typed(name, {\n // min([a, b, c, d, ...])\n 'Array | Matrix': _min,\n\n // min([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function (array, dim) {\n return reduce(array, dim.valueOf(), _smallest)\n },\n\n // min(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function min')\n }\n\n return _min(args)\n }\n })\n\n /**\n * Return the smallest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is smallest, or y when y is smallest\n * @private\n */\n function _smallest (x, y) {\n try {\n return smaller(x, y) ? x : y\n } catch (err) {\n throw improveErrorMessage(err, 'min', y)\n }\n }\n\n /**\n * Recursively calculate the minimum value in an n-dimensional array\n * @param {Array} array\n * @return {number} min\n * @private\n */\n function _min (array) {\n let min\n\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n min = NaN\n } else if (min === undefined || smaller(value, min)) {\n min = value\n }\n } catch (err) {\n throw improveErrorMessage(err, 'min', value)\n }\n })\n\n if (min === undefined) {\n throw new Error('Cannot calculate min of an empty array')\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof min === 'string') {\n min = numeric(min, safeNumberType(min, config))\n }\n\n return min\n }\n})\n","import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ImmutableDenseMatrix'\nconst dependencies = [\n 'smaller',\n 'DenseMatrix'\n]\n\nexport const createImmutableDenseMatrixClass = /* #__PURE__ */ factory(name, dependencies, ({ smaller, DenseMatrix }) => {\n function ImmutableDenseMatrix (data, datatype) {\n if (!(this instanceof ImmutableDenseMatrix)) { throw new SyntaxError('Constructor must be called with the new operator') }\n if (datatype && !isString(datatype)) { throw new Error('Invalid datatype: ' + datatype) }\n\n if (isMatrix(data) || isArray(data)) {\n // use DenseMatrix implementation\n const matrix = new DenseMatrix(data, datatype)\n // internal structures\n this._data = matrix._data\n this._size = matrix._size\n this._datatype = matrix._datatype\n this._min = null\n this._max = null\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data\n this._size = data.size\n this._datatype = data.datatype\n this._min = typeof data.min !== 'undefined' ? data.min : null\n this._max = typeof data.max !== 'undefined' ? data.max : null\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')')\n } else {\n // nothing provided\n this._data = []\n this._size = [0]\n this._datatype = datatype\n this._min = null\n this._max = null\n }\n }\n\n ImmutableDenseMatrix.prototype = new DenseMatrix()\n\n /**\n * Attach type information\n */\n ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix'\n ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | ImmutableDenseMatrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n ImmutableDenseMatrix.prototype.subset = function (index) {\n switch (arguments.length) {\n case 1:\n {\n // use base implementation\n const m = DenseMatrix.prototype.subset.call(this, index)\n // check result is a matrix\n if (isMatrix(m)) {\n // return immutable matrix\n return new ImmutableDenseMatrix({\n data: m._data,\n size: m._size,\n datatype: m._datatype\n })\n }\n return m\n }\n // intentional fall through\n case 2:\n case 3:\n throw new Error('Cannot invoke set subset on an Immutable Matrix instance')\n\n default:\n throw new SyntaxError('Wrong number of arguments')\n }\n }\n\n /**\n * Replace a single element in the matrix.\n * @param {Number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {ImmutableDenseMatrix} self\n */\n ImmutableDenseMatrix.prototype.set = function () {\n throw new Error('Cannot invoke set on an Immutable Matrix instance')\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {Number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n ImmutableDenseMatrix.prototype.resize = function () {\n throw new Error('Cannot invoke resize on an Immutable Matrix instance')\n }\n\n /**\n * Disallows reshaping in favor of immutability.\n *\n * @throws {Error} Operation not allowed\n */\n ImmutableDenseMatrix.prototype.reshape = function () {\n throw new Error('Cannot invoke reshape on an Immutable Matrix instance')\n }\n\n /**\n * Create a clone of the matrix\n * @return {ImmutableDenseMatrix} clone\n */\n ImmutableDenseMatrix.prototype.clone = function () {\n return new ImmutableDenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n })\n }\n\n /**\n * Get a JSON representation of the matrix\n * @returns {Object}\n */\n ImmutableDenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'ImmutableDenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n }\n }\n\n /**\n * Generate a matrix from a JSON object\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ImmutableDenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {ImmutableDenseMatrix}\n */\n ImmutableDenseMatrix.fromJSON = function (json) {\n return new ImmutableDenseMatrix(json)\n }\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @param {Number} i Matrix row index 1\n * @param {Number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n ImmutableDenseMatrix.prototype.swapRows = function () {\n throw new Error('Cannot invoke swapRows on an Immutable Matrix instance')\n }\n\n /**\n * Calculate the minimum value in the set\n * @return {Number | undefined} min\n */\n ImmutableDenseMatrix.prototype.min = function () {\n // check min has been calculated before\n if (this._min === null) {\n // minimum\n let m = null\n // compute min\n this.forEach(function (v) {\n if (m === null || smaller(v, m)) { m = v }\n })\n this._min = m !== null ? m : undefined\n }\n return this._min\n }\n\n /**\n * Calculate the maximum value in the set\n * @return {Number | undefined} max\n */\n ImmutableDenseMatrix.prototype.max = function () {\n // check max has been calculated before\n if (this._max === null) {\n // maximum\n let m = null\n // compute max\n this.forEach(function (v) {\n if (m === null || smaller(m, v)) { m = v }\n })\n this._max = m !== null ? m : undefined\n }\n return this._max\n }\n\n return ImmutableDenseMatrix\n}, { isClass: true })\n","import { isArray, isMatrix, isRange } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'Index'\nconst dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType']\n\nexport const createIndexClass = /* #__PURE__ */ factory(name, dependencies, ({ ImmutableDenseMatrix, getMatrixDataType }) => {\n /**\n * Create an index. An Index can store ranges and sets for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Usage:\n * const index = new Index(range1, range2, matrix1, array1, ...)\n *\n * Where each parameter can be any of:\n * A number\n * A string (containing a name of an object property)\n * An instance of Range\n * An Array with the Set values\n * An Array with Booleans\n * A Matrix with the Set values\n * A Matrix with Booleans\n *\n * The parameters start, end, and step must be integer numbers.\n *\n * @class Index\n * @Constructor Index\n * @param {...*} ranges\n */\n function Index (ranges) {\n if (!(this instanceof Index)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n this._dimensions = []\n this._sourceSize = []\n this._isScalar = true\n\n for (let i = 0, ii = arguments.length; i < ii; i++) {\n const arg = arguments[i]\n const argIsArray = isArray(arg)\n const argIsMatrix = isMatrix(arg)\n let sourceSize = null\n if (isRange(arg)) {\n this._dimensions.push(arg)\n this._isScalar = false\n } else if (argIsArray || argIsMatrix) {\n // create matrix\n let m\n\n if (getMatrixDataType(arg) === 'boolean') {\n if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf())\n if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf())\n sourceSize = arg.valueOf().length\n } else {\n m = _createImmutableMatrix(arg.valueOf())\n }\n\n this._dimensions.push(m)\n // size\n const size = m.size()\n // scalar\n if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {\n this._isScalar = false\n }\n } else if (typeof arg === 'number') {\n this._dimensions.push(_createImmutableMatrix([arg]))\n } else if (typeof arg === 'string') {\n // object property (arguments.count should be 1)\n this._dimensions.push(arg)\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range')\n }\n this._sourceSize.push(sourceSize)\n // TODO: implement support for wildcard '*'\n }\n }\n\n /**\n * Attach type information\n */\n Index.prototype.type = 'Index'\n Index.prototype.isIndex = true\n\n function _createImmutableMatrix (arg) {\n // loop array elements\n for (let i = 0, l = arg.length; i < l; i++) {\n if (typeof arg[i] !== 'number' || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers')\n }\n }\n // create matrix\n return new ImmutableDenseMatrix(arg)\n }\n\n /**\n * Create a clone of the index\n * @memberof Index\n * @return {Index} clone\n */\n Index.prototype.clone = function () {\n const index = new Index()\n index._dimensions = clone(this._dimensions)\n index._isScalar = this._isScalar\n index._sourceSize = this._sourceSize\n return index\n }\n\n /**\n * Create an index from an array with ranges/numbers\n * @memberof Index\n * @param {Array.} ranges\n * @return {Index} index\n * @private\n */\n Index.create = function (ranges) {\n const index = new Index()\n Index.apply(index, ranges)\n return index\n }\n\n /**\n * Retrieve the size of the index, the number of elements for each dimension.\n * @memberof Index\n * @returns {number[]} size\n */\n Index.prototype.size = function () {\n const size = []\n\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n const d = this._dimensions[i]\n size[i] = (typeof d === 'string') ? 1 : d.size()[0]\n }\n\n return size\n }\n\n /**\n * Get the maximum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} max\n */\n Index.prototype.max = function () {\n const values = []\n\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n const range = this._dimensions[i]\n values[i] = (typeof range === 'string') ? range : range.max()\n }\n\n return values\n }\n\n /**\n * Get the minimum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} min\n */\n Index.prototype.min = function () {\n const values = []\n\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n const range = this._dimensions[i]\n values[i] = (typeof range === 'string') ? range : range.min()\n }\n\n return values\n }\n\n /**\n * Loop over each of the ranges of the index\n * @memberof Index\n * @param {Function} callback Called for each range with a Range as first\n * argument, the dimension as second, and the\n * index object as third.\n */\n Index.prototype.forEach = function (callback) {\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n callback(this._dimensions[i], i, this)\n }\n }\n\n /**\n * Retrieve the dimension for the given index\n * @memberof Index\n * @param {Number} dim Number of the dimension\n * @returns {Range | null} range\n */\n Index.prototype.dimension = function (dim) {\n return this._dimensions[dim] || null\n }\n\n /**\n * Test whether this index contains an object property\n * @returns {boolean} Returns true if the index is an object property\n */\n Index.prototype.isObjectProperty = function () {\n return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string'\n }\n\n /**\n * Returns the object property name when the Index holds a single object property,\n * else returns null\n * @returns {string | null}\n */\n Index.prototype.getObjectProperty = function () {\n return this.isObjectProperty() ? this._dimensions[0] : null\n }\n\n /**\n * Test whether this index contains only a single value.\n *\n * This is the case when the index is created with only scalar values as ranges,\n * not for ranges resolving into a single value.\n * @memberof Index\n * @return {boolean} isScalar\n */\n Index.prototype.isScalar = function () {\n return this._isScalar\n }\n\n /**\n * Expand the Index into an array.\n * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]]\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.toArray = function () {\n const array = []\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n const dimension = this._dimensions[i]\n array.push((typeof dimension === 'string') ? dimension : dimension.toArray())\n }\n return array\n }\n\n /**\n * Get the primitive value of the Index, a two dimensional array.\n * Equivalent to Index.toArray().\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.valueOf = Index.prototype.toArray\n\n /**\n * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]'\n * @memberof Index\n * @returns {String} str\n */\n Index.prototype.toString = function () {\n const strings = []\n\n for (let i = 0, ii = this._dimensions.length; i < ii; i++) {\n const dimension = this._dimensions[i]\n if (typeof dimension === 'string') {\n strings.push(JSON.stringify(dimension))\n } else {\n strings.push(dimension.toString())\n }\n }\n\n return '[' + strings.join(', ') + ']'\n }\n\n /**\n * Get a JSON representation of the Index\n * @memberof Index\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Index\", \"ranges\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n */\n Index.prototype.toJSON = function () {\n return {\n mathjs: 'Index',\n dimensions: this._dimensions\n }\n }\n\n /**\n * Instantiate an Index from a JSON object\n * @memberof Index\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Index\", \"dimensions\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n * @return {Index}\n */\n Index.fromJSON = function (json) {\n return Index.create(json.dimensions)\n }\n\n return Index\n}, { isClass: true })\n\n/**\n * Receives an array of booleans and returns an array of Numbers for Index\n * @param {Array} booleanArrayIndex An array of booleans\n * @return {Array} A set of numbers ready for index\n */\nfunction _booleansArrayToNumbersForIndex (booleanArrayIndex) {\n // gets an array of booleans and returns an array of numbers\n const indexOfNumbers = []\n booleanArrayIndex.forEach((bool, idx) => {\n if (bool) {\n indexOfNumbers.push(idx)\n }\n })\n return indexOfNumbers\n}\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'FibonacciHeap'\nconst dependencies = ['smaller', 'larger']\n\nexport const createFibonacciHeapClass = /* #__PURE__ */ factory(name, dependencies, ({ smaller, larger }) => {\n const oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0)\n\n /**\n * Fibonacci Heap implementation, used interally for Matrix math.\n * @class FibonacciHeap\n * @constructor FibonacciHeap\n */\n function FibonacciHeap () {\n if (!(this instanceof FibonacciHeap)) { throw new SyntaxError('Constructor must be called with the new operator') }\n\n // initialize fields\n this._minimum = null\n this._size = 0\n }\n\n /**\n * Attach type information\n */\n FibonacciHeap.prototype.type = 'FibonacciHeap'\n FibonacciHeap.prototype.isFibonacciHeap = true\n\n /**\n * Inserts a new data element into the heap. No heap consolidation is\n * performed at this time, the new node is simply inserted into the root\n * list of this heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.insert = function (key, value) {\n // create node\n const node = {\n key,\n value,\n degree: 0\n }\n // check we have a node in the minimum\n if (this._minimum) {\n // minimum node\n const minimum = this._minimum\n // update left & right of node\n node.left = minimum\n node.right = minimum.right\n minimum.right = node\n node.right.left = node\n // update minimum node in heap if needed\n if (smaller(key, minimum.key)) {\n // node has a smaller key, use it as minimum\n this._minimum = node\n }\n } else {\n // set left & right\n node.left = node\n node.right = node\n // this is the first node\n this._minimum = node\n }\n // increment number of nodes in heap\n this._size++\n // return node\n return node\n }\n\n /**\n * Returns the number of nodes in heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.size = function () {\n return this._size\n }\n\n /**\n * Removes all elements from this heap.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.clear = function () {\n this._minimum = null\n this._size = 0\n }\n\n /**\n * Returns true if the heap is empty, otherwise false.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.isEmpty = function () {\n return this._size === 0\n }\n\n /**\n * Extracts the node with minimum key from heap. Amortized running\n * time: O(log n).\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.extractMinimum = function () {\n // node to remove\n const node = this._minimum\n // check we have a minimum\n if (node === null) { return node }\n // current minimum\n let minimum = this._minimum\n // get number of children\n let numberOfChildren = node.degree\n // pointer to the first child\n let x = node.child\n // for each child of node do...\n while (numberOfChildren > 0) {\n // store node in right side\n const tempRight = x.right\n // remove x from child list\n x.left.right = x.right\n x.right.left = x.left\n // add x to root list of heap\n x.left = minimum\n x.right = minimum.right\n minimum.right = x\n x.right.left = x\n // set Parent[x] to null\n x.parent = null\n x = tempRight\n numberOfChildren--\n }\n // remove node from root list of heap\n node.left.right = node.right\n node.right.left = node.left\n // update minimum\n if (node === node.right) {\n // empty\n minimum = null\n } else {\n // update minimum\n minimum = node.right\n // we need to update the pointer to the root with minimum key\n minimum = _findMinimumNode(minimum, this._size)\n }\n // decrement size of heap\n this._size--\n // update minimum\n this._minimum = minimum\n // return node\n return node\n }\n\n /**\n * Removes a node from the heap given the reference to the node. The trees\n * in the heap will be consolidated, if necessary. This operation may fail\n * to remove the correct element if there are nodes with key value -Infinity.\n * Running time: O(log n) amortized.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.remove = function (node) {\n // decrease key value\n this._minimum = _decreaseKey(this._minimum, node, -1)\n // remove the smallest\n this.extractMinimum()\n }\n\n /**\n * Decreases the key value for a heap node, given the new value to take on.\n * The structure of the heap may be changed and will not be consolidated.\n * Running time: O(1) amortized.\n * @memberof FibonacciHeap\n */\n function _decreaseKey (minimum, node, key) {\n // set node key\n node.key = key\n // get parent node\n const parent = node.parent\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent)\n // remove all nodes from parent to the root parent\n _cascadingCut(minimum, parent)\n }\n // update minimum node if needed\n if (smaller(node.key, minimum.key)) { minimum = node }\n // return minimum\n return minimum\n }\n\n /**\n * The reverse of the link operation: removes node from the child list of parent.\n * This method assumes that min is non-null. Running time: O(1).\n * @memberof FibonacciHeap\n */\n function _cut (minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right\n node.right.left = node.left\n parent.degree--\n // reset y.child if necessary\n if (parent.child === node) { parent.child = node.right }\n // remove child if degree is 0\n if (parent.degree === 0) { parent.child = null }\n // add node to root list of heap\n node.left = minimum\n node.right = minimum.right\n minimum.right = node\n node.right.left = node\n // set parent[node] to null\n node.parent = null\n // set mark[node] to false\n node.mark = false\n }\n\n /**\n * Performs a cascading cut operation. This cuts node from its parent and then\n * does the same for its parent, and so on up the tree.\n * Running time: O(log n); O(1) excluding the recursion.\n * @memberof FibonacciHeap\n */\n function _cascadingCut (minimum, node) {\n // store parent node\n const parent = node.parent\n // if there's a parent...\n if (!parent) { return }\n // if node is unmarked, set it marked\n if (!node.mark) {\n node.mark = true\n } else {\n // it's marked, cut it from parent\n _cut(minimum, node, parent)\n // cut its parent as well\n _cascadingCut(parent)\n }\n }\n\n /**\n * Make the first node a child of the second one. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n const _linkNodes = function (node, parent) {\n // remove node from root list of heap\n node.left.right = node.right\n node.right.left = node.left\n // make node a Child of parent\n node.parent = parent\n if (!parent.child) {\n parent.child = node\n node.right = node\n node.left = node\n } else {\n node.left = parent.child\n node.right = parent.child.right\n parent.child.right = node\n node.right.left = node\n }\n // increase degree[parent]\n parent.degree++\n // set mark[node] false\n node.mark = false\n }\n\n function _findMinimumNode (minimum, size) {\n // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree\n const arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1\n // create list with initial capacity\n const array = new Array(arraySize)\n // find the number of root nodes.\n let numRoots = 0\n let x = minimum\n if (x) {\n numRoots++\n x = x.right\n while (x !== minimum) {\n numRoots++\n x = x.right\n }\n }\n // vars\n let y\n // For each node in root list do...\n while (numRoots > 0) {\n // access this node's degree..\n let d = x.degree\n // get next node\n const next = x.right\n // check if there is a node already in array with the same degree\n while (true) {\n // get node with the same degree is any\n y = array[d]\n if (!y) { break }\n // make one node with the same degree a child of the other, do this based on the key value.\n if (larger(x.key, y.key)) {\n const temp = y\n y = x\n x = temp\n }\n // make y a child of x\n _linkNodes(y, x)\n // we have handled this degree, go to next one.\n array[d] = null\n d++\n }\n // save this node for later when we might encounter another of the same degree.\n array[d] = x\n // move forward through list.\n x = next\n numRoots--\n }\n // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[].\n minimum = null\n // loop nodes in array\n for (let i = 0; i < arraySize; i++) {\n // get current node\n y = array[i]\n if (!y) { continue }\n // check if we have a linked list\n if (minimum) {\n // First remove node from root list.\n y.left.right = y.right\n y.right.left = y.left\n // now add to root list, again.\n y.left = minimum\n y.right = minimum.right\n minimum.right = y\n y.right.left = y\n // check if this is a new min.\n if (smaller(y.key, minimum.key)) { minimum = y }\n } else { minimum = y }\n }\n return minimum\n }\n\n return FibonacciHeap\n}, { isClass: true })\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'Spa'\nconst dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap']\n\nexport const createSpaClass = /* #__PURE__ */ factory(name, dependencies, ({ addScalar, equalScalar, FibonacciHeap }) => {\n /**\n * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array\n * of the vector elements and an ordered list of non-zero elements.\n */\n function Spa () {\n if (!(this instanceof Spa)) { throw new SyntaxError('Constructor must be called with the new operator') }\n\n // allocate vector, TODO use typed arrays\n this._values = []\n this._heap = new FibonacciHeap()\n }\n\n /**\n * Attach type information\n */\n Spa.prototype.type = 'Spa'\n Spa.prototype.isSpa = true\n\n /**\n * Set the value for index i.\n *\n * @param {number} i The index\n * @param {number | BigNumber | Complex} The value at index i\n */\n Spa.prototype.set = function (i, v) {\n // check we have a value @ i\n if (!this._values[i]) {\n // insert in heap\n const node = this._heap.insert(i, v)\n // set the value @ i\n this._values[i] = node\n } else {\n // update the value @ i\n this._values[i].value = v\n }\n }\n\n Spa.prototype.get = function (i) {\n const node = this._values[i]\n if (node) { return node.value }\n return 0\n }\n\n Spa.prototype.accumulate = function (i, v) {\n // node @ i\n let node = this._values[i]\n if (!node) {\n // insert in heap\n node = this._heap.insert(i, v)\n // initialize value\n this._values[i] = node\n } else {\n // accumulate value\n node.value = addScalar(node.value, v)\n }\n }\n\n Spa.prototype.forEach = function (from, to, callback) {\n // references\n const heap = this._heap\n const values = this._values\n // nodes\n const nodes = []\n // node with minimum key, save it\n let node = heap.extractMinimum()\n if (node) { nodes.push(node) }\n // extract nodes from heap (ordered)\n while (node && node.key <= to) {\n // check it is in range\n if (node.key >= from) {\n // check value is not zero\n if (!equalScalar(node.value, 0)) {\n // invoke callback\n callback(node.key, node.value, this)\n }\n }\n // extract next node, save it\n node = heap.extractMinimum()\n if (node) { nodes.push(node) }\n }\n // reinsert all nodes in heap\n for (let i = 0; i < nodes.length; i++) {\n // current node\n const n = nodes[i]\n // insert node in heap\n node = heap.insert(n.key, n.value)\n // update values\n values[node.key] = node\n }\n }\n\n Spa.prototype.swap = function (i, j) {\n // node @ i and j\n let nodei = this._values[i]\n let nodej = this._values[j]\n // check we need to insert indeces\n if (!nodei && nodej) {\n // insert in heap\n nodei = this._heap.insert(i, nodej.value)\n // remove from heap\n this._heap.remove(nodej)\n // set values\n this._values[i] = nodei\n this._values[j] = undefined\n } else if (nodei && !nodej) {\n // insert in heap\n nodej = this._heap.insert(j, nodei.value)\n // remove from heap\n this._heap.remove(nodei)\n // set values\n this._values[j] = nodej\n this._values[i] = undefined\n } else if (nodei && nodej) {\n // swap values\n const v = nodei.value\n nodei.value = nodej.value\n nodej.value = v\n }\n }\n\n return Spa\n}, { isClass: true })\n","// (c) 2018, Mariusz Nowak\n// SPDX-License-Identifier: ISC\n// Derived from https://github.com/medikoo/lru-queue\nexport function lruQueue (limit) {\n let size = 0\n let base = 1\n let queue = Object.create(null)\n let map = Object.create(null)\n let index = 0\n const del = function (id) {\n const oldIndex = map[id]\n if (!oldIndex) return\n delete queue[oldIndex]\n delete map[id]\n --size\n if (base !== oldIndex) return\n if (!size) {\n index = 0\n base = 1\n return\n }\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) { /* empty */ }\n }\n limit = Math.abs(limit)\n return {\n hit: function (id) {\n const oldIndex = map[id]; const nuIndex = ++index\n queue[nuIndex] = id\n map[id] = nuIndex\n if (!oldIndex) {\n ++size\n if (size <= limit) return undefined\n id = queue[base]\n del(id)\n return id\n }\n delete queue[oldIndex]\n if (base !== oldIndex) return undefined\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) { /* empty */ }\n return undefined\n },\n delete: del,\n clear: function () {\n size = index = 0\n base = 1\n queue = Object.create(null)\n map = Object.create(null)\n }\n }\n}\n","// function utils\n\nimport { lruQueue } from './lruQueue.js'\n\n/**\n * Memoize a given function by caching the computed result.\n * The cache of a memoized function can be cleared by deleting the `cache`\n * property of the function.\n *\n * @param {function} fn The function to be memoized.\n * Must be a pure function.\n * @param {Object} [options]\n * @param {function(args: Array): string} [options.hasher]\n * A custom hash builder. Is JSON.stringify by default.\n * @param {number | undefined} [options.limit]\n * Maximum number of values that may be cached. Undefined indicates\n * unlimited (default)\n * @return {function} Returns the memoized function\n */\nexport function memoize (fn, { hasher, limit } = {}) {\n limit = limit == null ? Number.POSITIVE_INFINITY : limit\n hasher = hasher == null ? JSON.stringify : hasher\n\n return function memoize () {\n if (typeof memoize.cache !== 'object') {\n memoize.cache = {\n values: new Map(),\n lru: lruQueue(limit || Number.POSITIVE_INFINITY)\n }\n }\n const args = []\n for (let i = 0; i < arguments.length; i++) {\n args[i] = arguments[i]\n }\n const hash = hasher(args)\n\n if (memoize.cache.values.has(hash)) {\n memoize.cache.lru.hit(hash)\n return memoize.cache.values.get(hash)\n }\n\n const newVal = fn.apply(fn, args)\n memoize.cache.values.set(hash, newVal)\n memoize.cache.values.delete(memoize.cache.lru.hit(hash))\n\n return newVal\n }\n}\n\n/**\n * Memoize a given function by caching all results and the arguments,\n * and comparing against the arguments of previous results before\n * executing again.\n * This is less performant than `memoize` which calculates a hash,\n * which is very fast to compare. Use `memoizeCompare` only when it is\n * not possible to create a unique serializable hash from the function\n * arguments.\n * The isEqual function must compare two sets of arguments\n * and return true when equal (can be a deep equality check for example).\n * @param {function} fn\n * @param {function(a: *, b: *) : boolean} isEqual\n * @returns {function}\n */\nexport function memoizeCompare (fn, isEqual) {\n const memoize = function memoize () {\n const args = []\n for (let i = 0; i < arguments.length; i++) {\n args[i] = arguments[i]\n }\n\n for (let c = 0; c < memoize.cache.length; c++) {\n const cached = memoize.cache[c]\n\n if (isEqual(args, cached.args)) {\n // TODO: move this cache entry to the top so recently used entries move up?\n return cached.res\n }\n }\n\n const res = fn.apply(fn, args)\n memoize.cache.unshift({ args, res })\n\n return res\n }\n\n memoize.cache = []\n\n return memoize\n}\n","import { memoize } from '../function.js'\n\n/**\n * Calculate BigNumber e\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns e\n */\nexport const createBigNumberE = memoize(function (BigNumber) {\n return new BigNumber(1).exp()\n}, { hasher })\n\n/**\n * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns phi\n */\nexport const createBigNumberPhi = memoize(function (BigNumber) {\n return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2)\n}, { hasher })\n\n/**\n * Calculate BigNumber pi.\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns pi\n */\nexport const createBigNumberPi = memoize(function (BigNumber) {\n return BigNumber.acos(-1)\n}, { hasher })\n\n/**\n * Calculate BigNumber tau, tau = 2 * pi\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns tau\n */\nexport const createBigNumberTau = memoize(function (BigNumber) {\n return createBigNumberPi(BigNumber).times(2)\n}, { hasher })\n\n/**\n * Create a hash for a BigNumber constructor function. The created has is\n * the configured precision\n * @param {Array} args Supposed to contain a single entry with\n * a BigNumber constructor\n * @return {number} precision\n * @private\n */\nfunction hasher (args) {\n return args[0].precision\n}\n","import { isComplex, isUnit, typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { memoize } from '../../utils/function.js'\nimport { endsWith } from '../../utils/string.js'\nimport { clone, hasOwnProperty } from '../../utils/object.js'\nimport { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js'\n\nconst name = 'Unit'\nconst dependencies = [\n '?on',\n 'config',\n 'addScalar',\n 'subtractScalar',\n 'multiplyScalar',\n 'divideScalar',\n 'pow',\n 'abs',\n 'fix',\n 'round',\n 'equal',\n 'isNumeric',\n 'format',\n 'number',\n 'Complex',\n 'BigNumber',\n 'Fraction'\n]\n\nexport const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({\n on,\n config,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n abs,\n fix,\n round,\n equal,\n isNumeric,\n format,\n number,\n Complex,\n BigNumber,\n Fraction\n}) => {\n const toNumber = number\n /**\n * A unit can be constructed in the following ways:\n *\n * const a = new Unit(value, valuelessUnit)\n * const b = new Unit(null, valuelessUnit)\n * const c = Unit.parse(str)\n *\n * Example usage:\n *\n * const a = new Unit(5, 'cm') // 50 mm\n * const b = Unit.parse('23 kg') // 23 kg\n * const c = math.in(a, new Unit(null, 'm') // 0.05 m\n * const d = new Unit(9.81, \"m/s^2\") // 9.81 m/s^2\n *\n * @class Unit\n * @constructor Unit\n * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n */\n function Unit (value, valuelessUnit) {\n if (!(this instanceof Unit)) {\n throw new Error('Constructor must be called with the new operator')\n }\n\n if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) {\n throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined')\n }\n\n this.fixPrefix = false // if true, function format will not search for the\n // best prefix but leave it as initially provided.\n // fixPrefix is set true by the method Unit.to\n\n // The justification behind this is that if the constructor is explicitly called,\n // the caller wishes the units to be returned exactly as supplied.\n this.skipAutomaticSimplification = true\n\n if (valuelessUnit === undefined) {\n this.units = []\n this.dimensions = BASE_DIMENSIONS.map(x => 0)\n } else if (typeof valuelessUnit === 'string') {\n const u = Unit.parse(valuelessUnit)\n this.units = u.units\n this.dimensions = u.dimensions\n } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) {\n // clone from valuelessUnit\n this.fixPrefix = valuelessUnit.fixPrefix\n this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification\n this.dimensions = valuelessUnit.dimensions.slice(0)\n this.units = valuelessUnit.units.map(u => Object.assign({}, u))\n } else {\n throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit')\n }\n\n this.value = this._normalize(value)\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(Unit, 'name', { value: 'Unit' })\n Unit.prototype.constructor = Unit\n Unit.prototype.type = 'Unit'\n Unit.prototype.isUnit = true\n\n // private variables and functions for the Unit parser\n let text, index, c\n\n function skipWhitespace () {\n while (c === ' ' || c === '\\t') {\n next()\n }\n }\n\n function isDigitDot (c) {\n return ((c >= '0' && c <= '9') || c === '.')\n }\n\n function isDigit (c) {\n return ((c >= '0' && c <= '9'))\n }\n\n function next () {\n index++\n c = text.charAt(index)\n }\n\n function revert (oldIndex) {\n index = oldIndex\n c = text.charAt(index)\n }\n\n function parseNumber () {\n let number = ''\n const oldIndex = index\n\n if (c === '+') {\n next()\n } else if (c === '-') {\n number += c\n next()\n }\n\n if (!isDigitDot(c)) {\n // a + or - must be followed by a digit\n revert(oldIndex)\n return null\n }\n\n // get number, can have a single dot\n if (c === '.') {\n number += c\n next()\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n revert(oldIndex)\n return null\n }\n } else {\n while (isDigit(c)) {\n number += c\n next()\n }\n if (c === '.') {\n number += c\n next()\n }\n }\n while (isDigit(c)) {\n number += c\n next()\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c === 'E' || c === 'e') {\n // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as \"4exabytes\"\n\n let tentativeNumber = ''\n const tentativeIndex = index\n\n tentativeNumber += c\n next()\n\n if (c === '+' || c === '-') {\n tentativeNumber += c\n next()\n }\n\n // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation)\n if (!isDigit(c)) {\n // The e or E must belong to something else, so return the number without the e or E.\n revert(tentativeIndex)\n return number\n }\n\n // We can now safely say that this is scientific notation.\n number = number + tentativeNumber\n while (isDigit(c)) {\n number += c\n next()\n }\n }\n\n return number\n }\n\n function parseUnit () {\n let unitName = ''\n\n // Alphanumeric characters only; matches [a-zA-Z0-9]\n while (isDigit(c) || Unit.isValidAlpha(c)) {\n unitName += c\n next()\n }\n\n // Must begin with [a-zA-Z]\n const firstC = unitName.charAt(0)\n if (Unit.isValidAlpha(firstC)) {\n return unitName\n } else {\n return null\n }\n }\n\n function parseCharacter (toFind) {\n if (c === toFind) {\n next()\n return toFind\n } else {\n return null\n }\n }\n\n /**\n * Parse a string into a unit. The value of the unit is parsed as number,\n * BigNumber, or Fraction depending on the math.js config setting `number`.\n *\n * Throws an exception if the provided string does not contain a valid unit or\n * cannot be parsed.\n * @memberof Unit\n * @param {string} str A string like \"5.2 inch\", \"4e2 cm/s^2\"\n * @return {Unit} unit\n */\n Unit.parse = function (str, options) {\n options = options || {}\n text = str\n index = -1\n c = ''\n\n if (typeof text !== 'string') {\n throw new TypeError('Invalid argument in Unit.parse, string expected')\n }\n\n const unit = new Unit()\n unit.units = []\n\n let powerMultiplierCurrent = 1\n let expectingUnit = false\n\n // A unit should follow this pattern:\n // [number] ...[ [*/] unit[^number] ]\n // unit[^number] ... [ [*/] unit[^number] ]\n\n // Rules:\n // number is any floating point number.\n // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number!\n // The string may optionally begin with a number.\n // Each unit may optionally be followed by ^number.\n // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable:\n // 2m^2kg/s^2\n // it is not good form. If a unit starts with e, then it could be confused as a floating point number:\n // 4erg\n\n next()\n skipWhitespace()\n\n // Optional number at the start of the string\n const valueStr = parseNumber()\n let value = null\n if (valueStr) {\n if (config.number === 'BigNumber') {\n value = new BigNumber(valueStr)\n } else if (config.number === 'Fraction') {\n try {\n // not all numbers can be turned in Fractions, for example very small numbers not\n value = new Fraction(valueStr)\n } catch (err) {\n value = parseFloat(valueStr)\n }\n } else { // number\n value = parseFloat(valueStr)\n }\n\n skipWhitespace() // Whitespace is not required here\n\n // handle multiplication or division right after the value, like '1/s'\n if (parseCharacter('*')) {\n powerMultiplierCurrent = 1\n expectingUnit = true\n } else if (parseCharacter('/')) {\n powerMultiplierCurrent = -1\n expectingUnit = true\n }\n }\n\n // Stack to keep track of powerMultipliers applied to each parentheses group\n const powerMultiplierStack = []\n\n // Running product of all elements in powerMultiplierStack\n let powerMultiplierStackProduct = 1\n\n while (true) {\n skipWhitespace()\n\n // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack\n // A '(' will always appear directly before a unit.\n while (c === '(') {\n powerMultiplierStack.push(powerMultiplierCurrent)\n powerMultiplierStackProduct *= powerMultiplierCurrent\n powerMultiplierCurrent = 1\n next()\n skipWhitespace()\n }\n\n // Is there something here?\n let uStr\n if (c) {\n const oldC = c\n uStr = parseUnit()\n if (uStr === null) {\n throw new SyntaxError('Unexpected \"' + oldC + '\" in \"' + text + '\" at index ' + index.toString())\n }\n } else {\n // End of input.\n break\n }\n\n // Verify the unit exists and get the prefix (if any)\n const res = _findUnit(uStr)\n if (res === null) {\n // Unit not found.\n throw new SyntaxError('Unit \"' + uStr + '\" not found.')\n }\n\n let power = powerMultiplierCurrent * powerMultiplierStackProduct\n // Is there a \"^ number\"?\n skipWhitespace()\n if (parseCharacter('^')) {\n skipWhitespace()\n const p = parseNumber()\n if (p === null) {\n // No valid number found for the power!\n throw new SyntaxError('In \"' + str + '\", \"^\" must be followed by a floating-point number')\n }\n power *= p\n }\n\n // Add the unit to the list\n unit.units.push({\n unit: res.unit,\n prefix: res.prefix,\n power\n })\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power\n }\n\n // Check for and consume closing parentheses, popping from the stack.\n // A ')' will always follow a unit.\n skipWhitespace()\n while (c === ')') {\n if (powerMultiplierStack.length === 0) {\n throw new SyntaxError('Unmatched \")\" in \"' + text + '\" at index ' + index.toString())\n }\n powerMultiplierStackProduct /= powerMultiplierStack.pop()\n next()\n skipWhitespace()\n }\n\n // \"*\" and \"/\" should mean we are expecting something to come next.\n // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator.\n expectingUnit = false\n\n if (parseCharacter('*')) {\n // explicit multiplication\n powerMultiplierCurrent = 1\n expectingUnit = true\n } else if (parseCharacter('/')) {\n // division\n powerMultiplierCurrent = -1\n expectingUnit = true\n } else {\n // implicit multiplication\n powerMultiplierCurrent = 1\n }\n\n // Replace the unit into the auto unit system\n if (res.unit.base) {\n const baseDim = res.unit.base.key\n UNIT_SYSTEMS.auto[baseDim] = {\n unit: res.unit,\n prefix: res.prefix\n }\n }\n }\n\n // Has the string been entirely consumed?\n skipWhitespace()\n if (c) {\n throw new SyntaxError('Could not parse: \"' + str + '\"')\n }\n\n // Is there a trailing slash?\n if (expectingUnit) {\n throw new SyntaxError('Trailing characters: \"' + str + '\"')\n }\n\n // Is the parentheses stack empty?\n if (powerMultiplierStack.length !== 0) {\n throw new SyntaxError('Unmatched \"(\" in \"' + text + '\"')\n }\n\n // Are there any units at all?\n if (unit.units.length === 0 && !options.allowNoUnits) {\n throw new SyntaxError('\"' + str + '\" contains no units')\n }\n\n unit.value = (value !== undefined) ? unit._normalize(value) : null\n return unit\n }\n\n /**\n * create a copy of this unit\n * @memberof Unit\n * @return {Unit} Returns a cloned version of the unit\n */\n Unit.prototype.clone = function () {\n const unit = new Unit()\n\n unit.fixPrefix = this.fixPrefix\n unit.skipAutomaticSimplification = this.skipAutomaticSimplification\n\n unit.value = clone(this.value)\n unit.dimensions = this.dimensions.slice(0)\n unit.units = []\n for (let i = 0; i < this.units.length; i++) {\n unit.units[i] = { }\n for (const p in this.units[i]) {\n if (hasOwnProperty(this.units[i], p)) {\n unit.units[i][p] = this.units[i][p]\n }\n }\n }\n\n return unit\n }\n\n /**\n * Return the type of the value of this unit\n *\n * @memberof Unit\n * @return {string} type of the value of the unit\n */\n Unit.prototype.valueType = function () {\n return typeOf(this.value)\n }\n\n /**\n * Return whether the unit is derived (such as m/s, or cm^2, but not N)\n * @memberof Unit\n * @return {boolean} True if the unit is derived\n * @private\n */\n Unit.prototype._isDerived = function () {\n if (this.units.length === 0) {\n return false\n }\n return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15\n }\n\n /**\n * Normalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number | BigNumber | Fraction | boolean} value\n * @return {number | BigNumber | Fraction | boolean} normalized value\n * @private\n */\n Unit.prototype._normalize = function (value) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value\n }\n let res = value\n const convert = Unit._getNumberConverter(typeOf(value)) // convert to Fraction or BigNumber if needed\n\n for (let i = 0; i < this.units.length; i++) {\n const unitValue = convert(this.units[i].unit.value)\n const unitPrefixValue = convert(this.units[i].prefix.value)\n const unitPower = convert(this.units[i].power)\n res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower))\n }\n\n return res\n }\n\n /**\n * Denormalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number} value\n * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit)\n * @return {number} denormalized value\n * @private\n */\n Unit.prototype._denormalize = function (value, prefixValue) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value\n }\n let res = value\n const convert = Unit._getNumberConverter(typeOf(value)) // convert to Fraction or BigNumber if needed\n\n for (let i = 0; i < this.units.length; i++) {\n const unitValue = convert(this.units[i].unit.value)\n const unitPrefixValue = convert(this.units[i].prefix.value)\n const unitPower = convert(this.units[i].power)\n res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower))\n }\n\n return res\n }\n\n /**\n * Find a unit from a string\n * @memberof Unit\n * @param {string} str A string like 'cm' or 'inch'\n * @returns {Object | null} result When found, an object with fields unit and\n * prefix is returned. Else, null is returned.\n * @private\n */\n const _findUnit = memoize((str) => {\n // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit.\n if (hasOwnProperty(UNITS, str)) {\n const unit = UNITS[str]\n const prefix = unit.prefixes['']\n return { unit, prefix }\n }\n\n for (const name in UNITS) {\n if (hasOwnProperty(UNITS, name)) {\n if (endsWith(str, name)) {\n const unit = UNITS[name]\n const prefixLen = (str.length - name.length)\n const prefixName = str.substring(0, prefixLen)\n const prefix = hasOwnProperty(unit.prefixes, prefixName)\n ? unit.prefixes[prefixName]\n : undefined\n if (prefix !== undefined) {\n // store unit, prefix, and value\n return { unit, prefix }\n }\n }\n }\n }\n\n return null\n }, { hasher: (args) => args[0], limit: 100 })\n\n /**\n * Test if the given expression is a unit.\n * The unit can have a prefix but cannot have a value.\n * @memberof Unit\n * @param {string} name A string to be tested whether it is a value less unit.\n * The unit can have prefix, like \"cm\"\n * @return {boolean} true if the given string is a unit\n */\n Unit.isValuelessUnit = function (name) {\n return (_findUnit(name) !== null)\n }\n\n /**\n * check if this unit has given base unit\n * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.\n * @memberof Unit\n * @param {BASE_UNIT | string | undefined} base\n */\n Unit.prototype.hasBase = function (base) {\n if (typeof (base) === 'string') {\n base = BASE_UNITS[base]\n }\n\n if (!base) { return false }\n\n // All dimensions must be the same\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) {\n return false\n }\n }\n return true\n }\n\n /**\n * Check if this unit has a base or bases equal to another base or bases\n * For derived units, the exponent on each base also must match\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if equal base\n */\n Unit.prototype.equalBase = function (other) {\n // All dimensions must be the same\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) {\n return false\n }\n }\n return true\n }\n\n /**\n * Check if this unit equals another unit\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if both units are equal\n */\n Unit.prototype.equals = function (other) {\n return (this.equalBase(other) && equal(this.value, other.value))\n }\n\n /**\n * Multiply this unit with another one or with a scalar\n * @memberof Unit\n * @param {Unit} other\n * @return {Unit} product of this unit and the other unit\n */\n Unit.prototype.multiply = function (_other) {\n const res = this.clone()\n const other = isUnit(_other) ? _other : new Unit(_other)\n\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0)\n }\n\n // Append other's units list onto res\n for (let i = 0; i < other.units.length; i++) {\n // Make a shallow copy of every unit\n const inverted = {\n ...other.units[i]\n }\n res.units.push(inverted)\n }\n\n // If at least one operand has a value, then the result should also have a value\n if (this.value !== null || other.value !== null) {\n const valThis = this.value === null ? this._normalize(1) : this.value\n const valOther = other.value === null ? other._normalize(1) : other.value\n res.value = multiplyScalar(valThis, valOther)\n } else {\n res.value = null\n }\n\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false\n }\n\n return getNumericIfUnitless(res)\n }\n\n /**\n * Divide a number by this unit\n *\n * @memberof Unit\n * @param {numeric} numerator\n * @param {unit} result of dividing numerator by this unit\n */\n Unit.prototype.divideInto = function (numerator) {\n return new Unit(numerator).divide(this)\n }\n\n /**\n * Divide this unit by another one\n * @memberof Unit\n * @param {Unit | numeric} other\n * @return {Unit} result of dividing this unit by the other unit\n */\n Unit.prototype.divide = function (_other) {\n const res = this.clone()\n const other = isUnit(_other) ? _other : new Unit(_other)\n\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0)\n }\n\n // Invert and append other's units list onto res\n for (let i = 0; i < other.units.length; i++) {\n // Make a shallow copy of every unit\n const inverted = {\n ...other.units[i],\n power: -other.units[i].power\n }\n res.units.push(inverted)\n }\n\n // If at least one operand has a value, the result should have a value\n if (this.value !== null || other.value !== null) {\n const valThis = this.value === null ? this._normalize(1) : this.value\n const valOther = other.value === null ? other._normalize(1) : other.value\n res.value = divideScalar(valThis, valOther)\n } else {\n res.value = null\n }\n\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false\n }\n\n return getNumericIfUnitless(res)\n }\n\n /**\n * Calculate the power of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} p\n * @returns {Unit} The result: this^p\n */\n Unit.prototype.pow = function (p) {\n const res = this.clone()\n\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) * p\n }\n\n // Adjust the power of each unit in the list\n for (let i = 0; i < res.units.length; i++) {\n res.units[i].power *= p\n }\n\n if (res.value !== null) {\n res.value = pow(res.value, p)\n\n // only allow numeric output, we don't want to return a Complex number\n // if (!isNumeric(res.value)) {\n // res.value = NaN\n // }\n // Update: Complex supported now\n } else {\n res.value = null\n }\n\n res.skipAutomaticSimplification = false\n\n return getNumericIfUnitless(res)\n }\n\n /**\n * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise\n * @param {Unit} unit\n * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise\n */\n function getNumericIfUnitless (unit) {\n if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {\n return unit.value\n } else {\n return unit\n }\n }\n\n /**\n * Calculate the absolute value of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} x\n * @returns {Unit} The result: |x|, absolute value of x\n */\n Unit.prototype.abs = function () {\n const ret = this.clone()\n if (ret.value !== null) {\n if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) {\n ret.value = abs(ret.value)\n } else {\n // To give the correct, but unexpected, results for units with an offset.\n // For example, abs(-283.15 degC) = -263.15 degC !!!\n // We must take the offset into consideration here\n const convert = ret._numberConverter() // convert to Fraction or BigNumber if needed\n const unitValue = convert(ret.units[0].unit.value)\n const nominalOffset = convert(ret.units[0].unit.offset)\n const unitOffset = multiplyScalar(unitValue, nominalOffset)\n ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset)\n }\n }\n\n for (const i in ret.units) {\n if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') {\n ret.units[i].unit = UNITS.W\n }\n }\n\n return ret\n }\n\n /**\n * Convert the unit to a specific unit name.\n * @memberof Unit\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit.\n */\n Unit.prototype.to = function (valuelessUnit) {\n const value = this.value === null ? this._normalize(1) : this.value\n let other\n if (typeof valuelessUnit === 'string') {\n other = Unit.parse(valuelessUnit)\n } else if (isUnit(valuelessUnit)) {\n other = valuelessUnit.clone()\n } else {\n throw new Error('String or Unit expected as parameter')\n }\n\n if (!this.equalBase(other)) {\n throw new Error(`Units do not match ('${other.toString()}' != '${this.toString()}')`)\n }\n if (other.value !== null) {\n throw new Error('Cannot convert to a unit with a value')\n }\n\n if (this.value === null || this._isDerived() ||\n this.units.length === 0 || other.units.length === 0 ||\n this.units[0].unit.offset === other.units[0].unit.offset) {\n other.value = clone(value)\n } else {\n /* Need to adjust value by difference in offset to convert */\n const convert = Unit._getNumberConverter(typeOf(value)) // convert to Fraction or BigNumber if needed\n\n const thisUnitValue = this.units[0].unit.value\n const thisNominalOffset = this.units[0].unit.offset\n const thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset)\n\n const otherUnitValue = other.units[0].unit.value\n const otherNominalOffset = other.units[0].unit.offset\n const otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset)\n\n other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset)))\n }\n other.fixPrefix = true\n other.skipAutomaticSimplification = true\n return other\n }\n\n /**\n * Return the value of the unit when represented with given valueless unit\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number} Returns the unit value as number.\n */\n // TODO: deprecate Unit.toNumber? It's always better to use toNumeric\n Unit.prototype.toNumber = function (valuelessUnit) {\n return toNumber(this.toNumeric(valuelessUnit))\n }\n\n /**\n * Return the value of the unit in the original numeric type\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number | BigNumber | Fraction} Returns the unit value\n */\n Unit.prototype.toNumeric = function (valuelessUnit) {\n let other\n if (valuelessUnit) {\n // Allow getting the numeric value without converting to a different unit\n other = this.to(valuelessUnit)\n } else {\n other = this.clone()\n }\n\n if (other._isDerived() || other.units.length === 0) {\n return other._denormalize(other.value)\n } else {\n return other._denormalize(other.value, other.units[0].prefix.value)\n }\n }\n\n /**\n * Get a string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.toString = function () {\n return this.format()\n }\n\n /**\n * Get a JSON representation of the unit\n * @memberof Unit\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n */\n Unit.prototype.toJSON = function () {\n return {\n mathjs: 'Unit',\n value: this._denormalize(this.value),\n unit: this.units.length > 0 ? this.formatUnits() : null,\n fixPrefix: this.fixPrefix\n }\n }\n\n /**\n * Instantiate a Unit from a JSON object\n * @memberof Unit\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n * @return {Unit}\n */\n Unit.fromJSON = function (json) {\n const unit = new Unit(json.value, json.unit ?? undefined)\n unit.fixPrefix = json.fixPrefix || false\n return unit\n }\n\n /**\n * Returns the string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.valueOf = Unit.prototype.toString\n\n /**\n * Simplify this Unit's unit list and return a new Unit with the simplified list.\n * The returned Unit will contain a list of the \"best\" units for formatting.\n */\n Unit.prototype.simplify = function () {\n const ret = this.clone()\n\n const proposedUnitList = []\n\n // Search for a matching base\n let matchingBase\n for (const key in currentUnitSystem) {\n if (hasOwnProperty(currentUnitSystem, key)) {\n if (ret.hasBase(BASE_UNITS[key])) {\n matchingBase = key\n break\n }\n }\n }\n\n if (matchingBase === 'NONE') {\n ret.units = []\n } else {\n let matchingUnit\n if (matchingBase) {\n // Does the unit system have a matching unit?\n if (hasOwnProperty(currentUnitSystem, matchingBase)) {\n matchingUnit = currentUnitSystem[matchingBase]\n }\n }\n if (matchingUnit) {\n ret.units = [{\n unit: matchingUnit.unit,\n prefix: matchingUnit.prefix,\n power: 1.0\n }]\n } else {\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the current unit system\n let missingBaseDim = false\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n const baseDim = BASE_DIMENSIONS[i]\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(currentUnitSystem, baseDim)) {\n proposedUnitList.push({\n unit: currentUnitSystem[baseDim].unit,\n prefix: currentUnitSystem[baseDim].prefix,\n power: ret.dimensions[i] || 0\n })\n } else {\n missingBaseDim = true\n }\n }\n }\n\n // Is the proposed unit list \"simpler\" than the existing one?\n if (proposedUnitList.length < ret.units.length && !missingBaseDim) {\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList\n }\n }\n }\n\n return ret\n }\n\n /**\n * Returns a new Unit in the SI system with the same value as this one\n */\n Unit.prototype.toSI = function () {\n const ret = this.clone()\n\n const proposedUnitList = []\n\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the SI unit system\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n const baseDim = BASE_DIMENSIONS[i]\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) {\n proposedUnitList.push({\n unit: UNIT_SYSTEMS.si[baseDim].unit,\n prefix: UNIT_SYSTEMS.si[baseDim].prefix,\n power: ret.dimensions[i] || 0\n })\n } else {\n throw new Error('Cannot express custom unit ' + baseDim + ' in SI units')\n }\n }\n }\n\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList\n\n ret.fixPrefix = true\n ret.skipAutomaticSimplification = true\n\n if (this.value !== null) {\n ret.value = null\n return this.to(ret)\n }\n return ret\n }\n\n /**\n * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.formatUnits = function () {\n let strNum = ''\n let strDen = ''\n let nNum = 0\n let nDen = 0\n\n for (let i = 0; i < this.units.length; i++) {\n if (this.units[i].power > 0) {\n nNum++\n strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name\n if (Math.abs(this.units[i].power - 1.0) > 1e-15) {\n strNum += '^' + this.units[i].power\n }\n } else if (this.units[i].power < 0) {\n nDen++\n }\n }\n\n if (nDen > 0) {\n for (let i = 0; i < this.units.length; i++) {\n if (this.units[i].power < 0) {\n if (nNum > 0) {\n strDen += ' ' + this.units[i].prefix.name + this.units[i].unit.name\n if (Math.abs(this.units[i].power + 1.0) > 1e-15) {\n strDen += '^' + (-this.units[i].power)\n }\n } else {\n strDen += ' ' + this.units[i].prefix.name + this.units[i].unit.name\n strDen += '^' + (this.units[i].power)\n }\n }\n }\n }\n // Remove leading \" \"\n strNum = strNum.substr(1)\n strDen = strDen.substr(1)\n\n // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting\n if (nNum > 1 && nDen > 0) {\n strNum = '(' + strNum + ')'\n }\n if (nDen > 1 && nNum > 0) {\n strDen = '(' + strDen + ')'\n }\n\n let str = strNum\n if (nNum > 0 && nDen > 0) {\n str += ' / '\n }\n str += strDen\n\n return str\n }\n\n /**\n * Get a string representation of the Unit, with optional formatting options.\n * @memberof Unit\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string}\n */\n Unit.prototype.format = function (options) {\n // Simplfy the unit list, unless it is valueless or was created directly in the\n // constructor or as the result of to or toSI\n const simp = this.skipAutomaticSimplification || this.value === null\n ? this.clone()\n : this.simplify()\n\n // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one.\n let isImaginary = false\n if (typeof (simp.value) !== 'undefined' && simp.value !== null && isComplex(simp.value)) {\n // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute\n isImaginary = Math.abs(simp.value.re) < 1e-14\n }\n\n for (const i in simp.units) {\n if (hasOwnProperty(simp.units, i)) {\n if (simp.units[i].unit) {\n if (simp.units[i].unit.name === 'VA' && isImaginary) {\n simp.units[i].unit = UNITS.VAR\n } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) {\n simp.units[i].unit = UNITS.VA\n }\n }\n }\n }\n\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n if (simp.units.length === 1 && !simp.fixPrefix) {\n // Units must have integer powers, otherwise the prefix will change the\n // outputted value by not-an-integer-power-of-ten\n if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) {\n // Apply the best prefix\n simp.units[0].prefix = simp._bestPrefix()\n }\n }\n\n const value = simp._denormalize(simp.value)\n let str = (simp.value !== null) ? format(value, options || {}) : ''\n const unitStr = simp.formatUnits()\n if (simp.value && isComplex(simp.value)) {\n str = '(' + str + ')' // Surround complex values with ( ) to enable better parsing\n }\n if (unitStr.length > 0 && str.length > 0) {\n str += ' '\n }\n str += unitStr\n\n return str\n }\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @private\n */\n Unit.prototype._bestPrefix = function () {\n if (this.units.length !== 1) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!')\n }\n if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!')\n }\n\n // find the best prefix value (resulting in the value of which\n // the absolute value of the log10 is closest to zero,\n // though with a little offset of 1.2 for nicer values: you get a\n // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...\n\n // Note: the units value can be any numeric type, but to find the best\n // prefix it's enough to work with limited precision of a regular number\n // Update: using mathjs abs since we also allow complex numbers\n const absValue = this.value !== null ? abs(this.value) : 0\n const absUnitValue = abs(this.units[0].unit.value)\n let bestPrefix = this.units[0].prefix\n if (absValue === 0) {\n return bestPrefix\n }\n const power = this.units[0].power\n let bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2\n if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix // Allow the original prefix\n bestDiff = Math.abs(bestDiff)\n const prefixes = this.units[0].unit.prefixes\n for (const p in prefixes) {\n if (hasOwnProperty(prefixes, p)) {\n const prefix = prefixes[p]\n if (prefix.scientific) {\n const diff = Math.abs(\n Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2)\n\n if (diff < bestDiff ||\n (diff === bestDiff && prefix.name.length < bestPrefix.name.length)) {\n // choose the prefix with the smallest diff, or if equal, choose the one\n // with the shortest name (can happen with SHORTLONG for example)\n bestPrefix = prefix\n bestDiff = diff\n }\n }\n }\n }\n\n return bestPrefix\n }\n\n /**\n * Returns an array of units whose sum is equal to this unit\n * @memberof Unit\n * @param {Array} [parts] An array of strings or valueless units.\n *\n * Example:\n *\n * const u = new Unit(1, 'm')\n * u.splitUnit(['feet', 'inch'])\n * [ 3 feet, 3.3700787401575 inch ]\n *\n * @return {Array} An array of units.\n */\n Unit.prototype.splitUnit = function (parts) {\n let x = this.clone()\n const ret = []\n for (let i = 0; i < parts.length; i++) {\n // Convert x to the requested unit\n x = x.to(parts[i])\n if (i === parts.length - 1) break\n\n // Get the numeric value of this unit\n const xNumeric = x.toNumeric()\n\n // Check to see if xNumeric is nearly equal to an integer,\n // since fix can incorrectly round down if there is round-off error\n const xRounded = round(xNumeric)\n let xFixed\n const isNearlyEqual = equal(xRounded, xNumeric)\n if (isNearlyEqual) {\n xFixed = xRounded\n } else {\n xFixed = fix(x.toNumeric())\n }\n\n const y = new Unit(xFixed, parts[i].toString())\n ret.push(y)\n x = subtractScalar(x, y)\n }\n\n // This little bit fixes a bug where the remainder should be 0 but is a little bit off.\n // But instead of comparing x, the remainder, with zero--we will compare the sum of\n // all the parts so far with the original value. If they are nearly equal,\n // we set the remainder to 0.\n let testSum = 0\n for (let i = 0; i < ret.length; i++) {\n testSum = addScalar(testSum, ret[i].value)\n }\n if (equal(testSum, this.value)) {\n x.value = 0\n }\n\n ret.push(x)\n\n return ret\n }\n\n const PREFIXES = {\n NONE: {\n '': { name: '', value: 1, scientific: true }\n },\n SHORT: {\n '': { name: '', value: 1, scientific: true },\n\n da: { name: 'da', value: 1e1, scientific: false },\n h: { name: 'h', value: 1e2, scientific: false },\n k: { name: 'k', value: 1e3, scientific: true },\n M: { name: 'M', value: 1e6, scientific: true },\n G: { name: 'G', value: 1e9, scientific: true },\n T: { name: 'T', value: 1e12, scientific: true },\n P: { name: 'P', value: 1e15, scientific: true },\n E: { name: 'E', value: 1e18, scientific: true },\n Z: { name: 'Z', value: 1e21, scientific: true },\n Y: { name: 'Y', value: 1e24, scientific: true },\n R: { name: 'R', value: 1e27, scientific: true },\n Q: { name: 'Q', value: 1e30, scientific: true },\n\n d: { name: 'd', value: 1e-1, scientific: false },\n c: { name: 'c', value: 1e-2, scientific: false },\n m: { name: 'm', value: 1e-3, scientific: true },\n u: { name: 'u', value: 1e-6, scientific: true },\n n: { name: 'n', value: 1e-9, scientific: true },\n p: { name: 'p', value: 1e-12, scientific: true },\n f: { name: 'f', value: 1e-15, scientific: true },\n a: { name: 'a', value: 1e-18, scientific: true },\n z: { name: 'z', value: 1e-21, scientific: true },\n y: { name: 'y', value: 1e-24, scientific: true },\n r: { name: 'r', value: 1e-27, scientific: true },\n q: { name: 'q', value: 1e-30, scientific: true }\n },\n LONG: {\n '': { name: '', value: 1, scientific: true },\n\n deca: { name: 'deca', value: 1e1, scientific: false },\n hecto: { name: 'hecto', value: 1e2, scientific: false },\n kilo: { name: 'kilo', value: 1e3, scientific: true },\n mega: { name: 'mega', value: 1e6, scientific: true },\n giga: { name: 'giga', value: 1e9, scientific: true },\n tera: { name: 'tera', value: 1e12, scientific: true },\n peta: { name: 'peta', value: 1e15, scientific: true },\n exa: { name: 'exa', value: 1e18, scientific: true },\n zetta: { name: 'zetta', value: 1e21, scientific: true },\n yotta: { name: 'yotta', value: 1e24, scientific: true },\n ronna: { name: 'ronna', value: 1e27, scientific: true },\n quetta: { name: 'quetta', value: 1e30, scientific: true },\n\n deci: { name: 'deci', value: 1e-1, scientific: false },\n centi: { name: 'centi', value: 1e-2, scientific: false },\n milli: { name: 'milli', value: 1e-3, scientific: true },\n micro: { name: 'micro', value: 1e-6, scientific: true },\n nano: { name: 'nano', value: 1e-9, scientific: true },\n pico: { name: 'pico', value: 1e-12, scientific: true },\n femto: { name: 'femto', value: 1e-15, scientific: true },\n atto: { name: 'atto', value: 1e-18, scientific: true },\n zepto: { name: 'zepto', value: 1e-21, scientific: true },\n yocto: { name: 'yocto', value: 1e-24, scientific: true },\n ronto: { name: 'ronto', value: 1e-27, scientific: true },\n quecto: { name: 'quecto', value: 1e-30, scientific: true }\n },\n SQUARED: {\n '': { name: '', value: 1, scientific: true },\n\n da: { name: 'da', value: 1e2, scientific: false },\n h: { name: 'h', value: 1e4, scientific: false },\n k: { name: 'k', value: 1e6, scientific: true },\n M: { name: 'M', value: 1e12, scientific: true },\n G: { name: 'G', value: 1e18, scientific: true },\n T: { name: 'T', value: 1e24, scientific: true },\n P: { name: 'P', value: 1e30, scientific: true },\n E: { name: 'E', value: 1e36, scientific: true },\n Z: { name: 'Z', value: 1e42, scientific: true },\n Y: { name: 'Y', value: 1e48, scientific: true },\n R: { name: 'R', value: 1e54, scientific: true },\n Q: { name: 'Q', value: 1e60, scientific: true },\n\n d: { name: 'd', value: 1e-2, scientific: false },\n c: { name: 'c', value: 1e-4, scientific: false },\n m: { name: 'm', value: 1e-6, scientific: true },\n u: { name: 'u', value: 1e-12, scientific: true },\n n: { name: 'n', value: 1e-18, scientific: true },\n p: { name: 'p', value: 1e-24, scientific: true },\n f: { name: 'f', value: 1e-30, scientific: true },\n a: { name: 'a', value: 1e-36, scientific: true },\n z: { name: 'z', value: 1e-42, scientific: true },\n y: { name: 'y', value: 1e-48, scientific: true },\n r: { name: 'r', value: 1e-54, scientific: true },\n q: { name: 'q', value: 1e-60, scientific: true }\n },\n CUBIC: {\n '': { name: '', value: 1, scientific: true },\n\n da: { name: 'da', value: 1e3, scientific: false },\n h: { name: 'h', value: 1e6, scientific: false },\n k: { name: 'k', value: 1e9, scientific: true },\n M: { name: 'M', value: 1e18, scientific: true },\n G: { name: 'G', value: 1e27, scientific: true },\n T: { name: 'T', value: 1e36, scientific: true },\n P: { name: 'P', value: 1e45, scientific: true },\n E: { name: 'E', value: 1e54, scientific: true },\n Z: { name: 'Z', value: 1e63, scientific: true },\n Y: { name: 'Y', value: 1e72, scientific: true },\n R: { name: 'R', value: 1e81, scientific: true },\n Q: { name: 'Q', value: 1e90, scientific: true },\n\n d: { name: 'd', value: 1e-3, scientific: false },\n c: { name: 'c', value: 1e-6, scientific: false },\n m: { name: 'm', value: 1e-9, scientific: true },\n u: { name: 'u', value: 1e-18, scientific: true },\n n: { name: 'n', value: 1e-27, scientific: true },\n p: { name: 'p', value: 1e-36, scientific: true },\n f: { name: 'f', value: 1e-45, scientific: true },\n a: { name: 'a', value: 1e-54, scientific: true },\n z: { name: 'z', value: 1e-63, scientific: true },\n y: { name: 'y', value: 1e-72, scientific: true },\n r: { name: 'r', value: 1e-81, scientific: true },\n q: { name: 'q', value: 1e-90, scientific: true }\n },\n BINARY_SHORT_SI: {\n '': { name: '', value: 1, scientific: true },\n k: { name: 'k', value: 1e3, scientific: true },\n M: { name: 'M', value: 1e6, scientific: true },\n G: { name: 'G', value: 1e9, scientific: true },\n T: { name: 'T', value: 1e12, scientific: true },\n P: { name: 'P', value: 1e15, scientific: true },\n E: { name: 'E', value: 1e18, scientific: true },\n Z: { name: 'Z', value: 1e21, scientific: true },\n Y: { name: 'Y', value: 1e24, scientific: true }\n },\n BINARY_SHORT_IEC: {\n '': { name: '', value: 1, scientific: true },\n Ki: { name: 'Ki', value: 1024, scientific: true },\n Mi: { name: 'Mi', value: Math.pow(1024, 2), scientific: true },\n Gi: { name: 'Gi', value: Math.pow(1024, 3), scientific: true },\n Ti: { name: 'Ti', value: Math.pow(1024, 4), scientific: true },\n Pi: { name: 'Pi', value: Math.pow(1024, 5), scientific: true },\n Ei: { name: 'Ei', value: Math.pow(1024, 6), scientific: true },\n Zi: { name: 'Zi', value: Math.pow(1024, 7), scientific: true },\n Yi: { name: 'Yi', value: Math.pow(1024, 8), scientific: true }\n },\n BINARY_LONG_SI: {\n '': { name: '', value: 1, scientific: true },\n kilo: { name: 'kilo', value: 1e3, scientific: true },\n mega: { name: 'mega', value: 1e6, scientific: true },\n giga: { name: 'giga', value: 1e9, scientific: true },\n tera: { name: 'tera', value: 1e12, scientific: true },\n peta: { name: 'peta', value: 1e15, scientific: true },\n exa: { name: 'exa', value: 1e18, scientific: true },\n zetta: { name: 'zetta', value: 1e21, scientific: true },\n yotta: { name: 'yotta', value: 1e24, scientific: true }\n },\n BINARY_LONG_IEC: {\n '': { name: '', value: 1, scientific: true },\n kibi: { name: 'kibi', value: 1024, scientific: true },\n mebi: { name: 'mebi', value: Math.pow(1024, 2), scientific: true },\n gibi: { name: 'gibi', value: Math.pow(1024, 3), scientific: true },\n tebi: { name: 'tebi', value: Math.pow(1024, 4), scientific: true },\n pebi: { name: 'pebi', value: Math.pow(1024, 5), scientific: true },\n exi: { name: 'exi', value: Math.pow(1024, 6), scientific: true },\n zebi: { name: 'zebi', value: Math.pow(1024, 7), scientific: true },\n yobi: { name: 'yobi', value: Math.pow(1024, 8), scientific: true }\n },\n BTU: {\n '': { name: '', value: 1, scientific: true },\n MM: { name: 'MM', value: 1e6, scientific: true }\n }\n }\n\n PREFIXES.SHORTLONG = Object.assign({}, PREFIXES.SHORT, PREFIXES.LONG)\n PREFIXES.BINARY_SHORT = Object.assign({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC)\n PREFIXES.BINARY_LONG = Object.assign({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC)\n\n /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning:\n * Index Dimension\n * ----- ---------\n * 0 Length\n * 1 Mass\n * 2 Time\n * 3 Current\n * 4 Temperature\n * 5 Luminous intensity\n * 6 Amount of substance\n * 7 Angle\n * 8 Bit (digital)\n * For example, the unit \"298.15 K\" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit \"1 cal / (gm °C)\" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0].\n *\n */\n\n const BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT']\n\n const BASE_UNITS = {\n NONE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n MASS: {\n dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n LENGTH: {\n dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0]\n },\n TIME: {\n dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0]\n },\n CURRENT: {\n dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0]\n },\n TEMPERATURE: {\n dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0]\n },\n LUMINOUS_INTENSITY: {\n dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0]\n },\n AMOUNT_OF_SUBSTANCE: {\n dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0]\n },\n\n FORCE: {\n dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0]\n },\n SURFACE: {\n dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0]\n },\n VOLUME: {\n dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0]\n },\n ENERGY: {\n dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0]\n },\n POWER: {\n dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0]\n },\n PRESSURE: {\n dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0]\n },\n\n ELECTRIC_CHARGE: {\n dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CAPACITANCE: {\n dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_POTENTIAL: {\n dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_RESISTANCE: {\n dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_INDUCTANCE: {\n dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CONDUCTANCE: {\n dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX: {\n dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX_DENSITY: {\n dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0]\n },\n\n FREQUENCY: {\n dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0]\n },\n ANGLE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0]\n },\n BIT: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1]\n }\n }\n\n for (const key in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, key)) {\n BASE_UNITS[key].key = key\n }\n }\n\n const BASE_UNIT_NONE = {}\n\n const UNIT_NONE = { name: '', base: BASE_UNIT_NONE, value: 1, offset: 0, dimensions: BASE_DIMENSIONS.map(x => 0) }\n\n const UNITS = {\n // length\n meter: {\n name: 'meter',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n inch: {\n name: 'inch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n foot: {\n name: 'foot',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yard: {\n name: 'yard',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mile: {\n name: 'mile',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n link: {\n name: 'link',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rod: {\n name: 'rod',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.0292,\n offset: 0\n },\n chain: {\n name: 'chain',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n angstrom: {\n name: 'angstrom',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1e-10,\n offset: 0\n },\n\n m: {\n name: 'm',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n in: {\n name: 'in',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n ft: {\n name: 'ft',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yd: {\n name: 'yd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mi: {\n name: 'mi',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n li: {\n name: 'li',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rd: {\n name: 'rd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.029210,\n offset: 0\n },\n ch: {\n name: 'ch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n mil: {\n name: 'mil',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0000254,\n offset: 0\n }, // 1/1000 inch\n\n // Surface\n m2: {\n name: 'm2',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.SQUARED,\n value: 1,\n offset: 0\n },\n sqin: {\n name: 'sqin',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.00064516,\n offset: 0\n }, // 645.16 mm2\n sqft: {\n name: 'sqft',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.09290304,\n offset: 0\n }, // 0.09290304 m2\n sqyd: {\n name: 'sqyd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.83612736,\n offset: 0\n }, // 0.83612736 m2\n sqmi: {\n name: 'sqmi',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 2589988.110336,\n offset: 0\n }, // 2.589988110336 km2\n sqrd: {\n name: 'sqrd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 25.29295,\n offset: 0\n }, // 25.29295 m2\n sqch: {\n name: 'sqch',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 404.6873,\n offset: 0\n }, // 404.6873 m2\n sqmil: {\n name: 'sqmil',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 6.4516e-10,\n offset: 0\n }, // 6.4516 * 10^-10 m2\n acre: {\n name: 'acre',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 4046.86,\n offset: 0\n }, // 4046.86 m2\n hectare: {\n name: 'hectare',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 10000,\n offset: 0\n }, // 10000 m2\n\n // Volume\n m3: {\n name: 'm3',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.CUBIC,\n value: 1,\n offset: 0\n },\n L: {\n name: 'L',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n }, // litre\n l: {\n name: 'l',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n }, // litre\n litre: {\n name: 'litre',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n cuin: {\n name: 'cuin',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1.6387064e-5,\n offset: 0\n }, // 1.6387064e-5 m3\n cuft: {\n name: 'cuft',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.028316846592,\n offset: 0\n }, // 28.316 846 592 L\n cuyd: {\n name: 'cuyd',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.764554857984,\n offset: 0\n }, // 764.554 857 984 L\n teaspoon: {\n name: 'teaspoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000005,\n offset: 0\n }, // 5 mL\n tablespoon: {\n name: 'tablespoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000015,\n offset: 0\n }, // 15 mL\n // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup\n drop: {\n name: 'drop',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n }, // 0.05 mL = 5e-8 m3\n gtt: {\n name: 'gtt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n }, // 0.05 mL = 5e-8 m3\n\n // Liquid volume\n minim: {\n name: 'minim',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000000061611519921875,\n offset: 0\n }, // 1/61440 gallons\n fluiddram: {\n name: 'fluiddram',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911953125,\n offset: 0\n }, // 1/1024 gallons\n fluidounce: {\n name: 'fluidounce',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000295735295625,\n offset: 0\n }, // 1/128 gallons\n gill: {\n name: 'gill',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00011829411825,\n offset: 0\n }, // 1/32 gallons\n cc: {\n name: 'cc',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1e-6,\n offset: 0\n }, // 1e-6 L\n cup: {\n name: 'cup',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882365,\n offset: 0\n }, // 1/16 gallons\n pint: {\n name: 'pint',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000473176473,\n offset: 0\n }, // 1/8 gallons\n quart: {\n name: 'quart',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000946352946,\n offset: 0\n }, // 1/4 gallons\n gallon: {\n name: 'gallon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785411784,\n offset: 0\n }, // 3.785411784 L\n beerbarrel: {\n name: 'beerbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.117347765304,\n offset: 0\n }, // 31 gallons\n oilbarrel: {\n name: 'oilbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.158987294928,\n offset: 0\n }, // 42 gallons\n hogshead: {\n name: 'hogshead',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.238480942392,\n offset: 0\n }, // 63 gallons\n\n // Mass\n g: {\n name: 'g',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n gram: {\n name: 'gram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n\n ton: {\n name: 'ton',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 907.18474,\n offset: 0\n },\n t: {\n name: 't',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 1000,\n offset: 0\n },\n tonne: {\n name: 'tonne',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 1000,\n offset: 0\n },\n\n grain: {\n name: 'grain',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dram: {\n name: 'dram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n ounce: {\n name: 'ounce',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n poundmass: {\n name: 'poundmass',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n hundredweight: {\n name: 'hundredweight',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n stick: {\n name: 'stick',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 115e-3,\n offset: 0\n },\n stone: {\n name: 'stone',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 6.35029318,\n offset: 0\n },\n\n gr: {\n name: 'gr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dr: {\n name: 'dr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n oz: {\n name: 'oz',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n lbm: {\n name: 'lbm',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n cwt: {\n name: 'cwt',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n\n // Time\n s: {\n name: 's',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n min: {\n name: 'min',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n h: {\n name: 'h',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n second: {\n name: 'second',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n sec: {\n name: 'sec',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n minute: {\n name: 'minute',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n hour: {\n name: 'hour',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n day: {\n name: 'day',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 86400,\n offset: 0\n },\n week: {\n name: 'week',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 7 * 86400,\n offset: 0\n },\n month: {\n name: 'month',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 2629800, // 1/12th of Julian year\n offset: 0\n },\n year: {\n name: 'year',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600, // Julian year\n offset: 0\n },\n decade: {\n name: 'decade',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 315576000, // Julian decade\n offset: 0\n },\n century: {\n name: 'century',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3155760000, // Julian century\n offset: 0\n },\n millennium: {\n name: 'millennium',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600000, // Julian millennium\n offset: 0\n },\n\n // Frequency\n hertz: {\n name: 'Hertz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n Hz: {\n name: 'Hz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n\n // Angle\n rad: {\n name: 'rad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n radian: {\n name: 'radian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888\n deg: {\n name: 'deg',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n degree: {\n name: 'degree',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399\n grad: {\n name: 'grad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n gradian: {\n name: 'gradian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793\n cycle: {\n name: 'cycle',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795\n arcsec: {\n name: 'arcsec',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477\n arcmin: {\n name: 'arcmin',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null, // will be filled in by calculateAngleValues()\n offset: 0\n },\n\n // Electric current\n A: {\n name: 'A',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n ampere: {\n name: 'ampere',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n\n // Temperature\n // K(C) = °C + 273.15\n // K(F) = (°F + 459.67) * (5 / 9)\n // K(R) = °R * (5 / 9)\n K: {\n name: 'K',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n degC: {\n name: 'degC',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 273.15\n },\n degF: {\n name: 'degF',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new Fraction(5, 9),\n offset: 459.67\n },\n degR: {\n name: 'degR',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new Fraction(5, 9),\n offset: 0\n },\n kelvin: {\n name: 'kelvin',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n celsius: {\n name: 'celsius',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 273.15\n },\n fahrenheit: {\n name: 'fahrenheit',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new Fraction(5, 9),\n offset: 459.67\n },\n rankine: {\n name: 'rankine',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new Fraction(5, 9),\n offset: 0\n },\n\n // amount of substance\n mol: {\n name: 'mol',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n mole: {\n name: 'mole',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n\n // luminous intensity\n cd: {\n name: 'cd',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n candela: {\n name: 'candela',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // TODO: units STERADIAN\n // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n\n // Force\n N: {\n name: 'N',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n newton: {\n name: 'newton',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n dyn: {\n name: 'dyn',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 0.00001,\n offset: 0\n },\n dyne: {\n name: 'dyne',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 0.00001,\n offset: 0\n },\n lbf: {\n name: 'lbf',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n poundforce: {\n name: 'poundforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n kip: {\n name: 'kip',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 4448.2216,\n offset: 0\n },\n kilogramforce: {\n name: 'kilogramforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n\n // Energy\n J: {\n name: 'J',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n joule: {\n name: 'joule',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n erg: {\n name: 'erg',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORTLONG, // Both kiloerg and kerg are acceptable\n value: 1e-7,\n offset: 0\n },\n Wh: {\n name: 'Wh',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 3600,\n offset: 0\n },\n BTU: {\n name: 'BTU',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.BTU,\n value: 1055.05585262,\n offset: 0\n },\n eV: {\n name: 'eV',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1.602176565e-19,\n offset: 0\n },\n electronvolt: {\n name: 'electronvolt',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1.602176565e-19,\n offset: 0\n },\n\n // Power\n W: {\n name: 'W',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n watt: {\n name: 'watt',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n hp: {\n name: 'hp',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.NONE,\n value: 745.6998715386,\n offset: 0\n },\n\n // Electrical power units\n VAR: {\n name: 'VAR',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: Complex.I,\n offset: 0\n },\n\n VA: {\n name: 'VA',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n\n // Pressure\n Pa: {\n name: 'Pa',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n psi: {\n name: 'psi',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 6894.75729276459,\n offset: 0\n },\n atm: {\n name: 'atm',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 101325,\n offset: 0\n },\n bar: {\n name: 'bar',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORTLONG,\n value: 100000,\n offset: 0\n },\n torr: {\n name: 'torr',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmHg: {\n name: 'mmHg',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmH2O: {\n name: 'mmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n cmH2O: {\n name: 'cmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 98.0665,\n offset: 0\n },\n\n // Electric charge\n coulomb: {\n name: 'coulomb',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n C: {\n name: 'C',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric capacitance\n farad: {\n name: 'farad',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n F: {\n name: 'F',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric potential\n volt: {\n name: 'volt',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n V: {\n name: 'V',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric resistance\n ohm: {\n name: 'ohm',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORTLONG, // Both Mohm and megaohm are acceptable\n value: 1,\n offset: 0\n },\n /*\n * Unicode breaks in browsers if charset is not specified\n Ω: {\n name: 'Ω',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n */\n // Electric inductance\n henry: {\n name: 'henry',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n H: {\n name: 'H',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric conductance\n siemens: {\n name: 'siemens',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n S: {\n name: 'S',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux\n weber: {\n name: 'weber',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n Wb: {\n name: 'Wb',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux density\n tesla: {\n name: 'tesla',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n T: {\n name: 'T',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n\n // Binary\n b: {\n name: 'b',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 1,\n offset: 0\n },\n bits: {\n name: 'bits',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 1,\n offset: 0\n },\n B: {\n name: 'B',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 8,\n offset: 0\n },\n bytes: {\n name: 'bytes',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 8,\n offset: 0\n }\n }\n\n // aliases (formerly plurals)\n // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units\n const ALIASES = {\n meters: 'meter',\n inches: 'inch',\n feet: 'foot',\n yards: 'yard',\n miles: 'mile',\n links: 'link',\n rods: 'rod',\n chains: 'chain',\n angstroms: 'angstrom',\n\n lt: 'l',\n litres: 'litre',\n liter: 'litre',\n liters: 'litre',\n teaspoons: 'teaspoon',\n tablespoons: 'tablespoon',\n minims: 'minim',\n fldr: 'fluiddram',\n fluiddrams: 'fluiddram',\n floz: 'fluidounce',\n fluidounces: 'fluidounce',\n gi: 'gill',\n gills: 'gill',\n cp: 'cup',\n cups: 'cup',\n pt: 'pint',\n pints: 'pint',\n qt: 'quart',\n quarts: 'quart',\n gal: 'gallon',\n gallons: 'gallon',\n bbl: 'beerbarrel',\n beerbarrels: 'beerbarrel',\n obl: 'oilbarrel',\n oilbarrels: 'oilbarrel',\n hogsheads: 'hogshead',\n gtts: 'gtt',\n\n grams: 'gram',\n tons: 'ton',\n tonnes: 'tonne',\n grains: 'grain',\n drams: 'dram',\n ounces: 'ounce',\n poundmasses: 'poundmass',\n hundredweights: 'hundredweight',\n sticks: 'stick',\n lb: 'lbm',\n lbs: 'lbm',\n\n kips: 'kip',\n kgf: 'kilogramforce',\n\n acres: 'acre',\n hectares: 'hectare',\n sqfeet: 'sqft',\n sqyard: 'sqyd',\n sqmile: 'sqmi',\n sqmiles: 'sqmi',\n\n mmhg: 'mmHg',\n mmh2o: 'mmH2O',\n cmh2o: 'cmH2O',\n\n seconds: 'second',\n secs: 'second',\n minutes: 'minute',\n mins: 'minute',\n hours: 'hour',\n hr: 'hour',\n hrs: 'hour',\n days: 'day',\n weeks: 'week',\n months: 'month',\n years: 'year',\n decades: 'decade',\n centuries: 'century',\n millennia: 'millennium',\n\n hertz: 'hertz',\n\n radians: 'radian',\n degrees: 'degree',\n gradians: 'gradian',\n cycles: 'cycle',\n arcsecond: 'arcsec',\n arcseconds: 'arcsec',\n arcminute: 'arcmin',\n arcminutes: 'arcmin',\n\n BTUs: 'BTU',\n watts: 'watt',\n joules: 'joule',\n\n amperes: 'ampere',\n amps: 'ampere',\n amp: 'ampere',\n coulombs: 'coulomb',\n volts: 'volt',\n ohms: 'ohm',\n farads: 'farad',\n webers: 'weber',\n teslas: 'tesla',\n electronvolts: 'electronvolt',\n moles: 'mole',\n\n bit: 'bits',\n byte: 'bytes'\n }\n\n /**\n * Calculate the values for the angle units.\n * Value is calculated as number or BigNumber depending on the configuration\n * @param {{number: 'number' | 'BigNumber'}} config\n */\n function calculateAngleValues (config) {\n if (config.number === 'BigNumber') {\n const pi = createPi(BigNumber)\n UNITS.rad.value = new BigNumber(1)\n UNITS.deg.value = pi.div(180) // 2 * pi / 360\n UNITS.grad.value = pi.div(200) // 2 * pi / 400\n UNITS.cycle.value = pi.times(2) // 2 * pi\n UNITS.arcsec.value = pi.div(648000) // 2 * pi / 360 / 3600\n UNITS.arcmin.value = pi.div(10800) // 2 * pi / 360 / 60\n } else { // number\n UNITS.rad.value = 1\n UNITS.deg.value = Math.PI / 180 // 2 * pi / 360\n UNITS.grad.value = Math.PI / 200 // 2 * pi / 400\n UNITS.cycle.value = Math.PI * 2 // 2 * pi\n UNITS.arcsec.value = Math.PI / 648000 // 2 * pi / 360 / 3600\n UNITS.arcmin.value = Math.PI / 10800 // 2 * pi / 360 / 60\n }\n\n // copy to the full names of the angles\n UNITS.radian.value = UNITS.rad.value\n UNITS.degree.value = UNITS.deg.value\n UNITS.gradian.value = UNITS.grad.value\n }\n\n // apply the angle values now\n calculateAngleValues(config)\n\n if (on) {\n // recalculate the values on change of configuration\n on('config', function (curr, prev) {\n if (curr.number !== prev.number) {\n calculateAngleValues(curr)\n }\n })\n }\n\n /**\n * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system.\n * A user perhaps could issue a command to select a preferred unit system, or use the default (see below).\n * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies.\n */\n const UNIT_SYSTEMS = {\n si: {\n // Base units\n NONE: { unit: UNIT_NONE, prefix: PREFIXES.NONE[''] },\n LENGTH: { unit: UNITS.m, prefix: PREFIXES.SHORT[''] },\n MASS: { unit: UNITS.g, prefix: PREFIXES.SHORT.k },\n TIME: { unit: UNITS.s, prefix: PREFIXES.SHORT[''] },\n CURRENT: { unit: UNITS.A, prefix: PREFIXES.SHORT[''] },\n TEMPERATURE: { unit: UNITS.K, prefix: PREFIXES.SHORT[''] },\n LUMINOUS_INTENSITY: { unit: UNITS.cd, prefix: PREFIXES.SHORT[''] },\n AMOUNT_OF_SUBSTANCE: { unit: UNITS.mol, prefix: PREFIXES.SHORT[''] },\n ANGLE: { unit: UNITS.rad, prefix: PREFIXES.SHORT[''] },\n BIT: { unit: UNITS.bits, prefix: PREFIXES.SHORT[''] },\n\n // Derived units\n FORCE: { unit: UNITS.N, prefix: PREFIXES.SHORT[''] },\n ENERGY: { unit: UNITS.J, prefix: PREFIXES.SHORT[''] },\n POWER: { unit: UNITS.W, prefix: PREFIXES.SHORT[''] },\n PRESSURE: { unit: UNITS.Pa, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_CHARGE: { unit: UNITS.C, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_CAPACITANCE: { unit: UNITS.F, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_POTENTIAL: { unit: UNITS.V, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_RESISTANCE: { unit: UNITS.ohm, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_INDUCTANCE: { unit: UNITS.H, prefix: PREFIXES.SHORT[''] },\n ELECTRIC_CONDUCTANCE: { unit: UNITS.S, prefix: PREFIXES.SHORT[''] },\n MAGNETIC_FLUX: { unit: UNITS.Wb, prefix: PREFIXES.SHORT[''] },\n MAGNETIC_FLUX_DENSITY: { unit: UNITS.T, prefix: PREFIXES.SHORT[''] },\n FREQUENCY: { unit: UNITS.Hz, prefix: PREFIXES.SHORT[''] }\n }\n }\n\n // Clone to create the other unit systems\n UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si))\n UNIT_SYSTEMS.cgs.LENGTH = { unit: UNITS.m, prefix: PREFIXES.SHORT.c }\n UNIT_SYSTEMS.cgs.MASS = { unit: UNITS.g, prefix: PREFIXES.SHORT[''] }\n UNIT_SYSTEMS.cgs.FORCE = { unit: UNITS.dyn, prefix: PREFIXES.SHORT[''] }\n UNIT_SYSTEMS.cgs.ENERGY = { unit: UNITS.erg, prefix: PREFIXES.NONE[''] }\n // there are wholly 4 unique cgs systems for electricity and magnetism,\n // so let's not worry about it unless somebody complains\n\n UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si))\n UNIT_SYSTEMS.us.LENGTH = { unit: UNITS.ft, prefix: PREFIXES.NONE[''] }\n UNIT_SYSTEMS.us.MASS = { unit: UNITS.lbm, prefix: PREFIXES.NONE[''] }\n UNIT_SYSTEMS.us.TEMPERATURE = { unit: UNITS.degF, prefix: PREFIXES.NONE[''] }\n UNIT_SYSTEMS.us.FORCE = { unit: UNITS.lbf, prefix: PREFIXES.NONE[''] }\n UNIT_SYSTEMS.us.ENERGY = { unit: UNITS.BTU, prefix: PREFIXES.BTU[''] }\n UNIT_SYSTEMS.us.POWER = { unit: UNITS.hp, prefix: PREFIXES.NONE[''] }\n UNIT_SYSTEMS.us.PRESSURE = { unit: UNITS.psi, prefix: PREFIXES.NONE[''] }\n\n // Add additional unit systems here.\n\n // Choose a unit system to seed the auto unit system.\n UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si))\n\n // Set the current unit system\n let currentUnitSystem = UNIT_SYSTEMS.auto\n\n /**\n * Set a unit system for formatting derived units.\n * @memberof Unit\n * @param {string} [name] The name of the unit system.\n */\n Unit.setUnitSystem = function (name) {\n if (hasOwnProperty(UNIT_SYSTEMS, name)) {\n currentUnitSystem = UNIT_SYSTEMS[name]\n } else {\n throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', '))\n }\n }\n\n /**\n * Return the current unit system.\n * @memberof Unit\n * @return {string} The current unit system.\n */\n Unit.getUnitSystem = function () {\n for (const key in UNIT_SYSTEMS) {\n if (hasOwnProperty(UNIT_SYSTEMS, key)) {\n if (UNIT_SYSTEMS[key] === currentUnitSystem) {\n return key\n }\n }\n }\n }\n\n /**\n * Converters to convert from number to an other numeric type like BigNumber\n * or Fraction\n */\n Unit.typeConverters = {\n BigNumber: function (x) {\n if (x?.isFraction) return new BigNumber(x.n).div(x.d).times(x.s)\n return new BigNumber(x + '') // stringify to prevent constructor error\n },\n\n Fraction: function (x) {\n return new Fraction(x)\n },\n\n Complex: function (x) {\n return x\n },\n\n number: function (x) {\n if (x?.isFraction) return number(x)\n return x\n }\n }\n\n /**\n * Retrieve the right converter function corresponding with this unit's\n * value\n *\n * @memberof Unit\n * @return {Function}\n */\n Unit.prototype._numberConverter = function () {\n const convert = Unit.typeConverters[this.valueType()]\n if (convert) {\n return convert\n }\n throw new TypeError('Unsupported Unit value type \"' + this.valueType() + '\"')\n }\n\n /**\n * Retrieve the right convertor function corresponding with the type\n * of provided exampleValue.\n *\n * @param {string} type A string 'number', 'BigNumber', or 'Fraction'\n * In case of an unknown type,\n * @return {Function}\n */\n Unit._getNumberConverter = function (type) {\n if (!Unit.typeConverters[type]) {\n throw new TypeError('Unsupported type \"' + type + '\"')\n }\n\n return Unit.typeConverters[type]\n }\n\n // Add dimensions to each built-in unit\n for (const key in UNITS) {\n if (hasOwnProperty(UNITS, key)) {\n const unit = UNITS[key]\n unit.dimensions = unit.base.dimensions\n }\n }\n\n // Create aliases\n for (const name in ALIASES) {\n if (hasOwnProperty(ALIASES, name)) {\n const unit = UNITS[ALIASES[name]]\n const alias = {}\n for (const key in unit) {\n if (hasOwnProperty(unit, key)) {\n alias[key] = unit[key]\n }\n }\n alias.name = name\n UNITS[name] = alias\n }\n }\n\n /**\n * Checks if a character is a valid latin letter (upper or lower case).\n * Note that this function can be overridden, for example to allow support of other alphabets.\n * @memberof Unit\n * @param {string} c Tested character\n * @return {boolean} true if the character is a latin letter\n */\n Unit.isValidAlpha = function isValidAlpha (c) {\n return /^[a-zA-Z]$/.test(c)\n }\n\n function assertUnitNameIsValid (name) {\n for (let i = 0; i < name.length; i++) {\n c = name.charAt(i)\n\n if (i === 0 && !Unit.isValidAlpha(c)) { throw new Error('Invalid unit name (must begin with alpha character): \"' + name + '\"') }\n\n if (i > 0 && !(Unit.isValidAlpha(c) ||\n isDigit(c))) { throw new Error('Invalid unit name (only alphanumeric characters are allowed): \"' + name + '\"') }\n }\n }\n\n /**\n * Wrapper around createUnitSingle.\n * Example:\n * createUnit( {\n * foo: {\n * prefixes: 'long',\n * baseName: 'essence-of-foo'\n * },\n * bar: '40 foo',\n * baz: {\n * definition: '1 bar/hour',\n * prefixes: 'long'\n * }\n * },\n * {\n * override: true\n * })\n * @memberof Unit\n * @param {object} obj Object map. Each key becomes a unit which is defined by its value.\n * @param {object} options\n * @return {Unit} the last created unit\n */\n Unit.createUnit = function (obj, options) {\n if (typeof (obj) !== 'object') {\n throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\")\n }\n\n // Remove all units and aliases we are overriding\n if (options && options.override) {\n for (const key in obj) {\n if (hasOwnProperty(obj, key)) {\n Unit.deleteUnit(key)\n }\n if (obj[key].aliases) {\n for (let i = 0; i < obj[key].aliases.length; i++) {\n Unit.deleteUnit(obj[key].aliases[i])\n }\n }\n }\n }\n\n // TODO: traverse multiple times until all units have been added\n let lastUnit\n for (const key in obj) {\n if (hasOwnProperty(obj, key)) {\n lastUnit = Unit.createUnitSingle(key, obj[key])\n }\n }\n return lastUnit\n }\n\n /**\n * Create a user-defined unit and register it with the Unit type.\n * Example:\n * createUnitSingle('knot', '0.514444444 m/s')\n *\n * @memberof Unit\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string | Unit | object} definition Definition of the unit in terms\n * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string,\n * or an Object. If an Object, may have the following properties:\n * - definition {string | Unit} The definition of this unit.\n * - prefixes {string} \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\".\n * The default is \"none\".\n * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts']\n * - offset {Numeric} An offset to apply when converting from the unit. For\n * example, the offset for celsius is 273.15 and the offset for farhenheit\n * is 459.67. Default is 0.\n * - baseName {string} If the unit's dimension does not match that of any other\n * base unit, the name of the newly create base unit. Otherwise, this property\n * has no effect.\n *\n * @return {Unit}\n */\n Unit.createUnitSingle = function (name, obj) {\n if (typeof (obj) === 'undefined' || obj === null) {\n obj = {}\n }\n\n if (typeof (name) !== 'string') {\n throw new TypeError(\"createUnitSingle expects first parameter to be of type 'string'\")\n }\n\n // Check collisions with existing units\n if (hasOwnProperty(UNITS, name)) {\n throw new Error('Cannot create unit \"' + name + '\": a unit with that name already exists')\n }\n\n // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator.\n\n assertUnitNameIsValid(name)\n\n let defUnit = null // The Unit from which the new unit will be created.\n let aliases = []\n let offset = 0\n let definition\n let prefixes\n let baseName\n if (obj && obj.type === 'Unit') {\n defUnit = obj.clone()\n } else if (typeof (obj) === 'string') {\n if (obj !== '') {\n definition = obj\n }\n } else if (typeof (obj) === 'object') {\n definition = obj.definition\n prefixes = obj.prefixes\n offset = obj.offset\n baseName = obj.baseName\n if (obj.aliases) {\n aliases = obj.aliases.valueOf() // aliases could be a Matrix, so convert to Array\n }\n } else {\n throw new TypeError('Cannot create unit \"' + name + '\" from \"' + obj.toString() + '\": expecting \"string\" or \"Unit\" or \"Object\"')\n }\n\n if (aliases) {\n for (let i = 0; i < aliases.length; i++) {\n if (hasOwnProperty(UNITS, aliases[i])) {\n throw new Error('Cannot create alias \"' + aliases[i] + '\": a unit with that name already exists')\n }\n }\n }\n\n if (definition && typeof (definition) === 'string' && !defUnit) {\n try {\n defUnit = Unit.parse(definition, { allowNoUnits: true })\n } catch (ex) {\n ex.message = 'Could not create unit \"' + name + '\" from \"' + definition + '\": ' + ex.message\n throw (ex)\n }\n } else if (definition && definition.type === 'Unit') {\n defUnit = definition.clone()\n }\n\n aliases = aliases || []\n offset = offset || 0\n if (prefixes && prefixes.toUpperCase) { prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE } else { prefixes = PREFIXES.NONE }\n\n // If defUnit is null, it is because the user did not\n // specify a defintion. So create a new base dimension.\n let newUnit = {}\n if (!defUnit) {\n // Add a new base dimension\n baseName = baseName || name + '_STUFF' // foo --> foo_STUFF, or the essence of foo\n if (BASE_DIMENSIONS.indexOf(baseName) >= 0) {\n throw new Error('Cannot create new base unit \"' + name + '\": a base unit with that name already exists (and cannot be overridden)')\n }\n BASE_DIMENSIONS.push(baseName)\n\n // Push 0 onto existing base units\n for (const b in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, b)) {\n BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0\n }\n }\n\n // Add the new base unit\n const newBaseUnit = { dimensions: [] }\n for (let i = 0; i < BASE_DIMENSIONS.length; i++) {\n newBaseUnit.dimensions[i] = 0\n }\n newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1\n newBaseUnit.key = baseName\n BASE_UNITS[baseName] = newBaseUnit\n\n newUnit = {\n name,\n value: 1,\n dimensions: BASE_UNITS[baseName].dimensions.slice(0),\n prefixes,\n offset,\n base: BASE_UNITS[baseName]\n }\n\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n }\n } else {\n newUnit = {\n name,\n value: defUnit.value,\n dimensions: defUnit.dimensions.slice(0),\n prefixes,\n offset\n }\n\n // Create a new base if no matching base exists\n let anyMatch = false\n for (const i in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, i)) {\n let match = true\n for (let j = 0; j < BASE_DIMENSIONS.length; j++) {\n if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[i].dimensions[j] || 0)) > 1e-12) {\n match = false\n break\n }\n }\n if (match) {\n anyMatch = true\n newUnit.base = BASE_UNITS[i]\n break\n }\n }\n }\n if (!anyMatch) {\n baseName = baseName || name + '_STUFF' // foo --> foo_STUFF, or the essence of foo\n // Add the new base unit\n const newBaseUnit = { dimensions: defUnit.dimensions.slice(0) }\n newBaseUnit.key = baseName\n BASE_UNITS[baseName] = newBaseUnit\n\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n }\n\n newUnit.base = BASE_UNITS[baseName]\n }\n }\n\n Unit.UNITS[name] = newUnit\n\n for (let i = 0; i < aliases.length; i++) {\n const aliasName = aliases[i]\n const alias = {}\n for (const key in newUnit) {\n if (hasOwnProperty(newUnit, key)) {\n alias[key] = newUnit[key]\n }\n }\n alias.name = aliasName\n Unit.UNITS[aliasName] = alias\n }\n\n // delete the memoization cache because we created a new unit\n delete _findUnit.cache\n\n return new Unit(null, name)\n }\n\n Unit.deleteUnit = function (name) {\n delete Unit.UNITS[name]\n\n // delete the memoization cache because we deleted a unit\n delete _findUnit.cache\n }\n\n // expose arrays with prefixes, dimensions, units, systems\n Unit.PREFIXES = PREFIXES\n Unit.BASE_DIMENSIONS = BASE_DIMENSIONS\n Unit.BASE_UNITS = BASE_UNITS\n Unit.UNIT_SYSTEMS = UNIT_SYSTEMS\n Unit.UNITS = UNITS\n\n return Unit\n}, { isClass: true })\n","import { factory } from '../../../utils/factory.js'\nimport { deepMap } from '../../../utils/collection.js'\n\nconst name = 'unit'\nconst dependencies = ['typed', 'Unit']\n\n// This function is named createUnitFunction to prevent a naming conflict with createUnit\nexport const createUnitFunction = /* #__PURE__ */ factory(name, dependencies, ({ typed, Unit }) => {\n /**\n * Create a unit. Depending on the passed arguments, the function\n * will create and return a new math.Unit object.\n * When a matrix is provided, all elements will be converted to units.\n *\n * Syntax:\n *\n * math.unit(unit : string)\n * math.unit(value : number, valuelessUnit : Unit)\n * math.unit(value : number, valuelessUnit : string)\n *\n * Examples:\n *\n * const kph = math.unit('km/h') // returns Unit km/h (valueless)\n * const v = math.unit(25, kph) // returns Unit 25 km/h\n * const a = math.unit(5, 'cm') // returns Unit 50 mm\n * const b = math.unit('23 kg') // returns Unit 23 kg\n * a.to('m') // returns Unit 0.05 m\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, string, createUnit\n *\n * @param {* | Array | Matrix} args A number and unit.\n * @return {Unit | Array | Matrix} The created unit\n */\n\n return typed(name, {\n Unit: function (x) {\n return x.clone()\n },\n\n string: function (x) {\n if (Unit.isValuelessUnit(x)) {\n return new Unit(null, x) // a pure unit\n }\n\n return Unit.parse(x, { allowNoUnits: true }) // a unit with value, like '5cm'\n },\n\n 'number | BigNumber | Fraction | Complex, string | Unit': function (value, unit) {\n return new Unit(value, unit)\n },\n\n 'number | BigNumber | Fraction': function (value) {\n // dimensionless\n return new Unit(value)\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'sparse'\nconst dependencies = ['typed', 'SparseMatrix']\n\nexport const createSparse = /* #__PURE__ */ factory(name, dependencies, ({ typed, SparseMatrix }) => {\n /**\n * Create a Sparse Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Note that a Sparse Matrix is always 2-dimensional, so for example if\n * you create one from a plain array of _n_ numbers, you get an _n_ by 1\n * Sparse \"column vector\".\n *\n * Syntax:\n *\n * math.sparse() // creates an empty sparse matrix.\n * math.sparse(data) // creates a sparse matrix with initial data.\n * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype.\n *\n * Examples:\n *\n * let m = math.sparse([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n * let v = math.sparse([0, 0, 1])\n * v.size() // Array [3, 1]\n * v.get([2, 0]) // number 1\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, matrix\n *\n * @param {Array | Matrix} [data] A two dimensional array\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function () {\n return new SparseMatrix([])\n },\n\n string: function (datatype) {\n return new SparseMatrix([], datatype)\n },\n\n 'Array | Matrix': function (data) {\n return new SparseMatrix(data)\n },\n\n 'Array | Matrix, string': function (data, datatype) {\n return new SparseMatrix(data, datatype)\n }\n })\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'createUnit'\nconst dependencies = ['typed', 'Unit']\n\nexport const createCreateUnit = /* #__PURE__ */ factory(name, dependencies, ({ typed, Unit }) => {\n /**\n * Create a user-defined unit and register it with the Unit type.\n *\n * Syntax:\n *\n * math.createUnit({\n * baseUnit1: {\n * aliases: [string, ...]\n * prefixes: object\n * },\n * unit2: {\n * definition: string,\n * aliases: [string, ...]\n * prefixes: object,\n * offset: number\n * },\n * unit3: string // Shortcut\n * })\n *\n * // Another shortcut:\n * math.createUnit(string, unit : string, [object])\n *\n * Examples:\n *\n * math.createUnit('foo')\n * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})\n * math.createUnit('mph', '1 mile/hour')\n * math.createUnit('km', math.unit(1000, 'm'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.\n * @param {Object} options (optional) An object containing any of the following properties:\n * - `prefixes {string}` \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\". The default is \"none\".\n * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']\n * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.\n *\n * See also:\n *\n * unit\n *\n * @return {Unit} The new unit\n */\n return typed(name, {\n\n // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.\n 'Object, Object': function (obj, options) {\n return Unit.createUnit(obj, options)\n },\n\n // Same as above but without the options.\n Object: function (obj) {\n return Unit.createUnit(obj, {})\n },\n\n // Shortcut method for creating one unit.\n 'string, Unit | string | Object, Object': function (name, def, options) {\n const obj = {}\n obj[name] = def\n return Unit.createUnit(obj, options)\n },\n\n // Same as above but without the options.\n 'string, Unit | string | Object': function (name, def) {\n const obj = {}\n obj[name] = def\n return Unit.createUnit(obj, {})\n },\n\n // Without a definition, creates a base unit.\n string: function (name) {\n const obj = {}\n obj[name] = {}\n return Unit.createUnit(obj, {})\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'acos'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createAcos = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the inverse cosine of a value.\n *\n * To avoid confusion with the matrix arccosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acos(x)\n *\n * Examples:\n *\n * math.acos(0.5) // returns number 1.0471975511965979\n * math.acos(math.cos(1.5)) // returns number 1.5\n *\n * math.acos(2) // returns Complex 0 + 1.3169578969248166 i\n *\n * See also:\n *\n * cos, atan, asin\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosine of x\n */\n return typed(name, {\n number: function (x) {\n if ((x >= -1 && x <= 1) || config.predictable) {\n return Math.acos(x)\n } else {\n return new Complex(x, 0).acos()\n }\n },\n\n Complex: function (x) {\n return x.acos()\n },\n\n BigNumber: function (x) {\n return x.acos()\n }\n })\n})\n","import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js'\n\nconst n1 = 'number'\nconst n2 = 'number, number'\n\nexport function acosNumber (x) {\n return Math.acos(x)\n}\nacosNumber.signature = n1\n\nexport function acoshNumber (x) {\n return acosh(x)\n}\nacoshNumber.signature = n1\n\nexport function acotNumber (x) {\n return Math.atan(1 / x)\n}\nacotNumber.signature = n1\n\nexport function acothNumber (x) {\n return isFinite(x)\n ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2\n : 0\n}\nacothNumber.signature = n1\n\nexport function acscNumber (x) {\n return Math.asin(1 / x)\n}\nacscNumber.signature = n1\n\nexport function acschNumber (x) {\n const xInv = 1 / x\n return Math.log(xInv + Math.sqrt(xInv * xInv + 1))\n}\nacschNumber.signature = n1\n\nexport function asecNumber (x) {\n return Math.acos(1 / x)\n}\nasecNumber.signature = n1\n\nexport function asechNumber (x) {\n const xInv = 1 / x\n const ret = Math.sqrt(xInv * xInv - 1)\n return Math.log(ret + xInv)\n}\nasechNumber.signature = n1\n\nexport function asinNumber (x) {\n return Math.asin(x)\n}\nasinNumber.signature = n1\n\nexport function asinhNumber (x) {\n return asinh(x)\n}\nasinhNumber.signature = n1\n\nexport function atanNumber (x) {\n return Math.atan(x)\n}\natanNumber.signature = n1\n\nexport function atan2Number (y, x) {\n return Math.atan2(y, x)\n}\natan2Number.signature = n2\n\nexport function atanhNumber (x) {\n return atanh(x)\n}\natanhNumber.signature = n1\n\nexport function cosNumber (x) {\n return Math.cos(x)\n}\ncosNumber.signature = n1\n\nexport function coshNumber (x) {\n return cosh(x)\n}\ncoshNumber.signature = n1\n\nexport function cotNumber (x) {\n return 1 / Math.tan(x)\n}\ncotNumber.signature = n1\n\nexport function cothNumber (x) {\n const e = Math.exp(2 * x)\n return (e + 1) / (e - 1)\n}\ncothNumber.signature = n1\n\nexport function cscNumber (x) {\n return 1 / Math.sin(x)\n}\ncscNumber.signature = n1\n\nexport function cschNumber (x) {\n // consider values close to zero (+/-)\n if (x === 0) {\n return Number.POSITIVE_INFINITY\n } else {\n return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x)\n }\n}\ncschNumber.signature = n1\n\nexport function secNumber (x) {\n return 1 / Math.cos(x)\n}\nsecNumber.signature = n1\n\nexport function sechNumber (x) {\n return 2 / (Math.exp(x) + Math.exp(-x))\n}\nsechNumber.signature = n1\n\nexport function sinNumber (x) {\n return Math.sin(x)\n}\nsinNumber.signature = n1\n\nexport function sinhNumber (x) {\n return sinh(x)\n}\nsinhNumber.signature = n1\n\nexport function tanNumber (x) {\n return Math.tan(x)\n}\ntanNumber.signature = n1\n\nexport function tanhNumber (x) {\n return tanh(x)\n}\ntanhNumber.signature = n1\n","import { factory } from '../../utils/factory.js'\nimport { acoshNumber } from '../../plain/number/index.js'\n\nconst name = 'acosh'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createAcosh = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the hyperbolic arccos of a value,\n * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.acosh(x)\n *\n * Examples:\n *\n * math.acosh(1.5) // returns 0.9624236501192069\n *\n * See also:\n *\n * cosh, asinh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosine of x\n */\n return typed(name, {\n number: function (x) {\n if (x >= 1 || config.predictable) {\n return acoshNumber(x)\n }\n if (x <= -1) {\n return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI)\n }\n return new Complex(x, 0).acosh()\n },\n\n Complex: function (x) {\n return x.acosh()\n },\n\n BigNumber: function (x) {\n return x.acosh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { acotNumber } from '../../plain/number/index.js'\n\nconst name = 'acot'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createAcot = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.\n *\n * To avoid confusion with the matrix arccotanget, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acot(x)\n *\n * Examples:\n *\n * math.acot(0.5) // returns number 1.1071487177940904\n * math.acot(2) // returns number 0.4636476090008061\n * math.acot(math.cot(1.5)) // returns number 1.5\n *\n * See also:\n *\n * cot, atan\n *\n * @param {number | BigNumber| Complex} x Function input\n * @return {number | BigNumber| Complex} The arc cotangent of x\n */\n return typed(name, {\n number: acotNumber,\n\n Complex: function (x) {\n return x.acot()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).atan()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { acothNumber } from '../../plain/number/index.js'\n\nconst name = 'acoth'\nconst dependencies = ['typed', 'config', 'Complex', 'BigNumber']\n\nexport const createAcoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex, BigNumber }) => {\n /**\n * Calculate the inverse hyperbolic tangent of a value,\n * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\n *\n * To avoid confusion with the matrix inverse hyperbolic tangent, this\n * function does not apply to matrices.\n *\n * Syntax:\n *\n * math.acoth(x)\n *\n * Examples:\n *\n * math.acoth(0.5) // returns 0.8047189562170503\n *\n * See also:\n *\n * acsch, asech\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x\n */\n return typed(name, {\n number: function (x) {\n if (x >= 1 || x <= -1 || config.predictable) {\n return acothNumber(x)\n }\n return new Complex(x, 0).acoth()\n },\n\n Complex: function (x) {\n return x.acoth()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).atanh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { acscNumber } from '../../plain/number/index.js'\n\nconst name = 'acsc'\nconst dependencies = ['typed', 'config', 'Complex', 'BigNumber']\n\nexport const createAcsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex, BigNumber }) => {\n /**\n * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.\n *\n * To avoid confusion with the matrix arccosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acsc(x)\n *\n * Examples:\n *\n * math.acsc(2) // returns 0.5235987755982989\n * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i\n * math.acsc(math.csc(1.5)) // returns number ~1.5\n *\n * See also:\n *\n * csc, asin, asec\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosecant of x\n */\n return typed(name, {\n number: function (x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return acscNumber(x)\n }\n return new Complex(x, 0).acsc()\n },\n\n Complex: function (x) {\n return x.acsc()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).asin()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { acschNumber } from '../../plain/number/index.js'\n\nconst name = 'acsch'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createAcsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Calculate the inverse hyperbolic cosecant of a value,\n * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.\n *\n * To avoid confusion with the matrix inverse hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.acsch(x)\n *\n * Examples:\n *\n * math.acsch(0.5) // returns 1.4436354751788103\n *\n * See also:\n *\n * asech, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x\n */\n return typed(name, {\n number: acschNumber,\n\n Complex: function (x) {\n return x.acsch()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).asinh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { asecNumber } from '../../plain/number/index.js'\n\nconst name = 'asec'\nconst dependencies = ['typed', 'config', 'Complex', 'BigNumber']\n\nexport const createAsec = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex, BigNumber }) => {\n /**\n * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`.\n *\n * To avoid confusion with the matrix arcsecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.asec(x)\n *\n * Examples:\n *\n * math.asec(2) // returns 1.0471975511965979\n * math.asec(math.sec(1.5)) // returns 1.5\n *\n * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i\n *\n * See also:\n *\n * acos, acot, acsc\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc secant of x\n */\n return typed(name, {\n number: function (x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return asecNumber(x)\n }\n return new Complex(x, 0).asec()\n },\n\n Complex: function (x) {\n return x.asec()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).acos()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { asechNumber } from '../../plain/number/index.js'\n\nconst name = 'asech'\nconst dependencies = ['typed', 'config', 'Complex', 'BigNumber']\n\nexport const createAsech = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex, BigNumber }) => {\n /**\n * Calculate the hyperbolic arcsecant of a value,\n * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`.\n *\n * To avoid confusion with the matrix hyperbolic arcsecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asech(x)\n *\n * Examples:\n *\n * math.asech(0.5) // returns 1.3169578969248166\n *\n * See also:\n *\n * acsch, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x\n */\n return typed(name, {\n number: function (x) {\n if ((x <= 1 && x >= -1) || config.predictable) {\n const xInv = 1 / x\n if (xInv > 0 || config.predictable) {\n return asechNumber(x)\n }\n\n const ret = Math.sqrt(xInv * xInv - 1)\n return new Complex(Math.log(ret - xInv), Math.PI)\n }\n\n return new Complex(x, 0).asech()\n },\n\n Complex: function (x) {\n return x.asech()\n },\n\n BigNumber: function (x) {\n return new BigNumber(1).div(x).acosh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'asin'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createAsin = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the inverse sine of a value.\n *\n * To avoid confusion with the matric arcsine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.asin(x)\n *\n * Examples:\n *\n * math.asin(0.5) // returns number 0.5235987755982989\n * math.asin(math.sin(1.5)) // returns number ~1.5\n *\n * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i\n *\n * See also:\n *\n * sin, atan, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc sine of x\n */\n return typed(name, {\n number: function (x) {\n if ((x >= -1 && x <= 1) || config.predictable) {\n return Math.asin(x)\n } else {\n return new Complex(x, 0).asin()\n }\n },\n\n Complex: function (x) {\n return x.asin()\n },\n\n BigNumber: function (x) {\n return x.asin()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { asinhNumber } from '../../plain/number/index.js'\n\nconst name = 'asinh'\nconst dependencies = ['typed']\n\nexport const createAsinh = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the hyperbolic arcsine of a value,\n * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arcsine, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asinh(x)\n *\n * Examples:\n *\n * math.asinh(0.5) // returns 0.48121182505960347\n *\n * See also:\n *\n * acosh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsine of x\n */\n return typed('asinh', {\n number: asinhNumber,\n\n Complex: function (x) {\n return x.asinh()\n },\n\n BigNumber: function (x) {\n return x.asinh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'atan'\nconst dependencies = ['typed']\n\nexport const createAtan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the inverse tangent of a value.\n *\n * To avoid confusion with matrix arctangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.atan(x)\n *\n * Examples:\n *\n * math.atan(0.5) // returns number 0.4636476090008061\n * math.atan(2) // returns number 1.1071487177940904\n * math.atan(math.tan(1.5)) // returns number 1.5\n *\n * See also:\n *\n * tan, asin, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc tangent of x\n */\n return typed('atan', {\n number: function (x) {\n return Math.atan(x)\n },\n\n Complex: function (x) {\n return x.atan()\n },\n\n BigNumber: function (x) {\n return x.atan()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'atan2'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'equalScalar',\n 'BigNumber',\n 'DenseMatrix',\n 'concat'\n]\n\nexport const createAtan2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, BigNumber, DenseMatrix, concat }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo09xS0Sf = createMatAlgo09xS0Sf({ typed, equalScalar })\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n\n /**\n * Calculate the inverse tangent function with two arguments, y/x.\n * By providing two arguments, the right quadrant of the computed angle can be\n * determined.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.atan2(y, x)\n *\n * Examples:\n *\n * math.atan2(2, 2) / math.pi // returns number 0.25\n *\n * const angle = math.unit(60, 'deg') // returns Unit 60 deg\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n *\n * math.atan(2) // returns number 1.1071487177940904\n *\n * See also:\n *\n * tan, atan, sin, cos\n *\n * @param {number | Array | Matrix} y Second dimension\n * @param {number | Array | Matrix} x First dimension\n * @return {number | Array | Matrix} Four-quadrant inverse tangent\n */\n return typed(\n name,\n {\n 'number, number': Math.atan2,\n\n // Complex numbers doesn't seem to have a reasonable implementation of\n // atan2(). Even Matlab removed the support, after they only calculated\n // the atan only on base of the real part of the numbers and ignored\n // the imaginary.\n\n 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x)\n },\n matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SS: matAlgo09xS0Sf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n })\n )\n})\n","import { factory } from '../../utils/factory.js'\nimport { atanhNumber } from '../../plain/number/index.js'\n\nconst name = 'atanh'\nconst dependencies = ['typed', 'config', 'Complex']\n\nexport const createAtanh = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => {\n /**\n * Calculate the hyperbolic arctangent of a value,\n * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arctangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.atanh(x)\n *\n * Examples:\n *\n * math.atanh(0.5) // returns 0.5493061443340549\n *\n * See also:\n *\n * acosh, asinh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arctangent of x\n */\n return typed(name, {\n number: function (x) {\n if ((x <= 1 && x >= -1) || config.predictable) {\n return atanhNumber(x)\n }\n return new Complex(x, 0).atanh()\n },\n\n Complex: function (x) {\n return x.atanh()\n },\n\n BigNumber: function (x) {\n return x.atanh()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nexport const createTrigUnit = /* #__PURE__ */ factory(\n 'trigUnit', ['typed'], ({ typed }) => ({\n Unit: typed.referToSelf(self => x => {\n if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {\n throw new TypeError('Unit in function cot is no angle')\n }\n return typed.find(self, x.valueType())(x.value)\n })\n })\n)\n","import { factory } from '../../utils/factory.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'cos'\nconst dependencies = ['typed']\n\nexport const createCos = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the cosine of a value.\n *\n * To avoid confusion with the matrix cosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cos(x)\n *\n * Examples:\n *\n * math.cos(2) // returns number -0.4161468365471422\n * math.cos(math.pi / 4) // returns number 0.7071067811865475\n * math.cos(math.unit(180, 'deg')) // returns number -1\n * math.cos(math.unit(60, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosine of x\n */\n return typed(name, {\n number: Math.cos,\n 'Complex | BigNumber': x => x.cos()\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { cosh as coshNumber } from '../../utils/number.js'\n\nconst name = 'cosh'\nconst dependencies = ['typed']\n\nexport const createCosh = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the hyperbolic cosine of a value,\n * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic cosine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.cosh(x)\n *\n * Examples:\n *\n * math.cosh(0.5) // returns number 1.1276259652063807\n *\n * See also:\n *\n * sinh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosine of x\n */\n return typed(name, {\n number: coshNumber,\n 'Complex | BigNumber': x => x.cosh()\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { cotNumber } from '../../plain/number/index.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'cot'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createCot = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`.\n *\n * To avoid confusion with the matrix cotangent, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cot(x)\n *\n * Examples:\n *\n * math.cot(2) // returns number -0.45765755436028577\n * 1 / math.tan(2) // returns number -0.45765755436028577\n *\n * See also:\n *\n * tan, sec, csc\n *\n * @param {number | Complex | Unit | Array | Matrix} x Function input\n * @return {number | Complex | Array | Matrix} Cotangent of x\n */\n return typed(name, {\n number: cotNumber,\n Complex: x => x.cot(),\n BigNumber: x => new BigNumber(1).div(x.tan())\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { cothNumber } from '../../plain/number/index.js'\n\nconst name = 'coth'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createCoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Calculate the hyperbolic cotangent of a value,\n * defined as `coth(x) = 1 / tanh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cotangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.coth(x)\n *\n * Examples:\n *\n * // coth(x) = 1 / tanh(x)\n * math.coth(2) // returns 1.0373147207275482\n * 1 / math.tanh(2) // returns 1.0373147207275482\n *\n * See also:\n *\n * sinh, tanh, cosh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cotangent of x\n */\n return typed(name, {\n number: cothNumber,\n Complex: x => x.coth(),\n BigNumber: x => new BigNumber(1).div(x.tanh())\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { cscNumber } from '../../plain/number/index.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'csc'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createCsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.\n *\n * To avoid confusion with the matrix cosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.csc(x)\n *\n * Examples:\n *\n * math.csc(2) // returns number 1.099750170294617\n * 1 / math.sin(2) // returns number 1.099750170294617\n *\n * See also:\n *\n * sin, sec, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosecant of x\n */\n return typed(name, {\n number: cscNumber,\n Complex: x => x.csc(),\n BigNumber: x => new BigNumber(1).div(x.sin())\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { cschNumber } from '../../plain/number/index.js'\n\nconst name = 'csch'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createCsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Calculate the hyperbolic cosecant of a value,\n * defined as `csch(x) = 1 / sinh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.csch(x)\n *\n * Examples:\n *\n * // csch(x) = 1/ sinh(x)\n * math.csch(0.5) // returns 1.9190347513349437\n * 1 / math.sinh(0.5) // returns 1.9190347513349437\n *\n * See also:\n *\n * sinh, sech, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosecant of x\n */\n return typed(name, {\n number: cschNumber,\n Complex: x => x.csch(),\n BigNumber: x => new BigNumber(1).div(x.sinh())\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { secNumber } from '../../plain/number/index.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'sec'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createSec = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.\n *\n * To avoid confusion with the matrix secant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.sec(x)\n *\n * Examples:\n *\n * math.sec(2) // returns number -2.4029979617223822\n * 1 / math.cos(2) // returns number -2.4029979617223822\n *\n * See also:\n *\n * cos, csc, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Secant of x\n */\n return typed(name, {\n number: secNumber,\n Complex: x => x.sec(),\n BigNumber: x => new BigNumber(1).div(x.cos())\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { sechNumber } from '../../plain/number/index.js'\n\nconst name = 'sech'\nconst dependencies = ['typed', 'BigNumber']\n\nexport const createSech = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {\n /**\n * Calculate the hyperbolic secant of a value,\n * defined as `sech(x) = 1 / cosh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic secant, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sech(x)\n *\n * Examples:\n *\n * // sech(x) = 1/ cosh(x)\n * math.sech(0.5) // returns 0.886818883970074\n * 1 / math.cosh(0.5) // returns 0.886818883970074\n *\n * See also:\n *\n * cosh, csch, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic secant of x\n */\n return typed(name, {\n number: sechNumber,\n Complex: x => x.sech(),\n BigNumber: x => new BigNumber(1).div(x.cosh())\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'sin'\nconst dependencies = ['typed']\n\nexport const createSin = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the sine of a value.\n *\n * To avoid confusion with the matrix sine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.sin(x)\n *\n * Examples:\n *\n * math.sin(2) // returns number 0.9092974268256813\n * math.sin(math.pi / 4) // returns number 0.7071067811865475\n * math.sin(math.unit(90, 'deg')) // returns number 1\n * math.sin(math.unit(30, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Sine of x\n */\n return typed(name, {\n number: Math.sin,\n 'Complex | BigNumber': x => x.sin()\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { sinhNumber } from '../../plain/number/index.js'\n\nconst name = 'sinh'\nconst dependencies = ['typed']\n\nexport const createSinh = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the hyperbolic sine of a value,\n * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic sine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sinh(x)\n *\n * Examples:\n *\n * math.sinh(0.5) // returns number 0.5210953054937474\n *\n * See also:\n *\n * cosh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic sine of x\n */\n return typed(name, {\n number: sinhNumber,\n 'Complex | BigNumber': x => x.sinh()\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createTrigUnit } from './trigUnit.js'\n\nconst name = 'tan'\nconst dependencies = ['typed']\n\nexport const createTan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n const trigUnit = createTrigUnit({ typed })\n\n /**\n * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`.\n *\n * To avoid confusion with the matrix tangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.tan(x)\n *\n * Examples:\n *\n * math.tan(0.5) // returns number 0.5463024898437905\n * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905\n * math.tan(math.pi / 4) // returns number 1\n * math.tan(math.unit(45, 'deg')) // returns number 1\n *\n * See also:\n *\n * atan, sin, cos\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Tangent of x\n */\n return typed(name, {\n number: Math.tan,\n 'Complex | BigNumber': x => x.tan()\n }, trigUnit)\n})\n","import { factory } from '../../utils/factory.js'\nimport { tanh as _tanh } from '../../utils/number.js'\n\nconst name = 'tanh'\nconst dependencies = ['typed']\n\nexport const createTanh = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the hyperbolic tangent of a value,\n * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`.\n *\n * To avoid confusion with matrix hyperbolic tangent, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.tanh(x)\n *\n * Examples:\n *\n * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)\n * math.tanh(0.5) // returns 0.46211715726000974\n * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974\n * 1 / math.coth(0.5) // returns 0.46211715726000974\n *\n * See also:\n *\n * sinh, cosh, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic tangent of x\n */\n return typed('tanh', {\n number: _tanh,\n 'Complex | BigNumber': x => x.tanh()\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setCartesian'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']\n\nexport const createSetCartesian = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index, DenseMatrix }) => {\n /**\n * Create the cartesian product of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays\n * and the values will be sorted in ascending order before the operation.\n *\n * Syntax:\n *\n * math.setCartesian(set1, set2)\n *\n * Examples:\n *\n * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]]\n * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference, setPowerset\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The cartesian product of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n let result = []\n\n if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) { // if any of them is empty, return empty\n const b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)\n const b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)\n result = []\n for (let i = 0; i < b1.length; i++) {\n for (let j = 0; j < b2.length; j++) {\n result.push([b1[i], b2[j]])\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return result\n }\n // return a matrix otherwise\n return new DenseMatrix(result)\n }\n })\n})\n","import { flatten, generalize, identify } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setDifference'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']\n\nexport const createSetDifference = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index, DenseMatrix }) => {\n /**\n * Create the difference of two (multi)sets: every element of set1, that is not the element of set2.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setDifference(set1, set2)\n *\n * Examples:\n *\n * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2]\n * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2]\n *\n * See also:\n *\n * setUnion, setIntersect, setSymDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n let result\n if (subset(size(a1), new Index(0)) === 0) { // empty-anything=empty\n result = []\n } else if (subset(size(a2), new Index(0)) === 0) { // anything-empty=anything\n return flatten(a1.toArray())\n } else {\n const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural))\n const b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural))\n result = []\n let inb2\n for (let i = 0; i < b1.length; i++) {\n inb2 = false\n for (let j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { // the identifier is always a decimal int\n inb2 = true\n break\n }\n }\n if (!inb2) {\n result.push(b1[i])\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result)\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result))\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setDistinct'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']\n\nexport const createSetDistinct = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index, DenseMatrix }) => {\n /**\n * Collect the distinct elements of a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setDistinct(set)\n *\n * Examples:\n *\n * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]\n *\n * See also:\n *\n * setMultiplicity\n *\n * @param {Array | Matrix} a A multiset\n * @return {Array | Matrix} A set containing the distinc elements of the multiset\n */\n return typed(name, {\n 'Array | Matrix': function (a) {\n let result\n if (subset(size(a), new Index(0)) === 0) { // if empty, return empty\n result = []\n } else {\n const b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural)\n result = []\n result.push(b[0])\n for (let i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n result.push(b[i])\n }\n }\n }\n // return an array, if the input was an array\n if (Array.isArray(a)) {\n return result\n }\n // return a matrix otherwise\n return new DenseMatrix(result)\n }\n })\n})\n","import { flatten, generalize, identify } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setIntersect'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']\n\nexport const createSetIntersect = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index, DenseMatrix }) => {\n /**\n * Create the intersection of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIntersect(set1, set2)\n *\n * Examples:\n *\n * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4]\n * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4]\n *\n * See also:\n *\n * setUnion, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The intersection of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n let result\n if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) { // of any of them is empty, return empty\n result = []\n } else {\n const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural))\n const b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural))\n result = []\n for (let i = 0; i < b1.length; i++) {\n for (let j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { // the identifier is always a decimal int\n result.push(b1[i])\n break\n }\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result)\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result))\n }\n })\n})\n","import { flatten, identify } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setIsSubset'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']\n\nexport const createSetIsSubset = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index }) => {\n /**\n * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.)\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIsSubset(set1, set2)\n *\n * Examples:\n *\n * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false\n * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) { // empty is a subset of anything\n return true\n } else if (subset(size(a2), new Index(0)) === 0) { // anything is not a subset of empty\n return false\n }\n const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural))\n const b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural))\n let inb2\n for (let i = 0; i < b1.length; i++) {\n inb2 = false\n for (let j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { // the identifier is always a decimal int\n inb2 = true\n break\n }\n }\n if (inb2 === false) {\n return false\n }\n }\n return true\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setMultiplicity'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']\n\nexport const createSetMultiplicity = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index }) => {\n /**\n * Count the multiplicity of an element in a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setMultiplicity(element, set)\n *\n * Examples:\n *\n * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1\n * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2\n *\n * See also:\n *\n * setDistinct, setSize\n *\n * @param {number | BigNumber | Fraction | Complex} e An element in the multiset\n * @param {Array | Matrix} a A multiset\n * @return {number} The number of how many times the multiset contains the element\n */\n return typed(name, {\n 'number | BigNumber | Fraction | Complex, Array | Matrix': function (e, a) {\n if (subset(size(a), new Index(0)) === 0) { // if empty, return 0\n return 0\n }\n const b = flatten(Array.isArray(a) ? a : a.toArray())\n let count = 0\n for (let i = 0; i < b.length; i++) {\n if (compareNatural(b[i], e) === 0) {\n count++\n }\n }\n return count\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setPowerset'\nconst dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']\n\nexport const createSetPowerset = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, subset, compareNatural, Index }) => {\n /**\n * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.)\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setPowerset(set)\n *\n * Examples:\n *\n * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n *\n * See also:\n *\n * setCartesian\n *\n * @param {Array | Matrix} a A (multi)set\n * @return {Array} The powerset of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function (a) {\n if (subset(size(a), new Index(0)) === 0) { // if empty, return empty\n return []\n }\n const b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural)\n const result = []\n let number = 0\n while (number.toString(2).length <= b.length) {\n result.push(_subset(b, number.toString(2).split('').reverse()))\n number++\n }\n // can not return a matrix, because of the different size of the subarrays\n return _sort(result)\n }\n })\n\n // create subset\n function _subset (array, bitarray) {\n const result = []\n for (let i = 0; i < bitarray.length; i++) {\n if (bitarray[i] === '1') {\n result.push(array[i])\n }\n }\n return result\n }\n\n // sort subsests by length\n function _sort (array) {\n let temp = []\n for (let i = array.length - 1; i > 0; i--) {\n for (let j = 0; j < i; j++) {\n if (array[j].length > array[j + 1].length) {\n temp = array[j]\n array[j] = array[j + 1]\n array[j + 1] = temp\n }\n }\n }\n return array\n }\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setSize'\nconst dependencies = ['typed', 'compareNatural']\n\nexport const createSetSize = /* #__PURE__ */ factory(name, dependencies, ({ typed, compareNatural }) => {\n /**\n * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setSize(set)\n * math.setSize(set, unique)\n *\n * Examples:\n *\n * math.setSize([1, 2, 2, 4]) // returns 4\n * math.setSize([1, 2, 2, 4], true) // returns 3\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a A multiset\n * @param {boolean} [unique] If true, only the unique values are counted. False by default\n * @return {number} The number of elements of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function (a) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length\n },\n 'Array | Matrix, boolean': function (a, unique) {\n if (unique === false || a.length === 0) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length\n } else {\n const b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural)\n let count = 1\n for (let i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n count++\n }\n }\n return count\n }\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setSymDifference'\nconst dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index']\n\nexport const createSetSymDifference = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, concat, subset, setDifference, Index }) => {\n /**\n * Create the symmetric difference of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setSymDifference(set1, set2)\n *\n * Examples:\n *\n * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6]\n * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The symmetric difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) { // if any of them is empty, return the other one\n return flatten(a2)\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1)\n }\n const b1 = flatten(a1)\n const b2 = flatten(a2)\n return concat(setDifference(b1, b2), setDifference(b2, b1))\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'setUnion'\nconst dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index']\n\nexport const createSetUnion = /* #__PURE__ */ factory(name, dependencies, ({ typed, size, concat, subset, setIntersect, setSymDifference, Index }) => {\n /**\n * Create the union of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setUnion(set1, set2)\n *\n * Examples:\n *\n * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6]\n * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6]\n *\n * See also:\n *\n * setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The union of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function (a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) { // if any of them is empty, return the other one\n return flatten(a2)\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1)\n }\n const b1 = flatten(a1)\n const b2 = flatten(a2)\n return concat(setSymDifference(b1, b2), setIntersect(b1, b2))\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'\n\nconst name = 'add'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'addScalar',\n 'equalScalar',\n 'DenseMatrix',\n 'SparseMatrix',\n 'concat'\n]\n\nexport const createAdd = /* #__PURE__ */ factory(\n name,\n dependencies,\n ({ typed, matrix, addScalar, equalScalar, DenseMatrix, SparseMatrix, concat }) => {\n const matAlgo01xDSid = createMatAlgo01xDSid({ typed })\n const matAlgo04xSidSid = createMatAlgo04xSidSid({ typed, equalScalar })\n const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat })\n /**\n * Add two or more values, `x + y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.add(x, y)\n * math.add(x, y, z, ...)\n *\n * Examples:\n *\n * math.add(2, 3) // returns number 5\n * math.add(2, 3, 4) // returns number 9\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(-4, 1)\n * math.add(a, b) // returns Complex -2 + 4i\n *\n * math.add([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * const c = math.unit('5 cm')\n * const d = math.unit('2.1 mm')\n * math.add(c, d) // returns Unit 52.1 mm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`\n */\n return typed(\n name,\n {\n 'any, any': addScalar,\n\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n let result = self(x, y)\n\n for (let i = 0; i < rest.length; i++) {\n result = self(result, rest[i])\n }\n\n return result\n })\n },\n matrixAlgorithmSuite({\n elop: addScalar,\n DS: matAlgo01xDSid,\n SS: matAlgo04xSidSid,\n Ss: matAlgo10xSids\n })\n )\n })\n","import { factory } from '../../utils/factory.js'\nimport { flatten } from '../../utils/array.js'\nimport { isComplex } from '../../utils/is.js'\n\nconst name = 'hypot'\nconst dependencies = [\n 'typed',\n 'abs',\n 'addScalar',\n 'divideScalar',\n 'multiplyScalar',\n 'sqrt',\n 'smaller',\n 'isPositive'\n]\n\nexport const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, addScalar, divideScalar, multiplyScalar, sqrt, smaller, isPositive }) => {\n /**\n * Calculate the hypotenuse of a list with values. The hypotenuse is defined as:\n *\n * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)\n *\n * For matrix input, the hypotenuse is calculated for all values in the matrix.\n *\n * Syntax:\n *\n * math.hypot(a, b, ...)\n * math.hypot([a, b, c, ...])\n *\n * Examples:\n *\n * math.hypot(3, 4) // 5\n * math.hypot(3, 4, 5) // 7.0710678118654755\n * math.hypot([3, 4, 5]) // 7.0710678118654755\n * math.hypot(-2) // 2\n *\n * See also:\n *\n * abs, norm\n *\n * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix.\n * Matrix and Array input is flattened and returns a\n * single number for the whole matrix.\n * @return {number | BigNumber} Returns the hypothenusa of the input values.\n */\n return typed(name, {\n '... number | BigNumber': _hypot,\n\n Array: _hypot,\n\n Matrix: M => _hypot(flatten(M.toArray()))\n })\n\n /**\n * Calculate the hypotenuse for an Array with values\n * @param {Array.} args\n * @return {number | BigNumber} Returns the result\n * @private\n */\n function _hypot (args) {\n // code based on `hypot` from es6-shim:\n // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633\n let result = 0\n let largest = 0\n\n for (let i = 0; i < args.length; i++) {\n if (isComplex(args[i])) {\n throw new TypeError('Unexpected type of argument to hypot')\n }\n const value = abs(args[i])\n if (smaller(largest, value)) {\n result = multiplyScalar(result,\n multiplyScalar(divideScalar(largest, value), divideScalar(largest, value)))\n result = addScalar(result, 1)\n largest = value\n } else {\n result = addScalar(result, isPositive(value)\n ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest))\n : value)\n }\n }\n\n return multiplyScalar(largest, sqrt(result))\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'norm'\nconst dependencies = [\n 'typed',\n 'abs',\n 'add',\n 'pow',\n 'conj',\n 'sqrt',\n 'multiply',\n 'equalScalar',\n 'larger',\n 'smaller',\n 'matrix',\n 'ctranspose',\n 'eigs'\n]\n\nexport const createNorm = /* #__PURE__ */ factory(\n name,\n dependencies,\n ({\n typed,\n abs,\n add,\n pow,\n conj,\n sqrt,\n multiply,\n equalScalar,\n larger,\n smaller,\n matrix,\n ctranspose,\n eigs\n }) => {\n /**\n * Calculate the norm of a number, vector or matrix.\n *\n * The second parameter p is optional. If not provided, it defaults to 2.\n *\n * Syntax:\n *\n * math.norm(x)\n * math.norm(x, p)\n *\n * Examples:\n *\n * math.abs(-3.5) // returns 3.5\n * math.norm(-3.5) // returns 3.5\n *\n * math.norm(math.complex(3, -4)) // returns 5\n *\n * math.norm([1, 2, -3], Infinity) // returns 3\n * math.norm([1, 2, -3], -Infinity) // returns 1\n *\n * math.norm([3, 4], 2) // returns 5\n *\n * math.norm([[1, 2], [3, 4]], 1) // returns 6\n * math.norm([[1, 2], [3, 4]], 'inf') // returns 7\n * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661\n *\n * See also:\n *\n * abs, hypot\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the norm\n * @param {number | BigNumber | string} [p=2]\n * Vector space.\n * Supported numbers include Infinity and -Infinity.\n * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm)\n * @return {number | BigNumber} the p-norm\n */\n return typed(name, {\n number: Math.abs,\n\n Complex: function (x) {\n return x.abs()\n },\n\n BigNumber: function (x) {\n // norm(x) = abs(x)\n return x.abs()\n },\n\n boolean: function (x) {\n // norm(x) = abs(x)\n return Math.abs(x)\n },\n\n Array: function (x) {\n return _norm(matrix(x), 2)\n },\n\n Matrix: function (x) {\n return _norm(x, 2)\n },\n\n 'Array, number | BigNumber | string': function (x, p) {\n return _norm(matrix(x), p)\n },\n\n 'Matrix, number | BigNumber | string': function (x, p) {\n return _norm(x, p)\n }\n })\n\n /**\n * Calculate the plus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormPlusInfinity (x) {\n // norm(x, Infinity) = max(abs(x))\n let pinf = 0\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n const v = abs(value)\n if (larger(v, pinf)) {\n pinf = v\n }\n }, true)\n return pinf\n }\n\n /**\n * Calculate the minus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormMinusInfinity (x) {\n // norm(x, -Infinity) = min(abs(x))\n let ninf\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n const v = abs(value)\n if (!ninf || smaller(v, ninf)) {\n ninf = v\n }\n }, true)\n return ninf || 0\n }\n\n /**\n * Calculate the norm for a vector\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNorm (x, p) {\n // check p\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _vectorNormPlusInfinity(x)\n }\n if (p === Number.NEGATIVE_INFINITY || p === '-inf') {\n return _vectorNormMinusInfinity(x)\n }\n if (p === 'fro') {\n return _norm(x, 2)\n }\n if (typeof p === 'number' && !isNaN(p)) {\n // check p != 0\n if (!equalScalar(p, 0)) {\n // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p\n let n = 0\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n n = add(pow(abs(value), p), n)\n }, true)\n return pow(n, 1 / p)\n }\n return Number.POSITIVE_INFINITY\n }\n // invalid parameter value\n throw new Error('Unsupported parameter value')\n }\n\n /**\n * Calculate the Frobenius norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormFrobenius (x) {\n // norm(x) = sqrt(sum(diag(x'x)))\n let fro = 0\n x.forEach(function (value, index) {\n fro = add(fro, multiply(value, conj(value)))\n })\n return abs(sqrt(fro))\n }\n\n /**\n * Calculate the norm L1 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormOne (x) {\n // norm(x) = the largest column sum\n const c = []\n // result\n let maxc = 0\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n const j = index[1]\n const cj = add(c[j] || 0, abs(value))\n if (larger(cj, maxc)) {\n maxc = cj\n }\n c[j] = cj\n }, true)\n return maxc\n }\n\n /**\n * Calculate the norm L2 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormTwo (x) {\n // norm(x) = sqrt( max eigenvalue of A*.A)\n const sizeX = x.size()\n if (sizeX[0] !== sizeX[1]) {\n throw new RangeError('Invalid matrix dimensions')\n }\n const tx = ctranspose(x)\n const squaredX = multiply(tx, x)\n const eigenVals = eigs(squaredX).values.toArray()\n const rho = eigenVals[eigenVals.length - 1]\n return abs(sqrt(rho))\n }\n\n /**\n * Calculate the infinity norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormInfinity (x) {\n // norm(x) = the largest row sum\n const r = []\n // result\n let maxr = 0\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n const i = index[0]\n const ri = add(r[i] || 0, abs(value))\n if (larger(ri, maxr)) {\n maxr = ri\n }\n r[i] = ri\n }, true)\n return maxr\n }\n\n /**\n * Calculate the norm for a 2D Matrix (M*N)\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNorm (x, p) {\n // check p\n if (p === 1) {\n return _matrixNormOne(x)\n }\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _matrixNormInfinity(x)\n }\n if (p === 'fro') {\n return _matrixNormFrobenius(x)\n }\n if (p === 2) {\n return _matrixNormTwo(x)\n } // invalid parameter value\n\n throw new Error('Unsupported parameter value ' + p)\n }\n\n /**\n * Calculate the norm for an array\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _norm (x, p) {\n // size\n const sizeX = x.size()\n\n // check if it is a vector\n if (sizeX.length === 1) {\n return _vectorNorm(x, p)\n }\n // MxN matrix\n if (sizeX.length === 2) {\n if (sizeX[0] && sizeX[1]) {\n return _matrixNorm(x, p)\n } else {\n throw new RangeError('Invalid matrix dimensions')\n }\n }\n }\n }\n)\n","import { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\n\nconst name = 'dot'\nconst dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size']\n\nexport const createDot = /* #__PURE__ */ factory(name, dependencies, ({ typed, addScalar, multiplyScalar, conj, size }) => {\n /**\n * Calculate the dot product of two vectors. The dot product of\n * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:\n *\n * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn\n *\n * Syntax:\n *\n * math.dot(x, y)\n *\n * Examples:\n *\n * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15\n * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15\n *\n * See also:\n *\n * multiply, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {number} Returns the dot product of `x` and `y`\n */\n return typed(name, {\n 'Array | DenseMatrix, Array | DenseMatrix': _denseDot,\n 'SparseMatrix, SparseMatrix': _sparseDot\n })\n\n function _validateDim (x, y) {\n const xSize = _size(x)\n const ySize = _size(y)\n let xLen, yLen\n\n if (xSize.length === 1) {\n xLen = xSize[0]\n } else if (xSize.length === 2 && xSize[1] === 1) {\n xLen = xSize[0]\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')')\n }\n\n if (ySize.length === 1) {\n yLen = ySize[0]\n } else if (ySize.length === 2 && ySize[1] === 1) {\n yLen = ySize[0]\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')')\n }\n\n if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')')\n if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors')\n\n return xLen\n }\n\n function _denseDot (a, b) {\n const N = _validateDim(a, b)\n\n const adata = isMatrix(a) ? a._data : a\n const adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined\n\n const bdata = isMatrix(b) ? b._data : b\n const bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined\n\n // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors)\n const aIsColumn = _size(a).length === 2\n const bIsColumn = _size(b).length === 2\n\n let add = addScalar\n let mul = multiplyScalar\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n const dt = adt\n // find signatures that matches (dt, dt)\n add = typed.find(addScalar, [dt, dt])\n mul = typed.find(multiplyScalar, [dt, dt])\n }\n\n // both vectors 1-dimensional\n if (!aIsColumn && !bIsColumn) {\n let c = mul(conj(adata[0]), bdata[0])\n for (let i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i]))\n }\n return c\n }\n\n // a is 1-dim, b is column\n if (!aIsColumn && bIsColumn) {\n let c = mul(conj(adata[0]), bdata[0][0])\n for (let i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i][0]))\n }\n return c\n }\n\n // a is column, b is 1-dim\n if (aIsColumn && !bIsColumn) {\n let c = mul(conj(adata[0][0]), bdata[0])\n for (let i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i][0]), bdata[i]))\n }\n return c\n }\n\n // both vectors are column\n if (aIsColumn && bIsColumn) {\n let c = mul(conj(adata[0][0]), bdata[0][0])\n for (let i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i][0]), bdata[i][0]))\n }\n return c\n }\n }\n\n function _sparseDot (x, y) {\n _validateDim(x, y)\n\n const xindex = x._index\n const xvalues = x._values\n\n const yindex = y._index\n const yvalues = y._values\n\n // TODO optimize add & mul using datatype\n let c = 0\n const add = addScalar\n const mul = multiplyScalar\n\n let i = 0\n let j = 0\n while (i < xindex.length && j < yindex.length) {\n const I = xindex[i]\n const J = yindex[j]\n\n if (I < J) {\n i++\n continue\n }\n if (I > J) {\n j++\n continue\n }\n if (I === J) {\n c = add(c, mul(xvalues[i], yvalues[j]))\n i++\n j++\n }\n }\n\n return c\n }\n\n // TODO remove this once #1771 is fixed\n function _size (x) {\n return isMatrix(x) ? x.size() : size(x)\n }\n})\n","import { clone } from '../../utils/object.js'\nimport { format } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'trace'\nconst dependencies = ['typed', 'matrix', 'add']\n\nexport const createTrace = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, add }) => {\n /**\n * Calculate the trace of a matrix: the sum of the elements on the main\n * diagonal of a square matrix.\n *\n * Syntax:\n *\n * math.trace(x)\n *\n * Examples:\n *\n * math.trace([[1, 2], [3, 4]]) // returns 5\n *\n * const A = [\n * [1, 2, 3],\n * [-1, 2, 3],\n * [2, 0, 3]\n * ]\n * math.trace(A) // returns 6\n *\n * See also:\n *\n * diag\n *\n * @param {Array | Matrix} x A matrix\n *\n * @return {number} The trace of `x`\n */\n return typed('trace', {\n Array: function _arrayTrace (x) {\n // use dense matrix implementation\n return _denseTrace(matrix(x))\n },\n\n SparseMatrix: _sparseTrace,\n\n DenseMatrix: _denseTrace,\n\n any: clone\n })\n\n function _denseTrace (m) {\n // matrix size & data\n const size = m._size\n const data = m._data\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n // return data[0]\n return clone(data[0])\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')')\n case 2:\n {\n // two dimensional\n const rows = size[0]\n const cols = size[1]\n if (rows === cols) {\n // calulate sum\n let sum = 0\n // loop diagonal\n for (let i = 0; i < rows; i++) { sum = add(sum, data[i][i]) }\n // return trace\n return sum\n } else {\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')')\n }\n }\n default:\n // multi dimensional\n throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')')\n }\n }\n\n function _sparseTrace (m) {\n // matrix arrays\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n const size = m._size\n // check dimensions\n const rows = size[0]\n const columns = size[1]\n // matrix must be square\n if (rows === columns) {\n // calulate sum\n let sum = 0\n // check we have data (avoid looping columns)\n if (values.length > 0) {\n // loop columns\n for (let j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = ptr[j]\n const k1 = ptr[j + 1]\n // loop k within [k0, k1[\n for (let k = k0; k < k1; k++) {\n // row index\n const i = index[k]\n // check row\n if (i === j) {\n // accumulate value\n sum = add(sum, values[k])\n // exit loop\n break\n }\n if (i > j) {\n // exit loop, no value on the diagonal for column j\n break\n }\n }\n }\n }\n // return trace\n return sum\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')')\n }\n})\n","import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js'\nimport { factory } from '../../../utils/factory.js'\n\nconst name = 'index'\nconst dependencies = ['typed', 'Index']\n\nexport const createIndex = /* #__PURE__ */ factory(name, dependencies, ({ typed, Index }) => {\n /**\n * Create an index. An Index can store ranges having start, step, and end\n * for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Syntax:\n *\n * math.index(range1, range2, ...)\n *\n * Where each range can be any of:\n *\n * - A number\n * - A string for getting/setting an object property\n * - An instance of `Range`\n * - A one-dimensional Array or a Matrix with numbers or booleans\n *\n * Indexes must be zero-based, integer numbers.\n *\n * Examples:\n *\n * const b = [1, 2, 3, 4, 5]\n * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]\n * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4]\n *\n * const a = math.matrix([[1, 2], [3, 4]])\n * a.subset(math.index(0, 1)) // returns 2\n * a.subset(math.index(0, [false, true])) // returns 2\n *\n * See also:\n *\n * bignumber, boolean, complex, matrix, number, string, unit\n *\n * @param {...*} ranges Zero or more ranges or numbers.\n * @return {Index} Returns the created index\n */\n return typed(name, {\n '...number | string | BigNumber | Range | Array | Matrix': function (args) {\n const ranges = args.map(function (arg) {\n if (isBigNumber(arg)) {\n return arg.toNumber() // convert BigNumber to Number\n } else if (isArray(arg) || isMatrix(arg)) {\n return arg.map(function (elem) {\n // convert BigNumber to Number\n return isBigNumber(elem) ? elem.toNumber() : elem\n })\n } else {\n return arg\n }\n })\n\n const res = new Index()\n Index.apply(res, ranges)\n return res\n }\n })\n})\n","// Reserved keywords not allowed to use in the parser\nexport const keywords = new Set([\n 'end'\n])\n","import { isNode } from '../../utils/is.js'\n\nimport { keywords } from '../keywords.js'\nimport { deepStrictEqual } from '../../utils/object.js'\nimport { factory } from '../../utils/factory.js'\nimport { createMap } from '../../utils/map.js'\n\nconst name = 'Node'\nconst dependencies = ['mathWithTransform']\n\nexport const createNode = /* #__PURE__ */ factory(name, dependencies, ({ mathWithTransform }) => {\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope (scope) {\n for (const symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword')\n }\n }\n }\n\n class Node {\n get type () { return 'Node' }\n get isNode () { return true }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate (scope) {\n return this.compile().evaluate(scope)\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile () {\n const expr = this._compile(mathWithTransform, {})\n const args = {}\n const context = null\n\n function evaluate (scope) {\n const s = createMap(scope)\n _validateScope(s)\n return expr(s, args, context)\n }\n\n return {\n evaluate\n }\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type)\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface')\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map (callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface')\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode (node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node')\n }\n return node\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse (callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null)\n\n // recursively traverse over all children of a node\n function _traverse (node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent)\n _traverse(child, callback)\n })\n }\n\n _traverse(this, callback)\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform (callback) {\n function _transform (child, path, parent) {\n const replacement = callback(child, path, parent)\n\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement\n }\n\n return child.map(_transform)\n }\n\n return _transform(this, null, null)\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter (callback) {\n const nodes = []\n\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node)\n }\n })\n\n return nodes\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone () {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface')\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep () {\n return this.map(function (node) {\n return node.cloneDeep()\n })\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals (other) {\n return other\n ? this.type === other.type && deepStrictEqual(this, other)\n : false\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString (options) {\n const customString = this._getCustomString(options)\n\n if (typeof customString !== 'undefined') {\n return customString\n }\n\n return this._toString(options)\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString () {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type)\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON () {\n throw new Error(\n 'Cannot serialize object: toJSON not implemented by ' + this.type)\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML (options) {\n const customString = this._getCustomString(options)\n\n if (typeof customString !== 'undefined') {\n return customString\n }\n\n return this._toHTML(options)\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML () {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type)\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex (options) {\n const customString = this._getCustomString(options)\n\n if (typeof customString !== 'undefined') {\n return customString\n }\n\n return this._toTex(options)\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex (options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type)\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString (options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return\n case 'function':\n return options.handler(this, options)\n default:\n throw new TypeError('Object or function expected as callback')\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier () {\n return this.type\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent () {\n return this\n }\n }\n\n return Node\n}, { isClass: true, isNode: true })\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import { IndexError } from '../../../error/IndexError.js'\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform (err) {\n if (err && err.isIndexError) {\n return new IndexError(\n err.index + 1,\n err.min + 1,\n err.max !== undefined ? err.max + 1 : undefined)\n }\n\n return err\n}\n","import { errorTransform } from '../../transform/utils/errorTransform.js'\nimport { getSafeProperty } from '../../../utils/customs.js'\n\nexport function accessFactory ({ subset }) {\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access (object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index)\n } else if (object && typeof object.subset === 'function') { // Matrix\n return object.subset(index)\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index)\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property')\n }\n\n return getSafeProperty(object, index.getObjectProperty())\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object')\n }\n } catch (err) {\n throw errorTransform(err)\n }\n }\n}\n","import {\n isAccessorNode,\n isArrayNode,\n isConstantNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isParenthesisNode,\n isSymbolNode\n} from '../../utils/is.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { accessFactory } from './utils/access.js'\n\nconst name = 'AccessorNode'\nconst dependencies = [\n 'subset',\n 'Node'\n]\n\nexport const createAccessorNode = /* #__PURE__ */ factory(name, dependencies, ({ subset, Node }) => {\n const access = accessFactory({ subset })\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis (node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(\n isAccessorNode(node) ||\n isArrayNode(node) ||\n isConstantNode(node) ||\n isFunctionNode(node) ||\n isObjectNode(node) ||\n isParenthesisNode(node) ||\n isSymbolNode(node))\n }\n\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n */\n constructor (object, index) {\n super()\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"')\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"')\n }\n\n this.object = object\n this.index = index\n }\n\n // readonly property name\n get name () {\n if (this.index) {\n return (this.index.isObjectProperty())\n ? this.index.getObjectProperty()\n : ''\n } else {\n return this.object.name || ''\n }\n }\n\n static name = name\n get type () { return name }\n get isAccessorNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalObject = this.object._compile(math, argNames)\n const evalIndex = this.index._compile(math, argNames)\n\n if (this.index.isObjectProperty()) {\n const prop = this.index.getObjectProperty()\n return function evalAccessorNode (scope, args, context) {\n // get a property from an object evaluated using the scope.\n return getSafeProperty(evalObject(scope, args, context), prop)\n }\n } else {\n return function evalAccessorNode (scope, args, context) {\n const object = evalObject(scope, args, context)\n // we pass just object here instead of context:\n const index = evalIndex(scope, args, object)\n return access(object, index)\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.object, 'object', this)\n callback(this.index, 'index', this)\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map (callback) {\n return new AccessorNode(\n this._ifNode(callback(this.object, 'object', this)),\n this._ifNode(callback(this.index, 'index', this))\n )\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone () {\n return new AccessorNode(this.object, this.index)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString (options) {\n let object = this.object.toString(options)\n if (needParenthesis(this.object)) {\n object = '(' + object + ')'\n }\n\n return object + this.index.toString(options)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML (options) {\n let object = this.object.toHTML(options)\n if (needParenthesis(this.object)) {\n object =\n '(' +\n object +\n ')'\n }\n\n return object + this.index.toHTML(options)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex (options) {\n let object = this.object.toTex(options)\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)'\n }\n\n return object + this.index.toTex(options)\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n object: this.object,\n index: this.index\n }\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON (json) {\n return new AccessorNode(json.object, json.index)\n }\n }\n\n return AccessorNode\n}, { isClass: true, isNode: true })\n","import { isArrayNode, isNode } from '../../utils/is.js'\nimport { map } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ArrayNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createArrayNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor (items) {\n super()\n this.items = items || []\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected')\n }\n }\n\n static name = name\n get type () { return name }\n get isArrayNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalItems = map(this.items, function (item) {\n return item._compile(math, argNames)\n })\n\n const asMatrix = (math.config.matrix !== 'Array')\n if (asMatrix) {\n const matrix = math.matrix\n return function evalArrayNode (scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context)\n }))\n }\n } else {\n return function evalArrayNode (scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context)\n })\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (let i = 0; i < this.items.length; i++) {\n const node = this.items[i]\n callback(node, 'items[' + i + ']', this)\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map (callback) {\n const items = []\n for (let i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this))\n }\n return new ArrayNode(items)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone () {\n return new ArrayNode(this.items.slice(0))\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString (options) {\n const items = this.items.map(function (node) {\n return node.toString(options)\n })\n return '[' + items.join(', ') + ']'\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n items: this.items\n }\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON (json) {\n return new ArrayNode(json.items)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML (options) {\n const items = this.items.map(function (node) {\n return node.toHTML(options)\n })\n return '[' +\n items.join(',') +\n ']'\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n function itemsToTex (items, nested) {\n const mixedItems = items.some(isArrayNode) && !items.every(isArrayNode)\n const itemsFormRow = nested || mixedItems\n const itemSep = itemsFormRow ? '&' : '\\\\\\\\'\n const itemsTex = items\n .map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested)\n } else {\n return node.toTex(options)\n }\n })\n .join(itemSep)\n return mixedItems || !itemsFormRow || (itemsFormRow && !nested)\n ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}'\n : itemsTex\n }\n return itemsToTex(this.items, false)\n }\n }\n\n return ArrayNode\n}, { isClass: true, isNode: true })\n","// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js'\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js'\n\nexport const properties = [\n { // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n },\n { // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n },\n { // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n\n },\n { // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n },\n { // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // range\n RangeNode: {}\n },\n { // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: [\n 'OperatorNode:multiply',\n 'OperatorNode:divide',\n 'Operator:dotMultiply',\n 'Operator:dotDivide'\n ]\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: [\n 'OperatorNode:multiply',\n 'OperatorNode:divide',\n 'OperatorNode:dotMultiply',\n 'OperatorNode:doDivide'\n ]\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n },\n { // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: [\n 'OperatorNode:multiply',\n 'OperatorNode:divide',\n 'Operator:dotMultiply',\n 'Operator:dotDivide'\n ]\n }\n },\n { // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n },\n { // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n },\n { // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n },\n { // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n }\n]\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen (_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node\n let node = _node\n while (isParenthesisNode(node)) node = node.content\n return node\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence (_node, parenthesis, implicit, parent) {\n let node = _node\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent()\n }\n const identifier = node.getIdentifier()\n let precedence = null\n for (let i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i\n break\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit &&\n implicit !== 'show') {\n const leftArg = unwrapParen(node.args[0], parenthesis)\n if (!(isConstantNode(leftArg) && parent &&\n parent.getIdentifier() === 'OperatorNode:divide' &&\n rule2Node(unwrapParen(parent.args[0], parenthesis))) &&\n !(leftArg.getIdentifier() === 'OperatorNode:divide' &&\n rule2Node(unwrapParen(leftArg.args[0], parenthesis)) &&\n isConstantNode(unwrapParen(leftArg.args[1])))\n ) {\n precedence += 1\n }\n }\n return precedence\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity (_node, parenthesis) {\n let node = _node\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent()\n }\n const identifier = node.getIdentifier()\n const index = getPrecedence(node, parenthesis)\n if (index === null) {\n // node isn't in the list\n return null\n }\n const property = properties[index][identifier]\n\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left'\n }\n if (property.associativity === 'right') {\n return 'right'\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' +\n property.associativity + '\\'.')\n }\n\n // associativity is undefined\n return null\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith (nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n const a = (parenthesis !== 'keep') ? nodeA.getContent() : nodeA\n const b = (parenthesis !== 'keep') ? nodeA.getContent() : nodeB\n const identifierA = a.getIdentifier()\n const identifierB = b.getIdentifier()\n const index = getPrecedence(a, parenthesis)\n if (index === null) {\n // node isn't in the list\n return null\n }\n const property = properties[index][identifierA]\n\n if (hasOwnProperty(property, 'associativeWith') &&\n (property.associativeWith instanceof Array)) {\n for (let i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true\n }\n }\n return false\n }\n\n // associativeWith is not defined\n return null\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator (fn) {\n const identifier = 'OperatorNode:' + fn\n for (const group of properties) {\n if (identifier in group) {\n return group[identifier].op\n }\n }\n return null\n}\n","import { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js'\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { accessFactory } from './utils/access.js'\nimport { assignFactory } from './utils/assign.js'\nimport { getPrecedence } from '../operators.js'\n\nconst name = 'AssignmentNode'\nconst dependencies = [\n 'subset',\n '?matrix', // FIXME: should not be needed at all, should be handled by subset\n 'Node'\n]\n\nexport const createAssignmentNode = /* #__PURE__ */ factory(name, dependencies, ({ subset, matrix, Node }) => {\n const access = accessFactory({ subset })\n const assign = assignFactory({ subset, matrix })\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis (node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep'\n }\n\n const precedence = getPrecedence(node, parenthesis, implicit)\n const exprPrecedence = getPrecedence(node.value, parenthesis, implicit)\n return (parenthesis === 'all') ||\n ((exprPrecedence !== null) && (exprPrecedence <= precedence))\n }\n\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor (object, index, value) {\n super()\n this.object = object\n this.index = value ? index : null\n this.value = value || index\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"')\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"')\n }\n if (this.index && !isIndexNode(this.index)) { // index is optional\n throw new TypeError('IndexNode expected as \"index\"')\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"')\n }\n }\n\n // class name for typing purposes:\n static name = name\n\n // readonly property name\n get name () {\n if (this.index) {\n return (this.index.isObjectProperty())\n ? this.index.getObjectProperty()\n : ''\n } else {\n return this.object.name || ''\n }\n }\n\n get type () { return name }\n get isAssignmentNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalObject = this.object._compile(math, argNames)\n const evalIndex = this.index ? this.index._compile(math, argNames) : null\n const evalValue = this.value._compile(math, argNames)\n const name = this.object.name\n\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object')\n }\n\n return function evalAssignmentNode (scope, args, context) {\n const value = evalValue(scope, args, context)\n scope.set(name, value)\n return value\n }\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n const prop = this.index.getObjectProperty()\n\n return function evalAssignmentNode (scope, args, context) {\n const object = evalObject(scope, args, context)\n const value = evalValue(scope, args, context)\n setSafeProperty(object, prop, value)\n return value\n }\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode (scope, args, context) {\n const childObject = evalObject(scope, args, context)\n const value = evalValue(scope, args, context)\n // Important: we pass childObject instead of context:\n const index = evalIndex(scope, args, childObject)\n scope.set(name, assign(childObject, index, value))\n return value\n }\n } else { // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n const evalParentObject = this.object.object._compile(math, argNames)\n\n if (this.object.index.isObjectProperty()) {\n const parentProp = this.object.index.getObjectProperty()\n\n return function evalAssignmentNode (scope, args, context) {\n const parent = evalParentObject(scope, args, context)\n const childObject = getSafeProperty(parent, parentProp)\n // Important: we pass childObject instead of context:\n const index = evalIndex(scope, args, childObject)\n const value = evalValue(scope, args, context)\n setSafeProperty(\n parent, parentProp, assign(childObject, index, value))\n return value\n }\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n const evalParentIndex = this.object.index._compile(math, argNames)\n\n return function evalAssignmentNode (scope, args, context) {\n const parent = evalParentObject(scope, args, context)\n // Important: we pass parent instead of context:\n const parentIndex = evalParentIndex(scope, args, parent)\n const childObject = access(parent, parentIndex)\n // Important: we pass childObject instead of context\n const index = evalIndex(scope, args, childObject)\n const value = evalValue(scope, args, context)\n\n assign(parent, parentIndex, assign(childObject, index, value))\n\n return value\n }\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.object, 'object', this)\n if (this.index) {\n callback(this.index, 'index', this)\n }\n callback(this.value, 'value', this)\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map (callback) {\n const object = this._ifNode(callback(this.object, 'object', this))\n const index = this.index\n ? this._ifNode(callback(this.index, 'index', this))\n : null\n const value = this._ifNode(callback(this.value, 'value', this))\n\n return new AssignmentNode(object, index, value)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone () {\n return new AssignmentNode(this.object, this.index, this.value)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString (options) {\n const object = this.object.toString(options)\n const index = this.index ? this.index.toString(options) : ''\n let value = this.value.toString(options)\n if (needParenthesis(\n this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')'\n }\n\n return object + index + ' = ' + value\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n }\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON (json) {\n return new AssignmentNode(json.object, json.index, json.value)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML (options) {\n const object = this.object.toHTML(options)\n const index = this.index ? this.index.toHTML(options) : ''\n let value = this.value.toHTML(options)\n if (needParenthesis(\n this, options && options.parenthesis, options && options.implicit)) {\n value = '(' +\n value +\n ')'\n }\n\n return object + index +\n '=' +\n value\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex (options) {\n const object = this.object.toTex(options)\n const index = this.index ? this.index.toTex(options) : ''\n let value = this.value.toTex(options)\n if (needParenthesis(\n this, options && options.parenthesis, options && options.implicit)) {\n value = `\\\\left(${value}\\\\right)`\n }\n\n return object + index + '=' + value\n }\n }\n\n return AssignmentNode\n}, { isClass: true, isNode: true })\n","import { errorTransform } from '../../transform/utils/errorTransform.js'\nimport { setSafeProperty } from '../../../utils/customs.js'\n\nexport function assignFactory ({ subset, matrix }) {\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign (object, index, value) {\n try {\n if (Array.isArray(object)) {\n const result = matrix(object).subset(index, value).valueOf()\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item\n })\n\n return object\n } else if (object && typeof object.subset === 'function') { // Matrix\n return object.subset(index, value)\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value)\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property')\n }\n setSafeProperty(object, index.getObjectProperty(), value)\n return object\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object')\n }\n } catch (err) {\n throw errorTransform(err)\n }\n }\n}\n","import { isNode } from '../../utils/is.js'\nimport { forEach, map } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'BlockNode'\nconst dependencies = [\n 'ResultSet',\n 'Node'\n]\n\nexport const createBlockNode = /* #__PURE__ */ factory(name, dependencies, ({ ResultSet, Node }) => {\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor (blocks) {\n super()\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected')\n this.blocks = blocks.map(function (block) {\n const node = block && block.node\n const visible = block &&\n block.visible !== undefined\n ? block.visible\n : true\n\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node')\n if (typeof visible !== 'boolean') { throw new TypeError('Property \"visible\" must be a boolean') }\n\n return { node, visible }\n })\n }\n\n static name = name\n get type () { return name }\n get isBlockNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n }\n })\n\n return function evalBlockNodes (scope, args, context) {\n const results = []\n\n forEach(evalBlocks, function evalBlockNode (block) {\n const result = block.evaluate(scope, args, context)\n if (block.visible) {\n results.push(result)\n }\n })\n\n return new ResultSet(results)\n }\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (let i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this)\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map (callback) {\n const blocks = []\n for (let i = 0; i < this.blocks.length; i++) {\n const block = this.blocks[i]\n const node = this._ifNode(\n callback(block.node, 'blocks[' + i + '].node', this))\n blocks[i] = {\n node,\n visible: block.visible\n }\n }\n return new BlockNode(blocks)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone () {\n const blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n }\n })\n\n return new BlockNode(blocks)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString (options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';')\n }).join('\\n')\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n blocks: this.blocks\n }\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON (json) {\n return new BlockNode(json.blocks)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML (options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) +\n (param.visible ? '' : ';')\n }).join('
    ')\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';')\n }).join('\\\\;\\\\;\\n')\n }\n }\n\n return BlockNode\n}, { isClass: true, isNode: true })\n","import { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { getPrecedence } from '../operators.js'\n\nconst name = 'ConditionalNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createConditionalNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition (condition) {\n if (typeof condition === 'number' ||\n typeof condition === 'boolean' ||\n typeof condition === 'string') {\n return !!condition\n }\n\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero()\n }\n\n if (isComplex(condition)) {\n return !!((condition.re || condition.im))\n }\n\n if (isUnit(condition)) {\n return !!condition.value\n }\n }\n\n if (condition === null || condition === undefined) {\n return false\n }\n\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"')\n }\n\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor (condition, trueExpr, falseExpr) {\n super()\n if (!isNode(condition)) { throw new TypeError('Parameter condition must be a Node') }\n if (!isNode(trueExpr)) { throw new TypeError('Parameter trueExpr must be a Node') }\n if (!isNode(falseExpr)) { throw new TypeError('Parameter falseExpr must be a Node') }\n\n this.condition = condition\n this.trueExpr = trueExpr\n this.falseExpr = falseExpr\n }\n\n static name = name\n get type () { return name }\n get isConditionalNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalCondition = this.condition._compile(math, argNames)\n const evalTrueExpr = this.trueExpr._compile(math, argNames)\n const evalFalseExpr = this.falseExpr._compile(math, argNames)\n\n return function evalConditionalNode (scope, args, context) {\n return testCondition(evalCondition(scope, args, context))\n ? evalTrueExpr(scope, args, context)\n : evalFalseExpr(scope, args, context)\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.condition, 'condition', this)\n callback(this.trueExpr, 'trueExpr', this)\n callback(this.falseExpr, 'falseExpr', this)\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map (callback) {\n return new ConditionalNode(\n this._ifNode(callback(this.condition, 'condition', this)),\n this._ifNode(callback(this.trueExpr, 'trueExpr', this)),\n this._ifNode(callback(this.falseExpr, 'falseExpr', this))\n )\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone () {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n let condition = this.condition.toString(options)\n const conditionPrecedence =\n getPrecedence(this.condition, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.condition.type === 'OperatorNode') ||\n ((conditionPrecedence !== null) &&\n (conditionPrecedence <= precedence))) {\n condition = '(' + condition + ')'\n }\n\n let trueExpr = this.trueExpr.toString(options)\n const truePrecedence =\n getPrecedence(this.trueExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.trueExpr.type === 'OperatorNode') ||\n ((truePrecedence !== null) && (truePrecedence <= precedence))) {\n trueExpr = '(' + trueExpr + ')'\n }\n\n let falseExpr = this.falseExpr.toString(options)\n const falsePrecedence =\n getPrecedence(this.falseExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.falseExpr.type === 'OperatorNode') ||\n ((falsePrecedence !== null) && (falsePrecedence <= precedence))) {\n falseExpr = '(' + falseExpr + ')'\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n }\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON (json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n let condition = this.condition.toHTML(options)\n const conditionPrecedence =\n getPrecedence(this.condition, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.condition.type === 'OperatorNode') ||\n ((conditionPrecedence !== null) &&\n (conditionPrecedence <= precedence))) {\n condition =\n '(' +\n condition +\n ')'\n }\n\n let trueExpr = this.trueExpr.toHTML(options)\n const truePrecedence =\n getPrecedence(this.trueExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.trueExpr.type === 'OperatorNode') ||\n ((truePrecedence !== null) && (truePrecedence <= precedence))) {\n trueExpr =\n '(' +\n trueExpr +\n ')'\n }\n\n let falseExpr = this.falseExpr.toHTML(options)\n const falsePrecedence =\n getPrecedence(this.falseExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.falseExpr.type === 'OperatorNode') ||\n ((falsePrecedence !== null) && (falsePrecedence <= precedence))) {\n falseExpr =\n '(' +\n falseExpr +\n ')'\n }\n return condition +\n '?' +\n trueExpr +\n ':' +\n falseExpr\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n return '\\\\begin{cases} {' +\n this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' +\n this.condition.toTex(options) +\n '}\\\\\\\\{' + this.falseExpr.toTex(options) +\n '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}'\n }\n }\n\n return ConditionalNode\n}, { isClass: true, isNode: true })\n","/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex'\nimport { hasOwnProperty } from './object.js'\n\nexport const latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i', // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n}\n\nexport const latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge', // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~', // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac', // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot', // TODO find ideal solution\n dotDivide: '.:', // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n}\n\nexport const latexFunctions = {\n // arithmetic\n abs: { 1: '\\\\left|${args[0]}\\\\right|' },\n add: { 2: `\\\\left(\\${args[0]}${latexOperators.add}\\${args[1]}\\\\right)` },\n cbrt: { 1: '\\\\sqrt[3]{${args[0]}}' },\n ceil: { 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil' },\n cube: { 1: '\\\\left(${args[0]}\\\\right)^3' },\n divide: { 2: '\\\\frac{${args[0]}}{${args[1]}}' },\n dotDivide: { 2: `\\\\left(\\${args[0]}${latexOperators.dotDivide}\\${args[1]}\\\\right)` },\n dotMultiply: { 2: `\\\\left(\\${args[0]}${latexOperators.dotMultiply}\\${args[1]}\\\\right)` },\n dotPow: { 2: `\\\\left(\\${args[0]}${latexOperators.dotPow}\\${args[1]}\\\\right)` },\n exp: { 1: '\\\\exp\\\\left(${args[0]}\\\\right)' },\n expm1: `\\\\left(e${latexOperators.pow}{\\${args[0]}}-1\\\\right)`,\n fix: { 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)' },\n floor: { 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor' },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: { 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)' },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: { 2: `\\\\left(\\${args[0]}${latexOperators.mod}\\${args[1]}\\\\right)` },\n multiply: { 2: `\\\\left(\\${args[0]}${latexOperators.multiply}\\${args[1]}\\\\right)` },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: { 2: '\\\\sqrt[${args[1]}]{${args[0]}}' },\n nthRoots: { 2: '\\\\{y : $y^{args[1]} = {${args[0]}}\\\\}' },\n pow: { 2: `\\\\left(\\${args[0]}\\\\right)${latexOperators.pow}{\\${args[1]}}` },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: { 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)' },\n sqrt: { 1: '\\\\sqrt{${args[0]}}' },\n square: { 1: '\\\\left(${args[0]}\\\\right)^2' },\n subtract: { 2: `\\\\left(\\${args[0]}${latexOperators.subtract}\\${args[1]}\\\\right)` },\n unaryMinus: { 1: `${latexOperators.unaryMinus}\\\\left(\\${args[0]}\\\\right)` },\n unaryPlus: { 1: `${latexOperators.unaryPlus}\\\\left(\\${args[0]}\\\\right)` },\n\n // bitwise\n bitAnd: { 2: `\\\\left(\\${args[0]}${latexOperators.bitAnd}\\${args[1]}\\\\right)` },\n bitNot: { 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)' },\n bitOr: { 2: `\\\\left(\\${args[0]}${latexOperators.bitOr}\\${args[1]}\\\\right)` },\n bitXor: { 2: `\\\\left(\\${args[0]}${latexOperators.bitXor}\\${args[1]}\\\\right)` },\n leftShift: { 2: `\\\\left(\\${args[0]}${latexOperators.leftShift}\\${args[1]}\\\\right)` },\n rightArithShift: { 2: `\\\\left(\\${args[0]}${latexOperators.rightArithShift}\\${args[1]}\\\\right)` },\n rightLogShift: { 2: `\\\\left(\\${args[0]}${latexOperators.rightLogShift}\\${args[1]}\\\\right)` },\n\n // combinatorics\n bellNumbers: { 1: '\\\\mathrm{B}_{${args[0]}}' },\n catalan: { 1: '\\\\mathrm{C}_{${args[0]}}' },\n stirlingS2: { 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)' },\n\n // complex\n arg: { 1: '\\\\arg\\\\left(${args[0]}\\\\right)' },\n conj: { 1: '\\\\left(${args[0]}\\\\right)^*' },\n im: { 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace' },\n re: { 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace' },\n\n // logical\n and: { 2: `\\\\left(\\${args[0]}${latexOperators.and}\\${args[1]}\\\\right)` },\n not: { 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)' },\n or: { 2: `\\\\left(\\${args[0]}${latexOperators.or}\\${args[1]}\\\\right)` },\n xor: { 2: `\\\\left(\\${args[0]}${latexOperators.xor}\\${args[1]}\\\\right)` },\n\n // matrix\n cross: { 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)' },\n ctranspose: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.ctranspose}` },\n det: { 1: '\\\\det\\\\left(${args[0]}\\\\right)' },\n dot: { 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)' },\n expm: { 1: '\\\\exp\\\\left(${args[0]}\\\\right)' },\n inv: { 1: '\\\\left(${args[0]}\\\\right)^{-1}' },\n pinv: { 1: '\\\\left(${args[0]}\\\\right)^{+}' },\n sqrtm: { 1: `{\\${args[0]}}${latexOperators.pow}{\\\\frac{1}{2}}` },\n trace: { 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)' },\n transpose: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.transpose}` },\n\n // probability\n combinations: { 2: '\\\\binom{${args[0]}}{${args[1]}}' },\n combinationsWithRep: { 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)' },\n factorial: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.factorial}` },\n gamma: { 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)' },\n lgamma: { 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)' },\n\n // relational\n equal: { 2: `\\\\left(\\${args[0]}${latexOperators.equal}\\${args[1]}\\\\right)` },\n larger: { 2: `\\\\left(\\${args[0]}${latexOperators.larger}\\${args[1]}\\\\right)` },\n largerEq: { 2: `\\\\left(\\${args[0]}${latexOperators.largerEq}\\${args[1]}\\\\right)` },\n smaller: { 2: `\\\\left(\\${args[0]}${latexOperators.smaller}\\${args[1]}\\\\right)` },\n smallerEq: { 2: `\\\\left(\\${args[0]}${latexOperators.smallerEq}\\${args[1]}\\\\right)` },\n unequal: { 2: `\\\\left(\\${args[0]}${latexOperators.unequal}\\${args[1]}\\\\right)` },\n\n // special\n erf: { 1: 'erf\\\\left(${args[0]}\\\\right)' },\n\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n\n // trigonometry\n acos: { 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)' },\n acosh: { 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)' },\n acot: { 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)' },\n acoth: { 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)' },\n acsc: { 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)' },\n acsch: { 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)' },\n asec: { 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)' },\n asech: { 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)' },\n asin: { 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)' },\n asinh: { 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)' },\n atan: { 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)' },\n atan2: { 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)' },\n atanh: { 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)' },\n cos: { 1: '\\\\cos\\\\left(${args[0]}\\\\right)' },\n cosh: { 1: '\\\\cosh\\\\left(${args[0]}\\\\right)' },\n cot: { 1: '\\\\cot\\\\left(${args[0]}\\\\right)' },\n coth: { 1: '\\\\coth\\\\left(${args[0]}\\\\right)' },\n csc: { 1: '\\\\csc\\\\left(${args[0]}\\\\right)' },\n csch: { 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)' },\n sec: { 1: '\\\\sec\\\\left(${args[0]}\\\\right)' },\n sech: { 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)' },\n sin: { 1: '\\\\sin\\\\left(${args[0]}\\\\right)' },\n sinh: { 1: '\\\\sinh\\\\left(${args[0]}\\\\right)' },\n tan: { 1: '\\\\tan\\\\left(${args[0]}\\\\right)' },\n tanh: { 1: '\\\\tanh\\\\left(${args[0]}\\\\right)' },\n\n // unit\n to: { 2: `\\\\left(\\${args[0]}${latexOperators.to}\\${args[1]}\\\\right)` },\n\n // utils\n numeric: function (node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex()\n },\n\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: `\\\\left(\\\\left(\\${args[0]}\\\\right)+${latexSymbols.i}\\\\cdot\\\\left(\\${args[1]}\\\\right)\\\\right)`\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n\n}\n\nexport const defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)'\n\nconst latexUnits = {\n deg: '^\\\\circ'\n}\n\nexport function escapeLatex (string) {\n return escapeLatexLib(string, { preserveFormatting: true })\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol (name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name]\n }\n\n return '\\\\mathrm{' + escapeLatex(name) + '}'\n }\n\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name]\n }\n\n return escapeLatex(name)\n}\n","import { format } from '../../utils/string.js'\nimport { typeOf } from '../../utils/is.js'\nimport { escapeLatex } from '../../utils/latex.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ConstantNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createConstantNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor (value) {\n super()\n this.value = value\n }\n\n static name = name\n get type () { return name }\n get isConstantNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const value = this.value\n\n return function evalConstantNode () {\n return value\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map (callback) {\n return this.clone()\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone () {\n return new ConstantNode(this.value)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n return format(this.value, options)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const value = this._toString(options)\n\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + ''\n case 'string':\n return '' + value + ''\n case 'boolean':\n return '' + value + ''\n case 'null':\n return '' + value + ''\n case 'undefined':\n return '' + value + ''\n\n default:\n return '' + value + ''\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return { mathjs: name, value: this.value }\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON (json) {\n return new ConstantNode(json.value)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const value = this._toString(options)\n const type = typeOf(this.value)\n\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}'\n\n case 'number':\n case 'BigNumber': {\n const finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value)\n if (!finite) {\n return (this.value.valueOf() < 0)\n ? '-\\\\infty'\n : '\\\\infty'\n }\n\n const index = value.toLowerCase().indexOf('e')\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' +\n value.substring(index + 1) + '}'\n }\n\n return value\n }\n\n case 'bigint': {\n return value.toString()\n }\n\n case 'Fraction':\n return this.value.toLatex()\n\n default:\n return value\n }\n }\n }\n\n return ConstantNode\n}, { isClass: true, isNode: true })\n","import { isNode } from '../../utils/is.js'\n\nimport { keywords } from '../keywords.js'\nimport { escape } from '../../utils/string.js'\nimport { forEach, join } from '../../utils/array.js'\nimport { toSymbol } from '../../utils/latex.js'\nimport { getPrecedence } from '../operators.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'FunctionAssignmentNode'\nconst dependencies = [\n 'typed',\n 'Node'\n]\n\nexport const createFunctionAssignmentNode = /* #__PURE__ */ factory(name, dependencies, ({ typed, Node }) => {\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis (node, parenthesis, implicit) {\n const precedence = getPrecedence(node, parenthesis, implicit)\n const exprPrecedence = getPrecedence(node.expr, parenthesis, implicit)\n\n return (parenthesis === 'all') ||\n ((exprPrecedence !== null) && (exprPrecedence <= precedence))\n }\n\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor (name, params, expr) {\n super()\n // validate input\n if (typeof name !== 'string') { throw new TypeError('String expected for parameter \"name\"') }\n if (!Array.isArray(params)) {\n throw new TypeError(\n 'Array containing strings or objects expected for parameter \"params\"')\n }\n if (!isNode(expr)) { throw new TypeError('Node expected for parameter \"expr\"') }\n if (keywords.has(name)) { throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword') }\n\n const paramNames = new Set()\n for (const param of params) {\n const name = typeof param === 'string' ? param : param.name\n if (paramNames.has(name)) {\n throw new Error(`Duplicate parameter name \"${name}\"`)\n } else {\n paramNames.add(name)\n }\n }\n\n this.name = name\n this.params = params.map(function (param) {\n return (param && param.name) || param\n })\n this.types = params.map(function (param) {\n return (param && param.type) || 'any'\n })\n this.expr = expr\n }\n\n static name = name\n get type () { return name }\n get isFunctionAssignmentNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const childArgNames = Object.create(argNames)\n forEach(this.params, function (param) {\n childArgNames[param] = true\n })\n\n // compile the function expression with the child args\n const evalExpr = this.expr._compile(math, childArgNames)\n const name = this.name\n const params = this.params\n const signature = join(this.types, ',')\n const syntax = name + '(' + join(this.params, ', ') + ')'\n\n return function evalFunctionAssignmentNode (scope, args, context) {\n const signatures = {}\n signatures[signature] = function () {\n const childArgs = Object.create(args)\n\n for (let i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i]\n }\n\n return evalExpr(scope, childArgs, context)\n }\n const fn = typed(name, signatures)\n fn.syntax = syntax\n\n scope.set(name, fn)\n\n return fn\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.expr, 'expr', this)\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map (callback) {\n const expr = this._ifNode(callback(this.expr, 'expr', this))\n\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone () {\n return new FunctionAssignmentNode(\n this.name, this.params.slice(0), this.expr)\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n let expr = this.expr.toString(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')'\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n const types = this.types\n\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n }\n }),\n expr: this.expr\n }\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON (json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr)\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis = (options && options.parenthesis) ? options.parenthesis : 'keep'\n const params = []\n for (let i = 0; i < this.params.length; i++) {\n params.push('' +\n escape(this.params[i]) + '')\n }\n let expr = this.expr.toHTML(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' +\n expr +\n ')'\n }\n return '' +\n escape(this.name) + '' +\n '(' +\n params.join(',') +\n ')' +\n '=' +\n expr\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n let expr = this.expr.toTex(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = `\\\\left(${expr}\\\\right)`\n }\n\n return '\\\\mathrm{' + this.name +\n '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr\n }\n }\n\n return FunctionAssignmentNode\n}, { isClass: true, isNode: true })\n","import { map } from '../../utils/array.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js'\nimport { escape } from '../../utils/string.js'\n\nconst name = 'IndexNode'\nconst dependencies = [\n 'Node',\n 'size'\n]\n\nexport const createIndexNode = /* #__PURE__ */ factory(name, dependencies, ({ Node, size }) => {\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor (dimensions, dotNotation) {\n super()\n this.dimensions = dimensions\n this.dotNotation = dotNotation || false\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError(\n 'Array containing Nodes expected for parameter \"dimensions\"')\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties')\n }\n }\n\n static name = name\n get type () { return name }\n get isIndexNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n const evalDimensions = map(this.dimensions, function (dimension, i) {\n const needsEnd = dimension\n .filter(node => node.isSymbolNode && node.name === 'end')\n .length > 0\n\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n const childArgNames = Object.create(argNames)\n childArgNames.end = true\n\n const _evalDimension = dimension._compile(math, childArgNames)\n\n return function evalDimension (scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError(\n 'Cannot resolve \"end\": ' +\n 'context must be a Matrix, Array, or string but is ' +\n typeOf(context))\n }\n\n const s = size(context).valueOf()\n const childArgs = Object.create(args)\n childArgs.end = s[i]\n\n return _evalDimension(scope, childArgs, context)\n }\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames)\n }\n })\n\n const index = getSafeProperty(math, 'index')\n\n return function evalIndexNode (scope, args, context) {\n const dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context)\n })\n\n return index(...dimensions)\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (let i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this)\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map (callback) {\n const dimensions = []\n for (let i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(\n callback(this.dimensions[i], 'dimensions[' + i + ']', this))\n }\n\n return new IndexNode(dimensions, this.dotNotation)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone () {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation)\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty () {\n return this.dimensions.length === 1 &&\n isConstantNode(this.dimensions[0]) &&\n typeof this.dimensions[0].value === 'string'\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty () {\n return this.isObjectProperty() ? this.dimensions[0].value : null\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation\n ? ('.' + this.getObjectProperty())\n : ('[' + this.dimensions.join(', ') + ']')\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n }\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON (json) {\n return new IndexNode(json.dimensions, json.dotNotation)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n // format the parameters like \"[1, 0:5]\"\n const dimensions = []\n for (let i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML()\n }\n if (this.dotNotation) {\n return '.' +\n '' +\n escape(this.getObjectProperty()) + ''\n } else {\n return '[' +\n dimensions.join(',') +\n ']'\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const dimensions = this.dimensions.map(function (range) {\n return range.toTex(options)\n })\n\n return this.dotNotation\n ? ('.' + this.getObjectProperty() + '')\n : ('_{' + dimensions.join(',') + '}')\n }\n }\n\n return IndexNode\n}, { isClass: true, isNode: true })\n","import { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { isNode } from '../../utils/is.js'\nimport { hasOwnProperty } from '../../utils/object.js'\nimport { escape, stringify } from '../../utils/string.js'\n\nconst name = 'ObjectNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.} [properties] object with key/value pairs\n */\n constructor (properties) {\n super()\n this.properties = properties || {}\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') ||\n !Object.keys(properties).every(function (key) {\n return isNode(properties[key])\n })) {\n throw new TypeError('Object containing Nodes expected')\n }\n }\n }\n\n static name = name\n get type () { return name }\n get isObjectNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalEntries = {}\n\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n const stringifiedKey = stringify(key)\n const parsedKey = JSON.parse(stringifiedKey)\n const prop = getSafeProperty(this.properties, key)\n\n evalEntries[parsedKey] = prop._compile(math, argNames)\n }\n }\n\n return function evalObjectNode (scope, args, context) {\n const obj = {}\n\n for (const key in evalEntries) {\n if (hasOwnProperty(evalEntries, key)) {\n obj[key] = evalEntries[key](scope, args, context)\n }\n }\n\n return obj\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(\n this.properties[key], 'properties[' + stringify(key) + ']', this)\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map (callback) {\n const properties = {}\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(\n callback(\n this.properties[key], 'properties[' + stringify(key) + ']', this))\n }\n }\n return new ObjectNode(properties)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone () {\n const properties = {}\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key]\n }\n }\n return new ObjectNode(properties)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString (options) {\n const entries = []\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(\n stringify(key) + ': ' + this.properties[key].toString(options))\n }\n }\n return '{' + entries.join(', ') + '}'\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n properties: this.properties\n }\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON (json) {\n return new ObjectNode(json.properties)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML (options) {\n const entries = []\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(\n '' + escape(key) + '' +\n '' +\n ':' + this.properties[key].toHTML(options))\n }\n }\n return '{' +\n entries.join(',') +\n '}'\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const entries = []\n for (const key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(\n '\\\\mathbf{' + key + ':} & ' +\n this.properties[key].toTex(options) + '\\\\\\\\')\n }\n }\n const tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') +\n '\\\\end{array}\\\\right\\\\}'\n return tex\n }\n }\n\n return ObjectNode\n}, { isClass: true, isNode: true })\n","import { ObjectWrappingMap, PartitionedMap } from './map.js'\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope (parentScope, args) {\n return new PartitionedMap(\n parentScope,\n new ObjectWrappingMap(args),\n new Set(Object.keys(args))\n )\n}\n","import { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js'\nimport { map } from '../../utils/array.js'\nimport { createSubScope } from '../../utils/scope.js'\nimport { escape } from '../../utils/string.js'\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js'\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js'\nimport { latexOperators } from '../../utils/latex.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'OperatorNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createOperatorNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant (expr, parenthesis) {\n let curNode = expr\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content\n }\n if (isConstantNode(curNode)) return true\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis)\n }\n return false\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses (root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n const precedence = getPrecedence(root, parenthesis, implicit)\n const associativity = getAssociativity(root, parenthesis)\n\n if ((parenthesis === 'all') || ((args.length > 2) && (root.getIdentifier() !== 'OperatorNode:add') && (root.getIdentifier() !== 'OperatorNode:multiply'))) {\n return args.map(function (arg) {\n switch (arg.getContent().type) { // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false\n default:\n return true\n }\n })\n }\n\n let result\n switch (args.length) {\n case 0:\n result = []\n break\n\n case 1: // unary operators\n {\n // precedence of the operand\n const operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root)\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && (operandPrecedence !== null)) {\n let operandIdentifier\n let rootIdentifier\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier()\n rootIdentifier = root.getIdentifier()\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier()\n rootIdentifier = root.getContent().getIdentifier()\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false]\n break\n }\n\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false]\n break\n }\n }\n\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false]\n break\n }\n\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true]\n break\n }\n\n // otherwise, no parens needed\n result = [false]\n }\n break\n case 2: // binary operators\n {\n let lhsParens // left hand side needs parenthesis?\n // precedence of the left hand side\n const lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root)\n // is the root node associative with the left hand side\n const assocWithLhs = isAssociativeWith(root, args[0], parenthesis)\n\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false\n } else if ((lhsPrecedence === precedence) && (associativity === 'right') && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true\n } else if (lhsPrecedence < precedence) {\n lhsParens = true\n } else {\n lhsParens = false\n }\n\n let rhsParens // right hand side needs parenthesis?\n // precedence of the right hand side\n const rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root)\n // is the root node associative with the right hand side?\n const assocWithRhs = isAssociativeWith(root, args[1], parenthesis)\n\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false\n } else if ((rhsPrecedence === precedence) && (associativity === 'left') && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true\n } else if (rhsPrecedence < precedence) {\n rhsParens = true\n } else {\n rhsParens = false\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n let rootIdentifier\n let lhsIdentifier\n let rhsIdentifier\n if (parenthesis === 'keep') {\n rootIdentifier = root.getIdentifier()\n lhsIdentifier = root.args[0].getIdentifier()\n rhsIdentifier = root.args[1].getIdentifier()\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n rootIdentifier = root.getContent().getIdentifier()\n lhsIdentifier = root.args[0].getContent().getIdentifier()\n rhsIdentifier = root.args[1].getContent().getIdentifier()\n }\n\n if (lhsPrecedence !== null) {\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n lhsParens = false\n }\n\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false\n }\n }\n\n if (rhsPrecedence !== null) {\n if (properties[precedence][rootIdentifier].latexRightParens === false) {\n rhsParens = false\n }\n\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false\n }\n }\n }\n\n result = [lhsParens, rhsParens]\n }\n break\n\n default:\n if ((root.getIdentifier() === 'OperatorNode:add') || (root.getIdentifier() === 'OperatorNode:multiply')) {\n result = args.map(function (arg) {\n const argPrecedence = getPrecedence(arg, parenthesis, implicit, root)\n const assocWithArg = isAssociativeWith(root, arg, parenthesis)\n const argAssociativity = getAssociativity(arg, parenthesis)\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false\n } else if ((precedence === argPrecedence) && (associativity === argAssociativity) && !assocWithArg) {\n return true\n } else if (argPrecedence < precedence) {\n return true\n }\n\n return false\n })\n }\n break\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' &&\n root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (let i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] &&\n (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true\n }\n }\n }\n\n return result\n }\n\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor (op, fn, args, implicit, isPercentage) {\n super()\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"')\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"')\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError(\n 'Array containing Nodes expected for parameter \"args\"')\n }\n\n this.implicit = (implicit === true)\n this.isPercentage = (isPercentage === true)\n this.op = op\n this.fn = fn\n this.args = args || []\n }\n\n static name = name\n get type () { return name }\n get isOperatorNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error(\n 'Function ' + this.fn + ' missing in provided namespace \"math\"')\n } else {\n throw new Error('No access to function \"' + this.fn + '\"')\n }\n }\n\n const fn = getSafeProperty(math, this.fn)\n const evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames)\n })\n\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n const rawArgs = this.args\n return function evalOperatorNode (scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args))\n }\n } else if (evalArgs.length === 1) {\n const evalArg0 = evalArgs[0]\n return function evalOperatorNode (scope, args, context) {\n return fn(evalArg0(scope, args, context))\n }\n } else if (evalArgs.length === 2) {\n const evalArg0 = evalArgs[0]\n const evalArg1 = evalArgs[1]\n return function evalOperatorNode (scope, args, context) {\n return fn(\n evalArg0(scope, args, context),\n evalArg1(scope, args, context))\n }\n } else {\n return function evalOperatorNode (scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context)\n }))\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (let i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this)\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map (callback) {\n const args = []\n for (let i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this))\n }\n return new OperatorNode(\n this.op, this.fn, args, this.implicit, this.isPercentage)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone () {\n return new OperatorNode(\n this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage)\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary () {\n return this.args.length === 1\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary () {\n return this.args.length === 2\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const implicit = (options && options.implicit) ? options.implicit : 'hide'\n const args = this.args\n const parens =\n calculateNecessaryParentheses(this, parenthesis, implicit, args, false)\n\n if (args.length === 1) { // unary operators\n const assoc = getAssociativity(this, parenthesis)\n\n let operand = args[0].toString(options)\n if (parens[0]) {\n operand = '(' + operand + ')'\n }\n\n // for example for \"not\", we want a space between operand and argument\n const opIsNamed = /[a-zA-Z]+/.test(this.op)\n\n if (assoc === 'right') { // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand\n } else if (assoc === 'left') { // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op\n }\n\n // fall back to postfix\n return operand + this.op\n } else if (args.length === 2) {\n let lhs = args[0].toString(options) // left hand side\n let rhs = args[1].toString(options) // right hand side\n if (parens[0]) { // left hand side in parenthesis?\n lhs = '(' + lhs + ')'\n }\n if (parens[1]) { // right hand side in parenthesis?\n rhs = '(' + rhs + ')'\n }\n\n if (this.implicit &&\n (this.getIdentifier() === 'OperatorNode:multiply') &&\n (implicit === 'hide')) {\n return lhs + ' ' + rhs\n }\n\n return lhs + ' ' + this.op + ' ' + rhs\n } else if ((args.length > 2) &&\n ((this.getIdentifier() === 'OperatorNode:add') ||\n (this.getIdentifier() === 'OperatorNode:multiply'))) {\n const stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options)\n if (parens[index]) { // put in parenthesis?\n arg = '(' + arg + ')'\n }\n\n return arg\n })\n\n if (this.implicit &&\n (this.getIdentifier() === 'OperatorNode:multiply') &&\n (implicit === 'hide')) {\n return stringifiedArgs.join(' ')\n }\n\n return stringifiedArgs.join(' ' + this.op + ' ')\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')'\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n }\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON (json) {\n return new OperatorNode(\n json.op, json.fn, json.args, json.implicit, json.isPercentage)\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const implicit = (options && options.implicit) ? options.implicit : 'hide'\n const args = this.args\n const parens =\n calculateNecessaryParentheses(this, parenthesis, implicit, args, false)\n\n if (args.length === 1) { // unary operators\n const assoc = getAssociativity(this, parenthesis)\n\n let operand = args[0].toHTML(options)\n if (parens[0]) {\n operand =\n '(' +\n operand +\n ')'\n }\n\n if (assoc === 'right') { // prefix operator\n return '' + escape(this.op) + '' +\n operand\n } else { // postfix when assoc === 'left' or undefined\n return operand +\n '' + escape(this.op) + ''\n }\n } else if (args.length === 2) { // binary operatoes\n let lhs = args[0].toHTML(options) // left hand side\n let rhs = args[1].toHTML(options) // right hand side\n if (parens[0]) { // left hand side in parenthesis?\n lhs = '(' +\n lhs +\n ')'\n }\n if (parens[1]) { // right hand side in parenthesis?\n rhs = '(' +\n rhs +\n ')'\n }\n\n if (this.implicit &&\n (this.getIdentifier() === 'OperatorNode:multiply') &&\n (implicit === 'hide')) {\n return lhs +\n '' + rhs\n }\n\n return lhs +\n '' + escape(this.op) + '' +\n rhs\n } else {\n const stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options)\n if (parens[index]) { // put in parenthesis?\n arg =\n '(' +\n arg +\n ')'\n }\n\n return arg\n })\n\n if ((args.length > 2) &&\n ((this.getIdentifier() === 'OperatorNode:add') ||\n (this.getIdentifier() === 'OperatorNode:multiply'))) {\n if (this.implicit &&\n (this.getIdentifier() === 'OperatorNode:multiply') &&\n (implicit === 'hide')) {\n return stringifiedArgs.join(\n '')\n }\n\n return stringifiedArgs.join(\n '' + escape(this.op) + '')\n } else {\n // fallback to formatting as a function call\n return '' + escape(this.fn) +\n '' +\n '(' +\n stringifiedArgs.join(',') +\n ')'\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const implicit = (options && options.implicit) ? options.implicit : 'hide'\n const args = this.args\n const parens =\n calculateNecessaryParentheses(this, parenthesis, implicit, args, true)\n\n let op = latexOperators[this.fn]\n op = typeof op === 'undefined' ? this.op : op // fall back to using this.op\n\n if (args.length === 1) { // unary operators\n const assoc = getAssociativity(this, parenthesis)\n\n let operand = args[0].toTex(options)\n if (parens[0]) {\n operand = `\\\\left(${operand}\\\\right)`\n }\n\n if (assoc === 'right') { // prefix operator\n return op + operand\n } else if (assoc === 'left') { // postfix operator\n return operand + op\n }\n\n // fall back to postfix\n return operand + op\n } else if (args.length === 2) { // binary operators\n const lhs = args[0] // left hand side\n let lhsTex = lhs.toTex(options)\n if (parens[0]) {\n lhsTex = `\\\\left(${lhsTex}\\\\right)`\n }\n\n const rhs = args[1] // right hand side\n let rhsTex = rhs.toTex(options)\n if (parens[1]) {\n rhsTex = `\\\\left(${rhsTex}\\\\right)`\n }\n\n // handle some exceptions (due to the way LaTeX works)\n let lhsIdentifier\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier()\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier()\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}'\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}'\n rhsTex = '{' + rhsTex + '}'\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = `\\\\left(${lhsTex}\\\\right)`\n }\n break\n case 'OperatorNode:multiply':\n if (this.implicit && (implicit === 'hide')) {\n return lhsTex + '~' + rhsTex\n }\n }\n return lhsTex + op + rhsTex\n } else if ((args.length > 2) &&\n ((this.getIdentifier() === 'OperatorNode:add') ||\n (this.getIdentifier() === 'OperatorNode:multiply'))) {\n const texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options)\n if (parens[index]) {\n arg = `\\\\left(${arg}\\\\right)`\n }\n return arg\n })\n\n if ((this.getIdentifier() === 'OperatorNode:multiply') &&\n this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~')\n }\n\n return texifiedArgs.join(op)\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' +\n args.map(function (arg) {\n return arg.toTex(options)\n }).join(',') + '\\\\right)'\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier () {\n return this.type + ':' + this.fn\n }\n }\n\n return OperatorNode\n}, { isClass: true, isNode: true })\n","import { isNode } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ParenthesisNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createParenthesisNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor (content) {\n super()\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"')\n }\n\n this.content = content\n }\n\n static name = name\n get type () { return name }\n get isParenthesisNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n return this.content._compile(math, argNames)\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent () {\n return this.content.getContent()\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.content, 'content', this)\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map (callback) {\n const content = callback(this.content, 'content', this)\n return new ParenthesisNode(content)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone () {\n return new ParenthesisNode(this.content)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString (options) {\n if ((!options) ||\n (options && !options.parenthesis) ||\n (options && options.parenthesis === 'keep')) {\n return '(' + this.content.toString(options) + ')'\n }\n return this.content.toString(options)\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return { mathjs: name, content: this.content }\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON (json) {\n return new ParenthesisNode(json.content)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML (options) {\n if ((!options) ||\n (options && !options.parenthesis) ||\n (options && options.parenthesis === 'keep')) {\n return '(' +\n this.content.toHTML(options) +\n ')'\n }\n return this.content.toHTML(options)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex (options) {\n if ((!options) ||\n (options && !options.parenthesis) ||\n (options && options.parenthesis === 'keep')) {\n return `\\\\left(${this.content.toTex(options)}\\\\right)`\n }\n return this.content.toTex(options)\n }\n }\n\n return ParenthesisNode\n}, { isClass: true, isNode: true })\n","import { isNode, isSymbolNode } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { getPrecedence } from '../operators.js'\n\nconst name = 'RangeNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createRangeNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses (node, parenthesis, implicit) {\n const precedence = getPrecedence(node, parenthesis, implicit)\n const parens = {}\n\n const startPrecedence = getPrecedence(node.start, parenthesis, implicit)\n parens.start = ((startPrecedence !== null) && (startPrecedence <= precedence)) ||\n (parenthesis === 'all')\n\n if (node.step) {\n const stepPrecedence = getPrecedence(node.step, parenthesis, implicit)\n parens.step = ((stepPrecedence !== null) && (stepPrecedence <= precedence)) ||\n (parenthesis === 'all')\n }\n\n const endPrecedence = getPrecedence(node.end, parenthesis, implicit)\n parens.end = ((endPrecedence !== null) && (endPrecedence <= precedence)) ||\n (parenthesis === 'all')\n\n return parens\n }\n\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor (start, end, step) {\n super()\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected')\n if (!isNode(end)) throw new TypeError('Node expected')\n if (step && !isNode(step)) throw new TypeError('Node expected')\n if (arguments.length > 3) throw new Error('Too many arguments')\n\n this.start = start // included lower-bound\n this.end = end // included upper-bound\n this.step = step || null // optional step\n }\n\n static name = name\n get type () { return name }\n get isRangeNode () { return true }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd () {\n // find all `end` symbols in this RangeNode\n const endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && (node.name === 'end')\n })\n\n return endSymbols.length > 0\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const range = math.range\n const evalStart = this.start._compile(math, argNames)\n const evalEnd = this.end._compile(math, argNames)\n\n if (this.step) {\n const evalStep = this.step._compile(math, argNames)\n\n return function evalRangeNode (scope, args, context) {\n return range(\n evalStart(scope, args, context),\n evalEnd(scope, args, context),\n evalStep(scope, args, context)\n )\n }\n } else {\n return function evalRangeNode (scope, args, context) {\n return range(\n evalStart(scope, args, context),\n evalEnd(scope, args, context)\n )\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.start, 'start', this)\n callback(this.end, 'end', this)\n if (this.step) {\n callback(this.step, 'step', this)\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map (callback) {\n return new RangeNode(\n this._ifNode(callback(this.start, 'start', this)),\n this._ifNode(callback(this.end, 'end', this)),\n this.step && this._ifNode(callback(this.step, 'step', this))\n )\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone () {\n return new RangeNode(this.start, this.end, this.step && this.step)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const parens =\n calculateNecessaryParentheses(\n this, parenthesis, options && options.implicit)\n\n // format string as start:step:stop\n let str\n\n let start = this.start.toString(options)\n if (parens.start) {\n start = '(' + start + ')'\n }\n str = start\n\n if (this.step) {\n let step = this.step.toString(options)\n if (parens.step) {\n step = '(' + step + ')'\n }\n str += ':' + step\n }\n\n let end = this.end.toString(options)\n if (parens.end) {\n end = '(' + end + ')'\n }\n str += ':' + end\n\n return str\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n }\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON (json) {\n return new RangeNode(json.start, json.end, json.step)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const parens =\n calculateNecessaryParentheses(\n this, parenthesis, options && options.implicit)\n\n // format string as start:step:stop\n let str\n\n let start = this.start.toHTML(options)\n if (parens.start) {\n start = '(' +\n start +\n ')'\n }\n str = start\n\n if (this.step) {\n let step = this.step.toHTML(options)\n if (parens.step) {\n step = '(' +\n step +\n ')'\n }\n str += ':' + step\n }\n\n let end = this.end.toHTML(options)\n if (parens.end) {\n end = '(' +\n end +\n ')'\n }\n str += ':' + end\n\n return str\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const parens =\n calculateNecessaryParentheses(\n this, parenthesis, options && options.implicit)\n\n let str = this.start.toTex(options)\n if (parens.start) {\n str = `\\\\left(${str}\\\\right)`\n }\n\n if (this.step) {\n let step = this.step.toTex(options)\n if (parens.step) {\n step = `\\\\left(${step}\\\\right)`\n }\n str += ':' + step\n }\n\n let end = this.end.toTex(options)\n if (parens.end) {\n end = `\\\\left(${end}\\\\right)`\n }\n str += ':' + end\n\n return str\n }\n }\n\n return RangeNode\n}, { isClass: true, isNode: true })\n","import { getPrecedence } from '../operators.js'\nimport { escape } from '../../utils/string.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { latexOperators } from '../../utils/latex.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'RelationalNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createRelationalNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n const operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n }\n\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor (conditionals, params) {\n super()\n if (!Array.isArray(conditionals)) { throw new TypeError('Parameter conditionals must be an array') }\n if (!Array.isArray(params)) { throw new TypeError('Parameter params must be an array') }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError(\n 'Parameter params must contain exactly one more element ' +\n 'than parameter conditionals')\n }\n\n this.conditionals = conditionals\n this.params = params\n }\n\n static name = name\n get type () { return name }\n get isRelationalNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const self = this\n\n const compiled = this.params.map(p => p._compile(math, argNames))\n\n return function evalRelationalNode (scope, args, context) {\n let evalLhs\n let evalRhs = compiled[0](scope, args, context)\n\n for (let i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs\n evalRhs = compiled[i + 1](scope, args, context)\n const condFn = getSafeProperty(math, self.conditionals[i])\n if (!condFn(evalLhs, evalRhs)) {\n return false\n }\n }\n return true\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this)\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map (callback) {\n return new RelationalNode(\n this.conditionals.slice(),\n this.params.map(\n (n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this))\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone () {\n return new RelationalNode(this.conditionals, this.params)\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n const paramStrings = this.params.map(function (p, index) {\n const paramPrecedence =\n getPrecedence(p, parenthesis, options && options.implicit)\n return (parenthesis === 'all' ||\n (paramPrecedence !== null && paramPrecedence <= precedence))\n ? '(' + p.toString(options) + ')'\n : p.toString(options)\n })\n\n let ret = paramStrings[0]\n for (let i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]]\n ret += ' ' + paramStrings[i + 1]\n }\n\n return ret\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n }\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON (json) {\n return new RelationalNode(json.conditionals, json.params)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n const paramStrings = this.params.map(function (p, index) {\n const paramPrecedence =\n getPrecedence(p, parenthesis, options && options.implicit)\n return (parenthesis === 'all' ||\n (paramPrecedence !== null && paramPrecedence <= precedence))\n ? ('(' +\n p.toHTML(options) +\n ')')\n : p.toHTML(options)\n })\n\n let ret = paramStrings[0]\n for (let i = 0; i < this.conditionals.length; i++) {\n ret += '' +\n escape(operatorMap[this.conditionals[i]]) + '' +\n paramStrings[i + 1]\n }\n\n return ret\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n const paramStrings = this.params.map(function (p, index) {\n const paramPrecedence =\n getPrecedence(p, parenthesis, options && options.implicit)\n return (parenthesis === 'all' ||\n (paramPrecedence !== null && paramPrecedence <= precedence))\n ? '\\\\left(' + p.toTex(options) + '\\right)'\n : p.toTex(options)\n })\n\n let ret = paramStrings[0]\n for (let i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1]\n }\n\n return ret\n }\n }\n\n return RelationalNode\n}, { isClass: true, isNode: true })\n","import { escape } from '../../utils/string.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { toSymbol } from '../../utils/latex.js'\n\nconst name = 'SymbolNode'\nconst dependencies = [\n 'math',\n '?Unit',\n 'Node'\n]\n\nexport const createSymbolNode = /* #__PURE__ */ factory(name, dependencies, ({ math, Unit, Node }) => {\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit (name) {\n return Unit ? Unit.isValuelessUnit(name) : false\n }\n\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor (name) {\n super()\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"')\n }\n\n this.name = name\n }\n\n get type () { return 'SymbolNode' }\n get isSymbolNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const name = this.name\n\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name)\n }\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name)\n ? scope.get(name)\n : getSafeProperty(math, name)\n }\n } else {\n const isUnit = isValuelessUnit(name)\n\n return function (scope, args, context) {\n return scope.has(name)\n ? scope.get(name)\n : isUnit\n ? new Unit(null, name)\n : SymbolNode.onUndefinedSymbol(name)\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map (callback) {\n return this.clone()\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol (name) {\n throw new Error('Undefined symbol ' + name)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone () {\n return new SymbolNode(this.name)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString (options) {\n return this.name\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML (options) {\n const name = escape(this.name)\n\n if (name === 'true' || name === 'false') {\n return '' + name + ''\n } else if (name === 'i') {\n return '' +\n name + ''\n } else if (name === 'Infinity') {\n return '' +\n name + ''\n } else if (name === 'NaN') {\n return '' + name + ''\n } else if (name === 'null') {\n return '' + name + ''\n } else if (name === 'undefined') {\n return '' +\n name + ''\n }\n\n return '' + name + ''\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n }\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON (json) {\n return new SymbolNode(json.name)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex (options) {\n let isUnit = false\n if ((typeof math[this.name] === 'undefined') &&\n isValuelessUnit(this.name)) {\n isUnit = true\n }\n const symbol = toSymbol(this.name, isUnit)\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol\n }\n }\n\n return SymbolNode\n}, { isClass: true, isNode: true })\n","import { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js'\nimport { escape, format } from '../../utils/string.js'\nimport { hasOwnProperty } from '../../utils/object.js'\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js'\nimport { createSubScope } from '../../utils/scope.js'\nimport { factory } from '../../utils/factory.js'\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js'\n\nconst name = 'FunctionNode'\nconst dependencies = [\n 'math',\n 'Node',\n 'SymbolNode'\n]\n\nexport const createFunctionNode = /* #__PURE__ */ factory(name, dependencies, ({ math, Node, SymbolNode }) => {\n /* format to fixed length */\n const strin = entity => format(entity, { truncate: 78 })\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate (template, node, options) {\n let latex = ''\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n const regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi\n\n let inputPos = 0 // position in the input string\n let match\n while ((match = regex.exec(template)) !== null) { // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index)\n inputPos = match.index\n\n if (match[0] === '$$') { // escaped dollar sign\n latex += '$'\n inputPos++\n } else { // template parameter\n inputPos += match[0].length\n const property = node[match[1]]\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.')\n }\n if (match[2] === undefined) { // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property\n break\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options)\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options)\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.')\n }).join(',')\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes')\n }\n break\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes')\n }\n } else { // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options)\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.')\n }\n }\n }\n }\n latex += template.slice(inputPos) // append rest of the template\n\n return latex\n }\n\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymbolNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor (fn, args) {\n super()\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn)\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"')\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError(\n 'Array containing Nodes expected for parameter \"args\"')\n }\n\n this.fn = fn\n this.args = args || []\n }\n\n // readonly property name\n get name () {\n return this.fn.name || ''\n }\n\n static name = name\n get type () { return name }\n get isFunctionNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n // compile arguments\n const evalArgs = this.args.map((arg) => arg._compile(math, argNames))\n\n if (isSymbolNode(this.fn)) {\n const name = this.fn.name\n if (!argNames[name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n const fn = name in math ? getSafeProperty(math, name) : undefined\n const isRaw = typeof fn === 'function' && fn.rawArgs === true\n\n const resolveFn = (scope) => {\n let value\n if (scope.has(name)) {\n value = scope.get(name)\n } else if (name in math) {\n value = getSafeProperty(math, name)\n } else {\n return FunctionNode.onUndefinedFunction(name)\n }\n if (typeof value === 'function') {\n return value\n }\n throw new TypeError(\n `'${name}' is not a function; its value is:\\n ${strin(value)}`\n )\n }\n\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n const rawArgs = this.args\n return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n\n // the original function can be overwritten in the scope with a non-rawArgs function\n if (fn.rawArgs === true) {\n return fn(rawArgs, math, createSubScope(scope, args))\n } else {\n // \"regular\" evaluation\n const values = evalArgs.map((evalArg) => evalArg(scope, args, context))\n return fn(...values)\n }\n }\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0: return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n return fn()\n }\n case 1: return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n const evalArg0 = evalArgs[0]\n return fn(\n evalArg0(scope, args, context)\n )\n }\n case 2: return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n const evalArg0 = evalArgs[0]\n const evalArg1 = evalArgs[1]\n return fn(\n evalArg0(scope, args, context),\n evalArg1(scope, args, context)\n )\n }\n default: return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n const values = evalArgs.map((evalArg) => evalArg(scope, args, context))\n return fn(...values)\n }\n }\n }\n } else { // the function symbol is an argName\n const rawArgs = this.args\n return function evalFunctionNode (scope, args, context) {\n const fn = getSafeProperty(args, name)\n if (typeof fn !== 'function') {\n throw new TypeError(\n `Argument '${name}' was not a function; received: ${strin(fn)}`\n )\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(rawArgs, math, createSubScope(scope, args))\n } else {\n const values = evalArgs.map(\n (evalArg) => evalArg(scope, args, context))\n return fn.apply(fn, values)\n }\n }\n }\n } else if (\n isAccessorNode(this.fn) &&\n isIndexNode(this.fn.index) &&\n this.fn.index.isObjectProperty()\n ) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n const evalObject = this.fn.object._compile(math, argNames)\n const prop = this.fn.index.getObjectProperty()\n const rawArgs = this.args\n\n return function evalFunctionNode (scope, args, context) {\n const object = evalObject(scope, args, context)\n const fn = getSafeMethod(object, prop)\n\n if (fn?.rawArgs) {\n // \"Raw\" evaluation\n return fn(rawArgs, math, createSubScope(scope, args))\n } else {\n // \"regular\" evaluation\n const values = evalArgs.map((evalArg) => evalArg(scope, args, context))\n return fn.apply(object, values)\n }\n }\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n const fnExpr = this.fn.toString()\n const evalFn = this.fn._compile(math, argNames)\n const rawArgs = this.args\n\n return function evalFunctionNode (scope, args, context) {\n const fn = evalFn(scope, args, context)\n if (typeof fn !== 'function') {\n throw new TypeError(\n `Expression '${fnExpr}' did not evaluate to a function; value is:` +\n `\\n ${strin(fn)}`\n )\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(rawArgs, math, createSubScope(scope, args))\n } else {\n // \"regular\" evaluation\n const values = evalArgs.map(\n (evalArg) => evalArg(scope, args, context))\n return fn.apply(fn, values)\n }\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.fn, 'fn', this)\n\n for (let i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this)\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map (callback) {\n const fn = this._ifNode(callback(this.fn, 'fn', this))\n const args = []\n for (let i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this))\n }\n return new FunctionNode(fn, args)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone () {\n return new FunctionNode(this.fn, this.args.slice(0))\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n static onUndefinedFunction = function (name) {\n throw new Error('Undefined function ' + name)\n }\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString (options) {\n let customString\n const name = this.fn.toString(options)\n if (options &&\n (typeof options.handler === 'object') &&\n hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options)\n }\n\n if (typeof customString !== 'undefined') {\n return customString\n }\n\n // fall back to Node's toString\n return super.toString(options)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const args = this.args.map(function (arg) {\n return arg.toString(options)\n })\n\n const fn = isFunctionAssignmentNode(this.fn)\n ? ('(' + this.fn.toString(options) + ')')\n : this.fn.toString(options)\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')'\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n }\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n static fromJSON = function (json) {\n return new FunctionNode(json.fn, json.args)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const args = this.args.map(function (arg) {\n return arg.toHTML(options)\n })\n\n // format the arguments like \"add(2, 4.2)\"\n return '' + escape(this.fn) +\n '(' +\n args.join(',') +\n ')'\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex (options) {\n let customTex\n if (options &&\n (typeof options.handler === 'object') &&\n hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options)\n }\n\n if (typeof customTex !== 'undefined') {\n return customTex\n }\n\n // fall back to Node's toTex\n return super.toTex(options)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const args = this.args.map(function (arg) { // get LaTeX of the arguments\n return arg.toTex(options)\n })\n\n let latexConverter\n\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name]\n }\n\n // toTex property on the function itself\n if (math[this.name] &&\n ((typeof math[this.name].toTex === 'function') ||\n (typeof math[this.name].toTex === 'object') ||\n (typeof math[this.name].toTex === 'string'))\n ) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex\n }\n\n let customToTex\n switch (typeof latexConverter) {\n case 'function': // a callback function\n customToTex = latexConverter(this, options)\n break\n case 'string': // a template string\n customToTex = expandTemplate(latexConverter, this, options)\n break\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options)\n break\n case 'string':\n customToTex =\n expandTemplate(latexConverter[args.length], this, options)\n break\n }\n }\n\n if (typeof customToTex !== 'undefined') {\n return customToTex\n }\n\n return expandTemplate(defaultTemplate, this, options)\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier () {\n return this.type + ':' + this.name\n }\n }\n\n return FunctionNode\n}, { isClass: true, isNode: true })\n","import { factory } from '../utils/factory.js'\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js'\nimport { deepMap } from '../utils/collection.js'\nimport { safeNumberType } from '../utils/number.js'\nimport { hasOwnProperty } from '../utils/object.js'\n\nconst name = 'parse'\nconst dependencies = [\n 'typed',\n 'numeric',\n 'config',\n 'AccessorNode',\n 'ArrayNode',\n 'AssignmentNode',\n 'BlockNode',\n 'ConditionalNode',\n 'ConstantNode',\n 'FunctionAssignmentNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'ParenthesisNode',\n 'RangeNode',\n 'RelationalNode',\n 'SymbolNode'\n]\n\nexport const createParse = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n}) => {\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b') // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n const parse = typed(name, {\n string: function (expression) {\n return parseStart(expression, {})\n },\n 'Array | Matrix': function (expressions) {\n return parseMultiple(expressions, {})\n },\n 'string, Object': function (expression, options) {\n const extraNodes = options.nodes !== undefined ? options.nodes : {}\n\n return parseStart(expression, extraNodes)\n },\n 'Array | Matrix, Object': parseMultiple\n })\n\n function parseMultiple (expressions, options = {}) {\n const extraNodes = options.nodes !== undefined ? options.nodes : {}\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected')\n\n return parseStart(elem, extraNodes)\n })\n }\n\n // token types enumeration\n const TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n }\n\n // map with all delimiters\n const DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n\n '<<': true,\n '>>': true,\n '>>>': true\n }\n\n // map with all named delimiters\n const NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n }\n\n const CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n }\n\n const NUMERIC_CONSTANTS = [\n 'NaN',\n 'Infinity'\n ]\n\n const ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n }\n\n function initialState () {\n return {\n extraNodes: {}, // current extra nodes, must be careful not to mutate\n expression: '', // current expression\n comment: '', // last parsed comment\n index: 0, // current index in expr\n token: '', // current token\n tokenType: TOKENTYPE.NULL, // type of the token\n nestingLevel: 0, // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n }\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString (state, length) {\n return state.expression.substr(state.index, length)\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter (state) {\n return currentString(state, 1)\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next (state) {\n state.index++\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter (state) {\n return state.expression.charAt(state.index - 1)\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter (state) {\n return state.expression.charAt(state.index + 1)\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken (state) {\n state.tokenType = TOKENTYPE.NULL\n state.token = ''\n state.comment = ''\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' &&\n currentCharacter(state) !== '') {\n state.comment += currentCharacter(state)\n next(state)\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state)\n } else {\n break\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER\n return\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = currentCharacter(state)\n next(state)\n return\n }\n\n const c1 = currentCharacter(state)\n const c2 = currentString(state, 2)\n const c3 = currentString(state, 3)\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c3\n next(state)\n next(state)\n next(state)\n return\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c2\n next(state)\n next(state)\n return\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c1\n next(state)\n return\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER\n\n // check for binary, octal, or hex\n const c2 = currentString(state, 2)\n if (c2 === '0b' || c2 === '0o' || c2 === '0x') {\n state.token += currentCharacter(state)\n next(state)\n state.token += currentCharacter(state)\n next(state)\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.'\n next(state)\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i'\n next(state)\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n }\n return\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state)\n next(state)\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER\n return\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state)\n next(state)\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state)\n next(state)\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n } else if (nextCharacter(state) === '.') {\n next(state)\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n }\n\n return\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER\n } else {\n state.tokenType = TOKENTYPE.SYMBOL\n }\n\n return\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state)\n next(state)\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"')\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline (state) {\n do {\n getToken(state)\n }\n while (state.token === '\\n') // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams (state) {\n state.nestingLevel++\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams (state) {\n state.nestingLevel--\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha (c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) ||\n parse.isValidMathSymbol(c, cNext) ||\n parse.isValidMathSymbol(cPrev, c)\n }\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek (c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c)\n }\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol (high, low) {\n return /^[\\uD835]$/.test(high) &&\n /^[\\uDC00-\\uDFFF]$/.test(low) &&\n /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low)\n }\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace (c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || (c === '\\n' && nestingLevel > 0)\n }\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark (c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^'\n }\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot (c) {\n return ((c >= '0' && c <= '9') || c === '.')\n }\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit (c) {\n return (c >= '0' && c <= '9')\n }\n\n /**\n * checks if the given char c is a hex digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isHexDigit = function isHexDigit (c) {\n return ((c >= '0' && c <= '9') ||\n (c >= 'a' && c <= 'f') ||\n (c >= 'A' && c <= 'F'))\n }\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart (expression, extraNodes) {\n const state = initialState()\n Object.assign(state, { expression, extraNodes })\n getToken(state)\n\n const node = parseBlock(state)\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token)\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"')\n }\n }\n\n return node\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock (state) {\n let node\n const blocks = []\n let visible\n\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state)\n if (state.comment) {\n node.comment = state.comment\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') { // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = (state.token !== ';')\n blocks.push({ node, visible })\n }\n\n getToken(state)\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state)\n if (state.comment) {\n node.comment = state.comment\n }\n\n visible = (state.token !== ';')\n blocks.push({ node, visible })\n }\n }\n\n if (blocks.length > 0) {\n return new BlockNode(blocks)\n } else {\n if (!node) {\n node = new ConstantNode(undefined)\n if (state.comment) {\n node.comment = state.comment\n }\n }\n\n return node\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment (state) {\n let name, args, value, valid\n\n const node = parseConditional(state)\n\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name\n getTokenSkipNewline(state)\n value = parseAssignment(state)\n return new AssignmentNode(new SymbolNode(name), value)\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n getTokenSkipNewline(state)\n value = parseAssignment(state)\n return new AssignmentNode(node.object, node.index, value)\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true\n args = []\n\n name = node.name\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name\n } else {\n valid = false\n }\n })\n\n if (valid) {\n getTokenSkipNewline(state)\n value = parseAssignment(state)\n return new FunctionAssignmentNode(name, args, value)\n }\n }\n\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =')\n }\n\n return node\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional (state) {\n let node = parseLogicalOr(state)\n\n while (state.token === '?') { // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n const prev = state.conditionalLevel\n state.conditionalLevel = state.nestingLevel\n getTokenSkipNewline(state)\n\n const condition = node\n const trueExpr = parseAssignment(state)\n\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected')\n\n state.conditionalLevel = null\n getTokenSkipNewline(state)\n\n const falseExpr = parseAssignment(state) // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr)\n\n // restore the previous conditional level\n state.conditionalLevel = prev\n }\n\n return node\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr (state) {\n let node = parseLogicalXor(state)\n\n while (state.token === 'or') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)])\n }\n\n return node\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor (state) {\n let node = parseLogicalAnd(state)\n\n while (state.token === 'xor') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)])\n }\n\n return node\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd (state) {\n let node = parseBitwiseOr(state)\n\n while (state.token === 'and') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)])\n }\n\n return node\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr (state) {\n let node = parseBitwiseXor(state)\n\n while (state.token === '|') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)])\n }\n\n return node\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor (state) {\n let node = parseBitwiseAnd(state)\n\n while (state.token === '^|') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)])\n }\n\n return node\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd (state) {\n let node = parseRelational(state)\n\n while (state.token === '&') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)])\n }\n\n return node\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational (state) {\n const params = [parseShift(state)]\n const conditionals = []\n\n const operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n }\n\n while (hasOwnProperty(operators, state.token)) { // eslint-disable-line no-unmodified-loop-condition\n const cond = { name: state.token, fn: operators[state.token] }\n conditionals.push(cond)\n getTokenSkipNewline(state)\n params.push(parseShift(state))\n }\n\n if (params.length === 1) {\n return params[0]\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params)\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params)\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift (state) {\n let node, name, fn, params\n\n node = parseConversion(state)\n\n const operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n }\n\n while (hasOwnProperty(operators, state.token)) {\n name = state.token\n fn = operators[name]\n\n getTokenSkipNewline(state)\n params = [node, parseConversion(state)]\n node = new OperatorNode(name, fn, params)\n }\n\n return node\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion (state) {\n let node, name, fn, params\n\n node = parseRange(state)\n\n const operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n }\n\n while (hasOwnProperty(operators, state.token)) {\n name = state.token\n fn = operators[name]\n\n getTokenSkipNewline(state)\n\n if (name === 'in' && state.token === '') {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true)\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)]\n node = new OperatorNode(name, fn, params)\n }\n }\n\n return node\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange (state) {\n let node\n const params = []\n\n if (state.token === ':') {\n // implicit start=1 (one-based)\n node = new ConstantNode(1)\n } else {\n // explicit start\n node = parseAddSubtract(state)\n }\n\n if (state.token === ':' && (state.conditionalLevel !== state.nestingLevel)) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node)\n\n // parse step and end\n while (state.token === ':' && params.length < 3) { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'))\n } else {\n // explicit end\n params.push(parseAddSubtract(state))\n }\n }\n\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]) // start, end, step\n } else { // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]) // start, end\n }\n }\n\n return node\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract (state) {\n let node, name, fn, params\n\n node = parseMultiplyDivide(state)\n\n const operators = {\n '+': 'add',\n '-': 'subtract'\n }\n while (hasOwnProperty(operators, state.token)) {\n name = state.token\n fn = operators[name]\n\n getTokenSkipNewline(state)\n const rightNode = parseMultiplyDivide(state)\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])]\n } else {\n params = [node, rightNode]\n }\n node = new OperatorNode(name, fn, params)\n }\n\n return node\n }\n\n /**\n * multiply, divide\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivide (state) {\n let node, last, name, fn\n\n node = parseImplicitMultiplication(state)\n last = node\n\n const operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide'\n }\n\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token\n fn = operators[name]\n\n getTokenSkipNewline(state)\n\n last = parseImplicitMultiplication(state)\n node = new OperatorNode(name, fn, [node, last])\n } else {\n break\n }\n }\n\n return node\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication (state) {\n let node, last\n\n node = parseRule2(state)\n last = node\n\n while (true) {\n if ((state.tokenType === TOKENTYPE.SYMBOL) ||\n (state.token === 'in' && isConstantNode(node)) ||\n (state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0])) ||\n (state.tokenType === TOKENTYPE.NUMBER &&\n !isConstantNode(last) &&\n (!isOperatorNode(last) || last.op === '!')) ||\n (state.token === '(')) {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state)\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */)\n } else {\n break\n }\n }\n\n return node\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2 (state) {\n let node = parseModulusPercentage(state)\n let last = node\n const tokenStates = []\n\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(Object.assign({}, state))\n getTokenSkipNewline(state)\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(Object.assign({}, state))\n getTokenSkipNewline(state)\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n Object.assign(state, tokenStates.pop())\n tokenStates.pop()\n last = parseModulusPercentage(state)\n node = new OperatorNode('/', 'divide', [node, last])\n } else {\n // Not a match, so rewind\n tokenStates.pop()\n Object.assign(state, tokenStates.pop())\n break\n }\n } else {\n // Not a match, so rewind\n Object.assign(state, tokenStates.pop())\n break\n }\n } else {\n break\n }\n }\n\n return node\n }\n\n /**\n * modulus and percentage\n * @return {Node} node\n * @private\n */\n function parseModulusPercentage (state) {\n let node, name, fn, params\n\n node = parseUnary(state)\n\n const operators = {\n '%': 'mod',\n mod: 'mod'\n }\n\n while (hasOwnProperty(operators, state.token)) {\n name = state.token\n fn = operators[name]\n\n getTokenSkipNewline(state)\n\n if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') {\n // If the expression contains only %, then treat that as /100\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true)\n } else {\n params = [node, parseUnary(state)]\n node = new OperatorNode(name, fn, params)\n }\n }\n\n return node\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary (state) {\n let name, params, fn\n const operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n }\n\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token]\n name = state.token\n\n getTokenSkipNewline(state)\n params = [parseUnary(state)]\n\n return new OperatorNode(name, fn, params)\n }\n\n return parsePow(state)\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow (state) {\n let node, name, fn, params\n\n node = parseLeftHandOperators(state)\n\n if (state.token === '^' || state.token === '.^') {\n name = state.token\n fn = (name === '^') ? 'pow' : 'dotPow'\n\n getTokenSkipNewline(state)\n params = [node, parseUnary(state)] // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params)\n }\n\n return node\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators (state) {\n let node, name, fn, params\n\n node = parseCustomNodes(state)\n\n const operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n }\n\n while (hasOwnProperty(operators, state.token)) {\n name = state.token\n fn = operators[name]\n\n getToken(state)\n params = [node]\n\n node = new OperatorNode(name, fn, params)\n node = parseAccessors(state, node)\n }\n\n return node\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes (state) {\n let params = []\n\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n const CustomNode = state.extraNodes[state.token]\n\n getToken(state)\n\n // parse parameters\n if (state.token === '(') {\n params = []\n\n openParams(state)\n getToken(state)\n\n if (state.token !== ')') {\n params.push(parseAssignment(state))\n\n // parse a list with parameters\n while (state.token === ',') { // eslint-disable-line no-unmodified-loop-condition\n getToken(state)\n params.push(parseAssignment(state))\n }\n }\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected')\n }\n closeParams(state)\n getToken(state)\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params)\n }\n\n return parseSymbol(state)\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol (state) {\n let node, name\n\n if (state.tokenType === TOKENTYPE.SYMBOL ||\n (state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS)) {\n name = state.token\n\n getToken(state)\n\n if (hasOwnProperty(CONSTANTS, name)) { // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name])\n } else if (NUMERIC_CONSTANTS.includes(name)) { // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'))\n } else {\n node = new SymbolNode(name)\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node)\n return node\n }\n\n return parseString(state)\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2)\n * - index enclosed in square brackets [...], for example A[2,3]\n * - dot notation for properties, like foo.bar\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors (state, node, types) {\n let params\n\n while ((state.token === '(' || state.token === '[' || state.token === '.') &&\n (!types || types.includes(state.token))) { // eslint-disable-line no-unmodified-loop-condition\n params = []\n\n if (state.token === '(') {\n if (isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation like fn(2, 3) or obj.fn(2, 3)\n openParams(state)\n getToken(state)\n\n if (state.token !== ')') {\n params.push(parseAssignment(state))\n\n // parse a list with parameters\n while (state.token === ',') { // eslint-disable-line no-unmodified-loop-condition\n getToken(state)\n params.push(parseAssignment(state))\n }\n }\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected')\n }\n closeParams(state)\n getToken(state)\n\n node = new FunctionNode(node, params)\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state)\n getToken(state)\n\n if (state.token !== ']') {\n params.push(parseAssignment(state))\n\n // parse a list with parameters\n while (state.token === ',') { // eslint-disable-line no-unmodified-loop-condition\n getToken(state)\n params.push(parseAssignment(state))\n }\n }\n\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected')\n }\n closeParams(state)\n getToken(state)\n\n node = new AccessorNode(node, new IndexNode(params))\n } else {\n // dot notation like variable.prop\n getToken(state)\n\n const isPropertyName = state.tokenType === TOKENTYPE.SYMBOL ||\n (state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS)\n if (!isPropertyName) {\n throw createSyntaxError(state, 'Property name expected after dot')\n }\n\n params.push(new ConstantNode(state.token))\n getToken(state)\n\n const dotNotation = true\n node = new AccessorNode(node, new IndexNode(params, dotNotation))\n }\n }\n\n return node\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString (state) {\n let node, str\n\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token)\n\n // create constant\n node = new ConstantNode(str)\n\n // parse index parameters\n node = parseAccessors(state, node)\n\n return node\n }\n\n return parseMatrix(state)\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken (state, quote) {\n let str = ''\n\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state)\n\n const char = currentCharacter(state)\n const escapeChar = ESCAPE_CHARACTERS[char]\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar\n state.index += 1\n } else if (char === 'u') {\n // escaped unicode character\n const unicode = state.expression.slice(state.index + 1, state.index + 5)\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) { // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16))\n state.index += 5\n } else {\n throw createSyntaxError(state, `Invalid unicode character \\\\u${unicode}`)\n }\n } else {\n throw createSyntaxError(state, `Bad escape character \\\\${char}`)\n }\n } else {\n // any regular character\n str += currentCharacter(state)\n next(state)\n }\n }\n\n getToken(state)\n if (state.token !== quote) {\n throw createSyntaxError(state, `End of string ${quote} expected`)\n }\n getToken(state)\n\n return str\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix (state) {\n let array, params, rows, cols\n\n if (state.token === '[') {\n // matrix [...]\n openParams(state)\n getToken(state)\n\n if (state.token !== ']') {\n // this is a non-empty matrix\n const row = parseRow(state)\n\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1\n params = [row]\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') { // eslint-disable-line no-unmodified-loop-condition\n getToken(state)\n\n if (state.token !== ']') {\n params[rows] = parseRow(state)\n rows++\n }\n }\n\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected')\n }\n closeParams(state)\n getToken(state)\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length\n for (let r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' +\n '(' + params[r].items.length + ' !== ' + cols + ')')\n }\n }\n\n array = new ArrayNode(params)\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected')\n }\n closeParams(state)\n getToken(state)\n\n array = row\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state)\n getToken(state)\n array = new ArrayNode([])\n }\n\n return parseAccessors(state, array)\n }\n\n return parseObject(state)\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow (state) {\n const params = [parseAssignment(state)]\n let len = 1\n\n while (state.token === ',') { // eslint-disable-line no-unmodified-loop-condition\n getToken(state)\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state)\n len++\n }\n }\n\n return new ArrayNode(params)\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject (state) {\n if (state.token === '{') {\n openParams(state)\n let key\n\n const properties = {}\n do {\n getToken(state)\n\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token)\n } else if (state.tokenType === TOKENTYPE.SYMBOL || (state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS)) {\n key = state.token\n getToken(state)\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key')\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key')\n }\n getToken(state)\n\n // parse key\n properties[key] = parseAssignment(state)\n }\n }\n while (state.token === ',') // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value')\n }\n closeParams(state)\n getToken(state)\n\n let node = new ObjectNode(properties)\n\n // parse index parameters\n node = parseAccessors(state, node)\n\n return node\n }\n\n return parseNumber(state)\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber (state) {\n let numberStr\n\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token\n getToken(state)\n\n const numericType = safeNumberType(numberStr, config)\n const value = numeric(numberStr, numericType)\n\n return new ConstantNode(value)\n }\n\n return parseParentheses(state)\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses (state) {\n let node\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state)\n getToken(state)\n\n node = parseAssignment(state) // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected')\n }\n closeParams(state)\n getToken(state)\n\n node = new ParenthesisNode(node)\n node = parseAccessors(state, node)\n return node\n }\n\n return parseEnd(state)\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd (state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression')\n } else {\n throw createSyntaxError(state, 'Value expected')\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col (state) {\n return state.index - state.token.length + 1\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError (state, message) {\n const c = col(state)\n const error = new SyntaxError(message + ' (char ' + c + ')')\n error.char = c\n\n return error\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError (state, message) {\n const c = col(state)\n const error = new SyntaxError(message + ' (char ' + c + ')')\n error.char = c\n\n return error\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({ from: 'string', to: 'Node', convert: parse })\n\n return parse\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'compile'\nconst dependencies = ['typed', 'parse']\n\nexport const createCompile = /* #__PURE__ */ factory(name, dependencies, ({ typed, parse }) => {\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function (expr) {\n return parse(expr).compile()\n },\n\n 'Array | Matrix': function (expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile()\n })\n }\n })\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { createEmptyMap } from '../../utils/map.js'\n\nconst name = 'evaluate'\nconst dependencies = ['typed', 'parse']\n\nexport const createEvaluate = /* #__PURE__ */ factory(name, dependencies, ({ typed, parse }) => {\n /**\n * Evaluate an expression.\n *\n * The expression parser does not use JavaScript. Its syntax is close\n * to JavaScript but more suited for mathematical expressions.\n * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn\n * the syntax and get an overview of the exact differences from JavaScript.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function (expr) {\n const scope = createEmptyMap()\n return parse(expr).compile().evaluate(scope)\n },\n\n 'string, Map | Object': function (expr, scope) {\n return parse(expr).compile().evaluate(scope)\n },\n\n 'Array | Matrix': function (expr) {\n const scope = createEmptyMap()\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope)\n })\n },\n\n 'Array | Matrix, Map | Object': function (expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope)\n })\n }\n })\n})\n","import { factory } from '../utils/factory.js'\nimport { createEmptyMap, toObject } from '../utils/map.js'\n\nconst name = 'Parser'\nconst dependencies = ['evaluate']\n\nexport const createParserClass = /* #__PURE__ */ factory(name, dependencies, ({ evaluate }) => {\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser () {\n if (!(this instanceof Parser)) {\n throw new SyntaxError(\n 'Constructor must be called with the new operator')\n }\n\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n })\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser'\n Parser.prototype.isParser = true\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope)\n }\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name)\n }\n }\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope)\n }\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope\n }\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n this.scope.set(name, value)\n return value\n }\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name)\n }\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear()\n }\n\n return Parser\n}, { isClass: true })\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'parser'\nconst dependencies = ['typed', 'Parser']\n\nexport const createParser = /* #__PURE__ */ factory(name, dependencies, ({ typed, Parser }) => {\n /**\n * Create a parser. The function creates a new `math.Parser` object.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function () {\n return new Parser()\n }\n })\n})\n","import { clone } from '../../../utils/object.js'\nimport { factory } from '../../../utils/factory.js'\n\nconst name = 'lup'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'abs',\n 'addScalar',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'larger',\n 'equalScalar',\n 'unaryMinus',\n 'DenseMatrix',\n 'SparseMatrix',\n 'Spa'\n]\n\nexport const createLup = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n matrix,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n larger,\n equalScalar,\n unaryMinus,\n DenseMatrix,\n SparseMatrix,\n Spa\n }\n) => {\n /**\n * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a\n * row permutation vector `p` where `A[p,:] = L * U`\n *\n * Syntax:\n *\n * math.lup(A)\n *\n * Example:\n *\n * const m = [[2, 1], [1, 4]]\n * const r = math.lup(m)\n * // r = {\n * // L: [[1, 0], [0.5, 1]],\n * // U: [[2, 1], [0, 3.5]],\n * // P: [0, 1]\n * // }\n *\n * See also:\n *\n * slu, lsolve, lusolve, usolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition.\n *\n * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix.\n */\n return typed(name, {\n\n DenseMatrix: function (m) {\n return _denseLUP(m)\n },\n\n SparseMatrix: function (m) {\n return _sparseLUP(m)\n },\n\n Array: function (a) {\n // create dense matrix from array\n const m = matrix(a)\n // lup, use matrix implementation\n const r = _denseLUP(m)\n // result\n return {\n L: r.L.valueOf(),\n U: r.U.valueOf(),\n p: r.p\n }\n }\n })\n\n function _denseLUP (m) {\n // rows & columns\n const rows = m._size[0]\n const columns = m._size[1]\n // minimum rows and columns\n let n = Math.min(rows, columns)\n // matrix array, clone original data\n const data = clone(m._data)\n // l matrix arrays\n const ldata = []\n const lsize = [rows, n]\n // u matrix arrays\n const udata = []\n const usize = [n, columns]\n // vars\n let i, j, k\n // permutation vector\n const p = []\n for (i = 0; i < rows; i++) { p[i] = i }\n // loop columns\n for (j = 0; j < columns; j++) {\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // min i,j\n const min = Math.min(i, j)\n // v[i, j]\n let s = 0\n // loop up to min\n for (k = 0; k < min; k++) {\n // s = l[i, k] - data[k, j]\n s = addScalar(s, multiplyScalar(data[i][k], data[k][j]))\n }\n data[i][j] = subtractScalar(data[i][j], s)\n }\n }\n // row with larger value in cvector, row >= j\n let pi = j\n let pabsv = 0\n let vjj = 0\n // loop rows\n for (i = j; i < rows; i++) {\n // data @ i, j\n const v = data[i][j]\n // absolute value\n const absv = abs(v)\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = i\n // update max value\n pabsv = absv\n // value @ [j, j]\n vjj = v\n }\n }\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in p\n p[j] = [p[pi], p[pi] = p[j]][0]\n // swap j <-> pi in data\n DenseMatrix._swapRows(j, pi, data)\n }\n // check column is in lower triangular matrix\n if (j < rows) {\n // loop rows (lower triangular matrix)\n for (i = j + 1; i < rows; i++) {\n // value @ i, j\n const vij = data[i][j]\n if (!equalScalar(vij, 0)) {\n // update data\n data[i][j] = divideScalar(data[i][j], vjj)\n }\n }\n }\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // initialize row in arrays\n if (j === 0) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i] = []\n }\n // L\n ldata[i] = []\n }\n // check we are in the upper triangular matrix\n if (i < j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j]\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 0\n }\n continue\n }\n // diagonal value\n if (i === j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j]\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 1\n }\n continue\n }\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = 0\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = data[i][j]\n }\n }\n }\n // l matrix\n const l = new DenseMatrix({\n data: ldata,\n size: lsize\n })\n // u matrix\n const u = new DenseMatrix({\n data: udata,\n size: usize\n })\n // p vector\n const pv = []\n for (i = 0, n = p.length; i < n; i++) { pv[p[i]] = i }\n // return matrices\n return {\n L: l,\n U: u,\n p: pv,\n toString: function () {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p\n }\n }\n }\n\n function _sparseLUP (m) {\n // rows & columns\n const rows = m._size[0]\n const columns = m._size[1]\n // minimum rows and columns\n const n = Math.min(rows, columns)\n // matrix arrays (will not be modified, thanks to permutation vector)\n const values = m._values\n const index = m._index\n const ptr = m._ptr\n // l matrix arrays\n const lvalues = []\n const lindex = []\n const lptr = []\n const lsize = [rows, n]\n // u matrix arrays\n const uvalues = []\n const uindex = []\n const uptr = []\n const usize = [n, columns]\n // vars\n let i, j, k\n // permutation vectors, (current index -> original index) and (original index -> current index)\n const pvCo = []\n const pvOc = []\n for (i = 0; i < rows; i++) {\n pvCo[i] = i\n pvOc[i] = i\n }\n // swap indices in permutation vectors (condition x < y)!\n const swapIndeces = function (x, y) {\n // find pv indeces getting data from x and y\n const kx = pvOc[x]\n const ky = pvOc[y]\n // update permutation vector current -> original\n pvCo[kx] = y\n pvCo[ky] = x\n // update permutation vector original -> current\n pvOc[x] = ky\n pvOc[y] = kx\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // sparse accumulator\n const spa = new Spa()\n // check lower triangular matrix has a value @ column j\n if (j < rows) {\n // update ptr\n lptr.push(lvalues.length)\n // first value in j column for lower triangular matrix\n lvalues.push(1)\n lindex.push(j)\n }\n // update ptr\n uptr.push(uvalues.length)\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n const k0 = ptr[j]\n const k1 = ptr[j + 1]\n // copy column j into sparse accumulator\n for (k = k0; k < k1; k++) {\n // row\n i = index[k]\n // copy column values into sparse accumulator (use permutation vector)\n spa.set(pvCo[i], values[k])\n }\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows in column j (above diagonal)\n spa.forEach(0, j - 1, function (k, vkj) {\n // loop rows in column k (L)\n SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {\n // check row is below k\n if (i > k) {\n // update spa value\n spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)))\n }\n })\n })\n }\n // row with larger value in spa, row >= j\n let pi = j\n let vjj = spa.get(j)\n let pabsv = abs(vjj)\n // loop values in spa (order by row, below diagonal)\n spa.forEach(j + 1, rows - 1, function (x, v) {\n // absolute value\n const absv = abs(v)\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = x\n // update max value\n pabsv = absv\n // value @ [j, j]\n vjj = v\n }\n })\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in L\n SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr)\n // swap values j <-> pi in U\n SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr)\n // swap values in spa\n spa.swap(j, pi)\n // update permutation vector (swap values @ j, pi)\n swapIndeces(j, pi)\n }\n // loop values in spa (order by row)\n spa.forEach(0, rows - 1, function (x, v) {\n // check we are above diagonal\n if (x <= j) {\n // update upper triangular matrix\n uvalues.push(v)\n uindex.push(x)\n } else {\n // update value\n v = divideScalar(v, vjj)\n // check value is non zero\n if (!equalScalar(v, 0)) {\n // update lower triangular matrix\n lvalues.push(v)\n lindex.push(x)\n }\n }\n })\n }\n // update ptrs\n uptr.push(uvalues.length)\n lptr.push(lvalues.length)\n\n // return matrices\n return {\n L: new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: lsize\n }),\n U: new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: usize\n }),\n p: pvCo,\n toString: function () {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p\n }\n }\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'qr'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'zeros',\n 'identity',\n 'isZero',\n 'equal',\n 'sign',\n 'sqrt',\n 'conj',\n 'unaryMinus',\n 'addScalar',\n 'divideScalar',\n 'multiplyScalar',\n 'subtractScalar',\n 'complex'\n]\n\nexport const createQr = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n matrix,\n zeros,\n identity,\n isZero,\n equal,\n sign,\n sqrt,\n conj,\n unaryMinus,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n complex\n }\n) => {\n /**\n * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in\n * two matrices (`Q`, `R`) where `Q` is an\n * orthogonal matrix and `R` is an upper triangular matrix.\n *\n * Syntax:\n *\n * math.qr(A)\n *\n * Example:\n *\n * const m = [\n * [1, -1, 4],\n * [1, 4, -2],\n * [1, 4, 2],\n * [1, -1, 0]\n * ]\n * const result = math.qr(m)\n * // r = {\n * // Q: [\n * // [0.5, -0.5, 0.5],\n * // [0.5, 0.5, -0.5],\n * // [0.5, 0.5, 0.5],\n * // [0.5, -0.5, -0.5],\n * // ],\n * // R: [\n * // [2, 3, 2],\n * // [0, 5, -2],\n * // [0, 0, 4],\n * // [0, 0, 0]\n * // ]\n * // }\n *\n * See also:\n *\n * lup, lusolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array\n * for which to get the QR decomposition.\n *\n * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal\n * matrix and R: the upper triangular matrix\n */\n return Object.assign(typed(name, {\n\n DenseMatrix: function (m) {\n return _denseQR(m)\n },\n\n SparseMatrix: function (m) {\n return _sparseQR(m)\n },\n\n Array: function (a) {\n // create dense matrix from array\n const m = matrix(a)\n // lup, use matrix implementation\n const r = _denseQR(m)\n // result\n return {\n Q: r.Q.valueOf(),\n R: r.R.valueOf()\n }\n }\n }), { _denseQRimpl })\n\n function _denseQRimpl (m) {\n // rows & columns (m x n)\n const rows = m._size[0] // m\n const cols = m._size[1] // n\n\n const Q = identity([rows], 'dense')\n const Qdata = Q._data\n\n const R = m.clone()\n const Rdata = R._data\n\n // vars\n let i, j, k\n\n const w = zeros([rows], '')\n\n for (k = 0; k < Math.min(cols, rows); ++k) {\n /*\n * **k-th Household matrix**\n *\n * The matrix I - 2*v*transpose(v)\n * x = first column of A\n * x1 = first element of x\n * alpha = x1 / |x1| * |x|\n * e1 = tranpose([1, 0, 0, ...])\n * u = x - alpha * e1\n * v = u / |u|\n *\n * Household matrix = I - 2 * v * tranpose(v)\n *\n * * Initially Q = I and R = A.\n * * Household matrix is a reflection in a plane normal to v which\n * will zero out all but the top right element in R.\n * * Appplying reflection to both Q and R will not change product.\n * * Repeat this process on the (1,1) minor to get R as an upper\n * triangular matrix.\n * * Reflections leave the magnitude of the columns of Q unchanged\n * so Q remains othoganal.\n *\n */\n\n const pivot = Rdata[k][k]\n const sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot))\n const conjSgn = conj(sgn)\n\n let alphaSquared = 0\n\n for (i = k; i < rows; i++) {\n alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])))\n }\n\n const alpha = multiplyScalar(sgn, sqrt(alphaSquared))\n\n if (!isZero(alpha)) {\n // first element in vector u\n const u1 = subtractScalar(pivot, alpha)\n\n // w = v * u1 / |u| (only elements k to (rows-1) are used)\n w[k] = 1\n\n for (i = k + 1; i < rows; i++) {\n w[i] = divideScalar(Rdata[i][k], u1)\n }\n\n // tau = - conj(u1 / alpha)\n const tau = unaryMinus(conj(divideScalar(u1, alpha)))\n\n let s\n\n /*\n * tau and w have been choosen so that\n *\n * 2 * v * tranpose(v) = tau * w * tranpose(w)\n */\n\n /*\n * -- calculate R = R - tau * w * tranpose(w) * R --\n * Only do calculation with rows k to (rows-1)\n * Additionally columns 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (j = k; j < cols; j++) {\n s = 0.0\n\n // calculate jth element of [tranpose(w) * R]\n for (i = k; i < rows; i++) {\n s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]))\n }\n\n // calculate the jth element of [tau * transpose(w) * R]\n s = multiplyScalar(s, tau)\n\n for (i = k; i < rows; i++) {\n Rdata[i][j] = multiplyScalar(\n subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)),\n conjSgn\n )\n }\n }\n /*\n * -- calculate Q = Q - tau * Q * w * transpose(w) --\n * Q is a square matrix (rows x rows)\n * Only do calculation with columns k to (rows-1)\n * Additionally rows 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (i = 0; i < rows; i++) {\n s = 0.0\n\n // calculate ith element of [Q * w]\n for (j = k; j < rows; j++) {\n s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]))\n }\n\n // calculate the ith element of [tau * Q * w]\n s = multiplyScalar(s, tau)\n\n for (j = k; j < rows; ++j) {\n Qdata[i][j] = divideScalar(\n subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))),\n conjSgn\n )\n }\n }\n }\n }\n\n // return matrices\n return {\n Q,\n R,\n toString: function () {\n return 'Q: ' + this.Q.toString() + '\\nR: ' + this.R.toString()\n }\n }\n }\n\n function _denseQR (m) {\n const ret = _denseQRimpl(m)\n const Rdata = ret.R._data\n if (m._data.length > 0) {\n const zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0\n\n for (let i = 0; i < Rdata.length; ++i) {\n for (let j = 0; j < i && j < (Rdata[0] || []).length; ++j) {\n Rdata[i][j] = zero\n }\n }\n }\n\n return ret\n }\n\n function _sparseQR (m) {\n throw new Error('qr not implemented for sparse matrices yet')\n }\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Depth-first search and postorder of a tree rooted at node j\n *\n * @param {Number} j The tree node\n * @param {Number} k\n * @param {Array} w The workspace array\n * @param {Number} head The index offset within the workspace for the head array\n * @param {Number} next The index offset within the workspace for the next array\n * @param {Array} post The post ordering array\n * @param {Number} stack The index offset within the workspace for the stack array\n */\nexport function csTdfs (j, k, w, head, next, post, stack) {\n // variables\n let top = 0\n // place j on the stack\n w[stack] = j\n // while (stack is not empty)\n while (top >= 0) {\n // p = top of stack\n const p = w[stack + top]\n // i = youngest child of p\n const i = w[head + p]\n if (i === -1) {\n // p has no unordered children left\n top--\n // node p is the kth postordered node\n post[k++] = p\n } else {\n // remove i from children of p\n w[head + p] = w[next + i]\n // increment top\n ++top\n // start dfs on child node i\n w[stack + top] = i\n }\n }\n return k\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function \"flips\" its input about the integer -1.\n *\n * @param {Number} i The value to flip\n */\nexport function csFlip (i) {\n // flip the value\n return -i - 2\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js'\nimport { csFkeep } from './csFkeep.js'\nimport { csFlip } from './csFlip.js'\nimport { csTdfs } from './csTdfs.js'\n\nconst name = 'csAmd'\nconst dependencies = [\n 'add',\n 'multiply',\n 'transpose'\n]\n\nexport const createCsAmd = /* #__PURE__ */ factory(name, dependencies, ({ add, multiply, transpose }) => {\n /**\n * Approximate minimum degree ordering. The minimum degree algorithm is a widely used\n * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization\n * than A. It is a gready method that selects the sparsest pivot row and column during the course\n * of a right looking sparse Cholesky factorization.\n *\n * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR\n * @param {Matrix} m Sparse Matrix\n */\n return function csAmd (order, a) {\n // check input parameters\n if (!a || order <= 0 || order > 3) { return null }\n // a matrix arrays\n const asize = a._size\n // rows and columns\n const m = asize[0]\n const n = asize[1]\n // initialize vars\n let lemax = 0\n // dense threshold\n let dense = Math.max(16, 10 * Math.sqrt(n))\n dense = Math.min(n - 2, dense)\n // create target matrix C\n const cm = _createTargetMatrix(order, a, m, n, dense)\n // drop diagonal entries\n csFkeep(cm, _diag, null)\n // C matrix arrays\n const cindex = cm._index\n const cptr = cm._ptr\n\n // number of nonzero elements in C\n let cnz = cptr[n]\n\n // allocate result (n+1)\n const P = []\n\n // create workspace (8 * (n + 1))\n const W = []\n const len = 0 // first n + 1 entries\n const nv = n + 1 // next n + 1 entries\n const next = 2 * (n + 1) // next n + 1 entries\n const head = 3 * (n + 1) // next n + 1 entries\n const elen = 4 * (n + 1) // next n + 1 entries\n const degree = 5 * (n + 1) // next n + 1 entries\n const w = 6 * (n + 1) // next n + 1 entries\n const hhead = 7 * (n + 1) // last n + 1 entries\n\n // use P as workspace for last\n const last = P\n\n // initialize quotient graph\n let mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree)\n\n // initialize degree lists\n let nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next)\n\n // minimum degree node\n let mindeg = 0\n\n // vars\n let i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d\n\n // while (selecting pivots) do\n while (nel < n) {\n // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first\n // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow\n // many nodes have been eliminated.\n for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++);\n if (W[next + k] !== -1) { last[W[next + k]] = -1 }\n // remove k from degree list\n W[head + mindeg] = W[next + k]\n // elenk = |Ek|\n const elenk = W[elen + k]\n // # of nodes k represents\n let nvk = W[nv + k]\n // W[nv + k] nodes of A eliminated\n nel += nvk\n\n // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is\n // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the\n // degree lists. All elements e in Ek are absorved into element k.\n let dk = 0\n // flag k as in Lk\n W[nv + k] = -nvk\n let p = cptr[k]\n // do in place if W[elen + k] === 0\n const pk1 = (elenk === 0) ? p : cnz\n let pk2 = pk1\n for (k1 = 1; k1 <= elenk + 1; k1++) {\n if (k1 > elenk) {\n // search the nodes in k\n e = k\n // list of nodes starts at cindex[pj]\n pj = p\n // length of list of nodes in k\n ln = W[len + k] - elenk\n } else {\n // search the nodes in e\n e = cindex[p++]\n pj = cptr[e]\n // length of list of nodes in e\n ln = W[len + e]\n }\n for (k2 = 1; k2 <= ln; k2++) {\n i = cindex[pj++]\n // check node i dead, or seen\n if ((nvi = W[nv + i]) <= 0) { continue }\n // W[degree + Lk] += size of node i\n dk += nvi\n // negate W[nv + i] to denote i in Lk\n W[nv + i] = -nvi\n // place i in Lk\n cindex[pk2++] = i\n if (W[next + i] !== -1) { last[W[next + i]] = last[i] }\n // check we need to remove i from degree list\n if (last[i] !== -1) { W[next + last[i]] = W[next + i] } else { W[head + W[degree + i]] = W[next + i] }\n }\n if (e !== k) {\n // absorb e into k\n cptr[e] = csFlip(k)\n // e is now a dead element\n W[w + e] = 0\n }\n }\n // cindex[cnz...nzmax] is free\n if (elenk !== 0) { cnz = pk2 }\n // external degree of k - |Lk\\i|\n W[degree + k] = dk\n // element k is in cindex[pk1..pk2-1]\n cptr[k] = pk1\n W[len + k] = pk2 - pk1\n // k is now an element\n W[elen + k] = -2\n\n // Find set differences. The scan1 function now computes the set differences |Le \\ Lk| for all elements e. At the start of the\n // scan, no entry in the w array is greater than or equal to mark.\n\n // clear w if necessary\n mark = _wclear(mark, lemax, W, w, n)\n // scan 1: find |Le\\Lk|\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk]\n // check if W[elen + i] empty, skip it\n if ((eln = W[elen + i]) <= 0) { continue }\n // W[nv + i] was negated\n nvi = -W[nv + i]\n const wnvi = mark - nvi\n // scan Ei\n for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) {\n e = cindex[p]\n if (W[w + e] >= mark) {\n // decrement |Le\\Lk|\n W[w + e] -= nvi\n } else if (W[w + e] !== 0) {\n // ensure e is a live element, 1st time e seen in scan 1\n W[w + e] = W[degree + e] + wnvi\n }\n }\n }\n\n // degree update\n // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash\n // function h(i) for all nodes in Lk.\n\n // scan2: degree update\n for (pk = pk1; pk < pk2; pk++) {\n // consider node i in Lk\n i = cindex[pk]\n p1 = cptr[i]\n p2 = p1 + W[elen + i] - 1\n pn = p1\n // scan Ei\n for (h = 0, d = 0, p = p1; p <= p2; p++) {\n e = cindex[p]\n // check e is an unabsorbed element\n if (W[w + e] !== 0) {\n // dext = |Le\\Lk|\n const dext = W[w + e] - mark\n if (dext > 0) {\n // sum up the set differences\n d += dext\n // keep e in Ei\n cindex[pn++] = e\n // compute the hash of node i\n h += e\n } else {\n // aggressive absorb. e->k\n cptr[e] = csFlip(k)\n // e is a dead element\n W[w + e] = 0\n }\n }\n }\n // W[elen + i] = |Ei|\n W[elen + i] = pn - p1 + 1\n const p3 = pn\n const p4 = p1 + W[len + i]\n // prune edges in Ai\n for (p = p2 + 1; p < p4; p++) {\n j = cindex[p]\n // check node j dead or in Lk\n const nvj = W[nv + j]\n if (nvj <= 0) { continue }\n // degree(i) += |j|\n d += nvj\n // place j in node list of i\n cindex[pn++] = j\n // compute hash for node i\n h += j\n }\n // check for mass elimination\n if (d === 0) {\n // absorb i into k\n cptr[i] = csFlip(k)\n nvi = -W[nv + i]\n // |Lk| -= |i|\n dk -= nvi\n // |k| += W[nv + i]\n nvk += nvi\n nel += nvi\n W[nv + i] = 0\n // node i is dead\n W[elen + i] = -1\n } else {\n // update degree(i)\n W[degree + i] = Math.min(W[degree + i], d)\n // move first node to end\n cindex[pn] = cindex[p3]\n // move 1st el. to end of Ei\n cindex[p3] = cindex[p1]\n // add k as 1st element in of Ei\n cindex[p1] = k\n // new len of adj. list of node i\n W[len + i] = pn - p1 + 1\n // finalize hash of i\n h = (h < 0 ? -h : h) % n\n // place i in hash bucket\n W[next + i] = W[hhead + h]\n W[hhead + h] = i\n // save hash of i in last[i]\n last[i] = h\n }\n }\n // finalize |Lk|\n W[degree + k] = dk\n lemax = Math.max(lemax, dk)\n // clear w\n mark = _wclear(mark + lemax, lemax, W, w, n)\n\n // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i.\n // If two nodes have identical adjacency lists, their hash functions wil be identical.\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk]\n // check i is dead, skip it\n if (W[nv + i] >= 0) { continue }\n // scan hash bucket of node i\n h = last[i]\n i = W[hhead + h]\n // hash bucket will be empty\n W[hhead + h] = -1\n for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) {\n ln = W[len + i]\n eln = W[elen + i]\n for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) { W[w + cindex[p]] = mark }\n let jlast = i\n // compare i with all j\n for (j = W[next + i]; j !== -1;) {\n let ok = W[len + j] === ln && W[elen + j] === eln\n for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) {\n // compare i and j\n if (W[w + cindex[p]] !== mark) { ok = 0 }\n }\n // check i and j are identical\n if (ok) {\n // absorb j into i\n cptr[j] = csFlip(i)\n W[nv + i] += W[nv + j]\n W[nv + j] = 0\n // node j is dead\n W[elen + j] = -1\n // delete j from hash bucket\n j = W[next + j]\n W[next + jlast] = j\n } else {\n // j and i are different\n jlast = j\n j = W[next + j]\n }\n }\n }\n }\n\n // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time.\n // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared.\n for (p = pk1, pk = pk1; pk < pk2; pk++) {\n i = cindex[pk]\n // check i is dead, skip it\n if ((nvi = -W[nv + i]) <= 0) { continue }\n // restore W[nv + i]\n W[nv + i] = nvi\n // compute external degree(i)\n d = W[degree + i] + dk - nvi\n d = Math.min(d, n - nel - nvi)\n if (W[head + d] !== -1) { last[W[head + d]] = i }\n // put i back in degree list\n W[next + i] = W[head + d]\n last[i] = -1\n W[head + d] = i\n // find new minimum degree\n mindeg = Math.min(mindeg, d)\n W[degree + i] = d\n // place i in Lk\n cindex[p++] = i\n }\n // # nodes absorbed into k\n W[nv + k] = nvk\n // length of adj list of element k\n if ((W[len + k] = p - pk1) === 0) {\n // k is a root of the tree\n cptr[k] = -1\n // k is now a dead element\n W[w + k] = 0\n }\n if (elenk !== 0) {\n // free unused space in Lk\n cnz = p\n }\n }\n\n // Postordering. The elimination is complete, but no permutation has been computed. All that is left\n // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if\n // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation\n // is computed. The tree is restored by unflipping all of ptr.\n\n // fix assembly tree\n for (i = 0; i < n; i++) { cptr[i] = csFlip(cptr[i]) }\n for (j = 0; j <= n; j++) { W[head + j] = -1 }\n // place unordered nodes in lists\n for (j = n; j >= 0; j--) {\n // skip if j is an element\n if (W[nv + j] > 0) { continue }\n // place j in list of its parent\n W[next + j] = W[head + cptr[j]]\n W[head + cptr[j]] = j\n }\n // place elements in lists\n for (e = n; e >= 0; e--) {\n // skip unless e is an element\n if (W[nv + e] <= 0) { continue }\n if (cptr[e] !== -1) {\n // place e in list of its parent\n W[next + e] = W[head + cptr[e]]\n W[head + cptr[e]] = e\n }\n }\n // postorder the assembly tree\n for (k = 0, i = 0; i <= n; i++) {\n if (cptr[i] === -1) { k = csTdfs(i, k, W, head, next, P, w) }\n }\n // remove last item in array\n P.splice(P.length - 1, 1)\n // return P\n return P\n }\n\n /**\n * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation\n * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.\n *\n * Order: 0\n * A natural ordering P=null matrix is returned.\n *\n * Order: 1\n * Matrix must be square. This is appropriate for a Cholesky or LU factorization.\n * P = M + M'\n *\n * Order: 2\n * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.\n * P = M' * M\n *\n * Order: 3\n * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.\n * P = M' * M\n */\n function _createTargetMatrix (order, a, m, n, dense) {\n // compute A'\n const at = transpose(a)\n\n // check order = 1, matrix must be square\n if (order === 1 && n === m) {\n // C = A + A'\n return add(a, at)\n }\n\n // check order = 2, drop dense columns from M'\n if (order === 2) {\n // transpose arrays\n const tindex = at._index\n const tptr = at._ptr\n // new column index\n let p2 = 0\n // loop A' columns (rows)\n for (let j = 0; j < m; j++) {\n // column j of AT starts here\n let p = tptr[j]\n // new column j starts here\n tptr[j] = p2\n // skip dense col j\n if (tptr[j + 1] - p > dense) { continue }\n // map rows in column j of A\n for (const p1 = tptr[j + 1]; p < p1; p++) { tindex[p2++] = tindex[p] }\n }\n // finalize AT\n tptr[m] = p2\n // recreate A from new transpose matrix\n a = transpose(at)\n // use A' * A\n return multiply(at, a)\n }\n\n // use A' * A, square or rectangular matrix\n return multiply(at, a)\n }\n\n /**\n * Initialize quotient graph. There are four kind of nodes and elements that must be represented:\n *\n * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode.\n * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]).\n * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot.\n * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]).\n */\n function _initializeQuotientGraph (n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {\n // Initialize quotient graph\n for (let k = 0; k < n; k++) { W[len + k] = cptr[k + 1] - cptr[k] }\n W[len + n] = 0\n // initialize workspace\n for (let i = 0; i <= n; i++) {\n // degree list i is empty\n W[head + i] = -1\n last[i] = -1\n W[next + i] = -1\n // hash list i is empty\n W[hhead + i] = -1\n // node i is just one node\n W[nv + i] = 1\n // node i is alive\n W[w + i] = 1\n // Ek of node i is empty\n W[elen + i] = 0\n // degree of node i\n W[degree + i] = W[len + i]\n }\n // clear w\n const mark = _wclear(0, 0, W, w, n)\n // n is a dead element\n W[elen + n] = -2\n // n is a root of assembly tree\n cptr[n] = -1\n // n is a dead element\n W[w + n] = 0\n // return mark\n return mark\n }\n\n /**\n * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with\n * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the\n * output permutation p.\n */\n function _initializeDegreeLists (n, cptr, W, degree, elen, w, dense, nv, head, last, next) {\n // result\n let nel = 0\n // loop columns\n for (let i = 0; i < n; i++) {\n // degree @ i\n const d = W[degree + i]\n // check node i is empty\n if (d === 0) {\n // element i is dead\n W[elen + i] = -2\n nel++\n // i is a root of assembly tree\n cptr[i] = -1\n W[w + i] = 0\n } else if (d > dense) {\n // absorb i into element n\n W[nv + i] = 0\n // node i is dead\n W[elen + i] = -1\n nel++\n cptr[i] = csFlip(n)\n W[nv + n]++\n } else {\n const h = W[head + d]\n if (h !== -1) { last[h] = i }\n // put node i in degree list d\n W[next + i] = W[head + d]\n W[head + d] = i\n }\n }\n return nel\n }\n\n function _wclear (mark, lemax, W, w, n) {\n if (mark < 2 || (mark + lemax < 0)) {\n for (let k = 0; k < n; k++) {\n if (W[w + k] !== 0) { W[w + k] = 1 }\n }\n mark = 2\n }\n // at this point, W [0..n-1] < mark holds\n return mark\n }\n\n function _diag (i, j) {\n return i !== j\n }\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise\n *\n * @param {Matrix} a The sparse matrix\n * @param {function} callback The callback function, function will be invoked with the following args:\n * - The entry row\n * - The entry column\n * - The entry value\n * - The state parameter\n * @param {any} other The state\n *\n * @return The number of nonzero elements in the matrix\n */\nexport function csFkeep (a, callback, other) {\n // a arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n // columns\n const n = asize[1]\n // nonzero items\n let nz = 0\n // loop columns\n for (let j = 0; j < n; j++) {\n // get current location of col j\n let p = aptr[j]\n // record new location of col j\n aptr[j] = nz\n for (; p < aptr[j + 1]; p++) {\n // check we need to keep this item\n if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) {\n // keep A(i,j)\n aindex[nz] = aindex[p]\n // check we need to process values (pattern only)\n if (avalues) { avalues[nz] = avalues[p] }\n // increment nonzero items\n nz++\n }\n }\n }\n // finalize A\n aptr[n] = nz\n // trim arrays\n aindex.splice(nz, aindex.length - nz)\n // check we need to process values (pattern only)\n if (avalues) { avalues.splice(nz, avalues.length - nz) }\n // return number of nonzero items\n return nz\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function determines if j is a leaf of the ith row subtree.\n * Consider A(i,j), node j in ith row subtree and return lca(jprev,j)\n *\n * @param {Number} i The ith row subtree\n * @param {Number} j The node to test\n * @param {Array} w The workspace array\n * @param {Number} first The index offset within the workspace for the first array\n * @param {Number} maxfirst The index offset within the workspace for the maxfirst array\n * @param {Number} prevleaf The index offset within the workspace for the prevleaf array\n * @param {Number} ancestor The index offset within the workspace for the ancestor array\n *\n * @return {Object}\n */\nexport function csLeaf (i, j, w, first, maxfirst, prevleaf, ancestor) {\n let s, sparent\n\n // our result\n let jleaf = 0\n let q\n\n // check j is a leaf\n if (i <= j || w[first + j] <= w[maxfirst + i]) { return (-1) }\n // update max first[j] seen so far\n w[maxfirst + i] = w[first + j]\n // jprev = previous leaf of ith subtree\n const jprev = w[prevleaf + i]\n w[prevleaf + i] = j\n\n // check j is first or subsequent leaf\n if (jprev === -1) {\n // 1st leaf, q = root of ith subtree\n jleaf = 1\n q = i\n } else {\n // update jleaf\n jleaf = 2\n // q = least common ancester (jprev,j)\n for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);\n for (s = jprev; s !== q; s = sparent) {\n // path compression\n sparent = w[ancestor + s]\n w[ancestor + s] = q\n }\n }\n return { jleaf, q }\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js'\nimport { csLeaf } from './csLeaf.js'\n\nconst name = 'csCounts'\nconst dependencies = [\n 'transpose'\n]\n\nexport const createCsCounts = /* #__PURE__ */ factory(name, dependencies, ({ transpose }) => {\n /**\n * Computes the column counts using the upper triangular part of A.\n * It transposes A internally, none of the input parameters are modified.\n *\n * @param {Matrix} a The sparse matrix A\n *\n * @param {Matrix} ata Count the columns of A'A instead\n *\n * @return An array of size n of the column counts or null on error\n */\n return function (a, parent, post, ata) {\n // check inputs\n if (!a || !parent || !post) { return null }\n // a matrix arrays\n const asize = a._size\n // rows and columns\n const m = asize[0]\n const n = asize[1]\n // variables\n let i, j, k, J, p, p0, p1\n\n // workspace size\n const s = 4 * n + (ata ? (n + m + 1) : 0)\n // allocate workspace\n const w = [] // (s)\n const ancestor = 0 // first n entries\n const maxfirst = n // next n entries\n const prevleaf = 2 * n // next n entries\n const first = 3 * n // next n entries\n const head = 4 * n // next n + 1 entries (used when ata is true)\n const next = 5 * n + 1 // last entries in workspace\n // clear workspace w[0..s-1]\n for (k = 0; k < s; k++) { w[k] = -1 }\n\n // allocate result\n const colcount = [] // (n)\n\n // AT = A'\n const at = transpose(a)\n // at arrays\n const tindex = at._index\n const tptr = at._ptr\n\n // find w[first + j]\n for (k = 0; k < n; k++) {\n j = post[k]\n // colcount[j]=1 if j is a leaf\n colcount[j] = (w[first + j] === -1) ? 1 : 0\n for (; j !== -1 && w[first + j] === -1; j = parent[j]) { w[first + j] = k }\n }\n\n // initialize ata if needed\n if (ata) {\n // invert post\n for (k = 0; k < n; k++) { w[post[k]] = k }\n // loop rows (columns in AT)\n for (i = 0; i < m; i++) {\n // values in column i of AT\n for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) { k = Math.min(k, w[tindex[p]]) }\n // place row i in linked list k\n w[next + i] = w[head + k]\n w[head + k] = i\n }\n }\n\n // each node in its own set\n for (i = 0; i < n; i++) { w[ancestor + i] = i }\n\n for (k = 0; k < n; k++) {\n // j is the kth node in postordered etree\n j = post[k]\n // check j is not a root\n if (parent[j] !== -1) { colcount[parent[j]]-- }\n\n // J=j for LL'=A case\n for (J = (ata ? w[head + k] : j); J !== -1; J = (ata ? w[next + J] : -1)) {\n for (p = tptr[J]; p < tptr[J + 1]; p++) {\n i = tindex[p]\n const r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor)\n // check A(i,j) is in skeleton\n if (r.jleaf >= 1) { colcount[j]++ }\n // check account for overlap in q\n if (r.jleaf === 2) { colcount[r.q]-- }\n }\n }\n if (parent[j] !== -1) { w[ancestor + j] = parent[j] }\n }\n // sum up colcount's of each child\n for (j = 0; j < n; j++) {\n if (parent[j] !== -1) { colcount[parent[j]] += colcount[j] }\n }\n return colcount\n }\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csPermute } from './csPermute.js'\nimport { csPost } from './csPost.js'\nimport { csEtree } from './csEtree.js'\nimport { createCsAmd } from './csAmd.js'\nimport { createCsCounts } from './csCounts.js'\nimport { factory } from '../../../utils/factory.js'\n\nconst name = 'csSqr'\nconst dependencies = [\n 'add',\n 'multiply',\n 'transpose'\n]\n\nexport const createCsSqr = /* #__PURE__ */ factory(name, dependencies, ({ add, multiply, transpose }) => {\n const csAmd = createCsAmd({ add, multiply, transpose })\n const csCounts = createCsCounts({ transpose })\n\n /**\n * Symbolic ordering and analysis for QR and LU decompositions.\n *\n * @param {Number} order The ordering strategy (see csAmd for more details)\n * @param {Matrix} a The A matrix\n * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or\n * symbolic ordering and analysis for LU decomposition (false)\n *\n * @return {Object} The Symbolic ordering and analysis for matrix A\n */\n return function csSqr (order, a, qr) {\n // a arrays\n const aptr = a._ptr\n const asize = a._size\n // columns\n const n = asize[1]\n // vars\n let k\n // symbolic analysis result\n const s = {}\n // fill-reducing ordering\n s.q = csAmd(order, a)\n // validate results\n if (order && !s.q) { return null }\n // QR symbolic analysis\n if (qr) {\n // apply permutations if needed\n const c = order ? csPermute(a, null, s.q, 0) : a\n // etree of C'*C, where C=A(:,q)\n s.parent = csEtree(c, 1)\n // post order elimination tree\n const post = csPost(s.parent, n)\n // col counts chol(C'*C)\n s.cp = csCounts(c, s.parent, post, 1)\n // check we have everything needed to calculate number of nonzero elements\n if (c && s.parent && s.cp && _vcount(c, s)) {\n // calculate number of nonzero elements\n for (s.unz = 0, k = 0; k < n; k++) { s.unz += s.cp[k] }\n }\n } else {\n // for LU factorization only, guess nnz(L) and nnz(U)\n s.unz = 4 * (aptr[n]) + n\n s.lnz = s.unz\n }\n // return result S\n return s\n }\n\n /**\n * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent\n */\n function _vcount (a, s) {\n // a arrays\n const aptr = a._ptr\n const aindex = a._index\n const asize = a._size\n // rows & columns\n const m = asize[0]\n const n = asize[1]\n // initialize s arrays\n s.pinv = [] // (m + n)\n s.leftmost = [] // (m)\n // vars\n const parent = s.parent\n const pinv = s.pinv\n const leftmost = s.leftmost\n // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n const w = [] // (m + 3 * n)\n const next = 0\n const head = m\n const tail = m + n\n const nque = m + 2 * n\n // vars\n let i, k, p, p0, p1\n // initialize w\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1\n w[tail + k] = -1\n w[nque + k] = 0\n }\n // initialize row arrays\n for (i = 0; i < m; i++) { leftmost[i] = -1 }\n // loop columns backwards\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k\n }\n }\n // scan rows in reverse order\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1\n k = leftmost[i]\n // check row i is empty\n if (k === -1) { continue }\n // first row in queue k\n if (w[nque + k]++ === 0) { w[tail + k] = i }\n // put i at head of queue k\n w[next + i] = w[head + k]\n w[head + k] = i\n }\n s.lnz = 0\n s.m2 = m\n // find row permutation and nnz(V)\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k]\n // count V(k,k) as nonzero\n s.lnz++\n // add a fictitious row\n if (i < 0) { i = s.m2++ }\n // associate row i with V(:,k)\n pinv[i] = k\n // skip if V(k+1:m,k) is empty\n if (--nque[k] <= 0) { continue }\n // nque[k] is nnz (V(k+1:m,k))\n s.lnz += w[nque + k]\n // move all rows to parent of k\n const pa = parent[k]\n if (pa !== -1) {\n if (w[nque + pa] === 0) { w[tail + pa] = w[tail + k] }\n w[next + w[tail + k]] = w[head + pa]\n w[head + pa] = w[next + i]\n w[nque + pa] += w[nque + k]\n }\n }\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) { pinv[i] = k++ }\n }\n return true\n }\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a sparse matrix C = P * A * Q\n *\n * @param {SparseMatrix} a The Matrix A\n * @param {Array} pinv The row permutation vector\n * @param {Array} q The column permutation vector\n * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise\n *\n * @return {Matrix} C = P * A * Q, null on error\n */\nexport function csPermute (a, pinv, q, values) {\n // a arrays\n const avalues = a._values\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n const adt = a._datatype\n // rows & columns\n const m = asize[0]\n const n = asize[1]\n // c arrays\n const cvalues = values && a._values ? [] : null\n const cindex = [] // (aptr[n])\n const cptr = [] // (n + 1)\n // initialize vars\n let nz = 0\n // loop columns\n for (let k = 0; k < n; k++) {\n // column k of C is column q[k] of A\n cptr[k] = nz\n // apply column permutation\n const j = q ? (q[k]) : k\n // loop values in column j of A\n for (let t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) {\n // row i of A is row pinv[i] of C\n const r = pinv ? pinv[aindex[t]] : aindex[t]\n // index\n cindex[nz] = r\n // check we need to populate values\n if (cvalues) { cvalues[nz] = avalues[t] }\n // increment number of nonzero elements\n nz++\n }\n }\n // finalize the last column of C\n cptr[n] = nz\n // return C matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [m, n],\n datatype: adt\n })\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Computes the elimination tree of Matrix A (using triu(A)) or the\n * elimination tree of A'A without forming A'A.\n *\n * @param {Matrix} a The A Matrix\n * @param {boolean} ata A value of true the function computes the etree of A'A\n */\nexport function csEtree (a, ata) {\n // check inputs\n if (!a) { return null }\n // a arrays\n const aindex = a._index\n const aptr = a._ptr\n const asize = a._size\n // rows & columns\n const m = asize[0]\n const n = asize[1]\n\n // allocate result\n const parent = [] // (n)\n\n // allocate workspace\n const w = [] // (n + (ata ? m : 0))\n const ancestor = 0 // first n entries in w\n const prev = n // last m entries (ata = true)\n\n let i, inext\n\n // check we are calculating A'A\n if (ata) {\n // initialize workspace\n for (i = 0; i < m; i++) { w[prev + i] = -1 }\n }\n // loop columns\n for (let k = 0; k < n; k++) {\n // node k has no parent yet\n parent[k] = -1\n // nor does k have an ancestor\n w[ancestor + k] = -1\n // values in column k\n for (let p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // row\n const r = aindex[p]\n // node\n i = ata ? (w[prev + r]) : r\n // traverse from i to k\n for (; i !== -1 && i < k; i = inext) {\n // inext = ancestor of i\n inext = w[ancestor + i]\n // path compression\n w[ancestor + i] = k\n // check no anc., parent is k\n if (inext === -1) { parent[i] = k }\n }\n if (ata) { w[prev + r] = k }\n }\n }\n return parent\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csTdfs } from './csTdfs.js'\n\n/**\n * Post order a tree of forest\n *\n * @param {Array} parent The tree or forest\n * @param {Number} n Number of columns\n */\nexport function csPost (parent, n) {\n // check inputs\n if (!parent) { return null }\n // vars\n let k = 0\n let j\n // allocate result\n const post = [] // (n)\n // workspace, head: first n entries, next: next n entries, stack: last n entries\n const w = [] // (3 * n)\n const head = 0\n const next = n\n const stack = 2 * n\n // initialize workspace\n for (j = 0; j < n; j++) {\n // empty linked lists\n w[head + j] = -1\n }\n // traverse nodes in reverse order\n for (j = n - 1; j >= 0; j--) {\n // check j is a root\n if (parent[j] === -1) { continue }\n // add j to list of its parent\n w[next + j] = w[head + parent[j]]\n w[head + parent[j]] = j\n }\n // loop nodes\n for (j = 0; j < n; j++) {\n // skip j if it is not a root\n if (parent[j] !== -1) { continue }\n // depth-first search\n k = csTdfs(j, k, w, head, next, post, stack)\n }\n return post\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Checks if the node at w[j] is marked\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMarked (w, j) {\n // check node is marked\n return w[j] < 0\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csFlip } from './csFlip.js'\n\n/**\n * Marks the node at w[j]\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMark (w, j) {\n // mark w[j]\n w[j] = csFlip(w[j])\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csFlip } from './csFlip.js'\n\n/**\n * Flips the value if it is negative of returns the same value otherwise.\n *\n * @param {Number} i The value to flip\n */\nexport function csUnflip (i) {\n // flip the value if it is negative\n return i < 0 ? csFlip(i) : i\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csMarked } from './csMarked.js'\nimport { csMark } from './csMark.js'\nimport { csUnflip } from './csUnflip.js'\n\n/**\n * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting\n * at nodes in B (see csReach()).\n *\n * @param {Number} j The starting node for the DFS algorithm\n * @param {Matrix} g The G matrix to search, ptr array modified, then restored\n * @param {Number} top Start index in stack xi[top..n-1]\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n *\n * @return {Number} New value of top\n */\nexport function csDfs (j, g, top, xi, pinv) {\n // g arrays\n const index = g._index\n const ptr = g._ptr\n const size = g._size\n // columns\n const n = size[1]\n // vars\n let i, p, p2\n // initialize head\n let head = 0\n // initialize the recursion stack\n xi[0] = j\n // loop\n while (head >= 0) {\n // get j from the top of the recursion stack\n j = xi[head]\n // apply permutation vector\n const jnew = pinv ? pinv[j] : j\n // check node j is marked\n if (!csMarked(ptr, j)) {\n // mark node j as visited\n csMark(ptr, j)\n // update stack (last n entries in xi)\n xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew])\n }\n // node j done if no unvisited neighbors\n let done = 1\n // examine all neighbors of j, stack (last n entries in xi)\n for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) {\n // consider neighbor node i\n i = index[p]\n // check we have visited node i, skip it\n if (csMarked(ptr, i)) { continue }\n // pause depth-first search of node j, update stack (last n entries in xi)\n xi[n + head] = p\n // start dfs at node i\n xi[++head] = i\n // node j is not done\n done = 0\n // break, to start dfs(i)\n break\n }\n // check depth-first search at node j is done\n if (done) {\n // remove j from the recursion stack\n head--\n // and place in the output stack\n xi[--top] = j\n }\n }\n return top\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csReach } from './csReach.js'\nimport { factory } from '../../../utils/factory.js'\n\nconst name = 'csSpsolve'\nconst dependencies = [\n 'divideScalar',\n 'multiply',\n 'subtract'\n]\n\nexport const createCsSpsolve = /* #__PURE__ */ factory(name, dependencies, ({ divideScalar, multiply, subtract }) => {\n /**\n * The function csSpsolve() computes the solution to G * x = bk, where bk is the\n * kth column of B. When lo is true, the function assumes G = L is lower triangular with the\n * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U\n * is upper triangular with the diagonal entry as the last entry in each column.\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} x The soluton to the linear system G * x = b\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n * @param {boolean} lo The lower (true) upper triangular (false) flag\n *\n * @return {Number} The index for the nonzero pattern\n */\n return function csSpsolve (g, b, k, xi, x, pinv, lo) {\n // g arrays\n const gvalues = g._values\n const gindex = g._index\n const gptr = g._ptr\n const gsize = g._size\n // columns\n const n = gsize[1]\n // b arrays\n const bvalues = b._values\n const bindex = b._index\n const bptr = b._ptr\n // vars\n let p, p0, p1, q\n // xi[top..n-1] = csReach(B(:,k))\n const top = csReach(g, b, k, xi, pinv)\n // clear x\n for (p = top; p < n; p++) { x[xi[p]] = 0 }\n // scatter b\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) { x[bindex[p]] = bvalues[p] }\n // loop columns\n for (let px = top; px < n; px++) {\n // x array index for px\n const j = xi[px]\n // apply permutation vector (U x = b), j maps to column J of G\n const J = pinv ? pinv[j] : j\n // check column J is empty\n if (J < 0) { continue }\n // column value indeces in G, p0 <= p < p1\n p0 = gptr[J]\n p1 = gptr[J + 1]\n // x(j) /= G(j,j)\n x[j] = divideScalar(x[j], gvalues[lo ? p0 : (p1 - 1)])\n // first entry L(j,j)\n p = lo ? (p0 + 1) : p0\n q = lo ? (p1) : (p1 - 1)\n // loop\n for (; p < q; p++) {\n // row\n const i = gindex[p]\n // x(i) -= G(i,j) * x(j)\n x[i] = subtract(x[i], multiply(gvalues[p], x[j]))\n }\n }\n // return top of stack\n return top\n }\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csMarked } from './csMarked.js'\nimport { csMark } from './csMark.js'\nimport { csDfs } from './csDfs.js'\n\n/**\n * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1\n * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The\n * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B).\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector\n *\n * @return {Number} The index for the nonzero pattern\n */\nexport function csReach (g, b, k, xi, pinv) {\n // g arrays\n const gptr = g._ptr\n const gsize = g._size\n // b arrays\n const bindex = b._index\n const bptr = b._ptr\n // columns\n const n = gsize[1]\n // vars\n let p, p0, p1\n // initialize top\n let top = n\n // loop column indeces in B\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n // node i\n const i = bindex[p]\n // check node i is marked\n if (!csMarked(gptr, i)) {\n // start a dfs at unmarked node i\n top = csDfs(i, g, top, xi, pinv)\n }\n }\n // loop columns from top -> n - 1\n for (p = top; p < n; p++) {\n // restore G\n csMark(gptr, xi[p])\n }\n return top\n}\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { factory } from '../../../utils/factory.js'\nimport { createCsSpsolve } from './csSpsolve.js'\n\nconst name = 'csLu'\nconst dependencies = [\n 'abs',\n 'divideScalar',\n 'multiply',\n 'subtract',\n 'larger',\n 'largerEq',\n 'SparseMatrix'\n]\n\nexport const createCsLu = /* #__PURE__ */ factory(name, dependencies, ({ abs, divideScalar, multiply, subtract, larger, largerEq, SparseMatrix }) => {\n const csSpsolve = createCsSpsolve({ divideScalar, multiply, subtract })\n\n /**\n * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization\n * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L\n * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so\n * L * U = A(p, q), where p is the inverse of pinv.\n *\n * @param {Matrix} m The A Matrix to factorize\n * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing\n * column ordering q\n * @param {Number} tol Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Number} The numeric LU factorization of A or null\n */\n return function csLu (m, s, tol) {\n // validate input\n if (!m) { return null }\n // m arrays\n const size = m._size\n // columns\n const n = size[1]\n // symbolic analysis result\n let q\n let lnz = 100\n let unz = 100\n // update symbolic analysis parameters\n if (s) {\n q = s.q\n lnz = s.lnz || lnz\n unz = s.unz || unz\n }\n // L arrays\n const lvalues = [] // (lnz)\n const lindex = [] // (lnz)\n const lptr = [] // (n + 1)\n // L\n const L = new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: [n, n]\n })\n // U arrays\n const uvalues = [] // (unz)\n const uindex = [] // (unz)\n const uptr = [] // (n + 1)\n // U\n const U = new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: [n, n]\n })\n // inverse of permutation vector\n const pinv = [] // (n)\n // vars\n let i, p\n // allocate arrays\n const x = [] // (n)\n const xi = [] // (2 * n)\n // initialize variables\n for (i = 0; i < n; i++) {\n // clear workspace\n x[i] = 0\n // no rows pivotal yet\n pinv[i] = -1\n // no cols of L yet\n lptr[i + 1] = 0\n }\n // reset number of nonzero elements in L and U\n lnz = 0\n unz = 0\n // compute L(:,k) and U(:,k)\n for (let k = 0; k < n; k++) {\n // update ptr\n lptr[k] = lnz\n uptr[k] = unz\n // apply column permutations if needed\n const col = q ? q[k] : k\n // solve triangular system, x = L\\A(:,col)\n const top = csSpsolve(L, m, col, xi, x, pinv, 1)\n // find pivot\n let ipiv = -1\n let a = -1\n // loop xi[] from top -> n\n for (p = top; p < n; p++) {\n // x[i] is nonzero\n i = xi[p]\n // check row i is not yet pivotal\n if (pinv[i] < 0) {\n // absolute value of x[i]\n const xabs = abs(x[i])\n // check absoulte value is greater than pivot value\n if (larger(xabs, a)) {\n // largest pivot candidate so far\n a = xabs\n ipiv = i\n }\n } else {\n // x(i) is the entry U(pinv[i],k)\n uindex[unz] = pinv[i]\n uvalues[unz++] = x[i]\n }\n }\n // validate we found a valid pivot\n if (ipiv === -1 || a <= 0) { return null }\n // update actual pivot column, give preference to diagonal value\n if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) { ipiv = col }\n // the chosen pivot\n const pivot = x[ipiv]\n // last entry in U(:,k) is U(k,k)\n uindex[unz] = k\n uvalues[unz++] = pivot\n // ipiv is the kth pivot row\n pinv[ipiv] = k\n // first entry in L(:,k) is L(k,k) = 1\n lindex[lnz] = ipiv\n lvalues[lnz++] = 1\n // L(k+1:n,k) = x / pivot\n for (p = top; p < n; p++) {\n // row\n i = xi[p]\n // check x(i) is an entry in L(:,k)\n if (pinv[i] < 0) {\n // save unpermuted row in L\n lindex[lnz] = i\n // scale pivot column\n lvalues[lnz++] = divideScalar(x[i], pivot)\n }\n // x[0..n-1] = 0 for next k\n x[i] = 0\n }\n }\n // update ptr\n lptr[n] = lnz\n uptr[n] = unz\n // fix row indices of L for final pinv\n for (p = 0; p < lnz; p++) { lindex[p] = pinv[lindex[p]] }\n // trim arrays\n lvalues.splice(lnz, lvalues.length - lnz)\n lindex.splice(lnz, lindex.length - lnz)\n uvalues.splice(unz, uvalues.length - unz)\n uindex.splice(unz, uindex.length - unz)\n // return LU factor\n return { L, U, pinv }\n }\n})\n","import { isInteger } from '../../../utils/number.js'\nimport { factory } from '../../../utils/factory.js'\nimport { createCsSqr } from '../sparse/csSqr.js'\nimport { createCsLu } from '../sparse/csLu.js'\n\nconst name = 'slu'\nconst dependencies = [\n 'typed',\n 'abs',\n 'add',\n 'multiply',\n 'transpose',\n 'divideScalar',\n 'subtract',\n 'larger',\n 'largerEq',\n 'SparseMatrix'\n]\n\nexport const createSlu = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, add, multiply, transpose, divideScalar, subtract, larger, largerEq, SparseMatrix }) => {\n const csSqr = createCsSqr({ add, multiply, transpose })\n const csLu = createCsLu({ abs, divideScalar, multiply, subtract, larger, largerEq, SparseMatrix })\n\n /**\n * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where\n *\n * `P * A * Q = L * U`\n *\n * Syntax:\n *\n * math.slu(A, order, threshold)\n *\n * Examples:\n *\n * const A = math.sparse([[4,3], [6, 3]])\n * math.slu(A, 1, 0.001)\n * // returns:\n * // {\n * // L: [[1, 0], [1.5, 1]]\n * // U: [[4, 3], [0, -1.5]]\n * // p: [0, 1]\n * // q: [0, 1]\n * // }\n *\n * See also:\n *\n * lup, lsolve, usolve, lusolve\n *\n * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition.\n * @param {Number} order The Symbolic Ordering and Analysis order:\n * 0 - Natural ordering, no permutation vector q is returned\n * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A'\n * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'.\n * This is appropriatefor LU factorization of unsymmetric matrices.\n * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows.\n * A dense row is a row with more than 10*sqr(columns) entries.\n * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors.\n */\n return typed(name, {\n\n 'SparseMatrix, number, number': function (a, order, threshold) {\n // verify order\n if (!isInteger(order) || order < 0 || order > 3) { throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]') }\n // verify threshold\n if (threshold < 0 || threshold > 1) { throw new Error('Partial pivoting threshold must be a number from 0 to 1') }\n\n // perform symbolic ordering and analysis\n const s = csSqr(order, a, false)\n\n // perform lu decomposition\n const f = csLu(a, s, threshold)\n\n // return decomposition\n return {\n L: f.L,\n U: f.U,\n p: f.pinv,\n q: s.q,\n toString: function () {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\np: ' + this.p.toString() + (this.q ? '\\nq: ' + this.q.toString() : '') + '\\n'\n }\n }\n }\n })\n})\n","// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b.\n *\n * @param {Array} p The permutation vector of length n. null value denotes identity\n * @param {Array} b The input vector\n *\n * @return {Array} The output vector x = P'b\n */\nexport function csIpvec (p, b) {\n // vars\n let k\n const n = b.length\n const x = []\n // check permutation vector was provided, p = null denotes identity\n if (p) {\n // loop vector\n for (k = 0; k < n; k++) {\n // apply permutation\n x[p[k]] = b[k]\n }\n } else {\n // loop vector\n for (k = 0; k < n; k++) {\n // x[i] = b[i]\n x[k] = b[k]\n }\n }\n return x\n}\n","import { isArray, isMatrix } from '../../../utils/is.js'\nimport { factory } from '../../../utils/factory.js'\nimport { createSolveValidation } from './utils/solveValidation.js'\nimport { csIpvec } from '../sparse/csIpvec.js'\n\nconst name = 'lusolve'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'lup',\n 'slu',\n 'usolve',\n 'lsolve',\n 'DenseMatrix'\n]\n\nexport const createLusolve = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, lup, slu, usolve, lsolve, DenseMatrix }) => {\n const solveValidation = createSolveValidation({ DenseMatrix })\n\n /**\n * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.\n *\n * Syntax:\n *\n * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b\n * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)\n *\n * Examples:\n *\n * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]\n *\n * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]]\n *\n * const f = math.lup(m)\n * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]]\n * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]]\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = math.lusolve(a, b) // [[2], [5]]\n *\n * See also:\n *\n * lup, slu, lsolve, usolve\n *\n * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition\n * @param {Matrix | Array} b Column Vector\n * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix\n * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.\n *\n * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b\n */\n return typed(name, {\n\n 'Array, Array | Matrix': function (a, b) {\n a = matrix(a)\n const d = lup(a)\n const x = _lusolve(d.L, d.U, d.p, null, b)\n return x.valueOf()\n },\n\n 'DenseMatrix, Array | Matrix': function (a, b) {\n const d = lup(a)\n return _lusolve(d.L, d.U, d.p, null, b)\n },\n\n 'SparseMatrix, Array | Matrix': function (a, b) {\n const d = lup(a)\n return _lusolve(d.L, d.U, d.p, null, b)\n },\n\n 'SparseMatrix, Array | Matrix, number, number': function (a, b, order, threshold) {\n const d = slu(a, order, threshold)\n return _lusolve(d.L, d.U, d.p, d.q, b)\n },\n\n 'Object, Array | Matrix': function (d, b) {\n return _lusolve(d.L, d.U, d.p, d.q, b)\n }\n })\n\n function _toMatrix (a) {\n if (isMatrix(a)) { return a }\n if (isArray(a)) { return matrix(a) }\n throw new TypeError('Invalid Matrix LU decomposition')\n }\n\n function _lusolve (l, u, p, q, b) {\n // verify decomposition\n l = _toMatrix(l)\n u = _toMatrix(u)\n\n // apply row permutations if needed (b is a DenseMatrix)\n if (p) {\n b = solveValidation(l, b, true)\n b._data = csIpvec(p, b._data)\n }\n\n // use forward substitution to resolve L * y = b\n const y = lsolve(l, b)\n // use backward substitution to resolve U * x = y\n const x = usolve(u, y)\n\n // apply column permutations if needed (x is a DenseMatrix)\n if (q) { x._data = csIpvec(q, x._data) }\n\n return x\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'polynomialRoot'\nconst dependencies = [\n 'typed',\n 'isZero',\n 'equalScalar',\n 'add',\n 'subtract',\n 'multiply',\n 'divide',\n 'sqrt',\n 'unaryMinus',\n 'cbrt',\n 'typeOf',\n 'im',\n 're'\n]\n\nexport const createPolynomialRoot = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n isZero,\n equalScalar,\n add,\n subtract,\n multiply,\n divide,\n sqrt,\n unaryMinus,\n cbrt,\n typeOf,\n im,\n re\n}) => {\n /**\n * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients.\n * Currently operates only on linear, quadratic, and cubic polynomials using the standard\n * formulas for the roots.\n *\n * Syntax:\n *\n * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)\n *\n * Examples:\n * // linear\n * math.polynomialRoot(6, 3) // [-2]\n * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i]\n * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i]\n * // quadratic\n * math.polynomialRoot(2, -3, 1) // [2, 1]\n * math.polynomialRoot(8, 8, 2) // [-2]\n * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951]\n * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i]\n * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i]\n * // cubic\n * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2]\n * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i]\n * math.polynomialRoot(0, 8, 8, 2) // [0, -2]\n * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i]\n *\n * See also:\n * cbrt, sqrt\n *\n * @param {... number | Complex} coeffs\n * The coefficients of the polynomial, starting with with the constant coefficent, followed\n * by the linear coefficient and subsequent coefficients of increasing powers.\n * @return {Array} The distinct roots of the polynomial\n */\n\n return typed(name, {\n 'number|Complex, ...number|Complex': (constant, restCoeffs) => {\n const coeffs = [constant, ...restCoeffs]\n while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) {\n coeffs.pop()\n }\n if (coeffs.length < 2) {\n throw new RangeError(\n `Polynomial [${constant}, ${restCoeffs}] must have a non-zero non-constant coefficient`)\n }\n switch (coeffs.length) {\n case 2: // linear\n return [unaryMinus(divide(coeffs[0], coeffs[1]))]\n case 3: { // quadratic\n const [c, b, a] = coeffs\n const denom = multiply(2, a)\n const d1 = multiply(b, b)\n const d2 = multiply(4, a, c)\n if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)]\n const discriminant = sqrt(subtract(d1, d2))\n return [\n divide(subtract(discriminant, b), denom),\n divide(subtract(unaryMinus(discriminant), b), denom)\n ]\n }\n case 4: { // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation\n const [d, c, b, a] = coeffs\n const denom = unaryMinus(multiply(3, a))\n const D0_1 = multiply(b, b)\n const D0_2 = multiply(3, a, c)\n const D1_1 = add(multiply(2, b, b, b), multiply(27, a, a, d))\n const D1_2 = multiply(9, a, b, c)\n if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) {\n return [divide(b, denom)]\n }\n const Delta0 = subtract(D0_1, D0_2)\n const Delta1 = subtract(D1_1, D1_2)\n const discriminant1 = add(\n multiply(18, a, b, c, d), multiply(b, b, c, c))\n const discriminant2 = add(\n multiply(4, b, b, b, d),\n multiply(4, a, c, c, c),\n multiply(27, a, a, d, d))\n if (equalScalar(discriminant1, discriminant2)) {\n return [\n divide(\n subtract(\n multiply(4, a, b, c),\n add(multiply(9, a, a, d), multiply(b, b, b))),\n multiply(a, Delta0)), // simple root\n divide(\n subtract(multiply(9, a, d), multiply(b, c)),\n multiply(2, Delta0)) // double root\n ]\n }\n // OK, we have three distinct roots\n let Ccubed\n if (equalScalar(D0_1, D0_2)) {\n Ccubed = Delta1\n } else {\n Ccubed = divide(\n add(\n Delta1,\n sqrt(subtract(\n multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))\n ),\n 2)\n }\n const allRoots = true\n const rawRoots = cbrt(Ccubed, allRoots).toArray().map(\n C => divide(add(b, C, divide(Delta0, C)), denom))\n return rawRoots.map(r => {\n if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) {\n return re(r)\n }\n return r\n })\n }\n default:\n throw new RangeError(`only implemented for cubic or lower-order polynomials, not ${coeffs}`)\n }\n }\n })\n})\n","import { isHelp } from '../utils/is.js'\nimport { clone } from '../utils/object.js'\nimport { format } from '../utils/string.js'\nimport { factory } from '../utils/factory.js'\n\nconst name = 'Help'\nconst dependencies = ['evaluate']\n\nexport const createHelpClass = /* #__PURE__ */ factory(name, dependencies, ({ evaluate }) => {\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help (doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n if (!doc) throw new Error('Argument \"doc\" missing')\n\n this.doc = doc\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help'\n Help.prototype.isHelp = true\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n const doc = this.doc || {}\n let desc = '\\n'\n\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n'\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n'\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n'\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n'\n }\n if (doc.examples) {\n desc += 'Examples:\\n'\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n let configChanged = false\n const originalConfig = evaluate('config()')\n\n const scope = {\n config: (newConfig) => {\n configChanged = true\n return evaluate('config(newConfig)', { newConfig })\n }\n }\n\n for (let i = 0; i < doc.examples.length; i++) {\n const expr = doc.examples[i]\n desc += ' ' + expr + '\\n'\n\n let res\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope)\n } catch (e) {\n res = e\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, { precision: 14 }) + '\\n'\n }\n }\n desc += '\\n'\n\n if (configChanged) {\n evaluate('config(originalConfig)', { originalConfig })\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n'\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n'\n }\n\n return desc\n }\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n const obj = clone(this.doc)\n obj.mathjs = 'Help'\n return obj\n }\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n const doc = {}\n\n Object.keys(json)\n .filter(prop => prop !== 'mathjs')\n .forEach(prop => {\n doc[prop] = json[prop]\n })\n\n return new Help(doc)\n }\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString\n\n return Help\n}, { isClass: true })\n","import { isChain } from '../../utils/is.js'\nimport { format } from '../../utils/string.js'\nimport { hasOwnProperty, lazy } from '../../utils/object.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'Chain'\nconst dependencies = ['?on', 'math', 'typed']\n\nexport const createChainClass = /* #__PURE__ */ factory(name, dependencies, ({ on, math, typed }) => {\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain (value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator')\n }\n\n if (isChain(value)) {\n this.value = value.value\n } else {\n this.value = value\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain'\n Chain.prototype.isChain = true\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value\n }\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value\n }\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value)\n }\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n }\n }\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value)\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy (name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn)\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy (name, resolver) {\n lazy(Chain.prototype, name, function outerResolver () {\n const fn = resolver()\n if (typeof fn === 'function') {\n return chainify(fn)\n }\n\n return undefined // if not a function, ignore\n })\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify (fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value))\n }\n const args = [this.value]\n for (let i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i]\n }\n if (typed.isTypedFunction(fn)) {\n const sigObject = typed.resolve(fn, args)\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.')\n }\n return new Chain(sigObject.implementation.apply(fn, args))\n }\n return new Chain(fn.apply(fn, args))\n }\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1)\n } else {\n // createProxy(values)\n for (const name in arg0) {\n if (hasOwnProperty(arg0, name) && excludedNames[name] === undefined) {\n createLazyProxy(name, () => arg0[name])\n }\n }\n }\n }\n\n const excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n }\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math)\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver)\n }\n })\n }\n\n return Chain\n}, { isClass: true })\n","export const eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: [\n 'e'\n ],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: [\n 'e',\n 'e ^ 2',\n 'exp(2)',\n 'log(e)'\n ],\n seealso: ['exp']\n}\n","export const piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: [\n 'pi'\n ],\n description: 'The number pi is a mathematical constant that is the ratio of a circle\\'s circumference to its diameter, and is approximately equal to 3.14159',\n examples: [\n 'pi',\n 'sin(pi/2)'\n ],\n seealso: ['tau']\n}\n","import { eDocs } from './constants/e.js'\nimport { falseDocs } from './constants/false.js'\nimport { iDocs } from './constants/i.js'\nimport { InfinityDocs } from './constants/Infinity.js'\nimport { LN10Docs } from './constants/LN10.js'\nimport { LN2Docs } from './constants/LN2.js'\nimport { LOG10EDocs } from './constants/LOG10E.js'\nimport { LOG2EDocs } from './constants/LOG2E.js'\nimport { NaNDocs } from './constants/NaN.js'\nimport { nullDocs } from './constants/null.js'\nimport { phiDocs } from './constants/phi.js'\nimport { piDocs } from './constants/pi.js'\nimport { SQRT12Docs } from './constants/SQRT1_2.js'\nimport { SQRT2Docs } from './constants/SQRT2.js'\nimport { tauDocs } from './constants/tau.js'\nimport { trueDocs } from './constants/true.js'\nimport { versionDocs } from './constants/version.js'\nimport { bignumberDocs } from './construction/bignumber.js'\nimport { bigintDocs } from './construction/bigint.js'\nimport { booleanDocs } from './construction/boolean.js'\nimport { complexDocs } from './construction/complex.js'\nimport { createUnitDocs } from './construction/createUnit.js'\nimport { fractionDocs } from './construction/fraction.js'\nimport { indexDocs } from './construction/index.js'\nimport { matrixDocs } from './construction/matrix.js'\nimport { numberDocs } from './construction/number.js'\nimport { sparseDocs } from './construction/sparse.js'\nimport { splitUnitDocs } from './construction/splitUnit.js'\nimport { stringDocs } from './construction/string.js'\nimport { unitDocs } from './construction/unit.js'\nimport { configDocs } from './core/config.js'\nimport { importDocs } from './core/import.js'\nimport { typedDocs } from './core/typed.js'\nimport { derivativeDocs } from './function/algebra/derivative.js'\nimport { leafCountDocs } from './function/algebra/leafCount.js'\nimport { lsolveDocs } from './function/algebra/lsolve.js'\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js'\nimport { lupDocs } from './function/algebra/lup.js'\nimport { lusolveDocs } from './function/algebra/lusolve.js'\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js'\nimport { qrDocs } from './function/algebra/qr.js'\nimport { rationalizeDocs } from './function/algebra/rationalize.js'\nimport { resolveDocs } from './function/algebra/resolve.js'\nimport { simplifyDocs } from './function/algebra/simplify.js'\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js'\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js'\nimport { sluDocs } from './function/algebra/slu.js'\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js'\nimport { usolveDocs } from './function/algebra/usolve.js'\nimport { usolveAllDocs } from './function/algebra/usolveAll.js'\nimport { absDocs } from './function/arithmetic/abs.js'\nimport { addDocs } from './function/arithmetic/add.js'\nimport { cbrtDocs } from './function/arithmetic/cbrt.js'\nimport { ceilDocs } from './function/arithmetic/ceil.js'\nimport { cubeDocs } from './function/arithmetic/cube.js'\nimport { divideDocs } from './function/arithmetic/divide.js'\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js'\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js'\nimport { dotPowDocs } from './function/arithmetic/dotPow.js'\nimport { expDocs } from './function/arithmetic/exp.js'\nimport { expmDocs } from './function/arithmetic/expm.js'\nimport { expm1Docs } from './function/arithmetic/expm1.js'\nimport { fixDocs } from './function/arithmetic/fix.js'\nimport { floorDocs } from './function/arithmetic/floor.js'\nimport { gcdDocs } from './function/arithmetic/gcd.js'\nimport { hypotDocs } from './function/arithmetic/hypot.js'\nimport { invmodDocs } from './function/arithmetic/invmod.js'\nimport { lcmDocs } from './function/arithmetic/lcm.js'\nimport { logDocs } from './function/arithmetic/log.js'\nimport { log10Docs } from './function/arithmetic/log10.js'\nimport { log1pDocs } from './function/arithmetic/log1p.js'\nimport { log2Docs } from './function/arithmetic/log2.js'\nimport { modDocs } from './function/arithmetic/mod.js'\nimport { multiplyDocs } from './function/arithmetic/multiply.js'\nimport { normDocs } from './function/arithmetic/norm.js'\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js'\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js'\nimport { powDocs } from './function/arithmetic/pow.js'\nimport { roundDocs } from './function/arithmetic/round.js'\nimport { signDocs } from './function/arithmetic/sign.js'\nimport { sqrtDocs } from './function/arithmetic/sqrt.js'\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js'\nimport { sylvesterDocs } from './function/algebra/sylvester.js'\nimport { schurDocs } from './function/algebra/schur.js'\nimport { lyapDocs } from './function/algebra/lyap.js'\nimport { squareDocs } from './function/arithmetic/square.js'\nimport { subtractDocs } from './function/arithmetic/subtract.js'\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js'\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js'\nimport { xgcdDocs } from './function/arithmetic/xgcd.js'\nimport { bitAndDocs } from './function/bitwise/bitAnd.js'\nimport { bitNotDocs } from './function/bitwise/bitNot.js'\nimport { bitOrDocs } from './function/bitwise/bitOr.js'\nimport { bitXorDocs } from './function/bitwise/bitXor.js'\nimport { leftShiftDocs } from './function/bitwise/leftShift.js'\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js'\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js'\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js'\nimport { catalanDocs } from './function/combinatorics/catalan.js'\nimport { compositionDocs } from './function/combinatorics/composition.js'\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js'\nimport { argDocs } from './function/complex/arg.js'\nimport { conjDocs } from './function/complex/conj.js'\nimport { imDocs } from './function/complex/im.js'\nimport { reDocs } from './function/complex/re.js'\nimport { evaluateDocs } from './function/expression/evaluate.js'\nimport { helpDocs } from './function/expression/help.js'\nimport { distanceDocs } from './function/geometry/distance.js'\nimport { intersectDocs } from './function/geometry/intersect.js'\nimport { andDocs } from './function/logical/and.js'\nimport { notDocs } from './function/logical/not.js'\nimport { orDocs } from './function/logical/or.js'\nimport { xorDocs } from './function/logical/xor.js'\nimport { columnDocs } from './function/matrix/column.js'\nimport { concatDocs } from './function/matrix/concat.js'\nimport { countDocs } from './function/matrix/count.js'\nimport { crossDocs } from './function/matrix/cross.js'\nimport { ctransposeDocs } from './function/matrix/ctranspose.js'\nimport { detDocs } from './function/matrix/det.js'\nimport { diagDocs } from './function/matrix/diag.js'\nimport { diffDocs } from './function/matrix/diff.js'\nimport { dotDocs } from './function/matrix/dot.js'\nimport { eigsDocs } from './function/matrix/eigs.js'\nimport { filterDocs } from './function/matrix/filter.js'\nimport { flattenDocs } from './function/matrix/flatten.js'\nimport { forEachDocs } from './function/matrix/forEach.js'\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js'\nimport { identityDocs } from './function/matrix/identity.js'\nimport { invDocs } from './function/matrix/inv.js'\nimport { pinvDocs } from './function/matrix/pinv.js'\nimport { kronDocs } from './function/matrix/kron.js'\nimport { mapDocs } from './function/matrix/map.js'\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js'\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js'\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js'\nimport { onesDocs } from './function/matrix/ones.js'\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js'\nimport { rangeDocs } from './function/matrix/range.js'\nimport { reshapeDocs } from './function/matrix/reshape.js'\nimport { resizeDocs } from './function/matrix/resize.js'\nimport { rotateDocs } from './function/matrix/rotate.js'\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js'\nimport { rowDocs } from './function/matrix/row.js'\nimport { sizeDocs } from './function/matrix/size.js'\nimport { sortDocs } from './function/matrix/sort.js'\nimport { squeezeDocs } from './function/matrix/squeeze.js'\nimport { subsetDocs } from './function/matrix/subset.js'\nimport { traceDocs } from './function/matrix/trace.js'\nimport { transposeDocs } from './function/matrix/transpose.js'\nimport { zerosDocs } from './function/matrix/zeros.js'\nimport { fftDocs } from './function/matrix/fft.js'\nimport { ifftDocs } from './function/matrix/ifft.js'\nimport { combinationsDocs } from './function/probability/combinations.js'\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js'\nimport { factorialDocs } from './function/probability/factorial.js'\nimport { gammaDocs } from './function/probability/gamma.js'\nimport { lgammaDocs } from './function/probability/lgamma.js'\nimport { kldivergenceDocs } from './function/probability/kldivergence.js'\nimport { multinomialDocs } from './function/probability/multinomial.js'\nimport { permutationsDocs } from './function/probability/permutations.js'\nimport { pickRandomDocs } from './function/probability/pickRandom.js'\nimport { randomDocs } from './function/probability/random.js'\nimport { randomIntDocs } from './function/probability/randomInt.js'\nimport { compareDocs } from './function/relational/compare.js'\nimport { compareNaturalDocs } from './function/relational/compareNatural.js'\nimport { compareTextDocs } from './function/relational/compareText.js'\nimport { deepEqualDocs } from './function/relational/deepEqual.js'\nimport { equalDocs } from './function/relational/equal.js'\nimport { equalTextDocs } from './function/relational/equalText.js'\nimport { largerDocs } from './function/relational/larger.js'\nimport { largerEqDocs } from './function/relational/largerEq.js'\nimport { smallerDocs } from './function/relational/smaller.js'\nimport { smallerEqDocs } from './function/relational/smallerEq.js'\nimport { unequalDocs } from './function/relational/unequal.js'\nimport { setCartesianDocs } from './function/set/setCartesian.js'\nimport { setDifferenceDocs } from './function/set/setDifference.js'\nimport { setDistinctDocs } from './function/set/setDistinct.js'\nimport { setIntersectDocs } from './function/set/setIntersect.js'\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js'\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js'\nimport { setPowersetDocs } from './function/set/setPowerset.js'\nimport { setSizeDocs } from './function/set/setSize.js'\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js'\nimport { setUnionDocs } from './function/set/setUnion.js'\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js'\nimport { freqzDocs } from './function/signal/freqz.js'\nimport { erfDocs } from './function/special/erf.js'\nimport { zetaDocs } from './function/special/zeta.js'\nimport { madDocs } from './function/statistics/mad.js'\nimport { maxDocs } from './function/statistics/max.js'\nimport { meanDocs } from './function/statistics/mean.js'\nimport { medianDocs } from './function/statistics/median.js'\nimport { minDocs } from './function/statistics/min.js'\nimport { modeDocs } from './function/statistics/mode.js'\nimport { prodDocs } from './function/statistics/prod.js'\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js'\nimport { stdDocs } from './function/statistics/std.js'\nimport { cumSumDocs } from './function/statistics/cumsum.js'\nimport { sumDocs } from './function/statistics/sum.js'\nimport { varianceDocs } from './function/statistics/variance.js'\nimport { corrDocs } from './function/statistics/corr.js'\nimport { acosDocs } from './function/trigonometry/acos.js'\nimport { acoshDocs } from './function/trigonometry/acosh.js'\nimport { acotDocs } from './function/trigonometry/acot.js'\nimport { acothDocs } from './function/trigonometry/acoth.js'\nimport { acscDocs } from './function/trigonometry/acsc.js'\nimport { acschDocs } from './function/trigonometry/acsch.js'\nimport { asecDocs } from './function/trigonometry/asec.js'\nimport { asechDocs } from './function/trigonometry/asech.js'\nimport { asinDocs } from './function/trigonometry/asin.js'\nimport { asinhDocs } from './function/trigonometry/asinh.js'\nimport { atanDocs } from './function/trigonometry/atan.js'\nimport { atan2Docs } from './function/trigonometry/atan2.js'\nimport { atanhDocs } from './function/trigonometry/atanh.js'\nimport { cosDocs } from './function/trigonometry/cos.js'\nimport { coshDocs } from './function/trigonometry/cosh.js'\nimport { cotDocs } from './function/trigonometry/cot.js'\nimport { cothDocs } from './function/trigonometry/coth.js'\nimport { cscDocs } from './function/trigonometry/csc.js'\nimport { cschDocs } from './function/trigonometry/csch.js'\nimport { secDocs } from './function/trigonometry/sec.js'\nimport { sechDocs } from './function/trigonometry/sech.js'\nimport { sinDocs } from './function/trigonometry/sin.js'\nimport { sinhDocs } from './function/trigonometry/sinh.js'\nimport { tanDocs } from './function/trigonometry/tan.js'\nimport { tanhDocs } from './function/trigonometry/tanh.js'\nimport { toDocs } from './function/units/to.js'\nimport { binDocs } from './function/utils/bin.js'\nimport { cloneDocs } from './function/utils/clone.js'\nimport { formatDocs } from './function/utils/format.js'\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js'\nimport { hexDocs } from './function/utils/hex.js'\nimport { isIntegerDocs } from './function/utils/isInteger.js'\nimport { isNaNDocs } from './function/utils/isNaN.js'\nimport { isNegativeDocs } from './function/utils/isNegative.js'\nimport { isNumericDocs } from './function/utils/isNumeric.js'\nimport { isPositiveDocs } from './function/utils/isPositive.js'\nimport { isPrimeDocs } from './function/utils/isPrime.js'\nimport { isZeroDocs } from './function/utils/isZero.js'\nimport { numericDocs } from './function/utils/numeric.js'\nimport { octDocs } from './function/utils/oct.js'\nimport { printDocs } from './function/utils/print.js'\nimport { typeOfDocs } from './function/utils/typeOf.js'\nimport { solveODEDocs } from './function/numeric/solveODE.js'\n\nexport const embeddedDocs = {\n\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: { description: 'Speed of light in vacuum', examples: ['speedOfLight'] },\n gravitationConstant: { description: 'Newtonian constant of gravitation', examples: ['gravitationConstant'] },\n planckConstant: { description: 'Planck constant', examples: ['planckConstant'] },\n reducedPlanckConstant: { description: 'Reduced Planck constant', examples: ['reducedPlanckConstant'] },\n\n magneticConstant: { description: 'Magnetic constant (vacuum permeability)', examples: ['magneticConstant'] },\n electricConstant: { description: 'Electric constant (vacuum permeability)', examples: ['electricConstant'] },\n vacuumImpedance: { description: 'Characteristic impedance of vacuum', examples: ['vacuumImpedance'] },\n coulomb: { description: 'Coulomb\\'s constant', examples: ['coulomb'] },\n elementaryCharge: { description: 'Elementary charge', examples: ['elementaryCharge'] },\n bohrMagneton: { description: 'Bohr magneton', examples: ['bohrMagneton'] },\n conductanceQuantum: { description: 'Conductance quantum', examples: ['conductanceQuantum'] },\n inverseConductanceQuantum: { description: 'Inverse conductance quantum', examples: ['inverseConductanceQuantum'] },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: { description: 'Magnetic flux quantum', examples: ['magneticFluxQuantum'] },\n nuclearMagneton: { description: 'Nuclear magneton', examples: ['nuclearMagneton'] },\n klitzing: { description: 'Von Klitzing constant', examples: ['klitzing'] },\n\n bohrRadius: { description: 'Bohr radius', examples: ['bohrRadius'] },\n classicalElectronRadius: { description: 'Classical electron radius', examples: ['classicalElectronRadius'] },\n electronMass: { description: 'Electron mass', examples: ['electronMass'] },\n fermiCoupling: { description: 'Fermi coupling constant', examples: ['fermiCoupling'] },\n fineStructure: { description: 'Fine-structure constant', examples: ['fineStructure'] },\n hartreeEnergy: { description: 'Hartree energy', examples: ['hartreeEnergy'] },\n protonMass: { description: 'Proton mass', examples: ['protonMass'] },\n deuteronMass: { description: 'Deuteron Mass', examples: ['deuteronMass'] },\n neutronMass: { description: 'Neutron mass', examples: ['neutronMass'] },\n quantumOfCirculation: { description: 'Quantum of circulation', examples: ['quantumOfCirculation'] },\n rydberg: { description: 'Rydberg constant', examples: ['rydberg'] },\n thomsonCrossSection: { description: 'Thomson cross section', examples: ['thomsonCrossSection'] },\n weakMixingAngle: { description: 'Weak mixing angle', examples: ['weakMixingAngle'] },\n efimovFactor: { description: 'Efimov factor', examples: ['efimovFactor'] },\n\n atomicMass: { description: 'Atomic mass constant', examples: ['atomicMass'] },\n avogadro: { description: 'Avogadro\\'s number', examples: ['avogadro'] },\n boltzmann: { description: 'Boltzmann constant', examples: ['boltzmann'] },\n faraday: { description: 'Faraday constant', examples: ['faraday'] },\n firstRadiation: { description: 'First radiation constant', examples: ['firstRadiation'] },\n loschmidt: { description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa', examples: ['loschmidt'] },\n gasConstant: { description: 'Gas constant', examples: ['gasConstant'] },\n molarPlanckConstant: { description: 'Molar Planck constant', examples: ['molarPlanckConstant'] },\n molarVolume: { description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa', examples: ['molarVolume'] },\n sackurTetrode: { description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa', examples: ['sackurTetrode'] },\n secondRadiation: { description: 'Second radiation constant', examples: ['secondRadiation'] },\n stefanBoltzmann: { description: 'Stefan-Boltzmann constant', examples: ['stefanBoltzmann'] },\n wienDisplacement: { description: 'Wien displacement law constant', examples: ['wienDisplacement'] },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: { description: 'Molar mass constant', examples: ['molarMass'] },\n molarMassC12: { description: 'Molar mass constant of carbon-12', examples: ['molarMassC12'] },\n gravity: { description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)', examples: ['gravity'] },\n\n planckLength: { description: 'Planck length', examples: ['planckLength'] },\n planckMass: { description: 'Planck mass', examples: ['planckMass'] },\n planckTime: { description: 'Planck time', examples: ['planckTime'] },\n planckCharge: { description: 'Planck charge', examples: ['planckCharge'] },\n planckTemperature: { description: 'Planck temperature', examples: ['planckTemperature'] },\n\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n\n // functions - logical\n and: andDocs,\n not: notDocs,\n or: orDocs,\n xor: xorDocs,\n\n // functions - matrix\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n\n // functions - numeric\n solveODE: solveODEDocs,\n\n // functions - probability\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n\n // functions - units\n to: toDocs,\n\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n}\n","export const bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: [\n 'bignumber(x)'\n ],\n description:\n 'Create a big number from a number or string.',\n examples: [\n '0.1 + 0.2',\n 'bignumber(0.1) + bignumber(0.2)',\n 'bignumber(\"7.2\")',\n 'bignumber(\"7.2e500\")',\n 'bignumber([0.1, 0.2, 0.3])'\n ],\n seealso: [\n 'boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'\n ]\n}\n","export const bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: [\n 'bigint(x)'\n ],\n description:\n 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: [\n '123123123123123123 # a large number will lose digits',\n 'bigint(\"123123123123123123\")',\n 'bignumber([\"1\", \"3\", \"5\"])'\n ],\n seealso: [\n 'boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'\n ]\n}\n","export const booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: [\n 'x',\n 'boolean(x)'\n ],\n description:\n 'Convert a string or number into a boolean.',\n examples: [\n 'boolean(0)',\n 'boolean(1)',\n 'boolean(3)',\n 'boolean(\"true\")',\n 'boolean(\"false\")',\n 'boolean([1, 0, 1, 1])'\n ],\n seealso: [\n 'bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit'\n ]\n}\n","export const complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: [\n 'complex()',\n 'complex(re, im)',\n 'complex(string)'\n ],\n description:\n 'Create a complex number.',\n examples: [\n 'complex()',\n 'complex(2, 3)',\n 'complex(\"7 - 2i\")'\n ],\n seealso: [\n 'bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit'\n ]\n}\n","export const createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: [\n 'createUnit(definitions)',\n 'createUnit(name, definition)'\n ],\n description:\n 'Create a user-defined unit and register it with the Unit type.',\n examples: [\n 'createUnit(\"foo\")',\n 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})',\n 'createUnit(\"mph\", \"1 mile/hour\")'\n ],\n seealso: [\n 'unit', 'splitUnit'\n ]\n}\n","export const fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: [\n 'fraction(num)',\n 'fraction(matrix)',\n 'fraction(num,den)',\n 'fraction({n: num, d: den})'\n ],\n description:\n 'Create a fraction from a number or from integer numerator and denominator.',\n examples: [\n 'fraction(0.125)',\n 'fraction(1, 3) + fraction(2, 5)',\n 'fraction({n: 333, d: 53})',\n 'fraction([sqrt(9), sqrt(10), sqrt(11)])'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit'\n ]\n}\n","export const indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: [\n '[start]',\n '[start:end]',\n '[start:step:end]',\n '[start1, start 2, ...]',\n '[start1:end1, start2:end2, ...]',\n '[start1:step1:end1, start2:step2:end2, ...]'\n ],\n description:\n 'Create an index to get or replace a subset of a matrix',\n examples: [\n 'A = [1, 2, 3; 4, 5, 6]',\n 'A[1, :]',\n 'A[1, 2] = 50',\n 'A[1:2, 1:2] = 1',\n 'B = [1, 2, 3]',\n 'B[B>1 and B<3]'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit'\n ]\n}\n","export const matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: [\n '[]',\n '[a1, b1, ...; a2, b2, ...]',\n 'matrix()',\n 'matrix(\"dense\")',\n 'matrix([...])'\n ],\n description:\n 'Create a matrix.',\n examples: [\n '[]',\n '[1, 2, 3]',\n '[1, 2, 3; 4, 5, 6]',\n 'matrix()',\n 'matrix([3, 4])',\n 'matrix([3, 4; 5, 6], \"sparse\")',\n 'matrix([3, 4; 5, 6], \"sparse\", \"number\")'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse'\n ]\n}\n","export const numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: [\n 'x',\n 'number(x)',\n 'number(unit, valuelessUnit)'\n ],\n description:\n 'Create a number or convert a string or boolean into a number.',\n examples: [\n '2',\n '2e3',\n '4.05',\n 'number(2)',\n 'number(\"7.2\")',\n 'number(true)',\n 'number([true, false, true, true])',\n 'number(unit(\"52cm\"), \"m\")'\n ],\n seealso: [\n 'bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'\n ]\n}\n","export const sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: [\n 'sparse()',\n 'sparse([a1, b1, ...; a1, b2, ...])',\n 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'\n ],\n description:\n 'Create a sparse matrix.',\n examples: [\n 'sparse()',\n 'sparse([3, 4; 5, 6])',\n 'sparse([3, 0; 5, 0], \"number\")'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix'\n ]\n}\n","export const splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: [\n 'splitUnit(unit: Unit, parts: Unit[])'\n ],\n description:\n 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: [\n 'splitUnit(1 m, [\"feet\", \"inch\"])'\n ],\n seealso: [\n 'unit', 'createUnit'\n ]\n}\n","export const stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: [\n '\"text\"',\n 'string(x)'\n ],\n description:\n 'Create a string or convert a value to a string',\n examples: [\n '\"Hello World!\"',\n 'string(4.2)',\n 'string(3 + 2i)'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit'\n ]\n}\n","export const unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: [\n 'value unit',\n 'unit(value, unit)',\n 'unit(string)'\n ],\n description:\n 'Create a unit.',\n examples: [\n '5.5 mm',\n '3 inch',\n 'unit(7.1, \"kilogram\")',\n 'unit(\"23 deg\")'\n ],\n seealso: [\n 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string'\n ]\n}\n","export const falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: [\n 'false'\n ],\n description: 'Boolean value false',\n examples: [\n 'false'\n ],\n seealso: ['true']\n}\n","export const iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: [\n 'i'\n ],\n description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',\n examples: [\n 'i',\n 'i * i',\n 'sqrt(-1)'\n ],\n seealso: []\n}\n","export const InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: [\n 'Infinity'\n ],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: [\n 'Infinity',\n '1 / 0'\n ],\n seealso: []\n}\n","export const LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: [\n 'LN2'\n ],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: [\n 'LN2',\n 'log(2)'\n ],\n seealso: []\n}\n","export const LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: [\n 'LN10'\n ],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: [\n 'LN10',\n 'log(10)'\n ],\n seealso: []\n}\n","export const LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: [\n 'LOG2E'\n ],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: [\n 'LOG2E',\n 'log(e, 2)'\n ],\n seealso: []\n}\n","export const LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: [\n 'LOG10E'\n ],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: [\n 'LOG10E',\n 'log(e, 10)'\n ],\n seealso: []\n}\n","export const NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: [\n 'NaN'\n ],\n description: 'Not a number',\n examples: [\n 'NaN',\n '0 / 0'\n ],\n seealso: []\n}\n","export const nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: [\n 'null'\n ],\n description: 'Value null',\n examples: [\n 'null'\n ],\n seealso: ['true', 'false']\n}\n","export const phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: [\n 'phi'\n ],\n description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',\n examples: [\n 'phi'\n ],\n seealso: []\n}\n","export const SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: [\n 'SQRT1_2'\n ],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: [\n 'SQRT1_2',\n 'sqrt(1/2)'\n ],\n seealso: []\n}\n","export const SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: [\n 'SQRT2'\n ],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: [\n 'SQRT2',\n 'sqrt(2)'\n ],\n seealso: []\n}\n","export const tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: [\n 'tau'\n ],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: [\n 'tau',\n '2 * pi'\n ],\n seealso: ['pi']\n}\n","export const trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: [\n 'true'\n ],\n description: 'Boolean value true',\n examples: [\n 'true'\n ],\n seealso: ['false']\n}\n","export const versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: [\n 'version'\n ],\n description: 'A string with the version number of math.js',\n examples: [\n 'version'\n ],\n seealso: []\n}\n","export const derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: [\n 'derivative(expr, variable)',\n 'derivative(expr, variable, {simplify: boolean})'\n ],\n description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',\n examples: [\n 'derivative(\"2x^3\", \"x\")',\n 'derivative(\"2x^3\", \"x\", {simplify: false})',\n 'derivative(\"2x^2 + 3x + 4\", \"x\")',\n 'derivative(\"sin(2x)\", \"x\")',\n 'f = parse(\"x^2 + x\")',\n 'x = parse(\"x\")',\n 'df = derivative(f, x)',\n 'df.evaluate({x: 3})'\n ],\n seealso: [\n 'simplify', 'parse', 'evaluate'\n ]\n}\n","export const lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: [\n 'x=lsolve(L, b)'\n ],\n description:\n 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: [\n 'a = [-2, 3; 2, 1]',\n 'b = [11, 9]',\n 'x = lsolve(a, b)'\n ],\n seealso: [\n 'lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'\n ]\n}\n","export const lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: [\n 'x=lsolveAll(L, b)'\n ],\n description:\n 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: [\n 'a = [-2, 3; 2, 1]',\n 'b = [11, 9]',\n 'x = lsolve(a, b)'\n ],\n seealso: [\n 'lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'\n ]\n}\n","export const lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: [\n 'lup(m)'\n ],\n description:\n 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: [\n 'lup([[2, 1], [1, 4]])',\n 'lup(matrix([[2, 1], [1, 4]]))',\n 'lup(sparse([[2, 1], [1, 4]]))'\n ],\n seealso: [\n 'lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr'\n ]\n}\n","export const lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: [\n 'x=lusolve(A, b)',\n 'x=lusolve(lu, b)'\n ],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: [\n 'a = [-2, 3; 2, 1]',\n 'b = [11, 9]',\n 'x = lusolve(a, b)'\n ],\n seealso: [\n 'lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse'\n ]\n}\n","export const leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: [\n 'leafCount(\"e^(i*pi)-1\")',\n 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'\n ],\n seealso: ['simplify']\n}\n","export const polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: [\n 'x=polynomialRoot(-6, 3)',\n 'x=polynomialRoot(4, -4, 1)',\n 'x=polynomialRoot(-8, 12, -6, 1)'\n ],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: [\n 'a = polynomialRoot(-6, 11, -6, 1)'\n ],\n seealso: [\n 'cbrt', 'sqrt'\n ]\n}\n","export const resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: [\n 'resolve(node, scope)'\n ],\n description: 'Recursively substitute variables in an expression tree.',\n examples: [\n 'resolve(parse(\"1 + x\"), { x: 7 })',\n 'resolve(parse(\"size(text)\"), { text: \"Hello World\" })',\n 'resolve(parse(\"x + y\"), { x: parse(\"3z\") })',\n 'resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'\n ],\n seealso: [\n 'simplify', 'evaluate'\n ],\n mayThrow: [\n 'ReferenceError'\n ]\n}\n","export const simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: [\n 'simplify(expr)',\n 'simplify(expr, rules)'\n ],\n description: 'Simplify an expression tree.',\n examples: [\n 'simplify(\"3 + 2 / 4\")',\n 'simplify(\"2x + x\")',\n 'f = parse(\"x * (x + 2 + x)\")',\n 'simplified = simplify(f)',\n 'simplified.evaluate({x: 2})'\n ],\n seealso: [\n 'simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve'\n ]\n}\n","export const simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: [\n 'simplifyConstant(expr)',\n 'simplifyConstant(expr, options)'\n ],\n description: 'Replace constant subexpressions of node with their values.',\n examples: [\n 'simplifyConstant(\"(3-3)*x\")',\n 'simplifyConstant(parse(\"z-cos(tau/8)\"))'\n ],\n seealso: [\n 'simplify', 'simplifyCore', 'evaluate'\n ]\n}\n","export const simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: [\n 'simplifyCore(node)'\n ],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: [\n 'simplifyCore(parse(\"0*x\"))',\n 'simplifyCore(parse(\"(x+0)*2\"))'\n ],\n seealso: [\n 'simplify', 'simplifyConstant', 'evaluate'\n ]\n}\n","export const symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: [\n 'symbolicEqual(expr1, expr2)',\n 'symbolicEqual(expr1, expr2, options)'\n ],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: [\n 'symbolicEqual(\"x*y\",\"y*x\")',\n 'symbolicEqual(\"abs(x^2)\", \"x^2\")',\n 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'\n ],\n seealso: ['simplify', 'evaluate']\n}\n","export const rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: [\n 'rationalize(expr)',\n 'rationalize(expr, scope)',\n 'rationalize(expr, scope, detailed)'\n ],\n description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',\n examples: [\n 'rationalize(\"2x/y - y/(x+1)\")',\n 'rationalize(\"2x/y - y/(x+1)\", true)'\n ],\n seealso: [\n 'simplify'\n ]\n}\n","export const sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: [\n 'slu(A, order, threshold)'\n ],\n description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',\n examples: [\n 'slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'\n ],\n seealso: [\n 'lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr'\n ]\n}\n","export const usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: [\n 'x=usolve(U, b)'\n ],\n description:\n 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: [\n 'x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'\n ],\n seealso: [\n 'usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'\n ]\n}\n","export const usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: [\n 'x=usolve(U, b)'\n ],\n description:\n 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: [\n 'x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'\n ],\n seealso: [\n 'usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'\n ]\n}\n","export const qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: [\n 'qr(A)'\n ],\n description:\n 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',\n examples: [\n 'qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'\n ],\n seealso: [\n 'lup', 'slu', 'matrix'\n ]\n}\n","export const absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: [\n 'abs(x)'\n ],\n description: 'Compute the absolute value.',\n examples: [\n 'abs(3.5)',\n 'abs(-4.2)'\n ],\n seealso: ['sign']\n}\n","export const addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: [\n 'x + y',\n 'add(x, y)'\n ],\n description: 'Add two values.',\n examples: [\n 'a = 2.1 + 3.6',\n 'a - 3.6',\n '3 + 2i',\n '3 cm + 2 inch',\n '\"2.3\" + \"4\"'\n ],\n seealso: [\n 'subtract'\n ]\n}\n","export const cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: [\n 'cbrt(x)',\n 'cbrt(x, allRoots)'\n ],\n description:\n 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',\n examples: [\n 'cbrt(64)',\n 'cube(4)',\n 'cbrt(-8)',\n 'cbrt(2 + 3i)',\n 'cbrt(8i)',\n 'cbrt(8i, true)',\n 'cbrt(27 m^3)'\n ],\n seealso: [\n 'square',\n 'sqrt',\n 'cube',\n 'multiply'\n ]\n}\n","export const ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: [\n 'ceil(x)'\n ],\n description:\n 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: [\n 'ceil(3.2)',\n 'ceil(3.8)',\n 'ceil(-4.2)'\n ],\n seealso: ['floor', 'fix', 'round']\n}\n","export const cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: [\n 'cube(x)'\n ],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: [\n 'cube(2)',\n '2^3',\n '2 * 2 * 2'\n ],\n seealso: [\n 'multiply',\n 'square',\n 'pow'\n ]\n}\n","export const divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: [\n 'x / y',\n 'divide(x, y)'\n ],\n description: 'Divide two values.',\n examples: [\n 'a = 2 / 3',\n 'a * 3',\n '4.5 / 2',\n '3 + 4 / 2',\n '(3 + 4) / 2',\n '18 km / 4.5'\n ],\n seealso: [\n 'multiply'\n ]\n}\n","export const dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: [\n 'x ./ y',\n 'dotDivide(x, y)'\n ],\n description: 'Divide two values element wise.',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'b = [2, 1, 1; 3, 2, 5]',\n 'a ./ b'\n ],\n seealso: [\n 'multiply',\n 'dotMultiply',\n 'divide'\n ]\n}\n","export const dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: [\n 'x .* y',\n 'dotMultiply(x, y)'\n ],\n description: 'Multiply two values element wise.',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'b = [2, 1, 1; 3, 2, 5]',\n 'a .* b'\n ],\n seealso: [\n 'multiply',\n 'divide',\n 'dotDivide'\n ]\n}\n","export const dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: [\n 'x .^ y',\n 'dotPow(x, y)'\n ],\n description:\n 'Calculates the power of x to y element wise.',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'a .^ 2'\n ],\n seealso: [\n 'pow'\n ]\n}\n","export const expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: [\n 'exp(x)'\n ],\n description: 'Calculate the exponent of a value.',\n examples: [\n 'exp(1.3)',\n 'e ^ 1.3',\n 'log(exp(1.3))',\n 'x = 2.4',\n '(exp(i*x) == cos(x) + i*sin(x)) # Euler\\'s formula'\n ],\n seealso: [\n 'expm',\n 'expm1',\n 'pow',\n 'log'\n ]\n}\n","export const expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: [\n 'exp(x)'\n ],\n description: 'Compute the matrix exponential, expm(A) = e^A. ' +\n 'The matrix must be square. ' +\n 'Not to be confused with exp(a), which performs element-wise exponentiation.',\n examples: [\n 'expm([[0,2],[0,0]])'\n ],\n seealso: [\n 'exp'\n ]\n}\n","export const expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: [\n 'expm1(x)'\n ],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: [\n 'expm1(2)',\n 'pow(e, 2) - 1',\n 'log(expm1(2) + 1)'\n ],\n seealso: [\n 'exp',\n 'pow',\n 'log'\n ]\n}\n","export const fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: [\n 'fix(x)'\n ],\n description:\n 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: [\n 'fix(3.2)',\n 'fix(3.8)',\n 'fix(-4.2)',\n 'fix(-4.8)'\n ],\n seealso: ['ceil', 'floor', 'round']\n}\n","export const floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: [\n 'floor(x)'\n ],\n description:\n 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: [\n 'floor(3.2)',\n 'floor(3.8)',\n 'floor(-4.2)'\n ],\n seealso: ['ceil', 'fix', 'round']\n}\n","export const gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: [\n 'gcd(a, b)',\n 'gcd(a, b, c, ...)'\n ],\n description: 'Compute the greatest common divisor.',\n examples: [\n 'gcd(8, 12)',\n 'gcd(-4, 6)',\n 'gcd(25, 15, -10)'\n ],\n seealso: ['lcm', 'xgcd']\n}\n","export const hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: [\n 'hypot(a, b, c, ...)',\n 'hypot([a, b, c, ...])'\n ],\n description: 'Calculate the hypotenuse of a list with values.',\n examples: [\n 'hypot(3, 4)',\n 'sqrt(3^2 + 4^2)',\n 'hypot(-2)',\n 'hypot([3, 4, 5])'\n ],\n seealso: ['abs', 'norm']\n}\n","export const lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: [\n 'lcm(x, y)'\n ],\n description: 'Compute the least common multiple.',\n examples: [\n 'lcm(4, 6)',\n 'lcm(6, 21)',\n 'lcm(6, 21, 5)'\n ],\n seealso: ['gcd']\n}\n","export const logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: [\n 'log(x)',\n 'log(x, base)'\n ],\n description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',\n examples: [\n 'log(3.5)',\n 'a = log(2.4)',\n 'exp(a)',\n '10 ^ 4',\n 'log(10000, 10)',\n 'log(10000) / log(10)',\n 'b = log(1024, 2)',\n '2 ^ b'\n ],\n seealso: [\n 'exp',\n 'log1p',\n 'log2',\n 'log10'\n ]\n}\n","export const log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: [\n 'log2(x)'\n ],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: [\n 'log2(0.03125)',\n 'log2(16)',\n 'log2(16) / log2(2)',\n 'pow(2, 4)'\n ],\n seealso: [\n 'exp',\n 'log1p',\n 'log',\n 'log10'\n ]\n}\n","export const log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: [\n 'log1p(x)',\n 'log1p(x, base)'\n ],\n description: 'Calculate the logarithm of a `value+1`',\n examples: [\n 'log1p(2.5)',\n 'exp(log1p(1.4))',\n 'pow(10, 4)',\n 'log1p(9999, 10)',\n 'log1p(9999) / log(10)'\n ],\n seealso: [\n 'exp',\n 'log',\n 'log2',\n 'log10'\n ]\n}\n","export const log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: [\n 'log10(x)'\n ],\n description: 'Compute the 10-base logarithm of a value.',\n examples: [\n 'log10(0.00001)',\n 'log10(10000)',\n '10 ^ 4',\n 'log(10000) / log(10)',\n 'log(10000, 10)'\n ],\n seealso: [\n 'exp',\n 'log'\n ]\n}\n","export const modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: [\n 'x % y',\n 'x mod y',\n 'mod(x, y)'\n ],\n description:\n 'Calculates the modulus, the remainder of an integer division.',\n examples: [\n '7 % 3',\n '11 % 2',\n '10 mod 4',\n 'isOdd(x) = x % 2',\n 'isOdd(2)',\n 'isOdd(3)'\n ],\n seealso: ['divide']\n}\n","export const multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: [\n 'x * y',\n 'multiply(x, y)'\n ],\n description: 'multiply two values.',\n examples: [\n 'a = 2.1 * 3.4',\n 'a / 3.4',\n '2 * 3 + 4',\n '2 * (3 + 4)',\n '3 * 2.1 km'\n ],\n seealso: [\n 'divide'\n ]\n}\n","export const normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: [\n 'norm(x)',\n 'norm(x, p)'\n ],\n description: 'Calculate the norm of a number, vector or matrix.',\n examples: [\n 'abs(-3.5)',\n 'norm(-3.5)',\n 'norm(3 - 4i)',\n 'norm([1, 2, -3], Infinity)',\n 'norm([1, 2, -3], -Infinity)',\n 'norm([3, 4], 2)',\n 'norm([[1, 2], [3, 4]], 1)',\n 'norm([[1, 2], [3, 4]], \"inf\")',\n 'norm([[1, 2], [3, 4]], \"fro\")'\n ]\n}\n","export const nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: [\n 'nthRoot(a)',\n 'nthRoot(a, root)'\n ],\n description: 'Calculate the nth root of a value. ' +\n 'The principal nth root of a positive real number A, ' +\n 'is the positive real solution of the equation \"x^root = A\".',\n examples: [\n '4 ^ 3',\n 'nthRoot(64, 3)',\n 'nthRoot(9, 2)',\n 'sqrt(9)'\n ],\n seealso: [\n 'nthRoots',\n 'pow',\n 'sqrt'\n ]\n}\n","export const nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: [\n 'nthRoots(A)',\n 'nthRoots(A, root)'\n ],\n description: ('' +\n 'Calculate the nth roots of a value. ' +\n 'An nth root of a positive real number A, ' +\n 'is a positive real solution of the equation \"x^root = A\". ' +\n 'This function returns an array of complex values.'\n ),\n examples: [\n 'nthRoots(1)',\n 'nthRoots(1, 3)'\n ],\n seealso: [\n 'sqrt',\n 'pow',\n 'nthRoot'\n ]\n}\n","export const powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: [\n 'x ^ y',\n 'pow(x, y)'\n ],\n description:\n 'Calculates the power of x to y, x^y.',\n examples: [\n '2^3',\n '2*2*2',\n '1 + e ^ (pi * i)',\n 'pow([[1, 2], [4, 3]], 2)',\n 'pow([[1, 2], [4, 3]], -1)'\n ],\n seealso: [\n 'multiply',\n 'nthRoot',\n 'nthRoots',\n 'sqrt'\n ]\n}\n","export const roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: [\n 'round(x)',\n 'round(x, n)',\n 'round(unit, valuelessUnit)',\n 'round(unit, n, valuelessUnit)'\n ],\n description:\n 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',\n examples: [\n 'round(3.2)',\n 'round(3.8)',\n 'round(-4.2)',\n 'round(-4.8)',\n 'round(pi, 3)',\n 'round(123.45678, 2)',\n 'round(3.241cm, 2, cm)',\n 'round([3.2, 3.8, -4.7])'\n ],\n seealso: ['ceil', 'floor', 'fix']\n}\n","export const signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: [\n 'sign(x)'\n ],\n description:\n 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',\n examples: [\n 'sign(3.5)',\n 'sign(-4.2)',\n 'sign(0)'\n ],\n seealso: [\n 'abs'\n ]\n}\n","export const sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: [\n 'sqrt(x)'\n ],\n description:\n 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: [\n 'sqrt(25)',\n '5 * 5',\n 'sqrt(-1)'\n ],\n seealso: [\n 'square',\n 'sqrtm',\n 'multiply',\n 'nthRoot',\n 'nthRoots',\n 'pow'\n ]\n}\n","export const sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: [\n 'sqrtm(x)'\n ],\n description:\n 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',\n examples: [\n 'sqrtm([[33, 24], [48, 57]])'\n ],\n seealso: [\n 'sqrt',\n 'abs',\n 'square',\n 'multiply'\n ]\n}\n","export const squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: [\n 'square(x)'\n ],\n description:\n 'Compute the square of a value. The square of x is x * x.',\n examples: [\n 'square(3)',\n 'sqrt(9)',\n '3^2',\n '3 * 3'\n ],\n seealso: [\n 'multiply',\n 'pow',\n 'sqrt',\n 'cube'\n ]\n}\n","export const subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: [\n 'x - y',\n 'subtract(x, y)'\n ],\n description: 'subtract two values.',\n examples: [\n 'a = 5.3 - 2',\n 'a + 2',\n '2/3 - 1/6',\n '2 * 3 - 3',\n '2.1 km - 500m'\n ],\n seealso: [\n 'add'\n ]\n}\n","export const unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: [\n '-x',\n 'unaryMinus(x)'\n ],\n description:\n 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: [\n '-4.5',\n '-(-5.6)',\n '-\"22\"'\n ],\n seealso: [\n 'add', 'subtract', 'unaryPlus'\n ]\n}\n","export const unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: [\n '+x',\n 'unaryPlus(x)'\n ],\n description:\n 'Converts booleans and strings to numbers.',\n examples: [\n '+true',\n '+\"2\"'\n ],\n seealso: [\n 'add', 'subtract', 'unaryMinus'\n ]\n}\n","export const xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: [\n 'xgcd(a, b)'\n ],\n description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',\n examples: [\n 'xgcd(8, 12)',\n 'gcd(8, 12)',\n 'xgcd(36163, 21199)'\n ],\n seealso: ['gcd', 'lcm']\n}\n","export const invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: [\n 'invmod(a, b)'\n ],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)',\n examples: [\n 'invmod(8, 12)',\n 'invmod(7, 13)',\n 'invmod(15151, 15122)'\n ],\n seealso: ['gcd', 'xgcd']\n}\n","export const bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: [\n 'x & y',\n 'bitAnd(x, y)'\n ],\n description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',\n examples: [\n '5 & 3',\n 'bitAnd(53, 131)',\n '[1, 12, 31] & 42'\n ],\n seealso: [\n 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'\n ]\n}\n","export const bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: [\n '~x',\n 'bitNot(x)'\n ],\n description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',\n examples: [\n '~1',\n '~2',\n 'bitNot([2, -3, 4])'\n ],\n seealso: [\n 'bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'\n ]\n}\n","export const bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: [\n 'x | y',\n 'bitOr(x, y)'\n ],\n description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',\n examples: [\n '5 | 3',\n 'bitOr([1, 2, 3], 4)'\n ],\n seealso: [\n 'bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'\n ]\n}\n","export const bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: [\n 'bitXor(x, y)'\n ],\n description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',\n examples: [\n 'bitOr(1, 2)',\n 'bitXor([2, 3, 4], 4)'\n ],\n seealso: [\n 'bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift'\n ]\n}\n","export const leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: [\n 'x << y',\n 'leftShift(x, y)'\n ],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: [\n '4 << 1',\n '8 >> 1'\n ],\n seealso: [\n 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift'\n ]\n}\n","export const rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: [\n 'x >> y',\n 'rightArithShift(x, y)'\n ],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: [\n '8 >> 1',\n '4 << 1',\n '-12 >> 2'\n ],\n seealso: [\n 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift'\n ]\n}\n","export const rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: [\n 'x >>> y',\n 'rightLogShift(x, y)'\n ],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: [\n '8 >>> 1',\n '4 << 1',\n '-12 >>> 2'\n ],\n seealso: [\n 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift'\n ]\n}\n","export const bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: [\n 'bellNumbers(n)'\n ],\n description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: [\n 'bellNumbers(3)',\n 'bellNumbers(8)'\n ],\n seealso: ['stirlingS2']\n}\n","export const catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: [\n 'catalan(n)'\n ],\n description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: [\n 'catalan(3)',\n 'catalan(8)'\n ],\n seealso: ['bellNumbers']\n}\n","export const compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: [\n 'composition(n, k)'\n ],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: [\n 'composition(5, 3)'\n ],\n seealso: ['combinations']\n}\n","export const stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: [\n 'stirlingS2(n, k)'\n ],\n description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.',\n examples: [\n 'stirlingS2(5, 3)'\n ],\n seealso: ['bellNumbers']\n}\n","export const configDocs = {\n name: 'config',\n category: 'Core',\n syntax: [\n 'config()',\n 'config(options)'\n ],\n description: 'Get configuration or change configuration.',\n examples: [\n 'config()',\n '1/3 + 1/4',\n 'config({number: \"Fraction\"})',\n '1/3 + 1/4'\n ],\n seealso: []\n}\n","export const importDocs = {\n name: 'import',\n category: 'Core',\n syntax: [\n 'import(functions)',\n 'import(functions, options)'\n ],\n description: 'Import functions or constants from an object.',\n examples: [\n 'import({myFn: f(x)=x^2, myConstant: 32 })',\n 'myFn(2)',\n 'myConstant'\n ],\n seealso: []\n}\n","export const typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: [\n 'typed(signatures)',\n 'typed(name, signatures)'\n ],\n description: 'Create a typed function.',\n examples: [\n 'double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })',\n 'double(2)',\n 'double(\"hello\")'\n ],\n seealso: []\n}\n","export const argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: [\n 'arg(x)'\n ],\n description:\n 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: [\n 'arg(2 + 2i)',\n 'atan2(3, 2)',\n 'arg(2 + 3i)'\n ],\n seealso: [\n 're',\n 'im',\n 'conj',\n 'abs'\n ]\n}\n","export const conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: [\n 'conj(x)'\n ],\n description:\n 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: [\n 'conj(2 + 3i)',\n 'conj(2 - 3i)',\n 'conj(-5.2i)'\n ],\n seealso: [\n 're',\n 'im',\n 'abs',\n 'arg'\n ]\n}\n","export const reDocs = {\n name: 're',\n category: 'Complex',\n syntax: [\n 're(x)'\n ],\n description: 'Get the real part of a complex number.',\n examples: [\n 're(2 + 3i)',\n 'im(2 + 3i)',\n 're(-5.2i)',\n 're(2.4)'\n ],\n seealso: [\n 'im',\n 'conj',\n 'abs',\n 'arg'\n ]\n}\n","export const imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: [\n 'im(x)'\n ],\n description: 'Get the imaginary part of a complex number.',\n examples: [\n 'im(2 + 3i)',\n 're(2 + 3i)',\n 'im(-5.2i)',\n 'im(2.4)'\n ],\n seealso: [\n 're',\n 'conj',\n 'abs',\n 'arg'\n ]\n}\n","export const evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: [\n 'evaluate(expression)',\n 'evaluate(expression, scope)',\n 'evaluate([expr1, expr2, expr3, ...])',\n 'evaluate([expr1, expr2, expr3, ...], scope)'\n ],\n description: 'Evaluate an expression or an array with expressions.',\n examples: [\n 'evaluate(\"2 + 3\")',\n 'evaluate(\"sqrt(16)\")',\n 'evaluate(\"2 inch to cm\")',\n 'evaluate(\"sin(x * pi)\", { \"x\": 1/2 })',\n 'evaluate([\"width=2\", \"height=4\",\"width*height\"])'\n ],\n seealso: []\n}\n","export const helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: [\n 'help(object)',\n 'help(string)'\n ],\n description: 'Display documentation on a function or data type.',\n examples: [\n 'help(sqrt)',\n 'help(\"complex\")'\n ],\n seealso: []\n}\n","export const distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: [\n 'distance([x1, y1], [x2, y2])',\n 'distance([[x1, y1], [x2, y2]])'\n ],\n description: 'Calculates the Euclidean distance between two points.',\n examples: [\n 'distance([0,0], [4,4])',\n 'distance([[0,0], [4,4]])'\n ],\n seealso: []\n}\n","export const intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: [\n 'intersect(expr1, expr2, expr3, expr4)',\n 'intersect(expr1, expr2, expr3)'\n ],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: [\n 'intersect([0, 0], [10, 10], [10, 0], [0, 10])',\n 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'\n ],\n seealso: []\n}\n","export const andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: [\n 'x and y',\n 'and(x, y)'\n ],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: [\n 'true and false',\n 'true and true',\n '2 and 4'\n ],\n seealso: [\n 'not', 'or', 'xor'\n ]\n}\n","export const notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: [\n 'not x',\n 'not(x)'\n ],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: [\n 'not true',\n 'not false',\n 'not 2',\n 'not 0'\n ],\n seealso: [\n 'and', 'or', 'xor'\n ]\n}\n","export const orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: [\n 'x or y',\n 'or(x, y)'\n ],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: [\n 'true or false',\n 'false or false',\n '0 or 4'\n ],\n seealso: [\n 'not', 'and', 'xor'\n ]\n}\n","export const xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: [\n 'x xor y',\n 'xor(x, y)'\n ],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: [\n 'true xor false',\n 'false xor false',\n 'true xor true',\n '0 xor 4'\n ],\n seealso: [\n 'not', 'and', 'or'\n ]\n}\n","export const concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: [\n 'concat(A, B, C, ...)',\n 'concat(A, B, C, ..., dim)'\n ],\n description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.',\n examples: [\n 'A = [1, 2; 5, 6]',\n 'B = [3, 4; 7, 8]',\n 'concat(A, B)',\n 'concat(A, B, 1)',\n 'concat(A, B, 2)'\n ],\n seealso: [\n 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: [\n 'count(x)'\n ],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: [\n 'a = [1, 2; 3, 4; 5, 6]',\n 'count(a)',\n 'size(a)',\n 'count(\"hello world\")'\n ],\n seealso: [\n 'size'\n ]\n}\n","export const crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: [\n 'cross(A, B)'\n ],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: [\n 'cross([1, 1, 0], [0, 1, 1])',\n 'cross([3, -3, 1], [4, 9, 2])',\n 'cross([2, 3, 4], [5, 6, 7])'\n ],\n seealso: [\n 'multiply',\n 'dot'\n ]\n}\n","export const columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: [\n 'column(x, index)'\n ],\n description: 'Return a column from a matrix or array.',\n examples: [\n 'A = [[1, 2], [3, 4]]',\n 'column(A, 1)',\n 'column(A, 2)'\n ],\n seealso: ['row', 'matrixFromColumns']\n}\n","export const ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: [\n 'x\\'',\n 'ctranspose(x)'\n ],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'a\\'',\n 'ctranspose(a)'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'\n ]\n}\n","export const detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: [\n 'det(x)'\n ],\n description: 'Calculate the determinant of a matrix',\n examples: [\n 'det([1, 2; 3, 4])',\n 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'\n ],\n seealso: [\n 'concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: [\n 'diag(x)',\n 'diag(x, k)'\n ],\n description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',\n examples: [\n 'diag(1:3)',\n 'diag(1:3, 1)',\n 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]',\n 'diag(a)'\n ],\n seealso: [\n 'concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: [\n 'diff(arr)',\n 'diff(arr, dim)'\n ],\n description: [\n 'Create a new matrix or array with the difference of the passed matrix or array.',\n 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference',\n 'If no dimension parameter is passed it is assumed as dimension 0',\n 'Dimension is zero-based in javascript and one-based in the parser',\n 'Arrays must be \\'rectangular\\' meaning arrays like [1, 2]',\n 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'\n ],\n examples: [\n 'A = [1, 2, 4, 7, 0]',\n 'diff(A)',\n 'diff(A, 1)',\n 'B = [[1, 2], [3, 4]]',\n 'diff(B)',\n 'diff(B, 1)',\n 'diff(B, 2)',\n 'diff(B, bignumber(2))',\n 'diff([[1, 2], matrix([3, 4])], 2)'\n ],\n seealso: ['subtract', 'partitionSelect']\n}\n","export const dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: [\n 'dot(A, B)',\n 'A * B'\n ],\n description: 'Calculate the dot product of two vectors. ' +\n 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' +\n 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn',\n examples: [\n 'dot([2, 4, 1], [2, 2, 3])',\n '[2, 4, 1] * [2, 2, 3]'\n ],\n seealso: [\n 'multiply',\n 'cross'\n ]\n}\n","export const getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: [\n 'getMatrixDataType(x)'\n ],\n description: 'Find the data type of all elements in a matrix or array, ' +\n 'for example \"number\" if all items are a number ' +\n 'and \"Complex\" if all values are complex numbers. ' +\n 'If a matrix contains more than one data type, it will return \"mixed\".',\n examples: [\n 'getMatrixDataType([1, 2, 3])',\n 'getMatrixDataType([[5 cm], [2 inch]])',\n 'getMatrixDataType([1, \"text\"])',\n 'getMatrixDataType([1, bignumber(4)])'\n ],\n seealso: ['matrix', 'sparse', 'typeOf']\n}\n","export const identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: [\n 'identity(n)',\n 'identity(m, n)',\n 'identity([m, n])'\n ],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: [\n 'identity(3)',\n 'identity(3, 5)',\n 'a = [1, 2, 3; 4, 5, 6]',\n 'identity(size(a))'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: [\n 'filter(x, test)'\n ],\n description: 'Filter items in a matrix.',\n examples: [\n 'isPositive(x) = x > 0',\n 'filter([6, -2, -1, 4, 3], isPositive)',\n 'filter([6, -2, 0, 1, 0], x != 0)'\n ],\n seealso: ['sort', 'map', 'forEach']\n}\n","export const flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: [\n 'flatten(x)'\n ],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'size(a)',\n 'b = flatten(a)',\n 'size(b)'\n ],\n seealso: [\n 'concat', 'resize', 'size', 'squeeze'\n ]\n}\n","export const forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: [\n 'forEach(x, callback)'\n ],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: [\n 'numberOfPets = {}',\n 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;',\n 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)',\n 'numberOfPets'\n ],\n seealso: ['map', 'sort', 'filter']\n}\n","export const invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: [\n 'inv(x)'\n ],\n description: 'Calculate the inverse of a matrix',\n examples: [\n 'inv([1, 2; 3, 4])',\n 'inv(4)',\n '1 / 4'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: [\n 'pinv(x)'\n ],\n description: 'Calculate the Moore–Penrose inverse of a matrix',\n examples: [\n 'pinv([1, 2; 3, 4])',\n 'pinv([[1, 0], [0, 1], [0, 1]])',\n 'pinv(4)'\n ],\n seealso: [\n 'inv'\n ]\n}\n","export const eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: [\n 'eigs(x)'\n ],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: [\n 'eigs([[5, 2.3], [2.3, 1]])',\n 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'\n ],\n seealso: [\n 'inv'\n ]\n}\n","export const kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: [\n 'kron(x, y)'\n ],\n description: 'Calculates the Kronecker product of 2 matrices or vectors.',\n examples: [\n 'kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])',\n 'kron([1,1], [2,3,4])'\n ],\n seealso: [\n 'multiply', 'dot', 'cross'\n ]\n}\n","export const matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: [\n 'matrixFromFunction(size, fn)',\n 'matrixFromFunction(size, fn, format)',\n 'matrixFromFunction(size, fn, format, datatype)',\n 'matrixFromFunction(size, format, fn)',\n 'matrixFromFunction(size, format, datatype, fn)'\n ],\n description: 'Create a matrix by evaluating a generating function at each index.',\n examples: [\n 'f(I) = I[1] - I[2]',\n 'matrixFromFunction([3,3], f)',\n 'g(I) = I[1] - I[2] == 1 ? 4 : 0',\n 'matrixFromFunction([100, 100], \"sparse\", g)',\n 'matrixFromFunction([5], random)'\n ],\n seealso: [\n 'matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros'\n ]\n}\n","export const matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: [\n 'matrixFromRows(...arr)',\n 'matrixFromRows(row1, row2)',\n 'matrixFromRows(row1, row2, row3)'\n ],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: [\n 'matrixFromRows([1, 2, 3], [[4],[5],[6]])'\n ],\n seealso: [\n 'matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros'\n ]\n}\n","export const matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: [\n 'matrixFromColumns(...arr)',\n 'matrixFromColumns(row1, row2)',\n 'matrixFromColumns(row1, row2, row3)'\n ],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: [\n 'matrixFromColumns([1, 2, 3], [[4],[5],[6]])'\n ],\n seealso: [\n 'matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros'\n ]\n}\n","export const mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: [\n 'map(x, callback)',\n 'map(x, y, ..., callback)'\n ],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.',\n examples: [\n 'map([1, 2, 3], square)',\n 'map([1, 2], [3, 4], f(a,b) = a + b)'\n ],\n seealso: ['filter', 'forEach']\n}\n","export const onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: [\n 'ones(m)',\n 'ones(m, n)',\n 'ones(m, n, p, ...)',\n 'ones([m])',\n 'ones([m, n])',\n 'ones([m, n, p, ...])'\n ],\n description: 'Create a matrix containing ones.',\n examples: [\n 'ones(3)',\n 'ones(3, 5)',\n 'ones([2,3]) * 4.5',\n 'a = [1, 2, 3; 4, 5, 6]',\n 'ones(size(a))'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: [\n 'partitionSelect(x, k)',\n 'partitionSelect(x, k, compare)'\n ],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n examples: [\n 'partitionSelect([5, 10, 1], 2)',\n 'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)',\n 'arr = [5, 2, 1]',\n 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]',\n 'arr',\n 'partitionSelect(arr, 1, \\'desc\\') # returns 2, arr is now: [5, 2, 1]',\n 'arr'\n ],\n seealso: ['sort']\n}\n","export const rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: [\n 'start:end',\n 'start:step:end',\n 'range(start, end)',\n 'range(start, end, step)',\n 'range(string)'\n ],\n description:\n 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n examples: [\n '1:5',\n '3:-1:-3',\n 'range(3, 7)',\n 'range(0, 12, 2)',\n 'range(\"4:10\")',\n 'range(1m, 1m, 3m)',\n 'a = [1, 2, 3, 4; 5, 6, 7, 8]',\n 'a[1:2, 1:2]'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: [\n 'resize(x, size)',\n 'resize(x, size, defaultValue)'\n ],\n description: 'Resize a matrix.',\n examples: [\n 'resize([1,2,3,4,5], [3])',\n 'resize([1,2,3], [5])',\n 'resize([1,2,3], [5], -1)',\n 'resize(2, [2, 3])',\n 'resize(\"hello\", [8], \"!\")'\n ],\n seealso: [\n 'size', 'subset', 'squeeze', 'reshape'\n ]\n}\n","export const reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: [\n 'reshape(x, sizes)'\n ],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n examples: [\n 'reshape([1, 2, 3, 4, 5, 6], [2, 3])',\n 'reshape([[1, 2], [3, 4]], [1, 4])',\n 'reshape([[1, 2], [3, 4]], [4])',\n 'reshape([1, 2, 3, 4], [-1, 2])'\n ],\n seealso: [\n 'size', 'squeeze', 'resize'\n ]\n}\n","export const rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: [\n 'rotate(w, theta)',\n 'rotate(w, theta, v)'\n ],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' +\n 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: [\n 'rotate([1, 0], pi / 2)',\n 'rotate(matrix([1, 0]), unit(\"35deg\"))',\n 'rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])',\n 'rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'\n ],\n seealso: [\n 'matrix', 'rotationMatrix'\n ]\n}\n","export const rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: [\n 'rotationMatrix(theta)',\n 'rotationMatrix(theta, v)',\n 'rotationMatrix(theta, v, format)'\n ],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' +\n 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: [\n 'rotationMatrix(pi / 2)',\n 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])',\n 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'\n ],\n seealso: [\n 'cos', 'sin'\n ]\n}\n","export const rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: [\n 'row(x, index)'\n ],\n description: 'Return a row from a matrix or array.',\n examples: [\n 'A = [[1, 2], [3, 4]]',\n 'row(A, 1)',\n 'row(A, 2)'\n ],\n seealso: ['column', 'matrixFromRows']\n}\n","export const sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: [\n 'size(x)'\n ],\n description: 'Calculate the size of a matrix.',\n examples: [\n 'size(2.3)',\n 'size(\"hello world\")',\n 'a = [1, 2; 3, 4; 5, 6]',\n 'size(a)',\n 'size(1:6)'\n ],\n seealso: [\n 'concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: [\n 'sort(x)',\n 'sort(x, compare)'\n ],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n examples: [\n 'sort([5, 10, 1])',\n 'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")',\n 'sortByLength(a, b) = size(a)[1] - size(b)[1]',\n 'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)',\n 'sort([\"10\", \"1\", \"2\"], \"natural\")'\n ],\n seealso: ['map', 'filter', 'forEach']\n}\n","export const squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: [\n 'squeeze(x)'\n ],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: [\n 'a = zeros(3,2,1)',\n 'size(squeeze(a))',\n 'b = zeros(1,1,3)',\n 'size(squeeze(b))'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: [\n 'value(index)',\n 'value(index) = replacement',\n 'subset(value, [index])',\n 'subset(value, [index], replacement)'\n ],\n description: 'Get or set a subset of the entries of a matrix or ' +\n 'characters of a string. ' +\n 'Indexes are one-based. There should be one index specification for ' +\n 'each dimension of the target. Each specification can be a single ' +\n 'index, a list of indices, or a range in colon notation `l:u`. ' +\n 'In a range, both the lower bound l and upper bound u are included; ' +\n 'and if a bound is omitted it defaults to the most extreme valid value. ' +\n 'The cartesian product of the indices specified in each dimension ' +\n 'determines the target of the operation.',\n examples: [\n 'd = [1, 2; 3, 4]',\n 'e = []',\n 'e[1, 1:2] = [5, 6]',\n 'e[2, :] = [7, 8]',\n 'f = d * e',\n 'f[2, 1]',\n 'f[:, 1]',\n 'f[[1,2], [1,3]] = [9, 10; 11, 12]',\n 'f'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros'\n ]\n}\n","export const traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: [\n 'trace(A)'\n ],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: [\n 'A = [1, 2, 3; -1, 2, 3; 2, 0, 3]',\n 'trace(A)'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros'\n ]\n}\n","export const transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: [\n 'x\\'',\n 'transpose(x)'\n ],\n description: 'Transpose a matrix',\n examples: [\n 'a = [1, 2, 3; 4, 5, 6]',\n 'a\\'',\n 'transpose(a)'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'\n ]\n}\n","export const zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: [\n 'zeros(m)',\n 'zeros(m, n)',\n 'zeros(m, n, p, ...)',\n 'zeros([m])',\n 'zeros([m, n])',\n 'zeros([m, n, p, ...])'\n ],\n description: 'Create a matrix containing zeros.',\n examples: [\n 'zeros(3)',\n 'zeros(3, 5)',\n 'a = [1, 2, 3; 4, 5, 6]',\n 'zeros(size(a))'\n ],\n seealso: [\n 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose'\n ]\n}\n","export const fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: [\n 'fft(x)'\n ],\n description: 'Calculate N-dimensional Fourier transform',\n examples: [\n 'fft([[1, 0], [1, 0]])'\n ],\n seealso: [\n 'ifft'\n ]\n}\n","export const ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: [\n 'ifft(x)'\n ],\n description: 'Calculate N-dimensional inverse Fourier transform',\n examples: [\n 'ifft([[2, 2], [0, 0]])'\n ],\n seealso: [\n 'fft'\n ]\n}\n","export const sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: [\n 'sylvester(A,B,C)'\n ],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n examples: [\n 'sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])',\n 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]',\n 'sylvester(A, B, C)'\n ],\n seealso: [\n 'schur', 'lyap'\n ]\n}\n","export const schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: [\n 'schur(A)'\n ],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: [\n 'schur([[1, 0], [-4, 3]])',\n 'A = [[1, 0], [-4, 3]]',\n 'schur(A)'\n ],\n seealso: [\n 'lyap', 'sylvester'\n ]\n}\n","export const lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: [\n 'lyap(A,Q)'\n ],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: [\n 'lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])',\n 'A = [[-2, 0], [1, -4]]',\n 'Q = [[3, 1], [1, 3]]',\n 'lyap(A,Q)'\n ],\n seealso: [\n 'schur', 'sylvester'\n ]\n}\n","export const solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: [\n 'solveODE(func, tspan, y0)',\n 'solveODE(func, tspan, y0, options)'\n ],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n examples: [\n 'f(t,y) = y',\n 'tspan = [0, 4]',\n 'solveODE(f, tspan, 1)',\n 'solveODE(f, tspan, [1, 2])',\n 'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'\n ],\n seealso: ['derivative', 'simplifyCore']\n}\n","export const combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: [\n 'combinations(n, k)'\n ],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: [\n 'combinations(7, 5)'\n ],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n}\n","export const combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: [\n 'combinationsWithRep(n, k)'\n ],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: [\n 'combinationsWithRep(7, 5)'\n ],\n seealso: ['combinations', 'permutations', 'factorial']\n}\n","export const factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: [\n 'n!',\n 'factorial(n)'\n ],\n description: 'Compute the factorial of a value',\n examples: [\n '5!',\n '5 * 4 * 3 * 2 * 1',\n '3!'\n ],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n}\n","export const gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: [\n 'gamma(n)'\n ],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: [\n 'gamma(4)',\n '3!',\n 'gamma(1/2)',\n 'sqrt(pi)'\n ],\n seealso: ['factorial']\n}\n","export const kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: [\n 'kldivergence(x, y)'\n ],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: [\n 'kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'\n ],\n seealso: []\n}\n","export const lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\n description:\n 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' +\n 'using Lanczos approximation for numbers and Stirling series for complex numbers.',\n examples: [\n 'lgamma(4)',\n 'lgamma(1/2)',\n 'lgamma(i)',\n 'lgamma(complex(1.1, 2))'\n ],\n seealso: ['gamma']\n}\n","export const multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: [\n 'multinomial(A)'\n ],\n description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.',\n examples: [\n 'multinomial([1, 2, 1])'\n ],\n seealso: ['combinations', 'factorial']\n}\n","export const permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: [\n 'permutations(n)',\n 'permutations(n, k)'\n ],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: [\n 'permutations(5)',\n 'permutations(5, 3)'\n ],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n}\n","export const pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: [\n 'pickRandom(array)',\n 'pickRandom(array, number)',\n 'pickRandom(array, weights)',\n 'pickRandom(array, number, weights)',\n 'pickRandom(array, weights, number)'\n ],\n description:\n 'Pick a random entry from a given array.',\n examples: [\n 'pickRandom(0:10)',\n 'pickRandom([1, 3, 1, 6])',\n 'pickRandom([1, 3, 1, 6], 2)',\n 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])',\n 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])',\n 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'\n ],\n seealso: ['random', 'randomInt']\n}\n","export const randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: [\n 'random()',\n 'random(max)',\n 'random(min, max)',\n 'random(size)',\n 'random(size, max)',\n 'random(size, min, max)'\n ],\n description:\n 'Return a random number.',\n examples: [\n 'random()',\n 'random(10, 20)',\n 'random([2, 3])'\n ],\n seealso: ['pickRandom', 'randomInt']\n}\n","export const randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: [\n 'randomInt(max)',\n 'randomInt(min, max)',\n 'randomInt(size)',\n 'randomInt(size, max)',\n 'randomInt(size, min, max)'\n ],\n description:\n 'Return a random integer number',\n examples: [\n 'randomInt(10, 20)',\n 'randomInt([2, 3], 10)'\n ],\n seealso: ['pickRandom', 'random']\n}\n","export const compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: [\n 'compare(x, y)'\n ],\n description:\n 'Compare two values. ' +\n 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: [\n 'compare(2, 3)',\n 'compare(3, 2)',\n 'compare(2, 2)',\n 'compare(5cm, 40mm)',\n 'compare(2, [1, 2, 3])'\n ],\n seealso: [\n 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText'\n ]\n}\n","export const compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: [\n 'compareNatural(x, y)'\n ],\n description:\n 'Compare two values of any type in a deterministic, natural way. ' +\n 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: [\n 'compareNatural(2, 3)',\n 'compareNatural(3, 2)',\n 'compareNatural(2, 2)',\n 'compareNatural(5cm, 40mm)',\n 'compareNatural(\"2\", \"10\")',\n 'compareNatural(2 + 3i, 2 + 4i)',\n 'compareNatural([1, 2, 4], [1, 2, 3])',\n 'compareNatural([1, 5], [1, 2, 3])',\n 'compareNatural([1, 2], [1, 2])',\n 'compareNatural({a: 2}, {a: 4})'\n ],\n seealso: [\n 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText'\n ]\n}\n","export const compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: [\n 'compareText(x, y)'\n ],\n description:\n 'Compare two strings lexically. Comparison is case sensitive. ' +\n 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: [\n 'compareText(\"B\", \"A\")',\n 'compareText(\"A\", \"B\")',\n 'compareText(\"A\", \"A\")',\n 'compareText(\"2\", \"10\")',\n 'compare(\"2\", \"10\")',\n 'compare(2, 10)',\n 'compareNatural(\"2\", \"10\")',\n 'compareText(\"B\", [\"A\", \"B\", \"C\"])'\n ],\n seealso: [\n 'compare', 'compareNatural'\n ]\n}\n","export const deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: [\n 'deepEqual(x, y)'\n ],\n description:\n 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.',\n examples: [\n 'deepEqual([1,3,4], [1,3,4])',\n 'deepEqual([1,3,4], [1,3])'\n ],\n seealso: [\n 'equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare'\n ]\n}\n","export const equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: [\n 'x == y',\n 'equal(x, y)'\n ],\n description:\n 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: [\n '2+2 == 3',\n '2+2 == 4',\n 'a = 3.2',\n 'b = 6-2.8',\n 'a == b',\n '50cm == 0.5m'\n ],\n seealso: [\n 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText'\n ]\n}\n","export const equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: [\n 'equalText(x, y)'\n ],\n description:\n 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: [\n 'equalText(\"Hello\", \"Hello\")',\n 'equalText(\"a\", \"A\")',\n 'equal(\"2e3\", \"2000\")',\n 'equalText(\"2e3\", \"2000\")',\n 'equalText(\"B\", [\"A\", \"B\", \"C\"])'\n ],\n seealso: [\n 'compare', 'compareNatural', 'compareText', 'equal'\n ]\n}\n","export const largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: [\n 'x > y',\n 'larger(x, y)'\n ],\n description:\n 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.',\n examples: [\n '2 > 3',\n '5 > 2*2',\n 'a = 3.3',\n 'b = 6-2.8',\n '(a > b)',\n '(b < a)',\n '5 cm > 2 inch'\n ],\n seealso: [\n 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare'\n ]\n}\n","export const largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: [\n 'x >= y',\n 'largerEq(x, y)'\n ],\n description:\n 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.',\n examples: [\n '2 >= 1+1',\n '2 > 1+1',\n 'a = 3.2',\n 'b = 6-2.8',\n '(a >= b)'\n ],\n seealso: [\n 'equal', 'unequal', 'smallerEq', 'smaller', 'compare'\n ]\n}\n","export const smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: [\n 'x < y',\n 'smaller(x, y)'\n ],\n description:\n 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.',\n examples: [\n '2 < 3',\n '5 < 2*2',\n 'a = 3.3',\n 'b = 6-2.8',\n '(a < b)',\n '5 cm < 2 inch'\n ],\n seealso: [\n 'equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare'\n ]\n}\n","export const smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: [\n 'x <= y',\n 'smallerEq(x, y)'\n ],\n description:\n 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: [\n '2 <= 1+1',\n '2 < 1+1',\n 'a = 3.2',\n 'b = 6-2.8',\n '(a <= b)'\n ],\n seealso: [\n 'equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare'\n ]\n}\n","export const unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: [\n 'x != y',\n 'unequal(x, y)'\n ],\n description:\n 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: [\n '2+2 != 3',\n '2+2 != 4',\n 'a = 3.2',\n 'b = 6-2.8',\n 'a != b',\n '50cm != 0.5m',\n '5 cm != 2 inch'\n ],\n seealso: [\n 'equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual'\n ]\n}\n","export const setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: [\n 'setCartesian(set1, set2)'\n ],\n description:\n 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.',\n examples: [\n 'setCartesian([1, 2], [3, 4])'\n ],\n seealso: [\n 'setUnion', 'setIntersect', 'setDifference', 'setPowerset'\n ]\n}\n","export const setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: [\n 'setDifference(set1, set2)'\n ],\n description:\n 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: [\n 'setDifference([1, 2, 3, 4], [3, 4, 5, 6])',\n 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'\n ],\n seealso: [\n 'setUnion', 'setIntersect', 'setSymDifference'\n ]\n}\n","export const setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: [\n 'setDistinct(set)'\n ],\n description:\n 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: [\n 'setDistinct([1, 1, 1, 2, 2, 3])'\n ],\n seealso: [\n 'setMultiplicity'\n ]\n}\n","export const setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: [\n 'setIntersect(set1, set2)'\n ],\n description:\n 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: [\n 'setIntersect([1, 2, 3, 4], [3, 4, 5, 6])',\n 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'\n ],\n seealso: [\n 'setUnion', 'setDifference'\n ]\n}\n","export const setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: [\n 'setIsSubset(set1, set2)'\n ],\n description:\n 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: [\n 'setIsSubset([1, 2], [3, 4, 5, 6])',\n 'setIsSubset([3, 4], [3, 4, 5, 6])'\n ],\n seealso: [\n 'setUnion', 'setIntersect', 'setDifference'\n ]\n}\n","export const setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: [\n 'setMultiplicity(element, set)'\n ],\n description:\n 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: [\n 'setMultiplicity(1, [1, 2, 2, 4])',\n 'setMultiplicity(2, [1, 2, 2, 4])'\n ],\n seealso: [\n 'setDistinct', 'setSize'\n ]\n}\n","export const setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: [\n 'setPowerset(set)'\n ],\n description:\n 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: [\n 'setPowerset([1, 2, 3])'\n ],\n seealso: [\n 'setCartesian'\n ]\n}\n","export const setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: [\n 'setSize(set)',\n 'setSize(set, unique)'\n ],\n description:\n 'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: [\n 'setSize([1, 2, 2, 4])',\n 'setSize([1, 2, 2, 4], true)'\n ],\n seealso: [\n 'setUnion', 'setIntersect', 'setDifference'\n ]\n}\n","export const setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: [\n 'setSymDifference(set1, set2)'\n ],\n description:\n 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: [\n 'setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])',\n 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'\n ],\n seealso: [\n 'setUnion', 'setIntersect', 'setDifference'\n ]\n}\n","export const setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: [\n 'setUnion(set1, set2)'\n ],\n description:\n 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: [\n 'setUnion([1, 2, 3, 4], [3, 4, 5, 6])',\n 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'\n ],\n seealso: [\n 'setIntersect', 'setDifference'\n ]\n}\n","export const zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: [\n 'zpk2tf(z, p, k)'\n ],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: [\n 'zpk2tf([1, 2], [-1, -2], 1)',\n 'zpk2tf([1, 2], [-1, -2])',\n 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'\n ],\n seealso: []\n}\n","export const freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: [\n 'freqz(b, a)',\n 'freqz(b, a, w)'\n ],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: [\n 'freqz([1, 2], [1, 2, 3])',\n 'freqz([1, 2], [1, 2, 3], [0, 1])',\n 'freqz([1, 2], [1, 2, 3], 512)'\n ],\n seealso: []\n}\n","export const erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: [\n 'erf(x)'\n ],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: [\n 'erf(0.2)',\n 'erf(-0.5)',\n 'erf(4)'\n ],\n seealso: []\n}\n","export const zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: [\n 'zeta(s)'\n ],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\\'s Functional Equation for the entire complex plane',\n examples: [\n 'zeta(0.2)',\n 'zeta(-0.5)',\n 'zeta(4)'\n ],\n seealso: []\n}\n","export const cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: [\n 'cumsum(a, b, c, ...)',\n 'cumsum(A)'\n ],\n description: 'Compute the cumulative sum of all values.',\n examples: [\n 'cumsum(2, 3, 4, 1)',\n 'cumsum([2, 3, 4, 1])',\n 'cumsum([1, 2; 3, 4])',\n 'cumsum([1, 2; 3, 4], 1)',\n 'cumsum([1, 2; 3, 4], 2)'\n ],\n seealso: [\n 'max',\n 'mean',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: [\n 'mad(a, b, c, ...)',\n 'mad(A)'\n ],\n description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.',\n examples: [\n 'mad(10, 20, 30)',\n 'mad([1, 2, 3])'\n ],\n seealso: [\n 'mean',\n 'median',\n 'std',\n 'abs'\n ]\n}\n","export const maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: [\n 'max(a, b, c, ...)',\n 'max(A)',\n 'max(A, dimension)'\n ],\n description: 'Compute the maximum value of a list of values.',\n examples: [\n 'max(2, 3, 4, 1)',\n 'max([2, 3, 4, 1])',\n 'max([2, 5; 4, 3])',\n 'max([2, 5; 4, 3], 1)',\n 'max([2, 5; 4, 3], 2)',\n 'max(2.7, 7.1, -4.5, 2.0, 4.1)',\n 'min(2.7, 7.1, -4.5, 2.0, 4.1)'\n ],\n seealso: [\n 'mean',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: [\n 'mean(a, b, c, ...)',\n 'mean(A)',\n 'mean(A, dimension)'\n ],\n description: 'Compute the arithmetic mean of a list of values.',\n examples: [\n 'mean(2, 3, 4, 1)',\n 'mean([2, 3, 4, 1])',\n 'mean([2, 5; 4, 3])',\n 'mean([2, 5; 4, 3], 1)',\n 'mean([2, 5; 4, 3], 2)',\n 'mean([1.0, 2.7, 3.2, 4.0])'\n ],\n seealso: [\n 'max',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: [\n 'median(a, b, c, ...)',\n 'median(A)'\n ],\n description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.',\n examples: [\n 'median(5, 2, 7)',\n 'median([3, -1, 5, 7])'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'prod',\n 'std',\n 'sum',\n 'variance',\n 'quantileSeq'\n ]\n}\n","export const minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: [\n 'min(a, b, c, ...)',\n 'min(A)',\n 'min(A, dimension)'\n ],\n description: 'Compute the minimum value of a list of values.',\n examples: [\n 'min(2, 3, 4, 1)',\n 'min([2, 3, 4, 1])',\n 'min([2, 5; 4, 3])',\n 'min([2, 5; 4, 3], 1)',\n 'min([2, 5; 4, 3], 2)',\n 'min(2.7, 7.1, -4.5, 2.0, 4.1)',\n 'max(2.7, 7.1, -4.5, 2.0, 4.1)'\n ],\n seealso: [\n 'max',\n 'mean',\n 'median',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: [\n 'mode(a, b, c, ...)',\n 'mode(A)',\n 'mode(A, a, b, B, c, ...)'\n ],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: [\n 'mode(2, 1, 4, 3, 1)',\n 'mode([1, 2.7, 3.2, 4, 2.7])',\n 'mode(1, 4, 6, 1, 6)'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'median',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: [\n 'prod(a, b, c, ...)',\n 'prod(A)'\n ],\n description: 'Compute the product of all values.',\n examples: [\n 'prod(2, 3, 4)',\n 'prod([2, 3, 4])',\n 'prod([2, 5; 4, 3])'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'median',\n 'min',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: [\n 'quantileSeq(A, prob[, sorted])',\n 'quantileSeq(A, [prob1, prob2, ...][, sorted])',\n 'quantileSeq(A, N[, sorted])'\n ],\n description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n examples: [\n 'quantileSeq([3, -1, 5, 7], 0.5)',\n 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])',\n 'quantileSeq([3, -1, 5, 7], 2)',\n 'quantileSeq([-1, 3, 5, 7], 0.5, true)'\n ],\n seealso: [\n 'mean',\n 'median',\n 'min',\n 'max',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: [\n 'std(a, b, c, ...)',\n 'std(A)',\n 'std(A, dimension)',\n 'std(A, normalization)',\n 'std(A, dimension, normalization)'\n ],\n description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: [\n 'std(2, 4, 6)',\n 'std([2, 4, 6, 8])',\n 'std([2, 4, 6, 8], \"uncorrected\")',\n 'std([2, 4, 6, 8], \"biased\")',\n 'std([1, 2, 3; 4, 5, 6])'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'median',\n 'prod',\n 'sum',\n 'variance'\n ]\n}\n","export const sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: [\n 'sum(a, b, c, ...)',\n 'sum(A)',\n 'sum(A, dimension)'\n ],\n description: 'Compute the sum of all values.',\n examples: [\n 'sum(2, 3, 4, 1)',\n 'sum([2, 3, 4, 1])',\n 'sum([2, 5; 4, 3])'\n ],\n seealso: [\n 'max',\n 'mean',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum',\n 'variance'\n ]\n}\n","export const varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: [\n 'variance(a, b, c, ...)',\n 'variance(A)',\n 'variance(A, dimension)',\n 'variance(A, normalization)',\n 'variance(A, dimension, normalization)'\n ],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: [\n 'variance(2, 4, 6)',\n 'variance([2, 4, 6, 8])',\n 'variance([2, 4, 6, 8], \"uncorrected\")',\n 'variance([2, 4, 6, 8], \"biased\")',\n 'variance([1, 2, 3; 4, 5, 6])'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum'\n ]\n}\n","export const corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: [\n 'corr(A,B)'\n ],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n examples: [\n 'corr([2, 4, 6, 8],[1, 2, 3, 6])',\n 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'\n ],\n seealso: [\n 'max',\n 'mean',\n 'min',\n 'median',\n 'min',\n 'prod',\n 'std',\n 'sum'\n ]\n}\n","export const acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: [\n 'acos(x)'\n ],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: [\n 'acos(0.5)',\n 'acos(cos(2.3))'\n ],\n seealso: [\n 'cos',\n 'atan',\n 'asin'\n ]\n}\n","export const acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: [\n 'acosh(x)'\n ],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: [\n 'acosh(1.5)'\n ],\n seealso: [\n 'cosh',\n 'asinh',\n 'atanh'\n ]\n}\n","export const acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: [\n 'acot(x)'\n ],\n description: 'Calculate the inverse cotangent of a value.',\n examples: [\n 'acot(0.5)',\n 'acot(cot(0.5))',\n 'acot(2)'\n ],\n seealso: [\n 'cot',\n 'atan'\n ]\n}\n","export const acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: [\n 'acoth(x)'\n ],\n description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: [\n 'acoth(2)',\n 'acoth(0.5)'\n ],\n seealso: [\n 'acsch',\n 'asech'\n ]\n}\n","export const acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: [\n 'acsc(x)'\n ],\n description: 'Calculate the inverse cotangent of a value.',\n examples: [\n 'acsc(2)',\n 'acsc(csc(0.5))',\n 'acsc(0.5)'\n ],\n seealso: [\n 'csc',\n 'asin',\n 'asec'\n ]\n}\n","export const acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: [\n 'acsch(x)'\n ],\n description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: [\n 'acsch(0.5)'\n ],\n seealso: [\n 'asech',\n 'acoth'\n ]\n}\n","export const asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: [\n 'asec(x)'\n ],\n description: 'Calculate the inverse secant of a value.',\n examples: [\n 'asec(0.5)',\n 'asec(sec(0.5))',\n 'asec(2)'\n ],\n seealso: [\n 'acos',\n 'acot',\n 'acsc'\n ]\n}\n","export const asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: [\n 'asech(x)'\n ],\n description: 'Calculate the inverse secant of a value.',\n examples: [\n 'asech(0.5)'\n ],\n seealso: [\n 'acsch',\n 'acoth'\n ]\n}\n","export const asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: [\n 'asin(x)'\n ],\n description: 'Compute the inverse sine of a value in radians.',\n examples: [\n 'asin(0.5)',\n 'asin(sin(0.5))'\n ],\n seealso: [\n 'sin',\n 'acos',\n 'atan'\n ]\n}\n","export const asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: [\n 'asinh(x)'\n ],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: [\n 'asinh(0.5)'\n ],\n seealso: [\n 'acosh',\n 'atanh'\n ]\n}\n","export const atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: [\n 'atan(x)'\n ],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: [\n 'atan(0.5)',\n 'atan(tan(0.5))'\n ],\n seealso: [\n 'tan',\n 'acos',\n 'asin'\n ]\n}\n","export const atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: [\n 'atanh(x)'\n ],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: [\n 'atanh(0.5)'\n ],\n seealso: [\n 'acosh',\n 'asinh'\n ]\n}\n","export const atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: [\n 'atan2(y, x)'\n ],\n description:\n 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: [\n 'atan2(2, 2) / pi',\n 'angle = 60 deg in rad',\n 'x = cos(angle)',\n 'y = sin(angle)',\n 'atan2(y, x)'\n ],\n seealso: [\n 'sin',\n 'cos',\n 'tan'\n ]\n}\n","export const cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: [\n 'cos(x)'\n ],\n description: 'Compute the cosine of x in radians.',\n examples: [\n 'cos(2)',\n 'cos(pi / 4) ^ 2',\n 'cos(180 deg)',\n 'cos(60 deg)',\n 'sin(0.2)^2 + cos(0.2)^2'\n ],\n seealso: [\n 'acos',\n 'sin',\n 'tan'\n ]\n}\n","export const coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: [\n 'cosh(x)'\n ],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: [\n 'cosh(0.5)'\n ],\n seealso: [\n 'sinh',\n 'tanh',\n 'coth'\n ]\n}\n","export const cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: [\n 'cot(x)'\n ],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: [\n 'cot(2)',\n '1 / tan(2)'\n ],\n seealso: [\n 'sec',\n 'csc',\n 'tan'\n ]\n}\n","export const cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: [\n 'coth(x)'\n ],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: [\n 'coth(2)',\n '1 / tanh(2)'\n ],\n seealso: [\n 'sech',\n 'csch',\n 'tanh'\n ]\n}\n","export const cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: [\n 'csc(x)'\n ],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: [\n 'csc(2)',\n '1 / sin(2)'\n ],\n seealso: [\n 'sec',\n 'cot',\n 'sin'\n ]\n}\n","export const cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: [\n 'csch(x)'\n ],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: [\n 'csch(2)',\n '1 / sinh(2)'\n ],\n seealso: [\n 'sech',\n 'coth',\n 'sinh'\n ]\n}\n","export const secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: [\n 'sec(x)'\n ],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: [\n 'sec(2)',\n '1 / cos(2)'\n ],\n seealso: [\n 'cot',\n 'csc',\n 'cos'\n ]\n}\n","export const sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: [\n 'sech(x)'\n ],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: [\n 'sech(2)',\n '1 / cosh(2)'\n ],\n seealso: [\n 'coth',\n 'csch',\n 'cosh'\n ]\n}\n","export const sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: [\n 'sin(x)'\n ],\n description: 'Compute the sine of x in radians.',\n examples: [\n 'sin(2)',\n 'sin(pi / 4) ^ 2',\n 'sin(90 deg)',\n 'sin(30 deg)',\n 'sin(0.2)^2 + cos(0.2)^2'\n ],\n seealso: [\n 'asin',\n 'cos',\n 'tan'\n ]\n}\n","export const sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: [\n 'sinh(x)'\n ],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: [\n 'sinh(0.5)'\n ],\n seealso: [\n 'cosh',\n 'tanh'\n ]\n}\n","export const tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: [\n 'tan(x)'\n ],\n description: 'Compute the tangent of x in radians.',\n examples: [\n 'tan(0.5)',\n 'sin(0.5) / cos(0.5)',\n 'tan(pi / 4)',\n 'tan(45 deg)'\n ],\n seealso: [\n 'atan',\n 'sin',\n 'cos'\n ]\n}\n","export const tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: [\n 'tanh(x)'\n ],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: [\n 'tanh(0.5)',\n 'sinh(0.5) / cosh(0.5)'\n ],\n seealso: [\n 'sinh',\n 'cosh'\n ]\n}\n","export const toDocs = {\n name: 'to',\n category: 'Units',\n syntax: [\n 'x to unit',\n 'to(x, unit)'\n ],\n description: 'Change the unit of a value.',\n examples: [\n '5 inch to cm',\n '3.2kg to g',\n '16 bytes in bits'\n ],\n seealso: []\n}\n","export const cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: [\n 'clone(x)'\n ],\n description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',\n examples: [\n 'clone(3.5)',\n 'clone(2 - 4i)',\n 'clone(45 deg)',\n 'clone([1, 2; 3, 4])',\n 'clone(\"hello world\")'\n ],\n seealso: []\n}\n","export const formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: [\n 'format(value)',\n 'format(value, precision)'\n ],\n description: 'Format a value of any type as string.',\n examples: [\n 'format(2.3)',\n 'format(3 - 4i)',\n 'format([])',\n 'format(pi, 3)'\n ],\n seealso: ['print']\n}\n","export const binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: [\n 'bin(value)'\n ],\n description: 'Format a number as binary',\n examples: [\n 'bin(2)'\n ],\n seealso: ['oct', 'hex']\n}\n","export const octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: [\n 'oct(value)'\n ],\n description: 'Format a number as octal',\n examples: [\n 'oct(56)'\n ],\n seealso: ['bin', 'hex']\n}\n","export const hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: [\n 'hex(value)'\n ],\n description: 'Format a number as hexadecimal',\n examples: [\n 'hex(240)'\n ],\n seealso: ['bin', 'oct']\n}\n","export const isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: [\n 'isNaN(x)'\n ],\n description: 'Test whether a value is NaN (not a number)',\n examples: [\n 'isNaN(2)',\n 'isNaN(0 / 0)',\n 'isNaN(NaN)',\n 'isNaN(Infinity)'\n ],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n}\n","export const isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: [\n 'isInteger(x)'\n ],\n description: 'Test whether a value is an integer number.',\n examples: [\n 'isInteger(2)',\n 'isInteger(3.5)',\n 'isInteger([3, 0.5, -2])'\n ],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n}\n","export const isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: [\n 'isNegative(x)'\n ],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: [\n 'isNegative(2)',\n 'isNegative(0)',\n 'isNegative(-4)',\n 'isNegative([3, 0.5, -2])'\n ],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n}\n","export const isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: [\n 'isNumeric(x)'\n ],\n description: 'Test whether a value is a numeric value. ' +\n 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: [\n 'isNumeric(2)',\n 'isNumeric(\"2\")',\n 'hasNumericValue(\"2\")',\n 'isNumeric(0)',\n 'isNumeric(bignumber(500))',\n 'isNumeric(fraction(0.125))',\n 'isNumeric(2 + 3i)',\n 'isNumeric([2.3, \"foo\", false])'\n ],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']\n}\n","export const hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: [\n 'hasNumericValue(x)'\n ],\n description: 'Test whether a value is an numeric value. ' +\n 'In case of a string, true is returned if the string contains a numeric value.',\n examples: [\n 'hasNumericValue(2)',\n 'hasNumericValue(\"2\")',\n 'isNumeric(\"2\")',\n 'hasNumericValue(0)',\n 'hasNumericValue(bignumber(500))',\n 'hasNumericValue(fraction(0.125))',\n 'hasNumericValue(2 + 3i)',\n 'hasNumericValue([2.3, \"foo\", false])'\n ],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n}\n","export const isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: [\n 'isPositive(x)'\n ],\n description: 'Test whether a value is positive: larger than zero.',\n examples: [\n 'isPositive(2)',\n 'isPositive(0)',\n 'isPositive(-4)',\n 'isPositive([3, 0.5, -2])'\n ],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n}\n","export const isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: [\n 'isPrime(x)'\n ],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: [\n 'isPrime(3)',\n 'isPrime(-2)',\n 'isPrime([2, 17, 100])'\n ],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n}\n","export const isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: [\n 'isZero(x)'\n ],\n description: 'Test whether a value is zero.',\n examples: [\n 'isZero(2)',\n 'isZero(0)',\n 'isZero(-4)',\n 'isZero([3, 0, -2, 0])'\n ],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n}\n","export const printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: [\n 'print(template, values)',\n 'print(template, values, precision)'\n ],\n description: 'Interpolate values into a string template.',\n examples: [\n 'print(\"Lucy is $age years old\", {age: 5})',\n 'print(\"The value of pi is $pi\", {pi: pi}, 3)',\n 'print(\"Hello, $user.name!\", {user: {name: \"John\"}})',\n 'print(\"Values: $1, $2, $3\", [6, 9, 4])'\n ],\n seealso: ['format']\n}\n","export const typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: [\n 'typeOf(x)'\n ],\n description: 'Get the type of a variable.',\n examples: [\n 'typeOf(3.5)',\n 'typeOf(2 - 4i)',\n 'typeOf(45 deg)',\n 'typeOf(\"hello world\")'\n ],\n seealso: ['getMatrixDataType']\n}\n","export const numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: [\n 'numeric(x)'\n ],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: [\n 'numeric(\"4\")',\n 'numeric(\"4\", \"number\")',\n 'numeric(\"4\", \"bigint\")',\n 'numeric(\"4\", \"BigNumber\")',\n 'numeric(\"4\", \"Fraction\")',\n 'numeric(4, \"Fraction\")',\n 'numeric(fraction(2, 5), \"number\")'\n ],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n}\n","import { factory } from '../../utils/factory.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js'\nimport { hasOwnProperty } from '../../utils/object.js'\n\nconst name = 'help'\nconst dependencies = ['typed', 'mathWithTransform', 'Help']\n\nexport const createHelp = /* #__PURE__ */ factory(name, dependencies, ({ typed, mathWithTransform, Help }) => {\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function (search) {\n let prop\n let searchName = search\n\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && (search === mathWithTransform[prop])) {\n searchName = prop\n break\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n\n const doc = getSafeProperty(embeddedDocs, searchName)\n if (!doc) {\n const searchText = typeof searchName === 'function' ? searchName.name : searchName\n throw new Error('No documentation found on \"' + searchText + '\"')\n }\n return new Help(doc)\n }\n })\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'chain'\nconst dependencies = ['typed', 'Chain']\n\nexport const createChain = /* #__PURE__ */ factory(name, dependencies, ({ typed, Chain }) => {\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function () {\n return new Chain()\n },\n\n any: function (value) {\n return new Chain(value)\n }\n })\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { clone } from '../../utils/object.js'\nimport { format } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'det'\nconst dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus']\n\nexport const createDet = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtractScalar, multiply, divideScalar, isZero, unaryMinus }) => {\n /**\n * Calculate the determinant of a matrix.\n *\n * Syntax:\n *\n * math.det(x)\n *\n * Examples:\n *\n * math.det([[1, 2], [3, 4]]) // returns -2\n *\n * const A = [\n * [-2, 2, 3],\n * [-1, 1, 3],\n * [2, 0, -1]\n * ]\n * math.det(A) // returns 6\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x A matrix\n * @return {number} The determinant of `x`\n */\n return typed(name, {\n any: function (x) {\n return clone(x)\n },\n\n 'Array | Matrix': function det (x) {\n let size\n if (isMatrix(x)) {\n size = x.size()\n } else if (Array.isArray(x)) {\n x = matrix(x)\n size = x.size()\n } else {\n // a scalar\n size = []\n }\n\n switch (size.length) {\n case 0:\n // scalar\n return clone(x)\n\n case 1:\n // vector\n if (size[0] === 1) {\n return clone(x.valueOf()[0])\n } if (size[0] === 0) {\n return 1 // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n\n case 2:\n {\n // two-dimensional array\n const rows = size[0]\n const cols = size[1]\n if (rows === cols) {\n return _det(x.clone().valueOf(), rows, cols)\n } if (cols === 0) {\n return 1 // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n }\n\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' +\n '(size: ' + format(size) + ')')\n }\n }\n })\n\n /**\n * Calculate the determinant of a matrix\n * @param {Array[]} matrix A square, two dimensional matrix\n * @param {number} rows Number of rows of the matrix (zero-based)\n * @param {number} cols Number of columns of the matrix (zero-based)\n * @returns {number} det\n * @private\n */\n function _det (matrix, rows, cols) {\n if (rows === 1) {\n // this is a 1 x 1 matrix\n return clone(matrix[0][0])\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12\n return subtractScalar(\n multiply(matrix[0][0], matrix[1][1]),\n multiply(matrix[1][0], matrix[0][1])\n )\n } else {\n // Bareiss algorithm\n // this algorithm have same complexity as LUP decomposition (O(n^3))\n // but it preserve precision of floating point more relative to the LUP decomposition\n let negated = false\n const rowIndices = new Array(rows).fill(0).map((_, i) => i) // matrix index of row i\n for (let k = 0; k < rows; k++) {\n let k_ = rowIndices[k]\n if (isZero(matrix[k_][k])) {\n let _k\n for (_k = k + 1; _k < rows; _k++) {\n if (!isZero(matrix[rowIndices[_k]][k])) {\n k_ = rowIndices[_k]\n rowIndices[_k] = rowIndices[k]\n rowIndices[k] = k_\n negated = !negated\n break\n }\n }\n if (_k === rows) return matrix[k_][k] // some zero of the type\n }\n const piv = matrix[k_][k]\n const piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1]\n for (let i = k + 1; i < rows; i++) {\n const i_ = rowIndices[i]\n for (let j = k + 1; j < rows; j++) {\n matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_)\n }\n }\n }\n const det = matrix[rowIndices[rows - 1]][rows - 1]\n return negated ? unaryMinus(det) : det\n }\n }\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { format } from '../../utils/string.js'\n\nconst name = 'inv'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'divideScalar',\n 'addScalar',\n 'multiply',\n 'unaryMinus',\n 'det',\n 'identity',\n 'abs'\n]\n\nexport const createInv = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divideScalar, addScalar, multiply, unaryMinus, det, identity, abs }) => {\n /**\n * Calculate the inverse of a square matrix.\n *\n * Syntax:\n *\n * math.inv(x)\n *\n * Examples:\n *\n * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.inv(4) // returns 0.25\n * 1 / 4 // returns 0.25\n *\n * See also:\n *\n * det, transpose\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function (x) {\n const size = isMatrix(x) ? x.size() : arraySize(x)\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n if (isMatrix(x)) {\n return matrix([\n divideScalar(1, x.valueOf()[0])\n ])\n } else {\n return [\n divideScalar(1, x[0])\n ]\n }\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n\n case 2:\n // two dimensional array\n {\n const rows = size[0]\n const cols = size[1]\n if (rows === cols) {\n if (isMatrix(x)) {\n return matrix(\n _inv(x.valueOf(), rows, cols),\n x.storage()\n )\n } else {\n // return an Array\n return _inv(x, rows, cols)\n }\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n }\n\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' +\n '(size: ' + format(size) + ')')\n }\n },\n\n any: function (x) {\n // scalar\n return divideScalar(1, x) // FIXME: create a BigNumber one when configured for bignumbers\n }\n })\n\n /**\n * Calculate the inverse of a square matrix\n * @param {Array[]} mat A square matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns, must equal rows\n * @return {Array[]} inv Inverse matrix\n * @private\n */\n function _inv (mat, rows, cols) {\n let r, s, f, value, temp\n\n if (rows === 1) {\n // this is a 1 x 1 matrix\n value = mat[0][0]\n if (value === 0) {\n throw Error('Cannot calculate inverse, determinant is zero')\n }\n return [[\n divideScalar(1, value)\n ]]\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n const d = det(mat)\n if (d === 0) {\n throw Error('Cannot calculate inverse, determinant is zero')\n }\n return [\n [\n divideScalar(mat[1][1], d),\n divideScalar(unaryMinus(mat[0][1]), d)\n ],\n [\n divideScalar(unaryMinus(mat[1][0]), d),\n divideScalar(mat[0][0], d)\n ]\n ]\n } else {\n // this is a matrix of 3 x 3 or larger\n // calculate inverse using gauss-jordan elimination\n // https://en.wikipedia.org/wiki/Gaussian_elimination\n // http://mathworld.wolfram.com/MatrixInverse.html\n // http://math.uww.edu/~mcfarlat/inverse.htm\n\n // make a copy of the matrix (only the arrays, not of the elements)\n const A = mat.concat()\n for (r = 0; r < rows; r++) {\n A[r] = A[r].concat()\n }\n\n // create an identity matrix which in the end will contain the\n // matrix inverse\n const B = identity(rows).valueOf()\n\n // loop over all columns, and perform row reductions\n for (let c = 0; c < cols; c++) {\n // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c]\n let ABig = abs(A[c][c])\n let rBig = c\n r = c + 1\n while (r < rows) {\n if (abs(A[r][c]) > ABig) {\n ABig = abs(A[r][c])\n rBig = r\n }\n r++\n }\n if (ABig === 0) {\n throw Error('Cannot calculate inverse, determinant is zero')\n }\n r = rBig\n if (r !== c) {\n temp = A[c]; A[c] = A[r]; A[r] = temp\n temp = B[c]; B[c] = B[r]; B[r] = temp\n }\n\n // eliminate non-zero values on the other rows at column c\n const Ac = A[c]\n const Bc = B[c]\n for (r = 0; r < rows; r++) {\n const Ar = A[r]\n const Br = B[r]\n if (r !== c) {\n // eliminate value at column c and row r\n if (Ar[c] !== 0) {\n f = divideScalar(unaryMinus(Ar[c]), Ac[c])\n\n // add (f * row c) to row r to eliminate the value\n // at column c\n for (s = c; s < cols; s++) {\n Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]))\n }\n for (s = 0; s < cols; s++) {\n Br[s] = addScalar(Br[s], multiply(f, Bc[s]))\n }\n }\n } else {\n // normalize value at Acc to 1,\n // divide each value on row r with the value at Acc\n f = Ac[c]\n for (s = c; s < cols; s++) {\n Ar[s] = divideScalar(Ar[s], f)\n }\n for (s = 0; s < cols; s++) {\n Br[s] = divideScalar(Br[s], f)\n }\n }\n }\n }\n return B\n }\n }\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { format } from '../../utils/string.js'\nimport { clone } from '../../utils/object.js'\n\nconst name = 'pinv'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'inv',\n 'deepEqual',\n 'equal',\n 'dotDivide',\n 'dot',\n 'ctranspose',\n 'divideScalar',\n 'multiply',\n 'add',\n 'Complex'\n]\n\nexport const createPinv = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n matrix,\n inv,\n deepEqual,\n equal,\n dotDivide,\n dot,\n ctranspose,\n divideScalar,\n multiply,\n add,\n Complex\n}) => {\n /**\n * Calculate the Moore–Penrose inverse of a matrix.\n *\n * Syntax:\n *\n * math.pinv(x)\n *\n * Examples:\n *\n * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]\n * math.pinv(4) // returns 0.25\n *\n * See also:\n *\n * inv\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function (x) {\n const size = isMatrix(x) ? x.size() : arraySize(x)\n switch (size.length) {\n case 1:\n // vector\n if (_isZeros(x)) return ctranspose(x) // null vector\n if (size[0] === 1) {\n return inv(x) // invertible matrix\n } else {\n return dotDivide(ctranspose(x), dot(x, x))\n }\n\n case 2:\n // two dimensional array\n {\n if (_isZeros(x)) return ctranspose(x) // zero matrixx\n const rows = size[0]\n const cols = size[1]\n if (rows === cols) {\n try {\n return inv(x) // invertible matrix\n } catch (err) {\n if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) {\n // Expected\n } else {\n throw err\n }\n }\n }\n if (isMatrix(x)) {\n return matrix(\n _pinv(x.valueOf(), rows, cols),\n x.storage()\n )\n } else {\n // return an Array\n return _pinv(x, rows, cols)\n }\n }\n\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' +\n '(size: ' + format(size) + ')')\n }\n },\n\n any: function (x) {\n // scalar\n if (equal(x, 0)) return clone(x) // zero\n return divideScalar(1, x)\n }\n })\n\n /**\n * Calculate the Moore–Penrose inverse of a matrix\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} pinv Pseudoinverse matrix\n * @private\n */\n function _pinv (mat, rows, cols) {\n const { C, F } = _rankFact(mat, rows, cols) // TODO: Use SVD instead (may improve precision)\n const Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C))\n const Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F))))\n return multiply(Fpinv, Cpinv)\n }\n\n /**\n * Calculate the reduced row echelon form of a matrix\n *\n * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form\n *\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} Reduced row echelon form\n * @private\n */\n function _rref (mat, rows, cols) {\n const M = clone(mat)\n let lead = 0\n for (let r = 0; r < rows; r++) {\n if (cols <= lead) {\n return M\n }\n let i = r\n while (_isZero(M[i][lead])) {\n i++\n if (rows === i) {\n i = r\n lead++\n if (cols === lead) {\n return M\n }\n }\n }\n\n [M[i], M[r]] = [M[r], M[i]]\n\n let val = M[r][lead]\n for (let j = 0; j < cols; j++) {\n M[r][j] = dotDivide(M[r][j], val)\n }\n\n for (let i = 0; i < rows; i++) {\n if (i === r) continue\n val = M[i][lead]\n for (let j = 0; j < cols; j++) {\n M[i][j] = add(M[i][j], multiply(-1, multiply(val, M[r][j])))\n }\n }\n lead++\n }\n return M\n }\n\n /**\n * Calculate the rank factorization of a matrix\n *\n * @param {Array[]} mat A matrix (M)\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {{C: Array, F: Array}} rank factorization where M = C F\n * @private\n */\n function _rankFact (mat, rows, cols) {\n const rref = _rref(mat, rows, cols)\n const C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j]))))\n const F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i])))\n return { C, F }\n }\n\n function _isZero (x) {\n return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1)))\n }\n\n function _isZeros (arr) {\n return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1)))\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { format } from '../../utils/string.js'\nimport { createComplexEigs } from './eigs/complexEigs.js'\nimport { createRealSymmetric } from './eigs/realSymmetric.js'\nimport { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js'\n\nconst name = 'eigs'\n\n// The absolute state of math.js's dependency system:\nconst dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'divideScalar', 'inv', 'bignumber', 'multiply', 'add', 'larger', 'column', 'flatten', 'number', 'complex', 'sqrt', 'diag', 'size', 'reshape', 'qr', 'usolve', 'usolveAll', 'im', 're', 'smaller', 'matrixFromColumns', 'dot']\nexport const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ config, typed, matrix, addScalar, subtract, equal, abs, atan, cos, sin, multiplyScalar, divideScalar, inv, bignumber, multiply, add, larger, column, flatten, number, complex, sqrt, diag, size, reshape, qr, usolve, usolveAll, im, re, smaller, matrixFromColumns, dot }) => {\n const doRealSymmetric = createRealSymmetric({ config, addScalar, subtract, column, flatten, equal, abs, atan, cos, sin, multiplyScalar, inv, bignumber, complex, multiply, add })\n const doComplexEigs = createComplexEigs({ config, addScalar, subtract, multiply, multiplyScalar, flatten, divideScalar, sqrt, abs, bignumber, diag, size, reshape, qr, inv, usolve, usolveAll, equal, complex, larger, smaller, matrixFromColumns, dot })\n\n /**\n * Compute eigenvalues and optionally eigenvectors of a square matrix.\n * The eigenvalues are sorted by their absolute value, ascending, and\n * returned as a vector in the `values` property of the returned project.\n * An eigenvalue with algebraic multiplicity k will be listed k times, so\n * that the returned `values` vector always has length equal to the size\n * of the input matrix.\n *\n * The `eigenvectors` property of the return value provides the eigenvectors.\n * It is an array of plain objects: the `value` property of each gives the\n * associated eigenvalue, and the `vector` property gives the eigenvector\n * itself. Note that the same `value` property will occur as many times in\n * the list provided by `eigenvectors` as the geometric multiplicity of\n * that value.\n *\n * If the algorithm fails to converge, it will throw an error –\n * in that case, however, you may still find useful information\n * in `err.values` and `err.vectors`.\n *\n * Note that the 'precision' option does not directly specify the _accuracy_\n * of the returned eigenvalues. Rather, it determines how small an entry\n * of the iterative approximations to an upper triangular matrix must be\n * in order to be considered zero. The actual accuracy of the returned\n * eigenvalues may be greater or less than the precision, depending on the\n * conditioning of the matrix and how far apart or close the actual\n * eigenvalues are. Note that currently, relatively simple, \"traditional\"\n * methods of eigenvalue computation are being used; this is not a modern,\n * high-precision eigenvalue computation. That said, it should typically\n * produce fairly reasonable results.\n *\n * Syntax:\n *\n * math.eigs(x, [prec])\n * math.eigs(x, {options})\n *\n * Examples:\n *\n * const { eigs, multiply, column, transpose, matrixFromColumns } = math\n * const H = [[5, 2.3], [2.3, 1]]\n * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...]\n * const E = ans.values\n * const V = ans.eigenvectors\n * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector))\n * const U = matrixFromColumns(...V.map(obj => obj.vector))\n * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible\n * E[0] == UTxHxU[0][0] // returns true always\n *\n * // Compute only approximate eigenvalues:\n * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6})\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x Matrix to be diagonalized\n *\n * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision.\n * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested.\n *\n */\n return typed('eigs', {\n\n // The conversion to matrix in the first two implementations,\n // just to convert back to an array right away in\n // computeValuesAndVectors, is unfortunate, and should perhaps be\n // streamlined. It is done because the Matrix object carries some\n // type information about its entries, and so constructing the matrix\n // is a roundabout way of doing type detection.\n Array: function (x) { return doEigs(matrix(x)) },\n 'Array, number|BigNumber': function (x, prec) {\n return doEigs(matrix(x), { precision: prec })\n },\n 'Array, Object' (x, opts) { return doEigs(matrix(x), opts) },\n Matrix: function (mat) {\n return doEigs(mat, { matricize: true })\n },\n 'Matrix, number|BigNumber': function (mat, prec) {\n return doEigs(mat, { precision: prec, matricize: true })\n },\n 'Matrix, Object': function (mat, opts) {\n const useOpts = { matricize: true }\n Object.assign(useOpts, opts)\n return doEigs(mat, useOpts)\n }\n })\n\n function doEigs (mat, opts = {}) {\n const computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true\n const prec = opts.precision ?? config.relTol\n const result = computeValuesAndVectors(mat, prec, computeVectors)\n if (opts.matricize) {\n result.values = matrix(result.values)\n if (computeVectors) {\n result.eigenvectors = result.eigenvectors.map(({ value, vector }) =>\n ({ value, vector: matrix(vector) }))\n }\n }\n if (computeVectors) {\n Object.defineProperty(result, 'vectors', {\n enumerable: false, // to make sure that the eigenvectors can still be\n // converted to string.\n get: () => {\n throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors')\n }\n })\n }\n return result\n }\n\n function computeValuesAndVectors (mat, prec, computeVectors) {\n const arr = mat.toArray() // NOTE: arr is guaranteed to be unaliased\n // and so safe to modify in place\n const asize = mat.size()\n\n if (asize.length !== 2 || asize[0] !== asize[1]) {\n throw new RangeError(`Matrix must be square (size: ${format(asize)})`)\n }\n\n const N = asize[0]\n\n if (isReal(arr, N, prec)) {\n coerceReal(arr, N) // modifies arr by side effect\n\n if (isSymmetric(arr, N, prec)) {\n const type = coerceTypes(mat, arr, N) // modifies arr by side effect\n return doRealSymmetric(arr, N, prec, type, computeVectors)\n }\n }\n\n const type = coerceTypes(mat, arr, N) // modifies arr by side effect\n return doComplexEigs(arr, N, prec, type, computeVectors)\n }\n\n /** @return {boolean} */\n function isSymmetric (arr, N, prec) {\n for (let i = 0; i < N; i++) {\n for (let j = i; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) {\n return false\n }\n }\n }\n\n return true\n }\n\n /** @return {boolean} */\n function isReal (arr, N, prec) {\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(im(arr[i][j]))), prec)) {\n return false\n }\n }\n }\n\n return true\n }\n\n function coerceReal (arr, N) {\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n arr[i][j] = re(arr[i][j])\n }\n }\n }\n\n /** @return {'number' | 'BigNumber' | 'Complex'} */\n function coerceTypes (mat, arr, N) {\n /** @type {string} */\n const type = mat.datatype()\n\n if (type === 'number' || type === 'BigNumber' || type === 'Complex') {\n return type\n }\n\n let hasNumber = false\n let hasBig = false\n let hasComplex = false\n\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n const el = arr[i][j]\n\n if (isNumber(el) || isFraction(el)) {\n hasNumber = true\n } else if (isBigNumber(el)) {\n hasBig = true\n } else if (isComplex(el)) {\n hasComplex = true\n } else {\n throw TypeError('Unsupported type in Matrix: ' + typeOf(el))\n }\n }\n }\n\n if (hasBig && hasComplex) {\n console.warn('Complex BigNumbers not supported, this operation will lose precission.')\n }\n\n if (hasComplex) {\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n arr[i][j] = complex(arr[i][j])\n }\n }\n\n return 'Complex'\n }\n\n if (hasBig) {\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n arr[i][j] = bignumber(arr[i][j])\n }\n }\n\n return 'BigNumber'\n }\n\n if (hasNumber) {\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n arr[i][j] = number(arr[i][j])\n }\n }\n\n return 'number'\n } else {\n throw TypeError('Matrix contains unsupported types only.')\n }\n }\n})\n","import { clone } from '../../../utils/object.js'\n\nexport function createRealSymmetric ({ config, addScalar, subtract, abs, atan, cos, sin, multiplyScalar, inv, bignumber, multiply, add }) {\n /**\n * @param {number[] | BigNumber[]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number' | 'BigNumber'} type\n */\n function main (arr, N, prec = config.relTol, type, computeVectors) {\n if (type === 'number') {\n return diag(arr, prec, computeVectors)\n }\n\n if (type === 'BigNumber') {\n return diagBig(arr, prec, computeVectors)\n }\n\n throw TypeError('Unsupported data type: ' + type)\n }\n\n // diagonalization implementation for number (efficient)\n function diag (x, precision, computeVectors) {\n const N = x.length\n const e0 = Math.abs(precision / N)\n let psi\n let Sij\n if (computeVectors) {\n Sij = new Array(N)\n // Sij is Identity Matrix\n for (let i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0)\n Sij[i][i] = 1.0\n }\n }\n // initial error\n let Vab = getAij(x)\n while (Math.abs(Vab[1]) >= Math.abs(e0)) {\n const i = Vab[0][0]\n const j = Vab[0][1]\n psi = getTheta(x[i][i], x[j][j], x[i][j])\n x = x1(x, psi, i, j)\n if (computeVectors) Sij = Sij1(Sij, psi, i, j)\n Vab = getAij(x)\n }\n const Ei = Array(N).fill(0) // eigenvalues\n for (let i = 0; i < N; i++) {\n Ei[i] = x[i][i]\n }\n return sorting(clone(Ei), Sij, computeVectors)\n }\n\n // diagonalization implementation for bigNumber\n function diagBig (x, precision, computeVectors) {\n const N = x.length\n const e0 = abs(precision / N)\n let psi\n let Sij\n if (computeVectors) {\n Sij = new Array(N)\n // Sij is Identity Matrix\n for (let i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0)\n Sij[i][i] = 1.0\n }\n }\n // initial error\n let Vab = getAijBig(x)\n while (abs(Vab[1]) >= abs(e0)) {\n const i = Vab[0][0]\n const j = Vab[0][1]\n psi = getThetaBig(x[i][i], x[j][j], x[i][j])\n x = x1Big(x, psi, i, j)\n if (computeVectors) Sij = Sij1Big(Sij, psi, i, j)\n Vab = getAijBig(x)\n }\n const Ei = Array(N).fill(0) // eigenvalues\n for (let i = 0; i < N; i++) {\n Ei[i] = x[i][i]\n }\n // return [clone(Ei), clone(Sij)]\n return sorting(clone(Ei), Sij, computeVectors)\n }\n\n // get angle\n function getTheta (aii, ajj, aij) {\n const denom = (ajj - aii)\n if (Math.abs(denom) <= config.relTol) {\n return Math.PI / 4.0\n } else {\n return 0.5 * Math.atan(2.0 * aij / (ajj - aii))\n }\n }\n\n // get angle\n function getThetaBig (aii, ajj, aij) {\n const denom = subtract(ajj, aii)\n if (abs(denom) <= config.relTol) {\n return bignumber(-1).acos().div(4)\n } else {\n return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom))))\n }\n }\n\n // update eigvec\n function Sij1 (Sij, theta, i, j) {\n const N = Sij.length\n const c = Math.cos(theta)\n const s = Math.sin(theta)\n const Ski = Array(N).fill(0)\n const Skj = Array(N).fill(0)\n for (let k = 0; k < N; k++) {\n Ski[k] = c * Sij[k][i] - s * Sij[k][j]\n Skj[k] = s * Sij[k][i] + c * Sij[k][j]\n }\n for (let k = 0; k < N; k++) {\n Sij[k][i] = Ski[k]\n Sij[k][j] = Skj[k]\n }\n return Sij\n }\n // update eigvec for overlap\n function Sij1Big (Sij, theta, i, j) {\n const N = Sij.length\n const c = cos(theta)\n const s = sin(theta)\n const Ski = Array(N).fill(bignumber(0))\n const Skj = Array(N).fill(bignumber(0))\n for (let k = 0; k < N; k++) {\n Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j]))\n Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]))\n }\n for (let k = 0; k < N; k++) {\n Sij[k][i] = Ski[k]\n Sij[k][j] = Skj[k]\n }\n return Sij\n }\n\n // update matrix\n function x1Big (Hij, theta, i, j) {\n const N = Hij.length\n const c = bignumber(cos(theta))\n const s = bignumber(sin(theta))\n const c2 = multiplyScalar(c, c)\n const s2 = multiplyScalar(s, s)\n const Aki = Array(N).fill(bignumber(0))\n const Akj = Array(N).fill(bignumber(0))\n // 2cs Hij\n const csHij = multiply(bignumber(2), c, s, Hij[i][j])\n // Aii\n const Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j]))\n const Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j]))\n // 0 to i\n for (let k = 0; k < N; k++) {\n Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k]))\n Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]))\n }\n // Modify Hij\n Hij[i][i] = Aii\n Hij[j][j] = Ajj\n Hij[i][j] = bignumber(0)\n Hij[j][i] = bignumber(0)\n // 0 to i\n for (let k = 0; k < N; k++) {\n if (k !== i && k !== j) {\n Hij[i][k] = Aki[k]\n Hij[k][i] = Aki[k]\n Hij[j][k] = Akj[k]\n Hij[k][j] = Akj[k]\n }\n }\n return Hij\n }\n\n // update matrix\n function x1 (Hij, theta, i, j) {\n const N = Hij.length\n const c = Math.cos(theta)\n const s = Math.sin(theta)\n const c2 = c * c\n const s2 = s * s\n const Aki = Array(N).fill(0)\n const Akj = Array(N).fill(0)\n // Aii\n const Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j]\n const Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j]\n // 0 to i\n for (let k = 0; k < N; k++) {\n Aki[k] = c * Hij[i][k] - s * Hij[j][k]\n Akj[k] = s * Hij[i][k] + c * Hij[j][k]\n }\n // Modify Hij\n Hij[i][i] = Aii\n Hij[j][j] = Ajj\n Hij[i][j] = 0\n Hij[j][i] = 0\n // 0 to i\n for (let k = 0; k < N; k++) {\n if (k !== i && k !== j) {\n Hij[i][k] = Aki[k]\n Hij[k][i] = Aki[k]\n Hij[j][k] = Akj[k]\n Hij[k][j] = Akj[k]\n }\n }\n return Hij\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAij (Mij) {\n const N = Mij.length\n let maxMij = 0\n let maxIJ = [0, 1]\n for (let i = 0; i < N; i++) {\n for (let j = i + 1; j < N; j++) {\n if (Math.abs(maxMij) < Math.abs(Mij[i][j])) {\n maxMij = Math.abs(Mij[i][j])\n maxIJ = [i, j]\n }\n }\n }\n return [maxIJ, maxMij]\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAijBig (Mij) {\n const N = Mij.length\n let maxMij = 0\n let maxIJ = [0, 1]\n for (let i = 0; i < N; i++) {\n for (let j = i + 1; j < N; j++) {\n if (abs(maxMij) < abs(Mij[i][j])) {\n maxMij = abs(Mij[i][j])\n maxIJ = [i, j]\n }\n }\n }\n return [maxIJ, maxMij]\n }\n\n // sort results\n function sorting (E, S, computeVectors) {\n const N = E.length\n const values = Array(N)\n let vecs\n if (computeVectors) {\n vecs = Array(N)\n for (let k = 0; k < N; k++) {\n vecs[k] = Array(N)\n }\n }\n for (let i = 0; i < N; i++) {\n let minID = 0\n let minE = E[0]\n for (let j = 0; j < E.length; j++) {\n if (abs(E[j]) < abs(minE)) {\n minID = j\n minE = E[minID]\n }\n }\n values[i] = E.splice(minID, 1)[0]\n if (computeVectors) {\n for (let k = 0; k < N; k++) {\n vecs[i][k] = S[k][minID]\n S[k].splice(minID, 1)\n }\n }\n }\n if (!computeVectors) return { values }\n const eigenvectors = vecs.map((vector, i) => ({ value: values[i], vector }))\n return { values, eigenvectors }\n }\n\n return main\n}\n","import { clone } from '../../../utils/object.js'\n\nexport function createComplexEigs ({ addScalar, subtract, flatten, multiply, multiplyScalar, divideScalar, sqrt, abs, bignumber, diag, size, reshape, inv, qr, usolve, usolveAll, equal, complex, larger, smaller, matrixFromColumns, dot }) {\n /**\n * @param {number[][]} arr the matrix to find eigenvalues of\n * @param {number} N size of the matrix\n * @param {number|BigNumber} prec precision, anything lower will be considered zero\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors should we find eigenvectors?\n *\n * @returns {{ values: number[], vectors: number[][] }}\n */\n function complexEigs (arr, N, prec, type, findVectors = true) {\n // TODO check if any row/col are zero except the diagonal\n\n // make sure corresponding rows and columns have similar magnitude\n // important because of numerical stability\n // MODIFIES arr by side effect!\n const R = balance(arr, N, prec, type, findVectors)\n\n // R is the row transformation matrix\n // arr = A' = R A R^-1, A is the original matrix\n // (if findVectors is false, R is undefined)\n // (And so to return to original matrix: A = R^-1 arr R)\n\n // TODO if magnitudes of elements vary over many orders,\n // move greatest elements to the top left corner\n\n // using similarity transformations, reduce the matrix\n // to Hessenberg form (upper triangular plus one subdiagonal row)\n // updates the transformation matrix R with new row operationsq\n // MODIFIES arr by side effect!\n reduceToHessenberg(arr, N, prec, type, findVectors, R)\n // still true that original A = R^-1 arr R)\n\n // find eigenvalues\n const { values, C } = iterateUntilTriangular(arr, N, prec, type, findVectors)\n\n // values is the list of eigenvalues, C is the column\n // transformation matrix that transforms arr, the hessenberg\n // matrix, to upper triangular\n // (So U = C^-1 arr C and the relationship between current arr\n // and original A is unchanged.)\n\n if (findVectors) {\n const eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type)\n return { values, eigenvectors }\n }\n\n return { values }\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]}\n */\n function balance (arr, N, prec, type, findVectors) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n const realzero = big ? bignumber(0) : 0\n const one = big ? bignumber(1) : cplx ? complex(1) : 1\n const realone = big ? bignumber(1) : 1\n\n // base of the floating-point arithmetic\n const radix = big ? bignumber(10) : 2\n const radixSq = multiplyScalar(radix, radix)\n\n // the diagonal transformation matrix R\n let Rdiag\n if (findVectors) {\n Rdiag = Array(N).fill(one)\n }\n\n // this isn't the only time we loop thru the matrix...\n let last = false\n\n while (!last) {\n // ...haha I'm joking! unless...\n last = true\n\n for (let i = 0; i < N; i++) {\n // compute the taxicab norm of i-th column and row\n // TODO optimize for complex numbers\n let colNorm = realzero\n let rowNorm = realzero\n\n for (let j = 0; j < N; j++) {\n if (i === j) continue\n colNorm = addScalar(colNorm, abs(arr[j][i]))\n rowNorm = addScalar(rowNorm, abs(arr[i][j]))\n }\n\n if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {\n // find integer power closest to balancing the matrix\n // (we want to scale only by integer powers of radix,\n // so that we don't lose any precision due to round-off)\n\n let f = realone\n let c = colNorm\n\n const rowDivRadix = divideScalar(rowNorm, radix)\n const rowMulRadix = multiplyScalar(rowNorm, radix)\n\n while (smaller(c, rowDivRadix)) {\n c = multiplyScalar(c, radixSq)\n f = multiplyScalar(f, radix)\n }\n while (larger(c, rowMulRadix)) {\n c = divideScalar(c, radixSq)\n f = divideScalar(f, radix)\n }\n\n // check whether balancing is needed\n // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm)\n const condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95))\n\n // apply balancing similarity transformation\n if (condition) {\n // we should loop once again to check whether\n // another rebalancing is needed\n last = false\n\n const g = divideScalar(1, f)\n\n for (let j = 0; j < N; j++) {\n if (i === j) {\n continue\n }\n arr[i][j] = multiplyScalar(arr[i][j], g)\n arr[j][i] = multiplyScalar(arr[j][i], f)\n }\n\n // keep track of transformations\n if (findVectors) {\n Rdiag[i] = multiplyScalar(Rdiag[i], g)\n }\n }\n }\n }\n }\n\n // return the diagonal row transformation matrix\n return findVectors ? diag(Rdiag) : null\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors\n * @param {number[][]} R the row transformation matrix that will be modified\n */\n function reduceToHessenberg (arr, N, prec, type, findVectors, R) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n const zero = big ? bignumber(0) : cplx ? complex(0) : 0\n\n if (big) { prec = bignumber(prec) }\n\n for (let i = 0; i < N - 2; i++) {\n // Find the largest subdiag element in the i-th col\n\n let maxIndex = 0\n let max = zero\n\n for (let j = i + 1; j < N; j++) {\n const el = arr[j][i]\n if (smaller(abs(max), abs(el))) {\n max = el\n maxIndex = j\n }\n }\n\n // This col is pivoted, no need to do anything\n if (smaller(abs(max), prec)) {\n continue\n }\n\n if (maxIndex !== i + 1) {\n // Interchange maxIndex-th and (i+1)-th row\n const tmp1 = arr[maxIndex]\n arr[maxIndex] = arr[i + 1]\n arr[i + 1] = tmp1\n\n // Interchange maxIndex-th and (i+1)-th column\n for (let j = 0; j < N; j++) {\n const tmp2 = arr[j][maxIndex]\n arr[j][maxIndex] = arr[j][i + 1]\n arr[j][i + 1] = tmp2\n }\n\n // keep track of transformations\n if (findVectors) {\n const tmp3 = R[maxIndex]\n R[maxIndex] = R[i + 1]\n R[i + 1] = tmp3\n }\n }\n\n // Reduce following rows and columns\n for (let j = i + 2; j < N; j++) {\n const n = divideScalar(arr[j][i], max)\n\n if (n === 0) {\n continue\n }\n\n // from j-th row subtract n-times (i+1)th row\n for (let k = 0; k < N; k++) {\n arr[j][k] = subtract(arr[j][k], multiplyScalar(n, arr[i + 1][k]))\n }\n\n // to (i+1)th column add n-times j-th column\n for (let k = 0; k < N; k++) {\n arr[k][i + 1] = addScalar(arr[k][i + 1], multiplyScalar(n, arr[k][j]))\n }\n\n // keep track of transformations\n if (findVectors) {\n for (let k = 0; k < N; k++) {\n R[j][k] = subtract(R[j][k], multiplyScalar(n, R[i + 1][k]))\n }\n }\n }\n }\n\n return R\n }\n\n /**\n * @returns {{values: values, C: Matrix}}\n * @see Press, Wiliams: Numerical recipes in Fortran 77\n * @see https://en.wikipedia.org/wiki/QR_algorithm\n */\n function iterateUntilTriangular (A, N, prec, type, findVectors) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n const one = big ? bignumber(1) : cplx ? complex(1) : 1\n\n if (big) { prec = bignumber(prec) }\n\n // The Francis Algorithm\n // The core idea of this algorithm is that doing successive\n // A' = QtAQ transformations will eventually converge to block-\n // upper-triangular with diagonal blocks either 1x1 or 2x2.\n // The Q here is the one from the QR decomposition, A = QR.\n // Since the eigenvalues of a block-upper-triangular matrix are\n // the eigenvalues of its diagonal blocks and we know how to find\n // eigenvalues of a 2x2 matrix, we know the eigenvalues of A.\n\n let arr = clone(A)\n\n // the list of converged eigenvalues\n const lambdas = []\n\n // size of arr, which will get smaller as eigenvalues converge\n let n = N\n\n // the diagonal of the block-diagonal matrix that turns\n // converged 2x2 matrices into upper triangular matrices\n const Sdiag = []\n\n // N×N matrix describing the overall transformation done during the QR algorithm\n let Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined\n\n // nxn matrix describing the QR transformations done since last convergence\n let Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined\n\n // last eigenvalue converged before this many steps\n let lastConvergenceBefore = 0\n\n while (lastConvergenceBefore <= 100) {\n lastConvergenceBefore += 1\n\n // TODO if the convergence is slow, do something clever\n\n // Perform the factorization\n\n const k = arr[n - 1][n - 1] // TODO this is apparently a somewhat\n // old-fashioned choice; ideally set close to an eigenvalue, or\n // perhaps better yet switch to the implicit QR version that is sometimes\n // specifically called the \"Francis algorithm\" that is alluded to\n // in the following TODO. (Or perhaps we switch to an independently\n // optimized third-party package for the linear algebra operations...)\n\n for (let i = 0; i < n; i++) {\n arr[i][i] = subtract(arr[i][i], k)\n }\n\n // TODO do an implicit QR transformation\n const { Q, R } = qr(arr)\n arr = multiply(R, Q)\n\n for (let i = 0; i < n; i++) {\n arr[i][i] = addScalar(arr[i][i], k)\n }\n\n // keep track of transformations\n if (findVectors) {\n Qpartial = multiply(Qpartial, Q)\n }\n\n // The rightmost diagonal element converged to an eigenvalue\n if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) {\n lastConvergenceBefore = 0\n lambdas.push(arr[n - 1][n - 1])\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift([[1]])\n inflateMatrix(Qpartial, N)\n Qtotal = multiply(Qtotal, Qpartial)\n\n if (n > 1) {\n Qpartial = diag(Array(n - 1).fill(one))\n }\n }\n\n // reduce the matrix size\n n -= 1\n arr.pop()\n for (let i = 0; i < n; i++) {\n arr[i].pop()\n }\n\n // The rightmost diagonal 2x2 block converged\n } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) {\n lastConvergenceBefore = 0\n const ll = eigenvalues2x2(\n arr[n - 2][n - 2], arr[n - 2][n - 1],\n arr[n - 1][n - 2], arr[n - 1][n - 1]\n )\n lambdas.push(...ll)\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift(jordanBase2x2(\n arr[n - 2][n - 2], arr[n - 2][n - 1],\n arr[n - 1][n - 2], arr[n - 1][n - 1],\n ll[0], ll[1], prec, type\n ))\n inflateMatrix(Qpartial, N)\n Qtotal = multiply(Qtotal, Qpartial)\n if (n > 2) {\n Qpartial = diag(Array(n - 2).fill(one))\n }\n }\n\n // reduce the matrix size\n n -= 2\n arr.pop()\n arr.pop()\n for (let i = 0; i < n; i++) {\n arr[i].pop()\n arr[i].pop()\n }\n }\n\n if (n === 0) {\n break\n }\n }\n\n // standard sorting\n lambdas.sort((a, b) => +subtract(abs(a), abs(b)))\n\n // the algorithm didn't converge\n if (lastConvergenceBefore > 100) {\n const err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', '))\n err.values = lambdas\n err.vectors = []\n throw err\n }\n\n // combine the overall QR transformation Qtotal with the subsequent\n // transformation S that turns the diagonal 2x2 blocks to upper triangular\n const C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined\n\n return { values: lambdas, C }\n }\n\n /**\n * @param {Matrix} A hessenberg-form matrix\n * @param {number} N size of A\n * @param {Matrix} C column transformation matrix that turns A into upper triangular\n * @param {Matrix} R similarity that turns original matrix into A\n * @param {number[]} values array of eigenvalues of A\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]} eigenvalues\n */\n function findEigenvectors (A, N, C, R, values, prec, type) {\n const Cinv = inv(C)\n const U = multiply(Cinv, A, C)\n\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n const zero = big ? bignumber(0) : cplx ? complex(0) : 0\n const one = big ? bignumber(1) : cplx ? complex(1) : 1\n\n // turn values into a kind of \"multiset\"\n // this way it is easier to find eigenvectors\n const uniqueValues = []\n const multiplicities = []\n\n for (const lambda of values) {\n const i = indexOf(uniqueValues, lambda, equal)\n\n if (i === -1) {\n uniqueValues.push(lambda)\n multiplicities.push(1)\n } else {\n multiplicities[i] += 1\n }\n }\n\n // find eigenvectors by solving U − lambdaE = 0\n // TODO replace with an iterative eigenvector algorithm\n // (this one might fail for imprecise eigenvalues)\n\n const vectors = []\n const len = uniqueValues.length\n const b = Array(N).fill(zero)\n const E = diag(Array(N).fill(one))\n\n for (let i = 0; i < len; i++) {\n const lambda = uniqueValues[i]\n const S = subtract(U, multiply(lambda, E)) // the characteristic matrix\n\n let solutions = usolveAll(S, b)\n solutions.shift() // ignore the null vector\n\n // looks like we missed something, try inverse iteration\n // But if that fails, just presume that the original matrix truly\n // was defective.\n while (solutions.length < multiplicities[i]) {\n const approxVec = inverseIterate(S, N, solutions, prec, type)\n if (approxVec === null) { break } // no more vectors were found\n solutions.push(approxVec)\n }\n\n // Transform back into original array coordinates\n const correction = multiply(inv(R), C)\n solutions = solutions.map(v => multiply(correction, v))\n\n vectors.push(\n ...solutions.map(v => ({ value: lambda, vector: flatten(v) })))\n }\n\n return vectors\n }\n\n /**\n * Compute the eigenvalues of an 2x2 matrix\n * @return {[number,number]}\n */\n function eigenvalues2x2 (a, b, c, d) {\n // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA )\n const trA = addScalar(a, d)\n const detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c))\n const x = multiplyScalar(trA, 0.5)\n const y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5)\n\n return [addScalar(x, y), subtract(x, y)]\n }\n\n /**\n * For an 2x2 matrix compute the transformation matrix S,\n * so that SAS^-1 is an upper triangular matrix\n * @return {[[number,number],[number,number]]}\n * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf\n * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n */\n function jordanBase2x2 (a, b, c, d, l1, l2, prec, type) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n const zero = big ? bignumber(0) : cplx ? complex(0) : 0\n const one = big ? bignumber(1) : cplx ? complex(1) : 1\n\n // matrix is already upper triangular\n // return an identity matrix\n if (smaller(abs(c), prec)) {\n return [[one, zero], [zero, one]]\n }\n\n // matrix is diagonalizable\n // return its eigenvectors as columns\n if (larger(abs(subtract(l1, l2)), prec)) {\n return [[subtract(l1, d), subtract(l2, d)], [c, c]]\n }\n\n // matrix is not diagonalizable\n // compute diagonal elements of N = A - lambdaI\n const na = subtract(a, l1)\n const nd = subtract(d, l1)\n\n // col(N,2) = 0 implies S = ( col(N,1), e_1 )\n // col(N,2) != 0 implies S = ( col(N,2), e_2 )\n\n if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {\n return [[na, one], [c, zero]]\n } else {\n return [[b, zero], [nd, one]]\n }\n }\n\n /**\n * Enlarge the matrix from nxn to NxN, setting the new\n * elements to 1 on diagonal and 0 elsewhere\n */\n function inflateMatrix (arr, N) {\n // add columns\n for (let i = 0; i < arr.length; i++) {\n arr[i].push(...Array(N - arr[i].length).fill(0))\n }\n\n // add rows\n for (let i = arr.length; i < N; i++) {\n arr.push(Array(N).fill(0))\n arr[i][i] = 1\n }\n\n return arr\n }\n\n /**\n * Create a block-diagonal matrix with the given square matrices on the diagonal\n * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal\n * @param {number} N the size of the resulting matrix\n */\n function blockDiag (arr, N) {\n const M = []\n for (let i = 0; i < N; i++) {\n M[i] = Array(N).fill(0)\n }\n\n let I = 0\n for (const sub of arr) {\n const n = sub.length\n\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n; j++) {\n M[I + i][I + j] = sub[i][j]\n }\n }\n\n I += n\n }\n\n return M\n }\n\n /**\n * Finds the index of an element in an array using a custom equality function\n * @template T\n * @param {Array} arr array in which to search\n * @param {T} el the element to find\n * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el`\n * @returns {number} the index of `el`, or -1 when it's not in `arr`\n */\n function indexOf (arr, el, fn) {\n for (let i = 0; i < arr.length; i++) {\n if (fn(arr[i], el)) {\n return i\n }\n }\n return -1\n }\n\n /**\n * Provided a near-singular upper-triangular matrix A and a list of vectors,\n * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal\n * to each vector in the list\n * @template T\n * @param {T[][]} A near-singular square matrix\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {number} prec epsilon\n * @param {'number'|'BigNumber'|'Complex'} type\n * @return {T[] | null} eigenvector\n *\n * @see Numerical Recipes for Fortran 77 – 11.7 Eigenvalues or Eigenvectors by Inverse Iteration\n */\n function inverseIterate (A, N, orthog, prec, type) {\n const largeNum = type === 'BigNumber' ? bignumber(1000) : 1000\n\n let b // the vector\n\n // you better choose a random vector before I count to five\n let i = 0\n for (; i < 5; ++i) {\n b = randomOrthogonalVector(N, orthog, type)\n try {\n b = usolve(A, b)\n } catch {\n // That direction didn't work, likely because the original matrix\n // was defective. But still make the full number of tries...\n continue\n }\n if (larger(norm(b), largeNum)) { break }\n }\n if (i >= 5) {\n return null // couldn't find any orthogonal vector in the image\n }\n\n // you better converge before I count to ten\n i = 0\n while (true) {\n const c = usolve(A, b)\n\n if (smaller(norm(orthogonalComplement(b, [c])), prec)) { break }\n if (++i >= 10) { return null }\n\n b = normalize(c)\n }\n\n return b\n }\n\n /**\n * Generates a random unit vector of dimension N, orthogonal to each vector in the list\n * @template T\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} random vector\n */\n function randomOrthogonalVector (N, orthog, type) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n\n // generate random vector with the correct type\n let v = Array(N).fill(0).map(_ => 2 * Math.random() - 1)\n if (big) { v = v.map(n => bignumber(n)) }\n if (cplx) { v = v.map(n => complex(n)) }\n\n // project to orthogonal complement\n v = orthogonalComplement(v, orthog)\n\n // normalize\n return normalize(v, type)\n }\n\n /**\n * Project vector v to the orthogonal complement of an array of vectors\n */\n function orthogonalComplement (v, orthog) {\n const vectorShape = size(v)\n for (let w of orthog) {\n w = reshape(w, vectorShape) // make sure this is just a vector computation\n // v := v − (w, v)/|w|^2 w\n v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w))\n }\n\n return v\n }\n\n /**\n * Calculate the norm of a vector.\n * We can't use math.norm because factory can't handle circular dependency.\n * Seriously, I'm really fed up with factory.\n */\n function norm (v) {\n return abs(sqrt(dot(v, v)))\n }\n\n /**\n * Normalize a vector\n * @template T\n * @param {T[]} v\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} normalized vec\n */\n function normalize (v, type) {\n const big = type === 'BigNumber'\n const cplx = type === 'Complex'\n const one = big ? bignumber(1) : cplx ? complex(1) : 1\n\n return multiply(divideScalar(one, norm(v)), v)\n }\n\n return complexEigs\n}\n","import { isSparseMatrix } from '../../utils/is.js'\nimport { format } from '../../utils/string.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'expm'\nconst dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply']\n\nexport const createExpm = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, add, identity, inv, multiply }) => {\n /**\n * Compute the matrix exponential, expm(A) = e^A. The matrix must be square.\n * Not to be confused with exp(a), which performs element-wise\n * exponentiation.\n *\n * The exponential is calculated using the Padé approximant with scaling and\n * squaring; see \"Nineteen Dubious Ways to Compute the Exponential of a\n * Matrix,\" by Moler and Van Loan.\n *\n * Syntax:\n *\n * math.expm(x)\n *\n * Examples:\n *\n * const A = [[0,2],[0,0]]\n * math.expm(A) // returns [[1,2],[0,1]]\n *\n * See also:\n *\n * exp\n *\n * @param {Matrix} x A square Matrix\n * @return {Matrix} The exponential of x\n */\n return typed(name, {\n\n Matrix: function (A) {\n // Check matrix size\n const size = A.size()\n\n if (size.length !== 2 || size[0] !== size[1]) {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n\n const n = size[0]\n\n // Desired accuracy of the approximant (The actual accuracy\n // will be affected by round-off error)\n const eps = 1e-15\n\n // The Padé approximant is not so accurate when the values of A\n // are \"large\", so scale A by powers of two. Then compute the\n // exponential, and square the result repeatedly according to\n // the identity e^A = (e^(A/m))^m\n\n // Compute infinity-norm of A, ||A||, to see how \"big\" it is\n const infNorm = infinityNorm(A)\n\n // Find the optimal scaling factor and number of terms in the\n // Padé approximant to reach the desired accuracy\n const params = findParams(infNorm, eps)\n const q = params.q\n const j = params.j\n\n // The Pade approximation to e^A is:\n // Rqq(A) = Dqq(A) ^ -1 * Nqq(A)\n // where\n // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i\n // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i\n\n // Scale A by 1 / 2^j\n const Apos = multiply(A, Math.pow(2, -j))\n\n // The i=0 term is just the identity matrix\n let N = identity(n)\n let D = identity(n)\n\n // Initialization (i=0)\n let factor = 1\n\n // Initialization (i=1)\n let AposToI = Apos // Cloning not necessary\n let alternate = -1\n\n for (let i = 1; i <= q; i++) {\n if (i > 1) {\n AposToI = multiply(AposToI, Apos)\n alternate = -alternate\n }\n factor = factor * (q - i + 1) / ((2 * q - i + 1) * i)\n\n N = add(N, multiply(factor, AposToI))\n D = add(D, multiply(factor * alternate, AposToI))\n }\n\n let R = multiply(inv(D), N)\n\n // Square j times\n for (let i = 0; i < j; i++) {\n R = multiply(R, R)\n }\n\n return isSparseMatrix(A)\n ? A.createSparseMatrix(R)\n : R\n }\n\n })\n\n function infinityNorm (A) {\n const n = A.size()[0]\n let infNorm = 0\n for (let i = 0; i < n; i++) {\n let rowSum = 0\n for (let j = 0; j < n; j++) {\n rowSum += abs(A.get([i, j]))\n }\n infNorm = Math.max(rowSum, infNorm)\n }\n return infNorm\n }\n\n /**\n * Find the best parameters for the Pade approximant given\n * the matrix norm and desired accuracy. Returns the first acceptable\n * combination in order of increasing computational load.\n */\n function findParams (infNorm, eps) {\n const maxSearchSize = 30\n for (let k = 0; k < maxSearchSize; k++) {\n for (let q = 0; q <= k; q++) {\n const j = k - q\n if (errorEstimate(infNorm, q, j) < eps) {\n return { q, j }\n }\n }\n }\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)')\n }\n\n /**\n * Returns the estimated error of the Pade approximant for the given\n * parameters.\n */\n function errorEstimate (infNorm, q, j) {\n let qfac = 1\n for (let i = 2; i <= q; i++) {\n qfac *= i\n }\n let twoqfac = qfac\n for (let i = q + 1; i <= 2 * q; i++) {\n twoqfac *= i\n }\n const twoqp1fac = twoqfac * (2 * q + 1)\n\n return 8.0 *\n Math.pow(infNorm / Math.pow(2, j), 2 * q) *\n qfac * qfac / (twoqfac * twoqp1fac)\n }\n})\n","import { isMatrix } from '../../utils/is.js'\nimport { format } from '../../utils/string.js'\nimport { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'sqrtm'\nconst dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity']\n\nexport const createSqrtm = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, add, multiply, map, sqrt, subtract, inv, size, max, identity }) => {\n const _maxIterations = 1e3\n const _tolerance = 1e-6\n\n /**\n * Calculate the principal square root matrix using the Denman–Beavers iterative method\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman–Beavers_iteration\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n * @private\n */\n function _denmanBeavers (A) {\n let error\n let iterations = 0\n\n let Y = A\n let Z = identity(size(A))\n\n do {\n const Yk = Y\n Y = multiply(0.5, add(Yk, inv(Z)))\n Z = multiply(0.5, add(Z, inv(Yk)))\n\n error = max(abs(subtract(Y, Yk)))\n\n if (error > _tolerance && ++iterations > _maxIterations) {\n throw new Error('computing square root of matrix: iterative method could not converge')\n }\n } while (error > _tolerance)\n\n return Y\n }\n\n /**\n * Calculate the principal square root of a square matrix.\n * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix\n *\n * Syntax:\n *\n * math.sqrtm(A)\n *\n * Examples:\n *\n * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n */\n return typed(name, {\n 'Array | Matrix': function (A) {\n const size = isMatrix(A) ? A.size() : arraySize(A)\n switch (size.length) {\n case 1:\n // Single element Array | Matrix\n if (size[0] === 1) {\n return map(A, sqrt)\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n\n case 2:\n {\n // Two-dimensional Array | Matrix\n const rows = size[0]\n const cols = size[1]\n if (rows === cols) {\n return _denmanBeavers(A)\n } else {\n throw new RangeError('Matrix must be square ' +\n '(size: ' + format(size) + ')')\n }\n }\n default:\n // Multi dimensional array\n throw new RangeError('Matrix must be at most two dimensional ' +\n '(size: ' + format(size) + ')')\n }\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'sylvester'\nconst dependencies = [\n 'typed',\n 'schur',\n 'matrixFromColumns',\n 'matrix',\n 'multiply',\n 'range',\n 'concat',\n 'transpose',\n 'index',\n 'subset',\n 'add',\n 'subtract',\n 'identity',\n 'lusolve',\n 'abs'\n]\n\nexport const createSylvester = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n schur,\n matrixFromColumns,\n matrix,\n multiply,\n range,\n concat,\n transpose,\n index,\n subset,\n add,\n subtract,\n identity,\n lusolve,\n abs\n }\n) => {\n /**\n *\n * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are\n * matrices of appropriate dimensions, being A and B squared. Notice that other\n * equivalent definitions for the Sylvester equation exist and this function\n * assumes the one presented in the original publication of the the Bartels-\n * Stewart algorithm, which is implemented by this function.\n * https://en.wikipedia.org/wiki/Sylvester_equation\n *\n * Syntax:\n *\n * math.sylvester(A, B, C)\n *\n * Examples:\n *\n * const A = [[-1, -2], [1, 1]]\n * const B = [[2, -1], [1, -2]]\n * const C = [[-3, 2], [3, 0]]\n * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]]\n *\n * See also:\n *\n * schur, lyap\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} B Matrix B\n * @param {Matrix | Array} C Matrix C\n * @return {Matrix | Array} Matrix X, solving the Sylvester equation\n */\n return typed(name, {\n 'Matrix, Matrix, Matrix': _sylvester,\n 'Array, Matrix, Matrix': function (A, B, C) {\n return _sylvester(matrix(A), B, C)\n },\n 'Array, Array, Matrix': function (A, B, C) {\n return _sylvester(matrix(A), matrix(B), C)\n },\n 'Array, Matrix, Array': function (A, B, C) {\n return _sylvester(matrix(A), B, matrix(C))\n },\n 'Matrix, Array, Matrix': function (A, B, C) {\n return _sylvester(A, matrix(B), C)\n },\n 'Matrix, Array, Array': function (A, B, C) {\n return _sylvester(A, matrix(B), matrix(C))\n },\n 'Matrix, Matrix, Array': function (A, B, C) {\n return _sylvester(A, B, matrix(C))\n },\n 'Array, Array, Array': function (A, B, C) {\n return _sylvester(matrix(A), matrix(B), matrix(C)).toArray()\n }\n })\n function _sylvester (A, B, C) {\n const n = B.size()[0]\n const m = A.size()[0]\n\n const sA = schur(A)\n const F = sA.T\n const U = sA.U\n const sB = schur(multiply(-1, B))\n const G = sB.T\n const V = sB.U\n const D = multiply(multiply(transpose(U), C), V)\n const all = range(0, m)\n const y = []\n\n const hc = (a, b) => concat(a, b, 1)\n const vc = (a, b) => concat(a, b, 0)\n\n for (let k = 0; k < n; k++) {\n if (k < (n - 1) && abs(subset(G, index(k + 1, k))) > 1e-5) {\n let RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1)))\n for (let j = 0; j < k; j++) {\n RHS = add(RHS,\n vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1))))\n )\n }\n const gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k))))\n const gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k))))\n const gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1))))\n const gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1))))\n const LHS = vc(\n hc(add(F, gkk), gmk),\n hc(gkm, add(F, gmm))\n )\n const yAux = lusolve(LHS, RHS)\n y[k] = yAux.subset(index(range(0, m), 0))\n y[k + 1] = yAux.subset(index(range(m, 2 * m), 0))\n k++\n } else {\n let RHS = subset(D, index(all, k))\n for (let j = 0; j < k; j++) { RHS = add(RHS, multiply(y[j], subset(G, index(j, k)))) }\n const gkk = subset(G, index(k, k))\n const LHS = subtract(F, multiply(gkk, identity(m)))\n\n y[k] = lusolve(LHS, RHS)\n }\n }\n const Y = matrix(matrixFromColumns(...y))\n const X = multiply(U, multiply(Y, transpose(V)))\n\n return X\n }\n})\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'schur'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'identity',\n 'multiply',\n 'qr',\n 'norm',\n 'subtract'\n]\n\nexport const createSchur = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n matrix,\n identity,\n multiply,\n qr,\n norm,\n subtract\n }\n) => {\n /**\n *\n * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal\n * and T is upper quasi-triangular.\n * https://en.wikipedia.org/wiki/Schur_decomposition\n *\n * Syntax:\n *\n * math.schur(A)\n *\n * Examples:\n *\n * const A = [[1, 0], [-4, 3]]\n * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]}\n *\n * See also:\n *\n * sylvester, lyap, qr\n *\n * @param {Array | Matrix} A Matrix A\n * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU'\n */\n return typed(name, {\n Array: function (X) {\n const r = _schur(matrix(X))\n return {\n U: r.U.valueOf(),\n T: r.T.valueOf()\n }\n },\n\n Matrix: function (X) {\n return _schur(X)\n }\n })\n function _schur (X) {\n const n = X.size()[0]\n let A = X\n let U = identity(n)\n let k = 0\n let A0\n do {\n A0 = A\n const QR = qr(A)\n const Q = QR.Q\n const R = QR.R\n A = multiply(R, Q)\n U = multiply(U, Q)\n if ((k++) > 100) { break }\n } while (norm(subtract(A, A0)) > 1e-4)\n return { U, T: A }\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'lyap'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'sylvester',\n 'multiply',\n 'transpose'\n]\n\nexport const createLyap = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n matrix,\n sylvester,\n multiply,\n transpose\n }\n) => {\n /**\n *\n * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where\n * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice\n * that different equivalent definitions exist for the Continuous-time\n * Lyapunov equation.\n * https://en.wikipedia.org/wiki/Lyapunov_equation\n *\n * Syntax:\n *\n * math.lyap(A, Q)\n *\n * Examples:\n *\n * const A = [[-2, 0], [1, -4]]\n * const Q = [[3, 1], [1, 3]]\n * const P = math.lyap(A, Q)\n *\n * See also:\n *\n * sylvester, schur\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} Q Matrix Q\n * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q\n */\n return typed(name, {\n 'Matrix, Matrix': function (A, Q) {\n return sylvester(A, transpose(A), multiply(-1, Q))\n },\n 'Array, Matrix': function (A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q))\n },\n 'Matrix, Array': function (A, Q) {\n return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q)))\n },\n 'Array, Array': function (A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray()\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\nimport { extend } from '../../utils/object.js'\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\n\nconst name = 'divide'\nconst dependencies = [\n 'typed',\n 'matrix',\n 'multiply',\n 'equalScalar',\n 'divideScalar',\n 'inv'\n]\n\nexport const createDivide = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, multiply, equalScalar, divideScalar, inv }) => {\n const matAlgo11xS0s = createMatAlgo11xS0s({ typed, equalScalar })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n\n /**\n * Divide two values, `x / y`.\n * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`.\n *\n * Syntax:\n *\n * math.divide(x, y)\n *\n * Examples:\n *\n * math.divide(2, 3) // returns number 0.6666666666666666\n *\n * const a = math.complex(5, 14)\n * const b = math.complex(4, 1)\n * math.divide(a, b) // returns Complex 2 + 3i\n *\n * const c = [[7, -6], [13, -4]]\n * const d = [[1, 2], [4, 3]]\n * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]]\n *\n * const e = math.unit('18 km')\n * math.divide(e, 4.5) // returns Unit 4 km\n *\n * See also:\n *\n * multiply\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y`\n */\n return typed('divide', extend({\n // we extend the signatures of divideScalar with signatures dealing with matrices\n\n 'Array | Matrix, Array | Matrix': function (x, y) {\n // TODO: implement matrix right division using pseudo inverse\n // https://www.mathworks.nl/help/matlab/ref/mrdivide.html\n // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html\n // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour\n return multiply(x, inv(y))\n },\n\n 'DenseMatrix, any': function (x, y) {\n return matAlgo14xDs(x, y, divideScalar, false)\n },\n\n 'SparseMatrix, any': function (x, y) {\n return matAlgo11xS0s(x, y, divideScalar, false)\n },\n\n 'Array, any': function (x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf()\n },\n\n 'any, Array | Matrix': function (x, y) {\n return multiply(x, inv(y))\n }\n }, divideScalar.signatures))\n})\n","import { isBigNumber } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'distance'\nconst dependencies = [\n 'typed',\n 'addScalar',\n 'subtractScalar',\n 'divideScalar',\n 'multiplyScalar',\n 'deepEqual',\n 'sqrt',\n 'abs'\n]\n\nexport const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typed, addScalar, subtractScalar, multiplyScalar, divideScalar, deepEqual, sqrt, abs }) => {\n /**\n * Calculates:\n * The eucledian distance between two points in N-dimensional spaces.\n * Distance between point and a line in 2 and 3 dimensional spaces.\n * Pairwise distance between a set of 2D or 3D points\n * NOTE:\n * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c\n * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c)\n *\n * Syntax:\n *\n * math.distance([x1,y1], [x2,y2])\n * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY})\n * math.distance([x1,y1,z1], [x2,y2,z2])\n * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ})\n * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2])\n * math.distance([[x1,y1], [x2,y2], [x3,y3]])\n * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]])\n * math.distance([pointX,pointY], [a,b,c])\n * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY])\n * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY})\n * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c])\n * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c})\n *\n * Examples:\n * math.distance([0,0], [4,4]) // Returns 5.656854249492381\n * math.distance(\n * {pointOneX: 0, pointOneY: 0},\n * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951\n * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413\n * math.distance(\n * {pointOneX: 4, pointOneY: 5, pointOneZ: 8},\n * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3\n * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2\n * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1]\n * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608]\n * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387\n * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4\n * math.distance(\n * {pointX: 0, pointY: 0},\n * {lineOnePtX: 3, lineOnePtY: 0},\n * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4\n * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857\n * math.distance(\n * {pointX: 2, pointY: 3, pointZ: 1},\n * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857\n *\n * @param {Array | Matrix | Object} x Co-ordinates of first point\n * @param {Array | Matrix | Object} y Co-ordinates of second point\n * @return {Number | BigNumber} Returns the distance from two/three points\n */\n return typed(name, {\n 'Array, Array, Array': function (x, y, z) {\n // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2)\n if (x.length === 2 && y.length === 2 && z.length === 2) {\n if (!_2d(x)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument') }\n if (!_2d(y)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument') }\n if (!_2d(z)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument') }\n if (deepEqual(y, z)) { throw new TypeError('LinePoint1 should not be same with LinePoint2') }\n const xCoeff = subtractScalar(z[1], y[1])\n const yCoeff = subtractScalar(y[0], z[0])\n const constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1]))\n\n return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant)\n } else {\n throw new TypeError('Invalid Arguments: Try again')\n }\n },\n 'Object, Object, Object': function (x, y, z) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) {\n if (!_2d(x)) { throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers') }\n if (!_2d(y)) { throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers') }\n if (!_2d(z)) { throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers') }\n if (deepEqual(_objectToArray(y), _objectToArray(z))) { throw new TypeError('LinePoint1 should not be same with LinePoint2') }\n if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y &&\n 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) {\n const xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY)\n const yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX)\n const constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY))\n return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant)\n } else {\n throw new TypeError('Key names do not match')\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again')\n }\n },\n 'Array, Array': function (x, y) {\n // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const])\n if (x.length === 2 && y.length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument')\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument')\n }\n\n return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2])\n } else if (x.length === 3 && y.length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument')\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument')\n }\n\n return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5])\n } else if (x.length === y.length && x.length > 0) {\n // Point to Point N-dimensions\n if (!_containsOnlyNumbers(x)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers')\n }\n if (!_containsOnlyNumbers(y)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers')\n }\n\n return _euclideanDistance(x, y)\n } else {\n throw new TypeError('Invalid Arguments: Try again')\n }\n },\n 'Object, Object': function (x, y) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers')\n }\n if (!_3d(y)) {\n throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers')\n }\n if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) {\n return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant)\n } else {\n throw new TypeError('Key names do not match')\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers')\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers')\n }\n if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) {\n return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c)\n } else {\n throw new TypeError('Key names do not match')\n }\n } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) {\n // Point to Point 2D\n if (!_2d(x)) {\n throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers')\n }\n if (!_2d(y)) {\n throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers')\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY])\n } else {\n throw new TypeError('Key names do not match')\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) {\n // Point to Point 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers')\n }\n if (!_3d(y)) {\n throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers')\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x &&\n 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y\n ) {\n return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ])\n } else {\n throw new TypeError('Key names do not match')\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again')\n }\n },\n Array: function (arr) {\n if (!_pairwise(arr)) { throw new TypeError('Incorrect array format entered for pairwise distance calculation') }\n\n return _distancePairwise(arr)\n }\n })\n\n function _isNumber (a) {\n // distance supports numbers and bignumbers\n return (typeof a === 'number' || isBigNumber(a))\n }\n\n function _2d (a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a)\n }\n return _isNumber(a[0]) && _isNumber(a[1])\n }\n\n function _3d (a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a)\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2])\n }\n\n function _containsOnlyNumbers (a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (!Array.isArray(a)) {\n a = _objectToArray(a)\n }\n return a.every(_isNumber)\n }\n\n function _parametricLine (a) {\n if (a.constructor !== Array) {\n a = _objectToArray(a)\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) &&\n _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5])\n }\n\n function _objectToArray (o) {\n const keys = Object.keys(o)\n const a = []\n for (let i = 0; i < keys.length; i++) {\n a.push(o[keys[i]])\n }\n return a\n }\n\n function _pairwise (a) {\n // checks for valid arguments passed to _distancePairwise(Array)\n if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) {\n if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) {\n return false\n }\n } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) {\n if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) {\n return false\n }\n } else {\n return false\n }\n return true\n }\n\n function _distancePointLine2D (x, y, a, b, c) {\n const num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c))\n const den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)))\n return divideScalar(num, den)\n }\n\n function _distancePointLine3D (x, y, z, x0, y0, z0, a, b, c) {\n let num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)),\n subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)),\n subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))]\n num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])))\n const den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)))\n return divideScalar(num, den)\n }\n\n function _euclideanDistance (x, y) {\n const vectorSize = x.length\n let result = 0\n let diff = 0\n for (let i = 0; i < vectorSize; i++) {\n diff = subtractScalar(x[i], y[i])\n result = addScalar(multiplyScalar(diff, diff), result)\n }\n return sqrt(result)\n }\n\n function _distancePairwise (a) {\n const result = []\n let pointA = []\n let pointB = []\n for (let i = 0; i < a.length - 1; i++) {\n for (let j = i + 1; j < a.length; j++) {\n if (a[0].length === 2) {\n pointA = [a[i][0], a[i][1]]\n pointB = [a[j][0], a[j][1]]\n } else if (a[0].length === 3) {\n pointA = [a[i][0], a[i][1], a[i][2]]\n pointB = [a[j][0], a[j][1], a[j][2]]\n }\n result.push(_euclideanDistance(pointA, pointB))\n }\n }\n return result\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'intersect'\nconst dependencies = [\n 'typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric'\n]\n\nexport const createIntersect = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, abs, add, addScalar, matrix, multiply, multiplyScalar, divideScalar, subtract, smaller, equalScalar, flatten, isZero, isNumeric }) => {\n /**\n * Calculates the point of intersection of two lines in two or three dimensions\n * and of a line and a plane in three dimensions. The inputs are in the form of\n * arrays or 1 dimensional matrices. The line intersection functions return null\n * if the lines do not meet.\n *\n * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`.\n *\n * Syntax:\n *\n * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)\n * math.intersect(endPoint1, endPoint2, planeCoefficients)\n *\n * Examples:\n *\n * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5]\n * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0]\n * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3]\n *\n * @param {Array | Matrix} w Co-ordinates of first end-point of first line\n * @param {Array | Matrix} x Co-ordinates of second end-point of first line\n * @param {Array | Matrix} y Co-ordinates of first end-point of second line\n * OR Co-efficients of the plane's equation\n * @param {Array | Matrix} z Co-ordinates of second end-point of second line\n * OR undefined if the calculation is for line and plane\n * @return {Array} Returns the point of intersection of lines/lines-planes\n */\n return typed('intersect', {\n 'Array, Array, Array': _AAA,\n\n 'Array, Array, Array, Array': _AAAA,\n\n 'Matrix, Matrix, Matrix': function (x, y, plane) {\n const arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf())\n return arr === null ? null : matrix(arr)\n },\n\n 'Matrix, Matrix, Matrix, Matrix': function (w, x, y, z) {\n // TODO: output matrix type should match input matrix type\n const arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf())\n return arr === null ? null : matrix(arr)\n }\n })\n\n function _AAA (x, y, plane) {\n x = _coerceArr(x)\n y = _coerceArr(y)\n plane = _coerceArr(plane)\n\n if (!_3d(x)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument') }\n if (!_3d(y)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument') }\n if (!_4d(plane)) { throw new TypeError('Array with 4 numbers expected as third argument') }\n\n return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3])\n }\n\n function _AAAA (w, x, y, z) {\n w = _coerceArr(w)\n x = _coerceArr(x)\n y = _coerceArr(y)\n z = _coerceArr(z)\n\n if (w.length === 2) {\n if (!_2d(w)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument') }\n if (!_2d(x)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument') }\n if (!_2d(y)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument') }\n if (!_2d(z)) { throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument') }\n\n return _intersect2d(w, x, y, z)\n } else if (w.length === 3) {\n if (!_3d(w)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument') }\n if (!_3d(x)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument') }\n if (!_3d(y)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument') }\n if (!_3d(z)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument') }\n\n return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2])\n } else {\n throw new TypeError('Arrays with two or thee dimensional points expected')\n }\n }\n\n /** Coerce row and column 2-dim arrays to 1-dim array */\n function _coerceArr (arr) {\n // row matrix\n if (arr.length === 1) return arr[0]\n\n // column matrix\n if (arr.length > 1 && Array.isArray(arr[0])) {\n if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr)\n }\n\n return arr\n }\n\n function _2d (x) {\n return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1])\n }\n\n function _3d (x) {\n return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2])\n }\n\n function _4d (x) {\n return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3])\n }\n\n function _intersect2d (p1a, p1b, p2a, p2b) {\n const o1 = p1a\n const o2 = p2a\n const d1 = subtract(o1, p1b)\n const d2 = subtract(o2, p2b)\n const det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]))\n if (isZero(det)) return null\n if (smaller(abs(det), config.relTol)) {\n return null\n }\n const d20o11 = multiplyScalar(d2[0], o1[1])\n const d21o10 = multiplyScalar(d2[1], o1[0])\n const d20o21 = multiplyScalar(d2[0], o2[1])\n const d21o20 = multiplyScalar(d2[1], o2[0])\n const t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det)\n return add(multiply(d1, t), o1)\n }\n\n function _intersect3dHelper (a, b, c, d, e, f, g, h, i, j, k, l) {\n // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l)\n const add1 = multiplyScalar(subtract(a, b), subtract(c, d))\n const add2 = multiplyScalar(subtract(e, f), subtract(g, h))\n const add3 = multiplyScalar(subtract(i, j), subtract(k, l))\n return addScalar(addScalar(add1, add2), add3)\n }\n\n function _intersect3d (x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {\n const d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3)\n const d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1)\n const d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1)\n const d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3)\n const d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1)\n const numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343))\n const denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321))\n if (isZero(denominator)) return null\n const ta = divideScalar(numerator, denominator)\n const tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343)\n\n const pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1)))\n const pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1)))\n const paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1)))\n const pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3)))\n const pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3)))\n const pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)))\n if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) {\n return [pax, pay, paz]\n } else {\n return null\n }\n }\n\n function _intersectLinePlane (x1, y1, z1, x2, y2, z2, x, y, z, c) {\n const x1x = multiplyScalar(x1, x)\n const x2x = multiplyScalar(x2, x)\n const y1y = multiplyScalar(y1, y)\n const y2y = multiplyScalar(y2, y)\n const z1z = multiplyScalar(z1, z)\n const z2z = multiplyScalar(z2, z)\n\n const numerator = subtract(subtract(subtract(c, x1x), y1y), z1z)\n const denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z)\n\n const t = divideScalar(numerator, denominator)\n\n const px = addScalar(x1, multiplyScalar(t, subtract(x2, x1)))\n const py = addScalar(y1, multiplyScalar(t, subtract(y2, y1)))\n const pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)))\n return [px, py, pz]\n // TODO: Add cases when line is parallel to the plane:\n // (a) no intersection,\n // (b) line contained in plane\n }\n})\n","import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'sum'\nconst dependencies = ['typed', 'config', 'add', 'numeric']\n\nexport const createSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, numeric }) => {\n /**\n * Compute the sum of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.sum(a, b, c, ...)\n * math.sum(A)\n * math.sum(A, dimension)\n *\n * Examples:\n *\n * math.sum(2, 1, 4, 3) // returns 10\n * math.sum([2, 1, 4, 3]) // returns 10\n * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, cumsum\n *\n * @param {... *} args A single matrix or multiple scalar values\n * @return {*} The sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n 'Array | Matrix': _sum,\n\n // sum([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nsumDim,\n\n // sum(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function sum')\n }\n\n return _sum(args)\n }\n })\n\n /**\n * Recursively calculate the sum of an n-dimensional array\n * @param {Array | Matrix} array\n * @return {number} sum\n * @private\n */\n function _sum (array) {\n let sum\n\n deepForEach(array, function (value) {\n try {\n sum = (sum === undefined) ? value : add(sum, value)\n } catch (err) {\n throw improveErrorMessage(err, 'sum', value)\n }\n })\n\n // make sure returning numeric value: parse a string into a numeric value\n if (sum === undefined) {\n sum = numeric(0, config.number)\n }\n if (typeof sum === 'string') {\n sum = numeric(sum, safeNumberType(sum, config))\n }\n\n return sum\n }\n\n function _nsumDim (array, dim) {\n try {\n const sum = reduce(array, dim, add)\n return sum\n } catch (err) {\n throw improveErrorMessage(err, 'sum')\n }\n }\n})\n","import { containsCollections } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\nimport { _switch } from '../../utils/switch.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\nimport { arraySize } from '../../utils/array.js'\nimport { IndexError } from '../../error/IndexError.js'\n\nconst name = 'cumsum'\nconst dependencies = ['typed', 'add', 'unaryPlus']\n\nexport const createCumSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, unaryPlus }) => {\n /**\n * Compute the cumulative sum of a matrix or a list with values.\n * In case of a (multi dimensional) array or matrix, the cumulative sums\n * along a specified dimension (defaulting to the first) will be calculated.\n *\n * Syntax:\n *\n * math.cumsum(a, b, c, ...)\n * math.cumsum(A)\n *\n * Examples:\n *\n * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10]\n * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10]\n * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]]\n * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]]\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, sum\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The cumulative sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n Array: _cumsum,\n Matrix: function (matrix) {\n return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype()))\n },\n\n // sum([a, b, c, d, ...], dim)\n 'Array, number | BigNumber': _ncumSumDim,\n 'Matrix, number | BigNumber': function (matrix, dim) {\n return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype())\n },\n\n // cumsum(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('All values expected to be scalar in function cumsum')\n }\n\n return _cumsum(args)\n }\n })\n\n /**\n * Recursively calculate the cumulative sum of an n-dimensional array\n * @param {Array} array\n * @return {number} cumsum\n * @private\n */\n function _cumsum (array) {\n try {\n return _cumsummap(array)\n } catch (err) {\n throw improveErrorMessage(err, name)\n }\n }\n\n function _cumsummap (array) {\n if (array.length === 0) {\n return []\n }\n\n const sums = [unaryPlus(array[0])] // unaryPlus converts to number if need be\n for (let i = 1; i < array.length; ++i) {\n // Must use add below and not addScalar for the case of summing a\n // 2+-dimensional array along the 0th dimension (the row vectors,\n // or higher-d analogues, are literally added to each other).\n sums.push(add(sums[i - 1], array[i]))\n }\n return sums\n }\n\n function _ncumSumDim (array, dim) {\n const size = arraySize(array)\n if (dim < 0 || (dim >= size.length)) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length)\n }\n\n try {\n return _cumsumDimensional(array, dim)\n } catch (err) {\n throw improveErrorMessage(err, name)\n }\n }\n\n /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */\n function _cumsumDimensional (mat, dim) {\n let i, ret, tran\n\n if (dim <= 0) {\n const initialValue = mat[0][0]\n if (!Array.isArray(initialValue)) {\n return _cumsummap(mat)\n } else {\n tran = _switch(mat)\n ret = []\n for (i = 0; i < tran.length; i++) {\n ret[i] = _cumsumDimensional(tran[i], dim - 1)\n }\n return ret\n }\n } else {\n ret = []\n for (i = 0; i < mat.length; i++) {\n ret[i] = _cumsumDimensional(mat[i], dim - 1)\n }\n return ret\n }\n }\n})\n","import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'\nimport { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'mean'\nconst dependencies = ['typed', 'add', 'divide']\n\nexport const createMean = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, divide }) => {\n /**\n * Compute the mean value of matrix or a list with values.\n * In case of a multidimensional array, the mean of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.mean(a, b, c, ...)\n * math.mean(A)\n * math.mean(A, dimension)\n *\n * Examples:\n *\n * math.mean(2, 1, 4, 3) // returns 2.5\n * math.mean([1, 2.7, 3.2, 4]) // returns 2.725\n *\n * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5]\n * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4]\n *\n * See also:\n *\n * median, min, max, sum, prod, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The mean of all values\n */\n return typed(name, {\n // mean([a, b, c, d, ...])\n 'Array | Matrix': _mean,\n\n // mean([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nmeanDim,\n\n // mean(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function mean')\n }\n\n return _mean(args)\n }\n })\n\n /**\n * Calculate the mean value in an n-dimensional array, returning a\n * n-1 dimensional array\n * @param {Array} array\n * @param {number} dim\n * @return {number} mean\n * @private\n */\n function _nmeanDim (array, dim) {\n try {\n const sum = reduce(array, dim, add)\n const s = Array.isArray(array) ? arraySize(array) : array.size()\n return divide(sum, s[dim])\n } catch (err) {\n throw improveErrorMessage(err, 'mean')\n }\n }\n\n /**\n * Recursively calculate the mean value in an n-dimensional array\n * @param {Array} array\n * @return {number} mean\n * @private\n */\n function _mean (array) {\n let sum\n let num = 0\n\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value)\n num++\n } catch (err) {\n throw improveErrorMessage(err, 'mean', value)\n }\n })\n\n if (num === 0) {\n throw new Error('Cannot calculate the mean of an empty array')\n }\n return divide(sum, num)\n }\n})\n","import { containsCollections } from '../../utils/collection.js'\nimport { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'median'\nconst dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect']\n\nexport const createMedian = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, divide, compare, partitionSelect }) => {\n /**\n * Recursively calculate the median of an n-dimensional array\n * @param {Array} array\n * @return {Number} median\n * @private\n */\n function _median (array) {\n try {\n array = flatten(array.valueOf())\n\n const num = array.length\n if (num === 0) {\n throw new Error('Cannot calculate median of an empty array')\n }\n\n if (num % 2 === 0) {\n // even: return the average of the two middle values\n const mid = num / 2 - 1\n const right = partitionSelect(array, mid + 1)\n\n // array now partitioned at mid + 1, take max of left part\n let left = array[mid]\n for (let i = 0; i < mid; ++i) {\n if (compare(array[i], left) > 0) {\n left = array[i]\n }\n }\n\n return middle2(left, right)\n } else {\n // odd: return the middle value\n const m = partitionSelect(array, (num - 1) / 2)\n\n return middle(m)\n }\n } catch (err) {\n throw improveErrorMessage(err, 'median')\n }\n }\n\n // helper function to type check the middle value of the array\n const middle = typed({\n 'number | BigNumber | Complex | Unit': function (value) {\n return value\n }\n })\n\n // helper function to type check the two middle value of the array\n const middle2 = typed({\n 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function (left, right) {\n return divide(add(left, right), 2)\n }\n })\n\n /**\n * Compute the median of a matrix or a list with values. The values are\n * sorted and the middle value is returned. In case of an even number of\n * values, the average of the two middle values is returned.\n * Supported types of values are: Number, BigNumber, Unit\n *\n * In case of a (multi dimensional) array or matrix, the median of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.median(a, b, c, ...)\n * math.median(A)\n *\n * Examples:\n *\n * math.median(5, 2, 7) // returns 5\n * math.median([3, -1, 5, 7]) // returns 4\n *\n * See also:\n *\n * mean, min, max, sum, prod, std, variance, quantileSeq\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The median\n */\n return typed(name, {\n // median([a, b, c, d, ...])\n 'Array | Matrix': _median,\n\n // median([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function (array, dim) {\n // TODO: implement median(A, dim)\n throw new Error('median(A, dim) is not yet supported')\n // return reduce(arguments[0], arguments[1], ...)\n },\n\n // median(a, b, c, d, ...)\n '...': function (args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function median')\n }\n\n return _median(args)\n }\n })\n})\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst name = 'mad'\nconst dependencies = ['typed', 'abs', 'map', 'median', 'subtract']\n\nexport const createMad = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, map, median, subtract }) => {\n /**\n * Compute the median absolute deviation of a matrix or a list with values.\n * The median absolute deviation is defined as the median of the absolute\n * deviations from the median.\n *\n * Syntax:\n *\n * math.mad(a, b, c, ...)\n * math.mad(A)\n *\n * Examples:\n *\n * math.mad(10, 20, 30) // returns 10\n * math.mad([1, 2, 3]) // returns 1\n * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5\n *\n * See also:\n *\n * median, mean, std, abs\n *\n * @param {Array | Matrix} array\n * A single matrix or multiple scalar values.\n * @return {*} The median absolute deviation.\n */\n return typed(name, {\n // mad([a, b, c, d, ...])\n 'Array | Matrix': _mad,\n\n // mad(a, b, c, d, ...)\n '...': function (args) {\n return _mad(args)\n }\n })\n\n function _mad (array) {\n array = flatten(array.valueOf())\n\n if (array.length === 0) {\n throw new Error('Cannot calculate median absolute deviation (mad) of an empty array')\n }\n\n try {\n const med = median(array)\n return median(map(array, function (value) {\n return abs(subtract(value, med))\n }))\n } catch (err) {\n if (err instanceof TypeError && err.message.includes('median')) {\n throw new TypeError(err.message.replace('median', 'mad'))\n } else {\n throw improveErrorMessage(err, 'mad')\n }\n }\n }\n})\n","import { deepForEach } from '../../utils/collection.js'\nimport { isBigNumber } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { improveErrorMessage } from './utils/improveErrorMessage.js'\n\nconst DEFAULT_NORMALIZATION = 'unbiased'\n\nconst name = 'variance'\nconst dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']\n\nexport const createVariance = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, subtract, multiply, divide, apply, isNaN }) => {\n /**\n * Compute the variance of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the variance over all\n * elements will be calculated.\n *\n * Additionally, it is possible to compute the variance along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Note that older browser may not like the variable name `var`. In that\n * case, the function can be called as `math['var'](...)` instead of\n * `math.var(...)`.\n *\n * Syntax:\n *\n * math.variance(a, b, c, ...)\n * math.variance(A)\n * math.variance(A, normalization)\n * math.variance(A, dimension)\n * math.variance(A, dimension, normalization)\n *\n * Examples:\n *\n * math.variance(2, 4, 6) // returns 4\n * math.variance([2, 4, 6, 8]) // returns 6.666666666666667\n * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5\n * math.variance([2, 4, 6, 8], 'biased') // returns 4\n *\n * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5\n * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2]\n *\n * See also:\n *\n * mean, median, max, min, prod, std, sum\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the variance for a matrix\n * @return {*} The variance\n */\n return typed(name, {\n // variance([a, b, c, d, ...])\n 'Array | Matrix': function (array) {\n return _var(array, DEFAULT_NORMALIZATION)\n },\n\n // variance([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _var,\n\n // variance([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': function (array, dim) {\n return _varDim(array, dim, DEFAULT_NORMALIZATION)\n },\n\n // variance([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _varDim,\n\n // variance(a, b, c, d, ...)\n '...': function (args) {\n return _var(args, DEFAULT_NORMALIZATION)\n }\n })\n\n /**\n * Recursively calculate the variance of an n-dimensional array\n * @param {Array} array\n * @param {string} normalization\n * Determines how to normalize the variance:\n * - 'unbiased' The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n * @return {number | BigNumber} variance\n * @private\n */\n function _var (array, normalization) {\n let sum\n let num = 0\n\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)')\n }\n\n // calculate the mean and number of elements\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value)\n num++\n } catch (err) {\n throw improveErrorMessage(err, 'variance', value)\n }\n })\n if (num === 0) throw new Error('Cannot calculate variance of an empty array')\n\n const mean = divide(sum, num)\n\n // calculate the variance\n sum = undefined\n deepForEach(array, function (value) {\n const diff = subtract(value, mean)\n sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff))\n })\n\n if (isNaN(sum)) {\n return sum\n }\n\n switch (normalization) {\n case 'uncorrected':\n return divide(sum, num)\n\n case 'biased':\n return divide(sum, num + 1)\n\n case 'unbiased':\n {\n const zero = isBigNumber(sum) ? sum.mul(0) : 0\n return (num === 1) ? zero : divide(sum, num - 1)\n }\n\n default:\n throw new Error('Unknown normalization \"' + normalization + '\". ' +\n 'Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".')\n }\n }\n\n function _varDim (array, dim, normalization) {\n try {\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)')\n }\n return apply(array, dim, (x) => _var(x, normalization))\n } catch (err) {\n throw improveErrorMessage(err, 'variance')\n }\n }\n})\n","import { isNumber } from '../../utils/is.js'\nimport { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { createApply } from '../matrix/apply.js'\n\nconst name = 'quantileSeq'\nconst dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']\n\nexport const createQuantileSeq = /* #__PURE__ */ factory(name, dependencies, ({ typed, bignumber, add, subtract, divide, multiply, partitionSelect, compare, isInteger, smaller, smallerEq, larger }) => {\n const apply = createApply({ typed, isInteger })\n\n /**\n * Compute the prob order quantile of a matrix or a list with values.\n * The sequence is sorted and the middle value is returned.\n * Supported types of sequence values are: Number, BigNumber, Unit\n * Supported types of probability are: Number, BigNumber\n *\n * In case of a multidimensional array or matrix, the prob order quantile\n * of all elements will be calculated.\n *\n * Syntax:\n *\n * math.quantileSeq(A, prob[, sorted])\n * math.quantileSeq(A, [prob1, prob2, ...][, sorted])\n * math.quantileSeq(A, N[, sorted])\n *\n * Examples:\n *\n * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4\n * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]\n * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]\n * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array, Matrix} data A single matrix or Array\n * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is\n * the amount of evenly distributed steps of\n * probabilities; only one of these options can\n * be provided\n * @param {Boolean} sorted=false is data sorted in ascending order\n * @return {Number, BigNumber, Unit, Array} Quantile(s)\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false),\n 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),\n 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber,\n 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),\n 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false),\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),\n 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)\n })\n\n function _quantileSeqDim (data, prob, sorted, dim, fn) {\n return apply(data, dim, x => fn(x, prob, sorted))\n }\n\n function _quantileSeqProbNumber (data, probOrN, sorted) {\n let probArr\n const dataArr = data.valueOf()\n if (smaller(probOrN, 0)) {\n throw new Error('N/prob must be non-negative')\n }\n if (smallerEq(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], prob[,sorted])\n return isNumber(probOrN)\n ? _quantileSeq(dataArr, probOrN, sorted)\n : bignumber(_quantileSeq(dataArr, probOrN, sorted))\n }\n if (larger(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], N[,sorted])\n if (!isInteger(probOrN)) {\n throw new Error('N must be a positive integer')\n }\n\n // largest possible Array length is 2^32-1\n // 2^32 < 10^15, thus safe conversion guaranteed\n if (larger(probOrN, 4294967295)) {\n throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array')\n }\n\n const nPlusOne = add(probOrN, 1)\n probArr = []\n\n for (let i = 0; smaller(i, probOrN); i++) {\n const prob = divide(i + 1, nPlusOne)\n probArr.push(_quantileSeq(dataArr, prob, sorted))\n }\n\n return isNumber(probOrN) ? probArr : bignumber(probArr)\n }\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array, Matrix} array\n * @param {Array, Matrix} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n\n function _quantileSeqProbCollection (data, probOrN, sorted) {\n const dataArr = data.valueOf()\n // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted])\n const probOrNArr = probOrN.valueOf()\n const probArr = []\n for (let i = 0; i < probOrNArr.length; ++i) {\n probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted))\n }\n return probArr\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array} array\n * @param {Number, BigNumber} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n function _quantileSeq (array, prob, sorted) {\n const flat = flatten(array)\n const len = flat.length\n if (len === 0) {\n throw new Error('Cannot calculate quantile of an empty sequence')\n }\n\n const index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1)\n const integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber()\n const fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart)\n\n if (isInteger(index)) {\n return sorted\n ? flat[index]\n : partitionSelect(\n flat,\n isNumber(prob) ? index : index.valueOf()\n )\n }\n let left\n let right\n if (sorted) {\n left = flat[integerPart]\n right = flat[integerPart + 1]\n } else {\n right = partitionSelect(flat, integerPart + 1)\n\n // max of partition is kth largest\n left = flat[integerPart]\n for (let i = 0; i < integerPart; ++i) {\n if (compare(flat[i], left) > 0) {\n left = flat[i]\n }\n }\n }\n // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1]\n return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart))\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\nconst name = 'std'\nconst dependencies = ['typed', 'map', 'sqrt', 'variance']\n\nexport const createStd = /* #__PURE__ */ factory(name, dependencies, ({ typed, map, sqrt, variance }) => {\n /**\n * Compute the standard deviation of a matrix or a list with values.\n * The standard deviations is defined as the square root of the variance:\n * `std(A) = sqrt(variance(A))`.\n * In case of a (multi dimensional) array or matrix, the standard deviation\n * over all elements will be calculated by default, unless an axis is specified\n * in which case the standard deviation will be computed along that axis.\n *\n * Additionally, it is possible to compute the standard deviation along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Syntax:\n *\n * math.std(a, b, c, ...)\n * math.std(A)\n * math.std(A, normalization)\n * math.std(A, dimension)\n * math.std(A, dimension, normalization)\n *\n * Examples:\n *\n * math.std(2, 4, 6) // returns 2\n * math.std([2, 4, 6, 8]) // returns 2.581988897471611\n * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979\n * math.std([2, 4, 6, 8], 'biased') // returns 2\n *\n * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707\n * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378]\n * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2]\n * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951]\n *\n * See also:\n *\n * mean, median, max, min, prod, sum, variance\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the standard deviation for a matrix\n * @return {*} The standard deviation\n */\n return typed(name, {\n // std([a, b, c, d, ...])\n 'Array | Matrix': _std,\n\n // std([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _std,\n\n // std([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': _std,\n\n // std([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _std,\n\n // std(a, b, c, d, ...)\n '...': function (args) {\n return _std(args)\n }\n })\n\n function _std (array, normalization) {\n if (array.length === 0) {\n throw new SyntaxError('Function std requires one or more parameters (0 provided)')\n }\n\n try {\n const v = variance.apply(null, arguments)\n if (isCollection(v)) {\n return map(v, sqrt)\n } else {\n return sqrt(v)\n }\n } catch (err) {\n if (err instanceof TypeError && err.message.includes(' variance')) {\n throw new TypeError(err.message.replace(' variance', ' std'))\n } else {\n throw err\n }\n }\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'corr'\nconst dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide']\n\nexport const createCorr = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, sqrt, sum, add, subtract, multiply, pow, divide }) => {\n /**\n * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\n *\n * Syntax:\n *\n * math.corr(A, B)\n *\n * Examples:\n *\n * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1\n * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644\n * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1]\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient\n * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient\n * @return {*} The correlation coefficient\n */\n return typed(name, {\n 'Array, Array': function (A, B) {\n return _corr(A, B)\n },\n 'Matrix, Matrix': function (A, B) {\n const res = _corr(A.toArray(), B.toArray())\n return Array.isArray(res) ? matrix(res) : res\n }\n })\n /**\n * Calculate the correlation coefficient between two arrays or matrices.\n * @param {Array | Matrix} A\n * @param {Array | Matrix} B\n * @return {*} correlation coefficient\n * @private\n */\n function _corr (A, B) {\n const correlations = []\n if (Array.isArray(A[0]) && Array.isArray(B[0])) {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.')\n }\n for (let i = 0; i < A.length; i++) {\n if (A[i].length !== B[i].length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.')\n }\n correlations.push(correlation(A[i], B[i]))\n }\n return correlations\n } else {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.')\n }\n return correlation(A, B)\n }\n }\n function correlation (A, B) {\n const n = A.length\n const sumX = sum(A)\n const sumY = sum(B)\n const sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0)\n const sumXSquare = sum(A.map(x => pow(x, 2)))\n const sumYSquare = sum(B.map(y => pow(y, 2)))\n const numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY))\n const denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2))))\n return divide(numerator, denominator)\n }\n})\n","/** @param {number} i\n * @param {number} n\n * @returns {number} product of i to n\n */\nexport function product (i, n) {\n if (n < i) {\n return 1\n }\n\n if (n === i) {\n return n\n }\n\n const half = (n + i) >> 1 // divide (n + i) by 2 and truncate to integer\n return product(i, half) * product(half + 1, n)\n}\n","import { isInteger } from '../../utils/number.js'\nimport { product } from '../../utils/product.js'\n\nexport function combinationsNumber (n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinations')\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinations')\n }\n if (k > n) {\n throw new TypeError('k must be less than or equal to n')\n }\n\n const nMinusk = n - k\n\n let answer = 1\n const firstnumerator = (k < nMinusk) ? nMinusk + 1 : k + 1\n let nextdivisor = 2\n const lastdivisor = (k < nMinusk) ? k : nMinusk\n // balance multiplications and divisions to try to keep intermediate values\n // in exact-integer range as long as possible\n for (let nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) {\n answer *= nextnumerator\n while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) {\n answer /= nextdivisor\n ++nextdivisor\n }\n }\n // for big n, k, floating point may have caused weirdness in remainder\n if (nextdivisor <= lastdivisor) {\n answer /= product(nextdivisor, lastdivisor)\n }\n return answer\n}\ncombinationsNumber.signature = 'number, number'\n","import { factory } from '../../utils/factory.js'\nimport { combinationsNumber } from '../../plain/number/combinations.js'\n\nconst name = 'combinations'\nconst dependencies = ['typed']\n\nexport const createCombinations = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities.\n *\n * Combinations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.combinations(n, k)\n *\n * Examples:\n *\n * math.combinations(7, 5) // returns 21\n *\n * See also:\n *\n * combinationsWithRep, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations.\n */\n return typed(name, {\n 'number, number': combinationsNumber,\n\n 'BigNumber, BigNumber': function (n, k) {\n const BigNumber = n.constructor\n let result, i\n const nMinusk = n.minus(k)\n const one = new BigNumber(1)\n\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinations')\n }\n if (k.gt(n)) {\n throw new TypeError('k must be less than n in function combinations')\n }\n\n result = one\n if (k.lt(nMinusk)) {\n for (i = one; i.lte(nMinusk); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i)\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusk.plus(i)).dividedBy(i)\n }\n }\n\n return result\n }\n\n // TODO: implement support for collection in combinations\n })\n})\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger (n) {\n return n.isInteger() && n.gte(0)\n}\n","import { factory } from '../../utils/factory.js'\nimport { isInteger } from '../../utils/number.js'\nimport { product } from '../../utils/product.js'\n\nconst name = 'combinationsWithRep'\nconst dependencies = ['typed']\n\nexport const createCombinationsWithRep = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities, allowing individual outcomes to be repeated more than once.\n *\n * CombinationsWithRep only takes integer arguments.\n * The following condition must be enforced: k <= n + k -1.\n *\n * Syntax:\n *\n * math.combinationsWithRep(n, k)\n *\n * Examples:\n *\n * math.combinationsWithRep(7, 5) // returns 462\n *\n * See also:\n *\n * combinations, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations with replacement.\n */\n return typed(name, {\n 'number, number': function (n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep')\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep')\n }\n if (n < 1) {\n throw new TypeError('k must be less than or equal to n + k - 1')\n }\n\n if (k < n - 1) {\n const prodrange = product(n, n + k - 1)\n return prodrange / product(1, k)\n }\n const prodrange = product(k + 1, n + k - 1)\n return prodrange / product(1, n - 1)\n },\n\n 'BigNumber, BigNumber': function (n, k) {\n const BigNumber = n.constructor\n let result, i\n const one = new BigNumber(1)\n const nMinusOne = n.minus(one)\n\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep')\n }\n if (n.lt(one)) {\n throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep')\n }\n\n result = one\n if (k.lt(nMinusOne)) {\n for (i = one; i.lte(nMinusOne); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i)\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusOne.plus(i)).dividedBy(i)\n }\n }\n\n return result\n }\n })\n})\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger (n) {\n return n.isInteger() && n.gte(0)\n}\n","/* eslint-disable no-loss-of-precision */\n\nimport { isInteger } from '../../utils/number.js'\nimport { product } from '../../utils/product.js'\n\nexport function gammaNumber (n) {\n let x\n\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN\n }\n\n if (n > 171) {\n return Infinity // Will overflow\n }\n\n return product(1, n - 1)\n }\n\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n))\n }\n\n if (n >= 171.35) {\n return Infinity // will overflow\n }\n\n if (n > 85.0) { // Extended Stirling Approx\n const twoN = n * n\n const threeN = twoN * n\n const fourN = threeN * n\n const fiveN = fourN * n\n return Math.sqrt(2 * Math.PI / n) * Math.pow((n / Math.E), n) *\n (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) -\n 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) +\n 5246819 / (75246796800 * fiveN * n))\n }\n\n --n\n x = gammaP[0]\n for (let i = 1; i < gammaP.length; ++i) {\n x += gammaP[i] / (n + i)\n }\n\n const t = n + gammaG + 0.5\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x\n}\ngammaNumber.signature = 'number'\n\n// TODO: comment on the variables g and p\n\nexport const gammaG = 4.7421875\n\nexport const gammaP = [\n 0.99999999999999709182,\n 57.156235665862923517,\n -59.597960355475491248,\n 14.136097974741747174,\n -0.49191381609762019978,\n 0.33994649984811888699e-4,\n 0.46523628927048575665e-4,\n -0.98374475304879564677e-4,\n 0.15808870322491248884e-3,\n -0.21026444172410488319e-3,\n 0.21743961811521264320e-3,\n -0.16431810653676389022e-3,\n 0.84418223983852743293e-4,\n -0.26190838401581408670e-4,\n 0.36899182659531622704e-5\n]\n\n// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code\n\n// log(2 * pi) / 2\nexport const lnSqrt2PI = 0.91893853320467274178\n\nexport const lgammaG = 5 // Lanczos parameter \"g\"\nexport const lgammaN = 7 // Range of coefficients \"n\"\n\nexport const lgammaSeries = [\n 1.000000000190015,\n 76.18009172947146,\n -86.50532032941677,\n 24.01409824083091,\n -1.231739572450155,\n 0.1208650973866179e-2,\n -0.5395239384953e-5\n]\n\nexport function lgammaNumber (n) {\n if (n < 0) return NaN\n if (n === 0) return Infinity\n if (!isFinite(n)) return n\n\n if (n < 0.5) {\n // Use Euler's reflection formula:\n // gamma(z) = PI / (sin(PI * z) * gamma(1 - z))\n return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n)\n }\n\n // Compute the logarithm of the Gamma function using the Lanczos method\n\n n = n - 1\n const base = n + lgammaG + 0.5 // Base of the Lanczos exponential\n let sum = lgammaSeries[0]\n\n // We start with the terms that have the smallest coefficients and largest denominator\n for (let i = lgammaN - 1; i >= 1; i--) {\n sum += lgammaSeries[i] / (n + i)\n }\n\n return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum)\n}\nlgammaNumber.signature = 'number'\n","import { factory } from '../../utils/factory.js'\nimport { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js'\n\nconst name = 'gamma'\nconst dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex']\n\nexport const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, multiplyScalar, pow, BigNumber, Complex }) => {\n /**\n * Compute the gamma function of a value using Lanczos approximation for\n * small values, and an extended Stirling approximation for large values.\n *\n * To avoid confusion with the matrix Gamma function, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.gamma(n)\n *\n * Examples:\n *\n * math.gamma(5) // returns 24\n * math.gamma(-0.5) // returns -3.5449077018110335\n * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i\n *\n * See also:\n *\n * combinations, factorial, permutations\n *\n * @param {number | BigNumber | Complex} n A real or complex number\n * @return {number | BigNumber | Complex} The gamma of `n`\n */\n\n function gammaComplex (n) {\n if (n.im === 0) {\n return gammaNumber(n.re)\n }\n\n // Lanczos approximation doesn't work well with real part lower than 0.5\n // So reflection formula is required\n if (n.re < 0.5) { // Euler's reflection formula\n // gamma(1-z) * gamma(z) = PI / sin(PI * z)\n // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined]\n // thanks to imperfect sin implementation sin(PI * n) != 0\n // we can safely use it anyway\n const t = new Complex(1 - n.re, -n.im)\n const r = new Complex(Math.PI * n.re, Math.PI * n.im)\n\n return new Complex(Math.PI).div(r.sin()).div(gammaComplex(t))\n }\n\n // Lanczos approximation\n // z -= 1\n n = new Complex(n.re - 1, n.im)\n\n // x = gammaPval[0]\n let x = new Complex(gammaP[0], 0)\n // for (i, gammaPval) in enumerate(gammaP):\n for (let i = 1; i < gammaP.length; ++i) {\n // x += gammaPval / (z + i)\n const gammaPval = new Complex(gammaP[i], 0)\n x = x.add(gammaPval.div(n.add(i)))\n }\n // t = z + gammaG + 0.5\n const t = new Complex(n.re + gammaG + 0.5, n.im)\n\n // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x\n const twoPiSqrt = Math.sqrt(2 * Math.PI)\n const tpow = t.pow(n.add(0.5))\n const expt = t.neg().exp()\n\n // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)]\n return x.mul(twoPiSqrt).mul(tpow).mul(expt)\n }\n\n return typed(name, {\n number: gammaNumber,\n Complex: gammaComplex,\n BigNumber: function (n) {\n if (n.isInteger()) {\n return (n.isNegative() || n.isZero())\n ? new BigNumber(Infinity)\n : bigFactorial(n.minus(1))\n }\n\n if (!n.isFinite()) {\n return new BigNumber(n.isNegative() ? NaN : Infinity)\n }\n\n throw new Error('Integer BigNumber expected')\n }\n })\n\n /**\n * Calculate factorial for a BigNumber\n * @param {BigNumber} n\n * @returns {BigNumber} Returns the factorial of n\n */\n function bigFactorial (n) {\n if (n < 8) {\n return new BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n])\n }\n\n const precision = config.precision + (Math.log(n.toNumber()) | 0)\n const Big = BigNumber.clone({ precision })\n\n if (n % 2 === 1) {\n return n.times(bigFactorial(new BigNumber(n - 1)))\n }\n\n let p = n\n let prod = new Big(n)\n let sum = n.toNumber()\n\n while (p > 2) {\n p -= 2\n sum += p\n prod = prod.times(sum)\n }\n\n return new BigNumber(prod.toPrecision(BigNumber.precision))\n }\n})\n","/* eslint-disable no-loss-of-precision */\n\n// References\n// ----------\n// [1] Hare, \"Computing the Principal Branch of log-Gamma\", Journal of Algorithms, 1997.\n// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments\n\nimport { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js'\nimport { factory } from '../../utils/factory.js'\nimport { copysign } from '../../utils/number.js'\n\nconst name = 'lgamma'\nconst dependencies = ['Complex', 'typed']\n\nexport const createLgamma = /* #__PURE__ */ factory(name, dependencies, ({ Complex, typed }) => {\n // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get\n // sufficient accuracy.\n //\n // These two values are copied from Scipy implementation:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37\n const SMALL_RE = 7\n const SMALL_IM = 7\n\n /**\n * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1].\n *\n * If you cannot access the paper, can also get these values from the formula in [2].\n *\n * 1 / 12 = 0.00833333333333333333333333333333\n * 1 / 360 = 0.00277777777777777777777777777778\n * ...\n * 3617 / 133400 = 0.02955065359477124183006535947712\n */\n const coeffs = [\n -2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4,\n -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2\n ]\n\n /**\n * Logarithm of the gamma function for real, positive numbers and complex numbers,\n * using Lanczos approximation for numbers and Stirling series for complex numbers.\n *\n * Syntax:\n *\n * math.lgamma(n)\n *\n * Examples:\n *\n * math.lgamma(5) // returns 3.178053830347945\n * math.lgamma(0) // returns Infinity\n * math.lgamma(-0.5) // returns NaN\n * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i\n *\n * See also:\n *\n * gamma\n *\n * @param {number | Complex} n A real or complex number\n * @return {number | Complex} The log gamma of `n`\n */\n return typed(name, {\n number: lgammaNumber,\n Complex: lgammaComplex,\n BigNumber: function () {\n throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\")\n }\n })\n\n function lgammaComplex (n) {\n const TWOPI = 6.2831853071795864769252842 // 2*pi\n const LOGPI = 1.1447298858494001741434262 // log(pi)\n\n const REFLECTION = 0.1\n\n if (n.isNaN()) {\n return new Complex(NaN, NaN)\n } else if (n.im === 0) {\n return new Complex(lgammaNumber(n.re), 0)\n } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {\n return lgammaStirling(n)\n } else if (n.re <= REFLECTION) {\n // Reflection formula. see Proposition 3.1 in [1]\n const tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25)\n const a = n.mul(Math.PI).sin().log()\n const b = lgammaComplex(new Complex(1 - n.re, -n.im))\n return new Complex(LOGPI, tmp).sub(a).sub(b)\n } else if (n.im >= 0) {\n return lgammaRecurrence(n)\n } else {\n return lgammaRecurrence(n.conjugate()).conjugate()\n }\n }\n\n function lgammaStirling (z) {\n // formula ref in [2]\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101\n\n // left part\n\n // x (log(x) - 1) + 1/2 (log(2PI) - log(x))\n // => (x - 0.5) * log(x) - x + log(2PI) / 2\n const leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI)\n\n // right part\n\n const rz = new Complex(1, 0).div(z)\n const rzz = rz.div(z)\n\n let a = coeffs[0]\n let b = coeffs[1]\n const r = 2 * rzz.re\n const s = rzz.re * rzz.re + rzz.im * rzz.im\n\n for (let i = 2; i < 8; i++) {\n const tmp = b\n b = -s * a + coeffs[i]\n a = r * a + tmp\n }\n\n const rightPart = rz.mul(rzz.mul(a).add(b))\n\n // plus left and right\n\n return leftPart.add(rightPart)\n }\n\n function lgammaRecurrence (z) {\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78\n\n let signflips = 0\n let sb = 0\n let shiftprod = z\n\n z = z.add(1)\n while (z.re <= SMALL_RE) {\n shiftprod = shiftprod.mul(z)\n\n const nsb = shiftprod.im < 0 ? 1 : 0\n if (nsb !== 0 && sb === 0) signflips++\n sb = nsb\n\n z = z.add(1)\n }\n\n return lgammaStirling(z)\n .sub(shiftprod.log())\n .sub(new Complex(0, signflips * 2 * Math.PI * 1))\n }\n})\n","import { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'factorial'\nconst dependencies = ['typed', 'gamma']\n\nexport const createFactorial = /* #__PURE__ */ factory(name, dependencies, ({ typed, gamma }) => {\n /**\n * Compute the factorial of a value\n *\n * Factorial only supports an integer value as argument.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.factorial(n)\n *\n * Examples:\n *\n * math.factorial(5) // returns 120\n * math.factorial(3) // returns 6\n *\n * See also:\n *\n * combinations, combinationsWithRep, gamma, permutations\n *\n * @param {number | BigNumber | Array | Matrix} n An integer number\n * @return {number | BigNumber | Array | Matrix} The factorial of `n`\n */\n return typed(name, {\n number: function (n) {\n if (n < 0) {\n throw new Error('Value must be non-negative')\n }\n\n return gamma(n + 1)\n },\n\n BigNumber: function (n) {\n if (n.isNegative()) {\n throw new Error('Value must be non-negative')\n }\n\n return gamma(n.plus(1))\n },\n\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'kldivergence'\nconst dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric']\n\nexport const createKldivergence = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, divide, sum, multiply, map, dotDivide, log, isNumeric }) => {\n /**\n * Calculate the Kullback-Leibler (KL) divergence between two distributions\n *\n * Syntax:\n *\n * math.kldivergence(x, y)\n *\n * Examples:\n *\n * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153\n *\n *\n * @param {Array | Matrix} q First vector\n * @param {Array | Matrix} p Second vector\n * @return {number} Returns distance between q and p\n */\n return typed(name, {\n 'Array, Array': function (q, p) {\n return _kldiv(matrix(q), matrix(p))\n },\n\n 'Matrix, Array': function (q, p) {\n return _kldiv(q, matrix(p))\n },\n\n 'Array, Matrix': function (q, p) {\n return _kldiv(matrix(q), p)\n },\n\n 'Matrix, Matrix': function (q, p) {\n return _kldiv(q, p)\n }\n\n })\n\n function _kldiv (q, p) {\n const plength = p.size().length\n const qlength = q.size().length\n if (plength > 1) {\n throw new Error('first object must be one dimensional')\n }\n\n if (qlength > 1) {\n throw new Error('second object must be one dimensional')\n }\n\n if (plength !== qlength) {\n throw new Error('Length of two vectors must be equal')\n }\n\n // Before calculation, apply normalization\n const sumq = sum(q)\n if (sumq === 0) {\n throw new Error('Sum of elements in first object must be non zero')\n }\n\n const sump = sum(p)\n if (sump === 0) {\n throw new Error('Sum of elements in second object must be non zero')\n }\n const qnorm = divide(q, sum(q))\n const pnorm = divide(p, sum(p))\n\n const result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x))))\n if (isNumeric(result)) {\n return result\n } else {\n return Number.NaN\n }\n }\n})\n","import { deepForEach } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'multinomial'\nconst dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive']\n\nexport const createMultinomial = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, divide, multiply, factorial, isInteger, isPositive }) => {\n /**\n * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities.\n *\n * multinomial takes one array of integers as an argument.\n * The following condition must be enforced: every ai <= 0\n *\n * Syntax:\n *\n * math.multinomial(a) // a is an array type\n *\n * Examples:\n *\n * math.multinomial([1,2,1]) // returns 12\n *\n * See also:\n *\n * combinations, factorial\n *\n * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset\n * @return {Number | BigNumber} Multinomial coefficient.\n */\n return typed(name, {\n 'Array | Matrix': function (a) {\n let sum = 0\n let denom = 1\n\n deepForEach(a, function (ai) {\n if (!isInteger(ai) || !isPositive(ai)) {\n throw new TypeError('Positive integer value expected in function multinomial')\n }\n sum = add(sum, ai)\n denom = multiply(denom, factorial(ai))\n })\n\n return divide(factorial(sum), denom)\n }\n })\n})\n","import { isInteger } from '../../utils/number.js'\nimport { product } from '../../utils/product.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'permutations'\nconst dependencies = ['typed', 'factorial']\n\nexport const createPermutations = /* #__PURE__ */ factory(name, dependencies, ({ typed, factorial }) => {\n /**\n * Compute the number of ways of obtaining an ordered subset of `k` elements\n * from a set of `n` elements.\n *\n * Permutations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.permutations(n)\n * math.permutations(n, k)\n *\n * Examples:\n *\n * math.permutations(5) // 120\n * math.permutations(5, 3) // 60\n *\n * See also:\n *\n * combinations, combinationsWithRep, factorial\n *\n * @param {number | BigNumber} n The number of objects in total\n * @param {number | BigNumber} [k] The number of objects in the subset\n * @return {number | BigNumber} The number of permutations\n */\n return typed(name, {\n 'number | BigNumber': factorial,\n 'number, number': function (n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function permutations')\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function permutations')\n }\n if (k > n) {\n throw new TypeError('second argument k must be less than or equal to first argument n')\n }\n // Permute n objects, k at a time\n return product((n - k) + 1, n)\n },\n\n 'BigNumber, BigNumber': function (n, k) {\n let result, i\n\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function permutations')\n }\n if (k.gt(n)) {\n throw new TypeError('second argument k must be less than or equal to first argument n')\n }\n\n const one = n.mul(0).add(1)\n result = one\n for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) {\n result = result.times(i)\n }\n\n return result\n }\n\n // TODO: implement support for collection in permutations\n })\n})\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger (n) {\n return n.isInteger() && n.gte(0)\n}\n","import seedrandom from 'seedrandom'\n\nconst singletonRandom = /* #__PURE__ */ seedrandom(Date.now())\n\nexport function createRng (randomSeed) {\n let random\n\n // create a new random generator with given seed\n function setSeed (seed) {\n random = seed === null ? singletonRandom : seedrandom(String(seed))\n }\n\n // initialize a seeded pseudo random number generator with config's random seed\n setSeed(randomSeed)\n\n // wrapper function so the rng can be updated via generator\n function rng () {\n return random()\n }\n\n return rng\n}\n","import { flatten } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\nimport { isMatrix, isNumber } from '../../utils/is.js'\nimport { createRng } from './util/seededRNG.js'\n\nconst name = 'pickRandom'\nconst dependencies = ['typed', 'config', '?on']\n\nexport const createPickRandom = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, on }) => {\n // seeded pseudo random number generator\n let rng = createRng(config.randomSeed)\n\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed)\n }\n })\n }\n\n /**\n * Random pick one or more values from a one dimensional array.\n * Array elements are picked using a random function with uniform or weighted distribution.\n *\n * Syntax:\n *\n * math.pickRandom(array)\n * math.pickRandom(array, number)\n * math.pickRandom(array, weights)\n * math.pickRandom(array, number, weights)\n * math.pickRandom(array, weights, number)\n * math.pickRandom(array, { weights, number, elementWise })\n *\n * Examples:\n *\n * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array\n * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution\n *\n * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false })\n * // returns one of the items in the array\n *\n * See also:\n *\n * random, randomInt\n *\n * @param {Array | Matrix} array A one dimensional array\n * @param {Int} number An int or float\n * @param {Array | Matrix} weights An array of ints or floats\n * @return {number | Array} Returns a single random value from array when number is undefined.\n * Returns an array with the configured number of elements when number is defined.\n */\n return typed(name, {\n 'Array | Matrix': function (possibles) {\n return _pickRandom(possibles, {})\n },\n\n 'Array | Matrix, Object': function (possibles, options) {\n return _pickRandom(possibles, options)\n },\n\n 'Array | Matrix, number': function (possibles, number) {\n return _pickRandom(possibles, { number })\n },\n\n 'Array | Matrix, Array | Matrix': function (possibles, weights) {\n return _pickRandom(possibles, { weights })\n },\n\n 'Array | Matrix, Array | Matrix, number': function (possibles, weights, number) {\n return _pickRandom(possibles, { number, weights })\n },\n\n 'Array | Matrix, number, Array | Matrix': function (possibles, number, weights) {\n return _pickRandom(possibles, { number, weights })\n }\n })\n\n /**\n * @param {Array | Matrix} possibles\n * @param {{\n * number?: number,\n * weights?: Array | Matrix,\n * elementWise: boolean\n * }} options\n * @returns {number | Array}\n * @private\n */\n function _pickRandom (possibles, { number, weights, elementWise = true }) {\n const single = (typeof number === 'undefined')\n if (single) {\n number = 1\n }\n\n const createMatrix = isMatrix(possibles)\n ? possibles.create\n : isMatrix(weights)\n ? weights.create\n : null\n\n possibles = possibles.valueOf() // get Array\n if (weights) {\n weights = weights.valueOf() // get Array\n }\n\n if (elementWise === true) {\n possibles = flatten(possibles)\n weights = flatten(weights)\n }\n\n let totalWeights = 0\n\n if (typeof weights !== 'undefined') {\n if (weights.length !== possibles.length) {\n throw new Error('Weights must have the same length as possibles')\n }\n\n for (let i = 0, len = weights.length; i < len; i++) {\n if (!isNumber(weights[i]) || weights[i] < 0) {\n throw new Error('Weights must be an array of positive numbers')\n }\n\n totalWeights += weights[i]\n }\n }\n\n const length = possibles.length\n\n const result = []\n let pick\n\n while (result.length < number) {\n if (typeof weights === 'undefined') {\n pick = possibles[Math.floor(rng() * length)]\n } else {\n let randKey = rng() * totalWeights\n\n for (let i = 0, len = possibles.length; i < len; i++) {\n randKey -= weights[i]\n\n if (randKey < 0) {\n pick = possibles[i]\n break\n }\n }\n }\n\n result.push(pick)\n }\n\n return single\n ? result[0]\n : createMatrix\n ? createMatrix(result)\n : result\n }\n})\n","/**\n * This is a util function for generating a random matrix recursively.\n * @param {number[]} size\n * @param {function} random\n * @returns {Array}\n */\nexport function randomMatrix (size, random) {\n const data = []\n size = size.slice(0)\n\n if (size.length > 1) {\n for (let i = 0, length = size.shift(); i < length; i++) {\n data.push(randomMatrix(size, random))\n }\n } else {\n for (let i = 0, length = size.shift(); i < length; i++) {\n data.push(random())\n }\n }\n\n return data\n}\n","import { factory } from '../../utils/factory.js'\nimport { isMatrix } from '../../utils/is.js'\nimport { createRng } from './util/seededRNG.js'\nimport { randomMatrix } from './util/randomMatrix.js'\n\nconst name = 'random'\nconst dependencies = ['typed', 'config', '?on']\n\nexport const createRandom = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, on }) => {\n // seeded pseudo random number generator\n let rng = createRng(config.randomSeed)\n\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed)\n }\n })\n }\n\n /**\n * Return a random number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.random() // generate a random number between 0 and 1\n * math.random(max) // generate a random number between 0 and max\n * math.random(min, max) // generate a random number between min and max\n * math.random(size) // generate a matrix with random numbers between 0 and 1\n * math.random(size, max) // generate a matrix with random numbers between 0 and max\n * math.random(size, min, max) // generate a matrix with random numbers between min and max\n *\n * Examples:\n *\n * math.random() // returns a random number between 0 and 1\n * math.random(100) // returns a random number between 0 and 100\n * math.random(30, 40) // returns a random number between 30 and 40\n * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1\n *\n * See also:\n *\n * randomInt, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random number\n */\n return typed(name, {\n '': () => _random(0, 1),\n number: (max) => _random(0, max),\n 'number, number': (min, max) => _random(min, max),\n 'Array | Matrix': (size) => _randomMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max)\n })\n\n function _randomMatrix (size, min, max) {\n const res = randomMatrix(size.valueOf(), () => _random(min, max))\n return isMatrix(size) ? size.create(res, 'number') : res\n }\n\n function _random (min, max) {\n return min + rng() * (max - min)\n }\n})\n\n// number only implementation of random, no matrix support\n// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?\nexport const createRandomNumber = /* #__PURE__ */ factory(name, ['typed', 'config', '?on'], ({ typed, config, on, matrix }) => {\n // seeded pseudo random number generator1\n let rng = createRng(config.randomSeed)\n\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed)\n }\n })\n }\n\n return typed(name, {\n '': () => _random(0, 1),\n number: (max) => _random(0, max),\n 'number, number': (min, max) => _random(min, max)\n })\n\n function _random (min, max) {\n return min + rng() * (max - min)\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { randomMatrix } from './util/randomMatrix.js'\nimport { createRng } from './util/seededRNG.js'\nimport { isMatrix } from '../../utils/is.js'\n\nconst name = 'randomInt'\nconst dependencies = ['typed', 'config', '?on']\n\nexport const createRandomInt = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, on }) => {\n // seeded pseudo random number generator\n let rng = createRng(config.randomSeed)\n\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed)\n }\n })\n }\n\n /**\n * Return a random integer number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.randomInt() // generate a random integer between 0 and 1\n * math.randomInt(max) // generate a random integer between 0 and max\n * math.randomInt(min, max) // generate a random integer between min and max\n * math.randomInt(size) // generate a matrix with random integer between 0 and 1\n * math.randomInt(size, max) // generate a matrix with random integer between 0 and max\n * math.randomInt(size, min, max) // generate a matrix with random integer between min and max\n *\n * Examples:\n *\n * math.randomInt(100) // returns a random integer between 0 and 100\n * math.randomInt(30, 40) // returns a random integer between 30 and 40\n * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1\n *\n * See also:\n *\n * random, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random integer value\n */\n return typed(name, {\n '': () => _randomInt(0, 1),\n number: (max) => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n 'Array | Matrix': (size) => _randomIntMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max)\n })\n\n function _randomIntMatrix (size, min, max) {\n const res = randomMatrix(size.valueOf(), () => _randomInt(min, max))\n return isMatrix(size) ? size.create(res, 'number') : res\n }\n\n function _randomInt (min, max) {\n return Math.floor(min + rng() * (max - min))\n }\n})\n","import { factory } from '../../utils/factory.js'\nimport { isNumber } from '../../utils/is.js'\n\nconst name = 'stirlingS2'\nconst dependencies = [\n 'typed',\n 'addScalar',\n 'subtractScalar',\n 'multiplyScalar',\n 'divideScalar',\n 'pow',\n 'factorial',\n 'combinations',\n 'isNegative',\n 'isInteger',\n 'number',\n '?bignumber',\n 'larger'\n]\n\nexport const createStirlingS2 = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n factorial,\n combinations,\n isNegative,\n isInteger,\n number,\n bignumber,\n larger\n }\n) => {\n const smallCache = []\n const bigCache = []\n /**\n * The Stirling numbers of the second kind, counts the number of ways to partition\n * a set of n labelled objects into k nonempty unlabelled subsets.\n * stirlingS2 only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * If n = k or k = 1 <= n, then s(n,k) = 1\n * If k = 0 < n, then s(n,k) = 0\n *\n * Note that if either n or k is supplied as a BigNumber, the result will be\n * as well.\n *\n * Syntax:\n *\n * math.stirlingS2(n, k)\n *\n * Examples:\n *\n * math.stirlingS2(5, 3) //returns 25\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} S(n,k)\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function (n, k) {\n if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) {\n throw new TypeError('Non-negative integer value expected in function stirlingS2')\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function stirlingS2')\n }\n\n const big = !(isNumber(n) && isNumber(k))\n const cache = big ? bigCache : smallCache\n const make = big ? bignumber : number\n const nn = number(n)\n const nk = number(k)\n /* See if we already have the value: */\n if (cache[nn] && cache[nn].length > nk) {\n return cache[nn][nk]\n }\n /* Fill the cache */\n for (let m = 0; m <= nn; ++m) {\n if (!cache[m]) {\n cache[m] = [m === 0 ? make(1) : make(0)]\n }\n if (m === 0) continue\n const row = cache[m]\n const prev = cache[m - 1]\n for (let i = row.length; i <= m && i <= nk; ++i) {\n if (i === m) {\n row[i] = 1\n } else {\n row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1])\n }\n }\n }\n return cache[nn][nk]\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'bellNumbers'\nconst dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2']\n\nexport const createBellNumbers = /* #__PURE__ */ factory(name, dependencies, ({ typed, addScalar, isNegative, isInteger, stirlingS2 }) => {\n /**\n * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.\n * bellNumbers only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.bellNumbers(n)\n *\n * Examples:\n *\n * math.bellNumbers(3) // returns 5\n * math.bellNumbers(8) // returns 4140\n *\n * See also:\n *\n * stirlingS2\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @return {Number | BigNumber} B(n)\n */\n return typed(name, {\n 'number | BigNumber': function (n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function bellNumbers')\n }\n\n // Sum (k=0, n) S(n,k).\n let result = 0\n for (let i = 0; i <= n; i++) {\n result = addScalar(result, stirlingS2(n, i))\n }\n\n return result\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'catalan'\nconst dependencies = [\n 'typed',\n 'addScalar',\n 'divideScalar',\n 'multiplyScalar',\n 'combinations',\n 'isNegative',\n 'isInteger'\n]\n\nexport const createCatalan = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n addScalar,\n divideScalar,\n multiplyScalar,\n combinations,\n isNegative,\n isInteger\n }\n) => {\n /**\n * The Catalan Numbers enumerate combinatorial structures of many different types.\n * catalan only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.catalan(n)\n *\n * Examples:\n *\n * math.catalan(3) // returns 5\n * math.catalan(8) // returns 1430\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n nth Catalan number\n * @return {Number | BigNumber} Cn(n)\n */\n return typed(name, {\n 'number | BigNumber': function (n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function catalan')\n }\n\n return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1))\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'composition'\nconst dependencies = [\n 'typed',\n 'addScalar',\n 'combinations',\n 'isNegative',\n 'isPositive',\n 'isInteger',\n 'larger'\n]\n\nexport const createComposition = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n addScalar,\n combinations,\n isPositive,\n isNegative,\n isInteger,\n larger\n }\n) => {\n /**\n * The composition counts of n into k parts.\n *\n * composition only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.composition(n, k)\n *\n * Examples:\n *\n * math.composition(5, 3) // returns 6\n *\n * See also:\n *\n * combinations\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} Returns the composition counts of n into k parts.\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function (n, k) {\n if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) {\n throw new TypeError('Positive integer value expected in function composition')\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function composition')\n }\n\n return combinations(addScalar(n, -1), addScalar(k, -1))\n }\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'leafCount'\nconst dependencies = [\n 'parse',\n 'typed'\n]\n\nexport const createLeafCount = /* #__PURE__ */ factory(name, dependencies, ({\n parse,\n typed\n}) => {\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves (node) {\n let count = 0\n node.forEach(n => { count += countLeaves(n) })\n return count || 1\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function (expr) {\n return countLeaves(expr)\n }\n })\n})\n","import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js'\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js'\n\nexport function isNumericNode (x) {\n return isConstantNode(x) || (isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]))\n}\n\nexport function isConstantExpression (x) {\n if (isConstantNode(x)) { // Basic Constant types\n return true\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) { // Can be constant depending on arguments\n return true\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) { // Parenthesis are transparent\n return true\n }\n return false // Probably missing some edge cases\n}\n","import { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js'\nimport { factory } from '../../../utils/factory.js'\nimport { hasOwnProperty } from '../../../utils/object.js'\n\nconst name = 'simplifyUtil'\nconst dependencies = [\n 'FunctionNode',\n 'OperatorNode',\n 'SymbolNode'\n]\n\nexport const createUtil = /* #__PURE__ */ factory(name, dependencies, ({ FunctionNode, OperatorNode, SymbolNode }) => {\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n const T = true\n const F = false\n\n const defaultName = 'defaultF'\n const defaultContext = {\n /* */ add: { trivial: T, total: T, commutative: T, associative: T },\n /**/ unaryPlus: { trivial: T, total: T, commutative: T, associative: T },\n /* */ subtract: { trivial: F, total: T, commutative: F, associative: F },\n /* */ multiply: { trivial: T, total: T, commutative: T, associative: T },\n /* */ divide: { trivial: F, total: T, commutative: F, associative: F },\n /* */ paren: { trivial: T, total: T, commutative: T, associative: F },\n /* */ defaultF: { trivial: F, total: T, commutative: F, associative: F }\n }\n const realContext = { divide: { total: F }, log: { total: F } }\n const positiveContext = {\n subtract: { total: F },\n abs: { trivial: T },\n log: { total: T }\n }\n\n function hasProperty (nodeOrName, property, context = defaultContext) {\n let name = defaultName\n if (typeof nodeOrName === 'string') {\n name = nodeOrName\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString()\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren'\n }\n if (hasOwnProperty(context, name)) {\n const properties = context[name]\n if (hasOwnProperty(properties, property)) {\n return properties[property]\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property]\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n const properties = context[defaultName]\n if (hasOwnProperty(properties, property)) {\n return properties[property]\n }\n return defaultContext[defaultName][property]\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n const properties = defaultContext[name]\n if (hasOwnProperty(properties, property)) {\n return properties[property]\n }\n }\n return defaultContext[defaultName][property]\n }\n\n function isCommutative (node, context = defaultContext) {\n return hasProperty(node, 'commutative', context)\n }\n\n function isAssociative (node, context = defaultContext) {\n return hasProperty(node, 'associative', context)\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext (primary, secondary) {\n const merged = { ...primary }\n for (const prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = { ...secondary[prop], ...primary[prop] }\n } else {\n merged[prop] = secondary[prop]\n }\n }\n return merged\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten (node, context) {\n if (!node.args || node.args.length === 0) {\n return node\n }\n node.args = allChildren(node, context)\n for (let i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context)\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren (node, context) {\n let op\n const children = []\n const findChildren = function (node) {\n for (let i = 0; i < node.args.length; i++) {\n const child = node.args[i]\n if (isOperatorNode(child) && op === child.op) {\n findChildren(child)\n } else {\n children.push(child)\n }\n }\n }\n\n if (isAssociative(node, context)) {\n op = node.op\n findChildren(node)\n return children\n } else {\n return node.args\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr (node, context) {\n if (!node.args || node.args.length === 0) {\n return\n }\n const makeNode = createMakeNodeFunction(node)\n const l = node.args.length\n for (let i = 0; i < l; i++) {\n unflattenr(node.args[i], context)\n }\n if (l > 2 && isAssociative(node, context)) {\n let curnode = node.args.pop()\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode])\n }\n node.args = curnode.args\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl (node, context) {\n if (!node.args || node.args.length === 0) {\n return\n }\n const makeNode = createMakeNodeFunction(node)\n const l = node.args.length\n for (let i = 0; i < l; i++) {\n unflattenl(node.args[i], context)\n }\n if (l > 2 && isAssociative(node, context)) {\n let curnode = node.args.shift()\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()])\n }\n node.args = curnode.args\n }\n }\n\n function createMakeNodeFunction (node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit)\n } catch (err) {\n console.error(err)\n return []\n }\n }\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args)\n }\n }\n }\n\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n }\n})\n","import { isParenthesisNode } from '../../utils/is.js'\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js'\nimport { factory } from '../../utils/factory.js'\nimport { createUtil } from './simplify/util.js'\nimport { hasOwnProperty } from '../../utils/object.js'\nimport { createEmptyMap, createMap } from '../../utils/map.js'\n\nconst name = 'simplify'\nconst dependencies = [\n 'config',\n 'typed',\n 'parse',\n 'add',\n 'subtract',\n 'multiply',\n 'divide',\n 'pow',\n 'isZero',\n 'equal',\n 'resolve',\n 'simplifyConstant',\n 'simplifyCore',\n '?fraction',\n '?bignumber',\n 'mathWithTransform',\n 'matrix',\n 'AccessorNode',\n 'ArrayNode',\n 'ConstantNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'ParenthesisNode',\n 'SymbolNode'\n]\n\nexport const createSimplify = /* #__PURE__ */ factory(name, dependencies, (\n {\n config,\n typed,\n parse,\n add,\n subtract,\n multiply,\n divide,\n pow,\n isZero,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n }\n) => {\n const { hasProperty, isCommutative, isAssociative, mergeContext, flatten, unflattenr, unflattenl, createMakeNodeFunction, defaultContext, realContext, positiveContext } =\n createUtil({ FunctionNode, OperatorNode, SymbolNode })\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or √3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or √3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({ from: 'Object', to: 'Map', convert: createMap })\n const simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object':\n (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n })\n typed.removeConversion({ from: 'Object', to: 'Map', convert: createMap })\n\n simplify.defaultContext = defaultContext\n simplify.realContext = realContext\n simplify.positiveContext = positiveContext\n\n function removeParens (node) {\n return node.transform(function (node, path, parent) {\n return isParenthesisNode(node)\n ? removeParens(node.content)\n : node\n })\n }\n\n // All constants that are allowed in rules\n const SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n }\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [\n simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n { l: 'log(e)', r: '1' },\n\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1', // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: { subtract: { total: true } }\n },\n {\n s: 'n-n -> 0', // partial alternative when we can't always subtract\n assuming: { subtract: { total: false } }\n },\n {\n s: '-(cl*v) -> v * (-cl)', // make non-constant terms positive\n assuming: { multiply: { commutative: true }, subtract: { total: true } }\n },\n {\n s: '-(cl*v) -> (-cl) * v', // non-commutative version, part 1\n assuming: { multiply: { commutative: false }, subtract: { total: true } }\n },\n {\n s: '-(v*cl) -> v * (-cl)', // non-commutative version, part 2\n assuming: { multiply: { commutative: false }, subtract: { total: true } }\n },\n { l: '-(n1/n2)', r: '-n1/n2' },\n { l: '-v', r: 'v * (-1)' }, // finish making non-constant terms positive\n { l: '(n1 + n2)*(-1)', r: 'n1*(-1) + n2*(-1)', repeat: true }, // expand negations to achieve as much sign cancellation as possible\n { l: 'n/n1^n2', r: 'n*n1^-n2' }, // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n { l: 'n/n1', r: 'n*n1^-1' },\n {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: { multiply: { commutative: true } }\n },\n {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: { multiply: { commutative: false } }\n },\n\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: { divide: { total: true } } // 1/(1/n) = n needs 1/n to exist\n },\n\n // collect like factors; into a sum, only do this for nonconstants\n { l: ' vd * ( vd * n1 + n2)', r: 'vd^2 * n1 + vd * n2' },\n {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: { divide: { total: true } } // v*1/v = v^(1+-1) needs 1/v\n },\n {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: { divide: { total: true } }\n },\n {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: { divide: { total: true } }\n },\n { l: 'n*n', r: 'n^2' },\n {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: { divide: { total: true } } // n*1/n = n^(-1+1) needs 1/n\n },\n {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: { divide: { total: true } } // ditto for n^2*1/n^2\n },\n\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant, // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: { add: { total: true } } // 2 = 1 + 1 needs to exist\n },\n { l: 'n+-n', r: '0' },\n { l: 'vd*n + vd', r: 'vd*(n+1)' }, // NOTE: leftmost position is special:\n { l: 'n3*n1 + n3*n2', r: 'n3*(n1+n2)' }, // All sub-monomials tried there.\n { l: 'n3^(-n4)*n1 + n3 * n2', r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)' },\n { l: 'n3^(-n4)*n1 + n3^n5 * n2', r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)' },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: { multiply: { commutative: false } }\n },\n {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: { multiply: { commutative: false } }\n },\n {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: { multiply: { commutative: false } }\n },\n {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: { divide: { total: true }, multiply: { commutative: false } }\n },\n {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: { multiply: { commutative: false } }\n },\n {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: { multiply: { commutative: false } }\n },\n { l: 'n*cd + cd', r: '(n+1)*cd' },\n {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: { multiply: { commutative: false } }\n },\n {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: { multiply: { commutative: false } }\n },\n simplifyConstant, // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: { subtract: { total: true } }\n },\n {\n s: 'n1*(-n) -> -(n1*n)', // in case * non-commutative\n assuming: { subtract: { total: true }, multiply: { commutative: false } }\n },\n\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: { add: { commutative: true } },\n imposeContext: { add: { commutative: false } }\n },\n {\n s: 'vd*cd -> cd*vd',\n assuming: { multiply: { commutative: true } },\n imposeContext: { multiply: { commutative: false } }\n },\n\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n { l: 'n+-n1', r: 'n-n1' }, // undo replace 'subtract'\n { l: 'n+-(n1)', r: 'n-(n1)' },\n {\n s: 'n*(n1^-1) -> n/n1', // undo replace 'divide'; for * commutative\n assuming: { multiply: { commutative: true } } // o.w. / not conventional\n },\n {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: { multiply: { commutative: true } } // o.w. / not conventional\n },\n {\n s: 'n^-1 -> 1/n',\n assuming: { multiply: { commutative: true } } // o.w. / not conventional\n },\n { l: 'n^1', r: 'n' }, // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2', // '*' before '/'\n assuming: { multiply: { associative: true } }\n },\n {\n s: 'n-(n1+n2) -> n-n1-n2', // '-' before '+'\n assuming: { addition: { associative: true, commutative: true } }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n { l: '1*n', r: 'n', imposeContext: { multiply: { commutative: true } } },\n\n {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: { multiply: { associative: true } }\n },\n\n { l: 'n1/(-n2)', r: '-n1/n2' }\n\n ]\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule (ruleObject, context) {\n const newRule = {}\n if (ruleObject.s) {\n const lr = ruleObject.s.split('->')\n if (lr.length === 2) {\n newRule.l = lr[0]\n newRule.r = lr[1]\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s)\n }\n } else {\n newRule.l = ruleObject.l\n newRule.r = ruleObject.r\n }\n newRule.l = removeParens(parse(newRule.l))\n newRule.r = removeParens(parse(newRule.r))\n for (const prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop]\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate)\n }\n\n if (isAssociative(newRule.l, context)) {\n const nonCommutative = !isCommutative(newRule.l, context)\n let leftExpandsym\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol()\n\n const makeNode = createMakeNodeFunction(newRule.l)\n const expandsym = _getExpandPlaceholderSymbol()\n newRule.expanded = {}\n newRule.expanded.l = makeNode([newRule.l, expandsym])\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context)\n unflattenr(newRule.expanded.l, context)\n newRule.expanded.r = makeNode([newRule.r, expandsym])\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {}\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l])\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r])\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {}\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l])\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r])\n }\n }\n\n return newRule\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules (rules, context) {\n // Array of rules to be used to simplify expressions\n const ruleSet = []\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i]\n let newRule\n const ruleType = typeof rule\n switch (ruleType) {\n case 'string':\n rule = { s: rule }\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context)\n break\n case 'function':\n newRule = rule\n break\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType)\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule)\n }\n return ruleSet\n }\n\n let _lastsym = 0\n function _getExpandPlaceholderSymbol () {\n return new SymbolNode('_p' + _lastsym++)\n }\n\n function _simplify (expr, rules, scope = createEmptyMap(), options = {}) {\n const debug = options.consoleDebug\n rules = _buildRules(rules || simplify.rules, options.context)\n let res = resolve(expr, scope)\n res = removeParens(res)\n const visited = {}\n let str = res.toString({ parenthesis: 'all' })\n while (!visited[str]) {\n visited[str] = true\n _lastsym = 0 // counter for placeholder symbols\n let laststr = str\n if (debug) console.log('Working on: ', str)\n for (let i = 0; i < rules.length; i++) {\n let rulestr = ''\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options)\n if (debug) rulestr = rules[i].name\n } else {\n flatten(res, options.context)\n res = applyRule(res, rules[i], options.context)\n if (debug) {\n rulestr = `${rules[i].l.toString()} -> ${rules[i].r.toString()}`\n }\n }\n if (debug) {\n const newstr = res.toString({ parenthesis: 'all' })\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr)\n laststr = newstr\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context)\n }\n str = res.toString({ parenthesis: 'all' })\n }\n return res\n }\n\n function mapRule (nodes, rule, context) {\n let resNodes = nodes\n if (nodes) {\n for (let i = 0; i < nodes.length; ++i) {\n const newNode = applyRule(nodes[i], rule, context)\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice()\n }\n resNodes[i] = newNode\n }\n }\n }\n return resNodes\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule (node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (const symbol in rule.assuming) {\n for (const property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !==\n rule.assuming[symbol][property]) {\n return node\n }\n }\n }\n }\n\n const mergedContext = mergeContext(rule.imposeContext, context)\n\n // Do not clone node unless we find a match\n let res = node\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n const newArgs = mapRule(res.args, rule, context)\n if (newArgs !== res.args) {\n res = res.clone()\n res.args = newArgs\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n const newContent = applyRule(res.content, rule, context)\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent)\n }\n }\n } else if (res instanceof ArrayNode) {\n const newItems = mapRule(res.items, rule, context)\n if (newItems !== res.items) {\n res = new ArrayNode(newItems)\n }\n } else if (res instanceof AccessorNode) {\n let newObj = res.object\n if (res.object) {\n newObj = applyRule(res.object, rule, context)\n }\n let newIndex = res.index\n if (res.index) {\n newIndex = applyRule(res.index, rule, context)\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex)\n }\n } else if (res instanceof IndexNode) {\n const newDims = mapRule(res.dimensions, rule, context)\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims)\n }\n } else if (res instanceof ObjectNode) {\n let changed = false\n const newProps = {}\n for (const prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context)\n if (newProps[prop] !== res.properties[prop]) {\n changed = true\n }\n }\n if (changed) {\n res = new ObjectNode(newProps)\n }\n }\n\n // Try to match a rule against this node\n let repl = rule.r\n let matches = _ruleMatch(rule.l, res, mergedContext)[0]\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0]\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0]\n if (!matches) { // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0]\n }\n }\n\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n const implicit = res.implicit\n res = repl.clone()\n if (implicit && 'implicit' in repl) {\n res.implicit = true\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone()\n } else {\n return node\n }\n })\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context)\n }\n\n return res\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits (node, context) {\n const res = []\n let right, rightArgs\n const makeNode = createMakeNodeFunction(node)\n if (isCommutative(node, context)) {\n for (let i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0)\n rightArgs.splice(i, 1)\n right = (rightArgs.length === 1) ? rightArgs[0] : makeNode(rightArgs)\n res.push(makeNode([node.args[i], right]))\n }\n } else {\n // Keep order, but try all parenthesizations\n for (let i = 1; i < node.args.length; i++) {\n let left = node.args[0]\n if (i > 1) {\n left = makeNode(node.args.slice(0, i))\n }\n rightArgs = node.args.slice(i)\n right = (rightArgs.length === 1) ? rightArgs[0] : makeNode(rightArgs)\n res.push(makeNode([left, right]))\n }\n }\n return res\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch (match1, match2) {\n const res = { placeholders: {} }\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res\n } else if (!match1.placeholders) {\n return match2\n } else if (!match2.placeholders) {\n return match1\n }\n\n // Placeholders with the same key must match exactly\n for (const key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key]\n\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null\n }\n }\n }\n }\n\n for (const key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, key)) {\n res.placeholders[key] = match2.placeholders[key]\n }\n }\n\n return res\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches (list1, list2) {\n const res = []\n\n if (list1.length === 0 || list2.length === 0) {\n return res\n }\n\n let merged\n for (let i1 = 0; i1 < list1.length; i1++) {\n for (let i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2])\n if (merged) {\n res.push(merged)\n }\n }\n }\n return res\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches (childMatches) {\n if (childMatches.length === 0) {\n return childMatches\n }\n\n const sets = childMatches.reduce(combineChildMatches)\n const uniqueSets = []\n const unique = {}\n for (let i = 0; i < sets.length; i++) {\n const s = JSON.stringify(sets[i])\n if (!unique[s]) {\n unique[s] = true\n uniqueSets.push(sets[i])\n }\n }\n return uniqueSets\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch (rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n let res = [{ placeholders: {} }]\n\n if ((rule instanceof OperatorNode && node instanceof OperatorNode) ||\n (rule instanceof FunctionNode && node instanceof FunctionNode)) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return []\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return []\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if ((node.args.length === 1 && rule.args.length === 1) ||\n (!isAssociative(node, context) &&\n node.args.length === rule.args.length) ||\n isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n let childMatches = []\n for (let i = 0; i < rule.args.length; i++) {\n const childMatch = _ruleMatch(rule.args[i], node.args[i], context)\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch)\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) || // exact match in order needed\n rule.args.length === 1) { // nothing to commute\n return []\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented')\n }\n /* Exactly two arguments, try them reversed */\n const leftMatch = _ruleMatch(rule.args[0], node.args[1], context)\n if (leftMatch.length === 0) {\n return []\n }\n const rightMatch = _ruleMatch(rule.args[1], node.args[0], context)\n if (rightMatch.length === 0) {\n return []\n }\n childMatches = [leftMatch, rightMatch]\n }\n res = mergeChildMatches(childMatches)\n } else if (node.args.length >= 2 && rule.args.length === 2) { // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n const splits = getSplits(node, context)\n let splitMatches = []\n for (let i = 0; i < splits.length; i++) {\n const matchSet = _ruleMatch(rule, splits[i], context, true) // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet)\n }\n return splitMatches\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString())\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return []\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?')\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return []\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node\n break\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node\n } else {\n // mis-match: rule does not encompass current node\n return []\n }\n break\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name)\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return []\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return []\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch (p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false\n }\n } else if ((p instanceof OperatorNode && q instanceof OperatorNode) ||\n (p instanceof FunctionNode && q instanceof FunctionNode)) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false\n }\n }\n\n if (p.args.length !== q.args.length) {\n return false\n }\n\n for (let i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false\n }\n }\n } else {\n return false\n }\n\n return true\n }\n\n return simplify\n})\n","import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\nimport { createUtil } from './simplify/util.js'\nimport { noBignumber, noFraction } from '../../utils/noop.js'\n\nconst name = 'simplifyConstant'\nconst dependencies = [\n 'typed',\n 'config',\n 'mathWithTransform',\n 'matrix',\n '?fraction',\n '?bignumber',\n 'AccessorNode',\n 'ArrayNode',\n 'ConstantNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'SymbolNode'\n]\n\nexport const createSimplifyConstant = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n config,\n mathWithTransform,\n matrix,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n}) => {\n const { isCommutative, isAssociative, allChildren, createMakeNodeFunction } =\n createUtil({ FunctionNode, OperatorNode, SymbolNode })\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n const simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n\n 'Node, Object': function (expr, options) {\n return _ensureNode(foldFraction(expr, options))\n }\n })\n\n function _removeFractions (thing) {\n if (isFraction(thing)) {\n return thing.valueOf()\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions)\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()))\n }\n return thing\n }\n\n function _eval (fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args)\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions)\n return _toNumber(mathWithTransform[fnname].apply(null, args), options)\n }\n }\n\n const _toNode = typed({\n Fraction: _fractionToNode,\n number: function (n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n))\n }\n return new ConstantNode(n)\n },\n BigNumber: function (n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n))\n }\n return new ConstantNode(n) // old parameters: (n.toString(), 'number')\n },\n bigint: function (n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n))\n }\n return new ConstantNode(n)\n },\n Complex: function (s) {\n throw new Error('Cannot convert Complex number to Node')\n },\n string: function (s) {\n return new ConstantNode(s)\n },\n Matrix: function (m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)))\n }\n })\n\n function _ensureNode (thing) {\n if (isNode(thing)) {\n return thing\n }\n return _toNode(thing)\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction (n, options) {\n const exactFractions = (options && options.exactFractions !== false)\n if (exactFractions && isFinite(n) && fraction) {\n const f = fraction(n)\n const fractionsLimit = (options && typeof options.fractionsLimit === 'number')\n ? options.fractionsLimit\n : Infinity // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f\n }\n }\n return n\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n const _toNumber = typed({\n 'string, Object': function (s, options) {\n const numericType = safeNumberType(s, config)\n\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber()\n }\n return bignumber(s)\n } else if (numericType === 'bigint') {\n return BigInt(s)\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction()\n }\n return fraction(s)\n } else {\n const n = parseFloat(s)\n return _exactFraction(n, options)\n }\n },\n\n 'Fraction, Object': function (s, options) { return s }, // we don't need options here\n\n 'BigNumber, Object': function (s, options) { return s }, // we don't need options here\n\n 'number, Object': function (s, options) {\n return _exactFraction(s, options)\n },\n\n 'bigint, Object': function (s, options) {\n return s\n },\n\n 'Complex, Object': function (s, options) {\n if (s.im !== 0) {\n return s\n }\n return _exactFraction(s.re, options)\n },\n\n 'Matrix, Object': function (s, options) {\n return matrix(_exactFraction(s.valueOf()))\n },\n\n 'Array, Object': function (s, options) {\n return s.map(_exactFraction)\n }\n })\n\n function unaryMinusNode (n) {\n return new OperatorNode('-', 'unaryMinus', [n])\n }\n\n function _fractionToNode (f) {\n let n\n const vn = f.s * f.n\n if (vn < 0) {\n n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)])\n } else {\n n = new ConstantNode(vn)\n }\n\n if (f.d === 1) {\n return n\n }\n return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)])\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor (obj, index, options) {\n if (!isIndexNode(index)) { // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index))\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n const remainingDims = Array.from(index.dimensions)\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) &&\n typeof remainingDims[0].value !== 'string') {\n const first = _toNumber(remainingDims.shift().value, options)\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1]\n } else { // matrix\n obj = obj.valueOf()[first - 1]\n if (obj instanceof Array) {\n obj = matrix(obj)\n }\n }\n } else if (remainingDims.length > 1 &&\n isConstantNode(remainingDims[1]) &&\n typeof remainingDims[1].value !== 'string') {\n const second = _toNumber(remainingDims[1].value, options)\n const tryItems = []\n const fromItems = isArrayNode(obj) ? obj.items : obj.valueOf()\n for (const item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1])\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1])\n } else {\n break\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems)\n } else { // matrix\n obj = matrix(tryItems)\n }\n remainingDims.splice(1, 1)\n } else { // extracting slice along 2nd dimension failed, give up\n break\n }\n } else { // neither 1st or 2nd dimension is constant, give up\n break\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index)\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims)\n return new AccessorNode(_ensureNode(obj), index)\n }\n /* All dimensions were constant, access completely resolved */\n return obj\n }\n if (isObjectNode(obj) &&\n index.dimensions.length === 1 &&\n isConstantNode(index.dimensions[0])) {\n const key = index.dimensions[0].value\n if (key in obj.properties) {\n return obj.properties[key]\n }\n return new ConstantNode() // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index)\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp (fn, args, makeNode, options) {\n const first = args.shift()\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n const reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n const last = sofar.pop()\n\n if (isNode(last)) {\n return [last, next]\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options))\n return sofar\n } catch (ignoreandcontinue) {\n sofar.push(last)\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()))\n const newtree = (sofar.length === 1) ? sofar[0] : makeNode(sofar)\n return [makeNode([newtree, _ensureNode(next)])]\n }, [first])\n\n if (reduction.length === 1) {\n return reduction[0]\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])])\n }\n\n // destroys the original node and returns a folded one\n function foldFraction (node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number': return _toNumber(node.value, options)\n case 'bigint': return _toNumber(node.value, options)\n case 'string': return node.value\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options)\n }\n return node\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node\n }\n {\n // Process operators as OperatorNode\n const operatorFunctions = ['add', 'multiply']\n if (!operatorFunctions.includes(node.name)) {\n const args = node.args.map(arg => foldFraction(arg, options))\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options)\n } catch (ignoreandcontinue) { }\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' &&\n args.length === 1 &&\n isArrayNode(args[0])) {\n const sz = []\n let section = args[0]\n while (isArrayNode(section)) {\n sz.push(section.items.length)\n section = section.items[0]\n }\n return matrix(sz)\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode))\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n const fn = node.fn.toString()\n let args\n let res\n const makeNode = createMakeNodeFunction(node)\n if (isOperatorNode(node) && node.isUnary()) {\n args = [foldFraction(node.args[0], options)]\n if (!isNode(args[0])) {\n res = _eval(fn, args, options)\n } else {\n res = makeNode(args)\n }\n } else if (isAssociative(node, options.context)) {\n args = allChildren(node, options.context)\n args = args.map(arg => foldFraction(arg, options))\n\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n const consts = []\n const vars = []\n\n for (let i = 0; i < args.length; i++) {\n if (!isNode(args[i])) {\n consts.push(args[i])\n } else {\n vars.push(args[i])\n }\n }\n\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options)\n vars.unshift(res)\n res = foldOp(fn, vars, makeNode, options)\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, args, makeNode, options)\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, args, makeNode, options)\n }\n } else {\n // non-associative binary operator\n args = node.args.map(arg => foldFraction(arg, options))\n res = foldOp(fn, args, makeNode, options)\n }\n return res\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options)\n case 'AccessorNode':\n return _foldAccessor(\n foldFraction(node.object, options),\n foldFraction(node.index, options),\n options)\n case 'ArrayNode': {\n const foldItems = node.items.map(item => foldFraction(item, options))\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode))\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems)\n }\n case 'IndexNode': {\n return new IndexNode(\n node.dimensions.map(n => simplifyConstant(n, options)))\n }\n case 'ObjectNode': {\n const foldProps = {}\n for (const prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options)\n }\n return new ObjectNode(foldProps)\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(`Unimplemented node type in simplifyConstant: ${node.type}`)\n }\n }\n\n return simplifyConstant\n})\n","import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js'\nimport { getOperator } from '../../expression/operators.js'\nimport { createUtil } from './simplify/util.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'simplifyCore'\nconst dependencies = [\n 'typed',\n 'parse',\n 'equal',\n 'isZero',\n 'add',\n 'subtract',\n 'multiply',\n 'divide',\n 'pow',\n 'AccessorNode',\n 'ArrayNode',\n 'ConstantNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'ParenthesisNode',\n 'SymbolNode'\n]\n\nexport const createSimplifyCore = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n}) => {\n const node0 = new ConstantNode(0)\n const node1 = new ConstantNode(1)\n const nodeT = new ConstantNode(true)\n const nodeF = new ConstantNode(false)\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean (node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op)\n }\n\n const { hasProperty, isCommutative } =\n createUtil({ FunctionNode, OperatorNode, SymbolNode })\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore (nodeToSimplify, options = {}) {\n const context = options ? options.context : undefined\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options)\n }\n // For other node types, we try the generic methods\n let simpChild = false\n let childCount = 0\n nodeToSimplify.forEach(c => {\n ++childCount\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options)\n }\n })\n if (childCount === 1) {\n return simpChild\n }\n }\n let node = nodeToSimplify\n if (isFunctionNode(node)) {\n const op = getOperator(node.name)\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n const last = node.args.pop()\n const seclast = node.args.pop()\n node.args.push(new OperatorNode(op, node.name, [last, seclast]))\n }\n }\n node = new OperatorNode(op, node.name, node.args)\n } else {\n return new FunctionNode(\n _simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)))\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n const a0 = _simplifyCore(node.args[0], options)\n\n if (node.op === '~') { // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0]\n }\n }\n if (node.op === 'not') { // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0]\n }\n }\n }\n let finish = true\n if (node.op === '-') { // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]])\n finish = false // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0]\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0])\n }\n if (isOperatorNode(node) && node.isBinary()) {\n const a0 = _simplifyCore(node.args[0], options)\n let a1 = _simplifyCore(node.args[1], options)\n\n if (node.op === '+') {\n if (isConstantNode(a0) && isZero(a0.value)) {\n return a1\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return a0\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0]\n node = new OperatorNode('-', 'subtract', [a0, a1])\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(\n new OperatorNode('+', 'add', [a0, a1.args[0]]), options)\n }\n if (isConstantNode(a0) && isZero(a0.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]))\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return a0\n }\n return new OperatorNode(node.op, node.fn, [a0, a1])\n }\n if (node.op === '*') {\n if (isConstantNode(a0)) {\n if (isZero(a0.value)) {\n return node0\n } else if (equal(a0.value, 1)) {\n return a1\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0\n } else if (equal(a1.value, 1)) {\n return a0\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, a0], node.implicit) // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [a0, a1], node.implicit)\n }\n if (node.op === '/') {\n if (isConstantNode(a0) && isZero(a0.value)) {\n return node0\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return a0\n }\n return new OperatorNode(node.op, node.fn, [a0, a1])\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1\n } else if (equal(a1.value, 1)) {\n return a0\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(a0)) {\n if (a0.value) {\n if (isAlwaysBoolean(a1)) return a1\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF\n }\n } else {\n return nodeF\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(a0)) return a0\n } else {\n return nodeF\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(a0)) {\n if (a0.value) {\n return nodeT\n } else {\n if (isAlwaysBoolean(a1)) return a1\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT\n } else {\n if (isAlwaysBoolean(a0)) return a0\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [a0, a1])\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(\n node.op, node.fn, node.args.map(a => _simplifyCore(a, options)))\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)))\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(\n _simplifyCore(node.object, options), _simplifyCore(node.index, options))\n }\n if (isIndexNode(node)) {\n return new IndexNode(\n node.dimensions.map(n => _simplifyCore(n, options)))\n }\n if (isObjectNode(node)) {\n const newProps = {}\n for (const prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options)\n }\n return new ObjectNode(newProps)\n }\n // cannot simplify\n return node\n }\n\n return typed(name, { Node: _simplifyCore, 'Node,Object': _simplifyCore })\n})\n","import { createMap } from '../../utils/map.js'\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'resolve'\nconst dependencies = [\n 'typed',\n 'parse',\n 'ConstantNode',\n 'FunctionNode',\n 'OperatorNode',\n 'ParenthesisNode'\n]\n\nexport const createResolve = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n}) => {\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve (node, scope, within = new Set()) { // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n const variables = Array.from(within).join(', ')\n throw new ReferenceError(\n `recursive loop of variable definitions among {${variables}}`\n )\n }\n const value = scope.get(node.name)\n if (isNode(value)) {\n const nextWithin = new Set(within)\n nextWithin.add(node.name)\n return _resolve(value, scope, nextWithin)\n } else if (typeof value === 'number') {\n return parse(String(value))\n } else if (value !== undefined) {\n return new ConstantNode(value)\n } else {\n return node\n }\n } else if (isOperatorNode(node)) {\n const args = node.args.map(function (arg) {\n return _resolve(arg, scope, within)\n })\n return new OperatorNode(node.op, node.fn, args, node.implicit)\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within))\n } else if (isFunctionNode(node)) {\n const args = node.args.map(function (arg) {\n return _resolve(arg, scope, within)\n })\n return new FunctionNode(node.name, args)\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within))\n }\n\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(\n self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo(\n 'Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo(\n 'Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(\n self => (A, scope) => A.map(n => self(n, scope)))\n })\n})\n","import { isConstantNode } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'symbolicEqual'\nconst dependencies = [\n 'parse',\n 'simplify',\n 'typed',\n 'OperatorNode'\n]\n\nexport const createSymbolicEqual = /* #__PURE__ */ factory(name, dependencies, ({\n parse,\n simplify,\n typed,\n OperatorNode\n}) => {\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual (e1, e2, options = {}) {\n const diff = new OperatorNode('-', 'subtract', [e1, e2])\n const simplified = simplify(diff, {}, options)\n return (isConstantNode(simplified) && !(simplified.value))\n }\n\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n })\n})\n","import { isConstantNode, typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { safeNumberType } from '../../utils/number.js'\n\nconst name = 'derivative'\nconst dependencies = [\n 'typed',\n 'config',\n 'parse',\n 'simplify',\n 'equal',\n 'isZero',\n 'numeric',\n 'ConstantNode',\n 'FunctionNode',\n 'OperatorNode',\n 'ParenthesisNode',\n 'SymbolNode'\n]\n\nexport const createDerivative = /* #__PURE__ */ factory(name, dependencies, ({\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n}) => {\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative (expr, variable, options = { simplify: true }) {\n const constNodes = {}\n constTag(constNodes, expr, variable.name)\n const res = _derivative(expr, constNodes)\n return options.simplify ? simplify(res) : res\n }\n\n function parseIdentifier (string) {\n const symbol = parse(string)\n if (!symbol.isSymbolNode) {\n throw new TypeError('Invalid variable. ' +\n `Cannot parse ${JSON.stringify(string)} into a variable in function derivative`)\n }\n return symbol\n }\n\n const derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative,\n 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)),\n 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options)\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n let constNodes = {}\n constTag(constNodes, expr, variable.name)\n res = _derivative(res, constNodes)\n }\n return res\n }\n */\n })\n\n derivative._simplify = true\n\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args)\n }\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n const _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function (expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1)\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1)\n }\n },\n 'Node, ConstantNode': function (expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value))\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\")\n }\n },\n 'Node, SymbolNode, ConstantNode': function (expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value)\n },\n 'string, string, number': function (expr, x, order) {\n let d\n if (order === 1) {\n d = '{d\\\\over d' + x + '}'\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}'\n }\n return d + `\\\\left[${expr}\\\\right]`\n }\n })\n\n /**\n * Does a depth-first search on the expression tree to identify what Nodes\n * are constants (e.g. 2 + 2), and stores the ones that are constants in\n * constNodes. Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {Object} constNodes Holds the nodes that are constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n // TODO: can we rewrite constTag into a pure function?\n const constTag = typed('constTag', {\n 'Object, ConstantNode, string': function (constNodes, node) {\n constNodes[node] = true\n return true\n },\n\n 'Object, SymbolNode, string': function (constNodes, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n if (node.name !== varName) {\n constNodes[node] = true\n return true\n }\n return false\n },\n\n 'Object, ParenthesisNode, string': function (constNodes, node, varName) {\n return constTag(constNodes, node.content, varName)\n },\n\n 'Object, FunctionAssignmentNode, string': function (constNodes, node, varName) {\n if (!node.params.includes(varName)) {\n constNodes[node] = true\n return true\n }\n return constTag(constNodes, node.expr, varName)\n },\n\n 'Object, FunctionNode | OperatorNode, string': function (constNodes, node, varName) {\n if (node.args.length > 0) {\n let isConst = constTag(constNodes, node.args[0], varName)\n for (let i = 1; i < node.args.length; ++i) {\n isConst = constTag(constNodes, node.args[i], varName) && isConst\n }\n\n if (isConst) {\n constNodes[node] = true\n return true\n }\n }\n return false\n }\n })\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} constNodes Holds the nodes that are constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n const _derivative = typed('_derivative', {\n 'ConstantNode, Object': function (node) {\n return createConstantNode(0)\n },\n\n 'SymbolNode, Object': function (node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0)\n }\n return createConstantNode(1)\n },\n\n 'ParenthesisNode, Object': function (node, constNodes) {\n return new ParenthesisNode(_derivative(node.content, constNodes))\n },\n\n 'FunctionAssignmentNode, Object': function (node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0)\n }\n return _derivative(node.expr, constNodes)\n },\n\n 'FunctionNode, Object': function (node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0)\n }\n\n const arg0 = node.args[0]\n let arg1\n\n let div = false // is output a fraction?\n let negative = false // is output negative?\n\n let funcDerivative\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n createConstantNode(3),\n new OperatorNode('^', 'pow', [\n arg0,\n new OperatorNode('/', 'divide', [\n createConstantNode(2),\n createConstantNode(3)\n ])\n ])\n ])\n break\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n createConstantNode(2),\n new FunctionNode('sqrt', [arg0])\n ])\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [\n createConstantNode(1),\n node.args[1]\n ])\n\n // Is a variable?\n constNodes[arg1] = constNodes[node.args[1]]\n\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes)\n }\n break\n case 'log10':\n arg1 = createConstantNode(10)\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone()\n div = true\n } else if ((node.args.length === 1 && arg1) ||\n (node.args.length === 2 && constNodes[node.args[1]] !== undefined)) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [\n arg0.clone(),\n new FunctionNode('log', [arg1 || node.args[1]])\n ])\n div = true\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [\n new FunctionNode('log', [arg0]),\n new FunctionNode('log', [node.args[1]])\n ]), constNodes)\n }\n break\n case 'pow':\n if (node.args.length === 2) {\n constNodes[arg1] = constNodes[node.args[1]]\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes)\n }\n break\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()])\n break\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()])\n break\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [\n new FunctionNode('sin', [arg0.clone()])\n ])\n break\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [\n new FunctionNode('sec', [arg0.clone()]),\n createConstantNode(2)\n ])\n break\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [\n node,\n new FunctionNode('tan', [arg0.clone()])\n ])\n break\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n node,\n new FunctionNode('cot', [arg0.clone()])\n ])\n break\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true\n funcDerivative = new OperatorNode('^', 'pow', [\n new FunctionNode('csc', [arg0.clone()]),\n createConstantNode(2)\n ])\n break\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true\n funcDerivative = new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n createConstantNode(1),\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ])\n ])\n ])\n break\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true\n negative = true\n funcDerivative = new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n createConstantNode(1),\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ])\n ])\n ])\n break\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true\n funcDerivative = new OperatorNode('+', 'add', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n break\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n new FunctionNode('abs', [arg0.clone()]),\n new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n ])\n ])\n break\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n new FunctionNode('abs', [arg0.clone()]),\n new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n ])\n ])\n break\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true\n negative = true\n funcDerivative = new OperatorNode('+', 'add', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n break\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()])\n break\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()])\n break\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [\n new FunctionNode('sech', [arg0.clone()]),\n createConstantNode(2)\n ])\n break\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n node,\n new FunctionNode('tanh', [arg0.clone()])\n ])\n break\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n node,\n new FunctionNode('coth', [arg0.clone()])\n ])\n break\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true\n funcDerivative = new OperatorNode('^', 'pow', [\n new FunctionNode('csch', [arg0.clone()]),\n createConstantNode(2)\n ])\n break\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true\n funcDerivative = new FunctionNode('sqrt', [\n new OperatorNode('+', 'add', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n ])\n break\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true\n funcDerivative = new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n ])\n break\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true\n funcDerivative = new OperatorNode('-', 'subtract', [\n createConstantNode(1),\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ])\n ])\n break\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n arg0.clone(),\n new FunctionNode('sqrt', [\n new OperatorNode('-', 'subtract', [\n createConstantNode(1),\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ])\n ])\n ])\n ])\n break\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true\n negative = true\n funcDerivative = new OperatorNode('*', 'multiply', [\n new FunctionNode('abs', [arg0.clone()]),\n new FunctionNode('sqrt', [\n new OperatorNode('+', 'add', [\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ]),\n createConstantNode(1)\n ])\n ])\n ])\n break\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true\n negative = true\n funcDerivative = new OperatorNode('-', 'subtract', [\n createConstantNode(1),\n new OperatorNode('^', 'pow', [\n arg0.clone(),\n createConstantNode(2)\n ])\n ])\n break\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [\n new FunctionNode(new SymbolNode('abs'), [arg0.clone()]),\n arg0.clone()\n ])\n break\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' +\n 'the function is not supported, undefined, or the number of arguments passed to it are not supported')\n }\n\n let op, func\n if (div) {\n op = '/'\n func = 'divide'\n } else {\n op = '*'\n func = 'multiply'\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n let chainDerivative = _derivative(arg0, constNodes)\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative])\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative])\n },\n\n 'OperatorNode, Object': function (node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0)\n }\n\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, constNodes)\n }))\n }\n\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [\n _derivative(node.args[0], constNodes)\n ])\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [\n _derivative(node.args[0], constNodes),\n _derivative(node.args[1], constNodes)\n ])\n }\n }\n\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n const constantTerms = node.args.filter(function (arg) {\n return constNodes[arg] !== undefined\n })\n\n if (constantTerms.length > 0) {\n const nonConstantTerms = node.args.filter(function (arg) {\n return constNodes[arg] === undefined\n })\n\n const nonConstantNode = nonConstantTerms.length === 1\n ? nonConstantTerms[0]\n : new OperatorNode('*', 'multiply', nonConstantTerms)\n\n const newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes))\n\n return new OperatorNode('*', 'multiply', newArgs)\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return (argInner === argOuter)\n ? _derivative(argInner, constNodes)\n : argInner.clone()\n }))\n }))\n }\n\n if (node.op === '/' && node.isBinary()) {\n const arg0 = node.args[0]\n const arg1 = node.args[1]\n\n // d/dx(f(x) / c) = f'(x) / c\n if (constNodes[arg1] !== undefined) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1])\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (constNodes[arg0] !== undefined) {\n return new OperatorNode('*', 'multiply', [\n new OperatorNode('-', 'unaryMinus', [arg0]),\n new OperatorNode('/', 'divide', [\n _derivative(arg1, constNodes),\n new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])\n ])\n ])\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [\n new OperatorNode('-', 'subtract', [\n new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]),\n new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])\n ]),\n new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])\n ])\n }\n\n if (node.op === '^' && node.isBinary()) {\n const arg0 = node.args[0]\n const arg1 = node.args[1]\n\n if (constNodes[arg0] !== undefined) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(arg0) && (isZero(arg0.value) || equal(arg0.value, 1))) {\n return createConstantNode(0)\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [\n node,\n new OperatorNode('*', 'multiply', [\n new FunctionNode('log', [arg0.clone()]),\n _derivative(arg1.clone(), constNodes)\n ])\n ])\n }\n\n if (constNodes[arg1] !== undefined) {\n if (isConstantNode(arg1)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(arg1.value)) {\n return createConstantNode(0)\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(arg1.value, 1)) {\n return _derivative(arg0, constNodes)\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n const powMinusOne = new OperatorNode('^', 'pow', [\n arg0.clone(),\n new OperatorNode('-', 'subtract', [\n arg1,\n createConstantNode(1)\n ])\n ])\n\n return new OperatorNode('*', 'multiply', [\n arg1.clone(),\n new OperatorNode('*', 'multiply', [\n _derivative(arg0, constNodes),\n powMinusOne\n ])\n ])\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [\n new OperatorNode('^', 'pow', [arg0.clone(), arg1.clone()]),\n new OperatorNode('+', 'add', [\n new OperatorNode('*', 'multiply', [\n _derivative(arg0, constNodes),\n new OperatorNode('/', 'divide', [arg1.clone(), arg0.clone()])\n ]),\n new OperatorNode('*', 'multiply', [\n _derivative(arg1, constNodes),\n new FunctionNode('log', [arg0.clone()])\n ])\n ])\n ])\n }\n\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' +\n 'the operator is not supported, undefined, or the number of arguments passed to it are not supported')\n }\n })\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode (value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)))\n }\n\n return derivative\n})\n","import { isInteger } from '../../utils/number.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'rationalize'\nconst dependencies = [\n 'config',\n 'typed',\n 'equal',\n 'isZero',\n 'add',\n 'subtract',\n 'multiply',\n 'divide',\n 'pow',\n 'parse',\n 'simplifyConstant',\n 'simplifyCore',\n 'simplify',\n '?bignumber',\n '?fraction',\n 'mathWithTransform',\n 'matrix',\n 'AccessorNode',\n 'ArrayNode',\n 'ConstantNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'SymbolNode',\n 'ParenthesisNode'\n]\n\nexport const createRationalize = /* #__PURE__ */ factory(name, dependencies, ({\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n}) => {\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize (expr, scope = {}, detailed = false) {\n const setRules = rulesRationalize() // Rules for change polynomial in near canonical form\n const polyRet = polynomial(expr, scope, true, setRules.firstRules) // Check if expression is a rationalizable polynomial\n const nVars = polyRet.variables.length\n const noExactFractions = { exactFractions: false }\n const withExactFractions = { exactFractions: true }\n expr = polyRet.expression\n\n if (nVars >= 1) { // If expression in not a constant\n expr = expandPower(expr) // First expand power of polynomials (cannot be made from rules!)\n let sBefore // Previous expression\n let rules\n let eDistrDiv = true\n let redoInic = false\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions)\n let s\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules\n expr = simplify(expr, rules, {}, withExactFractions)\n eDistrDiv = !eDistrDiv // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString()\n if (s === sBefore) {\n break // No changes : end of the loop\n }\n\n redoInic = true\n sBefore = s\n }\n\n if (redoInic) { // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions)\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions)\n } // NVars >= 1\n\n const coefficients = []\n const retRationalize = {}\n\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') { // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients)\n expr.args[1] = polyToCanonical(expr.args[1])\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0]\n retRationalize.denominator = expr.args[1]\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients)\n }\n if (detailed) {\n retRationalize.numerator = expr\n retRationalize.denominator = null\n }\n }\n // nVars\n\n if (!detailed) return expr\n retRationalize.coefficients = coefficients\n retRationalize.variables = polyRet.variables\n retRationalize.expression = expr\n return retRationalize\n }\n\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }) // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial (expr, scope, extended, rules) {\n const variables = []\n const node = simplify(expr, rules, scope, { exactFractions: false }) // Resolves any variables and functions with all defined parameters\n extended = !!extended\n\n const oper = '+-*' + (extended ? '/' : '')\n recPoly(node)\n const retFunc = {}\n retFunc.expression = node\n retFunc.variables = variables\n return retFunc\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly (node) {\n const tp = node.type // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call')\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent')\n } else {\n recPoly(node.args[0])\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression')\n }\n for (let i = 0; i < node.args.length; i++) {\n recPoly(node.args[i])\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n const name = node.name // variable name\n const pos = variables.indexOf(name)\n if (pos === -1) {\n // new variable in expression\n variables.push(name)\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content)\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression')\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize () {\n const oldRules = [simplifyCore, // sCore\n { l: 'n+n', r: '2*n' },\n { l: 'n+-n', r: '0' },\n simplifyConstant, // sConstant\n { l: 'n*(n1^-1)', r: 'n/n1' },\n { l: 'n*n1^-n2', r: 'n/n1^n2' },\n { l: 'n1^-1', r: '1/n1' },\n { l: 'n*(n1/n2)', r: '(n*n1)/n2' },\n { l: '1*n', r: 'n' }]\n\n const rulesFirst = [\n { l: '(-n1)/(-n2)', r: 'n1/n2' }, // Unary division\n { l: '(-n1)*(-n2)', r: 'n1*n2' }, // Unary multiplication\n { l: 'n1--n2', r: 'n1+n2' }, // '--' elimination\n { l: 'n1-n2', r: 'n1+(-n2)' }, // Subtraction turn into add with un�ry minus\n { l: '(n1+n2)*n3', r: '(n1*n3 + n2*n3)' }, // Distributive 1\n { l: 'n1*(n2+n3)', r: '(n1*n2+n1*n3)' }, // Distributive 2\n { l: 'c1*n + c2*n', r: '(c1+c2)*n' }, // Joining constants\n { l: 'c1*n + n', r: '(c1+1)*n' }, // Joining constants\n { l: 'c1*n - c2*n', r: '(c1-c2)*n' }, // Joining constants\n { l: 'c1*n - n', r: '(c1-1)*n' }, // Joining constants\n { l: 'v/c', r: '(1/c)*v' }, // variable/constant (new!)\n { l: 'v/-c', r: '-(1/c)*v' }, // variable/constant (new!)\n { l: '-v*-c', r: 'c*v' }, // Inversion constant and variable 1\n { l: '-v*c', r: '-c*v' }, // Inversion constant and variable 2\n { l: 'v*-c', r: '-c*v' }, // Inversion constant and variable 3\n { l: 'v*c', r: 'c*v' }, // Inversion constant and variable 4\n { l: '-(-n1*n2)', r: '(n1*n2)' }, // Unary propagation\n { l: '-(n1*n2)', r: '(-n1*n2)' }, // Unary propagation\n { l: '-(-n1+n2)', r: '(n1-n2)' }, // Unary propagation\n { l: '-(n1+n2)', r: '(-n1-n2)' }, // Unary propagation\n { l: '(n1^n2)^n3', r: '(n1^(n2*n3))' }, // Power to Power\n { l: '-(-n1/n2)', r: '(n1/n2)' }, // Division and Unary\n { l: '-(n1/n2)', r: '(-n1/n2)' }] // Divisao and Unary\n\n const rulesDistrDiv = [\n { l: '(n1/n2 + n3/n4)', r: '((n1*n4 + n3*n2)/(n2*n4))' }, // Sum of fractions\n { l: '(n1/n2 + n3)', r: '((n1 + n3*n2)/n2)' }, // Sum fraction with number 1\n { l: '(n1 + n2/n3)', r: '((n1*n3 + n2)/n3)' }] // Sum fraction with number 1\n\n const rulesSucDiv = [\n { l: '(n1/(n2/n3))', r: '((n1*n3)/n2)' }, // Division simplification\n { l: '(n1/n2/n3)', r: '(n1/(n2*n3))' }]\n\n const setRules = {} // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv) // First rule set\n setRules.distrDivRules = rulesDistrDiv // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst) // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore, // simplify.rules[0]\n { l: 'n*-n', r: '-n^2' }, // Joining multiply with power 1\n { l: 'n*n', r: 'n^2' }, // Joining multiply with power 2\n simplifyConstant, // simplify.rules[14] old 3rd index in oldRules\n { l: 'n*-n^n1', r: '-n^(n1+1)' }, // Joining multiply with power 3\n { l: 'n*n^n1', r: 'n^(n1+1)' }, // Joining multiply with power 4\n { l: 'n^n1*-n^n2', r: '-n^(n1+n2)' }, // Joining multiply with power 5\n { l: 'n^n1*n^n2', r: 'n^(n1+n2)' }, // Joining multiply with power 6\n { l: 'n^n1*-n', r: '-n^(n1+1)' }, // Joining multiply with power 7\n { l: 'n^n1*n', r: 'n^(n1+1)' }, // Joining multiply with power 8\n { l: 'n^n1/-n', r: '-n^(n1-1)' }, // Joining multiply with power 8\n { l: 'n^n1/n', r: 'n^(n1-1)' }, // Joining division with power 1\n { l: 'n/-n^n1', r: '-n^(1-n1)' }, // Joining division with power 2\n { l: 'n/n^n1', r: 'n^(1-n1)' }, // Joining division with power 3\n { l: 'n^n1/-n^n2', r: 'n^(n1-n2)' }, // Joining division with power 4\n { l: 'n^n1/n^n2', r: 'n^(n1-n2)' }, // Joining division with power 5\n { l: 'n1+(-n2*n3)', r: 'n1-n2*n3' }, // Solving useless parenthesis 1\n { l: 'v*(-c)', r: '-c*v' }, // Solving useless unary 2\n { l: 'n1+-n2', r: 'n1-n2' }, // Solving +- together (new!)\n { l: 'v*c', r: 'c*v' }, // inversion constant with variable\n { l: '(n1^n2)^n3', r: '(n1^(n2*n3))' } // Power to Power\n\n ]\n return setRules\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower (node, parent, indParent) {\n const tp = node.type\n const internal = (arguments.length > 1) // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n let does = false\n let val\n if (node.op === '^') { // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' ||\n node.args[0].type === 'OperatorNode') &&\n (node.args[1].type === 'ConstantNode')) { // Second operator: Constant\n val = parseFloat(node.args[1].value)\n does = (val >= 2 && isInteger(val))\n }\n }\n\n if (does) { // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) { // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n const nEsqTopo = node.args[0]\n const nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)])\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo])\n } else { // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()])\n }\n\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') { parent.content = node } else { parent.args[indParent] = node }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content')\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (let i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i)\n }\n }\n\n if (!internal) {\n // return the root node\n return node\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical (node, coefficients) {\n if (coefficients === undefined) { coefficients = [] } // coefficients.\n\n coefficients[0] = 0 // index is the exponent\n const o = {}\n o.cte = 1\n o.oper = '+'\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = ''\n\n let maxExpo = 0 // maximum exponent\n let varname = '' // variable name\n\n recurPol(node, null, o)\n maxExpo = coefficients.length - 1\n let first = true\n let no\n\n for (let i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue\n let n1 = new ConstantNode(\n first ? coefficients[i] : Math.abs(coefficients[i]))\n const op = coefficients[i] < 0 ? '-' : '+'\n\n if (i > 0) { // Is not a constant without variable\n let n2 = new SymbolNode(varname)\n if (i > 1) {\n const n3 = new ConstantNode(i)\n n2 = new OperatorNode('^', 'pow', [n2, n3])\n }\n if (coefficients[i] === -1 && first) { n1 = new OperatorNode('-', 'unaryMinus', [n2]) } else if (Math.abs(coefficients[i]) === 1) { n1 = n2 } else { n1 = new OperatorNode('*', 'multiply', [n1, n2]) }\n }\n\n if (first) { no = n1 } else if (op === '+') { no = new OperatorNode('+', 'add', [no, n1]) } else { no = new OperatorNode('-', 'subtract', [no, n1]) }\n\n first = false\n } // for\n\n if (first) { return new ConstantNode(0) } else { return no }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol (node, noPai, o) {\n const tp = node.type\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call')\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid')\n\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' &&\n noPai.fn !== 'subtract' && noPai.fn !== 'multiply') { throw new Error('Invalid ' + node.op + ' placing') }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') &&\n noPai.fn !== 'add' && noPai.fn !== 'subtract') { throw new Error('Invalid ' + node.op + ' placing') }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' ||\n node.fn === 'unaryMinus') && o.noFil !== 0) { throw new Error('Invalid ' + node.op + ' placing') }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op\n }\n\n for (let i = 0; i < node.args.length; i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-'\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = ''\n o.cte = 1 // default if there is no constant\n o.oper = (i === 0 ? '+' : node.op)\n }\n o.noFil = i // number of son\n recurPol(node.args[i], node, o)\n } // for in children\n } else if (tp === 'SymbolNode') { // ***** SymbolName *****\n if (node.name !== varname && varname !== '') { throw new Error('There is more than one variable') }\n varname = node.name\n if (noPai === null) {\n coefficients[1] = 1\n return\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) { throw new Error('In power the variable should be the first parameter') }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) { throw new Error('In multiply the variable should be the second parameter') }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1)\n maxExpo = Math.max(1, maxExpo)\n }\n } else if (tp === 'ConstantNode') {\n const valor = parseFloat(node.value)\n if (noPai === null) {\n coefficients[0] = valor\n return\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered')\n\n if (!isInteger(valor) || valor <= 0) { throw new Error('Non-integer exponent is not allowed') }\n\n for (let i = maxExpo + 1; i < valor; i++) coefficients[i] = 0\n if (valor > maxExpo) coefficients[valor] = 0\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1)\n maxExpo = Math.max(valor, maxExpo)\n return\n }\n o.cte = valor\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') { coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1) }\n } else { throw new Error('Type ' + tp + ' is not allowed') }\n } // End of recurPol\n } // End of polyToCanonical\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'zpk2tf'\n\nconst dependencies = [\n 'typed',\n 'add',\n 'multiply',\n 'Complex',\n 'number'\n]\n\nexport const createZpk2tf = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, multiply, Complex, number }) => {\n /**\n * Compute the transfer function of a zero-pole-gain model.\n *\n * Syntax:\n * math.zpk2tf(z, p, k)\n *\n * Examples:\n * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]]\n *\n * See also:\n * freqz\n *\n * @param {Array} z Array of zeros values\n * @param {Array} p Array of poles values\n * @param {number} k Gain value\n * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials\n *\n */\n return typed(name, {\n 'Array,Array,number': function (z, p, k) {\n return _zpk2tf(z, p, k)\n },\n 'Array,Array': function (z, p) {\n return _zpk2tf(z, p, 1)\n },\n 'Matrix,Matrix,number': function (z, p, k) {\n return _zpk2tf(z.valueOf(), p.valueOf(), k)\n },\n 'Matrix,Matrix': function (z, p) {\n return _zpk2tf(z.valueOf(), p.valueOf(), 1)\n }\n })\n\n function _zpk2tf (z, p, k) {\n // if z is bignumber, convert it to number\n if (z.some((el) => el.type === 'BigNumber')) {\n z = z.map((el) => number(el))\n }\n // if p is bignumber, convert it to number\n if (p.some((el) => el.type === 'BigNumber')) {\n p = p.map((el) => number(el))\n }\n let num = [Complex(1, 0)]\n let den = [Complex(1, 0)]\n for (let i = 0; i < z.length; i++) {\n let zero = z[i]\n if (typeof zero === 'number') zero = Complex(zero, 0)\n num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)])\n }\n for (let i = 0; i < p.length; i++) {\n let pole = p[i]\n if (typeof pole === 'number') pole = Complex(pole, 0)\n den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)])\n }\n for (let i = 0; i < num.length; i++) {\n num[i] = multiply(num[i], k)\n }\n return [num, den]\n }\n\n function _multiply (a, b) {\n const c = []\n for (let i = 0; i < a.length + b.length - 1; i++) {\n c[i] = Complex(0, 0)\n for (let j = 0; j < a.length; j++) {\n if (i - j >= 0 && i - j < b.length) {\n c[i] = add(c[i], multiply(a[j], b[i - j]))\n }\n }\n }\n return c\n }\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'freqz'\n\nconst dependencies = [\n 'typed',\n 'add',\n 'multiply',\n 'Complex',\n 'divide',\n 'matrix'\n]\n\nexport const createFreqz = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, multiply, Complex, divide, matrix }) => {\n /**\n * Calculates the frequency response of a filter given its numerator and denominator coefficients.\n *\n * Syntax:\n * math.freqz(b, a)\n * math.freqz(b, a, w)\n *\n * Examples:\n * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] }\n * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] }\n *\n * See also:\n * zpk2tf\n *\n * @param {Array.} b The numerator coefficients of the filter.\n * @param {Array.} a The denominator coefficients of the filter.\n * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points)\n * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed.\n *\n *\n */\n return typed(name, {\n 'Array, Array': function (b, a) {\n const w = createBins(512)\n return _freqz(b, a, w)\n },\n 'Array, Array, Array': function (b, a, w) {\n return _freqz(b, a, w)\n },\n 'Array, Array, number': function (b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number')\n }\n const w2 = createBins(w)\n return _freqz(b, a, w2)\n },\n 'Matrix, Matrix': function (b, a) {\n // console.log('here')\n const _w = createBins(512)\n const { w, h } = _freqz(b.valueOf(), a.valueOf(), _w)\n return {\n w: matrix(w),\n h: matrix(h)\n }\n },\n 'Matrix, Matrix, Matrix': function (b, a, w) {\n const { h } = _freqz(b.valueOf(), a.valueOf(), w.valueOf())\n return {\n h: matrix(h),\n w: matrix(w)\n }\n },\n 'Matrix, Matrix, number': function (b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number')\n }\n const _w = createBins(w)\n const { h } = _freqz(b.valueOf(), a.valueOf(), _w)\n return {\n h: matrix(h),\n w: matrix(_w)\n }\n }\n })\n\n function _freqz (b, a, w) {\n const num = []\n const den = []\n for (let i = 0; i < w.length; i++) {\n let sumNum = Complex(0, 0)\n let sumDen = Complex(0, 0)\n for (let j = 0; j < b.length; j++) {\n sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))))\n }\n for (let j = 0; j < a.length; j++) {\n sumDen = add(sumDen, multiply(a[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))))\n }\n num.push(sumNum)\n den.push(sumDen)\n }\n const h = []\n for (let i = 0; i < num.length; i++) {\n h.push(divide(num[i], den[i]))\n }\n return { h, w }\n }\n\n function createBins (n) {\n const bins = []\n for (let i = 0; i < n; i++) {\n bins.push(i / n * Math.PI)\n }\n return bins\n }\n})\n","import { factory } from '../utils/factory.js'\n\nconst name = 'reviver'\nconst dependencies = [\n 'classes'\n]\n\nexport const createReviver = /* #__PURE__ */ factory(name, dependencies, ({ classes }) => {\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver (key, value) {\n const constructor = classes[value && value.mathjs]\n\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value)\n }\n\n return value\n }\n})\n","import { factory } from '../utils/factory.js'\n\nconst name = 'replacer'\nconst dependencies = []\n\nexport const createReplacer = /* #__PURE__ */ factory(name, dependencies, () => {\n /**\n * Stringify data types into their JSON representation.\n * Most data types can be serialized using their `.toJSON` method,\n * but not all, for example the number `Infinity`. For these cases you have\n * to use the replacer. Example usage:\n *\n * JSON.stringify([2, Infinity], math.replacer)\n *\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the replaced object\n */\n return function replacer (key, value) {\n // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON\n if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) {\n return {\n mathjs: 'number',\n value: String(value)\n }\n }\n\n if (typeof value === 'bigint') {\n return {\n mathjs: 'bigint',\n value: String(value)\n }\n }\n\n return value\n }\n})\n","export const pi = Math.PI\nexport const tau = 2 * Math.PI\nexport const e = Math.E\nexport const phi = 1.6180339887498948 // eslint-disable-line no-loss-of-precision\n","import { factory } from './utils/factory.js'\nimport { version } from './version.js'\nimport {\n createBigNumberE,\n createBigNumberPhi,\n createBigNumberPi,\n createBigNumberTau\n} from './utils/bignumber/constants.js'\nimport { pi, tau, e, phi } from './plain/number/index.js'\n\nexport const createTrue = /* #__PURE__ */ factory('true', [], () => true)\nexport const createFalse = /* #__PURE__ */ factory('false', [], () => false)\nexport const createNull = /* #__PURE__ */ factory('null', [], () => null)\n\nexport const createInfinity = /* #__PURE__ */ recreateFactory(\n 'Infinity',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(Infinity)\n : Infinity\n)\n\nexport const createNaN = /* #__PURE__ */ recreateFactory(\n 'NaN',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(NaN)\n : NaN\n)\n\nexport const createPi = /* #__PURE__ */ recreateFactory(\n 'pi',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? createBigNumberPi(BigNumber)\n : pi\n)\n\nexport const createTau = /* #__PURE__ */ recreateFactory(\n 'tau',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? createBigNumberTau(BigNumber)\n : tau\n)\n\nexport const createE = /* #__PURE__ */ recreateFactory(\n 'e',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? createBigNumberE(BigNumber)\n : e\n)\n\n// golden ratio, (1+sqrt(5))/2\nexport const createPhi = /* #__PURE__ */ recreateFactory(\n 'phi',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? createBigNumberPhi(BigNumber)\n : phi\n)\n\nexport const createLN2 = /* #__PURE__ */ recreateFactory(\n 'LN2',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(2).ln()\n : Math.LN2\n)\n\nexport const createLN10 = /* #__PURE__ */ recreateFactory(\n 'LN10',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(10).ln()\n : Math.LN10\n)\n\nexport const createLOG2E = /* #__PURE__ */ recreateFactory(\n 'LOG2E',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(1).div(new BigNumber(2).ln())\n : Math.LOG2E\n)\n\nexport const createLOG10E = /* #__PURE__ */ recreateFactory(\n 'LOG10E',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(1).div(new BigNumber(10).ln())\n : Math.LOG10E\n)\n\nexport const createSQRT1_2 = /* #__PURE__ */ recreateFactory( // eslint-disable-line camelcase\n 'SQRT1_2',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber('0.5').sqrt()\n : Math.SQRT1_2\n)\n\nexport const createSQRT2 = /* #__PURE__ */ recreateFactory(\n 'SQRT2',\n ['config', '?BigNumber'],\n ({ config, BigNumber }) => (config.number === 'BigNumber')\n ? new BigNumber(2).sqrt()\n : Math.SQRT2\n)\n\nexport const createI = /* #__PURE__ */ recreateFactory(\n 'i',\n ['Complex'],\n ({ Complex }) => Complex.I\n)\n\n// for backward compatibility with v5\nexport const createUppercasePi = /* #__PURE__ */ factory('PI', ['pi'], ({ pi }) => pi)\nexport const createUppercaseE = /* #__PURE__ */ factory('E', ['e'], ({ e }) => e)\n\nexport const createVersion = /* #__PURE__ */ factory('version', [], () => version)\n\n// helper function to create a factory with a flag recreateOnConfigChange\n// idea: allow passing optional properties to be attached to the factory function as 4th argument?\nfunction recreateFactory (name, dependencies, create) {\n return factory(name, dependencies, create, {\n recreateOnConfigChange: true\n })\n}\n","export const version = '13.2.0'\n// Note: This file is automatically generated when building math.js.\n// Changes made in this file will be overwritten.\n","import { factory } from '../../utils/factory.js'\n\n// Source: https://en.wikipedia.org/wiki/Physical_constant\n\n// Universal constants\nexport const createSpeedOfLight = /* #__PURE__ */ unitFactory('speedOfLight', '299792458', 'm s^-1')\nexport const createGravitationConstant = /* #__PURE__ */ unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2')\nexport const createPlanckConstant = /* #__PURE__ */ unitFactory('planckConstant', '6.62607015e-34', 'J s')\nexport const createReducedPlanckConstant = /* #__PURE__ */ unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s')\n\n// Electromagnetic constants\nexport const createMagneticConstant = /* #__PURE__ */ unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2')\nexport const createElectricConstant = /* #__PURE__ */ unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1')\nexport const createVacuumImpedance = /* #__PURE__ */ unitFactory('vacuumImpedance', '376.730313667', 'ohm')\nexport const createCoulomb = /* #__PURE__ */ unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2')\nexport const createElementaryCharge = /* #__PURE__ */ unitFactory('elementaryCharge', '1.602176634e-19', 'C')\nexport const createBohrMagneton = /* #__PURE__ */ unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1')\nexport const createConductanceQuantum = /* #__PURE__ */ unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S')\nexport const createInverseConductanceQuantum = /* #__PURE__ */ unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm')\nexport const createMagneticFluxQuantum = /* #__PURE__ */ unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb')\nexport const createNuclearMagneton = /* #__PURE__ */ unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1')\nexport const createKlitzing = /* #__PURE__ */ unitFactory('klitzing', '25812.807459304513', 'ohm')\nexport const createJosephson = /* #__PURE__ */ unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1') // TODO: support for Hz needed\n\n// Atomic and nuclear constants\nexport const createBohrRadius = /* #__PURE__ */ unitFactory('bohrRadius', '5.29177210903e-11', 'm')\nexport const createClassicalElectronRadius = /* #__PURE__ */ unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm')\nexport const createElectronMass = /* #__PURE__ */ unitFactory('electronMass', '9.1093837015e-31', 'kg')\nexport const createFermiCoupling = /* #__PURE__ */ unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2')\nexport const createFineStructure = numberFactory('fineStructure', 7.2973525693e-3)\nexport const createHartreeEnergy = /* #__PURE__ */ unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J')\nexport const createProtonMass = /* #__PURE__ */ unitFactory('protonMass', '1.67262192369e-27', 'kg')\nexport const createDeuteronMass = /* #__PURE__ */ unitFactory('deuteronMass', '3.3435830926e-27', 'kg')\nexport const createNeutronMass = /* #__PURE__ */ unitFactory('neutronMass', '1.6749271613e-27', 'kg')\nexport const createQuantumOfCirculation = /* #__PURE__ */ unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1')\nexport const createRydberg = /* #__PURE__ */ unitFactory('rydberg', '10973731.568160', 'm^-1')\nexport const createThomsonCrossSection = /* #__PURE__ */ unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2')\nexport const createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290)\nexport const createEfimovFactor = numberFactory('efimovFactor', 22.7)\n\n// Physico-chemical constants\nexport const createAtomicMass = /* #__PURE__ */ unitFactory('atomicMass', '1.66053906660e-27', 'kg')\nexport const createAvogadro = /* #__PURE__ */ unitFactory('avogadro', '6.02214076e23', 'mol^-1')\nexport const createBoltzmann = /* #__PURE__ */ unitFactory('boltzmann', '1.380649e-23', 'J K^-1')\nexport const createFaraday = /* #__PURE__ */ unitFactory('faraday', '96485.33212331001', 'C mol^-1')\nexport const createFirstRadiation = /* #__PURE__ */ unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2')\n// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1\nexport const createLoschmidt = /* #__PURE__ */ unitFactory('loschmidt', '2.686780111798444e25', 'm^-3')\nexport const createGasConstant = /* #__PURE__ */ unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1')\nexport const createMolarPlanckConstant = /* #__PURE__ */ unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1')\nexport const createMolarVolume = /* #__PURE__ */ unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1')\nexport const createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358)\nexport const createSecondRadiation = /* #__PURE__ */ unitFactory('secondRadiation', '0.014387768775039337', 'm K')\nexport const createStefanBoltzmann = /* #__PURE__ */ unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4')\nexport const createWienDisplacement = /* #__PURE__ */ unitFactory('wienDisplacement', '2.897771955e-3', 'm K')\n\n// Adopted values\nexport const createMolarMass = /* #__PURE__ */ unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1')\nexport const createMolarMassC12 = /* #__PURE__ */ unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1')\nexport const createGravity = /* #__PURE__ */ unitFactory('gravity', '9.80665', 'm s^-2')\n// atm is defined in Unit.js\n\n// Natural units\nexport const createPlanckLength = /* #__PURE__ */ unitFactory('planckLength', '1.616255e-35', 'm')\nexport const createPlanckMass = /* #__PURE__ */ unitFactory('planckMass', '2.176435e-8', 'kg')\nexport const createPlanckTime = /* #__PURE__ */ unitFactory('planckTime', '5.391245e-44', 's')\nexport const createPlanckCharge = /* #__PURE__ */ unitFactory('planckCharge', '1.87554603778e-18', 'C')\nexport const createPlanckTemperature = /* #__PURE__ */ unitFactory('planckTemperature', '1.416785e+32', 'K')\n\n// helper function to create a factory function which creates a physical constant,\n// a Unit with either a number value or a BigNumber value depending on the configuration\nfunction unitFactory (name, valueStr, unitStr) {\n const dependencies = ['config', 'Unit', 'BigNumber']\n\n return factory(name, dependencies, ({ config, Unit, BigNumber }) => {\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n const value = config.number === 'BigNumber'\n ? new BigNumber(valueStr)\n : parseFloat(valueStr)\n\n const unit = new Unit(value, unitStr)\n unit.fixPrefix = true\n return unit\n })\n}\n\n// helper function to create a factory function which creates a numeric constant,\n// either a number or BigNumber depending on the configuration\nfunction numberFactory (name, value) {\n const dependencies = ['config', 'BigNumber']\n\n return factory(name, dependencies, ({ config, BigNumber }) => {\n return config.number === 'BigNumber'\n ? new BigNumber(value)\n : value\n })\n}\n","import { errorTransform } from './utils/errorTransform.js'\nimport { factory } from '../../utils/factory.js'\nimport { createApply } from '../../function/matrix/apply.js'\nimport { isBigNumber, isNumber } from '../../utils/is.js'\n\nconst name = 'apply'\nconst dependencies = ['typed', 'isInteger']\n\n/**\n * Attach a transform function to math.apply\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function apply\n * from one-based to zero based\n */\nexport const createApplyTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, isInteger }) => {\n const apply = createApply({ typed, isInteger })\n\n // @see: comment of concat itself\n return typed('apply', {\n '...any': function (args) {\n // change dim from one-based to zero-based\n const dim = args[1]\n\n if (isNumber(dim)) {\n args[1] = dim - 1\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1)\n }\n\n try {\n return apply.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { errorTransform } from './utils/errorTransform.js'\nimport { factory } from '../../utils/factory.js'\nimport { createColumn } from '../../function/matrix/column.js'\nimport { isNumber } from '../../utils/is.js'\n\nconst name = 'column'\nconst dependencies = ['typed', 'Index', 'matrix', 'range']\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport const createColumnTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, Index, matrix, range }) => {\n const column = createColumn({ typed, Index, matrix, range })\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function (args) {\n // change last argument from zero-based to one-based\n const lastIndex = args.length - 1\n const last = args[lastIndex]\n if (isNumber(last)) {\n args[lastIndex] = last - 1\n }\n\n try {\n return column.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { isSymbolNode } from '../../../utils/is.js'\nimport { PartitionedMap } from '../../../utils/map.js'\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression (expression, math, scope) {\n // find an undefined symbol\n const symbol = expression.filter(function (node) {\n return isSymbolNode(node) &&\n !(node.name in math) &&\n !(scope.has(node.name))\n })[0]\n\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"')\n }\n\n // create a test function for this equation\n const name = symbol.name // variable name\n const argsScope = new Map()\n const subScope = new PartitionedMap(scope, argsScope, new Set([name]))\n const eq = expression.compile()\n return function inlineExpression (x) {\n argsScope.set(name, x)\n return eq.evaluate(subScope)\n }\n}\n","import { factory } from '../../../utils/factory.js'\n\nconst name = 'transformCallback'\nconst dependencies = ['typed']\n\nexport const createTransformCallback = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Transforms the given callback function based on its type and number of arrays.\n *\n * @param {Function} callback - The callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n return function (callback, numberOfArrays) {\n if (typed.isTypedFunction(callback)) {\n return _transformTypedCallbackFunction(callback, numberOfArrays)\n } else {\n return _transformCallbackFunction(callback, callback.length, numberOfArrays)\n }\n }\n\n /**\n * Transforms the given typed callback function based on the number of arrays.\n *\n * @param {Function} typedFunction - The typed callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n function _transformTypedCallbackFunction (typedFunction, numberOfArrays) {\n const signatures = Object.fromEntries(\n Object.entries(typedFunction.signatures)\n .map(([signature, callbackFunction]) => {\n const numberOfCallbackInputs = signature.split(',').length\n if (typed.isTypedFunction(callbackFunction)) {\n return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)]\n } else {\n return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)]\n }\n })\n )\n\n if (typeof typedFunction.name === 'string') {\n return typed(typedFunction.name, signatures)\n } else {\n return typed(signatures)\n }\n }\n})\n\n/**\n * Transforms the callback function based on the number of callback inputs and arrays.\n * There are three cases:\n * 1. The callback function has N arguments.\n * 2. The callback function has N+1 arguments.\n * 3. The callback function has 2N+1 arguments.\n *\n * @param {Function} callbackFunction - The callback function to transform.\n * @param {number} numberOfCallbackInputs - The number of callback inputs.\n * @param {number} numberOfArrays - The number of arrays.\n * @returns {Function} The transformed callback function.\n */\nfunction _transformCallbackFunction (callbackFunction, numberOfCallbackInputs, numberOfArrays) {\n if (numberOfCallbackInputs === numberOfArrays) {\n return callbackFunction\n } else if (numberOfCallbackInputs === numberOfArrays + 1) {\n return function (...args) {\n const vals = args.slice(0, numberOfArrays)\n const idx = _transformDims(args[numberOfArrays])\n return callbackFunction(...vals, idx)\n }\n } else if (numberOfCallbackInputs > numberOfArrays + 1) {\n return function (...args) {\n const vals = args.slice(0, numberOfArrays)\n const idx = _transformDims(args[numberOfArrays])\n const rest = args.slice(numberOfArrays + 1)\n return callbackFunction(...vals, idx, ...rest)\n }\n } else {\n return callbackFunction\n }\n}\n\n/**\n * Transforms the dimensions by adding 1 to each dimension.\n *\n * @param {Array} dims - The dimensions to transform.\n * @returns {Array} The transformed dimensions.\n */\nfunction _transformDims (dims) {\n return dims.map(dim => dim + 1)\n}\n","import { createFilter } from '../../function/matrix/filter.js'\nimport { factory } from '../../utils/factory.js'\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'\nimport { compileInlineExpression } from './utils/compileInlineExpression.js'\nimport { createTransformCallback } from './utils/transformCallback.js'\n\nconst name = 'filter'\nconst dependencies = ['typed']\n\nexport const createFilterTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform (args, math, scope) {\n const filter = createFilter({ typed })\n const transformCallback = createTransformCallback({ typed })\n\n if (args.length === 0) {\n return filter()\n }\n let x = args[0]\n\n if (args.length === 1) {\n return filter(x)\n }\n\n const N = args.length - 1\n let callback = args[N]\n\n if (x) {\n x = _compileAndEvaluate(x, scope)\n }\n\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope)\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope)\n }\n }\n\n return filter(x, transformCallback(callback, N))\n }\n filterTransform.rawArgs = true\n\n function _compileAndEvaluate (arg, scope) {\n return arg.compile().evaluate(scope)\n }\n\n return filterTransform\n}, { isTransformFunction: true })\n","import { createForEach } from '../../function/matrix/forEach.js'\nimport { createTransformCallback } from './utils/transformCallback.js'\nimport { factory } from '../../utils/factory.js'\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'\nimport { compileInlineExpression } from './utils/compileInlineExpression.js'\n\nconst name = 'forEach'\nconst dependencies = ['typed']\n\nexport const createForEachTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n const forEach = createForEach({ typed })\n const transformCallback = createTransformCallback({ typed })\n function forEachTransform (args, math, scope) {\n if (args.length === 0) {\n return forEach()\n }\n let x = args[0]\n\n if (args.length === 1) {\n return forEach(x)\n }\n\n const N = args.length - 1\n let callback = args[N]\n\n if (x) {\n x = _compileAndEvaluate(x, scope)\n }\n\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope)\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope)\n }\n }\n\n return forEach(x, transformCallback(callback, N))\n }\n forEachTransform.rawArgs = true\n\n function _compileAndEvaluate (arg, scope) {\n return arg.compile().evaluate(scope)\n }\n return forEachTransform\n}, { isTransformFunction: true })\n","import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'index'\nconst dependencies = ['Index', 'getMatrixDataType']\n\nexport const createIndexTransform = /* #__PURE__ */ factory(name, dependencies, ({ Index, getMatrixDataType }) => {\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform () {\n const args = []\n for (let i = 0, ii = arguments.length; i < ii; i++) {\n let arg = arguments[i]\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--\n arg.end -= (arg.step > 0 ? 0 : 2)\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) { return v - 1 })\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) { return v - 1 })\n }\n } else if (isNumber(arg)) {\n arg--\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range')\n }\n\n args[i] = arg\n }\n\n const res = new Index()\n Index.apply(res, args)\n return res\n }\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'\nimport { createMap } from '../../function/matrix/map.js'\nimport { compileInlineExpression } from './utils/compileInlineExpression.js'\nimport { createTransformCallback } from './utils/transformCallback.js'\n\nconst name = 'map'\nconst dependencies = ['typed']\n\nexport const createMapTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n const map = createMap({ typed })\n const transformCallback = createTransformCallback({ typed })\n\n function mapTransform (args, math, scope) {\n if (args.length === 0) {\n return map()\n }\n\n if (args.length === 1) {\n return map(args[0])\n }\n const N = args.length - 1\n let X = args.slice(0, N)\n let callback = args[N]\n X = X.map(arg => _compileAndEvaluate(arg, scope))\n\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope)\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope)\n }\n }\n return map(...X, transformCallback(callback, N))\n\n function _compileAndEvaluate (arg, scope) {\n return arg.compile().evaluate(scope)\n }\n }\n mapTransform.rawArgs = true\n\n return mapTransform\n}, { isTransformFunction: true })\n","import { isCollection } from '../../../utils/is.js'\nimport { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js'\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase (args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice()\n const dim = args[1]\n if (isNumberOrBigNumber(dim)) {\n args[1] = dimToZeroBase(dim)\n }\n }\n return args\n}\n","import { isNumber, isBigNumber } from '../../../utils/is.js'\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function dimToZeroBase (dim) {\n if (isNumber(dim)) {\n return dim - 1\n } else if (isBigNumber(dim)) {\n return dim.minus(1)\n } else {\n return dim\n }\n}\n\nexport function isNumberOrBigNumber (n) {\n return isNumber(n) || isBigNumber(n)\n}\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createMax } from '../../function/statistics/max.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'max'\nconst dependencies = ['typed', 'config', 'numeric', 'larger']\n\nexport const createMaxTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger }) => {\n const max = createMax({ typed, config, numeric, larger })\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return max.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createMean } from '../../function/statistics/mean.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'mean'\nconst dependencies = ['typed', 'add', 'divide']\n\nexport const createMeanTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, divide }) => {\n const mean = createMean({ typed, add, divide })\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return mean.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createMin } from '../../function/statistics/min.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'min'\nconst dependencies = ['typed', 'config', 'numeric', 'smaller']\n\nexport const createMinTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller }) => {\n const min = createMin({ typed, config, numeric, smaller })\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return min.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { createRange } from '../../function/matrix/range.js'\n\nconst name = 'range'\nconst dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']\n\nexport const createRangeTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq, add, isPositive }) => {\n const range = createRange({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq, add, isPositive })\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function (args) {\n const lastIndex = args.length - 1\n const last = args[lastIndex]\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true)\n }\n\n return range.apply(null, args)\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { createRow } from '../../function/matrix/row.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { isNumber } from '../../utils/is.js'\n\nconst name = 'row'\nconst dependencies = ['typed', 'Index', 'matrix', 'range']\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport const createRowTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, Index, matrix, range }) => {\n const row = createRow({ typed, Index, matrix, range })\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function (args) {\n // change last argument from zero-based to one-based\n const lastIndex = args.length - 1\n const last = args[lastIndex]\n if (isNumber(last)) {\n args[lastIndex] = last - 1\n }\n\n try {\n return row.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createSubset } from '../../function/matrix/subset.js'\n\nconst name = 'subset'\nconst dependencies = ['typed', 'matrix', 'zeros', 'add']\n\nexport const createSubsetTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, zeros, add }) => {\n const subset = createSubset({ typed, matrix, zeros, add })\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function (args) {\n try {\n return subset.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { isBigNumber, isNumber } from '../../utils/is.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { factory } from '../../utils/factory.js'\nimport { createConcat } from '../../function/matrix/concat.js'\n\nconst name = 'concat'\nconst dependencies = ['typed', 'matrix', 'isInteger']\n\nexport const createConcatTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, isInteger }) => {\n const concat = createConcat({ typed, matrix, isInteger })\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function (args) {\n // change last argument from one-based to zero-based\n const lastIndex = args.length - 1\n const last = args[lastIndex]\n if (isNumber(last)) {\n args[lastIndex] = last - 1\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1)\n }\n\n try {\n return concat.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createDiff } from '../../function/matrix/diff.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'diff'\nconst dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber']\n\nexport const createDiffTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtract, number, bignumber }) => {\n const diff = createDiff({ typed, matrix, subtract, number, bignumber })\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return diff.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { createStd } from '../../function/statistics/std.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'std'\nconst dependencies = ['typed', 'map', 'sqrt', 'variance']\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport const createStdTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, map, sqrt, variance }) => {\n const std = createStd({ typed, map, sqrt, variance })\n\n return typed('std', {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return std.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createSum } from '../../function/statistics/sum.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nconst name = 'sum'\nconst dependencies = ['typed', 'config', 'add', 'numeric']\n\nexport const createSumTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, numeric }) => {\n const sum = createSum({ typed, config, add, numeric })\n\n return typed(name, {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return sum.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'quantileSeq'\nconst dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport const createQuantileSeqTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, bignumber, add, subtract, divide, multiply, partitionSelect, compare, isInteger, smaller, smallerEq, larger }) => {\n const quantileSeq = createQuantileSeq({ typed, bignumber, add, subtract, divide, multiply, partitionSelect, compare, isInteger, smaller, smallerEq, larger })\n\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n })\n\n function dimToZeroBase (dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1]\n }\n}, { isTransformFunction: true })\n","import { isBigNumber, isCollection, isNumber } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createCumSum } from '../../function/statistics/cumsum.js'\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nconst name = 'cumsum'\nconst dependencies = ['typed', 'add', 'unaryPlus']\n\nexport const createCumSumTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, unaryPlus }) => {\n const cumsum = createCumSum({ typed, add, unaryPlus })\n\n return typed(name, {\n '...any': function (args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n const dim = args[1]\n if (isNumber(dim)) {\n args[1] = dim - 1\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1)\n }\n }\n\n try {\n return cumsum.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { factory } from '../../utils/factory.js'\nimport { errorTransform } from './utils/errorTransform.js'\nimport { createVariance } from '../../function/statistics/variance.js'\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'\n\nconst name = 'variance'\nconst dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport const createVarianceTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, subtract, multiply, divide, apply, isNaN }) => {\n const variance = createVariance({ typed, add, subtract, multiply, divide, apply, isNaN })\n\n return typed(name, {\n '...any': function (args) {\n args = lastDimToZeroBase(args)\n\n try {\n return variance.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true })\n","import { createPrint } from '../../function/string/print.js'\nimport { factory } from '../../utils/factory.js'\nimport { printTemplate } from '../../utils/print.js'\n\nconst name = 'print'\nconst dependencies = ['typed', 'matrix', 'zeros', 'add']\n\nexport const createPrintTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, zeros, add }) => {\n const print = createPrint({ typed, matrix, zeros, add })\n return typed(name, {\n 'string, Object | Array': function (template, values) { return print(_convertTemplateToZeroBasedIndex(template), values) },\n 'string, Object | Array, number | Object': function (template, values, options) { return print(_convertTemplateToZeroBasedIndex(template), values, options) }\n })\n\n function _convertTemplateToZeroBasedIndex (template) {\n return template.replace(printTemplate, (x) => {\n const parts = x.slice(1).split('.')\n const result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1\n } else {\n return part\n }\n })\n return '$' + result.join('.')\n })\n }\n}, { isTransformFunction: true })\n","import { createAnd } from '../../function/logical/and.js'\nimport { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\n\nconst name = 'and'\nconst dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']\n\nexport const createAndTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, not, concat }) => {\n const and = createAnd({ typed, matrix, equalScalar, zeros, not, concat })\n\n function andTransform (args, math, scope) {\n const condition1 = args[0].compile().evaluate(scope)\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false\n }\n const condition2 = args[1].compile().evaluate(scope)\n return and(condition1, condition2)\n }\n\n andTransform.rawArgs = true\n\n return andTransform\n}, { isTransformFunction: true })\n","import { createOr } from '../../function/logical/or.js'\nimport { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\n\nconst name = 'or'\nconst dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']\n\nexport const createOrTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat }) => {\n const or = createOr({ typed, matrix, equalScalar, DenseMatrix, concat })\n\n function orTransform (args, math, scope) {\n const condition1 = args[0].compile().evaluate(scope)\n if (!isCollection(condition1) && or(condition1, false)) {\n return true\n }\n const condition2 = args[1].compile().evaluate(scope)\n return or(condition1, condition2)\n }\n\n orTransform.rawArgs = true\n\n return orTransform\n}, { isTransformFunction: true })\n","import { createBitAnd } from '../../function/bitwise/bitAnd.js'\nimport { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\n\nconst name = 'bitAnd'\nconst dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']\n\nexport const createBitAndTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, zeros, not, concat }) => {\n const bitAnd = createBitAnd({ typed, matrix, equalScalar, zeros, not, concat })\n\n function bitAndTransform (args, math, scope) {\n const condition1 = args[0].compile().evaluate(scope)\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN\n }\n if (condition1 === 0 || condition1 === false) {\n return 0\n }\n }\n const condition2 = args[1].compile().evaluate(scope)\n return bitAnd(condition1, condition2)\n }\n\n bitAndTransform.rawArgs = true\n\n return bitAndTransform\n}, { isTransformFunction: true })\n","import { createBitOr } from '../../function/bitwise/bitOr.js'\nimport { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\n\nconst name = 'bitOr'\nconst dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']\n\nexport const createBitOrTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat }) => {\n const bitOr = createBitOr({ typed, matrix, equalScalar, DenseMatrix, concat })\n\n function bitOrTransform (args, math, scope) {\n const condition1 = args[0].compile().evaluate(scope)\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN\n }\n if (condition1 === (-1)) {\n return -1\n }\n if (condition1 === true) {\n return 1\n }\n }\n const condition2 = args[1].compile().evaluate(scope)\n return bitOr(condition1, condition2)\n }\n\n bitOrTransform.rawArgs = true\n\n return bitOrTransform\n}, { isTransformFunction: true })\n","export const DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n relTol: 1e-12,\n\n // minimum absolute difference between two compared values,\n // used by all comparison functions\n absTol: 1e-15,\n\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n\n // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction'\n number: 'number',\n\n // type of fallback used for config { number: 'bigint' } when a value cannot be represented\n // in the configured numeric type. Choose 'number' (default) or 'BigNumber'.\n numberFallback: 'number',\n\n // number of significant digits in BigNumbers\n precision: 64,\n\n // predictable output type of functions. When true, output type depends only\n // on the input types. When false (default), output type can vary depending\n // on input values. For example `math.sqrt(-4)` returns `complex('2i')` when\n // predictable is false, and returns `NaN` when true.\n predictable: false,\n\n // random seed for seeded pseudo random number generation\n // null = randomly seed\n randomSeed: null\n}\n","import { clone, deepExtend } from '../../utils/object.js'\nimport { DEFAULT_CONFIG } from '../config.js'\n\nexport const MATRIX_OPTIONS = ['Matrix', 'Array'] // valid values for option matrix\nexport const NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction'] // valid values for option number\n\nexport function configFactory (config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', 'bigint', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config (options) {\n if (options) {\n if (options.epsilon !== undefined) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.')\n const optionsFix = clone(options)\n optionsFix.relTol = options.epsilon\n optionsFix.absTol = options.epsilon * 1e-3\n delete optionsFix.epsilon\n return _config(optionsFix)\n }\n const prev = clone(config)\n\n // validate some of the options\n validateOption(options, 'matrix', MATRIX_OPTIONS)\n validateOption(options, 'number', NUMBER_OPTIONS)\n\n // merge options\n deepExtend(config, options)\n\n const curr = clone(config)\n\n const changes = clone(options)\n\n // emit 'config' event\n emit('config', curr, prev, changes)\n\n return curr\n } else {\n return clone(config)\n }\n }\n\n // attach the valid options to the function so they can be extended\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS\n\n // attach the config properties as readonly properties to the config function\n Object.keys(DEFAULT_CONFIG).forEach(key => {\n Object.defineProperty(_config, key, {\n get: () => config[key],\n enumerable: true,\n configurable: true\n })\n })\n\n return _config\n}\n\n/**\n * Validate an option\n * @param {Object} options Object with options\n * @param {string} name Name of the option to validate\n * @param {Array.} values Array with valid values for this option\n */\nfunction validateOption (options, name, values) {\n if (options[name] !== undefined && !values.includes(options[name])) {\n // unknown value\n console.warn('Warning: Unknown value \"' + options[name] + '\" for configuration option \"' + name + '\". ' +\n 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.')\n }\n}\n","import * as all from './factoriesAny.js'\nimport { create } from './core/create.js'\n\nexport default create(all)\n","import typedFunction from 'typed-function'\nimport { ArgumentsError } from '../error/ArgumentsError.js'\nimport { DimensionError } from '../error/DimensionError.js'\nimport { IndexError } from '../error/IndexError.js'\nimport { factory, isFactory } from '../utils/factory.js'\nimport {\n isAccessorNode,\n isArray,\n isArrayNode,\n isAssignmentNode,\n isBigInt,\n isBigNumber,\n isBlockNode,\n isBoolean,\n isChain,\n isCollection,\n isComplex,\n isConditionalNode,\n isConstantNode,\n isDate,\n isDenseMatrix,\n isFraction,\n isFunction,\n isFunctionAssignmentNode,\n isFunctionNode,\n isHelp,\n isIndex,\n isIndexNode,\n isMap,\n isMatrix,\n isNode,\n isNull,\n isNumber,\n isObject,\n isObjectNode,\n isObjectWrappingMap,\n isOperatorNode,\n isParenthesisNode,\n isPartitionedMap,\n isRange,\n isRangeNode,\n isRegExp,\n isRelationalNode,\n isResultSet,\n isSparseMatrix,\n isString,\n isSymbolNode,\n isUndefined,\n isUnit\n} from '../utils/is.js'\nimport { deepFlatten, isLegacyFactory } from '../utils/object.js'\nimport * as emitter from './../utils/emitter.js'\nimport { DEFAULT_CONFIG } from './config.js'\nimport { configFactory } from './function/config.js'\nimport { importFactory } from './function/import.js'\n\n/**\n * Create a mathjs instance from given factory functions and optionally config\n *\n * Usage:\n *\n * const mathjs1 = create({ createAdd, createMultiply, ...})\n * const config = { number: 'BigNumber' }\n * const mathjs2 = create(all, config)\n *\n * @param {Object} [factories] An object with factory functions\n * The object can contain nested objects,\n * all nested objects will be flattened.\n * @param {Object} [config] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {boolean} predictable\n * Predictable output type of functions. When true,\n * output type depends only on the input types. When\n * false (default), output type can vary depending\n * on input values. For example `math.sqrt(-4)`\n * returns `complex('2i')` when predictable is false, and\n * returns `NaN` when true.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @returns {Object} Returns a bare-bone math.js instance containing\n * functions:\n * - `import` to add new functions\n * - `config` to change configuration\n * - `on`, `off`, `once`, `emit` for events\n */\nexport function create (factories, config) {\n const configInternal = Object.assign({}, DEFAULT_CONFIG, config)\n\n // simple test for ES5 support\n if (typeof Object.create !== 'function') {\n throw new Error('ES5 not supported by this JavaScript engine. ' +\n 'Please load the es5-shim and es5-sham library for compatibility.')\n }\n\n // create the mathjs instance\n const math = emitter.mixin({\n // only here for backward compatibility for legacy factory functions\n isNumber,\n isComplex,\n isBigNumber,\n isBigInt,\n isFraction,\n isUnit,\n isString,\n isArray,\n isMatrix,\n isCollection,\n isDenseMatrix,\n isSparseMatrix,\n isRange,\n isIndex,\n isBoolean,\n isResultSet,\n isHelp,\n isFunction,\n isDate,\n isRegExp,\n isObject,\n isMap,\n isPartitionedMap,\n isObjectWrappingMap,\n isNull,\n isUndefined,\n\n isAccessorNode,\n isArrayNode,\n isAssignmentNode,\n isBlockNode,\n isConditionalNode,\n isConstantNode,\n isFunctionAssignmentNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRangeNode,\n isRelationalNode,\n isSymbolNode,\n\n isChain\n })\n\n // load config function and apply provided config\n math.config = configFactory(configInternal, math.emit)\n\n math.expression = {\n transform: {},\n mathWithTransform: {\n config: math.config\n }\n }\n\n // cached factories and instances used by function load\n const legacyFactories = []\n const legacyInstances = []\n\n /**\n * Load a function or data type from a factory.\n * If the function or data type already exists, the existing instance is\n * returned.\n * @param {Function} factory\n * @returns {*}\n */\n function load (factory) {\n if (isFactory(factory)) {\n return factory(math)\n }\n\n const firstProperty = factory[Object.keys(factory)[0]]\n if (isFactory(firstProperty)) {\n return firstProperty(math)\n }\n\n if (!isLegacyFactory(factory)) {\n console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory)\n throw new Error('Factory object with properties `type`, `name`, and `factory` expected')\n }\n\n const index = legacyFactories.indexOf(factory)\n let instance\n if (index === -1) {\n // doesn't yet exist\n if (factory.math === true) {\n // pass with math namespace\n instance = factory.factory(math.type, configInternal, load, math.typed, math)\n } else {\n instance = factory.factory(math.type, configInternal, load, math.typed)\n }\n\n // append to the cache\n legacyFactories.push(factory)\n legacyInstances.push(instance)\n } else {\n // already existing function, return the cached instance\n instance = legacyInstances[index]\n }\n\n return instance\n }\n\n const importedFactories = {}\n\n // load the import function\n function lazyTyped (...args) {\n return math.typed.apply(math.typed, args)\n }\n lazyTyped.isTypedFunction = typedFunction.isTypedFunction\n\n const internalImport = importFactory(lazyTyped, load, math, importedFactories)\n math.import = internalImport\n\n // listen for changes in config, import all functions again when changed\n // TODO: move this listener into the import function?\n math.on('config', () => {\n Object.values(importedFactories).forEach(factory => {\n if (factory && factory.meta && factory.meta.recreateOnConfigChange) {\n // FIXME: only re-create when the current instance is the same as was initially created\n // FIXME: delete the functions/constants before importing them again?\n internalImport(factory, { override: true })\n }\n })\n })\n\n // the create function exposed on the mathjs instance is bound to\n // the factory functions passed before\n math.create = create.bind(null, factories)\n\n // export factory function\n math.factory = factory\n\n // import the factory functions like createAdd as an array instead of object,\n // else they will get a different naming (`createAdd` instead of `add`).\n math.import(Object.values(deepFlatten(factories)))\n\n math.ArgumentsError = ArgumentsError\n math.DimensionError = DimensionError\n math.IndexError = IndexError\n\n return math\n}\n","import Emitter from 'tiny-emitter'\n\n/**\n * Extend given object with emitter functions `on`, `off`, `once`, `emit`\n * @param {Object} obj\n * @return {Object} obj\n */\nexport function mixin (obj) {\n // create event emitter\n const emitter = new Emitter()\n\n // bind methods to obj (we don't want to expose the emitter.e Array...)\n obj.on = emitter.on.bind(emitter)\n obj.off = emitter.off.bind(emitter)\n obj.once = emitter.once.bind(emitter)\n obj.emit = emitter.emit.bind(emitter)\n\n return obj\n}\n","import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js'\nimport { isFactory, stripOptionalNotation } from '../../utils/factory.js'\nimport { hasOwnProperty, lazy } from '../../utils/object.js'\nimport { ArgumentsError } from '../../error/ArgumentsError.js'\n\nexport function importFactory (typed, load, math, importedFactories) {\n /**\n * Import functions from an object or a module.\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.import(functions)\n * math.import(functions, options)\n *\n * Where:\n *\n * - `functions: Object`\n * An object with functions or factories to be imported.\n * - `options: Object` An object with import options. Available options:\n * - `override: boolean`\n * If true, existing functions will be overwritten. False by default.\n * - `silent: boolean`\n * If true, the function will not throw errors on duplicates or invalid\n * types. False by default.\n * - `wrap: boolean`\n * If true, the functions will be wrapped in a wrapper function\n * which converts data types like Matrix to primitive data types like Array.\n * The wrapper is needed when extending math.js with libraries which do not\n * support these data type. False by default.\n *\n * Examples:\n *\n * import { create, all } from 'mathjs'\n * import * as numbers from 'numbers'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * // define new functions and variables\n * math.import({\n * myvalue: 42,\n * hello: function (name) {\n * return 'hello, ' + name + '!'\n * }\n * })\n *\n * // use the imported function and variable\n * math.myvalue * 2 // 84\n * math.hello('user') // 'hello, user!'\n *\n * // import the npm module 'numbers'\n * // (must be installed first with `npm install numbers`)\n * math.import(numbers, {wrap: true})\n *\n * math.fibonacci(7) // returns 13\n *\n * @param {Object | Array} functions Object with functions to be imported.\n * @param {Object} [options] Import options.\n */\n function mathImport (functions, options) {\n const num = arguments.length\n if (num !== 1 && num !== 2) {\n throw new ArgumentsError('import', num, 1, 2)\n }\n\n if (!options) {\n options = {}\n }\n\n function flattenImports (flatValues, value, name) {\n if (Array.isArray(value)) {\n value.forEach(item => flattenImports(flatValues, item))\n } else if (typeof value === 'object') {\n for (const name in value) {\n if (hasOwnProperty(value, name)) {\n flattenImports(flatValues, value[name], name)\n }\n }\n } else if (isFactory(value) || name !== undefined) {\n const flatName = isFactory(value)\n ? isTransformFunctionFactory(value)\n ? (value.fn + '.transform') // TODO: this is ugly\n : value.fn\n : name\n\n // we allow importing the same function twice if it points to the same implementation\n if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) {\n throw new Error('Cannot import \"' + flatName + '\" twice')\n }\n\n flatValues[flatName] = value\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected')\n }\n }\n }\n\n const flatValues = {}\n flattenImports(flatValues, functions)\n\n for (const name in flatValues) {\n if (hasOwnProperty(flatValues, name)) {\n // console.log('import', name)\n const value = flatValues[name]\n\n if (isFactory(value)) {\n // we ignore name here and enforce the name of the factory\n // maybe at some point we do want to allow overriding it\n // in that case we can implement an option overrideFactoryNames: true\n _importFactory(value, options)\n } else if (isSupportedType(value)) {\n _import(name, value, options)\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected')\n }\n }\n }\n }\n }\n\n /**\n * Add a property to the math namespace\n * @param {string} name\n * @param {*} value\n * @param {Object} options See import for a description of the options\n * @private\n */\n function _import (name, value, options) {\n // TODO: refactor this function, it's to complicated and contains duplicate code\n if (options.wrap && typeof value === 'function') {\n // create a wrapper around the function\n value = _wrap(value)\n }\n\n // turn a plain function with a typed-function signature into a typed-function\n if (hasTypedFunctionSignature(value)) {\n value = typed(name, {\n [value.signature]: value\n })\n }\n\n if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {\n if (options.override) {\n // give the typed function the right name\n value = typed(name, value.signatures)\n } else {\n // merge the existing and typed function\n value = typed(math[name], value)\n }\n\n math[name] = value\n delete importedFactories[name]\n\n _importTransform(name, value)\n math.emit('import', name, function resolver () {\n return value\n })\n return\n }\n\n if (math[name] === undefined || options.override) {\n math[name] = value\n delete importedFactories[name]\n\n _importTransform(name, value)\n math.emit('import', name, function resolver () {\n return value\n })\n return\n }\n\n if (!options.silent) {\n throw new Error('Cannot import \"' + name + '\": already exists')\n }\n }\n\n function _importTransform (name, value) {\n if (value && typeof value.transform === 'function') {\n math.expression.transform[name] = value.transform\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value.transform\n }\n } else {\n // remove existing transform\n delete math.expression.transform[name]\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value\n }\n }\n }\n\n function _deleteTransform (name) {\n delete math.expression.transform[name]\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = math[name]\n } else {\n delete math.expression.mathWithTransform[name]\n }\n }\n\n /**\n * Create a wrapper a round an function which converts the arguments\n * to their primitive values (like convert a Matrix to Array)\n * @param {Function} fn\n * @return {Function} Returns the wrapped function\n * @private\n */\n function _wrap (fn) {\n const wrapper = function wrapper () {\n const args = []\n for (let i = 0, len = arguments.length; i < len; i++) {\n const arg = arguments[i]\n args[i] = arg && arg.valueOf()\n }\n return fn.apply(math, args)\n }\n\n if (fn.transform) {\n wrapper.transform = fn.transform\n }\n\n return wrapper\n }\n\n /**\n * Import an instance of a factory into math.js\n * @param {function(scope: object)} factory\n * @param {Object} options See import for a description of the options\n * @param {string} [name=factory.name] Optional custom name\n * @private\n */\n function _importFactory (factory, options, name = factory.fn) {\n if (name.includes('.')) {\n throw new Error('Factory name should not contain a nested path. ' +\n 'Name: ' + JSON.stringify(name))\n }\n\n const namespace = isTransformFunctionFactory(factory)\n ? math.expression.transform\n : math\n\n const existingTransform = name in math.expression.transform\n const existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined\n\n const resolver = function () {\n // collect all dependencies, handle finding both functions and classes and other special cases\n const dependencies = {}\n factory.dependencies\n .map(stripOptionalNotation)\n .forEach(dependency => {\n if (dependency.includes('.')) {\n throw new Error('Factory dependency should not contain a nested path. ' +\n 'Name: ' + JSON.stringify(dependency))\n }\n\n if (dependency === 'math') {\n dependencies.math = math\n } else if (dependency === 'mathWithTransform') {\n dependencies.mathWithTransform = math.expression.mathWithTransform\n } else if (dependency === 'classes') { // special case for json reviver\n dependencies.classes = math\n } else {\n dependencies[dependency] = math[dependency]\n }\n })\n\n const instance = /* #__PURE__ */ factory(dependencies)\n\n if (instance && typeof instance.transform === 'function') {\n throw new Error('Transforms cannot be attached to factory functions. ' +\n 'Please create a separate function for it with export const path = \"expression.transform\"')\n }\n\n if (existing === undefined || options.override) {\n return instance\n }\n\n if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) {\n // merge the existing and new typed function\n return typed(existing, instance)\n }\n\n if (options.silent) {\n // keep existing, ignore imported function\n return existing\n } else {\n throw new Error('Cannot import \"' + name + '\": already exists')\n }\n }\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver)\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name)\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name])\n }\n }\n } else {\n namespace[name] = resolver()\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name)\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name])\n }\n }\n }\n\n // TODO: improve factories, store a list with imports instead which can be re-played\n importedFactories[name] = factory\n\n math.emit('import', name, resolver)\n }\n\n /**\n * Check whether given object is a type which can be imported\n * @param {Function | number | string | boolean | null | Unit | Complex} object\n * @return {boolean}\n * @private\n */\n function isSupportedType (object) {\n return typeof object === 'function' ||\n typeof object === 'number' ||\n typeof object === 'string' ||\n typeof object === 'boolean' ||\n object === null ||\n isUnit(object) ||\n isComplex(object) ||\n isBigNumber(object) ||\n isFraction(object) ||\n isMatrix(object) ||\n Array.isArray(object)\n }\n\n function hasTypedFunctionSignature (fn) {\n return typeof fn === 'function' && typeof fn.signature === 'string'\n }\n\n function allowedInExpressions (name) {\n return !hasOwnProperty(unsafe, name)\n }\n\n function factoryAllowedInExpressions (factory) {\n return !factory.fn.includes('.') && // FIXME: make checking on path redundant, check on meta data instead\n !hasOwnProperty(unsafe, factory.fn) &&\n (!factory.meta || !factory.meta.isClass)\n }\n\n function isTransformFunctionFactory (factory) {\n return (factory !== undefined &&\n factory.meta !== undefined &&\n factory.meta.isTransformFunction === true) || false\n }\n\n // namespaces and functions not available in the parser for safety reasons\n const unsafe = {\n expression: true,\n type: true,\n docs: true,\n error: true,\n json: true,\n chain: true // chain method not supported. Note that there is a unit chain too.\n }\n\n return mathImport\n}\n"],"names":["root","factory","exports","module","define","amd","this","cosh","Math","x","abs","exp","sinh","parser_exit","SyntaxError","logHypot","a","b","_a","_b","log","LN2","Complex","z","undefined","Number","isFinite","cos","sin","length","tokens","match","plus","minus","i","c","isNaN","parseFloat","parse","prototype","t","d","pow","arg","atan2","loh","re","im","r","sqrt","tmp","expm1","PI","xx","cosm1","y","t1","t2","Infinity","atan","acos","asin","res","noIM","oneMinus","onePlus","temp","atanh","asinh","acosh","places","ceil","floor","round","ret","E","NaN","_extends","Object","assign","target","arguments","source","key","hasOwnProperty","call","defaultEscapes","$","_","formatEscapes","defaultEscapeMapFn","str","_ref","_ref$preserveFormatti","preserveFormatting","_ref$escapeMapFn","escapeMapFn","runningStr","String","result","escapes","escapeKeys","keys","_loop","specialCharFound","forEach","index","slice","naturalSort","oFxNcL","oFyNcL","sre","dre","hre","ore","s","insensitive","toLowerCase","replace","xN","split","yN","xD","parseInt","Date","yD","cLoc","numS","max","alea","xor128","xorwow","xorshift7","xor4096","tychei","sr","global","Alea","seed","n","me","mash","data","h","charCodeAt","next","s0","s1","s2","copy","f","impl","opts","xg","state","prng","int32","double","quick","XorGen","strseed","k","w","v","X","j","limit","init","push","pool","math","nodecrypto","width","startdenom","significance","overflow","mask","seedrandom","options","callback","shortseed","mixkey","flatten","entropy","tostring","out","randomBytes","Uint8Array","crypto","msCrypto","getRandomValues","e","browser","navigator","plugins","screen","autoseed","arc4","ARC4","g","S","pass","is_math_call","keylen","count","obj","depth","prop","typ","smear","stringseed","fromCharCode","apply","random","ex","self","on","name","ctx","fn","once","listener","off","emit","evtArr","len","evts","liveEvents","TinyEmitter","isCallable","tryToString","$TypeError","TypeError","argument","isConstructor","isPossiblePrototype","$String","wellKnownSymbol","create","defineProperty","UNSCOPABLES","ArrayPrototype","Array","configurable","value","charAt","unicode","isPrototypeOf","it","Prototype","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","O","includes","indexOf","fails","METHOD_NAME","method","aCallable","toObject","IndexedObject","REDUCE_EMPTY","IS_RIGHT","that","callbackfn","argumentsLength","memo","left","right","uncurryThis","arraySlice","sort","array","comparefn","element","middle","llength","rlength","lindex","rindex","ITERATOR","SAFE_CLOSING","called","iteratorWithReturn","done","from","error","exec","SKIP_CLOSING","ITERATION_SUPPORT","object","toString","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","$Object","CORRECT_ARGUMENTS","tag","tryGet","callee","hasOwn","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","getOwnPropertyDescriptor","DESCRIPTORS","createPropertyDescriptor","bitmap","enumerable","writable","makeBuiltIn","descriptor","get","getter","set","setter","defineGlobalProperty","simple","unsafe","nonConfigurable","nonWritable","globalThis","P","document","EXISTS","createElement","firefox","UA","test","userAgent","Pebble","ENVIRONMENT","version","process","Deno","versions","v8","webkit","classof","userAgentStartsWith","string","Bun","window","createNonEnumerableProperty","defineBuiltIn","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","dontCallGetSet","forced","sham","regexpExec","SPECIES","RegExpPrototype","RegExp","KEY","FORCED","SHAM","SYMBOL","DELEGATES_TO_SYMBOL","DELEGATES_TO_EXEC","execCalled","constructor","flags","nativeRegExpMethod","methods","nativeMethod","regexp","arg2","forceStringMethod","$exec","NATIVE_BIND","FunctionPrototype","Function","Reflect","bind","getDescriptor","PROPER","CONFIGURABLE","uncurryThisWithBind","namespace","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","isArray","replacer","rawLength","keysLength","V","func","SUBSTITUTION_SYMBOLS","SUBSTITUTION_SYMBOLS_NO_NAMED","matched","position","captures","namedCaptures","replacement","tailPos","m","symbols","ch","capture","check","console","getBuiltIn","propertyIsEnumerable","setPrototypeOf","dummy","Wrapper","NewTarget","NewTargetPrototype","store","functionToString","inspectSource","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","metadata","facade","STATE","enforce","getterFor","TYPE","type","documentAll","all","noop","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","feature","detection","normalize","POLYFILL","NATIVE","MATCH","isRegExp","USE_SYMBOL_AS_UID","$Symbol","isArrayIteratorMethod","getIterator","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterator","iterFn","step","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","stop","condition","callFn","kind","innerResult","innerError","toLength","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","join","CONFIGURABLE_LENGTH","TEMPLATE","arity","trunc","notify","toggle","node","promise","then","safeGetBuiltIn","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","IS_NODE","MutationObserver","WebKitMutationObserver","Promise","microtask","queue","flush","parent","domain","exit","head","enter","resolve","nextTick","createTextNode","observe","characterData","add","PromiseCapability","C","reject","$$resolve","$$reject","activeXDocument","definePropertiesModule","enumBugKeys","html","documentCreateElement","PROTOTYPE","SCRIPT","IE_PROTO","EmptyConstructor","scriptTag","content","LT","NullProtoObjectViaActiveX","write","close","parentWindow","NullProtoObject","ActiveXObject","iframeDocument","iframe","JS","style","display","appendChild","src","contentWindow","open","F","Properties","V8_PROTOTYPE_DEFINE_BUG","objectKeys","defineProperties","props","IE8_DOM_DEFINE","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","concat","getOwnPropertyNames","getOwnPropertySymbols","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","requireObjectCoercible","aPossiblePrototype","CORRECT_SETTER","proto","__proto__","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_PURE","V8_VERSION","NativePromisePrototype","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","Target","Source","tail","item","entry","R","re1","re2","regexpFlags","stickyHelpers","UNSUPPORTED_DOT_ALL","UNSUPPORTED_NCG","nativeReplace","nativeExec","patchedExec","UPDATES_LAST_INDEX_WRONG","lastIndex","UNSUPPORTED_Y","BROKEN_CARET","NPCG_INCLUDED","reCopy","group","raw","groups","sticky","charsAdded","strCopy","multiline","hasIndices","ignoreCase","dotAll","unicodeSets","regExpFlags","$RegExp","MISSED_STICKY","defineBuiltInAccessor","CONSTRUCTOR_NAME","Constructor","TAG","uid","SHARED","mode","copyright","license","aConstructor","defaultConstructor","toIntegerOrInfinity","CONVERT_TO_STRING","pos","first","second","size","codeAt","symbol","Symbol","$location","defer","channel","port","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","MessageChannel","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","event","globalPostMessageDefer","postMessage","protocol","host","handler","args","now","port2","port1","onmessage","addEventListener","importScripts","removeChild","setTimeout","min","integer","number","isSymbol","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","postfix","NATIVE_SYMBOL","passed","required","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","$includes","addToUnscopables","$reduce","arrayMethodIsStrict","CHROME_VERSION","reduce","deletePropertyOrThrow","internalSort","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","STRICT_METHOD","STABLE_SORT","code","chr","itemsLength","items","arrayLength","getSortCompare","getReplacerFunction","$stringify","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","offset","prev","stringify","space","iterate","createProperty","fromEntries","newPromiseCapabilityModule","perform","capability","$promiseResolve","values","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","setToStringTag","setSpecies","anInstance","speciesConstructor","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","setInternalState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","createEvent","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","unwrap","internalReject","internalResolve","wrapper","executor","onFulfilled","PromiseWrapper","wrap","race","capabilityReject","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","inheritIfRequired","getRegExpFlags","proxyAccessor","NativeRegExp","stringIndexOf","IS_NCG","CORRECT_NEW","RegExpWrapper","pattern","rawFlags","handled","thisIsRegExp","patternIsRegExp","flagsAreUndefined","rawPattern","named","brackets","ncg","groupid","groupname","handleNCG","handleDotAll","fixRegExpWellKnownSymbolLogic","advanceStringIndex","getSubstitution","regExpExec","REPLACE","REPLACE_KEEPS_$0","REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE","maybeCallNative","UNSAFE_SUBSTITUTE","searchValue","replaceValue","rx","functionalReplace","fullUnicode","results","accumulatedResult","nextSourcePosition","replacerArgs","NativeSymbol","SymbolPrototype","description","EmptyStringDescriptionStore","SymbolWrapper","thisSymbolValue","symbolDescriptiveString","desc","notOk","undef","NOT_TYPED_FUNCTION","isPlainObject","_types","anyType","isAny","typeMap","typeList","nConversions","typed","createCount","findType","typeName","message","otherName","addTypes","types","beforeSpec","beforeIndex","newTypes","conversionsTo","affectedTypes","Map","findTypeNames","matches","filter","isTypedFunction","entity","findSignature","signature","exact","params","parseSignature","canonicalSignature","stringifyParams","signatures","_typedFunctionData","signatureMap","nParams","remainingSignatures","candidate","want","filteredSignatures","possibility","have","getParamAtIndex","restParam","hasAny","haveTypes","paramTypeSet","some","wtype","separator","map","p","parseParam","param","typeDefs","trim","paramName","typeIndex","conversion","conversionIndex","hasConversion","expandParam","matchingConversions","typeNames","knownTypes","Set","newMatch","availableConversions","newName","convertibleTypes","typeSet","rawSignature","rawParams","parsedParam","hasRestParam","last","compileTest","test0","test1","tests","compileTests","initial","varIndex","lastTest","testRestParam","getTypeSetAtIndex","isExactType","mergeExpectedParams","paramSet","createError","err","expected","_name","matchingSignatures","nextMatchingDefs","actualTypes","category","actual","lengths","maxLength","expectedLength","argTypes","getLowestTypeIndex","getLowestConversionIndex","compareParams","param1","param2","typeDiff","convDiff","compareSignatures","signature1","signature2","pars1","pars2","last1","last2","hasRest1","hasRest2","par","any1","conv1","any2","conv2","lengthCriterion","comparisons","tc","thisComparison","compileArgsPreprocessing","fnConvert","compiledConversions","compileArgConversion","fnPreprocess","conversion0","conversion1","conversions","convert","splitParams","_splitParams","paramsSoFar","resultingParams","exactTypes","arr","nextParam","conflicting","params1","params2","ii","typeSet1","typeSet2","overlap","len1","len2","restParam1","restParam2","collectResolutions","references","functionList","resolvedReferences","reference","resolution","resolveReferences","resolvedFunctions","isReferToSelf","referToSelf","isReferTo","makeReferTo","referTo","clearResolutions","isResolved","fill","leftUnresolved","nothingResolved","createTypedFunction","rawSignaturesMap","warnAgainstDeprecatedThis","signaturesMap","deprecatedThisRegex","validateDeprecatedThis","parsedParams","originalFunctions","preliminarySignatures","pp","functionIndex","conversionParams","sp","spName","every","theTypedFn","internalSignatureMap","ok0","ok1","ok2","ok3","ok4","ok5","allOk","test00","test10","test20","test30","test40","test50","test01","test11","test21","test31","test41","test51","implementation","fn0","fn1","fn2","fn3","fn4","fn5","len0","len3","len4","len5","iStart","iEnd","fns","generic","onMismatch","arg0","arg1","_onMismatch","start","end","objectOrFn","checkName","nameSoFar","Error","getObjectName","mergeSignatures","dest","sourceFunction","destFunction","saveTyped","_validateConversion","to","maybeName","allSignatures","thisName","theseSignatures","throwMismatchError","clearConversions","_findType","find","addType","beforeObjectTest","before","addConversion","override","existing","other","removeConversion","addConversions","existingConversion","findInArray","splice","tf","argList","sigs","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","amdD","amdO","definition","o","toStringTag","nmd","paths","children","getSafeProperty","isSafeProperty","isSafeMethod","setSafeProperty","safeNativeProperties","getPrototypeOf","safeNativeMethods","toLocaleString","ObjectWrappingMap","wrappedObject","entries","mapIterator","delete","PartitionedMap","bKeys","createEmptyMap","createMap","mapOrObject","isMap","isNumber","isBigNumber","isDecimal","isBigInt","isComplex","isFraction","isUnit","isString","isMatrix","isCollection","isDenseMatrix","isSparseMatrix","isRange","isIndex","isBoolean","isResultSet","isHelp","isFunction","isDate","isPartitionedMap","isObjectWrappingMap","isNull","isUndefined","isAccessorNode","isNode","isArrayNode","isAssignmentNode","isBlockNode","isConditionalNode","isConstantNode","rule2Node","isOperatorNode","op","isFunctionAssignmentNode","isFunctionNode","isIndexNode","isObjectNode","isParenthesisNode","isRangeNode","isRelationalNode","isSymbolNode","isChain","typeOf","clone","mapObject","extend","deepExtend","deepStrictEqual","deepFlatten","nestedObject","flattenedObject","_deepFlatten","lazy","valueResolver","_value","_uninitialized","property","dependencies","meta","assertAndCreate","scope","deps","properties","pickShallow","stripOptionalNotation","dependency","isOptionalDependency","missingDependencies","assertDependencies","isFactory","isInteger","safeNumberType","numberStr","config","numberFallback","sign","log2","log10","LN10","log1p","cbrt","negate","formatNumberToBase","base","prefix","suffix","format","notation","precision","wordSize","normalizeFormatOptions","toFixed","toExponential","rounded","roundDigits","splitNumber","exponent","coefficients","newExp","missingZeros","expDiff","decimalIdx","decimals","decimalVal","toEngineering","lowerExp","_toNumberOrDefault","upperExp","zeros","dot","toPrecision","digits","toNumber","_toNumberOrThrow","splitValue","shift","unshift","pop","nearlyEqual","relTol","absTol","EPSILON","tanh","onError","defaultValue","_createTyped","typedFunction","createTyped","BigNumber","DenseMatrix","Fraction","throwNoBignumber","throwNoComplex","MAX_SAFE_INTEGER","throwNoFraction","BigInt","throwNoMatrix","matrix","usualError","sig","createResultSet","ResultSet","toJSON","mathjs","fromJSON","json","isClass","inexact","quadrant","EXP_LIMIT","MAX_DIGITS","NUMERALS","DEFAULTS","rounding","modulo","toExpNeg","toExpPos","minE","maxE","external","decimalError","invalidArgument","precisionLimitExceeded","cryptoUnavailable","mathfloor","mathpow","isBinary","isHex","isOctal","BASE","LOG_BASE","LN10_PRECISION","PI_PRECISION","digitsToString","ws","indexOfLastWord","getZeroString","checkInt32","checkRoundingDigits","rm","repeating","di","rd","convertBase","baseIn","baseOut","arrL","strL","reverse","absoluteValue","finalise","clampedTo","clamp","Ctor","gt","cmp","comparedTo","xdL","ydL","xd","yd","xs","ys","cosine","pr","sd","isZero","tinyPow","taylorSeries","times","cos2x","toLessThanHalfPi","neg","cubeRoot","rep","t3","t3plusx","divide","eq","decimalPlaces","dp","dividedBy","div","dividedToIntegerBy","divToInt","equals","greaterThan","greaterThanOrEqualTo","gte","hyperbolicCosine","one","cosh2_x","d8","hyperbolicSine","sinh2_x","d5","d16","d20","hyperbolicTangent","inverseCosine","halfPi","isNeg","getPi","inverseHyperbolicCosine","lte","ln","inverseHyperbolicSine","inverseHyperbolicTangent","wpr","xsd","inverseSine","inverseTangent","px","x2","isInt","isNegative","isPositive","isPos","lessThan","lt","lessThanOrEqualTo","logarithm","isBase10","denominator","inf","num","naturalLogarithm","getLn10","sub","xe","xLTy","getBase10Exponent","mod","q","naturalExponential","negated","carry","getPrecision","sine","sin2_x","squareRoot","tangent","tan","mul","rL","toBinary","toStringBinary","toDecimalPlaces","toDP","finiteToString","toFraction","maxD","d0","d1","d2","n0","n1","toHexadecimal","toHex","toNearest","toOctal","toPower","yn","intPow","toSignificantDigits","toSD","truncated","multiplyInteger","compare","aL","bL","subtract","logBase","more","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","isTruncated","roundUp","xdi","isExp","nonFiniteToString","zs","truncate","isOdd","maxOrMin","ltgt","guard","sum","c0","numerator","x1","parseDecimal","search","substring","parseOther","divisor","isFloat","Decimal","isHyperbolic","u","pi","useDefaults","defaults","ps","hypot","isDecimalInstance","Uint32Array","for","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","EUCLID","createBigNumberClass","curr","createComplexClass","toPolar","phi","strRe","strIm","epsilon","hasBase","InvalidParameter","newFraction","DivisionByZero","gcd","factorize","factors","p1","p2","M","A","B","D","N","NonIntegerParameter","eps","thisABS","cont","excludeWhole","whole","dec","cycLen","cycleLen","cycOff","rem1","rem2","modpow","cycleStart","createFractionClass","createRangeClass","Range","hasStart","hasEnd","hasStep","nums","diff","toArray","createMatrixClass","Matrix","storage","datatype","subset","resize","reshape","skipZeros","formatBigNumberToBase","big2","BigNumberCtor","endsWith","text","formatNumber","valueStr","formatBigNumber","looksLikeFraction","fraction","formatArray","syntax","_format","escaped","controlCharacters","escape","compareText","DimensionError","relation","stack","IndexError","arraySize","_validate","dim","dimNext","child","validate","validateIndexSourceSize","valueSize","_size","_sourceSize","sourceDim","validateIndex","isEmptyIndex","_dimensions","dimension","_data","_resize","elem","oldLen","newLen","minLen","sizes","flatArray","currentLength","newLength","product","processSizesWildcard","tmpArray2","tmpArray","sizeIndex","_reshape","processedSizes","wildCardIndex","squeeze","dims","_squeeze","unsqueeze","outer","_unsqueeze","flat","filterRegExp","identify","identifier","generalize","getArrayDataType","itemType","concatRecursive","concatDim","arrays","broadcastSizes","_len","_key","dimensions","sizeMax","checkBroadcastingRules","toSize","broadcastTo","Asize","broadcastedSize","paddedSize","arrayToStretch","sizeToStretch","dimToStretch","acc","recurse","optimizeCallback","firstIndex","firstValue","hasSingleSignature","numberOfArguments","testArgs","_findNumberOfArguments","fastCallback","_tryFunctionWithArgs","_len2","_key2","mappingFnName","callbackName","_err$data","argsDesc","_typeOf","JSON","_createCallbackError","RangeError","isDimensionError","isIndexError","createDenseMatrixClass","_datatype","preprocess","_getSubmatrix","range","_setSubmatrix","submatrix","dataIndex","subIndex","_fit","newSize","changed","createDenseMatrix","getDataType","isScalar","_get","iSize","sSize","_unused","_set","indexI","sizeArray","_forEach","rows","row","columns","col","diagonal","kSuper","kSub","ms","swapRows","_swapRows","vi","createClone","any","objectClone","_switch","mat","I","J","containsCollections","deepForEach","deepMap","_reduce","tran","scatter","mark","cindex","inverse","update","avalues","_values","aindex","_index","aptr","_ptr","k0","k1","createIsInteger","isIntegerNumber","bigint","isNegativeNumber","isPositiveNumber","isNaNNumber","createIsNegative","bigNearlyEqual","Unit","valueType","createIsNumeric","number | BigNumber | bigint | Fraction | boolean","Complex | Unit | string | null | undefined | Node","createHasNumericValue","isNumeric","boolean","createIsPositive","createIsZero","equalScalar","createIsNaN","createTypeOf","createCompareUnits","equalBase","createEqualScalar","compareUnits","complexEquals","createSparseMatrixClass","_ref2","SparseMatrix","_createFromArray","_createFromMatrix","ptr","zero","_getValueIndex","top","bottom","_insert","ins","_toArray","createSparseMatrix","density","idx","kk","mvalues","mindex","mptr","pv","_getsubset","firstDimensionRange","secondDimensionRange","firstDataIndex","firstSubIndex","secondDataIndex","secondSubIndex","_setsubset","_remove","colIndex","rowIndex","r1","c1","minRow","maxRow","minColumn","maxColumn","invoke","_map","_forEachRow","kx","ky","vx","vy","createNumber","nonDecimalNumberParts","nonDecimalWithRadixMatch","radix","integerPart","fractionalPart","getNonDecimalNumberParts","parts","makeNumberFromNonDecimalParts","wordSizeSuffixMatch","null","unit","valuelessUnit","createBigint","createString","createBoolean","lcase","createBignumber","twoPowSize","twoPowSizeSubOne","createComplex","ZERO","createFraction","createMatrix","_create","createMatrixFromFunction","createMatrixFromRows","_createArray","checkVectorTypeAndReturnLength","rowLength","vec","createMatrixFromColumns","colLength","createSplitUnit","splitUnit","n2","absNumber","addNumber","subtractNumber","multiplyNumber","unaryMinusNumber","unaryPlusNumber","cbrtNumber","cubeNumber","expNumber","expm1Number","lcmNumber","log10Number","log2Number","nthRootNumber","inv","signNumber","squareNumber","xgcdNumber","lastx","lasty","powNumber","roundNumber","createUnaryMinus","createUnaryPlus","numeric","createAbs","createApply","_apply","createAddScalar","fixPrefix","createSubtractScalar","createCbrt","unaryMinus","_cbrtComplex","third","allRoots","arg3","principal","createMatAlgo11xS0s","asize","adt","dt","cf","cvalues","cptr","createMatAlgo12xSfs","cdata","createMatAlgo14xDs","adata","_iterate","level","av","bv","cv","createCeilNumber","createCeil","matAlgo11xS0s","matAlgo12xSfs","matAlgo14xDs","ceilNumber","createCube","createExp","createExpm1","createFixNumber","createFix","fixNumber","bn","createFloorNumber","createFloor","floorNumber","createMatAlgo02xDS0","denseMatrix","sparseMatrix","bvalues","bindex","bptr","bsize","bdt","cij","createMatAlgo03xDSf","createMatAlgo05xSfSf","xa","xb","wa","wb","wai","wbi","vc","createMatAlgo13xDD","bdata","csize","broadcast","_broadcastTo","createMatrixAlgorithmSuite","matAlgo13xDD","elop","SD","DS","matrixSignatures","DenseMatrix, DenseMatrix","Array, Array","Array, DenseMatrix","DenseMatrix, Array","SS","scalar","Ds","Ss","sS","createMod","matAlgo02xDS0","matAlgo03xDSf","matAlgo05xSfSf","matrixAlgorithmSuite","createMatAlgo01xDSid","createMatAlgo04xSidSid","createMatAlgo10xSids","ArgumentsError","isArgumentsError","gcdTypes","gcdManyTypesSignature","is1d","createGcd","matAlgo01xDSid","matAlgo04xSidSid","matAlgo10xSids","Fraction, Fraction","createMatAlgo06xS0S0","createLcm","matAlgo06xS0S0","lcmTypes","lcmManySignature","lcm","createLog10","predictable","createLog2","_log2Complex","newX","createMultiplyScalar","number | Fraction | BigNumber | Complex, Unit","multiply","Unit, number | Fraction | BigNumber | Complex | Unit","createMultiply","addScalar","multiplyScalar","_validateMatrixDimensions","size1","size2","_multiplyMatrixVector","arows","acolumns","af","mf","brows","ib","vbi","ka0","ka1","ka","ia","ic","_multiplyMatrixMatrix","bcolumns","jb","kb0","kb1","kb","vbij","p0","selfMM","xsize","ysize","_multiplyVectorVector","alength","_multiplyVectorDenseMatrix","_multiplyVectorMatrix","rest","createNthRoot","complexErr","_bigNthRoot","selfDn","selfSn","selfDS","Big","createSign","complex","_isDerived","units","createSqrt","_sqrtNumber","createSquare","createSubtract","subtractScalar","createXgcd","createInvmod","xgcd","equal","smaller","invmod","createMatAlgo09xS0Sf","vb","createDotMultiply","matAlgo09xS0Sf","bitAndBigNumber","bitwise","bitNotBigNumber","prevPrec","bitOrBigNumber","negOne","xBits","yBits","xSign","ySign","decCoefficientToBinaryString","minBits","maxBits","minSign","shortLen","longLen","expFuncVal","outVal","twoPower","two","bitXor","leftShiftBigNumber","rightArithShiftBigNumber","bitAndNumber","bitNotNumber","bitOrNumber","bitXorNumber","leftShiftNumber","rightArithShiftNumber","rightLogShiftNumber","createBitAnd","bigint, bigint","createBitNot","createBitOr","createMatAlgo07xSSf","_scatter","va","createBitXor","matAlgo07xSSf","bigBitXor","createArg","createConj","conjugate","createIm","createRe","notNumber","orNumber","xorNumber","andNumber","createNot","null | undefined","createOr","createXor","createConcat","prevDim","asMatrix","matrices","_concat","createColumn","Index","_column","column","rowRange","createCross","_cross","highestDimension","xSize","ySize","createDiag","_diag","l","_createDiagonalMatrix","dm","vector","_getDiagonal","createFilter","_filterCallback","createFlatten","flattenArray","createForEach","createGetMatrixDataType","createIdentity","_identity","cols","_identityVector","minimum","createKron","_kron","_mapArray","Array|Matrix, Array|Matrix, ...Array|Matrix|function","Arrays","multiCallback","firstArrayIsMatrix","broadcastedArrays","firstValues","callbackCase","_getTypedCallbackCase","_getLimitedCallback","numberOfArrays","_getCallbackCase","broadcastedArraysCallback","_mapMultiple","createDiff","_diff","_recursive","selfAn","selfMn","_ElementDiff","obj1","obj2","obj1IsArray","obj2IsArray","arr1","arr2","_ArrayDiff","createOnes","_ones","hasBigNumbers","_normalize","noBignumber","noFraction","noMatrix","createRange","bignumber","smallerEq","larger","largerEq","_strRange","_out","_range","includeEnd","_parse","ongoing","createReshape","arrayReshape","createResize","defaultChar","_resizeString","arrayResize","createRotate","rotationMatrix","theta","_validateSize","expectedSize","actualSize","createRotationMatrix","norm","_rotationMatrix2x2","matrixV","_validateVector","_rotationMatrix3x3","storageType","minusOne","cosTheta","sinTheta","_convertToFormat","_mul","normV","vz","oneMinusC","createRow","_row","columnRange","createSize","createSqueeze","arraySqueeze","createSubset","subsetRef","subsetResult","_getObjectProperty","_getSubstring","_isScalar","indexSize","_broadcastReplacement","_setSubstring","_setObjectProperty","strLen","substr","chars","updated","createTranspose","transposeMatrix","transposed","transposedRow","_denseTranspose","_sparseTranspose","createCtranspose","transpose","conj","createZeros","_zeros","createFft","divideScalar","tau","dotDivide","_ndFft","_fft","_1dFft","_transpose","chirp","N2","xp","ichirp","fftXp","fftIchirp","fftProduct","ifftProduct","_czt","createIfft","fft","createSolveODE","_rk","butcherTableau","tspan","y0","isNumOrBig","t0","isForwards","firstStep","maxStep","minStep","timeVars","tol","minDelta","maxDelta","maxIter","bp","deltaB","iter","_createOngoing","trimStep","outOfBounds","_createTrimStep","TE","delta","_rk23","_rk45","_solveODE","opt","RK23","RK45","toUpperCase","methodOptions","methodsWithQuotes","availableMethodsString","_matrixSolveODE","T","sol","function, Array, Array","function, Matrix, Matrix","function, Array, number | BigNumber | Unit","Y","function, Matrix, number | BigNumber | Unit","function, Array, number | BigNumber | Unit, Object","function, Matrix, number | BigNumber | Unit, Object","createErf","MAX_NUM","THRESH","ysq","xnum","xden","Q","erf1","del","erfc2","SQRPI","erfc3","createZeta","factorial","gamma","zetaNumeric","zeta","createValue","determineDigits","getRe","factor","createMode","_mode","improveErrorMessage","fnName","details","createProd","_prod","createFormat","formatString","createBin","createOct","createHex","printTemplate","createPrint","_print","template","original","createTo","Unit, Unit | string","createIsPrime","modPow","modulus","accumulator","bases","adn","createNumeric","validInputTypes","validOutputTypes","outputType","inputType","createDivideScalar","Unit, number | Complex | Fraction | BigNumber | Unit","number | Fraction | Complex | BigNumber, Unit","divideInto","createPow","identity","_pow","_powArray","_powMatrix","yFrac","yNum","NO_INT","createRound","toExponent","xEpsilon","epsilonExponent","_n","valueless","toNumeric","createLog","logNumber","createLog1p","_log1p","_log1pComplex","xRe1p","createNthRoots","_calculateExactResult","_nthComplexRoots","aIsNumeric","roots","halfPiFactor","createDotPow","powScalarSignatures","powScalar","createDotDivide","createSolveValidation","mSize","bSize","createLsolve","solveValidation","bj","vjj","jValues","jIndices","xj","_sparseForwardSubstitution","_denseForwardSubstitution","mdata","createUsolve","_sparseBackwardSubstitution","_denseBackwardSubstitution","createLsolveAll","b_","L","iValues","iIndices","Mii","bNew","createUsolveAll","createMatAlgo08xS0Sid","createUseMatrixForArrayScalar","selfDB","selfnD","selfBD","createLeftShift","matAlgo08xS0Sid","useMatrixForArrayScalar","createRightArithShift","createRightLogShift","createAnd","not","createCompare","createCompareNumber","createCompareNatural","compareBooleans","_compareNatural","typeX","typeY","matTypes","compareMatricesAndArrays","compareComplexNumbers","compareArrays","formatUnits","compareNatural","keysX","keysY","compareObjects","_compareText","createCompareText","createEqual","createEqualNumber","createEqualText","createSmaller","createSmallerNumber","boolean, boolean","createSmallerEq","createSmallerEqNumber","createLarger","createLargerNumber","createLargerEq","createLargerEqNumber","createDeepEqual","_deepEqual","createUnequal","createUnequalNumber","createPartitionSelect","asc","_partitionSelect","quickSelect","pivot","createSort","compareAsc","compareDesc","_arrayIsVector","_matrixIsVector","_comparator","order","createMax","_max","_largest","createMin","_min","_smallest","createImmutableDenseMatrixClass","ImmutableDenseMatrix","isImmutableDenseMatrix","createIndexClass","getMatrixDataType","ranges","argIsArray","argIsMatrix","sourceSize","_createImmutableMatrix","_booleansArrayToNumbersForIndex","isObjectProperty","getObjectProperty","strings","booleanArrayIndex","indexOfNumbers","bool","createFibonacciHeapClass","oneOverLogPhi","FibonacciHeap","_minimum","_cut","degree","_cascadingCut","isFibonacciHeap","insert","isEmpty","extractMinimum","numberOfChildren","tempRight","numRoots","_linkNodes","_findMinimumNode","remove","_decreaseKey","createSpaClass","Spa","_heap","isSpa","accumulate","heap","nodes","swap","nodei","nodej","lruQueue","oldIndex","hit","nuIndex","memoize","hasher","POSITIVE_INFINITY","cache","lru","hash","newVal","createBigNumberE","createBigNumberPhi","createBigNumberPi","createBigNumberTau","createUnitClass","fix","skipAutomaticSimplification","BASE_DIMENSIONS","skipWhitespace","isDigit","revert","parseNumber","isDigitDot","tentativeNumber","tentativeIndex","parseUnit","unitName","isValidAlpha","firstC","parseCharacter","toFind","powerMultiplierCurrent","expectingUnit","powerMultiplierStack","powerMultiplierStackProduct","uStr","oldC","_findUnit","power","baseDim","UNIT_SYSTEMS","auto","allowNoUnits","_getNumberConverter","unitValue","unitPrefixValue","unitPower","_denormalize","prefixValue","UNITS","prefixes","prefixLen","prefixName","getNumericIfUnitless","BASE_UNITS","NONE","isValuelessUnit","_other","inverted","valThis","valOther","_numberConverter","nominalOffset","unitOffset","W","thisUnitValue","thisNominalOffset","thisUnitOffset","otherUnitValue","otherNominalOffset","otherUnitOffset","_json$unit","simplify","proposedUnitList","matchingBase","currentUnitSystem","matchingUnit","missingBaseDim","toSI","si","strNum","strDen","nNum","nDen","simp","isImaginary","VAR","VA","_bestPrefix","unitStr","absValue","absUnitValue","bestPrefix","bestDiff","scientific","xNumeric","xRounded","xFixed","testSum","PREFIXES","SHORT","da","G","Z","LONG","deca","hecto","kilo","mega","giga","tera","peta","exa","zetta","yotta","ronna","quetta","deci","centi","milli","micro","nano","pico","femto","atto","zepto","yocto","ronto","quecto","SQUARED","CUBIC","BINARY_SHORT_SI","BINARY_SHORT_IEC","Ki","Mi","Gi","Ti","Pi","Ei","Zi","Yi","BINARY_LONG_SI","BINARY_LONG_IEC","kibi","mebi","gibi","tebi","pebi","exi","zebi","yobi","BTU","MM","SHORTLONG","BINARY_SHORT","BINARY_LONG","MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","FORCE","SURFACE","VOLUME","ENERGY","POWER","PRESSURE","ELECTRIC_CHARGE","ELECTRIC_CAPACITANCE","ELECTRIC_POTENTIAL","ELECTRIC_RESISTANCE","ELECTRIC_INDUCTANCE","ELECTRIC_CONDUCTANCE","MAGNETIC_FLUX","MAGNETIC_FLUX_DENSITY","FREQUENCY","ANGLE","BIT","UNIT_NONE","meter","inch","foot","yard","mile","link","rod","chain","angstrom","in","ft","mi","li","mil","m2","sqin","sqft","sqyd","sqmi","sqrd","sqch","sqmil","acre","hectare","m3","litre","cuin","cuft","cuyd","teaspoon","tablespoon","drop","gtt","minim","fluiddram","fluidounce","gill","cc","cup","pint","quart","gallon","beerbarrel","oilbarrel","hogshead","gram","ton","tonne","grain","dram","ounce","poundmass","hundredweight","stick","stone","gr","dr","oz","lbm","cwt","sec","minute","hour","day","week","month","year","decade","century","millennium","hertz","reciprocal","Hz","rad","radian","deg","grad","gradian","cycle","arcsec","arcmin","ampere","K","degC","degF","degR","kelvin","celsius","fahrenheit","rankine","mol","mole","cd","candela","newton","dyn","dyne","lbf","poundforce","kip","kilogramforce","joule","erg","Wh","eV","electronvolt","watt","hp","Pa","psi","atm","bar","torr","mmHg","mmH2O","cmH2O","coulomb","farad","volt","ohm","henry","H","siemens","weber","Wb","tesla","bits","bytes","ALIASES","meters","inches","feet","yards","miles","links","rods","chains","angstroms","litres","liter","liters","teaspoons","tablespoons","minims","fldr","fluiddrams","floz","fluidounces","gi","gills","cp","cups","pt","pints","qt","quarts","gal","gallons","bbl","beerbarrels","obl","oilbarrels","hogsheads","gtts","grams","tons","tonnes","grains","drams","ounces","poundmasses","hundredweights","sticks","lb","lbs","kips","kgf","acres","hectares","sqfeet","sqyard","sqmile","sqmiles","mmhg","mmh2o","cmh2o","seconds","secs","minutes","mins","hours","hr","hrs","days","weeks","months","years","decades","centuries","millennia","radians","degrees","gradians","cycles","arcsecond","arcseconds","arcminute","arcminutes","BTUs","watts","joules","amperes","amps","amp","coulombs","volts","ohms","farads","webers","teslas","electronvolts","moles","bit","byte","calculateAngleValues","createPi","cgs","us","setUnitSystem","getUnitSystem","typeConverters","alias","createUnit","deleteUnit","aliases","lastUnit","createUnitSingle","assertUnitNameIsValid","baseName","defUnit","newUnit","anyMatch","newBaseUnit","aliasName","createUnitFunction","createSparse","createCreateUnit","def","createAcos","acoshNumber","acotNumber","acothNumber","acscNumber","acschNumber","xInv","asecNumber","asechNumber","asinhNumber","atanhNumber","cotNumber","cothNumber","cscNumber","cschNumber","secNumber","sechNumber","sinhNumber","createAcosh","createAcot","acot","createAcoth","acoth","createAcsc","acsc","createAcsch","acsch","createAsec","asec","createAsech","asech","createAsin","createAsinh","createAtan","createAtan2","BigNumber, BigNumber","createAtanh","createTrigUnit","createCos","trigUnit","createCosh","coshNumber","createCot","cot","createCoth","coth","createCsc","csc","createCsch","csch","createSec","createSech","sech","createSin","createSinh","createTan","createTanh","_tanh","createSetCartesian","a1","a2","b1","b2","createSetDifference","inb2","createSetDistinct","createSetIntersect","createSetIsSubset","createSetMultiplicity","createSetPowerset","_subset","_sort","bitarray","createSetSize","unique","createSetSymDifference","setDifference","createSetUnion","setIntersect","setSymDifference","createAdd","createHypot","_hypot","largest","createNorm","ctranspose","eigs","_norm","sizeX","pinf","_vectorNormPlusInfinity","NEGATIVE_INFINITY","ninf","_vectorNormMinusInfinity","_vectorNorm","maxc","cj","_matrixNormOne","maxr","ri","_matrixNormInfinity","fro","_matrixNormFrobenius","tx","squaredX","eigenVals","rho","_matrixNormTwo","_matrixNorm","createDot","_validateDim","aIsColumn","bIsColumn","xindex","xvalues","yindex","yvalues","xLen","yLen","createTrace","_denseTrace","createIndex","keywords","createNode","mathWithTransform","evaluate","compile","expr","_compile","_validateScope","argNames","_ifNode","traverse","_traverse","path","transform","_transform","cloneDeep","customString","_getCustomString","_toString","toHTML","_toHTML","toTex","_toTex","getIdentifier","getContent","_typeof","_defineProperty","errorTransform","accessFactory","createAccessorNode","Node","access","needParenthesis","AccessorNode","super","evalObject","evalIndex","context","createArrayNode","ArrayNode","evalItems","evalItem","itemsToTex","nested","mixedItems","itemsFormRow","itemSep","itemsTex","AssignmentNode","FunctionAssignmentNode","ConditionalNode","latexLeftParens","latexRightParens","latexParens","associativity","associativeWith","RelationalNode","RangeNode","unwrapParen","_node","parenthesis","getPrecedence","implicit","precedence","leftArg","getAssociativity","isAssociativeWith","nodeA","nodeB","identifierA","identifierB","createAssignmentNode","assignFactory","exprPrecedence","evalValue","childObject","evalParentObject","parentProp","evalParentIndex","parentIndex","createBlockNode","BlockNode","blocks","block","visible","evalBlocks","createConditionalNode","trueExpr","falseExpr","evalCondition","evalTrueExpr","evalFalseExpr","testCondition","conditionPrecedence","truePrecedence","falsePrecedence","latexSymbols","Alpha","alpha","Beta","beta","Gamma","Delta","Epsilon","varepsilon","Zeta","Eta","eta","Theta","vartheta","Iota","iota","Kappa","kappa","varkappa","Lambda","lambda","Mu","mu","Nu","nu","Xi","Omicron","omicron","varpi","Rho","varrho","Sigma","sigma","varsigma","Tau","Upsilon","upsilon","Phi","varphi","Chi","chi","Psi","Omega","omega","true","false","Inf","infinity","oo","lim","latexOperators","dotPow","unaryPlus","bitNot","dotMultiply","leftShift","rightArithShift","rightLogShift","unequal","bitAnd","bitOr","and","xor","or","latexFunctions","cube","nthRoot","nthRoots","square","bellNumbers","catalan","stirlingS2","cross","det","expm","pinv","sqrtm","trace","combinations","combinationsWithRep","lgamma","erf","variance","sparse","latexUnits","escapeLatex","escapeLatexLib","toSymbol","createConstantNode","ConstantNode","toLatex","createFunctionAssignmentNode","paramNames","childArgNames","evalExpr","childArgs","createIndexNode","IndexNode","dotNotation","evalDimensions","_evalDimension","evalDimension","createObjectNode","ObjectNode","evalEntries","stringifiedKey","parsedKey","createSubScope","parentScope","createOperatorNode","startsWithConstant","curNode","calculateNecessaryParentheses","latex","operandPrecedence","operandIdentifier","rootIdentifier","lhsParens","lhsPrecedence","assocWithLhs","rhsParens","rhsPrecedence","assocWithRhs","lhsIdentifier","rhsIdentifier","argPrecedence","assocWithArg","argAssociativity","OperatorNode","isPercentage","evalArgs","rawArgs","evalArg0","evalArg1","evalArg","isUnary","parens","assoc","operand","opIsNamed","lhs","rhs","stringifiedArgs","lhsTex","rhsTex","texifiedArgs","createParenthesisNode","ParenthesisNode","createRangeNode","startPrecedence","stepPrecedence","endPrecedence","needsEnd","evalStart","evalEnd","evalStep","createRelationalNode","operatorMap","conditionals","compiled","evalLhs","evalRhs","condFn","paramStrings","paramPrecedence","createSymbolNode","SymbolNode","onUndefinedSymbol","createFunctionNode","_FunctionNode","strin","expandTemplate","regex","inputPos","ReferenceError","FunctionNode","getSafeMethod","fnExpr","evalFn","isRaw","resolveFn","onUndefinedFunction","customTex","latexConverter","customToTex","createParse","expression","parseStart","expressions","parseMultiple","extraNodes","TOKENTYPE","NULL","DELIMITER","NUMBER","UNKNOWN","DELIMITERS","NAMED_DELIMITERS","CONSTANTS","NUMERIC_CONSTANTS","ESCAPE_CHARACTERS","currentString","currentCharacter","prevCharacter","nextCharacter","getToken","tokenType","token","comment","isWhitespace","nestingLevel","c2","c3","isHexDigit","isDecimalMark","createSyntaxError","isAlpha","getTokenSkipNewline","openParams","closeParams","conditionalLevel","parseAssignment","parseBlock","valid","parseLogicalXor","parseLogicalOr","parseConditional","parseLogicalAnd","parseBitwiseOr","parseBitwiseXor","parseBitwiseAnd","parseRelational","parseShift","operators","cond","parseConversion","parseRange","parseAddSubtract","parseMultiplyDivide","rightNode","parseImplicitMultiplication","parseRule2","parseModulusPercentage","tokenStates","parseUnary","CustomNode","parseAccessors","parseStringToken","parseRow","numericType","parseEnd","parseParentheses","parseObject","parseMatrix","parseString","parseSymbol","parseCustomNodes","parseLeftHandOperators","parsePow","quote","char","escapeChar","cPrev","cNext","isValidLatinOrGreek","isValidMathSymbol","high","createCompile","createEvaluate","createParserClass","Parser","isParser","getAll","getAllAsMap","createParser","createLup","_denseLUP","lvalues","lptr","lsize","uvalues","uindex","uptr","usize","pvCo","pvOc","swapIndeces","spa","vkj","vik","pabsv","absv","U","_sparseLUP","ldata","udata","vij","createQr","_denseQR","_sparseQR","_denseQRimpl","Qdata","Rdata","sgn","conjSgn","alphaSquared","u1","csTdfs","post","csFlip","createCsAmd","lemax","dense","cm","at","tindex","tptr","_createTargetMatrix","nz","csFkeep","cnz","nv","elen","hhead","k2","pj","nvi","pk","eln","pn","_wclear","_initializeQuotientGraph","nel","_initializeDegreeLists","mindeg","elenk","nvk","dk","pk1","pk2","wnvi","dext","p3","p4","nvj","jlast","csLeaf","maxfirst","prevleaf","ancestor","sparent","jleaf","jprev","createCsCounts","ata","colcount","createCsSqr","csAmd","csCounts","qr","csPermute","inext","csEtree","csPost","leftmost","nque","lnz","pa","_vcount","unz","csMarked","csMark","csUnflip","csDfs","jnew","createCsSpsolve","lo","gvalues","gindex","gptr","gsize","csReach","createCsLu","csSpsolve","ipiv","xabs","createSlu","csSqr","csLu","threshold","csIpvec","createLusolve","lup","slu","usolve","lsolve","_lusolve","_toMatrix","createPolynomialRoot","number|Complex, ...number|Complex","constant","restCoeffs","coeffs","denom","discriminant","D0_1","D0_2","D1_1","D1_2","Delta0","Delta1","discriminant1","discriminant2","Ccubed","createHelpClass","Help","doc","examples","configChanged","originalConfig","newConfig","mayThrow","seealso","createChainClass","Chain","createLazyProxy","resolver","chainify","sigObject","createProxy","excludedNames","docs","classes","eDocs","piDocs","embeddedDocs","LOG2E","LOG10E","SQRT1_2","SQRT2","speedOfLight","gravitationConstant","planckConstant","reducedPlanckConstant","magneticConstant","electricConstant","vacuumImpedance","elementaryCharge","bohrMagneton","conductanceQuantum","inverseConductanceQuantum","magneticFluxQuantum","nuclearMagneton","klitzing","bohrRadius","classicalElectronRadius","electronMass","fermiCoupling","fineStructure","hartreeEnergy","protonMass","deuteronMass","neutronMass","quantumOfCirculation","rydberg","thomsonCrossSection","weakMixingAngle","efimovFactor","atomicMass","avogadro","boltzmann","faraday","firstRadiation","loschmidt","gasConstant","molarPlanckConstant","molarVolume","sackurTetrode","secondRadiation","stefanBoltzmann","wienDisplacement","molarMass","molarMassC12","gravity","planckLength","planckMass","planckTime","planckCharge","planckTemperature","derivative","lsolveAll","lusolve","leafCount","polynomialRoot","simplifyConstant","simplifyCore","symbolicEqual","rationalize","usolveAll","composition","import","help","distance","intersect","diag","kron","matrixFromFunction","matrixFromRows","matrixFromColumns","ones","partitionSelect","rotate","ifft","sylvester","schur","lyap","solveODE","kldivergence","multinomial","permutations","pickRandom","randomInt","deepEqual","equalText","setCartesian","setDistinct","setIsSubset","setMultiplicity","setPowerset","setSize","setUnion","zpk2tf","freqz","cumsum","mad","mean","median","quantileSeq","std","corr","bin","oct","hex","hasNumericValue","isPrime","print","createHelp","searchName","searchText","createChain","createDet","rowIndices","k_","_k","piv","piv_","i_","_det","createInv","_inv","ABig","rBig","Ac","Bc","Ar","Br","createPinv","_isZeros","_pinv","rref","lead","_isZero","_rref","_rankFact","Cpinv","Fpinv","createEigs","doRealSymmetric","getTheta","aii","ajj","aij","getThetaBig","Sij1","Sij","Ski","Skj","Sij1Big","x1Big","Hij","Aki","Akj","csHij","Aii","Ajj","getAij","Mij","maxMij","maxIJ","getAijBig","sorting","computeVectors","vecs","minID","eigenvectors","prec","e0","Vab","diagBig","createRealSymmetric","doComplexEigs","eigenvalues2x2","trA","detA","jordanBase2x2","l1","l2","big","cplx","na","nd","inflateMatrix","inverseIterate","orthog","largeNum","randomOrthogonalVector","orthogonalComplement","vectorShape","findVectors","realzero","realone","radixSq","Rdiag","colNorm","rowNorm","rowDivRadix","rowMulRadix","balance","maxIndex","tmp1","tmp2","tmp3","reduceToHessenberg","lambdas","Sdiag","Qtotal","Qpartial","lastConvergenceBefore","ll","vectors","blockDiag","iterateUntilTriangular","Cinv","uniqueValues","multiplicities","solutions","approxVec","correction","findEigenvectors","createComplexEigs","doEigs","Array, Object","matricize","useOpts","_opts$precision","isReal","coerceReal","isSymmetric","coerceTypes","computeValuesAndVectors","hasNumber","hasBig","hasComplex","warn","createExpm","infNorm","rowSum","infinityNorm","errorEstimate","findParams","Apos","AposToI","alternate","qfac","twoqfac","twoqp1fac","createSqrtm","_tolerance","_denmanBeavers","iterations","Yk","createSylvester","_sylvester","sA","sB","hc","RHS","gkk","gmk","gkm","gmm","LHS","yAux","createSchur","_schur","A0","QR","createLyap","createDivide","createDistance","_2d","xCoeff","yCoeff","_distancePointLine2D","_objectToArray","lineTwoPtY","lineOnePtY","lineOnePtX","lineTwoPtX","pointX","pointY","_3d","_parametricLine","_distancePointLine3D","_containsOnlyNumbers","_euclideanDistance","xCoeffLine","yCoeffLine","pointZ","x0","z0","pointOneX","pointOneY","pointTwoX","pointTwoY","pointOneZ","pointTwoZ","_isNumber","aI","_pairwise","pointA","pointB","_distancePairwise","den","vectorSize","createIntersect","_AAA","_AAAA","plane","_coerceArr","_4d","y1","z1","y2","z2","x1x","x2x","y1y","y2y","z1z","z2z","_intersectLinePlane","p1a","p1b","p2a","p2b","o1","o2","d20o11","d21o10","d20o21","d21o20","_intersect2d","x3","y3","z3","x4","y4","z4","d1343","_intersect3dHelper","d4321","d1321","d4343","d2121","ta","tb","pax","pay","paz","pbx","pby","pbz","_intersect3d","add1","add2","add3","createSum","_sum","createCumSum","_cumsum","_ncumSumDim","_cumsummap","sums","_cumsumDimensional","initialValue","createMean","_mean","createMedian","_median","mid","middle2","createMad","_mad","med","DEFAULT_NORMALIZATION","createVariance","_var","_varDim","normalization","createQuantileSeq","Array | Matrix, number | BigNumber","_quantileSeqProbNumber","Array | Matrix, number | BigNumber, number","prob","_quantileSeqDim","Array | Matrix, number | BigNumber, boolean, number","sorted","Array | Matrix, Array | Matrix","_quantileSeqProbCollection","Array | Matrix, Array | Matrix, number","Array | Matrix, Array | Matrix, boolean, number","probOrN","probArr","dataArr","_quantileSeq","nPlusOne","probOrNArr","fracPart","createStd","_std","createCorr","_corr","correlations","correlation","sumX","sumY","sumXY","sumXSquare","sumYSquare","half","combinationsNumber","nMinusk","answer","nextdivisor","lastdivisor","nextnumerator","createCombinations","isPositiveInteger","createCombinationsWithRep","nMinusOne","gammaNumber","twoN","threeN","fourN","fiveN","gammaP","gammaG","lnSqrt2PI","lgammaSeries","lgammaNumber","lgammaN","createGamma","gammaComplex","gammaPval","twoPiSqrt","tpow","expt","bigFactorial","createLgamma","lgammaComplex","lgammaStirling","lgammaRecurrence","leftPart","rz","rzz","rightPart","signflips","sb","shiftprod","nsb","createFactorial","createKldivergence","_kldiv","plength","qlength","qnorm","pnorm","createMultinomial","ai","createPermutations","singletonRandom","createRng","randomSeed","createPickRandom","rng","possibles","_pickRandom","weights","elementWise","single","totalWeights","pick","randKey","randomMatrix","createRandom","_random","number, number","_randomMatrix","Array | Matrix, number","Array | Matrix, number, number","createRandomInt","_randomInt","_randomIntMatrix","createStirlingS2","smallCache","bigCache","make","nn","nk","createBellNumbers","createCatalan","createComposition","createLeafCount","countLeaves","isNumericNode","isConstantExpression","createUtil","defaultName","defaultContext","trivial","total","commutative","associative","paren","defaultF","hasProperty","nodeOrName","isAssociative","allChildren","findChildren","createMakeNodeFunction","isCommutative","mergeContext","primary","secondary","merged","unflattenr","makeNode","curnode","unflattenl","realContext","positiveContext","createSimplify","_simplify","Node, Map","Node, Map, Object","removeParens","SUPPORTED_CONSTANTS","_canonicalizeRule","ruleObject","newRule","lr","nonCommutative","leftExpandsym","_getExpandPlaceholderSymbol","expandsym","expanded","expandedNC1","expandedNC2","rules","assuming","repeat","imposeContext","addition","_lastsym","debug","consoleDebug","ruleSet","rule","ruleType","_buildRules","visited","laststr","rulestr","applyRule","newstr","mapRule","resNodes","newNode","mergedContext","newArgs","newContent","newItems","newObj","newIndex","newDims","newProps","repl","_ruleMatch","placeholders","mergeMatch","match1","match2","_exactMatch","combineChildMatches","list1","list2","i1","i2","isSplit","splits","rightArgs","getSplits","splitMatches","matchSet","childMatches","childMatch","leftMatch","rightMatch","sets","uniqueSets","mergeChildMatches","isVariableNode","createSimplifyConstant","_ensureNode","foldFraction","_removeFractions","thing","_eval","fnname","ignore","_toNumber","_toNode","vn","unaryMinusNode","_exactFraction","exactFractions","fractionsLimit","foldOp","reduction","sofar","ignoreandcontinue","newtree","sz","section","consts","vars","remainingDims","tryItems","fromItems","_foldAccessor","foldItems","foldProps","createSimplifyCore","node0","node1","nodeT","nodeF","isAlwaysBoolean","_simplifyCore","nodeToSimplify","simpChild","childCount","getOperator","seclast","a0","finish","createResolve","_resolve","within","variables","nextWithin","Node, Object","selfAM","createSymbolicEqual","_symbolicEqual","e1","e2","simplified","createDerivative","plainDerivative","variable","constNodes","constTag","_derivative","parseIdentifier","Node, string","Node, string, Object","deriv","_derivTex","varName","isConst","funcDerivative","negative","chainDerivative","constantTerms","nonConstantTerms","nonConstantNode","argOuter","argInner","powMinusOne","createRationalize","_rationalize","detailed","setRules","oldRules","rulesFirst","rulesSucDiv","firstRules","distrDivRules","sucDivRules","firstRulesAgain","finalRules","rulesRationalize","polyRet","extended","oper","recPoly","tp","retFunc","polynomial","nVars","noExactFractions","withExactFractions","sBefore","expandPower","eDistrDiv","redoInic","retRationalize","polyToCanonical","Node, boolean","indParent","internal","does","nEsqTopo","nDirTopo","maxExpo","varname","recurPol","noPai","noFil","fire","cte","valor","no","n3","createZpk2tf","_zpk2tf","_multiply","pole","createFreqz","_freqz","createBins","_w","sumNum","sumDen","bins","createReviver","createReplacer","createTrue","createFalse","createNull","createInfinity","recreateFactory","createNaN","_ref3","createTau","_ref4","createE","_ref5","createPhi","_ref6","createLN2","_ref7","createLN10","_ref8","createLOG2E","_ref9","createLOG10E","_ref10","createSQRT1_2","_ref11","createSQRT2","_ref12","createI","_ref13","createUppercasePi","_ref14","createUppercaseE","_ref15","createVersion","recreateOnConfigChange","createSpeedOfLight","unitFactory","createGravitationConstant","createPlanckConstant","createReducedPlanckConstant","createMagneticConstant","createElectricConstant","createVacuumImpedance","createCoulomb","createElementaryCharge","createBohrMagneton","createConductanceQuantum","createInverseConductanceQuantum","createMagneticFluxQuantum","createNuclearMagneton","createKlitzing","createBohrRadius","createClassicalElectronRadius","createElectronMass","createFermiCoupling","createFineStructure","numberFactory","createHartreeEnergy","createProtonMass","createDeuteronMass","createNeutronMass","createQuantumOfCirculation","createRydberg","createThomsonCrossSection","createWeakMixingAngle","createEfimovFactor","createAtomicMass","createAvogadro","createBoltzmann","createFaraday","createFirstRadiation","createLoschmidt","createGasConstant","createMolarPlanckConstant","createMolarVolume","createSackurTetrode","createSecondRadiation","createStefanBoltzmann","createWienDisplacement","createMolarMass","createMolarMassC12","createGravity","createPlanckLength","createPlanckMass","createPlanckTime","createPlanckCharge","createPlanckTemperature","createApplyTransform","isTransformFunction","createColumnTransform","compileInlineExpression","argsScope","subScope","createTransformCallback","_transformTypedCallbackFunction","_transformCallbackFunction","callbackFunction","numberOfCallbackInputs","vals","_transformDims","createFilterTransform","filterTransform","transformCallback","_compileAndEvaluate","createForEachTransform","forEachTransform","createIndexTransform","isSet","createMapTransform","mapTransform","lastDimToZeroBase","dimToZeroBase","createMaxTransform","createMeanTransform","createMinTransform","createRangeTransform","createRowTransform","createSubsetTransform","createConcatTransform","createDiffTransform","createStdTransform","createSumTransform","createQuantileSeqTransform","createCumSumTransform","createVarianceTransform","createPrintTransform","_convertTemplateToZeroBasedIndex","part","createAndTransform","andTransform","condition1","condition2","createOrTransform","orTransform","createBitAndTransform","bitAndTransform","createBitOrTransform","bitOrTransform","DEFAULT_CONFIG","MATRIX_OPTIONS","NUMBER_OPTIONS","configFactory","_config","optionsFix","validateOption","changes","factories","configInternal","emitter","Emitter","importedFactories","lazyTyped","internalImport","load","_import","_wrap","_importTransform","silent","allowedInExpressions","_deleteTransform","_importFactory","isTransformFunctionFactory","existingTransform","instance","factoryAllowedInExpressions","functions","flatValues","flattenImports","flatName","importFactory"],"sourceRoot":""} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/browser/package.json b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/constants.js new file mode 100644 index 0000000..2c97fbb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/constants.js @@ -0,0 +1,130 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createVersion = exports.createUppercasePi = exports.createUppercaseE = exports.createTrue = exports.createTau = exports.createSQRT2 = exports.createSQRT1_2 = exports.createPi = exports.createPhi = exports.createNull = exports.createNaN = exports.createLOG2E = exports.createLOG10E = exports.createLN2 = exports.createLN10 = exports.createInfinity = exports.createI = exports.createFalse = exports.createE = void 0; +var _factory = require("./utils/factory.js"); +var _version = require("./version.js"); +var _constants = require("./utils/bignumber/constants.js"); +var _index = require("./plain/number/index.js"); +const createTrue = exports.createTrue = /* #__PURE__ */(0, _factory.factory)('true', [], () => true); +const createFalse = exports.createFalse = /* #__PURE__ */(0, _factory.factory)('false', [], () => false); +const createNull = exports.createNull = /* #__PURE__ */(0, _factory.factory)('null', [], () => null); +const createInfinity = exports.createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => { + let { + config, + BigNumber + } = _ref; + return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity; +}); +const createNaN = exports.createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => { + let { + config, + BigNumber + } = _ref2; + return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN; +}); +const createPi = exports.createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => { + let { + config, + BigNumber + } = _ref3; + return config.number === 'BigNumber' ? (0, _constants.createBigNumberPi)(BigNumber) : _index.pi; +}); +const createTau = exports.createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => { + let { + config, + BigNumber + } = _ref4; + return config.number === 'BigNumber' ? (0, _constants.createBigNumberTau)(BigNumber) : _index.tau; +}); +const createE = exports.createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => { + let { + config, + BigNumber + } = _ref5; + return config.number === 'BigNumber' ? (0, _constants.createBigNumberE)(BigNumber) : _index.e; +}); + +// golden ratio, (1+sqrt(5))/2 +const createPhi = exports.createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => { + let { + config, + BigNumber + } = _ref6; + return config.number === 'BigNumber' ? (0, _constants.createBigNumberPhi)(BigNumber) : _index.phi; +}); +const createLN2 = exports.createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => { + let { + config, + BigNumber + } = _ref7; + return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2; +}); +const createLN10 = exports.createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => { + let { + config, + BigNumber + } = _ref8; + return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10; +}); +const createLOG2E = exports.createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => { + let { + config, + BigNumber + } = _ref9; + return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E; +}); +const createLOG10E = exports.createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => { + let { + config, + BigNumber + } = _ref10; + return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E; +}); +const createSQRT1_2 = exports.createSQRT1_2 = /* #__PURE__ */recreateFactory( +// eslint-disable-line camelcase +'SQRT1_2', ['config', '?BigNumber'], _ref11 => { + let { + config, + BigNumber + } = _ref11; + return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2; +}); +const createSQRT2 = exports.createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => { + let { + config, + BigNumber + } = _ref12; + return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2; +}); +const createI = exports.createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => { + let { + Complex + } = _ref13; + return Complex.I; +}); + +// for backward compatibility with v5 +const createUppercasePi = exports.createUppercasePi = /* #__PURE__ */(0, _factory.factory)('PI', ['pi'], _ref14 => { + let { + pi + } = _ref14; + return pi; +}); +const createUppercaseE = exports.createUppercaseE = /* #__PURE__ */(0, _factory.factory)('E', ['e'], _ref15 => { + let { + e + } = _ref15; + return e; +}); +const createVersion = exports.createVersion = /* #__PURE__ */(0, _factory.factory)('version', [], () => _version.version); + +// helper function to create a factory with a flag recreateOnConfigChange +// idea: allow passing optional properties to be attached to the factory function as 4th argument? +function recreateFactory(name, dependencies, create) { + return (0, _factory.factory)(name, dependencies, create, { + recreateOnConfigChange: true + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/config.js new file mode 100644 index 0000000..ea073bb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/config.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DEFAULT_CONFIG = void 0; +const DEFAULT_CONFIG = exports.DEFAULT_CONFIG = { + // minimum relative difference between two compared values, + // used by all comparison functions + relTol: 1e-12, + // minimum absolute difference between two compared values, + // used by all comparison functions + absTol: 1e-15, + // type of default matrix output. Choose 'matrix' (default) or 'array' + matrix: 'Matrix', + // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction' + number: 'number', + // type of fallback used for config { number: 'bigint' } when a value cannot be represented + // in the configured numeric type. Choose 'number' (default) or 'BigNumber'. + numberFallback: 'number', + // number of significant digits in BigNumbers + precision: 64, + // 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. + predictable: false, + // random seed for seeded pseudo random number generation + // null = randomly seed + randomSeed: null +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/create.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/create.js new file mode 100644 index 0000000..0032abf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/create.js @@ -0,0 +1,213 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.create = create; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _typedFunction = _interopRequireDefault(require("typed-function")); +var _ArgumentsError = require("../error/ArgumentsError.js"); +var _DimensionError = require("../error/DimensionError.js"); +var _IndexError = require("../error/IndexError.js"); +var _factory = require("../utils/factory.js"); +var _is = require("../utils/is.js"); +var _object = require("../utils/object.js"); +var emitter = _interopRequireWildcard(require("./../utils/emitter.js")); +var _config = require("./config.js"); +var _config2 = require("./function/config.js"); +var _import = require("./function/import.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +/** + * Create a mathjs instance from given factory functions and optionally config + * + * Usage: + * + * const mathjs1 = create({ createAdd, createMultiply, ...}) + * const config = { number: 'BigNumber' } + * const mathjs2 = create(all, config) + * + * @param {Object} [factories] An object with factory functions + * The object can contain nested objects, + * all nested objects will be flattened. + * @param {Object} [config] Available options: + * {number} relTol + * Minimum relative difference between two + * compared values, used by all comparison functions. + * {number} absTol + * Minimum absolute 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. + * {string} randomSeed + * Random seed for seeded pseudo random number generator. + * Set to null to randomly seed. + * @returns {Object} Returns a bare-bone math.js instance containing + * functions: + * - `import` to add new functions + * - `config` to change configuration + * - `on`, `off`, `once`, `emit` for events + */ +function create(factories, config) { + const configInternal = (0, _extends2.default)({}, _config.DEFAULT_CONFIG, config); + + // simple test for ES5 support + if (typeof Object.create !== 'function') { + throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.'); + } + + // create the mathjs instance + const math = emitter.mixin({ + // only here for backward compatibility for legacy factory functions + isNumber: _is.isNumber, + isComplex: _is.isComplex, + isBigNumber: _is.isBigNumber, + isBigInt: _is.isBigInt, + isFraction: _is.isFraction, + isUnit: _is.isUnit, + isString: _is.isString, + isArray: _is.isArray, + isMatrix: _is.isMatrix, + isCollection: _is.isCollection, + isDenseMatrix: _is.isDenseMatrix, + isSparseMatrix: _is.isSparseMatrix, + isRange: _is.isRange, + isIndex: _is.isIndex, + isBoolean: _is.isBoolean, + isResultSet: _is.isResultSet, + isHelp: _is.isHelp, + isFunction: _is.isFunction, + isDate: _is.isDate, + isRegExp: _is.isRegExp, + isObject: _is.isObject, + isMap: _is.isMap, + isPartitionedMap: _is.isPartitionedMap, + isObjectWrappingMap: _is.isObjectWrappingMap, + isNull: _is.isNull, + isUndefined: _is.isUndefined, + isAccessorNode: _is.isAccessorNode, + isArrayNode: _is.isArrayNode, + isAssignmentNode: _is.isAssignmentNode, + isBlockNode: _is.isBlockNode, + isConditionalNode: _is.isConditionalNode, + isConstantNode: _is.isConstantNode, + isFunctionAssignmentNode: _is.isFunctionAssignmentNode, + isFunctionNode: _is.isFunctionNode, + isIndexNode: _is.isIndexNode, + isNode: _is.isNode, + isObjectNode: _is.isObjectNode, + isOperatorNode: _is.isOperatorNode, + isParenthesisNode: _is.isParenthesisNode, + isRangeNode: _is.isRangeNode, + isRelationalNode: _is.isRelationalNode, + isSymbolNode: _is.isSymbolNode, + isChain: _is.isChain + }); + + // load config function and apply provided config + math.config = (0, _config2.configFactory)(configInternal, math.emit); + math.expression = { + transform: {}, + mathWithTransform: { + config: math.config + } + }; + + // cached factories and instances used by function load + const legacyFactories = []; + const legacyInstances = []; + + /** + * Load a function or data type from a factory. + * If the function or data type already exists, the existing instance is + * returned. + * @param {Function} factory + * @returns {*} + */ + function load(factory) { + if ((0, _factory.isFactory)(factory)) { + return factory(math); + } + const firstProperty = factory[Object.keys(factory)[0]]; + if ((0, _factory.isFactory)(firstProperty)) { + return firstProperty(math); + } + if (!(0, _object.isLegacyFactory)(factory)) { + console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory); + throw new Error('Factory object with properties `type`, `name`, and `factory` expected'); + } + const index = legacyFactories.indexOf(factory); + let instance; + if (index === -1) { + // doesn't yet exist + if (factory.math === true) { + // pass with math namespace + instance = factory.factory(math.type, configInternal, load, math.typed, math); + } else { + instance = factory.factory(math.type, configInternal, load, math.typed); + } + + // append to the cache + legacyFactories.push(factory); + legacyInstances.push(instance); + } else { + // already existing function, return the cached instance + instance = legacyInstances[index]; + } + return instance; + } + const importedFactories = {}; + + // load the import function + function lazyTyped() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return math.typed.apply(math.typed, args); + } + lazyTyped.isTypedFunction = _typedFunction.default.isTypedFunction; + const internalImport = (0, _import.importFactory)(lazyTyped, load, math, importedFactories); + math.import = internalImport; + + // listen for changes in config, import all functions again when changed + // TODO: move this listener into the import function? + math.on('config', () => { + Object.values(importedFactories).forEach(factory => { + if (factory && factory.meta && factory.meta.recreateOnConfigChange) { + // FIXME: only re-create when the current instance is the same as was initially created + // FIXME: delete the functions/constants before importing them again? + internalImport(factory, { + override: true + }); + } + }); + }); + + // the create function exposed on the mathjs instance is bound to + // the factory functions passed before + math.create = create.bind(null, factories); + + // export factory function + math.factory = _factory.factory; + + // import the factory functions like createAdd as an array instead of object, + // else they will get a different naming (`createAdd` instead of `add`). + math.import(Object.values((0, _object.deepFlatten)(factories))); + math.ArgumentsError = _ArgumentsError.ArgumentsError; + math.DimensionError = _DimensionError.DimensionError; + math.IndexError = _IndexError.IndexError; + return math; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/config.js new file mode 100644 index 0000000..b275af5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/config.js @@ -0,0 +1,115 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NUMBER_OPTIONS = exports.MATRIX_OPTIONS = void 0; +exports.configFactory = configFactory; +var _object = require("../../utils/object.js"); +var _config2 = require("../config.js"); +const MATRIX_OPTIONS = exports.MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix +const NUMBER_OPTIONS = exports.NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number + +function configFactory(config, emit) { + /** + * Set configuration options for math.js, and get current options. + * Will emit a 'config' event, with arguments (curr, prev, changes). + * + * This function is only available on a mathjs instance created using `create`. + * + * Syntax: + * + * math.config(config: Object): Object + * + * Examples: + * + * + * import { create, all } from 'mathjs' + * + * // create a mathjs instance + * const math = create(all) + * + * math.config().number // outputs 'number' + * math.evaluate('0.4') // outputs number 0.4 + * math.config({number: 'Fraction'}) + * math.evaluate('0.4') // outputs Fraction 2/5 + * + * @param {Object} [options] Available options: + * {number} relTol + * Minimum relative difference between two + * compared values, used by all comparison functions. + * {number} absTol + * Minimum absolute 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', 'bigint', or 'Fraction' + * {number} precision + * The number of significant digits for BigNumbers. + * Not applicable for Numbers. + * {string} parenthesis + * How to display parentheses in LaTeX and string + * output. + * {string} randomSeed + * Random seed for seeded pseudo random number generator. + * Set to null to randomly seed. + * @return {Object} Returns the current configuration + */ + function _config(options) { + if (options) { + if (options.epsilon !== undefined) { + // this if is only for backwards compatibility, it can be removed in the future. + console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.'); + const optionsFix = (0, _object.clone)(options); + optionsFix.relTol = options.epsilon; + optionsFix.absTol = options.epsilon * 1e-3; + delete optionsFix.epsilon; + return _config(optionsFix); + } + const prev = (0, _object.clone)(config); + + // validate some of the options + validateOption(options, 'matrix', MATRIX_OPTIONS); + validateOption(options, 'number', NUMBER_OPTIONS); + + // merge options + (0, _object.deepExtend)(config, options); + const curr = (0, _object.clone)(config); + const changes = (0, _object.clone)(options); + + // emit 'config' event + emit('config', curr, prev, changes); + return curr; + } else { + return (0, _object.clone)(config); + } + } + + // attach the valid options to the function so they can be extended + _config.MATRIX_OPTIONS = MATRIX_OPTIONS; + _config.NUMBER_OPTIONS = NUMBER_OPTIONS; + + // attach the config properties as readonly properties to the config function + Object.keys(_config2.DEFAULT_CONFIG).forEach(key => { + Object.defineProperty(_config, key, { + get: () => config[key], + enumerable: true, + configurable: true + }); + }); + return _config; +} + +/** + * Validate an option + * @param {Object} options Object with options + * @param {string} name Name of the option to validate + * @param {Array.} values Array with valid values for this option + */ +function validateOption(options, name, values) { + if (options[name] !== undefined && !values.includes(options[name])) { + // unknown value + console.warn('Warning: Unknown value "' + options[name] + '" for configuration option "' + name + '". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.'); + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/import.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/import.js new file mode 100644 index 0000000..422b63f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/import.js @@ -0,0 +1,331 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.importFactory = importFactory; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _object = require("../../utils/object.js"); +var _ArgumentsError = require("../../error/ArgumentsError.js"); +function importFactory(typed, load, math, importedFactories) { + /** + * Import functions from an object or a module. + * + * This function is only available on a mathjs instance created using `create`. + * + * Syntax: + * + * math.import(functions) + * math.import(functions, options) + * + * Where: + * + * - `functions: Object` + * An object with functions or factories to be imported. + * - `options: Object` An object with import options. Available options: + * - `override: boolean` + * If true, existing functions will be overwritten. False by default. + * - `silent: boolean` + * If true, the function will not throw errors on duplicates or invalid + * types. False by default. + * - `wrap: boolean` + * If true, the functions will be wrapped in a wrapper function + * which converts data types like Matrix to primitive data types like Array. + * The wrapper is needed when extending math.js with libraries which do not + * support these data type. False by default. + * + * Examples: + * + * import { create, all } from 'mathjs' + * import * as numbers from 'numbers' + * + * // create a mathjs instance + * const math = create(all) + * + * // define new functions and variables + * math.import({ + * myvalue: 42, + * hello: function (name) { + * return 'hello, ' + name + '!' + * } + * }) + * + * // use the imported function and variable + * math.myvalue * 2 // 84 + * math.hello('user') // 'hello, user!' + * + * // import the npm module 'numbers' + * // (must be installed first with `npm install numbers`) + * math.import(numbers, {wrap: true}) + * + * math.fibonacci(7) // returns 13 + * + * @param {Object | Array} functions Object with functions to be imported. + * @param {Object} [options] Import options. + */ + function mathImport(functions, options) { + const num = arguments.length; + if (num !== 1 && num !== 2) { + throw new _ArgumentsError.ArgumentsError('import', num, 1, 2); + } + if (!options) { + options = {}; + } + function flattenImports(flatValues, value, name) { + if (Array.isArray(value)) { + value.forEach(item => flattenImports(flatValues, item)); + } else if (typeof value === 'object') { + for (const name in value) { + if ((0, _object.hasOwnProperty)(value, name)) { + flattenImports(flatValues, value[name], name); + } + } + } else if ((0, _factory.isFactory)(value) || name !== undefined) { + const flatName = (0, _factory.isFactory)(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly + : value.fn : name; + + // we allow importing the same function twice if it points to the same implementation + if ((0, _object.hasOwnProperty)(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) { + throw new Error('Cannot import "' + flatName + '" twice'); + } + flatValues[flatName] = value; + } else { + if (!options.silent) { + throw new TypeError('Factory, Object, or Array expected'); + } + } + } + const flatValues = {}; + flattenImports(flatValues, functions); + for (const name in flatValues) { + if ((0, _object.hasOwnProperty)(flatValues, name)) { + // console.log('import', name) + const value = flatValues[name]; + if ((0, _factory.isFactory)(value)) { + // we ignore name here and enforce the name of the factory + // maybe at some point we do want to allow overriding it + // in that case we can implement an option overrideFactoryNames: true + _importFactory(value, options); + } else if (isSupportedType(value)) { + _import(name, value, options); + } else { + if (!options.silent) { + throw new TypeError('Factory, Object, or Array expected'); + } + } + } + } + } + + /** + * Add a property to the math namespace + * @param {string} name + * @param {*} value + * @param {Object} options See import for a description of the options + * @private + */ + function _import(name, value, options) { + // TODO: refactor this function, it's to complicated and contains duplicate code + if (options.wrap && typeof value === 'function') { + // create a wrapper around the function + value = _wrap(value); + } + + // turn a plain function with a typed-function signature into a typed-function + if (hasTypedFunctionSignature(value)) { + value = typed(name, { + [value.signature]: value + }); + } + if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) { + if (options.override) { + // give the typed function the right name + value = typed(name, value.signatures); + } else { + // merge the existing and typed function + value = typed(math[name], value); + } + math[name] = value; + delete importedFactories[name]; + _importTransform(name, value); + math.emit('import', name, function resolver() { + return value; + }); + return; + } + if (math[name] === undefined || options.override) { + math[name] = value; + delete importedFactories[name]; + _importTransform(name, value); + math.emit('import', name, function resolver() { + return value; + }); + return; + } + if (!options.silent) { + throw new Error('Cannot import "' + name + '": already exists'); + } + } + function _importTransform(name, value) { + if (value && typeof value.transform === 'function') { + math.expression.transform[name] = value.transform; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = value.transform; + } + } else { + // remove existing transform + delete math.expression.transform[name]; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = value; + } + } + } + function _deleteTransform(name) { + delete math.expression.transform[name]; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = math[name]; + } else { + delete math.expression.mathWithTransform[name]; + } + } + + /** + * Create a wrapper a round an function which converts the arguments + * to their primitive values (like convert a Matrix to Array) + * @param {Function} fn + * @return {Function} Returns the wrapped function + * @private + */ + function _wrap(fn) { + const wrapper = function wrapper() { + const args = []; + for (let i = 0, len = arguments.length; i < len; i++) { + const arg = arguments[i]; + args[i] = arg && arg.valueOf(); + } + return fn.apply(math, args); + }; + if (fn.transform) { + wrapper.transform = fn.transform; + } + return wrapper; + } + + /** + * Import an instance of a factory into math.js + * @param {function(scope: object)} factory + * @param {Object} options See import for a description of the options + * @param {string} [name=factory.name] Optional custom name + * @private + */ + function _importFactory(factory, options) { + let name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn; + if (name.includes('.')) { + throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name)); + } + const namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math; + const existingTransform = name in math.expression.transform; + const existing = (0, _object.hasOwnProperty)(namespace, name) ? namespace[name] : undefined; + const resolver = function () { + // collect all dependencies, handle finding both functions and classes and other special cases + const dependencies = {}; + factory.dependencies.map(_factory.stripOptionalNotation).forEach(dependency => { + if (dependency.includes('.')) { + throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency)); + } + if (dependency === 'math') { + dependencies.math = math; + } else if (dependency === 'mathWithTransform') { + dependencies.mathWithTransform = math.expression.mathWithTransform; + } else if (dependency === 'classes') { + // special case for json reviver + dependencies.classes = math; + } else { + dependencies[dependency] = math[dependency]; + } + }); + const instance = /* #__PURE__ */factory(dependencies); + if (instance && typeof instance.transform === 'function') { + throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = "expression.transform"'); + } + if (existing === undefined || options.override) { + return instance; + } + if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) { + // merge the existing and new typed function + return typed(existing, instance); + } + if (options.silent) { + // keep existing, ignore imported function + return existing; + } else { + throw new Error('Cannot import "' + name + '": already exists'); + } + }; + + // TODO: add unit test with non-lazy factory + if (!factory.meta || factory.meta.lazy !== false) { + (0, _object.lazy)(namespace, name, resolver); + + // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two) + if (existing && existingTransform) { + _deleteTransform(name); + } else { + if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) { + (0, _object.lazy)(math.expression.mathWithTransform, name, () => namespace[name]); + } + } + } else { + namespace[name] = resolver(); + + // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two) + if (existing && existingTransform) { + _deleteTransform(name); + } else { + if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) { + (0, _object.lazy)(math.expression.mathWithTransform, name, () => namespace[name]); + } + } + } + + // TODO: improve factories, store a list with imports instead which can be re-played + importedFactories[name] = factory; + math.emit('import', name, resolver); + } + + /** + * Check whether given object is a type which can be imported + * @param {Function | number | string | boolean | null | Unit | Complex} object + * @return {boolean} + * @private + */ + function isSupportedType(object) { + return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || (0, _is.isUnit)(object) || (0, _is.isComplex)(object) || (0, _is.isBigNumber)(object) || (0, _is.isFraction)(object) || (0, _is.isMatrix)(object) || Array.isArray(object); + } + function hasTypedFunctionSignature(fn) { + return typeof fn === 'function' && typeof fn.signature === 'string'; + } + function allowedInExpressions(name) { + return !(0, _object.hasOwnProperty)(unsafe, name); + } + function factoryAllowedInExpressions(factory) { + return !factory.fn.includes('.') && + // FIXME: make checking on path redundant, check on meta data instead + !(0, _object.hasOwnProperty)(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass); + } + function isTransformFunctionFactory(factory) { + return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false; + } + + // namespaces and functions not available in the parser for safety reasons + const unsafe = { + expression: true, + type: true, + docs: true, + error: true, + json: true, + chain: true // chain method not supported. Note that there is a unit chain too. + }; + return mathImport; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/typed.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/typed.js new file mode 100644 index 0000000..628ae9a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/core/function/typed.js @@ -0,0 +1,461 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTyped = void 0; +var _typedFunction = _interopRequireDefault(require("typed-function")); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +/** + * Create a typed-function which checks the types of the arguments and + * can match them against multiple provided signatures. The typed-function + * automatically converts inputs in order to find a matching signature. + * Typed functions throw informative errors in case of wrong input arguments. + * + * See the library [typed-function](https://github.com/josdejong/typed-function) + * for detailed documentation. + * + * Syntax: + * + * math.typed(name, signatures) : function + * math.typed(signatures) : function + * + * Examples: + * + * // create a typed function with multiple types per argument (type union) + * const fn2 = typed({ + * 'number | boolean': function (b) { + * return 'b is a number or boolean' + * }, + * 'string, number | boolean': function (a, b) { + * return 'a is a string, b is a number or boolean' + * } + * }) + * + * // create a typed function with an any type argument + * const log = typed({ + * 'string, any': function (event, data) { + * console.log('event: ' + event + ', data: ' + JSON.stringify(data)) + * } + * }) + * + * @param {string} [name] Optional name for the typed-function + * @param {Object} signatures Object with one or multiple function signatures + * @returns {function} The created typed-function. + */ + +// returns a new instance of typed-function +let _createTyped = function () { + // initially, return the original instance of typed-function + // consecutively, return a new instance from typed.create. + _createTyped = _typedFunction.default.create; + return _typedFunction.default; +}; +const dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction']; + +/** + * Factory function for creating a new typed instance + * @param {Object} dependencies Object with data types like Complex and BigNumber + * @returns {Function} + */ +const createTyped = exports.createTyped = /* #__PURE__ */(0, _factory.factory)('typed', dependencies, function createTyped(_ref) { + let { + BigNumber, + Complex, + DenseMatrix, + Fraction + } = _ref; + // TODO: typed-function must be able to silently ignore signatures with unknown data types + + // get a new instance of typed-function + const typed = _createTyped(); + + // define all types. The order of the types determines in which order function + // arguments are type-checked (so for performance it's important to put the + // most used types first). + typed.clear(); + typed.addTypes([{ + name: 'number', + test: _is.isNumber + }, { + name: 'Complex', + test: _is.isComplex + }, { + name: 'BigNumber', + test: _is.isBigNumber + }, { + name: 'bigint', + test: _is.isBigInt + }, { + name: 'Fraction', + test: _is.isFraction + }, { + name: 'Unit', + test: _is.isUnit + }, + // The following type matches a valid variable name, i.e., an alphanumeric + // string starting with an alphabetic character. It is used (at least) + // in the definition of the derivative() function, as the argument telling + // what to differentiate over must (currently) be a variable. + // TODO: deprecate the identifier type (it's not used anymore, see https://github.com/josdejong/mathjs/issues/3253) + { + name: 'identifier', + test: s => _is.isString && /^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{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B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(s) + }, { + name: 'string', + test: _is.isString + }, { + name: 'Chain', + test: _is.isChain + }, { + name: 'Array', + test: _is.isArray + }, { + name: 'Matrix', + test: _is.isMatrix + }, { + name: 'DenseMatrix', + test: _is.isDenseMatrix + }, { + name: 'SparseMatrix', + test: _is.isSparseMatrix + }, { + name: 'Range', + test: _is.isRange + }, { + name: 'Index', + test: _is.isIndex + }, { + name: 'boolean', + test: _is.isBoolean + }, { + name: 'ResultSet', + test: _is.isResultSet + }, { + name: 'Help', + test: _is.isHelp + }, { + name: 'function', + test: _is.isFunction + }, { + name: 'Date', + test: _is.isDate + }, { + name: 'RegExp', + test: _is.isRegExp + }, { + name: 'null', + test: _is.isNull + }, { + name: 'undefined', + test: _is.isUndefined + }, { + name: 'AccessorNode', + test: _is.isAccessorNode + }, { + name: 'ArrayNode', + test: _is.isArrayNode + }, { + name: 'AssignmentNode', + test: _is.isAssignmentNode + }, { + name: 'BlockNode', + test: _is.isBlockNode + }, { + name: 'ConditionalNode', + test: _is.isConditionalNode + }, { + name: 'ConstantNode', + test: _is.isConstantNode + }, { + name: 'FunctionNode', + test: _is.isFunctionNode + }, { + name: 'FunctionAssignmentNode', + test: _is.isFunctionAssignmentNode + }, { + name: 'IndexNode', + test: _is.isIndexNode + }, { + name: 'Node', + test: _is.isNode + }, { + name: 'ObjectNode', + test: _is.isObjectNode + }, { + name: 'OperatorNode', + test: _is.isOperatorNode + }, { + name: 'ParenthesisNode', + test: _is.isParenthesisNode + }, { + name: 'RangeNode', + test: _is.isRangeNode + }, { + name: 'RelationalNode', + test: _is.isRelationalNode + }, { + name: 'SymbolNode', + test: _is.isSymbolNode + }, { + name: 'Map', + test: _is.isMap + }, { + name: 'Object', + test: _is.isObject + } // order 'Object' last, it matches on other classes too + ]); + typed.addConversions([{ + from: 'number', + to: 'BigNumber', + convert: function (x) { + if (!BigNumber) { + throwNoBignumber(x); + } + + // note: conversion from number to BigNumber can fail if x has >15 digits + if ((0, _number.digits)(x) > 15) { + throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.'); + } + return new BigNumber(x); + } + }, { + from: 'number', + to: 'Complex', + convert: function (x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x, 0); + } + }, { + from: 'BigNumber', + to: 'Complex', + convert: function (x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x.toNumber(), 0); + } + }, { + from: 'bigint', + to: 'number', + convert: function (x) { + if (x > Number.MAX_SAFE_INTEGER) { + throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')'); + } + return Number(x); + } + }, { + from: 'bigint', + to: 'BigNumber', + convert: function (x) { + if (!BigNumber) { + throwNoBignumber(x); + } + return new BigNumber(x.toString()); + } + }, { + from: 'bigint', + to: 'Fraction', + convert: function (x) { + if (!Fraction) { + throwNoFraction(x); + } + return new Fraction(x.toString()); + } + }, { + from: 'Fraction', + to: 'BigNumber', + convert: function (x) { + throw new TypeError('Cannot implicitly convert a Fraction to BigNumber or vice versa. ' + 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.'); + } + }, { + from: 'Fraction', + to: 'Complex', + convert: function (x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x.valueOf(), 0); + } + }, { + from: 'number', + to: 'Fraction', + convert: function (x) { + if (!Fraction) { + throwNoFraction(x); + } + const f = new Fraction(x); + if (f.valueOf() !== x) { + throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.'); + } + return f; + } + }, { + // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))` + // from: 'Fraction', + // to: 'number', + // convert: function (x) { + // return x.valueOf() + // } + // }, { + from: 'string', + to: 'number', + convert: function (x) { + const n = Number(x); + if (isNaN(n)) { + throw new Error('Cannot convert "' + x + '" to a number'); + } + return n; + } + }, { + from: 'string', + to: 'BigNumber', + convert: function (x) { + if (!BigNumber) { + throwNoBignumber(x); + } + try { + return new BigNumber(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to BigNumber'); + } + } + }, { + from: 'string', + to: 'bigint', + convert: function (x) { + try { + return BigInt(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to BigInt'); + } + } + }, { + from: 'string', + to: 'Fraction', + convert: function (x) { + if (!Fraction) { + throwNoFraction(x); + } + try { + return new Fraction(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to Fraction'); + } + } + }, { + from: 'string', + to: 'Complex', + convert: function (x) { + if (!Complex) { + throwNoComplex(x); + } + try { + return new Complex(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to Complex'); + } + } + }, { + from: 'boolean', + to: 'number', + convert: function (x) { + return +x; + } + }, { + from: 'boolean', + to: 'BigNumber', + convert: function (x) { + if (!BigNumber) { + throwNoBignumber(x); + } + return new BigNumber(+x); + } + }, { + from: 'boolean', + to: 'bigint', + convert: function (x) { + return BigInt(+x); + } + }, { + from: 'boolean', + to: 'Fraction', + convert: function (x) { + if (!Fraction) { + throwNoFraction(x); + } + return new Fraction(+x); + } + }, { + from: 'boolean', + to: 'string', + convert: function (x) { + return String(x); + } + }, { + from: 'Array', + to: 'Matrix', + convert: function (array) { + if (!DenseMatrix) { + throwNoMatrix(); + } + return new DenseMatrix(array); + } + }, { + from: 'Matrix', + to: 'Array', + convert: function (matrix) { + return matrix.valueOf(); + } + }]); + + // Provide a suggestion on how to call a function elementwise + // This was added primarily as guidance for the v10 -> v11 transition, + // and could potentially be removed in the future if it no longer seems + // to be helpful. + typed.onMismatch = (name, args, signatures) => { + const usualError = typed.createError(name, args, signatures); + if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && (0, _is.isCollection)(args[0]) && + // check if the function can be unary: + signatures.some(sig => !sig.params.includes(','))) { + const err = new TypeError(`Function '${name}' doesn't apply to matrices. To call it ` + `elementwise on a matrix 'M', try 'map(M, ${name})'.`); + err.data = usualError.data; + throw err; + } + throw usualError; + }; + + // Provide a suggestion on how to call a function elementwise + // This was added primarily as guidance for the v10 -> v11 transition, + // and could potentially be removed in the future if it no longer seems + // to be helpful. + typed.onMismatch = (name, args, signatures) => { + const usualError = typed.createError(name, args, signatures); + if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && (0, _is.isCollection)(args[0]) && + // check if the function can be unary: + signatures.some(sig => !sig.params.includes(','))) { + const err = new TypeError(`Function '${name}' doesn't apply to matrices. To call it ` + `elementwise on a matrix 'M', try 'map(M, ${name})'.`); + err.data = usualError.data; + throw err; + } + throw usualError; + }; + return typed; +}); +function throwNoBignumber(x) { + throw new Error(`Cannot convert value ${x} into a BigNumber: no class 'BigNumber' provided`); +} +function throwNoComplex(x) { + throw new Error(`Cannot convert value ${x} into a Complex number: no class 'Complex' provided`); +} +function throwNoMatrix() { + throw new Error('Cannot convert array into a Matrix: no class \'DenseMatrix\' provided'); +} +function throwNoFraction(x) { + throw new Error(`Cannot convert value ${x} into a Fraction, no class 'Fraction' provided.`); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/defaultInstance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/defaultInstance.js new file mode 100644 index 0000000..527dd44 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/defaultInstance.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var all = _interopRequireWildcard(require("./factoriesAny.js")); +var _create = require("./core/create.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var _default = exports.default = (0, _create.create)(all); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js new file mode 100644 index 0000000..3678043 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.all = void 0; +var allFactories = _interopRequireWildcard(require("../factoriesAny.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +// creating all factories here in a separate file is needed to get tree-shaking working + +const all = exports.all = allFactories; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js new file mode 100644 index 0000000..5279cdf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.all = void 0; +var allFactories = _interopRequireWildcard(require("../factoriesNumber.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +// creating all factories here in a separate file is needed to get tree-shaking working + +const all = exports.all = allFactories; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/configReadonly.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/configReadonly.js new file mode 100644 index 0000000..509c249 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/configReadonly.js @@ -0,0 +1,22 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _config = require("../core/config.js"); +var _config2 = require("../core/function/config.js"); +// create a read-only version of config +const config = function (options) { + if (options) { + throw new Error('The global config is readonly. \n' + 'Please create a mathjs instance if you want to change the default configuration. \n' + 'Example:\n' + '\n' + ' import { create, all } from \'mathjs\';\n' + ' const mathjs = create(all);\n' + ' mathjs.config({ number: \'BigNumber\' });\n'); + } + return Object.freeze(_config.DEFAULT_CONFIG); +}; +exports.config = config; +(0, _extends2.default)(config, _config.DEFAULT_CONFIG, { + MATRIX_OPTIONS: _config2.MATRIX_OPTIONS, + NUMBER_OPTIONS: _config2.NUMBER_OPTIONS +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js new file mode 100644 index 0000000..c424404 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js @@ -0,0 +1,2546 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "AccessorNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesAccessorNodeGenerated.AccessorNodeDependencies; + } +}); +Object.defineProperty(exports, "ArrayNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesArrayNodeGenerated.ArrayNodeDependencies; + } +}); +Object.defineProperty(exports, "AssignmentNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies; + } +}); +Object.defineProperty(exports, "BigNumberDependencies", { + enumerable: true, + get: function () { + return _dependenciesBigNumberClassGenerated.BigNumberDependencies; + } +}); +Object.defineProperty(exports, "BlockNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesBlockNodeGenerated.BlockNodeDependencies; + } +}); +Object.defineProperty(exports, "ChainDependencies", { + enumerable: true, + get: function () { + return _dependenciesChainClassGenerated.ChainDependencies; + } +}); +Object.defineProperty(exports, "ComplexDependencies", { + enumerable: true, + get: function () { + return _dependenciesComplexClassGenerated.ComplexDependencies; + } +}); +Object.defineProperty(exports, "ConditionalNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies; + } +}); +Object.defineProperty(exports, "ConstantNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesConstantNodeGenerated.ConstantNodeDependencies; + } +}); +Object.defineProperty(exports, "DenseMatrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies; + } +}); +Object.defineProperty(exports, "EDependencies", { + enumerable: true, + get: function () { + return _dependenciesUppercaseEGenerated.EDependencies; + } +}); +Object.defineProperty(exports, "FibonacciHeapDependencies", { + enumerable: true, + get: function () { + return _dependenciesFibonacciHeapClassGenerated.FibonacciHeapDependencies; + } +}); +Object.defineProperty(exports, "FractionDependencies", { + enumerable: true, + get: function () { + return _dependenciesFractionClassGenerated.FractionDependencies; + } +}); +Object.defineProperty(exports, "FunctionAssignmentNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies; + } +}); +Object.defineProperty(exports, "FunctionNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesFunctionNodeGenerated.FunctionNodeDependencies; + } +}); +Object.defineProperty(exports, "HelpDependencies", { + enumerable: true, + get: function () { + return _dependenciesHelpClassGenerated.HelpDependencies; + } +}); +Object.defineProperty(exports, "ImmutableDenseMatrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesImmutableDenseMatrixClassGenerated.ImmutableDenseMatrixDependencies; + } +}); +Object.defineProperty(exports, "IndexDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexClassGenerated.IndexDependencies; + } +}); +Object.defineProperty(exports, "IndexNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexNodeGenerated.IndexNodeDependencies; + } +}); +Object.defineProperty(exports, "InfinityDependencies", { + enumerable: true, + get: function () { + return _dependenciesInfinityGenerated.InfinityDependencies; + } +}); +Object.defineProperty(exports, "LN10Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLN10Generated.LN10Dependencies; + } +}); +Object.defineProperty(exports, "LN2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLN2Generated.LN2Dependencies; + } +}); +Object.defineProperty(exports, "LOG10EDependencies", { + enumerable: true, + get: function () { + return _dependenciesLOG10EGenerated.LOG10EDependencies; + } +}); +Object.defineProperty(exports, "LOG2EDependencies", { + enumerable: true, + get: function () { + return _dependenciesLOG2EGenerated.LOG2EDependencies; + } +}); +Object.defineProperty(exports, "MatrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixClassGenerated.MatrixDependencies; + } +}); +Object.defineProperty(exports, "NaNDependencies", { + enumerable: true, + get: function () { + return _dependenciesNaNGenerated.NaNDependencies; + } +}); +Object.defineProperty(exports, "NodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesNodeGenerated.NodeDependencies; + } +}); +Object.defineProperty(exports, "ObjectNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesObjectNodeGenerated.ObjectNodeDependencies; + } +}); +Object.defineProperty(exports, "OperatorNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesOperatorNodeGenerated.OperatorNodeDependencies; + } +}); +Object.defineProperty(exports, "PIDependencies", { + enumerable: true, + get: function () { + return _dependenciesUppercasePiGenerated.PIDependencies; + } +}); +Object.defineProperty(exports, "ParenthesisNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies; + } +}); +Object.defineProperty(exports, "ParserDependencies", { + enumerable: true, + get: function () { + return _dependenciesParserClassGenerated.ParserDependencies; + } +}); +Object.defineProperty(exports, "RangeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeClassGenerated.RangeDependencies; + } +}); +Object.defineProperty(exports, "RangeNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeNodeGenerated.RangeNodeDependencies; + } +}); +Object.defineProperty(exports, "RelationalNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRelationalNodeGenerated.RelationalNodeDependencies; + } +}); +Object.defineProperty(exports, "ResultSetDependencies", { + enumerable: true, + get: function () { + return _dependenciesResultSetGenerated.ResultSetDependencies; + } +}); +Object.defineProperty(exports, "SQRT1_2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesSQRT1_2Generated.SQRT1_2Dependencies; + } +}); +Object.defineProperty(exports, "SQRT2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesSQRT2Generated.SQRT2Dependencies; + } +}); +Object.defineProperty(exports, "SpaDependencies", { + enumerable: true, + get: function () { + return _dependenciesSpaClassGenerated.SpaDependencies; + } +}); +Object.defineProperty(exports, "SparseMatrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies; + } +}); +Object.defineProperty(exports, "SymbolNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSymbolNodeGenerated.SymbolNodeDependencies; + } +}); +Object.defineProperty(exports, "UnitDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnitClassGenerated.UnitDependencies; + } +}); +Object.defineProperty(exports, "absDependencies", { + enumerable: true, + get: function () { + return _dependenciesAbsGenerated.absDependencies; + } +}); +Object.defineProperty(exports, "acosDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcosGenerated.acosDependencies; + } +}); +Object.defineProperty(exports, "acoshDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcoshGenerated.acoshDependencies; + } +}); +Object.defineProperty(exports, "acotDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcotGenerated.acotDependencies; + } +}); +Object.defineProperty(exports, "acothDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcothGenerated.acothDependencies; + } +}); +Object.defineProperty(exports, "acscDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcscGenerated.acscDependencies; + } +}); +Object.defineProperty(exports, "acschDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcschGenerated.acschDependencies; + } +}); +Object.defineProperty(exports, "addDependencies", { + enumerable: true, + get: function () { + return _dependenciesAddGenerated.addDependencies; + } +}); +Object.defineProperty(exports, "addScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesAddScalarGenerated.addScalarDependencies; + } +}); +Object.defineProperty(exports, "all", { + enumerable: true, + get: function () { + return _allFactoriesAny.all; + } +}); +Object.defineProperty(exports, "andDependencies", { + enumerable: true, + get: function () { + return _dependenciesAndGenerated.andDependencies; + } +}); +Object.defineProperty(exports, "andTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesAndTransformGenerated.andTransformDependencies; + } +}); +Object.defineProperty(exports, "applyDependencies", { + enumerable: true, + get: function () { + return _dependenciesApplyGenerated.applyDependencies; + } +}); +Object.defineProperty(exports, "applyTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesApplyTransformGenerated.applyTransformDependencies; + } +}); +Object.defineProperty(exports, "argDependencies", { + enumerable: true, + get: function () { + return _dependenciesArgGenerated.argDependencies; + } +}); +Object.defineProperty(exports, "asecDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsecGenerated.asecDependencies; + } +}); +Object.defineProperty(exports, "asechDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsechGenerated.asechDependencies; + } +}); +Object.defineProperty(exports, "asinDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsinGenerated.asinDependencies; + } +}); +Object.defineProperty(exports, "asinhDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsinhGenerated.asinhDependencies; + } +}); +Object.defineProperty(exports, "atan2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesAtan2Generated.atan2Dependencies; + } +}); +Object.defineProperty(exports, "atanDependencies", { + enumerable: true, + get: function () { + return _dependenciesAtanGenerated.atanDependencies; + } +}); +Object.defineProperty(exports, "atanhDependencies", { + enumerable: true, + get: function () { + return _dependenciesAtanhGenerated.atanhDependencies; + } +}); +Object.defineProperty(exports, "atomicMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesAtomicMassGenerated.atomicMassDependencies; + } +}); +Object.defineProperty(exports, "avogadroDependencies", { + enumerable: true, + get: function () { + return _dependenciesAvogadroGenerated.avogadroDependencies; + } +}); +Object.defineProperty(exports, "bellNumbersDependencies", { + enumerable: true, + get: function () { + return _dependenciesBellNumbersGenerated.bellNumbersDependencies; + } +}); +Object.defineProperty(exports, "bigintDependencies", { + enumerable: true, + get: function () { + return _dependenciesBigintGenerated.bigintDependencies; + } +}); +Object.defineProperty(exports, "bignumberDependencies", { + enumerable: true, + get: function () { + return _dependenciesBignumberGenerated.bignumberDependencies; + } +}); +Object.defineProperty(exports, "binDependencies", { + enumerable: true, + get: function () { + return _dependenciesBinGenerated.binDependencies; + } +}); +Object.defineProperty(exports, "bitAndDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitAndGenerated.bitAndDependencies; + } +}); +Object.defineProperty(exports, "bitAndTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitAndTransformGenerated.bitAndTransformDependencies; + } +}); +Object.defineProperty(exports, "bitNotDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitNotGenerated.bitNotDependencies; + } +}); +Object.defineProperty(exports, "bitOrDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitOrGenerated.bitOrDependencies; + } +}); +Object.defineProperty(exports, "bitOrTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitOrTransformGenerated.bitOrTransformDependencies; + } +}); +Object.defineProperty(exports, "bitXorDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitXorGenerated.bitXorDependencies; + } +}); +Object.defineProperty(exports, "bohrMagnetonDependencies", { + enumerable: true, + get: function () { + return _dependenciesBohrMagnetonGenerated.bohrMagnetonDependencies; + } +}); +Object.defineProperty(exports, "bohrRadiusDependencies", { + enumerable: true, + get: function () { + return _dependenciesBohrRadiusGenerated.bohrRadiusDependencies; + } +}); +Object.defineProperty(exports, "boltzmannDependencies", { + enumerable: true, + get: function () { + return _dependenciesBoltzmannGenerated.boltzmannDependencies; + } +}); +Object.defineProperty(exports, "booleanDependencies", { + enumerable: true, + get: function () { + return _dependenciesBooleanGenerated.booleanDependencies; + } +}); +Object.defineProperty(exports, "catalanDependencies", { + enumerable: true, + get: function () { + return _dependenciesCatalanGenerated.catalanDependencies; + } +}); +Object.defineProperty(exports, "cbrtDependencies", { + enumerable: true, + get: function () { + return _dependenciesCbrtGenerated.cbrtDependencies; + } +}); +Object.defineProperty(exports, "ceilDependencies", { + enumerable: true, + get: function () { + return _dependenciesCeilGenerated.ceilDependencies; + } +}); +Object.defineProperty(exports, "chainDependencies", { + enumerable: true, + get: function () { + return _dependenciesChainGenerated.chainDependencies; + } +}); +Object.defineProperty(exports, "classicalElectronRadiusDependencies", { + enumerable: true, + get: function () { + return _dependenciesClassicalElectronRadiusGenerated.classicalElectronRadiusDependencies; + } +}); +Object.defineProperty(exports, "cloneDependencies", { + enumerable: true, + get: function () { + return _dependenciesCloneGenerated.cloneDependencies; + } +}); +Object.defineProperty(exports, "columnDependencies", { + enumerable: true, + get: function () { + return _dependenciesColumnGenerated.columnDependencies; + } +}); +Object.defineProperty(exports, "columnTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesColumnTransformGenerated.columnTransformDependencies; + } +}); +Object.defineProperty(exports, "combinationsDependencies", { + enumerable: true, + get: function () { + return _dependenciesCombinationsGenerated.combinationsDependencies; + } +}); +Object.defineProperty(exports, "combinationsWithRepDependencies", { + enumerable: true, + get: function () { + return _dependenciesCombinationsWithRepGenerated.combinationsWithRepDependencies; + } +}); +Object.defineProperty(exports, "compareDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareGenerated.compareDependencies; + } +}); +Object.defineProperty(exports, "compareNaturalDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareNaturalGenerated.compareNaturalDependencies; + } +}); +Object.defineProperty(exports, "compareTextDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareTextGenerated.compareTextDependencies; + } +}); +Object.defineProperty(exports, "compileDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompileGenerated.compileDependencies; + } +}); +Object.defineProperty(exports, "complexDependencies", { + enumerable: true, + get: function () { + return _dependenciesComplexGenerated.complexDependencies; + } +}); +Object.defineProperty(exports, "compositionDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompositionGenerated.compositionDependencies; + } +}); +Object.defineProperty(exports, "concatDependencies", { + enumerable: true, + get: function () { + return _dependenciesConcatGenerated.concatDependencies; + } +}); +Object.defineProperty(exports, "concatTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesConcatTransformGenerated.concatTransformDependencies; + } +}); +Object.defineProperty(exports, "conductanceQuantumDependencies", { + enumerable: true, + get: function () { + return _dependenciesConductanceQuantumGenerated.conductanceQuantumDependencies; + } +}); +Object.defineProperty(exports, "conjDependencies", { + enumerable: true, + get: function () { + return _dependenciesConjGenerated.conjDependencies; + } +}); +Object.defineProperty(exports, "corrDependencies", { + enumerable: true, + get: function () { + return _dependenciesCorrGenerated.corrDependencies; + } +}); +Object.defineProperty(exports, "cosDependencies", { + enumerable: true, + get: function () { + return _dependenciesCosGenerated.cosDependencies; + } +}); +Object.defineProperty(exports, "coshDependencies", { + enumerable: true, + get: function () { + return _dependenciesCoshGenerated.coshDependencies; + } +}); +Object.defineProperty(exports, "cotDependencies", { + enumerable: true, + get: function () { + return _dependenciesCotGenerated.cotDependencies; + } +}); +Object.defineProperty(exports, "cothDependencies", { + enumerable: true, + get: function () { + return _dependenciesCothGenerated.cothDependencies; + } +}); +Object.defineProperty(exports, "coulombDependencies", { + enumerable: true, + get: function () { + return _dependenciesCoulombGenerated.coulombDependencies; + } +}); +Object.defineProperty(exports, "countDependencies", { + enumerable: true, + get: function () { + return _dependenciesCountGenerated.countDependencies; + } +}); +Object.defineProperty(exports, "createUnitDependencies", { + enumerable: true, + get: function () { + return _dependenciesCreateUnitGenerated.createUnitDependencies; + } +}); +Object.defineProperty(exports, "crossDependencies", { + enumerable: true, + get: function () { + return _dependenciesCrossGenerated.crossDependencies; + } +}); +Object.defineProperty(exports, "cscDependencies", { + enumerable: true, + get: function () { + return _dependenciesCscGenerated.cscDependencies; + } +}); +Object.defineProperty(exports, "cschDependencies", { + enumerable: true, + get: function () { + return _dependenciesCschGenerated.cschDependencies; + } +}); +Object.defineProperty(exports, "ctransposeDependencies", { + enumerable: true, + get: function () { + return _dependenciesCtransposeGenerated.ctransposeDependencies; + } +}); +Object.defineProperty(exports, "cubeDependencies", { + enumerable: true, + get: function () { + return _dependenciesCubeGenerated.cubeDependencies; + } +}); +Object.defineProperty(exports, "cumsumDependencies", { + enumerable: true, + get: function () { + return _dependenciesCumSumGenerated.cumsumDependencies; + } +}); +Object.defineProperty(exports, "cumsumTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesCumSumTransformGenerated.cumsumTransformDependencies; + } +}); +Object.defineProperty(exports, "deepEqualDependencies", { + enumerable: true, + get: function () { + return _dependenciesDeepEqualGenerated.deepEqualDependencies; + } +}); +Object.defineProperty(exports, "derivativeDependencies", { + enumerable: true, + get: function () { + return _dependenciesDerivativeGenerated.derivativeDependencies; + } +}); +Object.defineProperty(exports, "detDependencies", { + enumerable: true, + get: function () { + return _dependenciesDetGenerated.detDependencies; + } +}); +Object.defineProperty(exports, "deuteronMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesDeuteronMassGenerated.deuteronMassDependencies; + } +}); +Object.defineProperty(exports, "diagDependencies", { + enumerable: true, + get: function () { + return _dependenciesDiagGenerated.diagDependencies; + } +}); +Object.defineProperty(exports, "diffDependencies", { + enumerable: true, + get: function () { + return _dependenciesDiffGenerated.diffDependencies; + } +}); +Object.defineProperty(exports, "diffTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesDiffTransformGenerated.diffTransformDependencies; + } +}); +Object.defineProperty(exports, "distanceDependencies", { + enumerable: true, + get: function () { + return _dependenciesDistanceGenerated.distanceDependencies; + } +}); +Object.defineProperty(exports, "divideDependencies", { + enumerable: true, + get: function () { + return _dependenciesDivideGenerated.divideDependencies; + } +}); +Object.defineProperty(exports, "divideScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesDivideScalarGenerated.divideScalarDependencies; + } +}); +Object.defineProperty(exports, "dotDependencies", { + enumerable: true, + get: function () { + return _dependenciesDotGenerated.dotDependencies; + } +}); +Object.defineProperty(exports, "dotDivideDependencies", { + enumerable: true, + get: function () { + return _dependenciesDotDivideGenerated.dotDivideDependencies; + } +}); +Object.defineProperty(exports, "dotMultiplyDependencies", { + enumerable: true, + get: function () { + return _dependenciesDotMultiplyGenerated.dotMultiplyDependencies; + } +}); +Object.defineProperty(exports, "dotPowDependencies", { + enumerable: true, + get: function () { + return _dependenciesDotPowGenerated.dotPowDependencies; + } +}); +Object.defineProperty(exports, "eDependencies", { + enumerable: true, + get: function () { + return _dependenciesEGenerated.eDependencies; + } +}); +Object.defineProperty(exports, "efimovFactorDependencies", { + enumerable: true, + get: function () { + return _dependenciesEfimovFactorGenerated.efimovFactorDependencies; + } +}); +Object.defineProperty(exports, "eigsDependencies", { + enumerable: true, + get: function () { + return _dependenciesEigsGenerated.eigsDependencies; + } +}); +Object.defineProperty(exports, "electricConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesElectricConstantGenerated.electricConstantDependencies; + } +}); +Object.defineProperty(exports, "electronMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesElectronMassGenerated.electronMassDependencies; + } +}); +Object.defineProperty(exports, "elementaryChargeDependencies", { + enumerable: true, + get: function () { + return _dependenciesElementaryChargeGenerated.elementaryChargeDependencies; + } +}); +Object.defineProperty(exports, "equalDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualGenerated.equalDependencies; + } +}); +Object.defineProperty(exports, "equalScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualScalarGenerated.equalScalarDependencies; + } +}); +Object.defineProperty(exports, "equalTextDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualTextGenerated.equalTextDependencies; + } +}); +Object.defineProperty(exports, "erfDependencies", { + enumerable: true, + get: function () { + return _dependenciesErfGenerated.erfDependencies; + } +}); +Object.defineProperty(exports, "evaluateDependencies", { + enumerable: true, + get: function () { + return _dependenciesEvaluateGenerated.evaluateDependencies; + } +}); +Object.defineProperty(exports, "expDependencies", { + enumerable: true, + get: function () { + return _dependenciesExpGenerated.expDependencies; + } +}); +Object.defineProperty(exports, "expm1Dependencies", { + enumerable: true, + get: function () { + return _dependenciesExpm1Generated.expm1Dependencies; + } +}); +Object.defineProperty(exports, "expmDependencies", { + enumerable: true, + get: function () { + return _dependenciesExpmGenerated.expmDependencies; + } +}); +Object.defineProperty(exports, "factorialDependencies", { + enumerable: true, + get: function () { + return _dependenciesFactorialGenerated.factorialDependencies; + } +}); +Object.defineProperty(exports, "falseDependencies", { + enumerable: true, + get: function () { + return _dependenciesFalseGenerated.falseDependencies; + } +}); +Object.defineProperty(exports, "faradayDependencies", { + enumerable: true, + get: function () { + return _dependenciesFaradayGenerated.faradayDependencies; + } +}); +Object.defineProperty(exports, "fermiCouplingDependencies", { + enumerable: true, + get: function () { + return _dependenciesFermiCouplingGenerated.fermiCouplingDependencies; + } +}); +Object.defineProperty(exports, "fftDependencies", { + enumerable: true, + get: function () { + return _dependenciesFftGenerated.fftDependencies; + } +}); +Object.defineProperty(exports, "filterDependencies", { + enumerable: true, + get: function () { + return _dependenciesFilterGenerated.filterDependencies; + } +}); +Object.defineProperty(exports, "filterTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesFilterTransformGenerated.filterTransformDependencies; + } +}); +Object.defineProperty(exports, "fineStructureDependencies", { + enumerable: true, + get: function () { + return _dependenciesFineStructureGenerated.fineStructureDependencies; + } +}); +Object.defineProperty(exports, "firstRadiationDependencies", { + enumerable: true, + get: function () { + return _dependenciesFirstRadiationGenerated.firstRadiationDependencies; + } +}); +Object.defineProperty(exports, "fixDependencies", { + enumerable: true, + get: function () { + return _dependenciesFixGenerated.fixDependencies; + } +}); +Object.defineProperty(exports, "flattenDependencies", { + enumerable: true, + get: function () { + return _dependenciesFlattenGenerated.flattenDependencies; + } +}); +Object.defineProperty(exports, "floorDependencies", { + enumerable: true, + get: function () { + return _dependenciesFloorGenerated.floorDependencies; + } +}); +Object.defineProperty(exports, "forEachDependencies", { + enumerable: true, + get: function () { + return _dependenciesForEachGenerated.forEachDependencies; + } +}); +Object.defineProperty(exports, "forEachTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesForEachTransformGenerated.forEachTransformDependencies; + } +}); +Object.defineProperty(exports, "formatDependencies", { + enumerable: true, + get: function () { + return _dependenciesFormatGenerated.formatDependencies; + } +}); +Object.defineProperty(exports, "fractionDependencies", { + enumerable: true, + get: function () { + return _dependenciesFractionGenerated.fractionDependencies; + } +}); +Object.defineProperty(exports, "freqzDependencies", { + enumerable: true, + get: function () { + return _dependenciesFreqzGenerated.freqzDependencies; + } +}); +Object.defineProperty(exports, "gammaDependencies", { + enumerable: true, + get: function () { + return _dependenciesGammaGenerated.gammaDependencies; + } +}); +Object.defineProperty(exports, "gasConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesGasConstantGenerated.gasConstantDependencies; + } +}); +Object.defineProperty(exports, "gcdDependencies", { + enumerable: true, + get: function () { + return _dependenciesGcdGenerated.gcdDependencies; + } +}); +Object.defineProperty(exports, "getMatrixDataTypeDependencies", { + enumerable: true, + get: function () { + return _dependenciesGetMatrixDataTypeGenerated.getMatrixDataTypeDependencies; + } +}); +Object.defineProperty(exports, "gravitationConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesGravitationConstantGenerated.gravitationConstantDependencies; + } +}); +Object.defineProperty(exports, "gravityDependencies", { + enumerable: true, + get: function () { + return _dependenciesGravityGenerated.gravityDependencies; + } +}); +Object.defineProperty(exports, "hartreeEnergyDependencies", { + enumerable: true, + get: function () { + return _dependenciesHartreeEnergyGenerated.hartreeEnergyDependencies; + } +}); +Object.defineProperty(exports, "hasNumericValueDependencies", { + enumerable: true, + get: function () { + return _dependenciesHasNumericValueGenerated.hasNumericValueDependencies; + } +}); +Object.defineProperty(exports, "helpDependencies", { + enumerable: true, + get: function () { + return _dependenciesHelpGenerated.helpDependencies; + } +}); +Object.defineProperty(exports, "hexDependencies", { + enumerable: true, + get: function () { + return _dependenciesHexGenerated.hexDependencies; + } +}); +Object.defineProperty(exports, "hypotDependencies", { + enumerable: true, + get: function () { + return _dependenciesHypotGenerated.hypotDependencies; + } +}); +Object.defineProperty(exports, "iDependencies", { + enumerable: true, + get: function () { + return _dependenciesIGenerated.iDependencies; + } +}); +Object.defineProperty(exports, "identityDependencies", { + enumerable: true, + get: function () { + return _dependenciesIdentityGenerated.identityDependencies; + } +}); +Object.defineProperty(exports, "ifftDependencies", { + enumerable: true, + get: function () { + return _dependenciesIfftGenerated.ifftDependencies; + } +}); +Object.defineProperty(exports, "imDependencies", { + enumerable: true, + get: function () { + return _dependenciesImGenerated.imDependencies; + } +}); +Object.defineProperty(exports, "indexDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexGenerated.indexDependencies; + } +}); +Object.defineProperty(exports, "indexTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexTransformGenerated.indexTransformDependencies; + } +}); +Object.defineProperty(exports, "intersectDependencies", { + enumerable: true, + get: function () { + return _dependenciesIntersectGenerated.intersectDependencies; + } +}); +Object.defineProperty(exports, "invDependencies", { + enumerable: true, + get: function () { + return _dependenciesInvGenerated.invDependencies; + } +}); +Object.defineProperty(exports, "inverseConductanceQuantumDependencies", { + enumerable: true, + get: function () { + return _dependenciesInverseConductanceQuantumGenerated.inverseConductanceQuantumDependencies; + } +}); +Object.defineProperty(exports, "invmodDependencies", { + enumerable: true, + get: function () { + return _dependenciesInvmodGenerated.invmodDependencies; + } +}); +Object.defineProperty(exports, "isIntegerDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsIntegerGenerated.isIntegerDependencies; + } +}); +Object.defineProperty(exports, "isNaNDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNaNGenerated.isNaNDependencies; + } +}); +Object.defineProperty(exports, "isNegativeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNegativeGenerated.isNegativeDependencies; + } +}); +Object.defineProperty(exports, "isNumericDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNumericGenerated.isNumericDependencies; + } +}); +Object.defineProperty(exports, "isPositiveDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsPositiveGenerated.isPositiveDependencies; + } +}); +Object.defineProperty(exports, "isPrimeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsPrimeGenerated.isPrimeDependencies; + } +}); +Object.defineProperty(exports, "isZeroDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsZeroGenerated.isZeroDependencies; + } +}); +Object.defineProperty(exports, "kldivergenceDependencies", { + enumerable: true, + get: function () { + return _dependenciesKldivergenceGenerated.kldivergenceDependencies; + } +}); +Object.defineProperty(exports, "klitzingDependencies", { + enumerable: true, + get: function () { + return _dependenciesKlitzingGenerated.klitzingDependencies; + } +}); +Object.defineProperty(exports, "kronDependencies", { + enumerable: true, + get: function () { + return _dependenciesKronGenerated.kronDependencies; + } +}); +Object.defineProperty(exports, "largerDependencies", { + enumerable: true, + get: function () { + return _dependenciesLargerGenerated.largerDependencies; + } +}); +Object.defineProperty(exports, "largerEqDependencies", { + enumerable: true, + get: function () { + return _dependenciesLargerEqGenerated.largerEqDependencies; + } +}); +Object.defineProperty(exports, "lcmDependencies", { + enumerable: true, + get: function () { + return _dependenciesLcmGenerated.lcmDependencies; + } +}); +Object.defineProperty(exports, "leafCountDependencies", { + enumerable: true, + get: function () { + return _dependenciesLeafCountGenerated.leafCountDependencies; + } +}); +Object.defineProperty(exports, "leftShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesLeftShiftGenerated.leftShiftDependencies; + } +}); +Object.defineProperty(exports, "lgammaDependencies", { + enumerable: true, + get: function () { + return _dependenciesLgammaGenerated.lgammaDependencies; + } +}); +Object.defineProperty(exports, "log10Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLog10Generated.log10Dependencies; + } +}); +Object.defineProperty(exports, "log1pDependencies", { + enumerable: true, + get: function () { + return _dependenciesLog1pGenerated.log1pDependencies; + } +}); +Object.defineProperty(exports, "log2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLog2Generated.log2Dependencies; + } +}); +Object.defineProperty(exports, "logDependencies", { + enumerable: true, + get: function () { + return _dependenciesLogGenerated.logDependencies; + } +}); +Object.defineProperty(exports, "loschmidtDependencies", { + enumerable: true, + get: function () { + return _dependenciesLoschmidtGenerated.loschmidtDependencies; + } +}); +Object.defineProperty(exports, "lsolveAllDependencies", { + enumerable: true, + get: function () { + return _dependenciesLsolveAllGenerated.lsolveAllDependencies; + } +}); +Object.defineProperty(exports, "lsolveDependencies", { + enumerable: true, + get: function () { + return _dependenciesLsolveGenerated.lsolveDependencies; + } +}); +Object.defineProperty(exports, "lupDependencies", { + enumerable: true, + get: function () { + return _dependenciesLupGenerated.lupDependencies; + } +}); +Object.defineProperty(exports, "lusolveDependencies", { + enumerable: true, + get: function () { + return _dependenciesLusolveGenerated.lusolveDependencies; + } +}); +Object.defineProperty(exports, "lyapDependencies", { + enumerable: true, + get: function () { + return _dependenciesLyapGenerated.lyapDependencies; + } +}); +Object.defineProperty(exports, "madDependencies", { + enumerable: true, + get: function () { + return _dependenciesMadGenerated.madDependencies; + } +}); +Object.defineProperty(exports, "magneticConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesMagneticConstantGenerated.magneticConstantDependencies; + } +}); +Object.defineProperty(exports, "magneticFluxQuantumDependencies", { + enumerable: true, + get: function () { + return _dependenciesMagneticFluxQuantumGenerated.magneticFluxQuantumDependencies; + } +}); +Object.defineProperty(exports, "mapDependencies", { + enumerable: true, + get: function () { + return _dependenciesMapGenerated.mapDependencies; + } +}); +Object.defineProperty(exports, "mapTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMapTransformGenerated.mapTransformDependencies; + } +}); +Object.defineProperty(exports, "matrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixGenerated.matrixDependencies; + } +}); +Object.defineProperty(exports, "matrixFromColumnsDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixFromColumnsGenerated.matrixFromColumnsDependencies; + } +}); +Object.defineProperty(exports, "matrixFromFunctionDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixFromFunctionGenerated.matrixFromFunctionDependencies; + } +}); +Object.defineProperty(exports, "matrixFromRowsDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixFromRowsGenerated.matrixFromRowsDependencies; + } +}); +Object.defineProperty(exports, "maxDependencies", { + enumerable: true, + get: function () { + return _dependenciesMaxGenerated.maxDependencies; + } +}); +Object.defineProperty(exports, "maxTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMaxTransformGenerated.maxTransformDependencies; + } +}); +Object.defineProperty(exports, "meanDependencies", { + enumerable: true, + get: function () { + return _dependenciesMeanGenerated.meanDependencies; + } +}); +Object.defineProperty(exports, "meanTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMeanTransformGenerated.meanTransformDependencies; + } +}); +Object.defineProperty(exports, "medianDependencies", { + enumerable: true, + get: function () { + return _dependenciesMedianGenerated.medianDependencies; + } +}); +Object.defineProperty(exports, "minDependencies", { + enumerable: true, + get: function () { + return _dependenciesMinGenerated.minDependencies; + } +}); +Object.defineProperty(exports, "minTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMinTransformGenerated.minTransformDependencies; + } +}); +Object.defineProperty(exports, "modDependencies", { + enumerable: true, + get: function () { + return _dependenciesModGenerated.modDependencies; + } +}); +Object.defineProperty(exports, "modeDependencies", { + enumerable: true, + get: function () { + return _dependenciesModeGenerated.modeDependencies; + } +}); +Object.defineProperty(exports, "molarMassC12Dependencies", { + enumerable: true, + get: function () { + return _dependenciesMolarMassC12Generated.molarMassC12Dependencies; + } +}); +Object.defineProperty(exports, "molarMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesMolarMassGenerated.molarMassDependencies; + } +}); +Object.defineProperty(exports, "molarPlanckConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesMolarPlanckConstantGenerated.molarPlanckConstantDependencies; + } +}); +Object.defineProperty(exports, "molarVolumeDependencies", { + enumerable: true, + get: function () { + return _dependenciesMolarVolumeGenerated.molarVolumeDependencies; + } +}); +Object.defineProperty(exports, "multinomialDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultinomialGenerated.multinomialDependencies; + } +}); +Object.defineProperty(exports, "multiplyDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultiplyGenerated.multiplyDependencies; + } +}); +Object.defineProperty(exports, "multiplyScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies; + } +}); +Object.defineProperty(exports, "neutronMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesNeutronMassGenerated.neutronMassDependencies; + } +}); +Object.defineProperty(exports, "normDependencies", { + enumerable: true, + get: function () { + return _dependenciesNormGenerated.normDependencies; + } +}); +Object.defineProperty(exports, "notDependencies", { + enumerable: true, + get: function () { + return _dependenciesNotGenerated.notDependencies; + } +}); +Object.defineProperty(exports, "nthRootDependencies", { + enumerable: true, + get: function () { + return _dependenciesNthRootGenerated.nthRootDependencies; + } +}); +Object.defineProperty(exports, "nthRootsDependencies", { + enumerable: true, + get: function () { + return _dependenciesNthRootsGenerated.nthRootsDependencies; + } +}); +Object.defineProperty(exports, "nuclearMagnetonDependencies", { + enumerable: true, + get: function () { + return _dependenciesNuclearMagnetonGenerated.nuclearMagnetonDependencies; + } +}); +Object.defineProperty(exports, "nullDependencies", { + enumerable: true, + get: function () { + return _dependenciesNullGenerated.nullDependencies; + } +}); +Object.defineProperty(exports, "numberDependencies", { + enumerable: true, + get: function () { + return _dependenciesNumberGenerated.numberDependencies; + } +}); +Object.defineProperty(exports, "numericDependencies", { + enumerable: true, + get: function () { + return _dependenciesNumericGenerated.numericDependencies; + } +}); +Object.defineProperty(exports, "octDependencies", { + enumerable: true, + get: function () { + return _dependenciesOctGenerated.octDependencies; + } +}); +Object.defineProperty(exports, "onesDependencies", { + enumerable: true, + get: function () { + return _dependenciesOnesGenerated.onesDependencies; + } +}); +Object.defineProperty(exports, "orDependencies", { + enumerable: true, + get: function () { + return _dependenciesOrGenerated.orDependencies; + } +}); +Object.defineProperty(exports, "orTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesOrTransformGenerated.orTransformDependencies; + } +}); +Object.defineProperty(exports, "parseDependencies", { + enumerable: true, + get: function () { + return _dependenciesParseGenerated.parseDependencies; + } +}); +Object.defineProperty(exports, "parserDependencies", { + enumerable: true, + get: function () { + return _dependenciesParserGenerated.parserDependencies; + } +}); +Object.defineProperty(exports, "partitionSelectDependencies", { + enumerable: true, + get: function () { + return _dependenciesPartitionSelectGenerated.partitionSelectDependencies; + } +}); +Object.defineProperty(exports, "permutationsDependencies", { + enumerable: true, + get: function () { + return _dependenciesPermutationsGenerated.permutationsDependencies; + } +}); +Object.defineProperty(exports, "phiDependencies", { + enumerable: true, + get: function () { + return _dependenciesPhiGenerated.phiDependencies; + } +}); +Object.defineProperty(exports, "piDependencies", { + enumerable: true, + get: function () { + return _dependenciesPiGenerated.piDependencies; + } +}); +Object.defineProperty(exports, "pickRandomDependencies", { + enumerable: true, + get: function () { + return _dependenciesPickRandomGenerated.pickRandomDependencies; + } +}); +Object.defineProperty(exports, "pinvDependencies", { + enumerable: true, + get: function () { + return _dependenciesPinvGenerated.pinvDependencies; + } +}); +Object.defineProperty(exports, "planckChargeDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckChargeGenerated.planckChargeDependencies; + } +}); +Object.defineProperty(exports, "planckConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckConstantGenerated.planckConstantDependencies; + } +}); +Object.defineProperty(exports, "planckLengthDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckLengthGenerated.planckLengthDependencies; + } +}); +Object.defineProperty(exports, "planckMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckMassGenerated.planckMassDependencies; + } +}); +Object.defineProperty(exports, "planckTemperatureDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckTemperatureGenerated.planckTemperatureDependencies; + } +}); +Object.defineProperty(exports, "planckTimeDependencies", { + enumerable: true, + get: function () { + return _dependenciesPlanckTimeGenerated.planckTimeDependencies; + } +}); +Object.defineProperty(exports, "polynomialRootDependencies", { + enumerable: true, + get: function () { + return _dependenciesPolynomialRootGenerated.polynomialRootDependencies; + } +}); +Object.defineProperty(exports, "powDependencies", { + enumerable: true, + get: function () { + return _dependenciesPowGenerated.powDependencies; + } +}); +Object.defineProperty(exports, "printDependencies", { + enumerable: true, + get: function () { + return _dependenciesPrintGenerated.printDependencies; + } +}); +Object.defineProperty(exports, "printTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesPrintTransformGenerated.printTransformDependencies; + } +}); +Object.defineProperty(exports, "prodDependencies", { + enumerable: true, + get: function () { + return _dependenciesProdGenerated.prodDependencies; + } +}); +Object.defineProperty(exports, "protonMassDependencies", { + enumerable: true, + get: function () { + return _dependenciesProtonMassGenerated.protonMassDependencies; + } +}); +Object.defineProperty(exports, "qrDependencies", { + enumerable: true, + get: function () { + return _dependenciesQrGenerated.qrDependencies; + } +}); +Object.defineProperty(exports, "quantileSeqDependencies", { + enumerable: true, + get: function () { + return _dependenciesQuantileSeqGenerated.quantileSeqDependencies; + } +}); +Object.defineProperty(exports, "quantileSeqTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesQuantileSeqTransformGenerated.quantileSeqTransformDependencies; + } +}); +Object.defineProperty(exports, "quantumOfCirculationDependencies", { + enumerable: true, + get: function () { + return _dependenciesQuantumOfCirculationGenerated.quantumOfCirculationDependencies; + } +}); +Object.defineProperty(exports, "randomDependencies", { + enumerable: true, + get: function () { + return _dependenciesRandomGenerated.randomDependencies; + } +}); +Object.defineProperty(exports, "randomIntDependencies", { + enumerable: true, + get: function () { + return _dependenciesRandomIntGenerated.randomIntDependencies; + } +}); +Object.defineProperty(exports, "rangeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeGenerated.rangeDependencies; + } +}); +Object.defineProperty(exports, "rangeTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeTransformGenerated.rangeTransformDependencies; + } +}); +Object.defineProperty(exports, "rationalizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRationalizeGenerated.rationalizeDependencies; + } +}); +Object.defineProperty(exports, "reDependencies", { + enumerable: true, + get: function () { + return _dependenciesReGenerated.reDependencies; + } +}); +Object.defineProperty(exports, "reducedPlanckConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesReducedPlanckConstantGenerated.reducedPlanckConstantDependencies; + } +}); +Object.defineProperty(exports, "replacerDependencies", { + enumerable: true, + get: function () { + return _dependenciesReplacerGenerated.replacerDependencies; + } +}); +Object.defineProperty(exports, "reshapeDependencies", { + enumerable: true, + get: function () { + return _dependenciesReshapeGenerated.reshapeDependencies; + } +}); +Object.defineProperty(exports, "resizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesResizeGenerated.resizeDependencies; + } +}); +Object.defineProperty(exports, "resolveDependencies", { + enumerable: true, + get: function () { + return _dependenciesResolveGenerated.resolveDependencies; + } +}); +Object.defineProperty(exports, "reviverDependencies", { + enumerable: true, + get: function () { + return _dependenciesReviverGenerated.reviverDependencies; + } +}); +Object.defineProperty(exports, "rightArithShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesRightArithShiftGenerated.rightArithShiftDependencies; + } +}); +Object.defineProperty(exports, "rightLogShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesRightLogShiftGenerated.rightLogShiftDependencies; + } +}); +Object.defineProperty(exports, "rotateDependencies", { + enumerable: true, + get: function () { + return _dependenciesRotateGenerated.rotateDependencies; + } +}); +Object.defineProperty(exports, "rotationMatrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesRotationMatrixGenerated.rotationMatrixDependencies; + } +}); +Object.defineProperty(exports, "roundDependencies", { + enumerable: true, + get: function () { + return _dependenciesRoundGenerated.roundDependencies; + } +}); +Object.defineProperty(exports, "rowDependencies", { + enumerable: true, + get: function () { + return _dependenciesRowGenerated.rowDependencies; + } +}); +Object.defineProperty(exports, "rowTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesRowTransformGenerated.rowTransformDependencies; + } +}); +Object.defineProperty(exports, "rydbergDependencies", { + enumerable: true, + get: function () { + return _dependenciesRydbergGenerated.rydbergDependencies; + } +}); +Object.defineProperty(exports, "sackurTetrodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSackurTetrodeGenerated.sackurTetrodeDependencies; + } +}); +Object.defineProperty(exports, "schurDependencies", { + enumerable: true, + get: function () { + return _dependenciesSchurGenerated.schurDependencies; + } +}); +Object.defineProperty(exports, "secDependencies", { + enumerable: true, + get: function () { + return _dependenciesSecGenerated.secDependencies; + } +}); +Object.defineProperty(exports, "sechDependencies", { + enumerable: true, + get: function () { + return _dependenciesSechGenerated.sechDependencies; + } +}); +Object.defineProperty(exports, "secondRadiationDependencies", { + enumerable: true, + get: function () { + return _dependenciesSecondRadiationGenerated.secondRadiationDependencies; + } +}); +Object.defineProperty(exports, "setCartesianDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetCartesianGenerated.setCartesianDependencies; + } +}); +Object.defineProperty(exports, "setDifferenceDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetDifferenceGenerated.setDifferenceDependencies; + } +}); +Object.defineProperty(exports, "setDistinctDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetDistinctGenerated.setDistinctDependencies; + } +}); +Object.defineProperty(exports, "setIntersectDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetIntersectGenerated.setIntersectDependencies; + } +}); +Object.defineProperty(exports, "setIsSubsetDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetIsSubsetGenerated.setIsSubsetDependencies; + } +}); +Object.defineProperty(exports, "setMultiplicityDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetMultiplicityGenerated.setMultiplicityDependencies; + } +}); +Object.defineProperty(exports, "setPowersetDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetPowersetGenerated.setPowersetDependencies; + } +}); +Object.defineProperty(exports, "setSizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetSizeGenerated.setSizeDependencies; + } +}); +Object.defineProperty(exports, "setSymDifferenceDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetSymDifferenceGenerated.setSymDifferenceDependencies; + } +}); +Object.defineProperty(exports, "setUnionDependencies", { + enumerable: true, + get: function () { + return _dependenciesSetUnionGenerated.setUnionDependencies; + } +}); +Object.defineProperty(exports, "signDependencies", { + enumerable: true, + get: function () { + return _dependenciesSignGenerated.signDependencies; + } +}); +Object.defineProperty(exports, "simplifyConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies; + } +}); +Object.defineProperty(exports, "simplifyCoreDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies; + } +}); +Object.defineProperty(exports, "simplifyDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyGenerated.simplifyDependencies; + } +}); +Object.defineProperty(exports, "sinDependencies", { + enumerable: true, + get: function () { + return _dependenciesSinGenerated.sinDependencies; + } +}); +Object.defineProperty(exports, "sinhDependencies", { + enumerable: true, + get: function () { + return _dependenciesSinhGenerated.sinhDependencies; + } +}); +Object.defineProperty(exports, "sizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSizeGenerated.sizeDependencies; + } +}); +Object.defineProperty(exports, "sluDependencies", { + enumerable: true, + get: function () { + return _dependenciesSluGenerated.sluDependencies; + } +}); +Object.defineProperty(exports, "smallerDependencies", { + enumerable: true, + get: function () { + return _dependenciesSmallerGenerated.smallerDependencies; + } +}); +Object.defineProperty(exports, "smallerEqDependencies", { + enumerable: true, + get: function () { + return _dependenciesSmallerEqGenerated.smallerEqDependencies; + } +}); +Object.defineProperty(exports, "solveODEDependencies", { + enumerable: true, + get: function () { + return _dependenciesSolveODEGenerated.solveODEDependencies; + } +}); +Object.defineProperty(exports, "sortDependencies", { + enumerable: true, + get: function () { + return _dependenciesSortGenerated.sortDependencies; + } +}); +Object.defineProperty(exports, "sparseDependencies", { + enumerable: true, + get: function () { + return _dependenciesSparseGenerated.sparseDependencies; + } +}); +Object.defineProperty(exports, "speedOfLightDependencies", { + enumerable: true, + get: function () { + return _dependenciesSpeedOfLightGenerated.speedOfLightDependencies; + } +}); +Object.defineProperty(exports, "splitUnitDependencies", { + enumerable: true, + get: function () { + return _dependenciesSplitUnitGenerated.splitUnitDependencies; + } +}); +Object.defineProperty(exports, "sqrtDependencies", { + enumerable: true, + get: function () { + return _dependenciesSqrtGenerated.sqrtDependencies; + } +}); +Object.defineProperty(exports, "sqrtmDependencies", { + enumerable: true, + get: function () { + return _dependenciesSqrtmGenerated.sqrtmDependencies; + } +}); +Object.defineProperty(exports, "squareDependencies", { + enumerable: true, + get: function () { + return _dependenciesSquareGenerated.squareDependencies; + } +}); +Object.defineProperty(exports, "squeezeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSqueezeGenerated.squeezeDependencies; + } +}); +Object.defineProperty(exports, "stdDependencies", { + enumerable: true, + get: function () { + return _dependenciesStdGenerated.stdDependencies; + } +}); +Object.defineProperty(exports, "stdTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesStdTransformGenerated.stdTransformDependencies; + } +}); +Object.defineProperty(exports, "stefanBoltzmannDependencies", { + enumerable: true, + get: function () { + return _dependenciesStefanBoltzmannGenerated.stefanBoltzmannDependencies; + } +}); +Object.defineProperty(exports, "stirlingS2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesStirlingS2Generated.stirlingS2Dependencies; + } +}); +Object.defineProperty(exports, "stringDependencies", { + enumerable: true, + get: function () { + return _dependenciesStringGenerated.stringDependencies; + } +}); +Object.defineProperty(exports, "subsetDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubsetGenerated.subsetDependencies; + } +}); +Object.defineProperty(exports, "subsetTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubsetTransformGenerated.subsetTransformDependencies; + } +}); +Object.defineProperty(exports, "subtractDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubtractGenerated.subtractDependencies; + } +}); +Object.defineProperty(exports, "subtractScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubtractScalarGenerated.subtractScalarDependencies; + } +}); +Object.defineProperty(exports, "sumDependencies", { + enumerable: true, + get: function () { + return _dependenciesSumGenerated.sumDependencies; + } +}); +Object.defineProperty(exports, "sumTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesSumTransformGenerated.sumTransformDependencies; + } +}); +Object.defineProperty(exports, "sylvesterDependencies", { + enumerable: true, + get: function () { + return _dependenciesSylvesterGenerated.sylvesterDependencies; + } +}); +Object.defineProperty(exports, "symbolicEqualDependencies", { + enumerable: true, + get: function () { + return _dependenciesSymbolicEqualGenerated.symbolicEqualDependencies; + } +}); +Object.defineProperty(exports, "tanDependencies", { + enumerable: true, + get: function () { + return _dependenciesTanGenerated.tanDependencies; + } +}); +Object.defineProperty(exports, "tanhDependencies", { + enumerable: true, + get: function () { + return _dependenciesTanhGenerated.tanhDependencies; + } +}); +Object.defineProperty(exports, "tauDependencies", { + enumerable: true, + get: function () { + return _dependenciesTauGenerated.tauDependencies; + } +}); +Object.defineProperty(exports, "thomsonCrossSectionDependencies", { + enumerable: true, + get: function () { + return _dependenciesThomsonCrossSectionGenerated.thomsonCrossSectionDependencies; + } +}); +Object.defineProperty(exports, "toDependencies", { + enumerable: true, + get: function () { + return _dependenciesToGenerated.toDependencies; + } +}); +Object.defineProperty(exports, "traceDependencies", { + enumerable: true, + get: function () { + return _dependenciesTraceGenerated.traceDependencies; + } +}); +Object.defineProperty(exports, "transposeDependencies", { + enumerable: true, + get: function () { + return _dependenciesTransposeGenerated.transposeDependencies; + } +}); +Object.defineProperty(exports, "trueDependencies", { + enumerable: true, + get: function () { + return _dependenciesTrueGenerated.trueDependencies; + } +}); +Object.defineProperty(exports, "typeOfDependencies", { + enumerable: true, + get: function () { + return _dependenciesTypeOfGenerated.typeOfDependencies; + } +}); +Object.defineProperty(exports, "typedDependencies", { + enumerable: true, + get: function () { + return _dependenciesTypedGenerated.typedDependencies; + } +}); +Object.defineProperty(exports, "unaryMinusDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnaryMinusGenerated.unaryMinusDependencies; + } +}); +Object.defineProperty(exports, "unaryPlusDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnaryPlusGenerated.unaryPlusDependencies; + } +}); +Object.defineProperty(exports, "unequalDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnequalGenerated.unequalDependencies; + } +}); +Object.defineProperty(exports, "unitDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnitFunctionGenerated.unitDependencies; + } +}); +Object.defineProperty(exports, "usolveAllDependencies", { + enumerable: true, + get: function () { + return _dependenciesUsolveAllGenerated.usolveAllDependencies; + } +}); +Object.defineProperty(exports, "usolveDependencies", { + enumerable: true, + get: function () { + return _dependenciesUsolveGenerated.usolveDependencies; + } +}); +Object.defineProperty(exports, "vacuumImpedanceDependencies", { + enumerable: true, + get: function () { + return _dependenciesVacuumImpedanceGenerated.vacuumImpedanceDependencies; + } +}); +Object.defineProperty(exports, "varianceDependencies", { + enumerable: true, + get: function () { + return _dependenciesVarianceGenerated.varianceDependencies; + } +}); +Object.defineProperty(exports, "varianceTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesVarianceTransformGenerated.varianceTransformDependencies; + } +}); +Object.defineProperty(exports, "versionDependencies", { + enumerable: true, + get: function () { + return _dependenciesVersionGenerated.versionDependencies; + } +}); +Object.defineProperty(exports, "weakMixingAngleDependencies", { + enumerable: true, + get: function () { + return _dependenciesWeakMixingAngleGenerated.weakMixingAngleDependencies; + } +}); +Object.defineProperty(exports, "wienDisplacementDependencies", { + enumerable: true, + get: function () { + return _dependenciesWienDisplacementGenerated.wienDisplacementDependencies; + } +}); +Object.defineProperty(exports, "xgcdDependencies", { + enumerable: true, + get: function () { + return _dependenciesXgcdGenerated.xgcdDependencies; + } +}); +Object.defineProperty(exports, "xorDependencies", { + enumerable: true, + get: function () { + return _dependenciesXorGenerated.xorDependencies; + } +}); +Object.defineProperty(exports, "zerosDependencies", { + enumerable: true, + get: function () { + return _dependenciesZerosGenerated.zerosDependencies; + } +}); +Object.defineProperty(exports, "zetaDependencies", { + enumerable: true, + get: function () { + return _dependenciesZetaGenerated.zetaDependencies; + } +}); +Object.defineProperty(exports, "zpk2tfDependencies", { + enumerable: true, + get: function () { + return _dependenciesZpk2tfGenerated.zpk2tfDependencies; + } +}); +var _dependenciesAbsGenerated = require("./dependenciesAny/dependenciesAbs.generated.js"); +var _dependenciesAccessorNodeGenerated = require("./dependenciesAny/dependenciesAccessorNode.generated.js"); +var _dependenciesAcosGenerated = require("./dependenciesAny/dependenciesAcos.generated.js"); +var _dependenciesAcoshGenerated = require("./dependenciesAny/dependenciesAcosh.generated.js"); +var _dependenciesAcotGenerated = require("./dependenciesAny/dependenciesAcot.generated.js"); +var _dependenciesAcothGenerated = require("./dependenciesAny/dependenciesAcoth.generated.js"); +var _dependenciesAcscGenerated = require("./dependenciesAny/dependenciesAcsc.generated.js"); +var _dependenciesAcschGenerated = require("./dependenciesAny/dependenciesAcsch.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAny/dependenciesAdd.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAny/dependenciesAddScalar.generated.js"); +var _dependenciesAndGenerated = require("./dependenciesAny/dependenciesAnd.generated.js"); +var _dependenciesAndTransformGenerated = require("./dependenciesAny/dependenciesAndTransform.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesAny/dependenciesApply.generated.js"); +var _dependenciesApplyTransformGenerated = require("./dependenciesAny/dependenciesApplyTransform.generated.js"); +var _dependenciesArgGenerated = require("./dependenciesAny/dependenciesArg.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesAny/dependenciesArrayNode.generated.js"); +var _dependenciesAsecGenerated = require("./dependenciesAny/dependenciesAsec.generated.js"); +var _dependenciesAsechGenerated = require("./dependenciesAny/dependenciesAsech.generated.js"); +var _dependenciesAsinGenerated = require("./dependenciesAny/dependenciesAsin.generated.js"); +var _dependenciesAsinhGenerated = require("./dependenciesAny/dependenciesAsinh.generated.js"); +var _dependenciesAssignmentNodeGenerated = require("./dependenciesAny/dependenciesAssignmentNode.generated.js"); +var _dependenciesAtanGenerated = require("./dependenciesAny/dependenciesAtan.generated.js"); +var _dependenciesAtan2Generated = require("./dependenciesAny/dependenciesAtan2.generated.js"); +var _dependenciesAtanhGenerated = require("./dependenciesAny/dependenciesAtanh.generated.js"); +var _dependenciesAtomicMassGenerated = require("./dependenciesAny/dependenciesAtomicMass.generated.js"); +var _dependenciesAvogadroGenerated = require("./dependenciesAny/dependenciesAvogadro.generated.js"); +var _dependenciesBellNumbersGenerated = require("./dependenciesAny/dependenciesBellNumbers.generated.js"); +var _dependenciesBigNumberClassGenerated = require("./dependenciesAny/dependenciesBigNumberClass.generated.js"); +var _dependenciesBigintGenerated = require("./dependenciesAny/dependenciesBigint.generated.js"); +var _dependenciesBignumberGenerated = require("./dependenciesAny/dependenciesBignumber.generated.js"); +var _dependenciesBinGenerated = require("./dependenciesAny/dependenciesBin.generated.js"); +var _dependenciesBitAndGenerated = require("./dependenciesAny/dependenciesBitAnd.generated.js"); +var _dependenciesBitAndTransformGenerated = require("./dependenciesAny/dependenciesBitAndTransform.generated.js"); +var _dependenciesBitNotGenerated = require("./dependenciesAny/dependenciesBitNot.generated.js"); +var _dependenciesBitOrGenerated = require("./dependenciesAny/dependenciesBitOr.generated.js"); +var _dependenciesBitOrTransformGenerated = require("./dependenciesAny/dependenciesBitOrTransform.generated.js"); +var _dependenciesBitXorGenerated = require("./dependenciesAny/dependenciesBitXor.generated.js"); +var _dependenciesBlockNodeGenerated = require("./dependenciesAny/dependenciesBlockNode.generated.js"); +var _dependenciesBohrMagnetonGenerated = require("./dependenciesAny/dependenciesBohrMagneton.generated.js"); +var _dependenciesBohrRadiusGenerated = require("./dependenciesAny/dependenciesBohrRadius.generated.js"); +var _dependenciesBoltzmannGenerated = require("./dependenciesAny/dependenciesBoltzmann.generated.js"); +var _dependenciesBooleanGenerated = require("./dependenciesAny/dependenciesBoolean.generated.js"); +var _dependenciesCatalanGenerated = require("./dependenciesAny/dependenciesCatalan.generated.js"); +var _dependenciesCbrtGenerated = require("./dependenciesAny/dependenciesCbrt.generated.js"); +var _dependenciesCeilGenerated = require("./dependenciesAny/dependenciesCeil.generated.js"); +var _dependenciesChainGenerated = require("./dependenciesAny/dependenciesChain.generated.js"); +var _dependenciesChainClassGenerated = require("./dependenciesAny/dependenciesChainClass.generated.js"); +var _dependenciesClassicalElectronRadiusGenerated = require("./dependenciesAny/dependenciesClassicalElectronRadius.generated.js"); +var _dependenciesCloneGenerated = require("./dependenciesAny/dependenciesClone.generated.js"); +var _dependenciesColumnGenerated = require("./dependenciesAny/dependenciesColumn.generated.js"); +var _dependenciesColumnTransformGenerated = require("./dependenciesAny/dependenciesColumnTransform.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesAny/dependenciesCombinations.generated.js"); +var _dependenciesCombinationsWithRepGenerated = require("./dependenciesAny/dependenciesCombinationsWithRep.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesAny/dependenciesCompare.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesAny/dependenciesCompareNatural.generated.js"); +var _dependenciesCompareTextGenerated = require("./dependenciesAny/dependenciesCompareText.generated.js"); +var _dependenciesCompileGenerated = require("./dependenciesAny/dependenciesCompile.generated.js"); +var _dependenciesComplexGenerated = require("./dependenciesAny/dependenciesComplex.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesAny/dependenciesComplexClass.generated.js"); +var _dependenciesCompositionGenerated = require("./dependenciesAny/dependenciesComposition.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesAny/dependenciesConcat.generated.js"); +var _dependenciesConcatTransformGenerated = require("./dependenciesAny/dependenciesConcatTransform.generated.js"); +var _dependenciesConditionalNodeGenerated = require("./dependenciesAny/dependenciesConditionalNode.generated.js"); +var _dependenciesConductanceQuantumGenerated = require("./dependenciesAny/dependenciesConductanceQuantum.generated.js"); +var _dependenciesConjGenerated = require("./dependenciesAny/dependenciesConj.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesAny/dependenciesConstantNode.generated.js"); +var _dependenciesCorrGenerated = require("./dependenciesAny/dependenciesCorr.generated.js"); +var _dependenciesCosGenerated = require("./dependenciesAny/dependenciesCos.generated.js"); +var _dependenciesCoshGenerated = require("./dependenciesAny/dependenciesCosh.generated.js"); +var _dependenciesCotGenerated = require("./dependenciesAny/dependenciesCot.generated.js"); +var _dependenciesCothGenerated = require("./dependenciesAny/dependenciesCoth.generated.js"); +var _dependenciesCoulombGenerated = require("./dependenciesAny/dependenciesCoulomb.generated.js"); +var _dependenciesCountGenerated = require("./dependenciesAny/dependenciesCount.generated.js"); +var _dependenciesCreateUnitGenerated = require("./dependenciesAny/dependenciesCreateUnit.generated.js"); +var _dependenciesCrossGenerated = require("./dependenciesAny/dependenciesCross.generated.js"); +var _dependenciesCscGenerated = require("./dependenciesAny/dependenciesCsc.generated.js"); +var _dependenciesCschGenerated = require("./dependenciesAny/dependenciesCsch.generated.js"); +var _dependenciesCtransposeGenerated = require("./dependenciesAny/dependenciesCtranspose.generated.js"); +var _dependenciesCubeGenerated = require("./dependenciesAny/dependenciesCube.generated.js"); +var _dependenciesCumSumGenerated = require("./dependenciesAny/dependenciesCumSum.generated.js"); +var _dependenciesCumSumTransformGenerated = require("./dependenciesAny/dependenciesCumSumTransform.generated.js"); +var _dependenciesDeepEqualGenerated = require("./dependenciesAny/dependenciesDeepEqual.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesAny/dependenciesDenseMatrixClass.generated.js"); +var _dependenciesDerivativeGenerated = require("./dependenciesAny/dependenciesDerivative.generated.js"); +var _dependenciesDetGenerated = require("./dependenciesAny/dependenciesDet.generated.js"); +var _dependenciesDeuteronMassGenerated = require("./dependenciesAny/dependenciesDeuteronMass.generated.js"); +var _dependenciesDiagGenerated = require("./dependenciesAny/dependenciesDiag.generated.js"); +var _dependenciesDiffGenerated = require("./dependenciesAny/dependenciesDiff.generated.js"); +var _dependenciesDiffTransformGenerated = require("./dependenciesAny/dependenciesDiffTransform.generated.js"); +var _dependenciesDistanceGenerated = require("./dependenciesAny/dependenciesDistance.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesAny/dependenciesDivide.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesAny/dependenciesDivideScalar.generated.js"); +var _dependenciesDotGenerated = require("./dependenciesAny/dependenciesDot.generated.js"); +var _dependenciesDotDivideGenerated = require("./dependenciesAny/dependenciesDotDivide.generated.js"); +var _dependenciesDotMultiplyGenerated = require("./dependenciesAny/dependenciesDotMultiply.generated.js"); +var _dependenciesDotPowGenerated = require("./dependenciesAny/dependenciesDotPow.generated.js"); +var _dependenciesEGenerated = require("./dependenciesAny/dependenciesE.generated.js"); +var _dependenciesEfimovFactorGenerated = require("./dependenciesAny/dependenciesEfimovFactor.generated.js"); +var _dependenciesEigsGenerated = require("./dependenciesAny/dependenciesEigs.generated.js"); +var _dependenciesElectricConstantGenerated = require("./dependenciesAny/dependenciesElectricConstant.generated.js"); +var _dependenciesElectronMassGenerated = require("./dependenciesAny/dependenciesElectronMass.generated.js"); +var _dependenciesElementaryChargeGenerated = require("./dependenciesAny/dependenciesElementaryCharge.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesAny/dependenciesEqual.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesAny/dependenciesEqualScalar.generated.js"); +var _dependenciesEqualTextGenerated = require("./dependenciesAny/dependenciesEqualText.generated.js"); +var _dependenciesErfGenerated = require("./dependenciesAny/dependenciesErf.generated.js"); +var _dependenciesEvaluateGenerated = require("./dependenciesAny/dependenciesEvaluate.generated.js"); +var _dependenciesExpGenerated = require("./dependenciesAny/dependenciesExp.generated.js"); +var _dependenciesExpmGenerated = require("./dependenciesAny/dependenciesExpm.generated.js"); +var _dependenciesExpm1Generated = require("./dependenciesAny/dependenciesExpm1.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesAny/dependenciesFactorial.generated.js"); +var _dependenciesFalseGenerated = require("./dependenciesAny/dependenciesFalse.generated.js"); +var _dependenciesFaradayGenerated = require("./dependenciesAny/dependenciesFaraday.generated.js"); +var _dependenciesFermiCouplingGenerated = require("./dependenciesAny/dependenciesFermiCoupling.generated.js"); +var _dependenciesFftGenerated = require("./dependenciesAny/dependenciesFft.generated.js"); +var _dependenciesFibonacciHeapClassGenerated = require("./dependenciesAny/dependenciesFibonacciHeapClass.generated.js"); +var _dependenciesFilterGenerated = require("./dependenciesAny/dependenciesFilter.generated.js"); +var _dependenciesFilterTransformGenerated = require("./dependenciesAny/dependenciesFilterTransform.generated.js"); +var _dependenciesFineStructureGenerated = require("./dependenciesAny/dependenciesFineStructure.generated.js"); +var _dependenciesFirstRadiationGenerated = require("./dependenciesAny/dependenciesFirstRadiation.generated.js"); +var _dependenciesFixGenerated = require("./dependenciesAny/dependenciesFix.generated.js"); +var _dependenciesFlattenGenerated = require("./dependenciesAny/dependenciesFlatten.generated.js"); +var _dependenciesFloorGenerated = require("./dependenciesAny/dependenciesFloor.generated.js"); +var _dependenciesForEachGenerated = require("./dependenciesAny/dependenciesForEach.generated.js"); +var _dependenciesForEachTransformGenerated = require("./dependenciesAny/dependenciesForEachTransform.generated.js"); +var _dependenciesFormatGenerated = require("./dependenciesAny/dependenciesFormat.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesAny/dependenciesFraction.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesAny/dependenciesFractionClass.generated.js"); +var _dependenciesFreqzGenerated = require("./dependenciesAny/dependenciesFreqz.generated.js"); +var _dependenciesFunctionAssignmentNodeGenerated = require("./dependenciesAny/dependenciesFunctionAssignmentNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesAny/dependenciesFunctionNode.generated.js"); +var _dependenciesGammaGenerated = require("./dependenciesAny/dependenciesGamma.generated.js"); +var _dependenciesGasConstantGenerated = require("./dependenciesAny/dependenciesGasConstant.generated.js"); +var _dependenciesGcdGenerated = require("./dependenciesAny/dependenciesGcd.generated.js"); +var _dependenciesGetMatrixDataTypeGenerated = require("./dependenciesAny/dependenciesGetMatrixDataType.generated.js"); +var _dependenciesGravitationConstantGenerated = require("./dependenciesAny/dependenciesGravitationConstant.generated.js"); +var _dependenciesGravityGenerated = require("./dependenciesAny/dependenciesGravity.generated.js"); +var _dependenciesHartreeEnergyGenerated = require("./dependenciesAny/dependenciesHartreeEnergy.generated.js"); +var _dependenciesHasNumericValueGenerated = require("./dependenciesAny/dependenciesHasNumericValue.generated.js"); +var _dependenciesHelpGenerated = require("./dependenciesAny/dependenciesHelp.generated.js"); +var _dependenciesHelpClassGenerated = require("./dependenciesAny/dependenciesHelpClass.generated.js"); +var _dependenciesHexGenerated = require("./dependenciesAny/dependenciesHex.generated.js"); +var _dependenciesHypotGenerated = require("./dependenciesAny/dependenciesHypot.generated.js"); +var _dependenciesIGenerated = require("./dependenciesAny/dependenciesI.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesAny/dependenciesIdentity.generated.js"); +var _dependenciesIfftGenerated = require("./dependenciesAny/dependenciesIfft.generated.js"); +var _dependenciesImGenerated = require("./dependenciesAny/dependenciesIm.generated.js"); +var _dependenciesImmutableDenseMatrixClassGenerated = require("./dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js"); +var _dependenciesIndexGenerated = require("./dependenciesAny/dependenciesIndex.generated.js"); +var _dependenciesIndexClassGenerated = require("./dependenciesAny/dependenciesIndexClass.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesAny/dependenciesIndexNode.generated.js"); +var _dependenciesIndexTransformGenerated = require("./dependenciesAny/dependenciesIndexTransform.generated.js"); +var _dependenciesInfinityGenerated = require("./dependenciesAny/dependenciesInfinity.generated.js"); +var _dependenciesIntersectGenerated = require("./dependenciesAny/dependenciesIntersect.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesAny/dependenciesInv.generated.js"); +var _dependenciesInverseConductanceQuantumGenerated = require("./dependenciesAny/dependenciesInverseConductanceQuantum.generated.js"); +var _dependenciesInvmodGenerated = require("./dependenciesAny/dependenciesInvmod.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesAny/dependenciesIsInteger.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesAny/dependenciesIsNaN.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesAny/dependenciesIsNegative.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesAny/dependenciesIsNumeric.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesAny/dependenciesIsPositive.generated.js"); +var _dependenciesIsPrimeGenerated = require("./dependenciesAny/dependenciesIsPrime.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesAny/dependenciesIsZero.generated.js"); +var _dependenciesKldivergenceGenerated = require("./dependenciesAny/dependenciesKldivergence.generated.js"); +var _dependenciesKlitzingGenerated = require("./dependenciesAny/dependenciesKlitzing.generated.js"); +var _dependenciesKronGenerated = require("./dependenciesAny/dependenciesKron.generated.js"); +var _dependenciesLN10Generated = require("./dependenciesAny/dependenciesLN10.generated.js"); +var _dependenciesLN2Generated = require("./dependenciesAny/dependenciesLN2.generated.js"); +var _dependenciesLOG10EGenerated = require("./dependenciesAny/dependenciesLOG10E.generated.js"); +var _dependenciesLOG2EGenerated = require("./dependenciesAny/dependenciesLOG2E.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesAny/dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesAny/dependenciesLargerEq.generated.js"); +var _dependenciesLcmGenerated = require("./dependenciesAny/dependenciesLcm.generated.js"); +var _dependenciesLeafCountGenerated = require("./dependenciesAny/dependenciesLeafCount.generated.js"); +var _dependenciesLeftShiftGenerated = require("./dependenciesAny/dependenciesLeftShift.generated.js"); +var _dependenciesLgammaGenerated = require("./dependenciesAny/dependenciesLgamma.generated.js"); +var _dependenciesLogGenerated = require("./dependenciesAny/dependenciesLog.generated.js"); +var _dependenciesLog10Generated = require("./dependenciesAny/dependenciesLog10.generated.js"); +var _dependenciesLog1pGenerated = require("./dependenciesAny/dependenciesLog1p.generated.js"); +var _dependenciesLog2Generated = require("./dependenciesAny/dependenciesLog2.generated.js"); +var _dependenciesLoschmidtGenerated = require("./dependenciesAny/dependenciesLoschmidt.generated.js"); +var _dependenciesLsolveGenerated = require("./dependenciesAny/dependenciesLsolve.generated.js"); +var _dependenciesLsolveAllGenerated = require("./dependenciesAny/dependenciesLsolveAll.generated.js"); +var _dependenciesLupGenerated = require("./dependenciesAny/dependenciesLup.generated.js"); +var _dependenciesLusolveGenerated = require("./dependenciesAny/dependenciesLusolve.generated.js"); +var _dependenciesLyapGenerated = require("./dependenciesAny/dependenciesLyap.generated.js"); +var _dependenciesMadGenerated = require("./dependenciesAny/dependenciesMad.generated.js"); +var _dependenciesMagneticConstantGenerated = require("./dependenciesAny/dependenciesMagneticConstant.generated.js"); +var _dependenciesMagneticFluxQuantumGenerated = require("./dependenciesAny/dependenciesMagneticFluxQuantum.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesAny/dependenciesMap.generated.js"); +var _dependenciesMapTransformGenerated = require("./dependenciesAny/dependenciesMapTransform.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesAny/dependenciesMatrix.generated.js"); +var _dependenciesMatrixClassGenerated = require("./dependenciesAny/dependenciesMatrixClass.generated.js"); +var _dependenciesMatrixFromColumnsGenerated = require("./dependenciesAny/dependenciesMatrixFromColumns.generated.js"); +var _dependenciesMatrixFromFunctionGenerated = require("./dependenciesAny/dependenciesMatrixFromFunction.generated.js"); +var _dependenciesMatrixFromRowsGenerated = require("./dependenciesAny/dependenciesMatrixFromRows.generated.js"); +var _dependenciesMaxGenerated = require("./dependenciesAny/dependenciesMax.generated.js"); +var _dependenciesMaxTransformGenerated = require("./dependenciesAny/dependenciesMaxTransform.generated.js"); +var _dependenciesMeanGenerated = require("./dependenciesAny/dependenciesMean.generated.js"); +var _dependenciesMeanTransformGenerated = require("./dependenciesAny/dependenciesMeanTransform.generated.js"); +var _dependenciesMedianGenerated = require("./dependenciesAny/dependenciesMedian.generated.js"); +var _dependenciesMinGenerated = require("./dependenciesAny/dependenciesMin.generated.js"); +var _dependenciesMinTransformGenerated = require("./dependenciesAny/dependenciesMinTransform.generated.js"); +var _dependenciesModGenerated = require("./dependenciesAny/dependenciesMod.generated.js"); +var _dependenciesModeGenerated = require("./dependenciesAny/dependenciesMode.generated.js"); +var _dependenciesMolarMassGenerated = require("./dependenciesAny/dependenciesMolarMass.generated.js"); +var _dependenciesMolarMassC12Generated = require("./dependenciesAny/dependenciesMolarMassC12.generated.js"); +var _dependenciesMolarPlanckConstantGenerated = require("./dependenciesAny/dependenciesMolarPlanckConstant.generated.js"); +var _dependenciesMolarVolumeGenerated = require("./dependenciesAny/dependenciesMolarVolume.generated.js"); +var _dependenciesMultinomialGenerated = require("./dependenciesAny/dependenciesMultinomial.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesAny/dependenciesMultiply.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesAny/dependenciesMultiplyScalar.generated.js"); +var _dependenciesNaNGenerated = require("./dependenciesAny/dependenciesNaN.generated.js"); +var _dependenciesNeutronMassGenerated = require("./dependenciesAny/dependenciesNeutronMass.generated.js"); +var _dependenciesNodeGenerated = require("./dependenciesAny/dependenciesNode.generated.js"); +var _dependenciesNormGenerated = require("./dependenciesAny/dependenciesNorm.generated.js"); +var _dependenciesNotGenerated = require("./dependenciesAny/dependenciesNot.generated.js"); +var _dependenciesNthRootGenerated = require("./dependenciesAny/dependenciesNthRoot.generated.js"); +var _dependenciesNthRootsGenerated = require("./dependenciesAny/dependenciesNthRoots.generated.js"); +var _dependenciesNuclearMagnetonGenerated = require("./dependenciesAny/dependenciesNuclearMagneton.generated.js"); +var _dependenciesNullGenerated = require("./dependenciesAny/dependenciesNull.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesAny/dependenciesNumber.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesAny/dependenciesNumeric.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesAny/dependenciesObjectNode.generated.js"); +var _dependenciesOctGenerated = require("./dependenciesAny/dependenciesOct.generated.js"); +var _dependenciesOnesGenerated = require("./dependenciesAny/dependenciesOnes.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesAny/dependenciesOperatorNode.generated.js"); +var _dependenciesOrGenerated = require("./dependenciesAny/dependenciesOr.generated.js"); +var _dependenciesOrTransformGenerated = require("./dependenciesAny/dependenciesOrTransform.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesAny/dependenciesParenthesisNode.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesAny/dependenciesParse.generated.js"); +var _dependenciesParserGenerated = require("./dependenciesAny/dependenciesParser.generated.js"); +var _dependenciesParserClassGenerated = require("./dependenciesAny/dependenciesParserClass.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesAny/dependenciesPartitionSelect.generated.js"); +var _dependenciesPermutationsGenerated = require("./dependenciesAny/dependenciesPermutations.generated.js"); +var _dependenciesPhiGenerated = require("./dependenciesAny/dependenciesPhi.generated.js"); +var _dependenciesPiGenerated = require("./dependenciesAny/dependenciesPi.generated.js"); +var _dependenciesPickRandomGenerated = require("./dependenciesAny/dependenciesPickRandom.generated.js"); +var _dependenciesPinvGenerated = require("./dependenciesAny/dependenciesPinv.generated.js"); +var _dependenciesPlanckChargeGenerated = require("./dependenciesAny/dependenciesPlanckCharge.generated.js"); +var _dependenciesPlanckConstantGenerated = require("./dependenciesAny/dependenciesPlanckConstant.generated.js"); +var _dependenciesPlanckLengthGenerated = require("./dependenciesAny/dependenciesPlanckLength.generated.js"); +var _dependenciesPlanckMassGenerated = require("./dependenciesAny/dependenciesPlanckMass.generated.js"); +var _dependenciesPlanckTemperatureGenerated = require("./dependenciesAny/dependenciesPlanckTemperature.generated.js"); +var _dependenciesPlanckTimeGenerated = require("./dependenciesAny/dependenciesPlanckTime.generated.js"); +var _dependenciesPolynomialRootGenerated = require("./dependenciesAny/dependenciesPolynomialRoot.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesAny/dependenciesPow.generated.js"); +var _dependenciesPrintGenerated = require("./dependenciesAny/dependenciesPrint.generated.js"); +var _dependenciesPrintTransformGenerated = require("./dependenciesAny/dependenciesPrintTransform.generated.js"); +var _dependenciesProdGenerated = require("./dependenciesAny/dependenciesProd.generated.js"); +var _dependenciesProtonMassGenerated = require("./dependenciesAny/dependenciesProtonMass.generated.js"); +var _dependenciesQrGenerated = require("./dependenciesAny/dependenciesQr.generated.js"); +var _dependenciesQuantileSeqGenerated = require("./dependenciesAny/dependenciesQuantileSeq.generated.js"); +var _dependenciesQuantileSeqTransformGenerated = require("./dependenciesAny/dependenciesQuantileSeqTransform.generated.js"); +var _dependenciesQuantumOfCirculationGenerated = require("./dependenciesAny/dependenciesQuantumOfCirculation.generated.js"); +var _dependenciesRandomGenerated = require("./dependenciesAny/dependenciesRandom.generated.js"); +var _dependenciesRandomIntGenerated = require("./dependenciesAny/dependenciesRandomInt.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesAny/dependenciesRange.generated.js"); +var _dependenciesRangeClassGenerated = require("./dependenciesAny/dependenciesRangeClass.generated.js"); +var _dependenciesRangeNodeGenerated = require("./dependenciesAny/dependenciesRangeNode.generated.js"); +var _dependenciesRangeTransformGenerated = require("./dependenciesAny/dependenciesRangeTransform.generated.js"); +var _dependenciesRationalizeGenerated = require("./dependenciesAny/dependenciesRationalize.generated.js"); +var _dependenciesReGenerated = require("./dependenciesAny/dependenciesRe.generated.js"); +var _dependenciesReducedPlanckConstantGenerated = require("./dependenciesAny/dependenciesReducedPlanckConstant.generated.js"); +var _dependenciesRelationalNodeGenerated = require("./dependenciesAny/dependenciesRelationalNode.generated.js"); +var _dependenciesReplacerGenerated = require("./dependenciesAny/dependenciesReplacer.generated.js"); +var _dependenciesReshapeGenerated = require("./dependenciesAny/dependenciesReshape.generated.js"); +var _dependenciesResizeGenerated = require("./dependenciesAny/dependenciesResize.generated.js"); +var _dependenciesResolveGenerated = require("./dependenciesAny/dependenciesResolve.generated.js"); +var _dependenciesResultSetGenerated = require("./dependenciesAny/dependenciesResultSet.generated.js"); +var _dependenciesReviverGenerated = require("./dependenciesAny/dependenciesReviver.generated.js"); +var _dependenciesRightArithShiftGenerated = require("./dependenciesAny/dependenciesRightArithShift.generated.js"); +var _dependenciesRightLogShiftGenerated = require("./dependenciesAny/dependenciesRightLogShift.generated.js"); +var _dependenciesRotateGenerated = require("./dependenciesAny/dependenciesRotate.generated.js"); +var _dependenciesRotationMatrixGenerated = require("./dependenciesAny/dependenciesRotationMatrix.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesAny/dependenciesRound.generated.js"); +var _dependenciesRowGenerated = require("./dependenciesAny/dependenciesRow.generated.js"); +var _dependenciesRowTransformGenerated = require("./dependenciesAny/dependenciesRowTransform.generated.js"); +var _dependenciesRydbergGenerated = require("./dependenciesAny/dependenciesRydberg.generated.js"); +var _dependenciesSQRT1_2Generated = require("./dependenciesAny/dependenciesSQRT1_2.generated.js"); +var _dependenciesSQRT2Generated = require("./dependenciesAny/dependenciesSQRT2.generated.js"); +var _dependenciesSackurTetrodeGenerated = require("./dependenciesAny/dependenciesSackurTetrode.generated.js"); +var _dependenciesSchurGenerated = require("./dependenciesAny/dependenciesSchur.generated.js"); +var _dependenciesSecGenerated = require("./dependenciesAny/dependenciesSec.generated.js"); +var _dependenciesSechGenerated = require("./dependenciesAny/dependenciesSech.generated.js"); +var _dependenciesSecondRadiationGenerated = require("./dependenciesAny/dependenciesSecondRadiation.generated.js"); +var _dependenciesSetCartesianGenerated = require("./dependenciesAny/dependenciesSetCartesian.generated.js"); +var _dependenciesSetDifferenceGenerated = require("./dependenciesAny/dependenciesSetDifference.generated.js"); +var _dependenciesSetDistinctGenerated = require("./dependenciesAny/dependenciesSetDistinct.generated.js"); +var _dependenciesSetIntersectGenerated = require("./dependenciesAny/dependenciesSetIntersect.generated.js"); +var _dependenciesSetIsSubsetGenerated = require("./dependenciesAny/dependenciesSetIsSubset.generated.js"); +var _dependenciesSetMultiplicityGenerated = require("./dependenciesAny/dependenciesSetMultiplicity.generated.js"); +var _dependenciesSetPowersetGenerated = require("./dependenciesAny/dependenciesSetPowerset.generated.js"); +var _dependenciesSetSizeGenerated = require("./dependenciesAny/dependenciesSetSize.generated.js"); +var _dependenciesSetSymDifferenceGenerated = require("./dependenciesAny/dependenciesSetSymDifference.generated.js"); +var _dependenciesSetUnionGenerated = require("./dependenciesAny/dependenciesSetUnion.generated.js"); +var _dependenciesSignGenerated = require("./dependenciesAny/dependenciesSign.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesAny/dependenciesSimplify.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesAny/dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesAny/dependenciesSimplifyCore.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesAny/dependenciesSin.generated.js"); +var _dependenciesSinhGenerated = require("./dependenciesAny/dependenciesSinh.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesAny/dependenciesSize.generated.js"); +var _dependenciesSluGenerated = require("./dependenciesAny/dependenciesSlu.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesAny/dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesAny/dependenciesSmallerEq.generated.js"); +var _dependenciesSolveODEGenerated = require("./dependenciesAny/dependenciesSolveODE.generated.js"); +var _dependenciesSortGenerated = require("./dependenciesAny/dependenciesSort.generated.js"); +var _dependenciesSpaClassGenerated = require("./dependenciesAny/dependenciesSpaClass.generated.js"); +var _dependenciesSparseGenerated = require("./dependenciesAny/dependenciesSparse.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesAny/dependenciesSparseMatrixClass.generated.js"); +var _dependenciesSpeedOfLightGenerated = require("./dependenciesAny/dependenciesSpeedOfLight.generated.js"); +var _dependenciesSplitUnitGenerated = require("./dependenciesAny/dependenciesSplitUnit.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesAny/dependenciesSqrt.generated.js"); +var _dependenciesSqrtmGenerated = require("./dependenciesAny/dependenciesSqrtm.generated.js"); +var _dependenciesSquareGenerated = require("./dependenciesAny/dependenciesSquare.generated.js"); +var _dependenciesSqueezeGenerated = require("./dependenciesAny/dependenciesSqueeze.generated.js"); +var _dependenciesStdGenerated = require("./dependenciesAny/dependenciesStd.generated.js"); +var _dependenciesStdTransformGenerated = require("./dependenciesAny/dependenciesStdTransform.generated.js"); +var _dependenciesStefanBoltzmannGenerated = require("./dependenciesAny/dependenciesStefanBoltzmann.generated.js"); +var _dependenciesStirlingS2Generated = require("./dependenciesAny/dependenciesStirlingS2.generated.js"); +var _dependenciesStringGenerated = require("./dependenciesAny/dependenciesString.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesAny/dependenciesSubset.generated.js"); +var _dependenciesSubsetTransformGenerated = require("./dependenciesAny/dependenciesSubsetTransform.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesAny/dependenciesSubtract.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesAny/dependenciesSubtractScalar.generated.js"); +var _dependenciesSumGenerated = require("./dependenciesAny/dependenciesSum.generated.js"); +var _dependenciesSumTransformGenerated = require("./dependenciesAny/dependenciesSumTransform.generated.js"); +var _dependenciesSylvesterGenerated = require("./dependenciesAny/dependenciesSylvester.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesAny/dependenciesSymbolNode.generated.js"); +var _dependenciesSymbolicEqualGenerated = require("./dependenciesAny/dependenciesSymbolicEqual.generated.js"); +var _dependenciesTanGenerated = require("./dependenciesAny/dependenciesTan.generated.js"); +var _dependenciesTanhGenerated = require("./dependenciesAny/dependenciesTanh.generated.js"); +var _dependenciesTauGenerated = require("./dependenciesAny/dependenciesTau.generated.js"); +var _dependenciesThomsonCrossSectionGenerated = require("./dependenciesAny/dependenciesThomsonCrossSection.generated.js"); +var _dependenciesToGenerated = require("./dependenciesAny/dependenciesTo.generated.js"); +var _dependenciesTraceGenerated = require("./dependenciesAny/dependenciesTrace.generated.js"); +var _dependenciesTransposeGenerated = require("./dependenciesAny/dependenciesTranspose.generated.js"); +var _dependenciesTrueGenerated = require("./dependenciesAny/dependenciesTrue.generated.js"); +var _dependenciesTypeOfGenerated = require("./dependenciesAny/dependenciesTypeOf.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesAny/dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesAny/dependenciesUnaryMinus.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesAny/dependenciesUnaryPlus.generated.js"); +var _dependenciesUnequalGenerated = require("./dependenciesAny/dependenciesUnequal.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesAny/dependenciesUnitClass.generated.js"); +var _dependenciesUnitFunctionGenerated = require("./dependenciesAny/dependenciesUnitFunction.generated.js"); +var _dependenciesUppercaseEGenerated = require("./dependenciesAny/dependenciesUppercaseE.generated.js"); +var _dependenciesUppercasePiGenerated = require("./dependenciesAny/dependenciesUppercasePi.generated.js"); +var _dependenciesUsolveGenerated = require("./dependenciesAny/dependenciesUsolve.generated.js"); +var _dependenciesUsolveAllGenerated = require("./dependenciesAny/dependenciesUsolveAll.generated.js"); +var _dependenciesVacuumImpedanceGenerated = require("./dependenciesAny/dependenciesVacuumImpedance.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesAny/dependenciesVariance.generated.js"); +var _dependenciesVarianceTransformGenerated = require("./dependenciesAny/dependenciesVarianceTransform.generated.js"); +var _dependenciesVersionGenerated = require("./dependenciesAny/dependenciesVersion.generated.js"); +var _dependenciesWeakMixingAngleGenerated = require("./dependenciesAny/dependenciesWeakMixingAngle.generated.js"); +var _dependenciesWienDisplacementGenerated = require("./dependenciesAny/dependenciesWienDisplacement.generated.js"); +var _dependenciesXgcdGenerated = require("./dependenciesAny/dependenciesXgcd.generated.js"); +var _dependenciesXorGenerated = require("./dependenciesAny/dependenciesXor.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesAny/dependenciesZeros.generated.js"); +var _dependenciesZetaGenerated = require("./dependenciesAny/dependenciesZeta.generated.js"); +var _dependenciesZpk2tfGenerated = require("./dependenciesAny/dependenciesZpk2tf.generated.js"); +var _allFactoriesAny = require("./allFactoriesAny.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js new file mode 100644 index 0000000..a209244 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.absDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const absDependencies = exports.absDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAbs: _factoriesAny.createAbs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js new file mode 100644 index 0000000..1013f15 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AccessorNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const AccessorNodeDependencies = exports.AccessorNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + createAccessorNode: _factoriesAny.createAccessorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js new file mode 100644 index 0000000..3a33acb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acosDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acosDependencies = exports.acosDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcos: _factoriesAny.createAcos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js new file mode 100644 index 0000000..c11f52c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acoshDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acoshDependencies = exports.acoshDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcosh: _factoriesAny.createAcosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js new file mode 100644 index 0000000..ff6fe20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acotDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acotDependencies = exports.acotDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcot: _factoriesAny.createAcot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js new file mode 100644 index 0000000..52eb9c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acothDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acothDependencies = exports.acothDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcoth: _factoriesAny.createAcoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js new file mode 100644 index 0000000..ec86871 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acscDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acscDependencies = exports.acscDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcsc: _factoriesAny.createAcsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js new file mode 100644 index 0000000..117284d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acschDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acschDependencies = exports.acschDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcsch: _factoriesAny.createAcsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js new file mode 100644 index 0000000..fe3d875 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const addDependencies = exports.addDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAdd: _factoriesAny.createAdd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js new file mode 100644 index 0000000..0259adb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const addScalarDependencies = exports.addScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAddScalar: _factoriesAny.createAddScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js new file mode 100644 index 0000000..62b49af --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.andDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNotGenerated = require("./dependenciesNot.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const andDependencies = exports.andDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + notDependencies: _dependenciesNotGenerated.notDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createAnd: _factoriesAny.createAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js new file mode 100644 index 0000000..23cfcd9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.andTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNotGenerated = require("./dependenciesNot.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const andTransformDependencies = exports.andTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + notDependencies: _dependenciesNotGenerated.notDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createAndTransform: _factoriesAny.createAndTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js new file mode 100644 index 0000000..afe4d38 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.applyDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const applyDependencies = exports.applyDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createApply: _factoriesAny.createApply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApplyTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApplyTransform.generated.js new file mode 100644 index 0000000..b1bf1ca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApplyTransform.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.applyTransformDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const applyTransformDependencies = exports.applyTransformDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createApplyTransform: _factoriesAny.createApplyTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js new file mode 100644 index 0000000..9b63396 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.argDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const argDependencies = exports.argDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createArg: _factoriesAny.createArg +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js new file mode 100644 index 0000000..1dd6e9d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArrayNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ArrayNodeDependencies = exports.ArrayNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createArrayNode: _factoriesAny.createArrayNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js new file mode 100644 index 0000000..4ce5ddd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asecDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asecDependencies = exports.asecDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsec: _factoriesAny.createAsec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js new file mode 100644 index 0000000..c998c7d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asechDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asechDependencies = exports.asechDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsech: _factoriesAny.createAsech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js new file mode 100644 index 0000000..16407af --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asinDependencies = exports.asinDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsin: _factoriesAny.createAsin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js new file mode 100644 index 0000000..9952f06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asinhDependencies = exports.asinhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsinh: _factoriesAny.createAsinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js new file mode 100644 index 0000000..3356a2c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AssignmentNodeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const AssignmentNodeDependencies = exports.AssignmentNodeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + createAssignmentNode: _factoriesAny.createAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js new file mode 100644 index 0000000..8e74620 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atanDependencies = exports.atanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtan: _factoriesAny.createAtan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js new file mode 100644 index 0000000..d6f892b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atan2Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atan2Dependencies = exports.atan2Dependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtan2: _factoriesAny.createAtan2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js new file mode 100644 index 0000000..8474b1b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanhDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atanhDependencies = exports.atanhDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtanh: _factoriesAny.createAtanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js new file mode 100644 index 0000000..22c1c3c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atomicMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atomicMassDependencies = exports.atomicMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createAtomicMass: _factoriesAny.createAtomicMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js new file mode 100644 index 0000000..5bc3c9f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.avogadroDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const avogadroDependencies = exports.avogadroDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createAvogadro: _factoriesAny.createAvogadro +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js new file mode 100644 index 0000000..042691b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bellNumbersDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesStirlingS2Generated = require("./dependenciesStirlingS2.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bellNumbersDependencies = exports.bellNumbersDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + stirlingS2Dependencies: _dependenciesStirlingS2Generated.stirlingS2Dependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBellNumbers: _factoriesAny.createBellNumbers +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js new file mode 100644 index 0000000..3c96c2e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BigNumberDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const BigNumberDependencies = exports.BigNumberDependencies = { + createBigNumberClass: _factoriesAny.createBigNumberClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js new file mode 100644 index 0000000..5b2e8c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bigintDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bigintDependencies = exports.bigintDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBigint: _factoriesAny.createBigint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js new file mode 100644 index 0000000..872f75f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bignumberDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bignumberDependencies = exports.bignumberDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBignumber: _factoriesAny.createBignumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js new file mode 100644 index 0000000..da90dde --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.binDependencies = void 0; +var _dependenciesFormatGenerated = require("./dependenciesFormat.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const binDependencies = exports.binDependencies = { + formatDependencies: _dependenciesFormatGenerated.formatDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBin: _factoriesAny.createBin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js new file mode 100644 index 0000000..be66698 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitAndDependencies = exports.bitAndDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitAnd: _factoriesAny.createBitAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js new file mode 100644 index 0000000..dcf6dc0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNotGenerated = require("./dependenciesNot.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitAndTransformDependencies = exports.bitAndTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + notDependencies: _dependenciesNotGenerated.notDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createBitAndTransform: _factoriesAny.createBitAndTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js new file mode 100644 index 0000000..4ab8f47 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitNotDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitNotDependencies = exports.bitNotDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitNot: _factoriesAny.createBitNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js new file mode 100644 index 0000000..78cf43d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitOrDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitOrDependencies = exports.bitOrDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitOr: _factoriesAny.createBitOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js new file mode 100644 index 0000000..2671bc1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitOrTransformDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitOrTransformDependencies = exports.bitOrTransformDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitOrTransform: _factoriesAny.createBitOrTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js new file mode 100644 index 0000000..b499dbf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitXorDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitXorDependencies = exports.bitXorDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitXor: _factoriesAny.createBitXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js new file mode 100644 index 0000000..10c04cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BlockNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesResultSetGenerated = require("./dependenciesResultSet.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const BlockNodeDependencies = exports.BlockNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + ResultSetDependencies: _dependenciesResultSetGenerated.ResultSetDependencies, + createBlockNode: _factoriesAny.createBlockNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js new file mode 100644 index 0000000..7d72bc7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bohrMagnetonDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bohrMagnetonDependencies = exports.bohrMagnetonDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createBohrMagneton: _factoriesAny.createBohrMagneton +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js new file mode 100644 index 0000000..476da49 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bohrRadiusDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bohrRadiusDependencies = exports.bohrRadiusDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createBohrRadius: _factoriesAny.createBohrRadius +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js new file mode 100644 index 0000000..4f5135b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.boltzmannDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const boltzmannDependencies = exports.boltzmannDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createBoltzmann: _factoriesAny.createBoltzmann +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js new file mode 100644 index 0000000..d52eae8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.booleanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const booleanDependencies = exports.booleanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBoolean: _factoriesAny.createBoolean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js new file mode 100644 index 0000000..1e35a08 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.catalanDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const catalanDependencies = exports.catalanDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCatalan: _factoriesAny.createCatalan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js new file mode 100644 index 0000000..5608678 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cbrtDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cbrtDependencies = exports.cbrtDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createCbrt: _factoriesAny.createCbrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js new file mode 100644 index 0000000..261c51e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ceilDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ceilDependencies = exports.ceilDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createCeil: _factoriesAny.createCeil +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js new file mode 100644 index 0000000..61ba627 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.chainDependencies = void 0; +var _dependenciesChainClassGenerated = require("./dependenciesChainClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const chainDependencies = exports.chainDependencies = { + ChainDependencies: _dependenciesChainClassGenerated.ChainDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createChain: _factoriesAny.createChain +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js new file mode 100644 index 0000000..8c00a84 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ChainDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ChainDependencies = exports.ChainDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createChainClass: _factoriesAny.createChainClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js new file mode 100644 index 0000000..e08033a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.classicalElectronRadiusDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const classicalElectronRadiusDependencies = exports.classicalElectronRadiusDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createClassicalElectronRadius: _factoriesAny.createClassicalElectronRadius +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js new file mode 100644 index 0000000..a23e7c4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cloneDependencies = exports.cloneDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createClone: _factoriesAny.createClone +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js new file mode 100644 index 0000000..0db7c9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.columnDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesRange.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const columnDependencies = exports.columnDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createColumn: _factoriesAny.createColumn +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js new file mode 100644 index 0000000..84e9737 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.columnTransformDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesRange.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const columnTransformDependencies = exports.columnTransformDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createColumnTransform: _factoriesAny.createColumnTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js new file mode 100644 index 0000000..41d58d6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const combinationsDependencies = exports.combinationsDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCombinations: _factoriesAny.createCombinations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js new file mode 100644 index 0000000..8727fc1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsWithRepDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const combinationsWithRepDependencies = exports.combinationsWithRepDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCombinationsWithRep: _factoriesAny.createCombinationsWithRep +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js new file mode 100644 index 0000000..f5f7b26 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareDependencies = exports.compareDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompare: _factoriesAny.createCompare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js new file mode 100644 index 0000000..34dca1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareNaturalDependencies = void 0; +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareNaturalDependencies = exports.compareNaturalDependencies = { + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompareNatural: _factoriesAny.createCompareNatural +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js new file mode 100644 index 0000000..863a8a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareTextDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareTextDependencies = exports.compareTextDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompareText: _factoriesAny.createCompareText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js new file mode 100644 index 0000000..08e0e7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compileDependencies = void 0; +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compileDependencies = exports.compileDependencies = { + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompile: _factoriesAny.createCompile +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js new file mode 100644 index 0000000..f6fbf39 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.complexDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const complexDependencies = exports.complexDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createComplex: _factoriesAny.createComplex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js new file mode 100644 index 0000000..480c6e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ComplexDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ComplexDependencies = exports.ComplexDependencies = { + createComplexClass: _factoriesAny.createComplexClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js new file mode 100644 index 0000000..159937a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compositionDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compositionDependencies = exports.compositionDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createComposition: _factoriesAny.createComposition +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js new file mode 100644 index 0000000..5406431 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.concatDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const concatDependencies = exports.concatDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createConcat: _factoriesAny.createConcat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js new file mode 100644 index 0000000..b34b69f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.concatTransformDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const concatTransformDependencies = exports.concatTransformDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createConcatTransform: _factoriesAny.createConcatTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js new file mode 100644 index 0000000..e4fe8a4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConditionalNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ConditionalNodeDependencies = exports.ConditionalNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createConditionalNode: _factoriesAny.createConditionalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js new file mode 100644 index 0000000..b9c4ba4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.conductanceQuantumDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const conductanceQuantumDependencies = exports.conductanceQuantumDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createConductanceQuantum: _factoriesAny.createConductanceQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js new file mode 100644 index 0000000..17e72c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.conjDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const conjDependencies = exports.conjDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createConj: _factoriesAny.createConj +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js new file mode 100644 index 0000000..bfabdf9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConstantNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ConstantNodeDependencies = exports.ConstantNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createConstantNode: _factoriesAny.createConstantNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js new file mode 100644 index 0000000..44679f5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.corrDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMeanGenerated = require("./dependenciesMean.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesSumGenerated = require("./dependenciesSum.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const corrDependencies = exports.corrDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + meanDependencies: _dependenciesMeanGenerated.meanDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + sumDependencies: _dependenciesSumGenerated.sumDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCorr: _factoriesAny.createCorr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js new file mode 100644 index 0000000..baa3170 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cosDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cosDependencies = exports.cosDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCos: _factoriesAny.createCos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js new file mode 100644 index 0000000..14528a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.coshDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const coshDependencies = exports.coshDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCosh: _factoriesAny.createCosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js new file mode 100644 index 0000000..02c4e5f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cotDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cotDependencies = exports.cotDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCot: _factoriesAny.createCot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js new file mode 100644 index 0000000..8dc4cb6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cothDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cothDependencies = exports.cothDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCoth: _factoriesAny.createCoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js new file mode 100644 index 0000000..a9b2d72 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.coulombDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const coulombDependencies = exports.coulombDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createCoulomb: _factoriesAny.createCoulomb +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js new file mode 100644 index 0000000..a9b2b3d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.countDependencies = void 0; +var _dependenciesProdGenerated = require("./dependenciesProd.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const countDependencies = exports.countDependencies = { + prodDependencies: _dependenciesProdGenerated.prodDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCount: _factoriesAny.createCount +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js new file mode 100644 index 0000000..991076b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnitDependencies = void 0; +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const createUnitDependencies = exports.createUnitDependencies = { + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCreateUnit: _factoriesAny.createCreateUnit +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js new file mode 100644 index 0000000..8be6d39 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.crossDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const crossDependencies = exports.crossDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCross: _factoriesAny.createCross +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js new file mode 100644 index 0000000..342c99f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cscDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cscDependencies = exports.cscDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCsc: _factoriesAny.createCsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js new file mode 100644 index 0000000..5e461e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cschDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cschDependencies = exports.cschDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCsch: _factoriesAny.createCsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js new file mode 100644 index 0000000..6d17118 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ctransposeDependencies = void 0; +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesTransposeGenerated = require("./dependenciesTranspose.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ctransposeDependencies = exports.ctransposeDependencies = { + conjDependencies: _dependenciesConjGenerated.conjDependencies, + transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCtranspose: _factoriesAny.createCtranspose +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js new file mode 100644 index 0000000..b5de087 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cubeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cubeDependencies = exports.cubeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCube: _factoriesAny.createCube +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js new file mode 100644 index 0000000..bd1dfd0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cumsumDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesUnaryPlus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cumsumDependencies = exports.cumsumDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryPlusDependencies: _dependenciesUnaryPlusGenerated.unaryPlusDependencies, + createCumSum: _factoriesAny.createCumSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js new file mode 100644 index 0000000..4370a1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cumsumTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesUnaryPlus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cumsumTransformDependencies = exports.cumsumTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryPlusDependencies: _dependenciesUnaryPlusGenerated.unaryPlusDependencies, + createCumSumTransform: _factoriesAny.createCumSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js new file mode 100644 index 0000000..f0d2fb0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deepEqualDependencies = void 0; +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const deepEqualDependencies = exports.deepEqualDependencies = { + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDeepEqual: _factoriesAny.createDeepEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js new file mode 100644 index 0000000..921d31e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DenseMatrixDependencies = void 0; +var _dependenciesMatrixClassGenerated = require("./dependenciesMatrixClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const DenseMatrixDependencies = exports.DenseMatrixDependencies = { + MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, + createDenseMatrixClass: _factoriesAny.createDenseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js new file mode 100644 index 0000000..ecac7f2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.derivativeDependencies = void 0; +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesSimplify.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const derivativeDependencies = exports.derivativeDependencies = { + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDerivative: _factoriesAny.createDerivative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js new file mode 100644 index 0000000..1697b14 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.detDependencies = void 0; +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const detDependencies = exports.detDependencies = { + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createDet: _factoriesAny.createDet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js new file mode 100644 index 0000000..096e30d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deuteronMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const deuteronMassDependencies = exports.deuteronMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createDeuteronMass: _factoriesAny.createDeuteronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js new file mode 100644 index 0000000..a4e36ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diagDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const diagDependencies = exports.diagDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDiag: _factoriesAny.createDiag +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js new file mode 100644 index 0000000..94f634a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diffDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const diffDependencies = exports.diffDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDiff: _factoriesAny.createDiff +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js new file mode 100644 index 0000000..37a03b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diffTransformDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const diffTransformDependencies = exports.diffTransformDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDiffTransform: _factoriesAny.createDiffTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js new file mode 100644 index 0000000..3a82821 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.distanceDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDeepEqualGenerated = require("./dependenciesDeepEqual.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const distanceDependencies = exports.distanceDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + deepEqualDependencies: _dependenciesDeepEqualGenerated.deepEqualDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDistance: _factoriesAny.createDistance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js new file mode 100644 index 0000000..eb7279a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.divideDependencies = void 0; +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const divideDependencies = exports.divideDependencies = { + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDivide: _factoriesAny.createDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js new file mode 100644 index 0000000..cb63652 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.divideScalarDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const divideScalarDependencies = exports.divideScalarDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDivideScalar: _factoriesAny.createDivideScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js new file mode 100644 index 0000000..7de92d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const dotDependencies = exports.dotDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + conjDependencies: _dependenciesConjGenerated.conjDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDot: _factoriesAny.createDot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js new file mode 100644 index 0000000..55d7c5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotDivideDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const dotDivideDependencies = exports.dotDivideDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDotDivide: _factoriesAny.createDotDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js new file mode 100644 index 0000000..f69a302 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotMultiplyDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const dotMultiplyDependencies = exports.dotMultiplyDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDotMultiply: _factoriesAny.createDotMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js new file mode 100644 index 0000000..adf53b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotPowDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const dotPowDependencies = exports.dotPowDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDotPow: _factoriesAny.createDotPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js new file mode 100644 index 0000000..dccc3aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.eDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const eDependencies = exports.eDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createE: _factoriesAny.createE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js new file mode 100644 index 0000000..f5318a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.efimovFactorDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const efimovFactorDependencies = exports.efimovFactorDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createEfimovFactor: _factoriesAny.createEfimovFactor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js new file mode 100644 index 0000000..8332e40 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.eigsDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesAtanGenerated = require("./dependenciesAtan.generated.js"); +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesColumnGenerated = require("./dependenciesColumn.generated.js"); +var _dependenciesComplexGenerated = require("./dependenciesComplex.generated.js"); +var _dependenciesCosGenerated = require("./dependenciesCos.generated.js"); +var _dependenciesDiagGenerated = require("./dependenciesDiag.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesDotGenerated = require("./dependenciesDot.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesFlattenGenerated = require("./dependenciesFlatten.generated.js"); +var _dependenciesImGenerated = require("./dependenciesIm.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMatrixFromColumnsGenerated = require("./dependenciesMatrixFromColumns.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesQrGenerated = require("./dependenciesQr.generated.js"); +var _dependenciesReGenerated = require("./dependenciesRe.generated.js"); +var _dependenciesReshapeGenerated = require("./dependenciesReshape.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesSin.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUsolveGenerated = require("./dependenciesUsolve.generated.js"); +var _dependenciesUsolveAllGenerated = require("./dependenciesUsolveAll.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const eigsDependencies = exports.eigsDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + atanDependencies: _dependenciesAtanGenerated.atanDependencies, + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + columnDependencies: _dependenciesColumnGenerated.columnDependencies, + complexDependencies: _dependenciesComplexGenerated.complexDependencies, + cosDependencies: _dependenciesCosGenerated.cosDependencies, + diagDependencies: _dependenciesDiagGenerated.diagDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + dotDependencies: _dependenciesDotGenerated.dotDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, + imDependencies: _dependenciesImGenerated.imDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + matrixFromColumnsDependencies: _dependenciesMatrixFromColumnsGenerated.matrixFromColumnsDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + qrDependencies: _dependenciesQrGenerated.qrDependencies, + reDependencies: _dependenciesReGenerated.reDependencies, + reshapeDependencies: _dependenciesReshapeGenerated.reshapeDependencies, + sinDependencies: _dependenciesSinGenerated.sinDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + usolveDependencies: _dependenciesUsolveGenerated.usolveDependencies, + usolveAllDependencies: _dependenciesUsolveAllGenerated.usolveAllDependencies, + createEigs: _factoriesAny.createEigs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js new file mode 100644 index 0000000..5c6f2d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.electricConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const electricConstantDependencies = exports.electricConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createElectricConstant: _factoriesAny.createElectricConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js new file mode 100644 index 0000000..1850f7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.electronMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const electronMassDependencies = exports.electronMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createElectronMass: _factoriesAny.createElectronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js new file mode 100644 index 0000000..cff49e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.elementaryChargeDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const elementaryChargeDependencies = exports.elementaryChargeDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createElementaryCharge: _factoriesAny.createElementaryCharge +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js new file mode 100644 index 0000000..4ac085d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalDependencies = exports.equalDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqual: _factoriesAny.createEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js new file mode 100644 index 0000000..74c417d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalScalarDependencies = exports.equalScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqualScalar: _factoriesAny.createEqualScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js new file mode 100644 index 0000000..cb8c2d4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalTextDependencies = void 0; +var _dependenciesCompareTextGenerated = require("./dependenciesCompareText.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalTextDependencies = exports.equalTextDependencies = { + compareTextDependencies: _dependenciesCompareTextGenerated.compareTextDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqualText: _factoriesAny.createEqualText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js new file mode 100644 index 0000000..c829914 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.erfDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const erfDependencies = exports.erfDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createErf: _factoriesAny.createErf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js new file mode 100644 index 0000000..91fc6c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.evaluateDependencies = void 0; +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const evaluateDependencies = exports.evaluateDependencies = { + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEvaluate: _factoriesAny.createEvaluate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js new file mode 100644 index 0000000..40d3405 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const expDependencies = exports.expDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createExp: _factoriesAny.createExp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js new file mode 100644 index 0000000..f0c0bad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expmDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const expmDependencies = exports.expmDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createExpm: _factoriesAny.createExpm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js new file mode 100644 index 0000000..2341cce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expm1Dependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const expm1Dependencies = exports.expm1Dependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createExpm1: _factoriesAny.createExpm1 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js new file mode 100644 index 0000000..5b0cb68 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.factorialDependencies = void 0; +var _dependenciesGammaGenerated = require("./dependenciesGamma.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const factorialDependencies = exports.factorialDependencies = { + gammaDependencies: _dependenciesGammaGenerated.gammaDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFactorial: _factoriesAny.createFactorial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js new file mode 100644 index 0000000..cf7d620 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.falseDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const falseDependencies = exports.falseDependencies = { + createFalse: _factoriesAny.createFalse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js new file mode 100644 index 0000000..0b764b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.faradayDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const faradayDependencies = exports.faradayDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createFaraday: _factoriesAny.createFaraday +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js new file mode 100644 index 0000000..e83d858 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fermiCouplingDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fermiCouplingDependencies = exports.fermiCouplingDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createFermiCoupling: _factoriesAny.createFermiCoupling +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js new file mode 100644 index 0000000..afcb954 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fftDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCeilGenerated = require("./dependenciesCeil.generated.js"); +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesDotDivideGenerated = require("./dependenciesDotDivide.generated.js"); +var _dependenciesExpGenerated = require("./dependenciesExp.generated.js"); +var _dependenciesIGenerated = require("./dependenciesI.generated.js"); +var _dependenciesLog2Generated = require("./dependenciesLog2.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesTauGenerated = require("./dependenciesTau.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fftDependencies = exports.fftDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + ceilDependencies: _dependenciesCeilGenerated.ceilDependencies, + conjDependencies: _dependenciesConjGenerated.conjDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + dotDivideDependencies: _dependenciesDotDivideGenerated.dotDivideDependencies, + expDependencies: _dependenciesExpGenerated.expDependencies, + iDependencies: _dependenciesIGenerated.iDependencies, + log2Dependencies: _dependenciesLog2Generated.log2Dependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + tauDependencies: _dependenciesTauGenerated.tauDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFft: _factoriesAny.createFft +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js new file mode 100644 index 0000000..a652c0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FibonacciHeapDependencies = void 0; +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FibonacciHeapDependencies = exports.FibonacciHeapDependencies = { + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + createFibonacciHeapClass: _factoriesAny.createFibonacciHeapClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js new file mode 100644 index 0000000..d2a95b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.filterDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const filterDependencies = exports.filterDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFilter: _factoriesAny.createFilter +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js new file mode 100644 index 0000000..e20f07b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.filterTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const filterTransformDependencies = exports.filterTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFilterTransform: _factoriesAny.createFilterTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js new file mode 100644 index 0000000..d23fcd1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fineStructureDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fineStructureDependencies = exports.fineStructureDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createFineStructure: _factoriesAny.createFineStructure +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js new file mode 100644 index 0000000..71f6d89 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.firstRadiationDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const firstRadiationDependencies = exports.firstRadiationDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createFirstRadiation: _factoriesAny.createFirstRadiation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js new file mode 100644 index 0000000..a3991af --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fixDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesCeilGenerated = require("./dependenciesCeil.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesFloorGenerated = require("./dependenciesFloor.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fixDependencies = exports.fixDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + ceilDependencies: _dependenciesCeilGenerated.ceilDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + floorDependencies: _dependenciesFloorGenerated.floorDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createFix: _factoriesAny.createFix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js new file mode 100644 index 0000000..7374fba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.flattenDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const flattenDependencies = exports.flattenDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFlatten: _factoriesAny.createFlatten +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js new file mode 100644 index 0000000..0dab5f4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.floorDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const floorDependencies = exports.floorDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createFloor: _factoriesAny.createFloor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js new file mode 100644 index 0000000..332f049 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forEachDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const forEachDependencies = exports.forEachDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createForEach: _factoriesAny.createForEach +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js new file mode 100644 index 0000000..97f8396 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forEachTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const forEachTransformDependencies = exports.forEachTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createForEachTransform: _factoriesAny.createForEachTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js new file mode 100644 index 0000000..17e9173 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const formatDependencies = exports.formatDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFormat: _factoriesAny.createFormat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js new file mode 100644 index 0000000..01a451b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fractionDependencies = void 0; +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fractionDependencies = exports.fractionDependencies = { + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFraction: _factoriesAny.createFraction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js new file mode 100644 index 0000000..3537798 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FractionDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FractionDependencies = exports.FractionDependencies = { + createFractionClass: _factoriesAny.createFractionClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js new file mode 100644 index 0000000..e4b9c18 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.freqzDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const freqzDependencies = exports.freqzDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFreqz: _factoriesAny.createFreqz +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js new file mode 100644 index 0000000..533b6a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FunctionAssignmentNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FunctionAssignmentNodeDependencies = exports.FunctionAssignmentNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFunctionAssignmentNode: _factoriesAny.createFunctionAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js new file mode 100644 index 0000000..d49ec5c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FunctionNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FunctionNodeDependencies = exports.FunctionNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + createFunctionNode: _factoriesAny.createFunctionNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js new file mode 100644 index 0000000..af6f35a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gammaDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gammaDependencies = exports.gammaDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createGamma: _factoriesAny.createGamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js new file mode 100644 index 0000000..21dfe43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gasConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gasConstantDependencies = exports.gasConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createGasConstant: _factoriesAny.createGasConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js new file mode 100644 index 0000000..a43a568 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gcdDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gcdDependencies = exports.gcdDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createGcd: _factoriesAny.createGcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js new file mode 100644 index 0000000..82e4827 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getMatrixDataTypeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const getMatrixDataTypeDependencies = exports.getMatrixDataTypeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createGetMatrixDataType: _factoriesAny.createGetMatrixDataType +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js new file mode 100644 index 0000000..51b8b36 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gravitationConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gravitationConstantDependencies = exports.gravitationConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createGravitationConstant: _factoriesAny.createGravitationConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js new file mode 100644 index 0000000..3b16894 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gravityDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gravityDependencies = exports.gravityDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createGravity: _factoriesAny.createGravity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js new file mode 100644 index 0000000..8a62590 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hartreeEnergyDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hartreeEnergyDependencies = exports.hartreeEnergyDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createHartreeEnergy: _factoriesAny.createHartreeEnergy +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js new file mode 100644 index 0000000..6aeb4c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasNumericValueDependencies = void 0; +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hasNumericValueDependencies = exports.hasNumericValueDependencies = { + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHasNumericValue: _factoriesAny.createHasNumericValue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js new file mode 100644 index 0000000..75337a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.helpDependencies = void 0; +var _dependenciesHelpClassGenerated = require("./dependenciesHelpClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const helpDependencies = exports.helpDependencies = { + HelpDependencies: _dependenciesHelpClassGenerated.HelpDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHelp: _factoriesAny.createHelp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js new file mode 100644 index 0000000..3d2dcd0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.HelpDependencies = void 0; +var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const HelpDependencies = exports.HelpDependencies = { + evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, + createHelpClass: _factoriesAny.createHelpClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js new file mode 100644 index 0000000..a3cfc5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hexDependencies = void 0; +var _dependenciesFormatGenerated = require("./dependenciesFormat.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hexDependencies = exports.hexDependencies = { + formatDependencies: _dependenciesFormatGenerated.formatDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHex: _factoriesAny.createHex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js new file mode 100644 index 0000000..d77515b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hypotDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hypotDependencies = exports.hypotDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHypot: _factoriesAny.createHypot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js new file mode 100644 index 0000000..a172b7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.iDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const iDependencies = exports.iDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + createI: _factoriesAny.createI +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js new file mode 100644 index 0000000..dc2635c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.identityDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const identityDependencies = exports.identityDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIdentity: _factoriesAny.createIdentity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js new file mode 100644 index 0000000..b39012b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ifftDependencies = void 0; +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesDotDivideGenerated = require("./dependenciesDotDivide.generated.js"); +var _dependenciesFftGenerated = require("./dependenciesFft.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ifftDependencies = exports.ifftDependencies = { + conjDependencies: _dependenciesConjGenerated.conjDependencies, + dotDivideDependencies: _dependenciesDotDivideGenerated.dotDivideDependencies, + fftDependencies: _dependenciesFftGenerated.fftDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIfft: _factoriesAny.createIfft +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js new file mode 100644 index 0000000..5f8f27a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.imDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const imDependencies = exports.imDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIm: _factoriesAny.createIm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js new file mode 100644 index 0000000..6096907 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ImmutableDenseMatrixDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ImmutableDenseMatrixDependencies = exports.ImmutableDenseMatrixDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + createImmutableDenseMatrixClass: _factoriesAny.createImmutableDenseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js new file mode 100644 index 0000000..74abca3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.indexDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const indexDependencies = exports.indexDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIndex: _factoriesAny.createIndex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js new file mode 100644 index 0000000..6731548 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndexDependencies = void 0; +var _dependenciesImmutableDenseMatrixClassGenerated = require("./dependenciesImmutableDenseMatrixClass.generated.js"); +var _dependenciesGetMatrixDataTypeGenerated = require("./dependenciesGetMatrixDataType.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const IndexDependencies = exports.IndexDependencies = { + ImmutableDenseMatrixDependencies: _dependenciesImmutableDenseMatrixClassGenerated.ImmutableDenseMatrixDependencies, + getMatrixDataTypeDependencies: _dependenciesGetMatrixDataTypeGenerated.getMatrixDataTypeDependencies, + createIndexClass: _factoriesAny.createIndexClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js new file mode 100644 index 0000000..967371d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndexNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const IndexNodeDependencies = exports.IndexNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + createIndexNode: _factoriesAny.createIndexNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js new file mode 100644 index 0000000..94fc2f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.indexTransformDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesGetMatrixDataTypeGenerated = require("./dependenciesGetMatrixDataType.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const indexTransformDependencies = exports.indexTransformDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + getMatrixDataTypeDependencies: _dependenciesGetMatrixDataTypeGenerated.getMatrixDataTypeDependencies, + createIndexTransform: _factoriesAny.createIndexTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js new file mode 100644 index 0000000..2534c8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.InfinityDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const InfinityDependencies = exports.InfinityDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createInfinity: _factoriesAny.createInfinity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js new file mode 100644 index 0000000..5ecc970 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.intersectDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesFlattenGenerated = require("./dependenciesFlatten.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const intersectDependencies = exports.intersectDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIntersect: _factoriesAny.createIntersect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js new file mode 100644 index 0000000..7641b37 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.invDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDetGenerated = require("./dependenciesDet.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const invDependencies = exports.invDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + detDependencies: _dependenciesDetGenerated.detDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createInv: _factoriesAny.createInv +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js new file mode 100644 index 0000000..37f933d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.inverseConductanceQuantumDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const inverseConductanceQuantumDependencies = exports.inverseConductanceQuantumDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createInverseConductanceQuantum: _factoriesAny.createInverseConductanceQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js new file mode 100644 index 0000000..fa6d7f2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.invmodDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesModGenerated = require("./dependenciesMod.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesXgcdGenerated = require("./dependenciesXgcd.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const invmodDependencies = exports.invmodDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + modDependencies: _dependenciesModGenerated.modDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + xgcdDependencies: _dependenciesXgcdGenerated.xgcdDependencies, + createInvmod: _factoriesAny.createInvmod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js new file mode 100644 index 0000000..35afad2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIntegerDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isIntegerDependencies = exports.isIntegerDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsInteger: _factoriesAny.createIsInteger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js new file mode 100644 index 0000000..190d036 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNaNDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNaNDependencies = exports.isNaNDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNaN: _factoriesAny.createIsNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js new file mode 100644 index 0000000..1039abf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNegativeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNegativeDependencies = exports.isNegativeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNegative: _factoriesAny.createIsNegative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js new file mode 100644 index 0000000..5ba31d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNumericDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNumericDependencies = exports.isNumericDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNumeric: _factoriesAny.createIsNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js new file mode 100644 index 0000000..0b19335 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPositiveDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isPositiveDependencies = exports.isPositiveDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsPositive: _factoriesAny.createIsPositive +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js new file mode 100644 index 0000000..82ebfd0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPrimeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isPrimeDependencies = exports.isPrimeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsPrime: _factoriesAny.createIsPrime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js new file mode 100644 index 0000000..1d86159 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isZeroDependencies = void 0; +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isZeroDependencies = exports.isZeroDependencies = { + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsZero: _factoriesAny.createIsZero +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js new file mode 100644 index 0000000..30cd592 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.kldivergenceDependencies = void 0; +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesDotDivideGenerated = require("./dependenciesDotDivide.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesLogGenerated = require("./dependenciesLog.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSumGenerated = require("./dependenciesSum.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const kldivergenceDependencies = exports.kldivergenceDependencies = { + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + dotDivideDependencies: _dependenciesDotDivideGenerated.dotDivideDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + logDependencies: _dependenciesLogGenerated.logDependencies, + mapDependencies: _dependenciesMapGenerated.mapDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + sumDependencies: _dependenciesSumGenerated.sumDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createKldivergence: _factoriesAny.createKldivergence +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js new file mode 100644 index 0000000..9c6aefc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.klitzingDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const klitzingDependencies = exports.klitzingDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createKlitzing: _factoriesAny.createKlitzing +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js new file mode 100644 index 0000000..7e6eff6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.kronDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const kronDependencies = exports.kronDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createKron: _factoriesAny.createKron +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js new file mode 100644 index 0000000..42d6d6f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN10Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LN10Dependencies = exports.LN10Dependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createLN10: _factoriesAny.createLN10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js new file mode 100644 index 0000000..6ea7e58 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN2Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LN2Dependencies = exports.LN2Dependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createLN2: _factoriesAny.createLN2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js new file mode 100644 index 0000000..d86d760 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG10EDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LOG10EDependencies = exports.LOG10EDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createLOG10E: _factoriesAny.createLOG10E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js new file mode 100644 index 0000000..c85914b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG2EDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LOG2EDependencies = exports.LOG2EDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createLOG2E: _factoriesAny.createLOG2E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js new file mode 100644 index 0000000..f620af8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const largerDependencies = exports.largerDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLarger: _factoriesAny.createLarger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js new file mode 100644 index 0000000..3f29148 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerEqDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const largerEqDependencies = exports.largerEqDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLargerEq: _factoriesAny.createLargerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js new file mode 100644 index 0000000..f279e17 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lcmDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lcmDependencies = exports.lcmDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLcm: _factoriesAny.createLcm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js new file mode 100644 index 0000000..409882d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.leafCountDependencies = void 0; +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const leafCountDependencies = exports.leafCountDependencies = { + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLeafCount: _factoriesAny.createLeafCount +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js new file mode 100644 index 0000000..bd6c224 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.leftShiftDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const leftShiftDependencies = exports.leftShiftDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createLeftShift: _factoriesAny.createLeftShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js new file mode 100644 index 0000000..7c12fe1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lgammaDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lgammaDependencies = exports.lgammaDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLgamma: _factoriesAny.createLgamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js new file mode 100644 index 0000000..b1be622 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.logDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const logDependencies = exports.logDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog: _factoriesAny.createLog +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js new file mode 100644 index 0000000..865cd7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log10Dependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log10Dependencies = exports.log10Dependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog10: _factoriesAny.createLog10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js new file mode 100644 index 0000000..7b6af55 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log1pDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesLogGenerated = require("./dependenciesLog.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log1pDependencies = exports.log1pDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + logDependencies: _dependenciesLogGenerated.logDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog1p: _factoriesAny.createLog1p +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js new file mode 100644 index 0000000..be63826 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log2Dependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log2Dependencies = exports.log2Dependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog2: _factoriesAny.createLog2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js new file mode 100644 index 0000000..1188507 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.loschmidtDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const loschmidtDependencies = exports.loschmidtDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createLoschmidt: _factoriesAny.createLoschmidt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js new file mode 100644 index 0000000..a7baef8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lsolveDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lsolveDependencies = exports.lsolveDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLsolve: _factoriesAny.createLsolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js new file mode 100644 index 0000000..1c2c7ce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lsolveAllDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lsolveAllDependencies = exports.lsolveAllDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLsolveAll: _factoriesAny.createLsolveAll +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js new file mode 100644 index 0000000..84ff4ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lupDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSpaClassGenerated = require("./dependenciesSpaClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lupDependencies = exports.lupDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + SpaDependencies: _dependenciesSpaClassGenerated.SpaDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createLup: _factoriesAny.createLup +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js new file mode 100644 index 0000000..fb3df3f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lusolveDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesLsolveGenerated = require("./dependenciesLsolve.generated.js"); +var _dependenciesLupGenerated = require("./dependenciesLup.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesSluGenerated = require("./dependenciesSlu.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUsolveGenerated = require("./dependenciesUsolve.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lusolveDependencies = exports.lusolveDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + lsolveDependencies: _dependenciesLsolveGenerated.lsolveDependencies, + lupDependencies: _dependenciesLupGenerated.lupDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + sluDependencies: _dependenciesSluGenerated.sluDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + usolveDependencies: _dependenciesUsolveGenerated.usolveDependencies, + createLusolve: _factoriesAny.createLusolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js new file mode 100644 index 0000000..9a092ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lyapDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSylvesterGenerated = require("./dependenciesSylvester.generated.js"); +var _dependenciesTransposeGenerated = require("./dependenciesTranspose.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lyapDependencies = exports.lyapDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + sylvesterDependencies: _dependenciesSylvesterGenerated.sylvesterDependencies, + transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLyap: _factoriesAny.createLyap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js new file mode 100644 index 0000000..d8f13d2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.madDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesMedianGenerated = require("./dependenciesMedian.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const madDependencies = exports.madDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + mapDependencies: _dependenciesMapGenerated.mapDependencies, + medianDependencies: _dependenciesMedianGenerated.medianDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMad: _factoriesAny.createMad +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js new file mode 100644 index 0000000..7812682 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.magneticConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const magneticConstantDependencies = exports.magneticConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMagneticConstant: _factoriesAny.createMagneticConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js new file mode 100644 index 0000000..8a2d2a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.magneticFluxQuantumDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const magneticFluxQuantumDependencies = exports.magneticFluxQuantumDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMagneticFluxQuantum: _factoriesAny.createMagneticFluxQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js new file mode 100644 index 0000000..23e401d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mapDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const mapDependencies = exports.mapDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMap: _factoriesAny.createMap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js new file mode 100644 index 0000000..42567b3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mapTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const mapTransformDependencies = exports.mapTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMapTransform: _factoriesAny.createMapTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js new file mode 100644 index 0000000..f085dd6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesMatrixClassGenerated = require("./dependenciesMatrixClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const matrixDependencies = exports.matrixDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMatrix: _factoriesAny.createMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js new file mode 100644 index 0000000..f28ed0c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MatrixDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const MatrixDependencies = exports.MatrixDependencies = { + createMatrixClass: _factoriesAny.createMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js new file mode 100644 index 0000000..2722b83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromColumnsDependencies = void 0; +var _dependenciesFlattenGenerated = require("./dependenciesFlatten.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const matrixFromColumnsDependencies = exports.matrixFromColumnsDependencies = { + flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMatrixFromColumns: _factoriesAny.createMatrixFromColumns +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js new file mode 100644 index 0000000..affb043 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromFunctionDependencies = void 0; +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const matrixFromFunctionDependencies = exports.matrixFromFunctionDependencies = { + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMatrixFromFunction: _factoriesAny.createMatrixFromFunction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js new file mode 100644 index 0000000..bc05055 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromRowsDependencies = void 0; +var _dependenciesFlattenGenerated = require("./dependenciesFlatten.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const matrixFromRowsDependencies = exports.matrixFromRowsDependencies = { + flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMatrixFromRows: _factoriesAny.createMatrixFromRows +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js new file mode 100644 index 0000000..9740c37 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maxDependencies = void 0; +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const maxDependencies = exports.maxDependencies = { + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMax: _factoriesAny.createMax +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js new file mode 100644 index 0000000..b7b2275 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maxTransformDependencies = void 0; +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const maxTransformDependencies = exports.maxTransformDependencies = { + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMaxTransform: _factoriesAny.createMaxTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js new file mode 100644 index 0000000..73fb788 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.meanDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const meanDependencies = exports.meanDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMean: _factoriesAny.createMean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js new file mode 100644 index 0000000..43b58de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.meanTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const meanTransformDependencies = exports.meanTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMeanTransform: _factoriesAny.createMeanTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js new file mode 100644 index 0000000..7ccea59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.medianDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesPartitionSelect.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const medianDependencies = exports.medianDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMedian: _factoriesAny.createMedian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js new file mode 100644 index 0000000..4ae9bc5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.minDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const minDependencies = exports.minDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMin: _factoriesAny.createMin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js new file mode 100644 index 0000000..9cc2656 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.minTransformDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const minTransformDependencies = exports.minTransformDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMinTransform: _factoriesAny.createMinTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js new file mode 100644 index 0000000..0c66c0c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const modDependencies = exports.modDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createMod: _factoriesAny.createMod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js new file mode 100644 index 0000000..120cf46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modeDependencies = void 0; +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const modeDependencies = exports.modeDependencies = { + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMode: _factoriesAny.createMode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js new file mode 100644 index 0000000..359508e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.molarMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const molarMassDependencies = exports.molarMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMolarMass: _factoriesAny.createMolarMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js new file mode 100644 index 0000000..685080c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.molarMassC12Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const molarMassC12Dependencies = exports.molarMassC12Dependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMolarMassC12: _factoriesAny.createMolarMassC12 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js new file mode 100644 index 0000000..465673e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.molarPlanckConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const molarPlanckConstantDependencies = exports.molarPlanckConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMolarPlanckConstant: _factoriesAny.createMolarPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js new file mode 100644 index 0000000..025d170 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.molarVolumeDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const molarVolumeDependencies = exports.molarVolumeDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createMolarVolume: _factoriesAny.createMolarVolume +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js new file mode 100644 index 0000000..7aac091 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multinomialDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multinomialDependencies = exports.multinomialDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultinomial: _factoriesAny.createMultinomial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js new file mode 100644 index 0000000..5058b57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multiplyDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDotGenerated = require("./dependenciesDot.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multiplyDependencies = exports.multiplyDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + dotDependencies: _dependenciesDotGenerated.dotDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultiply: _factoriesAny.createMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js new file mode 100644 index 0000000..c93ed59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multiplyScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multiplyScalarDependencies = exports.multiplyScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultiplyScalar: _factoriesAny.createMultiplyScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js new file mode 100644 index 0000000..0a40ca2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NaNDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const NaNDependencies = exports.NaNDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createNaN: _factoriesAny.createNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js new file mode 100644 index 0000000..793c05d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.neutronMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const neutronMassDependencies = exports.neutronMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createNeutronMass: _factoriesAny.createNeutronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js new file mode 100644 index 0000000..4028831 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NodeDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const NodeDependencies = exports.NodeDependencies = { + createNode: _factoriesAny.createNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js new file mode 100644 index 0000000..a9144a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesCtransposeGenerated = require("./dependenciesCtranspose.generated.js"); +var _dependenciesEigsGenerated = require("./dependenciesEigs.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const normDependencies = exports.normDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + conjDependencies: _dependenciesConjGenerated.conjDependencies, + ctransposeDependencies: _dependenciesCtransposeGenerated.ctransposeDependencies, + eigsDependencies: _dependenciesEigsGenerated.eigsDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNorm: _factoriesAny.createNorm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js new file mode 100644 index 0000000..0b6d52a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.notDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const notDependencies = exports.notDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNot: _factoriesAny.createNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js new file mode 100644 index 0000000..fb7b091 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nthRootDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nthRootDependencies = exports.nthRootDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNthRoot: _factoriesAny.createNthRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js new file mode 100644 index 0000000..a2fd939 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nthRootsDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nthRootsDependencies = exports.nthRootsDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNthRoots: _factoriesAny.createNthRoots +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js new file mode 100644 index 0000000..016d4f9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nuclearMagnetonDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nuclearMagnetonDependencies = exports.nuclearMagnetonDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createNuclearMagneton: _factoriesAny.createNuclearMagneton +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js new file mode 100644 index 0000000..06e6030 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nullDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nullDependencies = exports.nullDependencies = { + createNull: _factoriesAny.createNull +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js new file mode 100644 index 0000000..f2daee6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numberDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const numberDependencies = exports.numberDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNumber: _factoriesAny.createNumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js new file mode 100644 index 0000000..736f9de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numericDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesFraction.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const numericDependencies = exports.numericDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + createNumeric: _factoriesAny.createNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js new file mode 100644 index 0000000..9d6abee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ObjectNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ObjectNodeDependencies = exports.ObjectNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createObjectNode: _factoriesAny.createObjectNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js new file mode 100644 index 0000000..22a2fc9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.octDependencies = void 0; +var _dependenciesFormatGenerated = require("./dependenciesFormat.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const octDependencies = exports.octDependencies = { + formatDependencies: _dependenciesFormatGenerated.formatDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createOct: _factoriesAny.createOct +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js new file mode 100644 index 0000000..6bf6fa4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.onesDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const onesDependencies = exports.onesDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createOnes: _factoriesAny.createOnes +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js new file mode 100644 index 0000000..2787034 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OperatorNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const OperatorNodeDependencies = exports.OperatorNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createOperatorNode: _factoriesAny.createOperatorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js new file mode 100644 index 0000000..de904e7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.orDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const orDependencies = exports.orDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createOr: _factoriesAny.createOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js new file mode 100644 index 0000000..83f0370 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.orTransformDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const orTransformDependencies = exports.orTransformDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createOrTransform: _factoriesAny.createOrTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js new file mode 100644 index 0000000..08de22b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ParenthesisNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ParenthesisNodeDependencies = exports.ParenthesisNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createParenthesisNode: _factoriesAny.createParenthesisNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js new file mode 100644 index 0000000..de8dace --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesAssignmentNodeGenerated = require("./dependenciesAssignmentNode.generated.js"); +var _dependenciesBlockNodeGenerated = require("./dependenciesBlockNode.generated.js"); +var _dependenciesConditionalNodeGenerated = require("./dependenciesConditionalNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionAssignmentNodeGenerated = require("./dependenciesFunctionAssignmentNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesRangeNodeGenerated = require("./dependenciesRangeNode.generated.js"); +var _dependenciesRelationalNodeGenerated = require("./dependenciesRelationalNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const parseDependencies = exports.parseDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + AssignmentNodeDependencies: _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies, + BlockNodeDependencies: _dependenciesBlockNodeGenerated.BlockNodeDependencies, + ConditionalNodeDependencies: _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionAssignmentNodeDependencies: _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + RangeNodeDependencies: _dependenciesRangeNodeGenerated.RangeNodeDependencies, + RelationalNodeDependencies: _dependenciesRelationalNodeGenerated.RelationalNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createParse: _factoriesAny.createParse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js new file mode 100644 index 0000000..9fa99ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parserDependencies = void 0; +var _dependenciesParserClassGenerated = require("./dependenciesParserClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const parserDependencies = exports.parserDependencies = { + ParserDependencies: _dependenciesParserClassGenerated.ParserDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createParser: _factoriesAny.createParser +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js new file mode 100644 index 0000000..2187acc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ParserDependencies = void 0; +var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ParserDependencies = exports.ParserDependencies = { + evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, + createParserClass: _factoriesAny.createParserClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js new file mode 100644 index 0000000..3ec52a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.partitionSelectDependencies = void 0; +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const partitionSelectDependencies = exports.partitionSelectDependencies = { + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPartitionSelect: _factoriesAny.createPartitionSelect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js new file mode 100644 index 0000000..dd90fb5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.permutationsDependencies = void 0; +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const permutationsDependencies = exports.permutationsDependencies = { + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPermutations: _factoriesAny.createPermutations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js new file mode 100644 index 0000000..d11ac28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.phiDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const phiDependencies = exports.phiDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createPhi: _factoriesAny.createPhi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js new file mode 100644 index 0000000..98f8d9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.piDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const piDependencies = exports.piDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createPi: _factoriesAny.createPi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js new file mode 100644 index 0000000..492616c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pickRandomDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const pickRandomDependencies = exports.pickRandomDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPickRandom: _factoriesAny.createPickRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js new file mode 100644 index 0000000..73f1f8b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pinvDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCtransposeGenerated = require("./dependenciesCtranspose.generated.js"); +var _dependenciesDeepEqualGenerated = require("./dependenciesDeepEqual.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesDotGenerated = require("./dependenciesDot.generated.js"); +var _dependenciesDotDivideGenerated = require("./dependenciesDotDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const pinvDependencies = exports.pinvDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + ctransposeDependencies: _dependenciesCtransposeGenerated.ctransposeDependencies, + deepEqualDependencies: _dependenciesDeepEqualGenerated.deepEqualDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + dotDependencies: _dependenciesDotGenerated.dotDependencies, + dotDivideDependencies: _dependenciesDotDivideGenerated.dotDivideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPinv: _factoriesAny.createPinv +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js new file mode 100644 index 0000000..a201819 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckChargeDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckChargeDependencies = exports.planckChargeDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckCharge: _factoriesAny.createPlanckCharge +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js new file mode 100644 index 0000000..067e11d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckConstantDependencies = exports.planckConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckConstant: _factoriesAny.createPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js new file mode 100644 index 0000000..8e3fd7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckLengthDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckLengthDependencies = exports.planckLengthDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckLength: _factoriesAny.createPlanckLength +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js new file mode 100644 index 0000000..131852c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckMassDependencies = exports.planckMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckMass: _factoriesAny.createPlanckMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js new file mode 100644 index 0000000..742e2ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckTemperatureDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckTemperatureDependencies = exports.planckTemperatureDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckTemperature: _factoriesAny.createPlanckTemperature +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js new file mode 100644 index 0000000..4a24085 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.planckTimeDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const planckTimeDependencies = exports.planckTimeDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createPlanckTime: _factoriesAny.createPlanckTime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js new file mode 100644 index 0000000..08b10fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.polynomialRootDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCbrtGenerated = require("./dependenciesCbrt.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesImGenerated = require("./dependenciesIm.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesReGenerated = require("./dependenciesRe.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypeOfGenerated = require("./dependenciesTypeOf.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const polynomialRootDependencies = exports.polynomialRootDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + cbrtDependencies: _dependenciesCbrtGenerated.cbrtDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + imDependencies: _dependenciesImGenerated.imDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + reDependencies: _dependenciesReGenerated.reDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typeOfDependencies: _dependenciesTypeOfGenerated.typeOfDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createPolynomialRoot: _factoriesAny.createPolynomialRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js new file mode 100644 index 0000000..9f3cf06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.powDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesFraction.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const powDependencies = exports.powDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPow: _factoriesAny.createPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js new file mode 100644 index 0000000..61ec88a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const printDependencies = exports.printDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPrint: _factoriesAny.createPrint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js new file mode 100644 index 0000000..de5b63c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const printTransformDependencies = exports.printTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createPrintTransform: _factoriesAny.createPrintTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js new file mode 100644 index 0000000..81232f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.prodDependencies = void 0; +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const prodDependencies = exports.prodDependencies = { + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createProd: _factoriesAny.createProd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js new file mode 100644 index 0000000..1676078 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.protonMassDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const protonMassDependencies = exports.protonMassDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createProtonMass: _factoriesAny.createProtonMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js new file mode 100644 index 0000000..c84ce8e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.qrDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesComplexGenerated = require("./dependenciesComplex.generated.js"); +var _dependenciesConjGenerated = require("./dependenciesConj.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSignGenerated = require("./dependenciesSign.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const qrDependencies = exports.qrDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + complexDependencies: _dependenciesComplexGenerated.complexDependencies, + conjDependencies: _dependenciesConjGenerated.conjDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + signDependencies: _dependenciesSignGenerated.signDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createQr: _factoriesAny.createQr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js new file mode 100644 index 0000000..9752ff1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.quantileSeqDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesPartitionSelect.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const quantileSeqDependencies = exports.quantileSeqDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createQuantileSeq: _factoriesAny.createQuantileSeq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js new file mode 100644 index 0000000..37e2332 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.quantileSeqTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesPartitionSelect.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const quantileSeqTransformDependencies = exports.quantileSeqTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createQuantileSeqTransform: _factoriesAny.createQuantileSeqTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js new file mode 100644 index 0000000..10a77cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.quantumOfCirculationDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const quantumOfCirculationDependencies = exports.quantumOfCirculationDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createQuantumOfCirculation: _factoriesAny.createQuantumOfCirculation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js new file mode 100644 index 0000000..bd3adb8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const randomDependencies = exports.randomDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRandom: _factoriesAny.createRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js new file mode 100644 index 0000000..d28db08 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomIntDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const randomIntDependencies = exports.randomIntDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRandomInt: _factoriesAny.createRandomInt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js new file mode 100644 index 0000000..7c3aa34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rangeDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesLargerEq.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rangeDependencies = exports.rangeDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRange: _factoriesAny.createRange +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js new file mode 100644 index 0000000..f1e48ad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RangeDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RangeDependencies = exports.RangeDependencies = { + createRangeClass: _factoriesAny.createRangeClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js new file mode 100644 index 0000000..7aad9a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RangeNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RangeNodeDependencies = exports.RangeNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createRangeNode: _factoriesAny.createRangeNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js new file mode 100644 index 0000000..60a437d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rangeTransformDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesLargerEq.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rangeTransformDependencies = exports.rangeTransformDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRangeTransform: _factoriesAny.createRangeTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js new file mode 100644 index 0000000..7668049 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rationalizeDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesFraction.generated.js"); +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesSimplify.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rationalizeDependencies = exports.rationalizeDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, + simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, + simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRationalize: _factoriesAny.createRationalize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js new file mode 100644 index 0000000..35789c5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const reDependencies = exports.reDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRe: _factoriesAny.createRe +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js new file mode 100644 index 0000000..4041248 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reducedPlanckConstantDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const reducedPlanckConstantDependencies = exports.reducedPlanckConstantDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createReducedPlanckConstant: _factoriesAny.createReducedPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js new file mode 100644 index 0000000..62c1626 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RelationalNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RelationalNodeDependencies = exports.RelationalNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createRelationalNode: _factoriesAny.createRelationalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js new file mode 100644 index 0000000..39e3ff1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.replacerDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const replacerDependencies = exports.replacerDependencies = { + createReplacer: _factoriesAny.createReplacer +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js new file mode 100644 index 0000000..7587a7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reshapeDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const reshapeDependencies = exports.reshapeDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createReshape: _factoriesAny.createReshape +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js new file mode 100644 index 0000000..4c9546e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resizeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const resizeDependencies = exports.resizeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + createResize: _factoriesAny.createResize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js new file mode 100644 index 0000000..7b174e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolveDependencies = void 0; +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const resolveDependencies = exports.resolveDependencies = { + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createResolve: _factoriesAny.createResolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js new file mode 100644 index 0000000..0ee382c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ResultSetDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ResultSetDependencies = exports.ResultSetDependencies = { + createResultSet: _factoriesAny.createResultSet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js new file mode 100644 index 0000000..8507ead --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reviverDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const reviverDependencies = exports.reviverDependencies = { + createReviver: _factoriesAny.createReviver +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js new file mode 100644 index 0000000..a2add6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightArithShiftDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rightArithShiftDependencies = exports.rightArithShiftDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createRightArithShift: _factoriesAny.createRightArithShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js new file mode 100644 index 0000000..ae40dd7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightLogShiftDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rightLogShiftDependencies = exports.rightLogShiftDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createRightLogShift: _factoriesAny.createRightLogShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js new file mode 100644 index 0000000..ac2bf2d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rotateDependencies = void 0; +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesRotationMatrixGenerated = require("./dependenciesRotationMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rotateDependencies = exports.rotateDependencies = { + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + rotationMatrixDependencies: _dependenciesRotationMatrixGenerated.rotationMatrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRotate: _factoriesAny.createRotate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js new file mode 100644 index 0000000..b64a159 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rotationMatrixDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCosGenerated = require("./dependenciesCos.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNormGenerated = require("./dependenciesNorm.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesSin.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rotationMatrixDependencies = exports.rotationMatrixDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + cosDependencies: _dependenciesCosGenerated.cosDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + normDependencies: _dependenciesNormGenerated.normDependencies, + sinDependencies: _dependenciesSinGenerated.sinDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createRotationMatrix: _factoriesAny.createRotationMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js new file mode 100644 index 0000000..3b222f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.roundDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const roundDependencies = exports.roundDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createRound: _factoriesAny.createRound +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js new file mode 100644 index 0000000..39b94b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rowDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesRange.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rowDependencies = exports.rowDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRow: _factoriesAny.createRow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js new file mode 100644 index 0000000..70fc593 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rowTransformDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesRange.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rowTransformDependencies = exports.rowTransformDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRowTransform: _factoriesAny.createRowTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js new file mode 100644 index 0000000..6df96b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rydbergDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rydbergDependencies = exports.rydbergDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createRydberg: _factoriesAny.createRydberg +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js new file mode 100644 index 0000000..d2257d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT1_2Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +// eslint-disable-line camelcase + +const SQRT1_2Dependencies = exports.SQRT1_2Dependencies = { + // eslint-disable-line camelcase + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createSQRT1_2: _factoriesAny.createSQRT1_2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js new file mode 100644 index 0000000..f6b0b76 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT2Dependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SQRT2Dependencies = exports.SQRT2Dependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createSQRT2: _factoriesAny.createSQRT2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js new file mode 100644 index 0000000..48869b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sackurTetrodeDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sackurTetrodeDependencies = exports.sackurTetrodeDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createSackurTetrode: _factoriesAny.createSackurTetrode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js new file mode 100644 index 0000000..38fdf66 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.schurDependencies = void 0; +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesNormGenerated = require("./dependenciesNorm.generated.js"); +var _dependenciesQrGenerated = require("./dependenciesQr.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const schurDependencies = exports.schurDependencies = { + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + normDependencies: _dependenciesNormGenerated.normDependencies, + qrDependencies: _dependenciesQrGenerated.qrDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSchur: _factoriesAny.createSchur +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js new file mode 100644 index 0000000..7c17436 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.secDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const secDependencies = exports.secDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSec: _factoriesAny.createSec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js new file mode 100644 index 0000000..954a48d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sechDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sechDependencies = exports.sechDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSech: _factoriesAny.createSech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js new file mode 100644 index 0000000..25f2773 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.secondRadiationDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const secondRadiationDependencies = exports.secondRadiationDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createSecondRadiation: _factoriesAny.createSecondRadiation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js new file mode 100644 index 0000000..7ad7c4d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setCartesianDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setCartesianDependencies = exports.setCartesianDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetCartesian: _factoriesAny.createSetCartesian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js new file mode 100644 index 0000000..048786c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setDifferenceDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setDifferenceDependencies = exports.setDifferenceDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetDifference: _factoriesAny.createSetDifference +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js new file mode 100644 index 0000000..047735f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setDistinctDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setDistinctDependencies = exports.setDistinctDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetDistinct: _factoriesAny.createSetDistinct +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js new file mode 100644 index 0000000..7f24e3a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setIntersectDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setIntersectDependencies = exports.setIntersectDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetIntersect: _factoriesAny.createSetIntersect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js new file mode 100644 index 0000000..2171853 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setIsSubsetDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setIsSubsetDependencies = exports.setIsSubsetDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetIsSubset: _factoriesAny.createSetIsSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js new file mode 100644 index 0000000..404a796 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setMultiplicityDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setMultiplicityDependencies = exports.setMultiplicityDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetMultiplicity: _factoriesAny.createSetMultiplicity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js new file mode 100644 index 0000000..d35c0d4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setPowersetDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setPowersetDependencies = exports.setPowersetDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetPowerset: _factoriesAny.createSetPowerset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js new file mode 100644 index 0000000..9b821a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setSizeDependencies = void 0; +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setSizeDependencies = exports.setSizeDependencies = { + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetSize: _factoriesAny.createSetSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js new file mode 100644 index 0000000..6c4bf9b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setSymDifferenceDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesSetDifferenceGenerated = require("./dependenciesSetDifference.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setSymDifferenceDependencies = exports.setSymDifferenceDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + setDifferenceDependencies: _dependenciesSetDifferenceGenerated.setDifferenceDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetSymDifference: _factoriesAny.createSetSymDifference +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js new file mode 100644 index 0000000..0ca3b74 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setUnionDependencies = void 0; +var _dependenciesIndexClassGenerated = require("./dependenciesIndexClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesSetIntersectGenerated = require("./dependenciesSetIntersect.generated.js"); +var _dependenciesSetSymDifferenceGenerated = require("./dependenciesSetSymDifference.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const setUnionDependencies = exports.setUnionDependencies = { + IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + setIntersectDependencies: _dependenciesSetIntersectGenerated.setIntersectDependencies, + setSymDifferenceDependencies: _dependenciesSetSymDifferenceGenerated.setSymDifferenceDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSetUnion: _factoriesAny.createSetUnion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js new file mode 100644 index 0000000..8a8d566 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.signDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _dependenciesComplexGenerated = require("./dependenciesComplex.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const signDependencies = exports.signDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + complexDependencies: _dependenciesComplexGenerated.complexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSign: _factoriesAny.createSign +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js new file mode 100644 index 0000000..e09a719 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesFraction.generated.js"); +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesResolveGenerated = require("./dependenciesResolve.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyDependencies = exports.simplifyDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + resolveDependencies: _dependenciesResolveGenerated.resolveDependencies, + simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, + simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplify: _factoriesAny.createSimplify +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js new file mode 100644 index 0000000..a74a21d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyConstantDependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesFractionGenerated = require("./dependenciesFraction.generated.js"); +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyConstantDependencies = exports.simplifyConstantDependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplifyConstant: _factoriesAny.createSimplifyConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js new file mode 100644 index 0000000..24ab57b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyCoreDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyCoreDependencies = exports.simplifyCoreDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplifyCore: _factoriesAny.createSimplifyCore +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js new file mode 100644 index 0000000..d598bb1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sinDependencies = exports.sinDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSin: _factoriesAny.createSin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js new file mode 100644 index 0000000..3ca69c5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sinhDependencies = exports.sinhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSinh: _factoriesAny.createSinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js new file mode 100644 index 0000000..4d61dfe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sizeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sizeDependencies = exports.sizeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSize: _factoriesAny.createSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js new file mode 100644 index 0000000..ce824d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sluDependencies = void 0; +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesLargerEq.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTransposeGenerated = require("./dependenciesTranspose.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sluDependencies = exports.sluDependencies = { + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSlu: _factoriesAny.createSlu +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js new file mode 100644 index 0000000..58244e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const smallerDependencies = exports.smallerDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSmaller: _factoriesAny.createSmaller +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js new file mode 100644 index 0000000..5482bb6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerEqDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const smallerEqDependencies = exports.smallerEqDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSmallerEq: _factoriesAny.createSmallerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js new file mode 100644 index 0000000..b23de99 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.solveODEDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMaxGenerated = require("./dependenciesMax.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const solveODEDependencies = exports.solveODEDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + mapDependencies: _dependenciesMapGenerated.mapDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + maxDependencies: _dependenciesMaxGenerated.maxDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createSolveODE: _factoriesAny.createSolveODE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js new file mode 100644 index 0000000..94036fd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sortDependencies = void 0; +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesCompareNatural.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sortDependencies = exports.sortDependencies = { + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSort: _factoriesAny.createSort +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js new file mode 100644 index 0000000..6ffda1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SpaDependencies = void 0; +var _dependenciesFibonacciHeapClassGenerated = require("./dependenciesFibonacciHeapClass.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SpaDependencies = exports.SpaDependencies = { + FibonacciHeapDependencies: _dependenciesFibonacciHeapClassGenerated.FibonacciHeapDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + createSpaClass: _factoriesAny.createSpaClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js new file mode 100644 index 0000000..89047ce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sparseDependencies = void 0; +var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sparseDependencies = exports.sparseDependencies = { + SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSparse: _factoriesAny.createSparse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js new file mode 100644 index 0000000..af95c83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SparseMatrixDependencies = void 0; +var _dependenciesMatrixClassGenerated = require("./dependenciesMatrixClass.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SparseMatrixDependencies = exports.SparseMatrixDependencies = { + MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSparseMatrixClass: _factoriesAny.createSparseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js new file mode 100644 index 0000000..6a0daf2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.speedOfLightDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const speedOfLightDependencies = exports.speedOfLightDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createSpeedOfLight: _factoriesAny.createSpeedOfLight +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js new file mode 100644 index 0000000..244bb24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.splitUnitDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const splitUnitDependencies = exports.splitUnitDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSplitUnit: _factoriesAny.createSplitUnit +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js new file mode 100644 index 0000000..693e1b3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sqrtDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sqrtDependencies = exports.sqrtDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSqrt: _factoriesAny.createSqrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js new file mode 100644 index 0000000..c02cf69 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sqrtmDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesInvGenerated = require("./dependenciesInv.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesMaxGenerated = require("./dependenciesMax.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sqrtmDependencies = exports.sqrtmDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + invDependencies: _dependenciesInvGenerated.invDependencies, + mapDependencies: _dependenciesMapGenerated.mapDependencies, + maxDependencies: _dependenciesMaxGenerated.maxDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSqrtm: _factoriesAny.createSqrtm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js new file mode 100644 index 0000000..fe2dc1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.squareDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const squareDependencies = exports.squareDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSquare: _factoriesAny.createSquare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js new file mode 100644 index 0000000..bce917c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.squeezeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const squeezeDependencies = exports.squeezeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSqueeze: _factoriesAny.createSqueeze +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js new file mode 100644 index 0000000..3a20a73 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stdDependencies = void 0; +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesVariance.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stdDependencies = exports.stdDependencies = { + mapDependencies: _dependenciesMapGenerated.mapDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, + createStd: _factoriesAny.createStd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js new file mode 100644 index 0000000..9869410 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stdTransformDependencies = void 0; +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesVariance.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stdTransformDependencies = exports.stdTransformDependencies = { + mapDependencies: _dependenciesMapGenerated.mapDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, + createStdTransform: _factoriesAny.createStdTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js new file mode 100644 index 0000000..f5c4ad4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stefanBoltzmannDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stefanBoltzmannDependencies = exports.stefanBoltzmannDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createStefanBoltzmann: _factoriesAny.createStefanBoltzmann +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js new file mode 100644 index 0000000..7f7a6d4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stirlingS2Dependencies = void 0; +var _dependenciesBignumberGenerated = require("./dependenciesBignumber.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stirlingS2Dependencies = exports.stirlingS2Dependencies = { + bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createStirlingS2: _factoriesAny.createStirlingS2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js new file mode 100644 index 0000000..2a14a55 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stringDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stringDependencies = exports.stringDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createString: _factoriesAny.createString +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js new file mode 100644 index 0000000..9f658cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subsetDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subsetDependencies = exports.subsetDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createSubset: _factoriesAny.createSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js new file mode 100644 index 0000000..d85fe5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subsetTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subsetTransformDependencies = exports.subsetTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, + createSubsetTransform: _factoriesAny.createSubsetTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js new file mode 100644 index 0000000..784a909 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subtractDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesUnaryMinus.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subtractDependencies = exports.subtractDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, + createSubtract: _factoriesAny.createSubtract +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js new file mode 100644 index 0000000..33608da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subtractScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subtractScalarDependencies = exports.subtractScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSubtractScalar: _factoriesAny.createSubtractScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js new file mode 100644 index 0000000..78927db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sumDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sumDependencies = exports.sumDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSum: _factoriesAny.createSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js new file mode 100644 index 0000000..1961331 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sumTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sumTransformDependencies = exports.sumTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSumTransform: _factoriesAny.createSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js new file mode 100644 index 0000000..b5db13f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sylvesterDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesIdentityGenerated = require("./dependenciesIdentity.generated.js"); +var _dependenciesIndexGenerated = require("./dependenciesIndex.generated.js"); +var _dependenciesLusolveGenerated = require("./dependenciesLusolve.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMatrixFromColumnsGenerated = require("./dependenciesMatrixFromColumns.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesRange.generated.js"); +var _dependenciesSchurGenerated = require("./dependenciesSchur.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTransposeGenerated = require("./dependenciesTranspose.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sylvesterDependencies = exports.sylvesterDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + identityDependencies: _dependenciesIdentityGenerated.identityDependencies, + indexDependencies: _dependenciesIndexGenerated.indexDependencies, + lusolveDependencies: _dependenciesLusolveGenerated.lusolveDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + matrixFromColumnsDependencies: _dependenciesMatrixFromColumnsGenerated.matrixFromColumnsDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, + schurDependencies: _dependenciesSchurGenerated.schurDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSylvester: _factoriesAny.createSylvester +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js new file mode 100644 index 0000000..a34e548 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SymbolNodeDependencies = void 0; +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SymbolNodeDependencies = exports.SymbolNodeDependencies = { + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createSymbolNode: _factoriesAny.createSymbolNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js new file mode 100644 index 0000000..562c7c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.symbolicEqualDependencies = void 0; +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesSimplify.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const symbolicEqualDependencies = exports.symbolicEqualDependencies = { + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSymbolicEqual: _factoriesAny.createSymbolicEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js new file mode 100644 index 0000000..df5060e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tanDependencies = exports.tanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTan: _factoriesAny.createTan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js new file mode 100644 index 0000000..8b03fed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tanhDependencies = exports.tanhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTanh: _factoriesAny.createTanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js new file mode 100644 index 0000000..3cbd68d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tauDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tauDependencies = exports.tauDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createTau: _factoriesAny.createTau +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js new file mode 100644 index 0000000..6aa9bae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.thomsonCrossSectionDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const thomsonCrossSectionDependencies = exports.thomsonCrossSectionDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createThomsonCrossSection: _factoriesAny.createThomsonCrossSection +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js new file mode 100644 index 0000000..055da52 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.toDependencies = void 0; +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const toDependencies = exports.toDependencies = { + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTo: _factoriesAny.createTo +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js new file mode 100644 index 0000000..0101245 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.traceDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const traceDependencies = exports.traceDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTrace: _factoriesAny.createTrace +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js new file mode 100644 index 0000000..a50a2e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transposeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const transposeDependencies = exports.transposeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTranspose: _factoriesAny.createTranspose +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js new file mode 100644 index 0000000..7a7f863 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.trueDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const trueDependencies = exports.trueDependencies = { + createTrue: _factoriesAny.createTrue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js new file mode 100644 index 0000000..2d69b03 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeOfDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const typeOfDependencies = exports.typeOfDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTypeOf: _factoriesAny.createTypeOf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js new file mode 100644 index 0000000..1cec5b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typedDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const typedDependencies = exports.typedDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + createTyped: _factoriesAny.createTyped +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js new file mode 100644 index 0000000..4235a84 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryMinusDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unaryMinusDependencies = exports.unaryMinusDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnaryMinus: _factoriesAny.createUnaryMinus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js new file mode 100644 index 0000000..7f50a4f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryPlusDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unaryPlusDependencies = exports.unaryPlusDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnaryPlus: _factoriesAny.createUnaryPlus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js new file mode 100644 index 0000000..16a0e2f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unequalDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unequalDependencies = exports.unequalDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnequal: _factoriesAny.createUnequal +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js new file mode 100644 index 0000000..9da2ac5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.UnitDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesFixGenerated = require("./dependenciesFix.generated.js"); +var _dependenciesFormatGenerated = require("./dependenciesFormat.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const UnitDependencies = exports.UnitDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + fixDependencies: _dependenciesFixGenerated.fixDependencies, + formatDependencies: _dependenciesFormatGenerated.formatDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + createUnitClass: _factoriesAny.createUnitClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js new file mode 100644 index 0000000..fc4cbfb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unitDependencies = void 0; +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unitDependencies = exports.unitDependencies = { + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnitFunction: _factoriesAny.createUnitFunction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js new file mode 100644 index 0000000..21959cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.EDependencies = void 0; +var _dependenciesEGenerated = require("./dependenciesE.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const EDependencies = exports.EDependencies = { + eDependencies: _dependenciesEGenerated.eDependencies, + createUppercaseE: _factoriesAny.createUppercaseE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js new file mode 100644 index 0000000..3503d4c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PIDependencies = void 0; +var _dependenciesPiGenerated = require("./dependenciesPi.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const PIDependencies = exports.PIDependencies = { + piDependencies: _dependenciesPiGenerated.piDependencies, + createUppercasePi: _factoriesAny.createUppercasePi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js new file mode 100644 index 0000000..e54ac02 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.usolveDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const usolveDependencies = exports.usolveDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUsolve: _factoriesAny.createUsolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js new file mode 100644 index 0000000..60f017b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.usolveAllDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const usolveAllDependencies = exports.usolveAllDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUsolveAll: _factoriesAny.createUsolveAll +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js new file mode 100644 index 0000000..4619717 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.vacuumImpedanceDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const vacuumImpedanceDependencies = exports.vacuumImpedanceDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createVacuumImpedance: _factoriesAny.createVacuumImpedance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js new file mode 100644 index 0000000..9753188 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.varianceDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesApply.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const varianceDependencies = exports.varianceDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + applyDependencies: _dependenciesApplyGenerated.applyDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createVariance: _factoriesAny.createVariance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js new file mode 100644 index 0000000..b824b25 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.varianceTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesApply.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const varianceTransformDependencies = exports.varianceTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + applyDependencies: _dependenciesApplyGenerated.applyDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createVarianceTransform: _factoriesAny.createVarianceTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js new file mode 100644 index 0000000..8987e6b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.versionDependencies = void 0; +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const versionDependencies = exports.versionDependencies = { + createVersion: _factoriesAny.createVersion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js new file mode 100644 index 0000000..666712d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.weakMixingAngleDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const weakMixingAngleDependencies = exports.weakMixingAngleDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + createWeakMixingAngle: _factoriesAny.createWeakMixingAngle +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js new file mode 100644 index 0000000..ffead9b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.wienDisplacementDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesUnitClassGenerated = require("./dependenciesUnitClass.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const wienDisplacementDependencies = exports.wienDisplacementDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, + createWienDisplacement: _factoriesAny.createWienDisplacement +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js new file mode 100644 index 0000000..5d9ffbc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xgcdDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const xgcdDependencies = exports.xgcdDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createXgcd: _factoriesAny.createXgcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js new file mode 100644 index 0000000..ffcc830 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xorDependencies = void 0; +var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); +var _dependenciesConcatGenerated = require("./dependenciesConcat.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const xorDependencies = exports.xorDependencies = { + DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, + concatDependencies: _dependenciesConcatGenerated.concatDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createXor: _factoriesAny.createXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js new file mode 100644 index 0000000..3a5e95a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zerosDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const zerosDependencies = exports.zerosDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createZeros: _factoriesAny.createZeros +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js new file mode 100644 index 0000000..007d273 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zetaDependencies = void 0; +var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesGammaGenerated = require("./dependenciesGamma.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPiGenerated = require("./dependenciesPi.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesSin.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const zetaDependencies = exports.zetaDependencies = { + BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + gammaDependencies: _dependenciesGammaGenerated.gammaDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + piDependencies: _dependenciesPiGenerated.piDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + sinDependencies: _dependenciesSinGenerated.sinDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createZeta: _factoriesAny.createZeta +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js new file mode 100644 index 0000000..926b4ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zpk2tfDependencies = void 0; +var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesAny = require("../../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const zpk2tfDependencies = exports.zpk2tfDependencies = { + ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createZpk2tf: _factoriesAny.createZpk2tf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js new file mode 100644 index 0000000..e68dbf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js @@ -0,0 +1,1447 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "AccessorNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesAccessorNodeGenerated.AccessorNodeDependencies; + } +}); +Object.defineProperty(exports, "ArrayNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesArrayNodeGenerated.ArrayNodeDependencies; + } +}); +Object.defineProperty(exports, "AssignmentNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies; + } +}); +Object.defineProperty(exports, "BlockNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesBlockNodeGenerated.BlockNodeDependencies; + } +}); +Object.defineProperty(exports, "ChainDependencies", { + enumerable: true, + get: function () { + return _dependenciesChainClassGenerated.ChainDependencies; + } +}); +Object.defineProperty(exports, "ConditionalNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies; + } +}); +Object.defineProperty(exports, "ConstantNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesConstantNodeGenerated.ConstantNodeDependencies; + } +}); +Object.defineProperty(exports, "EDependencies", { + enumerable: true, + get: function () { + return _dependenciesUppercaseEGenerated.EDependencies; + } +}); +Object.defineProperty(exports, "FunctionAssignmentNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies; + } +}); +Object.defineProperty(exports, "FunctionNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesFunctionNodeGenerated.FunctionNodeDependencies; + } +}); +Object.defineProperty(exports, "HelpDependencies", { + enumerable: true, + get: function () { + return _dependenciesHelpClassGenerated.HelpDependencies; + } +}); +Object.defineProperty(exports, "IndexNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexNodeGenerated.IndexNodeDependencies; + } +}); +Object.defineProperty(exports, "InfinityDependencies", { + enumerable: true, + get: function () { + return _dependenciesInfinityGenerated.InfinityDependencies; + } +}); +Object.defineProperty(exports, "LN10Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLN10Generated.LN10Dependencies; + } +}); +Object.defineProperty(exports, "LN2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLN2Generated.LN2Dependencies; + } +}); +Object.defineProperty(exports, "LOG10EDependencies", { + enumerable: true, + get: function () { + return _dependenciesLOG10EGenerated.LOG10EDependencies; + } +}); +Object.defineProperty(exports, "LOG2EDependencies", { + enumerable: true, + get: function () { + return _dependenciesLOG2EGenerated.LOG2EDependencies; + } +}); +Object.defineProperty(exports, "NaNDependencies", { + enumerable: true, + get: function () { + return _dependenciesNaNGenerated.NaNDependencies; + } +}); +Object.defineProperty(exports, "NodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesNodeGenerated.NodeDependencies; + } +}); +Object.defineProperty(exports, "ObjectNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesObjectNodeGenerated.ObjectNodeDependencies; + } +}); +Object.defineProperty(exports, "OperatorNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesOperatorNodeGenerated.OperatorNodeDependencies; + } +}); +Object.defineProperty(exports, "PIDependencies", { + enumerable: true, + get: function () { + return _dependenciesUppercasePiGenerated.PIDependencies; + } +}); +Object.defineProperty(exports, "ParenthesisNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies; + } +}); +Object.defineProperty(exports, "ParserDependencies", { + enumerable: true, + get: function () { + return _dependenciesParserClassGenerated.ParserDependencies; + } +}); +Object.defineProperty(exports, "RangeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeClassGenerated.RangeDependencies; + } +}); +Object.defineProperty(exports, "RangeNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeNodeGenerated.RangeNodeDependencies; + } +}); +Object.defineProperty(exports, "RelationalNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRelationalNodeGenerated.RelationalNodeDependencies; + } +}); +Object.defineProperty(exports, "ResultSetDependencies", { + enumerable: true, + get: function () { + return _dependenciesResultSetGenerated.ResultSetDependencies; + } +}); +Object.defineProperty(exports, "SQRT1_2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesSQRT1_2Generated.SQRT1_2Dependencies; + } +}); +Object.defineProperty(exports, "SQRT2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesSQRT2Generated.SQRT2Dependencies; + } +}); +Object.defineProperty(exports, "SymbolNodeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSymbolNodeGenerated.SymbolNodeDependencies; + } +}); +Object.defineProperty(exports, "absDependencies", { + enumerable: true, + get: function () { + return _dependenciesAbsGenerated.absDependencies; + } +}); +Object.defineProperty(exports, "acosDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcosGenerated.acosDependencies; + } +}); +Object.defineProperty(exports, "acoshDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcoshGenerated.acoshDependencies; + } +}); +Object.defineProperty(exports, "acotDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcotGenerated.acotDependencies; + } +}); +Object.defineProperty(exports, "acothDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcothGenerated.acothDependencies; + } +}); +Object.defineProperty(exports, "acscDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcscGenerated.acscDependencies; + } +}); +Object.defineProperty(exports, "acschDependencies", { + enumerable: true, + get: function () { + return _dependenciesAcschGenerated.acschDependencies; + } +}); +Object.defineProperty(exports, "addDependencies", { + enumerable: true, + get: function () { + return _dependenciesAddGenerated.addDependencies; + } +}); +Object.defineProperty(exports, "addScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesAddScalarGenerated.addScalarDependencies; + } +}); +Object.defineProperty(exports, "all", { + enumerable: true, + get: function () { + return _allFactoriesNumber.all; + } +}); +Object.defineProperty(exports, "andDependencies", { + enumerable: true, + get: function () { + return _dependenciesAndGenerated.andDependencies; + } +}); +Object.defineProperty(exports, "applyDependencies", { + enumerable: true, + get: function () { + return _dependenciesApplyGenerated.applyDependencies; + } +}); +Object.defineProperty(exports, "applyTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesApplyTransformGenerated.applyTransformDependencies; + } +}); +Object.defineProperty(exports, "asecDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsecGenerated.asecDependencies; + } +}); +Object.defineProperty(exports, "asechDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsechGenerated.asechDependencies; + } +}); +Object.defineProperty(exports, "asinDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsinGenerated.asinDependencies; + } +}); +Object.defineProperty(exports, "asinhDependencies", { + enumerable: true, + get: function () { + return _dependenciesAsinhGenerated.asinhDependencies; + } +}); +Object.defineProperty(exports, "atan2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesAtan2Generated.atan2Dependencies; + } +}); +Object.defineProperty(exports, "atanDependencies", { + enumerable: true, + get: function () { + return _dependenciesAtanGenerated.atanDependencies; + } +}); +Object.defineProperty(exports, "atanhDependencies", { + enumerable: true, + get: function () { + return _dependenciesAtanhGenerated.atanhDependencies; + } +}); +Object.defineProperty(exports, "bellNumbersDependencies", { + enumerable: true, + get: function () { + return _dependenciesBellNumbersGenerated.bellNumbersDependencies; + } +}); +Object.defineProperty(exports, "bigintDependencies", { + enumerable: true, + get: function () { + return _dependenciesBigintGenerated.bigintDependencies; + } +}); +Object.defineProperty(exports, "bitAndDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitAndGenerated.bitAndDependencies; + } +}); +Object.defineProperty(exports, "bitNotDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitNotGenerated.bitNotDependencies; + } +}); +Object.defineProperty(exports, "bitOrDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitOrGenerated.bitOrDependencies; + } +}); +Object.defineProperty(exports, "bitXorDependencies", { + enumerable: true, + get: function () { + return _dependenciesBitXorGenerated.bitXorDependencies; + } +}); +Object.defineProperty(exports, "booleanDependencies", { + enumerable: true, + get: function () { + return _dependenciesBooleanGenerated.booleanDependencies; + } +}); +Object.defineProperty(exports, "catalanDependencies", { + enumerable: true, + get: function () { + return _dependenciesCatalanGenerated.catalanDependencies; + } +}); +Object.defineProperty(exports, "cbrtDependencies", { + enumerable: true, + get: function () { + return _dependenciesCbrtGenerated.cbrtDependencies; + } +}); +Object.defineProperty(exports, "ceilDependencies", { + enumerable: true, + get: function () { + return _dependenciesCeilGenerated.ceilDependencies; + } +}); +Object.defineProperty(exports, "chainDependencies", { + enumerable: true, + get: function () { + return _dependenciesChainGenerated.chainDependencies; + } +}); +Object.defineProperty(exports, "cloneDependencies", { + enumerable: true, + get: function () { + return _dependenciesCloneGenerated.cloneDependencies; + } +}); +Object.defineProperty(exports, "combinationsDependencies", { + enumerable: true, + get: function () { + return _dependenciesCombinationsGenerated.combinationsDependencies; + } +}); +Object.defineProperty(exports, "combinationsWithRepDependencies", { + enumerable: true, + get: function () { + return _dependenciesCombinationsWithRepGenerated.combinationsWithRepDependencies; + } +}); +Object.defineProperty(exports, "compareDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareGenerated.compareDependencies; + } +}); +Object.defineProperty(exports, "compareNaturalDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareNaturalGenerated.compareNaturalDependencies; + } +}); +Object.defineProperty(exports, "compareTextDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompareTextGenerated.compareTextDependencies; + } +}); +Object.defineProperty(exports, "compileDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompileGenerated.compileDependencies; + } +}); +Object.defineProperty(exports, "compositionDependencies", { + enumerable: true, + get: function () { + return _dependenciesCompositionGenerated.compositionDependencies; + } +}); +Object.defineProperty(exports, "corrDependencies", { + enumerable: true, + get: function () { + return _dependenciesCorrGenerated.corrDependencies; + } +}); +Object.defineProperty(exports, "cosDependencies", { + enumerable: true, + get: function () { + return _dependenciesCosGenerated.cosDependencies; + } +}); +Object.defineProperty(exports, "coshDependencies", { + enumerable: true, + get: function () { + return _dependenciesCoshGenerated.coshDependencies; + } +}); +Object.defineProperty(exports, "cotDependencies", { + enumerable: true, + get: function () { + return _dependenciesCotGenerated.cotDependencies; + } +}); +Object.defineProperty(exports, "cothDependencies", { + enumerable: true, + get: function () { + return _dependenciesCothGenerated.cothDependencies; + } +}); +Object.defineProperty(exports, "cscDependencies", { + enumerable: true, + get: function () { + return _dependenciesCscGenerated.cscDependencies; + } +}); +Object.defineProperty(exports, "cschDependencies", { + enumerable: true, + get: function () { + return _dependenciesCschGenerated.cschDependencies; + } +}); +Object.defineProperty(exports, "cubeDependencies", { + enumerable: true, + get: function () { + return _dependenciesCubeGenerated.cubeDependencies; + } +}); +Object.defineProperty(exports, "cumsumDependencies", { + enumerable: true, + get: function () { + return _dependenciesCumSumGenerated.cumsumDependencies; + } +}); +Object.defineProperty(exports, "cumsumTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesCumSumTransformGenerated.cumsumTransformDependencies; + } +}); +Object.defineProperty(exports, "deepEqualDependencies", { + enumerable: true, + get: function () { + return _dependenciesDeepEqualGenerated.deepEqualDependencies; + } +}); +Object.defineProperty(exports, "derivativeDependencies", { + enumerable: true, + get: function () { + return _dependenciesDerivativeGenerated.derivativeDependencies; + } +}); +Object.defineProperty(exports, "divideDependencies", { + enumerable: true, + get: function () { + return _dependenciesDivideGenerated.divideDependencies; + } +}); +Object.defineProperty(exports, "divideScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesDivideScalarGenerated.divideScalarDependencies; + } +}); +Object.defineProperty(exports, "eDependencies", { + enumerable: true, + get: function () { + return _dependenciesEGenerated.eDependencies; + } +}); +Object.defineProperty(exports, "equalDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualGenerated.equalDependencies; + } +}); +Object.defineProperty(exports, "equalScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualScalarGenerated.equalScalarDependencies; + } +}); +Object.defineProperty(exports, "equalTextDependencies", { + enumerable: true, + get: function () { + return _dependenciesEqualTextGenerated.equalTextDependencies; + } +}); +Object.defineProperty(exports, "erfDependencies", { + enumerable: true, + get: function () { + return _dependenciesErfGenerated.erfDependencies; + } +}); +Object.defineProperty(exports, "evaluateDependencies", { + enumerable: true, + get: function () { + return _dependenciesEvaluateGenerated.evaluateDependencies; + } +}); +Object.defineProperty(exports, "expDependencies", { + enumerable: true, + get: function () { + return _dependenciesExpGenerated.expDependencies; + } +}); +Object.defineProperty(exports, "expm1Dependencies", { + enumerable: true, + get: function () { + return _dependenciesExpm1Generated.expm1Dependencies; + } +}); +Object.defineProperty(exports, "factorialDependencies", { + enumerable: true, + get: function () { + return _dependenciesFactorialGenerated.factorialDependencies; + } +}); +Object.defineProperty(exports, "falseDependencies", { + enumerable: true, + get: function () { + return _dependenciesFalseGenerated.falseDependencies; + } +}); +Object.defineProperty(exports, "filterDependencies", { + enumerable: true, + get: function () { + return _dependenciesFilterGenerated.filterDependencies; + } +}); +Object.defineProperty(exports, "filterTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesFilterTransformGenerated.filterTransformDependencies; + } +}); +Object.defineProperty(exports, "fixDependencies", { + enumerable: true, + get: function () { + return _dependenciesFixGenerated.fixDependencies; + } +}); +Object.defineProperty(exports, "floorDependencies", { + enumerable: true, + get: function () { + return _dependenciesFloorGenerated.floorDependencies; + } +}); +Object.defineProperty(exports, "forEachDependencies", { + enumerable: true, + get: function () { + return _dependenciesForEachGenerated.forEachDependencies; + } +}); +Object.defineProperty(exports, "forEachTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesForEachTransformGenerated.forEachTransformDependencies; + } +}); +Object.defineProperty(exports, "formatDependencies", { + enumerable: true, + get: function () { + return _dependenciesFormatGenerated.formatDependencies; + } +}); +Object.defineProperty(exports, "gammaDependencies", { + enumerable: true, + get: function () { + return _dependenciesGammaGenerated.gammaDependencies; + } +}); +Object.defineProperty(exports, "gcdDependencies", { + enumerable: true, + get: function () { + return _dependenciesGcdGenerated.gcdDependencies; + } +}); +Object.defineProperty(exports, "hasNumericValueDependencies", { + enumerable: true, + get: function () { + return _dependenciesHasNumericValueGenerated.hasNumericValueDependencies; + } +}); +Object.defineProperty(exports, "helpDependencies", { + enumerable: true, + get: function () { + return _dependenciesHelpGenerated.helpDependencies; + } +}); +Object.defineProperty(exports, "hypotDependencies", { + enumerable: true, + get: function () { + return _dependenciesHypotGenerated.hypotDependencies; + } +}); +Object.defineProperty(exports, "indexDependencies", { + enumerable: true, + get: function () { + return _dependenciesIndexGenerated.indexDependencies; + } +}); +Object.defineProperty(exports, "isIntegerDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsIntegerGenerated.isIntegerDependencies; + } +}); +Object.defineProperty(exports, "isNaNDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNaNGenerated.isNaNDependencies; + } +}); +Object.defineProperty(exports, "isNegativeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNegativeGenerated.isNegativeDependencies; + } +}); +Object.defineProperty(exports, "isNumericDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsNumericGenerated.isNumericDependencies; + } +}); +Object.defineProperty(exports, "isPositiveDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsPositiveGenerated.isPositiveDependencies; + } +}); +Object.defineProperty(exports, "isPrimeDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsPrimeGenerated.isPrimeDependencies; + } +}); +Object.defineProperty(exports, "isZeroDependencies", { + enumerable: true, + get: function () { + return _dependenciesIsZeroGenerated.isZeroDependencies; + } +}); +Object.defineProperty(exports, "largerDependencies", { + enumerable: true, + get: function () { + return _dependenciesLargerGenerated.largerDependencies; + } +}); +Object.defineProperty(exports, "largerEqDependencies", { + enumerable: true, + get: function () { + return _dependenciesLargerEqGenerated.largerEqDependencies; + } +}); +Object.defineProperty(exports, "lcmDependencies", { + enumerable: true, + get: function () { + return _dependenciesLcmGenerated.lcmDependencies; + } +}); +Object.defineProperty(exports, "leftShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesLeftShiftGenerated.leftShiftDependencies; + } +}); +Object.defineProperty(exports, "lgammaDependencies", { + enumerable: true, + get: function () { + return _dependenciesLgammaGenerated.lgammaDependencies; + } +}); +Object.defineProperty(exports, "log10Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLog10Generated.log10Dependencies; + } +}); +Object.defineProperty(exports, "log1pDependencies", { + enumerable: true, + get: function () { + return _dependenciesLog1pGenerated.log1pDependencies; + } +}); +Object.defineProperty(exports, "log2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesLog2Generated.log2Dependencies; + } +}); +Object.defineProperty(exports, "logDependencies", { + enumerable: true, + get: function () { + return _dependenciesLogGenerated.logDependencies; + } +}); +Object.defineProperty(exports, "madDependencies", { + enumerable: true, + get: function () { + return _dependenciesMadGenerated.madDependencies; + } +}); +Object.defineProperty(exports, "mapDependencies", { + enumerable: true, + get: function () { + return _dependenciesMapGenerated.mapDependencies; + } +}); +Object.defineProperty(exports, "mapTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMapTransformGenerated.mapTransformDependencies; + } +}); +Object.defineProperty(exports, "matrixDependencies", { + enumerable: true, + get: function () { + return _dependenciesMatrixGenerated.matrixDependencies; + } +}); +Object.defineProperty(exports, "maxDependencies", { + enumerable: true, + get: function () { + return _dependenciesMaxGenerated.maxDependencies; + } +}); +Object.defineProperty(exports, "maxTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMaxTransformGenerated.maxTransformDependencies; + } +}); +Object.defineProperty(exports, "meanDependencies", { + enumerable: true, + get: function () { + return _dependenciesMeanGenerated.meanDependencies; + } +}); +Object.defineProperty(exports, "meanTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMeanTransformGenerated.meanTransformDependencies; + } +}); +Object.defineProperty(exports, "medianDependencies", { + enumerable: true, + get: function () { + return _dependenciesMedianGenerated.medianDependencies; + } +}); +Object.defineProperty(exports, "minDependencies", { + enumerable: true, + get: function () { + return _dependenciesMinGenerated.minDependencies; + } +}); +Object.defineProperty(exports, "minTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesMinTransformGenerated.minTransformDependencies; + } +}); +Object.defineProperty(exports, "modDependencies", { + enumerable: true, + get: function () { + return _dependenciesModGenerated.modDependencies; + } +}); +Object.defineProperty(exports, "modeDependencies", { + enumerable: true, + get: function () { + return _dependenciesModeGenerated.modeDependencies; + } +}); +Object.defineProperty(exports, "multinomialDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultinomialGenerated.multinomialDependencies; + } +}); +Object.defineProperty(exports, "multiplyDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultiplyGenerated.multiplyDependencies; + } +}); +Object.defineProperty(exports, "multiplyScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies; + } +}); +Object.defineProperty(exports, "normDependencies", { + enumerable: true, + get: function () { + return _dependenciesNormGenerated.normDependencies; + } +}); +Object.defineProperty(exports, "notDependencies", { + enumerable: true, + get: function () { + return _dependenciesNotGenerated.notDependencies; + } +}); +Object.defineProperty(exports, "nthRootDependencies", { + enumerable: true, + get: function () { + return _dependenciesNthRootGenerated.nthRootDependencies; + } +}); +Object.defineProperty(exports, "nullDependencies", { + enumerable: true, + get: function () { + return _dependenciesNullGenerated.nullDependencies; + } +}); +Object.defineProperty(exports, "numberDependencies", { + enumerable: true, + get: function () { + return _dependenciesNumberGenerated.numberDependencies; + } +}); +Object.defineProperty(exports, "numericDependencies", { + enumerable: true, + get: function () { + return _dependenciesNumericGenerated.numericDependencies; + } +}); +Object.defineProperty(exports, "orDependencies", { + enumerable: true, + get: function () { + return _dependenciesOrGenerated.orDependencies; + } +}); +Object.defineProperty(exports, "parseDependencies", { + enumerable: true, + get: function () { + return _dependenciesParseGenerated.parseDependencies; + } +}); +Object.defineProperty(exports, "parserDependencies", { + enumerable: true, + get: function () { + return _dependenciesParserGenerated.parserDependencies; + } +}); +Object.defineProperty(exports, "partitionSelectDependencies", { + enumerable: true, + get: function () { + return _dependenciesPartitionSelectGenerated.partitionSelectDependencies; + } +}); +Object.defineProperty(exports, "permutationsDependencies", { + enumerable: true, + get: function () { + return _dependenciesPermutationsGenerated.permutationsDependencies; + } +}); +Object.defineProperty(exports, "phiDependencies", { + enumerable: true, + get: function () { + return _dependenciesPhiGenerated.phiDependencies; + } +}); +Object.defineProperty(exports, "piDependencies", { + enumerable: true, + get: function () { + return _dependenciesPiGenerated.piDependencies; + } +}); +Object.defineProperty(exports, "pickRandomDependencies", { + enumerable: true, + get: function () { + return _dependenciesPickRandomGenerated.pickRandomDependencies; + } +}); +Object.defineProperty(exports, "powDependencies", { + enumerable: true, + get: function () { + return _dependenciesPowGenerated.powDependencies; + } +}); +Object.defineProperty(exports, "printDependencies", { + enumerable: true, + get: function () { + return _dependenciesPrintGenerated.printDependencies; + } +}); +Object.defineProperty(exports, "prodDependencies", { + enumerable: true, + get: function () { + return _dependenciesProdGenerated.prodDependencies; + } +}); +Object.defineProperty(exports, "quantileSeqDependencies", { + enumerable: true, + get: function () { + return _dependenciesQuantileSeqGenerated.quantileSeqDependencies; + } +}); +Object.defineProperty(exports, "randomDependencies", { + enumerable: true, + get: function () { + return _dependenciesRandomGenerated.randomDependencies; + } +}); +Object.defineProperty(exports, "randomIntDependencies", { + enumerable: true, + get: function () { + return _dependenciesRandomIntGenerated.randomIntDependencies; + } +}); +Object.defineProperty(exports, "rangeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeGenerated.rangeDependencies; + } +}); +Object.defineProperty(exports, "rangeTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesRangeTransformGenerated.rangeTransformDependencies; + } +}); +Object.defineProperty(exports, "rationalizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesRationalizeGenerated.rationalizeDependencies; + } +}); +Object.defineProperty(exports, "replacerDependencies", { + enumerable: true, + get: function () { + return _dependenciesReplacerGenerated.replacerDependencies; + } +}); +Object.defineProperty(exports, "resolveDependencies", { + enumerable: true, + get: function () { + return _dependenciesResolveGenerated.resolveDependencies; + } +}); +Object.defineProperty(exports, "reviverDependencies", { + enumerable: true, + get: function () { + return _dependenciesReviverGenerated.reviverDependencies; + } +}); +Object.defineProperty(exports, "rightArithShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesRightArithShiftGenerated.rightArithShiftDependencies; + } +}); +Object.defineProperty(exports, "rightLogShiftDependencies", { + enumerable: true, + get: function () { + return _dependenciesRightLogShiftGenerated.rightLogShiftDependencies; + } +}); +Object.defineProperty(exports, "roundDependencies", { + enumerable: true, + get: function () { + return _dependenciesRoundGenerated.roundDependencies; + } +}); +Object.defineProperty(exports, "secDependencies", { + enumerable: true, + get: function () { + return _dependenciesSecGenerated.secDependencies; + } +}); +Object.defineProperty(exports, "sechDependencies", { + enumerable: true, + get: function () { + return _dependenciesSechGenerated.sechDependencies; + } +}); +Object.defineProperty(exports, "signDependencies", { + enumerable: true, + get: function () { + return _dependenciesSignGenerated.signDependencies; + } +}); +Object.defineProperty(exports, "simplifyConstantDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies; + } +}); +Object.defineProperty(exports, "simplifyCoreDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies; + } +}); +Object.defineProperty(exports, "simplifyDependencies", { + enumerable: true, + get: function () { + return _dependenciesSimplifyGenerated.simplifyDependencies; + } +}); +Object.defineProperty(exports, "sinDependencies", { + enumerable: true, + get: function () { + return _dependenciesSinGenerated.sinDependencies; + } +}); +Object.defineProperty(exports, "sinhDependencies", { + enumerable: true, + get: function () { + return _dependenciesSinhGenerated.sinhDependencies; + } +}); +Object.defineProperty(exports, "sizeDependencies", { + enumerable: true, + get: function () { + return _dependenciesSizeGenerated.sizeDependencies; + } +}); +Object.defineProperty(exports, "smallerDependencies", { + enumerable: true, + get: function () { + return _dependenciesSmallerGenerated.smallerDependencies; + } +}); +Object.defineProperty(exports, "smallerEqDependencies", { + enumerable: true, + get: function () { + return _dependenciesSmallerEqGenerated.smallerEqDependencies; + } +}); +Object.defineProperty(exports, "sqrtDependencies", { + enumerable: true, + get: function () { + return _dependenciesSqrtGenerated.sqrtDependencies; + } +}); +Object.defineProperty(exports, "squareDependencies", { + enumerable: true, + get: function () { + return _dependenciesSquareGenerated.squareDependencies; + } +}); +Object.defineProperty(exports, "stdDependencies", { + enumerable: true, + get: function () { + return _dependenciesStdGenerated.stdDependencies; + } +}); +Object.defineProperty(exports, "stdTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesStdTransformGenerated.stdTransformDependencies; + } +}); +Object.defineProperty(exports, "stirlingS2Dependencies", { + enumerable: true, + get: function () { + return _dependenciesStirlingS2Generated.stirlingS2Dependencies; + } +}); +Object.defineProperty(exports, "stringDependencies", { + enumerable: true, + get: function () { + return _dependenciesStringGenerated.stringDependencies; + } +}); +Object.defineProperty(exports, "subsetDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubsetGenerated.subsetDependencies; + } +}); +Object.defineProperty(exports, "subsetTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubsetTransformGenerated.subsetTransformDependencies; + } +}); +Object.defineProperty(exports, "subtractDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubtractGenerated.subtractDependencies; + } +}); +Object.defineProperty(exports, "subtractScalarDependencies", { + enumerable: true, + get: function () { + return _dependenciesSubtractScalarGenerated.subtractScalarDependencies; + } +}); +Object.defineProperty(exports, "sumDependencies", { + enumerable: true, + get: function () { + return _dependenciesSumGenerated.sumDependencies; + } +}); +Object.defineProperty(exports, "sumTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesSumTransformGenerated.sumTransformDependencies; + } +}); +Object.defineProperty(exports, "tanDependencies", { + enumerable: true, + get: function () { + return _dependenciesTanGenerated.tanDependencies; + } +}); +Object.defineProperty(exports, "tanhDependencies", { + enumerable: true, + get: function () { + return _dependenciesTanhGenerated.tanhDependencies; + } +}); +Object.defineProperty(exports, "tauDependencies", { + enumerable: true, + get: function () { + return _dependenciesTauGenerated.tauDependencies; + } +}); +Object.defineProperty(exports, "trueDependencies", { + enumerable: true, + get: function () { + return _dependenciesTrueGenerated.trueDependencies; + } +}); +Object.defineProperty(exports, "typeOfDependencies", { + enumerable: true, + get: function () { + return _dependenciesTypeOfGenerated.typeOfDependencies; + } +}); +Object.defineProperty(exports, "typedDependencies", { + enumerable: true, + get: function () { + return _dependenciesTypedGenerated.typedDependencies; + } +}); +Object.defineProperty(exports, "unaryMinusDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnaryMinusGenerated.unaryMinusDependencies; + } +}); +Object.defineProperty(exports, "unaryPlusDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnaryPlusGenerated.unaryPlusDependencies; + } +}); +Object.defineProperty(exports, "unequalDependencies", { + enumerable: true, + get: function () { + return _dependenciesUnequalGenerated.unequalDependencies; + } +}); +Object.defineProperty(exports, "varianceDependencies", { + enumerable: true, + get: function () { + return _dependenciesVarianceGenerated.varianceDependencies; + } +}); +Object.defineProperty(exports, "varianceTransformDependencies", { + enumerable: true, + get: function () { + return _dependenciesVarianceTransformGenerated.varianceTransformDependencies; + } +}); +Object.defineProperty(exports, "versionDependencies", { + enumerable: true, + get: function () { + return _dependenciesVersionGenerated.versionDependencies; + } +}); +Object.defineProperty(exports, "xgcdDependencies", { + enumerable: true, + get: function () { + return _dependenciesXgcdGenerated.xgcdDependencies; + } +}); +Object.defineProperty(exports, "xorDependencies", { + enumerable: true, + get: function () { + return _dependenciesXorGenerated.xorDependencies; + } +}); +Object.defineProperty(exports, "zetaDependencies", { + enumerable: true, + get: function () { + return _dependenciesZetaGenerated.zetaDependencies; + } +}); +var _dependenciesAbsGenerated = require("./dependenciesNumber/dependenciesAbs.generated.js"); +var _dependenciesAccessorNodeGenerated = require("./dependenciesNumber/dependenciesAccessorNode.generated.js"); +var _dependenciesAcosGenerated = require("./dependenciesNumber/dependenciesAcos.generated.js"); +var _dependenciesAcoshGenerated = require("./dependenciesNumber/dependenciesAcosh.generated.js"); +var _dependenciesAcotGenerated = require("./dependenciesNumber/dependenciesAcot.generated.js"); +var _dependenciesAcothGenerated = require("./dependenciesNumber/dependenciesAcoth.generated.js"); +var _dependenciesAcscGenerated = require("./dependenciesNumber/dependenciesAcsc.generated.js"); +var _dependenciesAcschGenerated = require("./dependenciesNumber/dependenciesAcsch.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesNumber/dependenciesAdd.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesNumber/dependenciesAddScalar.generated.js"); +var _dependenciesAndGenerated = require("./dependenciesNumber/dependenciesAnd.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesNumber/dependenciesApply.generated.js"); +var _dependenciesApplyTransformGenerated = require("./dependenciesNumber/dependenciesApplyTransform.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesNumber/dependenciesArrayNode.generated.js"); +var _dependenciesAsecGenerated = require("./dependenciesNumber/dependenciesAsec.generated.js"); +var _dependenciesAsechGenerated = require("./dependenciesNumber/dependenciesAsech.generated.js"); +var _dependenciesAsinGenerated = require("./dependenciesNumber/dependenciesAsin.generated.js"); +var _dependenciesAsinhGenerated = require("./dependenciesNumber/dependenciesAsinh.generated.js"); +var _dependenciesAssignmentNodeGenerated = require("./dependenciesNumber/dependenciesAssignmentNode.generated.js"); +var _dependenciesAtanGenerated = require("./dependenciesNumber/dependenciesAtan.generated.js"); +var _dependenciesAtan2Generated = require("./dependenciesNumber/dependenciesAtan2.generated.js"); +var _dependenciesAtanhGenerated = require("./dependenciesNumber/dependenciesAtanh.generated.js"); +var _dependenciesBellNumbersGenerated = require("./dependenciesNumber/dependenciesBellNumbers.generated.js"); +var _dependenciesBigintGenerated = require("./dependenciesNumber/dependenciesBigint.generated.js"); +var _dependenciesBitAndGenerated = require("./dependenciesNumber/dependenciesBitAnd.generated.js"); +var _dependenciesBitNotGenerated = require("./dependenciesNumber/dependenciesBitNot.generated.js"); +var _dependenciesBitOrGenerated = require("./dependenciesNumber/dependenciesBitOr.generated.js"); +var _dependenciesBitXorGenerated = require("./dependenciesNumber/dependenciesBitXor.generated.js"); +var _dependenciesBlockNodeGenerated = require("./dependenciesNumber/dependenciesBlockNode.generated.js"); +var _dependenciesBooleanGenerated = require("./dependenciesNumber/dependenciesBoolean.generated.js"); +var _dependenciesCatalanGenerated = require("./dependenciesNumber/dependenciesCatalan.generated.js"); +var _dependenciesCbrtGenerated = require("./dependenciesNumber/dependenciesCbrt.generated.js"); +var _dependenciesCeilGenerated = require("./dependenciesNumber/dependenciesCeil.generated.js"); +var _dependenciesChainGenerated = require("./dependenciesNumber/dependenciesChain.generated.js"); +var _dependenciesChainClassGenerated = require("./dependenciesNumber/dependenciesChainClass.generated.js"); +var _dependenciesCloneGenerated = require("./dependenciesNumber/dependenciesClone.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesNumber/dependenciesCombinations.generated.js"); +var _dependenciesCombinationsWithRepGenerated = require("./dependenciesNumber/dependenciesCombinationsWithRep.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesNumber/dependenciesCompare.generated.js"); +var _dependenciesCompareNaturalGenerated = require("./dependenciesNumber/dependenciesCompareNatural.generated.js"); +var _dependenciesCompareTextGenerated = require("./dependenciesNumber/dependenciesCompareText.generated.js"); +var _dependenciesCompileGenerated = require("./dependenciesNumber/dependenciesCompile.generated.js"); +var _dependenciesCompositionGenerated = require("./dependenciesNumber/dependenciesComposition.generated.js"); +var _dependenciesConditionalNodeGenerated = require("./dependenciesNumber/dependenciesConditionalNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesNumber/dependenciesConstantNode.generated.js"); +var _dependenciesCorrGenerated = require("./dependenciesNumber/dependenciesCorr.generated.js"); +var _dependenciesCosGenerated = require("./dependenciesNumber/dependenciesCos.generated.js"); +var _dependenciesCoshGenerated = require("./dependenciesNumber/dependenciesCosh.generated.js"); +var _dependenciesCotGenerated = require("./dependenciesNumber/dependenciesCot.generated.js"); +var _dependenciesCothGenerated = require("./dependenciesNumber/dependenciesCoth.generated.js"); +var _dependenciesCscGenerated = require("./dependenciesNumber/dependenciesCsc.generated.js"); +var _dependenciesCschGenerated = require("./dependenciesNumber/dependenciesCsch.generated.js"); +var _dependenciesCubeGenerated = require("./dependenciesNumber/dependenciesCube.generated.js"); +var _dependenciesCumSumGenerated = require("./dependenciesNumber/dependenciesCumSum.generated.js"); +var _dependenciesCumSumTransformGenerated = require("./dependenciesNumber/dependenciesCumSumTransform.generated.js"); +var _dependenciesDeepEqualGenerated = require("./dependenciesNumber/dependenciesDeepEqual.generated.js"); +var _dependenciesDerivativeGenerated = require("./dependenciesNumber/dependenciesDerivative.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesNumber/dependenciesDivide.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesNumber/dependenciesDivideScalar.generated.js"); +var _dependenciesEGenerated = require("./dependenciesNumber/dependenciesE.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesNumber/dependenciesEqual.generated.js"); +var _dependenciesEqualScalarGenerated = require("./dependenciesNumber/dependenciesEqualScalar.generated.js"); +var _dependenciesEqualTextGenerated = require("./dependenciesNumber/dependenciesEqualText.generated.js"); +var _dependenciesErfGenerated = require("./dependenciesNumber/dependenciesErf.generated.js"); +var _dependenciesEvaluateGenerated = require("./dependenciesNumber/dependenciesEvaluate.generated.js"); +var _dependenciesExpGenerated = require("./dependenciesNumber/dependenciesExp.generated.js"); +var _dependenciesExpm1Generated = require("./dependenciesNumber/dependenciesExpm1.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesNumber/dependenciesFactorial.generated.js"); +var _dependenciesFalseGenerated = require("./dependenciesNumber/dependenciesFalse.generated.js"); +var _dependenciesFilterGenerated = require("./dependenciesNumber/dependenciesFilter.generated.js"); +var _dependenciesFilterTransformGenerated = require("./dependenciesNumber/dependenciesFilterTransform.generated.js"); +var _dependenciesFixGenerated = require("./dependenciesNumber/dependenciesFix.generated.js"); +var _dependenciesFloorGenerated = require("./dependenciesNumber/dependenciesFloor.generated.js"); +var _dependenciesForEachGenerated = require("./dependenciesNumber/dependenciesForEach.generated.js"); +var _dependenciesForEachTransformGenerated = require("./dependenciesNumber/dependenciesForEachTransform.generated.js"); +var _dependenciesFormatGenerated = require("./dependenciesNumber/dependenciesFormat.generated.js"); +var _dependenciesFunctionAssignmentNodeGenerated = require("./dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesNumber/dependenciesFunctionNode.generated.js"); +var _dependenciesGammaGenerated = require("./dependenciesNumber/dependenciesGamma.generated.js"); +var _dependenciesGcdGenerated = require("./dependenciesNumber/dependenciesGcd.generated.js"); +var _dependenciesHasNumericValueGenerated = require("./dependenciesNumber/dependenciesHasNumericValue.generated.js"); +var _dependenciesHelpGenerated = require("./dependenciesNumber/dependenciesHelp.generated.js"); +var _dependenciesHelpClassGenerated = require("./dependenciesNumber/dependenciesHelpClass.generated.js"); +var _dependenciesHypotGenerated = require("./dependenciesNumber/dependenciesHypot.generated.js"); +var _dependenciesIndexGenerated = require("./dependenciesNumber/dependenciesIndex.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesNumber/dependenciesIndexNode.generated.js"); +var _dependenciesInfinityGenerated = require("./dependenciesNumber/dependenciesInfinity.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesNumber/dependenciesIsInteger.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesNumber/dependenciesIsNaN.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesNumber/dependenciesIsNegative.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesNumber/dependenciesIsNumeric.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesNumber/dependenciesIsPositive.generated.js"); +var _dependenciesIsPrimeGenerated = require("./dependenciesNumber/dependenciesIsPrime.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesNumber/dependenciesIsZero.generated.js"); +var _dependenciesLN10Generated = require("./dependenciesNumber/dependenciesLN10.generated.js"); +var _dependenciesLN2Generated = require("./dependenciesNumber/dependenciesLN2.generated.js"); +var _dependenciesLOG10EGenerated = require("./dependenciesNumber/dependenciesLOG10E.generated.js"); +var _dependenciesLOG2EGenerated = require("./dependenciesNumber/dependenciesLOG2E.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesNumber/dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesNumber/dependenciesLargerEq.generated.js"); +var _dependenciesLcmGenerated = require("./dependenciesNumber/dependenciesLcm.generated.js"); +var _dependenciesLeftShiftGenerated = require("./dependenciesNumber/dependenciesLeftShift.generated.js"); +var _dependenciesLgammaGenerated = require("./dependenciesNumber/dependenciesLgamma.generated.js"); +var _dependenciesLogGenerated = require("./dependenciesNumber/dependenciesLog.generated.js"); +var _dependenciesLog10Generated = require("./dependenciesNumber/dependenciesLog10.generated.js"); +var _dependenciesLog1pGenerated = require("./dependenciesNumber/dependenciesLog1p.generated.js"); +var _dependenciesLog2Generated = require("./dependenciesNumber/dependenciesLog2.generated.js"); +var _dependenciesMadGenerated = require("./dependenciesNumber/dependenciesMad.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesNumber/dependenciesMap.generated.js"); +var _dependenciesMapTransformGenerated = require("./dependenciesNumber/dependenciesMapTransform.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesNumber/dependenciesMatrix.generated.js"); +var _dependenciesMaxGenerated = require("./dependenciesNumber/dependenciesMax.generated.js"); +var _dependenciesMaxTransformGenerated = require("./dependenciesNumber/dependenciesMaxTransform.generated.js"); +var _dependenciesMeanGenerated = require("./dependenciesNumber/dependenciesMean.generated.js"); +var _dependenciesMeanTransformGenerated = require("./dependenciesNumber/dependenciesMeanTransform.generated.js"); +var _dependenciesMedianGenerated = require("./dependenciesNumber/dependenciesMedian.generated.js"); +var _dependenciesMinGenerated = require("./dependenciesNumber/dependenciesMin.generated.js"); +var _dependenciesMinTransformGenerated = require("./dependenciesNumber/dependenciesMinTransform.generated.js"); +var _dependenciesModGenerated = require("./dependenciesNumber/dependenciesMod.generated.js"); +var _dependenciesModeGenerated = require("./dependenciesNumber/dependenciesMode.generated.js"); +var _dependenciesMultinomialGenerated = require("./dependenciesNumber/dependenciesMultinomial.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesNumber/dependenciesMultiply.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesNumber/dependenciesMultiplyScalar.generated.js"); +var _dependenciesNaNGenerated = require("./dependenciesNumber/dependenciesNaN.generated.js"); +var _dependenciesNodeGenerated = require("./dependenciesNumber/dependenciesNode.generated.js"); +var _dependenciesNormGenerated = require("./dependenciesNumber/dependenciesNorm.generated.js"); +var _dependenciesNotGenerated = require("./dependenciesNumber/dependenciesNot.generated.js"); +var _dependenciesNthRootGenerated = require("./dependenciesNumber/dependenciesNthRoot.generated.js"); +var _dependenciesNullGenerated = require("./dependenciesNumber/dependenciesNull.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber/dependenciesNumber.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumber/dependenciesNumeric.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesNumber/dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesNumber/dependenciesOperatorNode.generated.js"); +var _dependenciesOrGenerated = require("./dependenciesNumber/dependenciesOr.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesNumber/dependenciesParenthesisNode.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesNumber/dependenciesParse.generated.js"); +var _dependenciesParserGenerated = require("./dependenciesNumber/dependenciesParser.generated.js"); +var _dependenciesParserClassGenerated = require("./dependenciesNumber/dependenciesParserClass.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesNumber/dependenciesPartitionSelect.generated.js"); +var _dependenciesPermutationsGenerated = require("./dependenciesNumber/dependenciesPermutations.generated.js"); +var _dependenciesPhiGenerated = require("./dependenciesNumber/dependenciesPhi.generated.js"); +var _dependenciesPiGenerated = require("./dependenciesNumber/dependenciesPi.generated.js"); +var _dependenciesPickRandomGenerated = require("./dependenciesNumber/dependenciesPickRandom.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesNumber/dependenciesPow.generated.js"); +var _dependenciesPrintGenerated = require("./dependenciesNumber/dependenciesPrint.generated.js"); +var _dependenciesProdGenerated = require("./dependenciesNumber/dependenciesProd.generated.js"); +var _dependenciesQuantileSeqGenerated = require("./dependenciesNumber/dependenciesQuantileSeq.generated.js"); +var _dependenciesRandomGenerated = require("./dependenciesNumber/dependenciesRandom.generated.js"); +var _dependenciesRandomIntGenerated = require("./dependenciesNumber/dependenciesRandomInt.generated.js"); +var _dependenciesRangeGenerated = require("./dependenciesNumber/dependenciesRange.generated.js"); +var _dependenciesRangeClassGenerated = require("./dependenciesNumber/dependenciesRangeClass.generated.js"); +var _dependenciesRangeNodeGenerated = require("./dependenciesNumber/dependenciesRangeNode.generated.js"); +var _dependenciesRangeTransformGenerated = require("./dependenciesNumber/dependenciesRangeTransform.generated.js"); +var _dependenciesRationalizeGenerated = require("./dependenciesNumber/dependenciesRationalize.generated.js"); +var _dependenciesRelationalNodeGenerated = require("./dependenciesNumber/dependenciesRelationalNode.generated.js"); +var _dependenciesReplacerGenerated = require("./dependenciesNumber/dependenciesReplacer.generated.js"); +var _dependenciesResolveGenerated = require("./dependenciesNumber/dependenciesResolve.generated.js"); +var _dependenciesResultSetGenerated = require("./dependenciesNumber/dependenciesResultSet.generated.js"); +var _dependenciesReviverGenerated = require("./dependenciesNumber/dependenciesReviver.generated.js"); +var _dependenciesRightArithShiftGenerated = require("./dependenciesNumber/dependenciesRightArithShift.generated.js"); +var _dependenciesRightLogShiftGenerated = require("./dependenciesNumber/dependenciesRightLogShift.generated.js"); +var _dependenciesRoundGenerated = require("./dependenciesNumber/dependenciesRound.generated.js"); +var _dependenciesSQRT1_2Generated = require("./dependenciesNumber/dependenciesSQRT1_2.generated.js"); +var _dependenciesSQRT2Generated = require("./dependenciesNumber/dependenciesSQRT2.generated.js"); +var _dependenciesSecGenerated = require("./dependenciesNumber/dependenciesSec.generated.js"); +var _dependenciesSechGenerated = require("./dependenciesNumber/dependenciesSech.generated.js"); +var _dependenciesSignGenerated = require("./dependenciesNumber/dependenciesSign.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesNumber/dependenciesSimplify.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesNumber/dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesNumber/dependenciesSimplifyCore.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesNumber/dependenciesSin.generated.js"); +var _dependenciesSinhGenerated = require("./dependenciesNumber/dependenciesSinh.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesNumber/dependenciesSize.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesNumber/dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesNumber/dependenciesSmallerEq.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesNumber/dependenciesSqrt.generated.js"); +var _dependenciesSquareGenerated = require("./dependenciesNumber/dependenciesSquare.generated.js"); +var _dependenciesStdGenerated = require("./dependenciesNumber/dependenciesStd.generated.js"); +var _dependenciesStdTransformGenerated = require("./dependenciesNumber/dependenciesStdTransform.generated.js"); +var _dependenciesStirlingS2Generated = require("./dependenciesNumber/dependenciesStirlingS2.generated.js"); +var _dependenciesStringGenerated = require("./dependenciesNumber/dependenciesString.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesNumber/dependenciesSubset.generated.js"); +var _dependenciesSubsetTransformGenerated = require("./dependenciesNumber/dependenciesSubsetTransform.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesNumber/dependenciesSubtract.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesNumber/dependenciesSubtractScalar.generated.js"); +var _dependenciesSumGenerated = require("./dependenciesNumber/dependenciesSum.generated.js"); +var _dependenciesSumTransformGenerated = require("./dependenciesNumber/dependenciesSumTransform.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesNumber/dependenciesSymbolNode.generated.js"); +var _dependenciesTanGenerated = require("./dependenciesNumber/dependenciesTan.generated.js"); +var _dependenciesTanhGenerated = require("./dependenciesNumber/dependenciesTanh.generated.js"); +var _dependenciesTauGenerated = require("./dependenciesNumber/dependenciesTau.generated.js"); +var _dependenciesTrueGenerated = require("./dependenciesNumber/dependenciesTrue.generated.js"); +var _dependenciesTypeOfGenerated = require("./dependenciesNumber/dependenciesTypeOf.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesNumber/dependenciesTyped.generated.js"); +var _dependenciesUnaryMinusGenerated = require("./dependenciesNumber/dependenciesUnaryMinus.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesNumber/dependenciesUnaryPlus.generated.js"); +var _dependenciesUnequalGenerated = require("./dependenciesNumber/dependenciesUnequal.generated.js"); +var _dependenciesUppercaseEGenerated = require("./dependenciesNumber/dependenciesUppercaseE.generated.js"); +var _dependenciesUppercasePiGenerated = require("./dependenciesNumber/dependenciesUppercasePi.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesNumber/dependenciesVariance.generated.js"); +var _dependenciesVarianceTransformGenerated = require("./dependenciesNumber/dependenciesVarianceTransform.generated.js"); +var _dependenciesVersionGenerated = require("./dependenciesNumber/dependenciesVersion.generated.js"); +var _dependenciesXgcdGenerated = require("./dependenciesNumber/dependenciesXgcd.generated.js"); +var _dependenciesXorGenerated = require("./dependenciesNumber/dependenciesXor.generated.js"); +var _dependenciesZetaGenerated = require("./dependenciesNumber/dependenciesZeta.generated.js"); +var _allFactoriesNumber = require("./allFactoriesNumber.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js new file mode 100644 index 0000000..e9485c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.absDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const absDependencies = exports.absDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAbs: _factoriesNumber.createAbs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js new file mode 100644 index 0000000..1e76b37 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AccessorNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const AccessorNodeDependencies = exports.AccessorNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + createAccessorNode: _factoriesNumber.createAccessorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js new file mode 100644 index 0000000..ba76716 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acosDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acosDependencies = exports.acosDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcos: _factoriesNumber.createAcos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js new file mode 100644 index 0000000..6d65aa0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acoshDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acoshDependencies = exports.acoshDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcosh: _factoriesNumber.createAcosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js new file mode 100644 index 0000000..fa77128 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acotDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acotDependencies = exports.acotDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcot: _factoriesNumber.createAcot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js new file mode 100644 index 0000000..26e4d33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acothDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acothDependencies = exports.acothDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcoth: _factoriesNumber.createAcoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js new file mode 100644 index 0000000..97a796a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acscDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acscDependencies = exports.acscDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcsc: _factoriesNumber.createAcsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js new file mode 100644 index 0000000..a732848 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acschDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const acschDependencies = exports.acschDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAcsch: _factoriesNumber.createAcsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js new file mode 100644 index 0000000..0e292c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const addDependencies = exports.addDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAdd: _factoriesNumber.createAdd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js new file mode 100644 index 0000000..51789ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const addScalarDependencies = exports.addScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAddScalar: _factoriesNumber.createAddScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js new file mode 100644 index 0000000..20f1fe3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.andDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const andDependencies = exports.andDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAnd: _factoriesNumber.createAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApply.generated.js new file mode 100644 index 0000000..d742831 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApply.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.applyDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const applyDependencies = exports.applyDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createApply: _factoriesNumber.createApply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApplyTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApplyTransform.generated.js new file mode 100644 index 0000000..424126c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesApplyTransform.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.applyTransformDependencies = void 0; +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const applyTransformDependencies = exports.applyTransformDependencies = { + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createApplyTransform: _factoriesNumber.createApplyTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js new file mode 100644 index 0000000..dc59bef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArrayNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ArrayNodeDependencies = exports.ArrayNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createArrayNode: _factoriesNumber.createArrayNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js new file mode 100644 index 0000000..57e34a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asecDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asecDependencies = exports.asecDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsec: _factoriesNumber.createAsec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js new file mode 100644 index 0000000..8723bb2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asechDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asechDependencies = exports.asechDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsech: _factoriesNumber.createAsech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js new file mode 100644 index 0000000..743cf4f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asinDependencies = exports.asinDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsin: _factoriesNumber.createAsin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js new file mode 100644 index 0000000..9a7c1bf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const asinhDependencies = exports.asinhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAsinh: _factoriesNumber.createAsinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js new file mode 100644 index 0000000..db3c7f4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AssignmentNodeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSubsetGenerated = require("./dependenciesSubset.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const AssignmentNodeDependencies = exports.AssignmentNodeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, + createAssignmentNode: _factoriesNumber.createAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js new file mode 100644 index 0000000..74f6f0b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atanDependencies = exports.atanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtan: _factoriesNumber.createAtan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js new file mode 100644 index 0000000..fe4d438 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atan2Dependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atan2Dependencies = exports.atan2Dependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtan2: _factoriesNumber.createAtan2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js new file mode 100644 index 0000000..6f67c96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const atanhDependencies = exports.atanhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createAtanh: _factoriesNumber.createAtanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js new file mode 100644 index 0000000..84a4ab6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bellNumbersDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesStirlingS2Generated = require("./dependenciesStirlingS2.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bellNumbersDependencies = exports.bellNumbersDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + stirlingS2Dependencies: _dependenciesStirlingS2Generated.stirlingS2Dependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBellNumbers: _factoriesNumber.createBellNumbers +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js new file mode 100644 index 0000000..711e272 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bigintDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bigintDependencies = exports.bigintDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBigint: _factoriesNumber.createBigint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js new file mode 100644 index 0000000..1d8fb1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitAndDependencies = exports.bitAndDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitAnd: _factoriesNumber.createBitAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js new file mode 100644 index 0000000..cb2d71e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitNotDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitNotDependencies = exports.bitNotDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitNot: _factoriesNumber.createBitNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js new file mode 100644 index 0000000..6ce8e6e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitOrDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitOrDependencies = exports.bitOrDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitOr: _factoriesNumber.createBitOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js new file mode 100644 index 0000000..d1b6408 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitXorDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const bitXorDependencies = exports.bitXorDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBitXor: _factoriesNumber.createBitXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js new file mode 100644 index 0000000..aafced2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BlockNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesResultSetGenerated = require("./dependenciesResultSet.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const BlockNodeDependencies = exports.BlockNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + ResultSetDependencies: _dependenciesResultSetGenerated.ResultSetDependencies, + createBlockNode: _factoriesNumber.createBlockNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js new file mode 100644 index 0000000..7f19df9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.booleanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const booleanDependencies = exports.booleanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createBoolean: _factoriesNumber.createBoolean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js new file mode 100644 index 0000000..cc1737d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.catalanDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const catalanDependencies = exports.catalanDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCatalan: _factoriesNumber.createCatalan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js new file mode 100644 index 0000000..7f34821 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cbrtDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cbrtDependencies = exports.cbrtDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCbrt: _factoriesNumber.createCbrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js new file mode 100644 index 0000000..5a99231 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ceilDependencies = void 0; +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ceilDependencies = exports.ceilDependencies = { + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCeil: _factoriesNumber.createCeil +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js new file mode 100644 index 0000000..e4fcb16 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.chainDependencies = void 0; +var _dependenciesChainClassGenerated = require("./dependenciesChainClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const chainDependencies = exports.chainDependencies = { + ChainDependencies: _dependenciesChainClassGenerated.ChainDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createChain: _factoriesNumber.createChain +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js new file mode 100644 index 0000000..099a462 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ChainDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ChainDependencies = exports.ChainDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createChainClass: _factoriesNumber.createChainClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js new file mode 100644 index 0000000..d635205 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cloneDependencies = exports.cloneDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createClone: _factoriesNumber.createClone +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js new file mode 100644 index 0000000..54f291b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const combinationsDependencies = exports.combinationsDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCombinations: _factoriesNumber.createCombinations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js new file mode 100644 index 0000000..3ab0e01 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsWithRepDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const combinationsWithRepDependencies = exports.combinationsWithRepDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCombinationsWithRep: _factoriesNumber.createCombinationsWithRep +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js new file mode 100644 index 0000000..a2ef64a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareDependencies = exports.compareDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompare: _factoriesNumber.createCompare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js new file mode 100644 index 0000000..79b56c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareNaturalDependencies = void 0; +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareNaturalDependencies = exports.compareNaturalDependencies = { + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompareNatural: _factoriesNumber.createCompareNatural +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js new file mode 100644 index 0000000..10831d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareTextDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compareTextDependencies = exports.compareTextDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompareText: _factoriesNumber.createCompareText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js new file mode 100644 index 0000000..e05ece3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compileDependencies = void 0; +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compileDependencies = exports.compileDependencies = { + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCompile: _factoriesNumber.createCompile +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js new file mode 100644 index 0000000..86fa60b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compositionDependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const compositionDependencies = exports.compositionDependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createComposition: _factoriesNumber.createComposition +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js new file mode 100644 index 0000000..3717bf3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConditionalNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ConditionalNodeDependencies = exports.ConditionalNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createConditionalNode: _factoriesNumber.createConditionalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js new file mode 100644 index 0000000..a6121e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConstantNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ConstantNodeDependencies = exports.ConstantNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createConstantNode: _factoriesNumber.createConstantNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js new file mode 100644 index 0000000..0406748 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.corrDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMeanGenerated = require("./dependenciesMean.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesSumGenerated = require("./dependenciesSum.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const corrDependencies = exports.corrDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + meanDependencies: _dependenciesMeanGenerated.meanDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + sumDependencies: _dependenciesSumGenerated.sumDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCorr: _factoriesNumber.createCorr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js new file mode 100644 index 0000000..7a1c466 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cosDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cosDependencies = exports.cosDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCos: _factoriesNumber.createCos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js new file mode 100644 index 0000000..afb0b87 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.coshDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const coshDependencies = exports.coshDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCosh: _factoriesNumber.createCosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js new file mode 100644 index 0000000..8e2c524 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cotDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cotDependencies = exports.cotDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCot: _factoriesNumber.createCot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js new file mode 100644 index 0000000..f5eb7b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cothDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cothDependencies = exports.cothDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCoth: _factoriesNumber.createCoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js new file mode 100644 index 0000000..181723c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cscDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cscDependencies = exports.cscDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCsc: _factoriesNumber.createCsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js new file mode 100644 index 0000000..e4ea771 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cschDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cschDependencies = exports.cschDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCsch: _factoriesNumber.createCsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js new file mode 100644 index 0000000..6735e1b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cubeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cubeDependencies = exports.cubeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createCube: _factoriesNumber.createCube +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js new file mode 100644 index 0000000..63e1596 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cumsumDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesUnaryPlus.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cumsumDependencies = exports.cumsumDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryPlusDependencies: _dependenciesUnaryPlusGenerated.unaryPlusDependencies, + createCumSum: _factoriesNumber.createCumSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js new file mode 100644 index 0000000..5ab2c2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cumsumTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesUnaryPlusGenerated = require("./dependenciesUnaryPlus.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const cumsumTransformDependencies = exports.cumsumTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + unaryPlusDependencies: _dependenciesUnaryPlusGenerated.unaryPlusDependencies, + createCumSumTransform: _factoriesNumber.createCumSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js new file mode 100644 index 0000000..dc54e9c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deepEqualDependencies = void 0; +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const deepEqualDependencies = exports.deepEqualDependencies = { + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDeepEqual: _factoriesNumber.createDeepEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js new file mode 100644 index 0000000..cf41d1f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.derivativeDependencies = void 0; +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesSimplify.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const derivativeDependencies = exports.derivativeDependencies = { + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDerivative: _factoriesNumber.createDerivative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js new file mode 100644 index 0000000..346757e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.divideDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const divideDependencies = exports.divideDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDivide: _factoriesNumber.createDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js new file mode 100644 index 0000000..64dfeb4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.divideScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const divideScalarDependencies = exports.divideScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createDivideScalar: _factoriesNumber.createDivideScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js new file mode 100644 index 0000000..cecc000 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.eDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const eDependencies = exports.eDependencies = { + createE: _factoriesNumber.createE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js new file mode 100644 index 0000000..a59e816 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalDependencies = void 0; +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalDependencies = exports.equalDependencies = { + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqual: _factoriesNumber.createEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js new file mode 100644 index 0000000..a691430 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalScalarDependencies = exports.equalScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqualScalar: _factoriesNumber.createEqualScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js new file mode 100644 index 0000000..220c175 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalTextDependencies = void 0; +var _dependenciesCompareTextGenerated = require("./dependenciesCompareText.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const equalTextDependencies = exports.equalTextDependencies = { + compareTextDependencies: _dependenciesCompareTextGenerated.compareTextDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEqualText: _factoriesNumber.createEqualText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js new file mode 100644 index 0000000..7daf4fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.erfDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const erfDependencies = exports.erfDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createErf: _factoriesNumber.createErf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js new file mode 100644 index 0000000..7f62901 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.evaluateDependencies = void 0; +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const evaluateDependencies = exports.evaluateDependencies = { + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createEvaluate: _factoriesNumber.createEvaluate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js new file mode 100644 index 0000000..1f6a507 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const expDependencies = exports.expDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createExp: _factoriesNumber.createExp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js new file mode 100644 index 0000000..04cf1c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expm1Dependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const expm1Dependencies = exports.expm1Dependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createExpm1: _factoriesNumber.createExpm1 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js new file mode 100644 index 0000000..b610553 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.factorialDependencies = void 0; +var _dependenciesGammaGenerated = require("./dependenciesGamma.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const factorialDependencies = exports.factorialDependencies = { + gammaDependencies: _dependenciesGammaGenerated.gammaDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFactorial: _factoriesNumber.createFactorial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js new file mode 100644 index 0000000..67e166e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.falseDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const falseDependencies = exports.falseDependencies = { + createFalse: _factoriesNumber.createFalse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js new file mode 100644 index 0000000..141e4f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.filterDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const filterDependencies = exports.filterDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFilter: _factoriesNumber.createFilter +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js new file mode 100644 index 0000000..9fe1a59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.filterTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const filterTransformDependencies = exports.filterTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFilterTransform: _factoriesNumber.createFilterTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js new file mode 100644 index 0000000..f4f5c96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fixDependencies = void 0; +var _dependenciesCeilGenerated = require("./dependenciesCeil.generated.js"); +var _dependenciesFloorGenerated = require("./dependenciesFloor.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const fixDependencies = exports.fixDependencies = { + ceilDependencies: _dependenciesCeilGenerated.ceilDependencies, + floorDependencies: _dependenciesFloorGenerated.floorDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFix: _factoriesNumber.createFix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js new file mode 100644 index 0000000..582d328 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.floorDependencies = void 0; +var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const floorDependencies = exports.floorDependencies = { + roundDependencies: _dependenciesRoundGenerated.roundDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFloor: _factoriesNumber.createFloor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js new file mode 100644 index 0000000..81936d0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forEachDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const forEachDependencies = exports.forEachDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createForEach: _factoriesNumber.createForEach +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js new file mode 100644 index 0000000..2aa784a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forEachTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const forEachTransformDependencies = exports.forEachTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createForEachTransform: _factoriesNumber.createForEachTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js new file mode 100644 index 0000000..0479849 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const formatDependencies = exports.formatDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFormat: _factoriesNumber.createFormat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js new file mode 100644 index 0000000..218e5fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FunctionAssignmentNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FunctionAssignmentNodeDependencies = exports.FunctionAssignmentNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createFunctionAssignmentNode: _factoriesNumber.createFunctionAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js new file mode 100644 index 0000000..62c3d4d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FunctionNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const FunctionNodeDependencies = exports.FunctionNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + createFunctionNode: _factoriesNumber.createFunctionNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js new file mode 100644 index 0000000..b27dc79 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gammaDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gammaDependencies = exports.gammaDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createGamma: _factoriesNumber.createGamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js new file mode 100644 index 0000000..d797983 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gcdDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const gcdDependencies = exports.gcdDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createGcd: _factoriesNumber.createGcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js new file mode 100644 index 0000000..44acb49 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasNumericValueDependencies = void 0; +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hasNumericValueDependencies = exports.hasNumericValueDependencies = { + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHasNumericValue: _factoriesNumber.createHasNumericValue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js new file mode 100644 index 0000000..64af532 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.helpDependencies = void 0; +var _dependenciesHelpClassGenerated = require("./dependenciesHelpClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const helpDependencies = exports.helpDependencies = { + HelpDependencies: _dependenciesHelpClassGenerated.HelpDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHelp: _factoriesNumber.createHelp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js new file mode 100644 index 0000000..6253896 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.HelpDependencies = void 0; +var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const HelpDependencies = exports.HelpDependencies = { + evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, + createHelpClass: _factoriesNumber.createHelpClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js new file mode 100644 index 0000000..fb7e015 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hypotDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const hypotDependencies = exports.hypotDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createHypot: _factoriesNumber.createHypot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js new file mode 100644 index 0000000..72b8bc7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.indexDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const indexDependencies = exports.indexDependencies = { + createIndex: _factoriesNumber.createIndex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js new file mode 100644 index 0000000..c2c40f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndexNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const IndexNodeDependencies = exports.IndexNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, + createIndexNode: _factoriesNumber.createIndexNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js new file mode 100644 index 0000000..1196315 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.InfinityDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const InfinityDependencies = exports.InfinityDependencies = { + createInfinity: _factoriesNumber.createInfinity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js new file mode 100644 index 0000000..2450b89 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIntegerDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isIntegerDependencies = exports.isIntegerDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsInteger: _factoriesNumber.createIsInteger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js new file mode 100644 index 0000000..ae67c93 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNaNDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNaNDependencies = exports.isNaNDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNaN: _factoriesNumber.createIsNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js new file mode 100644 index 0000000..e6772f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNegativeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNegativeDependencies = exports.isNegativeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNegative: _factoriesNumber.createIsNegative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js new file mode 100644 index 0000000..6c7f4c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNumericDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isNumericDependencies = exports.isNumericDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsNumeric: _factoriesNumber.createIsNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js new file mode 100644 index 0000000..1e8cedd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPositiveDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isPositiveDependencies = exports.isPositiveDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsPositive: _factoriesNumber.createIsPositive +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js new file mode 100644 index 0000000..45bdf5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPrimeDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isPrimeDependencies = exports.isPrimeDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsPrime: _factoriesNumber.createIsPrime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js new file mode 100644 index 0000000..a760963 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isZeroDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const isZeroDependencies = exports.isZeroDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createIsZero: _factoriesNumber.createIsZero +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js new file mode 100644 index 0000000..9b1512c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN10Dependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LN10Dependencies = exports.LN10Dependencies = { + createLN10: _factoriesNumber.createLN10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js new file mode 100644 index 0000000..483a4dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN2Dependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LN2Dependencies = exports.LN2Dependencies = { + createLN2: _factoriesNumber.createLN2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js new file mode 100644 index 0000000..e86e5c4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG10EDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LOG10EDependencies = exports.LOG10EDependencies = { + createLOG10E: _factoriesNumber.createLOG10E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js new file mode 100644 index 0000000..abf38ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG2EDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const LOG2EDependencies = exports.LOG2EDependencies = { + createLOG2E: _factoriesNumber.createLOG2E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js new file mode 100644 index 0000000..02c305b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const largerDependencies = exports.largerDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLarger: _factoriesNumber.createLarger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js new file mode 100644 index 0000000..f6a60a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerEqDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const largerEqDependencies = exports.largerEqDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLargerEq: _factoriesNumber.createLargerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js new file mode 100644 index 0000000..3b1cd75 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lcmDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lcmDependencies = exports.lcmDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLcm: _factoriesNumber.createLcm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js new file mode 100644 index 0000000..64bb0d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.leftShiftDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const leftShiftDependencies = exports.leftShiftDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLeftShift: _factoriesNumber.createLeftShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js new file mode 100644 index 0000000..8afdc01 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lgammaDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const lgammaDependencies = exports.lgammaDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLgamma: _factoriesNumber.createLgamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js new file mode 100644 index 0000000..57d9550 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.logDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const logDependencies = exports.logDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog: _factoriesNumber.createLog +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js new file mode 100644 index 0000000..edfb462 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log10Dependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log10Dependencies = exports.log10Dependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog10: _factoriesNumber.createLog10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js new file mode 100644 index 0000000..45acff9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log1pDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log1pDependencies = exports.log1pDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog1p: _factoriesNumber.createLog1p +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js new file mode 100644 index 0000000..d80d6ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log2Dependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const log2Dependencies = exports.log2Dependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createLog2: _factoriesNumber.createLog2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js new file mode 100644 index 0000000..9eb37a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.madDependencies = void 0; +var _dependenciesAbsGenerated = require("./dependenciesAbs.generated.js"); +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesMedianGenerated = require("./dependenciesMedian.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const madDependencies = exports.madDependencies = { + absDependencies: _dependenciesAbsGenerated.absDependencies, + mapDependencies: _dependenciesMapGenerated.mapDependencies, + medianDependencies: _dependenciesMedianGenerated.medianDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMad: _factoriesNumber.createMad +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js new file mode 100644 index 0000000..504764d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mapDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const mapDependencies = exports.mapDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMap: _factoriesNumber.createMap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js new file mode 100644 index 0000000..cc42590 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mapTransformDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const mapTransformDependencies = exports.mapTransformDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMapTransform: _factoriesNumber.createMapTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js new file mode 100644 index 0000000..21bcd3c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const matrixDependencies = exports.matrixDependencies = { + createMatrix: _factoriesNumber.createMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js new file mode 100644 index 0000000..358aae2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maxDependencies = void 0; +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const maxDependencies = exports.maxDependencies = { + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMax: _factoriesNumber.createMax +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js new file mode 100644 index 0000000..154d6b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maxTransformDependencies = void 0; +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const maxTransformDependencies = exports.maxTransformDependencies = { + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMaxTransform: _factoriesNumber.createMaxTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js new file mode 100644 index 0000000..4d8c88d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.meanDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const meanDependencies = exports.meanDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMean: _factoriesNumber.createMean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js new file mode 100644 index 0000000..f2fa8f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.meanTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const meanTransformDependencies = exports.meanTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMeanTransform: _factoriesNumber.createMeanTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js new file mode 100644 index 0000000..c1cbb1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.medianDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesPartitionSelect.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const medianDependencies = exports.medianDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMedian: _factoriesNumber.createMedian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js new file mode 100644 index 0000000..0b28234 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.minDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const minDependencies = exports.minDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMin: _factoriesNumber.createMin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js new file mode 100644 index 0000000..340c8ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.minTransformDependencies = void 0; +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const minTransformDependencies = exports.minTransformDependencies = { + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMinTransform: _factoriesNumber.createMinTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js new file mode 100644 index 0000000..ac9ffa6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const modDependencies = exports.modDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMod: _factoriesNumber.createMod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js new file mode 100644 index 0000000..6c66983 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modeDependencies = void 0; +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const modeDependencies = exports.modeDependencies = { + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMode: _factoriesNumber.createMode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js new file mode 100644 index 0000000..17b6f75 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multinomialDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multinomialDependencies = exports.multinomialDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultinomial: _factoriesNumber.createMultinomial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js new file mode 100644 index 0000000..b7c2937 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multiplyDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multiplyDependencies = exports.multiplyDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultiply: _factoriesNumber.createMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js new file mode 100644 index 0000000..0501d3d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multiplyScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const multiplyScalarDependencies = exports.multiplyScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createMultiplyScalar: _factoriesNumber.createMultiplyScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js new file mode 100644 index 0000000..afdf6ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NaNDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const NaNDependencies = exports.NaNDependencies = { + createNaN: _factoriesNumber.createNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js new file mode 100644 index 0000000..74cf58f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NodeDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const NodeDependencies = exports.NodeDependencies = { + createNode: _factoriesNumber.createNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js new file mode 100644 index 0000000..9993c89 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const normDependencies = exports.normDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNorm: _factoriesNumber.createNorm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js new file mode 100644 index 0000000..c48e858 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.notDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const notDependencies = exports.notDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNot: _factoriesNumber.createNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js new file mode 100644 index 0000000..221da34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nthRootDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nthRootDependencies = exports.nthRootDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNthRoot: _factoriesNumber.createNthRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js new file mode 100644 index 0000000..6a72e3c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nullDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const nullDependencies = exports.nullDependencies = { + createNull: _factoriesNumber.createNull +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js new file mode 100644 index 0000000..e9e7af2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numberDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const numberDependencies = exports.numberDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createNumber: _factoriesNumber.createNumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js new file mode 100644 index 0000000..7b20e94 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numericDependencies = void 0; +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const numericDependencies = exports.numericDependencies = { + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + createNumeric: _factoriesNumber.createNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js new file mode 100644 index 0000000..e7da029 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ObjectNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ObjectNodeDependencies = exports.ObjectNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createObjectNode: _factoriesNumber.createObjectNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js new file mode 100644 index 0000000..274dd46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OperatorNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const OperatorNodeDependencies = exports.OperatorNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createOperatorNode: _factoriesNumber.createOperatorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js new file mode 100644 index 0000000..36be79c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.orDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const orDependencies = exports.orDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createOr: _factoriesNumber.createOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js new file mode 100644 index 0000000..f4695b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ParenthesisNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ParenthesisNodeDependencies = exports.ParenthesisNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createParenthesisNode: _factoriesNumber.createParenthesisNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js new file mode 100644 index 0000000..15c9ff8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesAssignmentNodeGenerated = require("./dependenciesAssignmentNode.generated.js"); +var _dependenciesBlockNodeGenerated = require("./dependenciesBlockNode.generated.js"); +var _dependenciesConditionalNodeGenerated = require("./dependenciesConditionalNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionAssignmentNodeGenerated = require("./dependenciesFunctionAssignmentNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesRangeNodeGenerated = require("./dependenciesRangeNode.generated.js"); +var _dependenciesRelationalNodeGenerated = require("./dependenciesRelationalNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const parseDependencies = exports.parseDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + AssignmentNodeDependencies: _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies, + BlockNodeDependencies: _dependenciesBlockNodeGenerated.BlockNodeDependencies, + ConditionalNodeDependencies: _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionAssignmentNodeDependencies: _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + RangeNodeDependencies: _dependenciesRangeNodeGenerated.RangeNodeDependencies, + RelationalNodeDependencies: _dependenciesRelationalNodeGenerated.RelationalNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createParse: _factoriesNumber.createParse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js new file mode 100644 index 0000000..98aa7b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parserDependencies = void 0; +var _dependenciesParserClassGenerated = require("./dependenciesParserClass.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const parserDependencies = exports.parserDependencies = { + ParserDependencies: _dependenciesParserClassGenerated.ParserDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createParser: _factoriesNumber.createParser +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js new file mode 100644 index 0000000..5266912 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ParserDependencies = void 0; +var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ParserDependencies = exports.ParserDependencies = { + evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, + createParserClass: _factoriesNumber.createParserClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js new file mode 100644 index 0000000..2d7cfd3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.partitionSelectDependencies = void 0; +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesIsNumericGenerated = require("./dependenciesIsNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const partitionSelectDependencies = exports.partitionSelectDependencies = { + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPartitionSelect: _factoriesNumber.createPartitionSelect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js new file mode 100644 index 0000000..2c1fac4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.permutationsDependencies = void 0; +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const permutationsDependencies = exports.permutationsDependencies = { + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPermutations: _factoriesNumber.createPermutations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js new file mode 100644 index 0000000..3c1e7d2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.phiDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const phiDependencies = exports.phiDependencies = { + createPhi: _factoriesNumber.createPhi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js new file mode 100644 index 0000000..cc98a69 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.piDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const piDependencies = exports.piDependencies = { + createPi: _factoriesNumber.createPi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js new file mode 100644 index 0000000..667e87c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pickRandomDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const pickRandomDependencies = exports.pickRandomDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPickRandom: _factoriesNumber.createPickRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js new file mode 100644 index 0000000..6a173d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.powDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const powDependencies = exports.powDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPow: _factoriesNumber.createPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js new file mode 100644 index 0000000..b0916fd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const printDependencies = exports.printDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createPrint: _factoriesNumber.createPrint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js new file mode 100644 index 0000000..4cab317 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.prodDependencies = void 0; +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const prodDependencies = exports.prodDependencies = { + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createProd: _factoriesNumber.createProd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js new file mode 100644 index 0000000..a12bee6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.quantileSeqDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesCompareGenerated = require("./dependenciesCompare.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPartitionSelectGenerated = require("./dependenciesPartitionSelect.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const quantileSeqDependencies = exports.quantileSeqDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + compareDependencies: _dependenciesCompareGenerated.compareDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createQuantileSeq: _factoriesNumber.createQuantileSeq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js new file mode 100644 index 0000000..e90d8d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const randomDependencies = exports.randomDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRandom: _factoriesNumber.createRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js new file mode 100644 index 0000000..01cccb4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomIntDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const randomIntDependencies = exports.randomIntDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRandomInt: _factoriesNumber.createRandomInt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js new file mode 100644 index 0000000..9ce7eb1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rangeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesLargerEq.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rangeDependencies = exports.rangeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRange: _factoriesNumber.createRange +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js new file mode 100644 index 0000000..4dd2681 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RangeDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RangeDependencies = exports.RangeDependencies = { + createRangeClass: _factoriesNumber.createRangeClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js new file mode 100644 index 0000000..dcdce30 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RangeNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RangeNodeDependencies = exports.RangeNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createRangeNode: _factoriesNumber.createRangeNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js new file mode 100644 index 0000000..43743f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rangeTransformDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesLargerEqGenerated = require("./dependenciesLargerEq.generated.js"); +var _dependenciesSmallerGenerated = require("./dependenciesSmaller.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rangeTransformDependencies = exports.rangeTransformDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, + smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRangeTransform: _factoriesNumber.createRangeTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js new file mode 100644 index 0000000..56eb3aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rationalizeDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSimplifyGenerated = require("./dependenciesSimplify.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rationalizeDependencies = exports.rationalizeDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, + simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, + simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRationalize: _factoriesNumber.createRationalize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js new file mode 100644 index 0000000..729e180 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RelationalNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const RelationalNodeDependencies = exports.RelationalNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createRelationalNode: _factoriesNumber.createRelationalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js new file mode 100644 index 0000000..c091ba7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.replacerDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const replacerDependencies = exports.replacerDependencies = { + createReplacer: _factoriesNumber.createReplacer +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js new file mode 100644 index 0000000..6f4fd77 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolveDependencies = void 0; +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const resolveDependencies = exports.resolveDependencies = { + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createResolve: _factoriesNumber.createResolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js new file mode 100644 index 0000000..9e97ede --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ResultSetDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const ResultSetDependencies = exports.ResultSetDependencies = { + createResultSet: _factoriesNumber.createResultSet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js new file mode 100644 index 0000000..c94c35b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reviverDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const reviverDependencies = exports.reviverDependencies = { + createReviver: _factoriesNumber.createReviver +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js new file mode 100644 index 0000000..9dcd16e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightArithShiftDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rightArithShiftDependencies = exports.rightArithShiftDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRightArithShift: _factoriesNumber.createRightArithShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js new file mode 100644 index 0000000..a95962b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightLogShiftDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const rightLogShiftDependencies = exports.rightLogShiftDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRightLogShift: _factoriesNumber.createRightLogShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js new file mode 100644 index 0000000..497ae98 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.roundDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const roundDependencies = exports.roundDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createRound: _factoriesNumber.createRound +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js new file mode 100644 index 0000000..129a7ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT1_2Dependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +// eslint-disable-line camelcase + +const SQRT1_2Dependencies = exports.SQRT1_2Dependencies = { + // eslint-disable-line camelcase + createSQRT1_2: _factoriesNumber.createSQRT1_2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js new file mode 100644 index 0000000..a252e5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT2Dependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SQRT2Dependencies = exports.SQRT2Dependencies = { + createSQRT2: _factoriesNumber.createSQRT2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js new file mode 100644 index 0000000..b616955 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.secDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const secDependencies = exports.secDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSec: _factoriesNumber.createSec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js new file mode 100644 index 0000000..dcec568 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sechDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sechDependencies = exports.sechDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSech: _factoriesNumber.createSech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js new file mode 100644 index 0000000..e0a485d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.signDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const signDependencies = exports.signDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSign: _factoriesNumber.createSign +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js new file mode 100644 index 0000000..58a326b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesResolveGenerated = require("./dependenciesResolve.generated.js"); +var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); +var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyDependencies = exports.simplifyDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + resolveDependencies: _dependenciesResolveGenerated.resolveDependencies, + simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, + simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplify: _factoriesNumber.createSimplify +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js new file mode 100644 index 0000000..a2c8b51 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyConstantDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyConstantDependencies = exports.simplifyConstantDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplifyConstant: _factoriesNumber.createSimplifyConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js new file mode 100644 index 0000000..da13883 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyCoreDependencies = void 0; +var _dependenciesAccessorNodeGenerated = require("./dependenciesAccessorNode.generated.js"); +var _dependenciesArrayNodeGenerated = require("./dependenciesArrayNode.generated.js"); +var _dependenciesConstantNodeGenerated = require("./dependenciesConstantNode.generated.js"); +var _dependenciesFunctionNodeGenerated = require("./dependenciesFunctionNode.generated.js"); +var _dependenciesIndexNodeGenerated = require("./dependenciesIndexNode.generated.js"); +var _dependenciesObjectNodeGenerated = require("./dependenciesObjectNode.generated.js"); +var _dependenciesOperatorNodeGenerated = require("./dependenciesOperatorNode.generated.js"); +var _dependenciesParenthesisNodeGenerated = require("./dependenciesParenthesisNode.generated.js"); +var _dependenciesSymbolNodeGenerated = require("./dependenciesSymbolNode.generated.js"); +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const simplifyCoreDependencies = exports.simplifyCoreDependencies = { + AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, + ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, + ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, + FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, + IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, + ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, + OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, + ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, + SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + parseDependencies: _dependenciesParseGenerated.parseDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSimplifyCore: _factoriesNumber.createSimplifyCore +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js new file mode 100644 index 0000000..7839170 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sinDependencies = exports.sinDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSin: _factoriesNumber.createSin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js new file mode 100644 index 0000000..774f86a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sinhDependencies = exports.sinhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSinh: _factoriesNumber.createSinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js new file mode 100644 index 0000000..ec34481 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sizeDependencies = void 0; +var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sizeDependencies = exports.sizeDependencies = { + matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSize: _factoriesNumber.createSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js new file mode 100644 index 0000000..0638bb8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const smallerDependencies = exports.smallerDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSmaller: _factoriesNumber.createSmaller +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js new file mode 100644 index 0000000..877962a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerEqDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const smallerEqDependencies = exports.smallerEqDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSmallerEq: _factoriesNumber.createSmallerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js new file mode 100644 index 0000000..b1cc9d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sqrtDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sqrtDependencies = exports.sqrtDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSqrt: _factoriesNumber.createSqrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js new file mode 100644 index 0000000..f9ad8dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.squareDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const squareDependencies = exports.squareDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSquare: _factoriesNumber.createSquare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js new file mode 100644 index 0000000..73dff61 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stdDependencies = void 0; +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesVariance.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stdDependencies = exports.stdDependencies = { + mapDependencies: _dependenciesMapGenerated.mapDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, + createStd: _factoriesNumber.createStd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js new file mode 100644 index 0000000..369b1b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stdTransformDependencies = void 0; +var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); +var _dependenciesSqrtGenerated = require("./dependenciesSqrt.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _dependenciesVarianceGenerated = require("./dependenciesVariance.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stdTransformDependencies = exports.stdTransformDependencies = { + mapDependencies: _dependenciesMapGenerated.mapDependencies, + sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, + createStdTransform: _factoriesNumber.createStdTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js new file mode 100644 index 0000000..cf455f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stirlingS2Dependencies = void 0; +var _dependenciesAddScalarGenerated = require("./dependenciesAddScalar.generated.js"); +var _dependenciesCombinationsGenerated = require("./dependenciesCombinations.generated.js"); +var _dependenciesDivideScalarGenerated = require("./dependenciesDivideScalar.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesLargerGenerated = require("./dependenciesLarger.generated.js"); +var _dependenciesMultiplyScalarGenerated = require("./dependenciesMultiplyScalar.generated.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSubtractScalarGenerated = require("./dependenciesSubtractScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stirlingS2Dependencies = exports.stirlingS2Dependencies = { + addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, + combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, + divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + largerDependencies: _dependenciesLargerGenerated.largerDependencies, + multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, + numberDependencies: _dependenciesNumberGenerated.numberDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + subtractScalarDependencies: _dependenciesSubtractScalarGenerated.subtractScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createStirlingS2: _factoriesNumber.createStirlingS2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js new file mode 100644 index 0000000..ef8705a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stringDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const stringDependencies = exports.stringDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createString: _factoriesNumber.createString +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js new file mode 100644 index 0000000..7673178 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subsetDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subsetDependencies = exports.subsetDependencies = { + createSubset: _factoriesNumber.createSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js new file mode 100644 index 0000000..1cb79b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subsetTransformDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subsetTransformDependencies = exports.subsetTransformDependencies = { + createSubsetTransform: _factoriesNumber.createSubsetTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js new file mode 100644 index 0000000..188f60f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subtractDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subtractDependencies = exports.subtractDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSubtract: _factoriesNumber.createSubtract +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js new file mode 100644 index 0000000..9373c85 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subtractScalarDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const subtractScalarDependencies = exports.subtractScalarDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSubtractScalar: _factoriesNumber.createSubtractScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js new file mode 100644 index 0000000..9b2904b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sumDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sumDependencies = exports.sumDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSum: _factoriesNumber.createSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js new file mode 100644 index 0000000..ec6215e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sumTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesNumericGenerated = require("./dependenciesNumeric.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const sumTransformDependencies = exports.sumTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + numericDependencies: _dependenciesNumericGenerated.numericDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createSumTransform: _factoriesNumber.createSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js new file mode 100644 index 0000000..df354a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SymbolNodeDependencies = void 0; +var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const SymbolNodeDependencies = exports.SymbolNodeDependencies = { + NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, + createSymbolNode: _factoriesNumber.createSymbolNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js new file mode 100644 index 0000000..8b77910 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tanDependencies = exports.tanDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTan: _factoriesNumber.createTan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js new file mode 100644 index 0000000..9e22258 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanhDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tanhDependencies = exports.tanhDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTanh: _factoriesNumber.createTanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js new file mode 100644 index 0000000..aa0458c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tauDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const tauDependencies = exports.tauDependencies = { + createTau: _factoriesNumber.createTau +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js new file mode 100644 index 0000000..53250b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.trueDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const trueDependencies = exports.trueDependencies = { + createTrue: _factoriesNumber.createTrue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js new file mode 100644 index 0000000..f354174 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeOfDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const typeOfDependencies = exports.typeOfDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createTypeOf: _factoriesNumber.createTypeOf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js new file mode 100644 index 0000000..bf7963e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typedDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const typedDependencies = exports.typedDependencies = { + createTyped: _factoriesNumber.createTyped +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js new file mode 100644 index 0000000..b9c3371 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryMinusDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unaryMinusDependencies = exports.unaryMinusDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnaryMinus: _factoriesNumber.createUnaryMinus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js new file mode 100644 index 0000000..fe5a51c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryPlusDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unaryPlusDependencies = exports.unaryPlusDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnaryPlus: _factoriesNumber.createUnaryPlus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js new file mode 100644 index 0000000..3ec27ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unequalDependencies = void 0; +var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const unequalDependencies = exports.unequalDependencies = { + equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createUnequal: _factoriesNumber.createUnequal +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js new file mode 100644 index 0000000..18d39e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.EDependencies = void 0; +var _dependenciesEGenerated = require("./dependenciesE.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const EDependencies = exports.EDependencies = { + eDependencies: _dependenciesEGenerated.eDependencies, + createUppercaseE: _factoriesNumber.createUppercaseE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js new file mode 100644 index 0000000..720c460 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PIDependencies = void 0; +var _dependenciesPiGenerated = require("./dependenciesPi.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const PIDependencies = exports.PIDependencies = { + piDependencies: _dependenciesPiGenerated.piDependencies, + createUppercasePi: _factoriesNumber.createUppercasePi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js new file mode 100644 index 0000000..f6642df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.varianceDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesApply.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const varianceDependencies = exports.varianceDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + applyDependencies: _dependenciesApplyGenerated.applyDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createVariance: _factoriesNumber.createVariance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js new file mode 100644 index 0000000..3f48b55 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.varianceTransformDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesApplyGenerated = require("./dependenciesApply.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const varianceTransformDependencies = exports.varianceTransformDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + applyDependencies: _dependenciesApplyGenerated.applyDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createVarianceTransform: _factoriesNumber.createVarianceTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js new file mode 100644 index 0000000..aeb1a13 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.versionDependencies = void 0; +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const versionDependencies = exports.versionDependencies = { + createVersion: _factoriesNumber.createVersion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js new file mode 100644 index 0000000..8f457ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xgcdDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const xgcdDependencies = exports.xgcdDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createXgcd: _factoriesNumber.createXgcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js new file mode 100644 index 0000000..2aaaf77 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xorDependencies = void 0; +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const xorDependencies = exports.xorDependencies = { + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createXor: _factoriesNumber.createXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js new file mode 100644 index 0000000..e2be460 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zetaDependencies = void 0; +var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); +var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); +var _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); +var _dependenciesFactorialGenerated = require("./dependenciesFactorial.generated.js"); +var _dependenciesGammaGenerated = require("./dependenciesGamma.generated.js"); +var _dependenciesIsNegativeGenerated = require("./dependenciesIsNegative.generated.js"); +var _dependenciesMultiplyGenerated = require("./dependenciesMultiply.generated.js"); +var _dependenciesPiGenerated = require("./dependenciesPi.generated.js"); +var _dependenciesPowGenerated = require("./dependenciesPow.generated.js"); +var _dependenciesSinGenerated = require("./dependenciesSin.generated.js"); +var _dependenciesSmallerEqGenerated = require("./dependenciesSmallerEq.generated.js"); +var _dependenciesSubtractGenerated = require("./dependenciesSubtract.generated.js"); +var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); +var _factoriesNumber = require("../../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const zetaDependencies = exports.zetaDependencies = { + addDependencies: _dependenciesAddGenerated.addDependencies, + divideDependencies: _dependenciesDivideGenerated.divideDependencies, + equalDependencies: _dependenciesEqualGenerated.equalDependencies, + factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, + gammaDependencies: _dependenciesGammaGenerated.gammaDependencies, + isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, + multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, + piDependencies: _dependenciesPiGenerated.piDependencies, + powDependencies: _dependenciesPowGenerated.powDependencies, + sinDependencies: _dependenciesSinGenerated.sinDependencies, + smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, + subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, + typedDependencies: _dependenciesTypedGenerated.typedDependencies, + createZeta: _factoriesNumber.createZeta +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js new file mode 100644 index 0000000..4df8611 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js @@ -0,0 +1,764 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.derivative = exports.compile = exports.chain = exports.SymbolNode = exports.RelationalNode = exports.RangeNode = exports.Parser = exports.ParenthesisNode = exports.OperatorNode = exports.ObjectNode = exports.Node = exports.IndexNode = exports.Help = exports.FunctionNode = exports.FunctionAssignmentNode = exports.ConstantNode = exports.ConditionalNode = exports.Chain = exports.BlockNode = exports.AssignmentNode = exports.ArrayNode = exports.AccessorNode = void 0; +Object.defineProperty(exports, "docs", { + enumerable: true, + get: function () { + return _embeddedDocs.embeddedDocs; + } +}); +exports.symbolicEqual = exports.simplifyCore = exports.simplifyConstant = exports.simplify = exports.reviver = exports.resolve = exports.rationalize = exports.parser = exports.parse = exports.leafCount = exports.help = exports.evaluate = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _configReadonly = require("./configReadonly.js"); +var _factoriesAny = require("../factoriesAny.js"); +var _pureFunctionsAnyGenerated = require("./pureFunctionsAny.generated.js"); +var _embeddedDocs = require("../expression/embeddedDocs/embeddedDocs.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const math = {}; // NOT pure! +const mathWithTransform = {}; // NOT pure! +const classes = {}; // NOT pure! + +const Node = exports.Node = (0, _factoriesAny.createNode)({ + mathWithTransform +}); +const ObjectNode = exports.ObjectNode = (0, _factoriesAny.createObjectNode)({ + Node +}); +const OperatorNode = exports.OperatorNode = (0, _factoriesAny.createOperatorNode)({ + Node +}); +const ParenthesisNode = exports.ParenthesisNode = (0, _factoriesAny.createParenthesisNode)({ + Node +}); +const RelationalNode = exports.RelationalNode = (0, _factoriesAny.createRelationalNode)({ + Node +}); +const ArrayNode = exports.ArrayNode = (0, _factoriesAny.createArrayNode)({ + Node +}); +const BlockNode = exports.BlockNode = (0, _factoriesAny.createBlockNode)({ + Node, + ResultSet: _pureFunctionsAnyGenerated.ResultSet +}); +const ConditionalNode = exports.ConditionalNode = (0, _factoriesAny.createConditionalNode)({ + Node +}); +const ConstantNode = exports.ConstantNode = (0, _factoriesAny.createConstantNode)({ + Node +}); +const RangeNode = exports.RangeNode = (0, _factoriesAny.createRangeNode)({ + Node +}); +const reviver = exports.reviver = (0, _factoriesAny.createReviver)({ + classes +}); +const Chain = exports.Chain = (0, _factoriesAny.createChainClass)({ + math, + typed: _pureFunctionsAnyGenerated.typed +}); +const FunctionAssignmentNode = exports.FunctionAssignmentNode = (0, _factoriesAny.createFunctionAssignmentNode)({ + Node, + typed: _pureFunctionsAnyGenerated.typed +}); +const chain = exports.chain = (0, _factoriesAny.createChain)({ + Chain, + typed: _pureFunctionsAnyGenerated.typed +}); +const IndexNode = exports.IndexNode = (0, _factoriesAny.createIndexNode)({ + Node, + size: _pureFunctionsAnyGenerated.size +}); +const AccessorNode = exports.AccessorNode = (0, _factoriesAny.createAccessorNode)({ + Node, + subset: _pureFunctionsAnyGenerated.subset +}); +const AssignmentNode = exports.AssignmentNode = (0, _factoriesAny.createAssignmentNode)({ + matrix: _pureFunctionsAnyGenerated.matrix, + Node, + subset: _pureFunctionsAnyGenerated.subset +}); +const SymbolNode = exports.SymbolNode = (0, _factoriesAny.createSymbolNode)({ + Unit: _pureFunctionsAnyGenerated.Unit, + Node, + math +}); +const FunctionNode = exports.FunctionNode = (0, _factoriesAny.createFunctionNode)({ + Node, + SymbolNode, + math +}); +const parse = exports.parse = (0, _factoriesAny.createParse)({ + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode, + config: _configReadonly.config, + numeric: _pureFunctionsAnyGenerated.numeric, + typed: _pureFunctionsAnyGenerated.typed +}); +const resolve = exports.resolve = (0, _factoriesAny.createResolve)({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + parse, + typed: _pureFunctionsAnyGenerated.typed +}); +const simplifyConstant = exports.simplifyConstant = (0, _factoriesAny.createSimplifyConstant)({ + bignumber: _pureFunctionsAnyGenerated.bignumber, + fraction: _pureFunctionsAnyGenerated.fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + config: _configReadonly.config, + mathWithTransform, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed +}); +const compile = exports.compile = (0, _factoriesAny.createCompile)({ + parse, + typed: _pureFunctionsAnyGenerated.typed +}); +const simplifyCore = exports.simplifyCore = (0, _factoriesAny.createSimplifyCore)({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsAnyGenerated.add, + divide: _pureFunctionsAnyGenerated.divide, + equal: _pureFunctionsAnyGenerated.equal, + isZero: _pureFunctionsAnyGenerated.isZero, + multiply: _pureFunctionsAnyGenerated.multiply, + parse, + pow: _pureFunctionsAnyGenerated.pow, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed +}); +const evaluate = exports.evaluate = (0, _factoriesAny.createEvaluate)({ + parse, + typed: _pureFunctionsAnyGenerated.typed +}); +const Help = exports.Help = (0, _factoriesAny.createHelpClass)({ + evaluate +}); +const Parser = exports.Parser = (0, _factoriesAny.createParserClass)({ + evaluate +}); +const simplify = exports.simplify = (0, _factoriesAny.createSimplify)({ + bignumber: _pureFunctionsAnyGenerated.bignumber, + fraction: _pureFunctionsAnyGenerated.fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsAnyGenerated.add, + config: _configReadonly.config, + divide: _pureFunctionsAnyGenerated.divide, + equal: _pureFunctionsAnyGenerated.equal, + isZero: _pureFunctionsAnyGenerated.isZero, + mathWithTransform, + matrix: _pureFunctionsAnyGenerated.matrix, + multiply: _pureFunctionsAnyGenerated.multiply, + parse, + pow: _pureFunctionsAnyGenerated.pow, + resolve, + simplifyConstant, + simplifyCore, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed +}); +const symbolicEqual = exports.symbolicEqual = (0, _factoriesAny.createSymbolicEqual)({ + OperatorNode, + parse, + simplify, + typed: _pureFunctionsAnyGenerated.typed +}); +const leafCount = exports.leafCount = (0, _factoriesAny.createLeafCount)({ + parse, + typed: _pureFunctionsAnyGenerated.typed +}); +const parser = exports.parser = (0, _factoriesAny.createParser)({ + Parser, + typed: _pureFunctionsAnyGenerated.typed +}); +const rationalize = exports.rationalize = (0, _factoriesAny.createRationalize)({ + bignumber: _pureFunctionsAnyGenerated.bignumber, + fraction: _pureFunctionsAnyGenerated.fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsAnyGenerated.add, + config: _configReadonly.config, + divide: _pureFunctionsAnyGenerated.divide, + equal: _pureFunctionsAnyGenerated.equal, + isZero: _pureFunctionsAnyGenerated.isZero, + mathWithTransform, + matrix: _pureFunctionsAnyGenerated.matrix, + multiply: _pureFunctionsAnyGenerated.multiply, + parse, + pow: _pureFunctionsAnyGenerated.pow, + simplify, + simplifyConstant, + simplifyCore, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed +}); +const derivative = exports.derivative = (0, _factoriesAny.createDerivative)({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + config: _configReadonly.config, + equal: _pureFunctionsAnyGenerated.equal, + isZero: _pureFunctionsAnyGenerated.isZero, + numeric: _pureFunctionsAnyGenerated.numeric, + parse, + simplify, + typed: _pureFunctionsAnyGenerated.typed +}); +const help = exports.help = (0, _factoriesAny.createHelp)({ + Help, + mathWithTransform, + typed: _pureFunctionsAnyGenerated.typed +}); +(0, _extends2.default)(math, { + e: _pureFunctionsAnyGenerated.e, + false: _pureFunctionsAnyGenerated._false, + fineStructure: _pureFunctionsAnyGenerated.fineStructure, + i: _pureFunctionsAnyGenerated.i, + Infinity: _pureFunctionsAnyGenerated._Infinity, + LN10: _pureFunctionsAnyGenerated.LN10, + LOG10E: _pureFunctionsAnyGenerated.LOG10E, + NaN: _pureFunctionsAnyGenerated._NaN, + null: _pureFunctionsAnyGenerated._null, + phi: _pureFunctionsAnyGenerated.phi, + SQRT1_2: _pureFunctionsAnyGenerated.SQRT1_2, + sackurTetrode: _pureFunctionsAnyGenerated.sackurTetrode, + tau: _pureFunctionsAnyGenerated.tau, + true: _pureFunctionsAnyGenerated._true, + 'E': _pureFunctionsAnyGenerated.e, + version: _pureFunctionsAnyGenerated.version, + efimovFactor: _pureFunctionsAnyGenerated.efimovFactor, + LN2: _pureFunctionsAnyGenerated.LN2, + pi: _pureFunctionsAnyGenerated.pi, + replacer: _pureFunctionsAnyGenerated.replacer, + reviver, + SQRT2: _pureFunctionsAnyGenerated.SQRT2, + typed: _pureFunctionsAnyGenerated.typed, + 'PI': _pureFunctionsAnyGenerated.pi, + weakMixingAngle: _pureFunctionsAnyGenerated.weakMixingAngle, + abs: _pureFunctionsAnyGenerated.abs, + acos: _pureFunctionsAnyGenerated.acos, + acot: _pureFunctionsAnyGenerated.acot, + acsc: _pureFunctionsAnyGenerated.acsc, + addScalar: _pureFunctionsAnyGenerated.addScalar, + arg: _pureFunctionsAnyGenerated.arg, + asech: _pureFunctionsAnyGenerated.asech, + asinh: _pureFunctionsAnyGenerated.asinh, + atan: _pureFunctionsAnyGenerated.atan, + atanh: _pureFunctionsAnyGenerated.atanh, + bigint: _pureFunctionsAnyGenerated.bigint, + bitNot: _pureFunctionsAnyGenerated.bitNot, + boolean: _pureFunctionsAnyGenerated.boolean, + clone: _pureFunctionsAnyGenerated.clone, + combinations: _pureFunctionsAnyGenerated.combinations, + complex: _pureFunctionsAnyGenerated.complex, + conj: _pureFunctionsAnyGenerated.conj, + cos: _pureFunctionsAnyGenerated.cos, + cot: _pureFunctionsAnyGenerated.cot, + csc: _pureFunctionsAnyGenerated.csc, + cube: _pureFunctionsAnyGenerated.cube, + equalScalar: _pureFunctionsAnyGenerated.equalScalar, + erf: _pureFunctionsAnyGenerated.erf, + exp: _pureFunctionsAnyGenerated.exp, + expm1: _pureFunctionsAnyGenerated.expm1, + filter: _pureFunctionsAnyGenerated.filter, + flatten: _pureFunctionsAnyGenerated.flatten, + forEach: _pureFunctionsAnyGenerated.forEach, + format: _pureFunctionsAnyGenerated.format, + getMatrixDataType: _pureFunctionsAnyGenerated.getMatrixDataType, + hex: _pureFunctionsAnyGenerated.hex, + im: _pureFunctionsAnyGenerated.im, + isInteger: _pureFunctionsAnyGenerated.isInteger, + isNegative: _pureFunctionsAnyGenerated.isNegative, + isPositive: _pureFunctionsAnyGenerated.isPositive, + isZero: _pureFunctionsAnyGenerated.isZero, + LOG2E: _pureFunctionsAnyGenerated.LOG2E, + lgamma: _pureFunctionsAnyGenerated.lgamma, + log10: _pureFunctionsAnyGenerated.log10, + log2: _pureFunctionsAnyGenerated.log2, + map: _pureFunctionsAnyGenerated.map, + multiplyScalar: _pureFunctionsAnyGenerated.multiplyScalar, + not: _pureFunctionsAnyGenerated.not, + number: _pureFunctionsAnyGenerated.number, + oct: _pureFunctionsAnyGenerated.oct, + pickRandom: _pureFunctionsAnyGenerated.pickRandom, + print: _pureFunctionsAnyGenerated.print, + random: _pureFunctionsAnyGenerated.random, + re: _pureFunctionsAnyGenerated.re, + sec: _pureFunctionsAnyGenerated.sec, + sign: _pureFunctionsAnyGenerated.sign, + sin: _pureFunctionsAnyGenerated.sin, + splitUnit: _pureFunctionsAnyGenerated.splitUnit, + square: _pureFunctionsAnyGenerated.square, + string: _pureFunctionsAnyGenerated.string, + subtractScalar: _pureFunctionsAnyGenerated.subtractScalar, + tan: _pureFunctionsAnyGenerated.tan, + typeOf: _pureFunctionsAnyGenerated.typeOf, + acosh: _pureFunctionsAnyGenerated.acosh, + acsch: _pureFunctionsAnyGenerated.acsch, + apply: _pureFunctionsAnyGenerated.apply, + asec: _pureFunctionsAnyGenerated.asec, + bignumber: _pureFunctionsAnyGenerated.bignumber, + chain, + combinationsWithRep: _pureFunctionsAnyGenerated.combinationsWithRep, + cosh: _pureFunctionsAnyGenerated.cosh, + csch: _pureFunctionsAnyGenerated.csch, + isNaN: _pureFunctionsAnyGenerated.isNaN, + isPrime: _pureFunctionsAnyGenerated.isPrime, + randomInt: _pureFunctionsAnyGenerated.randomInt, + sech: _pureFunctionsAnyGenerated.sech, + sinh: _pureFunctionsAnyGenerated.sinh, + sparse: _pureFunctionsAnyGenerated.sparse, + sqrt: _pureFunctionsAnyGenerated.sqrt, + squeeze: _pureFunctionsAnyGenerated.squeeze, + tanh: _pureFunctionsAnyGenerated.tanh, + unaryMinus: _pureFunctionsAnyGenerated.unaryMinus, + acoth: _pureFunctionsAnyGenerated.acoth, + bin: _pureFunctionsAnyGenerated.bin, + coth: _pureFunctionsAnyGenerated.coth, + fraction: _pureFunctionsAnyGenerated.fraction, + isNumeric: _pureFunctionsAnyGenerated.isNumeric, + matrix: _pureFunctionsAnyGenerated.matrix, + matrixFromFunction: _pureFunctionsAnyGenerated.matrixFromFunction, + mode: _pureFunctionsAnyGenerated.mode, + numeric: _pureFunctionsAnyGenerated.numeric, + prod: _pureFunctionsAnyGenerated.prod, + reshape: _pureFunctionsAnyGenerated.reshape, + size: _pureFunctionsAnyGenerated.size, + transpose: _pureFunctionsAnyGenerated.transpose, + xgcd: _pureFunctionsAnyGenerated.xgcd, + zeros: _pureFunctionsAnyGenerated.zeros, + asin: _pureFunctionsAnyGenerated.asin, + cbrt: _pureFunctionsAnyGenerated.cbrt, + concat: _pureFunctionsAnyGenerated.concat, + count: _pureFunctionsAnyGenerated.count, + ctranspose: _pureFunctionsAnyGenerated.ctranspose, + diag: _pureFunctionsAnyGenerated.diag, + divideScalar: _pureFunctionsAnyGenerated.divideScalar, + dotDivide: _pureFunctionsAnyGenerated.dotDivide, + equal: _pureFunctionsAnyGenerated.equal, + hasNumericValue: _pureFunctionsAnyGenerated.hasNumericValue, + identity: _pureFunctionsAnyGenerated.identity, + kron: _pureFunctionsAnyGenerated.kron, + largerEq: _pureFunctionsAnyGenerated.largerEq, + leftShift: _pureFunctionsAnyGenerated.leftShift, + lsolve: _pureFunctionsAnyGenerated.lsolve, + matrixFromColumns: _pureFunctionsAnyGenerated.matrixFromColumns, + nthRoot: _pureFunctionsAnyGenerated.nthRoot, + ones: _pureFunctionsAnyGenerated.ones, + qr: _pureFunctionsAnyGenerated.qr, + resize: _pureFunctionsAnyGenerated.resize, + rightArithShift: _pureFunctionsAnyGenerated.rightArithShift, + round: _pureFunctionsAnyGenerated.round, + smaller: _pureFunctionsAnyGenerated.smaller, + subtract: _pureFunctionsAnyGenerated.subtract, + to: _pureFunctionsAnyGenerated.to, + unaryPlus: _pureFunctionsAnyGenerated.unaryPlus, + usolve: _pureFunctionsAnyGenerated.usolve, + xor: _pureFunctionsAnyGenerated.xor, + add: _pureFunctionsAnyGenerated.add, + atan2: _pureFunctionsAnyGenerated.atan2, + bitAnd: _pureFunctionsAnyGenerated.bitAnd, + bitOr: _pureFunctionsAnyGenerated.bitOr, + bitXor: _pureFunctionsAnyGenerated.bitXor, + catalan: _pureFunctionsAnyGenerated.catalan, + compare: _pureFunctionsAnyGenerated.compare, + compareText: _pureFunctionsAnyGenerated.compareText, + cumsum: _pureFunctionsAnyGenerated.cumsum, + deepEqual: _pureFunctionsAnyGenerated.deepEqual, + diff: _pureFunctionsAnyGenerated.diff, + distance: _pureFunctionsAnyGenerated.distance, + dot: _pureFunctionsAnyGenerated.dot, + equalText: _pureFunctionsAnyGenerated.equalText, + floor: _pureFunctionsAnyGenerated.floor, + gcd: _pureFunctionsAnyGenerated.gcd, + hypot: _pureFunctionsAnyGenerated.hypot, + larger: _pureFunctionsAnyGenerated.larger, + log: _pureFunctionsAnyGenerated.log, + lsolveAll: _pureFunctionsAnyGenerated.lsolveAll, + matrixFromRows: _pureFunctionsAnyGenerated.matrixFromRows, + min: _pureFunctionsAnyGenerated.min, + mod: _pureFunctionsAnyGenerated.mod, + multiply: _pureFunctionsAnyGenerated.multiply, + nthRoots: _pureFunctionsAnyGenerated.nthRoots, + or: _pureFunctionsAnyGenerated.or, + partitionSelect: _pureFunctionsAnyGenerated.partitionSelect, + rightLogShift: _pureFunctionsAnyGenerated.rightLogShift, + slu: _pureFunctionsAnyGenerated.slu, + subset: _pureFunctionsAnyGenerated.subset, + sum: _pureFunctionsAnyGenerated.sum, + trace: _pureFunctionsAnyGenerated.trace, + usolveAll: _pureFunctionsAnyGenerated.usolveAll, + zpk2tf: _pureFunctionsAnyGenerated.zpk2tf, + ceil: _pureFunctionsAnyGenerated.ceil, + compareNatural: _pureFunctionsAnyGenerated.compareNatural, + composition: _pureFunctionsAnyGenerated.composition, + cross: _pureFunctionsAnyGenerated.cross, + det: _pureFunctionsAnyGenerated.det, + dotMultiply: _pureFunctionsAnyGenerated.dotMultiply, + fix: _pureFunctionsAnyGenerated.fix, + index: _pureFunctionsAnyGenerated.index, + intersect: _pureFunctionsAnyGenerated.intersect, + invmod: _pureFunctionsAnyGenerated.invmod, + lcm: _pureFunctionsAnyGenerated.lcm, + log1p: _pureFunctionsAnyGenerated.log1p, + max: _pureFunctionsAnyGenerated.max, + setCartesian: _pureFunctionsAnyGenerated.setCartesian, + setDistinct: _pureFunctionsAnyGenerated.setDistinct, + setIsSubset: _pureFunctionsAnyGenerated.setIsSubset, + setPowerset: _pureFunctionsAnyGenerated.setPowerset, + smallerEq: _pureFunctionsAnyGenerated.smallerEq, + sort: _pureFunctionsAnyGenerated.sort, + unequal: _pureFunctionsAnyGenerated.unequal, + and: _pureFunctionsAnyGenerated.and, + range: _pureFunctionsAnyGenerated.range, + row: _pureFunctionsAnyGenerated.row, + setDifference: _pureFunctionsAnyGenerated.setDifference, + setMultiplicity: _pureFunctionsAnyGenerated.setMultiplicity, + setSymDifference: _pureFunctionsAnyGenerated.setSymDifference, + column: _pureFunctionsAnyGenerated.column, + inv: _pureFunctionsAnyGenerated.inv, + lup: _pureFunctionsAnyGenerated.lup, + pinv: _pureFunctionsAnyGenerated.pinv, + pow: _pureFunctionsAnyGenerated.pow, + setIntersect: _pureFunctionsAnyGenerated.setIntersect, + setUnion: _pureFunctionsAnyGenerated.setUnion, + sqrtm: _pureFunctionsAnyGenerated.sqrtm, + vacuumImpedance: _pureFunctionsAnyGenerated.vacuumImpedance, + wienDisplacement: _pureFunctionsAnyGenerated.wienDisplacement, + atomicMass: _pureFunctionsAnyGenerated.atomicMass, + bohrMagneton: _pureFunctionsAnyGenerated.bohrMagneton, + boltzmann: _pureFunctionsAnyGenerated.boltzmann, + conductanceQuantum: _pureFunctionsAnyGenerated.conductanceQuantum, + coulomb: _pureFunctionsAnyGenerated.coulomb, + deuteronMass: _pureFunctionsAnyGenerated.deuteronMass, + dotPow: _pureFunctionsAnyGenerated.dotPow, + electricConstant: _pureFunctionsAnyGenerated.electricConstant, + elementaryCharge: _pureFunctionsAnyGenerated.elementaryCharge, + expm: _pureFunctionsAnyGenerated.expm, + faraday: _pureFunctionsAnyGenerated.faraday, + fft: _pureFunctionsAnyGenerated.fft, + gamma: _pureFunctionsAnyGenerated.gamma, + gravitationConstant: _pureFunctionsAnyGenerated.gravitationConstant, + hartreeEnergy: _pureFunctionsAnyGenerated.hartreeEnergy, + ifft: _pureFunctionsAnyGenerated.ifft, + klitzing: _pureFunctionsAnyGenerated.klitzing, + loschmidt: _pureFunctionsAnyGenerated.loschmidt, + magneticConstant: _pureFunctionsAnyGenerated.magneticConstant, + molarMass: _pureFunctionsAnyGenerated.molarMass, + molarPlanckConstant: _pureFunctionsAnyGenerated.molarPlanckConstant, + neutronMass: _pureFunctionsAnyGenerated.neutronMass, + nuclearMagneton: _pureFunctionsAnyGenerated.nuclearMagneton, + planckCharge: _pureFunctionsAnyGenerated.planckCharge, + planckLength: _pureFunctionsAnyGenerated.planckLength, + planckTemperature: _pureFunctionsAnyGenerated.planckTemperature, + protonMass: _pureFunctionsAnyGenerated.protonMass, + quantumOfCirculation: _pureFunctionsAnyGenerated.quantumOfCirculation, + reducedPlanckConstant: _pureFunctionsAnyGenerated.reducedPlanckConstant, + rydberg: _pureFunctionsAnyGenerated.rydberg, + secondRadiation: _pureFunctionsAnyGenerated.secondRadiation, + speedOfLight: _pureFunctionsAnyGenerated.speedOfLight, + stefanBoltzmann: _pureFunctionsAnyGenerated.stefanBoltzmann, + thomsonCrossSection: _pureFunctionsAnyGenerated.thomsonCrossSection, + avogadro: _pureFunctionsAnyGenerated.avogadro, + bohrRadius: _pureFunctionsAnyGenerated.bohrRadius, + createUnit: _pureFunctionsAnyGenerated.createUnit, + divide: _pureFunctionsAnyGenerated.divide, + electronMass: _pureFunctionsAnyGenerated.electronMass, + factorial: _pureFunctionsAnyGenerated.factorial, + firstRadiation: _pureFunctionsAnyGenerated.firstRadiation, + gravity: _pureFunctionsAnyGenerated.gravity, + inverseConductanceQuantum: _pureFunctionsAnyGenerated.inverseConductanceQuantum, + lusolve: _pureFunctionsAnyGenerated.lusolve, + magneticFluxQuantum: _pureFunctionsAnyGenerated.magneticFluxQuantum, + molarMassC12: _pureFunctionsAnyGenerated.molarMassC12, + multinomial: _pureFunctionsAnyGenerated.multinomial, + parse, + permutations: _pureFunctionsAnyGenerated.permutations, + planckMass: _pureFunctionsAnyGenerated.planckMass, + polynomialRoot: _pureFunctionsAnyGenerated.polynomialRoot, + resolve, + setSize: _pureFunctionsAnyGenerated.setSize, + simplifyConstant, + solveODE: _pureFunctionsAnyGenerated.solveODE, + stirlingS2: _pureFunctionsAnyGenerated.stirlingS2, + unit: _pureFunctionsAnyGenerated.unit, + bellNumbers: _pureFunctionsAnyGenerated.bellNumbers, + compile, + eigs: _pureFunctionsAnyGenerated.eigs, + fermiCoupling: _pureFunctionsAnyGenerated.fermiCoupling, + gasConstant: _pureFunctionsAnyGenerated.gasConstant, + kldivergence: _pureFunctionsAnyGenerated.kldivergence, + mean: _pureFunctionsAnyGenerated.mean, + molarVolume: _pureFunctionsAnyGenerated.molarVolume, + planckConstant: _pureFunctionsAnyGenerated.planckConstant, + quantileSeq: _pureFunctionsAnyGenerated.quantileSeq, + simplifyCore, + variance: _pureFunctionsAnyGenerated.variance, + classicalElectronRadius: _pureFunctionsAnyGenerated.classicalElectronRadius, + evaluate, + median: _pureFunctionsAnyGenerated.median, + simplify, + symbolicEqual, + corr: _pureFunctionsAnyGenerated.corr, + freqz: _pureFunctionsAnyGenerated.freqz, + leafCount, + mad: _pureFunctionsAnyGenerated.mad, + parser, + rationalize, + std: _pureFunctionsAnyGenerated.std, + zeta: _pureFunctionsAnyGenerated.zeta, + derivative, + norm: _pureFunctionsAnyGenerated.norm, + rotationMatrix: _pureFunctionsAnyGenerated.rotationMatrix, + help, + planckTime: _pureFunctionsAnyGenerated.planckTime, + schur: _pureFunctionsAnyGenerated.schur, + rotate: _pureFunctionsAnyGenerated.rotate, + sylvester: _pureFunctionsAnyGenerated.sylvester, + lyap: _pureFunctionsAnyGenerated.lyap, + config: _configReadonly.config +}); +(0, _extends2.default)(mathWithTransform, math, { + filter: (0, _factoriesAny.createFilterTransform)({ + typed: _pureFunctionsAnyGenerated.typed + }), + forEach: (0, _factoriesAny.createForEachTransform)({ + typed: _pureFunctionsAnyGenerated.typed + }), + map: (0, _factoriesAny.createMapTransform)({ + typed: _pureFunctionsAnyGenerated.typed + }), + apply: (0, _factoriesAny.createApplyTransform)({ + isInteger: _pureFunctionsAnyGenerated.isInteger, + typed: _pureFunctionsAnyGenerated.typed + }), + or: (0, _factoriesAny.createOrTransform)({ + DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, + concat: _pureFunctionsAnyGenerated.concat, + equalScalar: _pureFunctionsAnyGenerated.equalScalar, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed + }), + and: (0, _factoriesAny.createAndTransform)({ + add: _pureFunctionsAnyGenerated.add, + concat: _pureFunctionsAnyGenerated.concat, + equalScalar: _pureFunctionsAnyGenerated.equalScalar, + matrix: _pureFunctionsAnyGenerated.matrix, + not: _pureFunctionsAnyGenerated.not, + typed: _pureFunctionsAnyGenerated.typed, + zeros: _pureFunctionsAnyGenerated.zeros + }), + concat: (0, _factoriesAny.createConcatTransform)({ + isInteger: _pureFunctionsAnyGenerated.isInteger, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed + }), + max: (0, _factoriesAny.createMaxTransform)({ + config: _configReadonly.config, + larger: _pureFunctionsAnyGenerated.larger, + numeric: _pureFunctionsAnyGenerated.numeric, + typed: _pureFunctionsAnyGenerated.typed + }), + print: (0, _factoriesAny.createPrintTransform)({ + add: _pureFunctionsAnyGenerated.add, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed, + zeros: _pureFunctionsAnyGenerated.zeros + }), + bitAnd: (0, _factoriesAny.createBitAndTransform)({ + add: _pureFunctionsAnyGenerated.add, + concat: _pureFunctionsAnyGenerated.concat, + equalScalar: _pureFunctionsAnyGenerated.equalScalar, + matrix: _pureFunctionsAnyGenerated.matrix, + not: _pureFunctionsAnyGenerated.not, + typed: _pureFunctionsAnyGenerated.typed, + zeros: _pureFunctionsAnyGenerated.zeros + }), + diff: (0, _factoriesAny.createDiffTransform)({ + bignumber: _pureFunctionsAnyGenerated.bignumber, + matrix: _pureFunctionsAnyGenerated.matrix, + number: _pureFunctionsAnyGenerated.number, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed + }), + min: (0, _factoriesAny.createMinTransform)({ + config: _configReadonly.config, + numeric: _pureFunctionsAnyGenerated.numeric, + smaller: _pureFunctionsAnyGenerated.smaller, + typed: _pureFunctionsAnyGenerated.typed + }), + subset: (0, _factoriesAny.createSubsetTransform)({ + add: _pureFunctionsAnyGenerated.add, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed, + zeros: _pureFunctionsAnyGenerated.zeros + }), + bitOr: (0, _factoriesAny.createBitOrTransform)({ + DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, + concat: _pureFunctionsAnyGenerated.concat, + equalScalar: _pureFunctionsAnyGenerated.equalScalar, + matrix: _pureFunctionsAnyGenerated.matrix, + typed: _pureFunctionsAnyGenerated.typed + }), + cumsum: (0, _factoriesAny.createCumSumTransform)({ + add: _pureFunctionsAnyGenerated.add, + typed: _pureFunctionsAnyGenerated.typed, + unaryPlus: _pureFunctionsAnyGenerated.unaryPlus + }), + index: (0, _factoriesAny.createIndexTransform)({ + Index: _pureFunctionsAnyGenerated.Index, + getMatrixDataType: _pureFunctionsAnyGenerated.getMatrixDataType + }), + sum: (0, _factoriesAny.createSumTransform)({ + add: _pureFunctionsAnyGenerated.add, + config: _configReadonly.config, + numeric: _pureFunctionsAnyGenerated.numeric, + typed: _pureFunctionsAnyGenerated.typed + }), + range: (0, _factoriesAny.createRangeTransform)({ + bignumber: _pureFunctionsAnyGenerated.bignumber, + matrix: _pureFunctionsAnyGenerated.matrix, + add: _pureFunctionsAnyGenerated.add, + config: _configReadonly.config, + isPositive: _pureFunctionsAnyGenerated.isPositive, + larger: _pureFunctionsAnyGenerated.larger, + largerEq: _pureFunctionsAnyGenerated.largerEq, + smaller: _pureFunctionsAnyGenerated.smaller, + smallerEq: _pureFunctionsAnyGenerated.smallerEq, + typed: _pureFunctionsAnyGenerated.typed + }), + row: (0, _factoriesAny.createRowTransform)({ + Index: _pureFunctionsAnyGenerated.Index, + matrix: _pureFunctionsAnyGenerated.matrix, + range: _pureFunctionsAnyGenerated.range, + typed: _pureFunctionsAnyGenerated.typed + }), + column: (0, _factoriesAny.createColumnTransform)({ + Index: _pureFunctionsAnyGenerated.Index, + matrix: _pureFunctionsAnyGenerated.matrix, + range: _pureFunctionsAnyGenerated.range, + typed: _pureFunctionsAnyGenerated.typed + }), + mean: (0, _factoriesAny.createMeanTransform)({ + add: _pureFunctionsAnyGenerated.add, + divide: _pureFunctionsAnyGenerated.divide, + typed: _pureFunctionsAnyGenerated.typed + }), + quantileSeq: (0, _factoriesAny.createQuantileSeqTransform)({ + add: _pureFunctionsAnyGenerated.add, + bignumber: _pureFunctionsAnyGenerated.bignumber, + compare: _pureFunctionsAnyGenerated.compare, + divide: _pureFunctionsAnyGenerated.divide, + isInteger: _pureFunctionsAnyGenerated.isInteger, + larger: _pureFunctionsAnyGenerated.larger, + multiply: _pureFunctionsAnyGenerated.multiply, + partitionSelect: _pureFunctionsAnyGenerated.partitionSelect, + smaller: _pureFunctionsAnyGenerated.smaller, + smallerEq: _pureFunctionsAnyGenerated.smallerEq, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed + }), + variance: (0, _factoriesAny.createVarianceTransform)({ + add: _pureFunctionsAnyGenerated.add, + apply: _pureFunctionsAnyGenerated.apply, + divide: _pureFunctionsAnyGenerated.divide, + isNaN: _pureFunctionsAnyGenerated.isNaN, + multiply: _pureFunctionsAnyGenerated.multiply, + subtract: _pureFunctionsAnyGenerated.subtract, + typed: _pureFunctionsAnyGenerated.typed + }), + std: (0, _factoriesAny.createStdTransform)({ + map: _pureFunctionsAnyGenerated.map, + sqrt: _pureFunctionsAnyGenerated.sqrt, + typed: _pureFunctionsAnyGenerated.typed, + variance: _pureFunctionsAnyGenerated.variance + }) +}); +(0, _extends2.default)(classes, { + BigNumber: _pureFunctionsAnyGenerated.BigNumber, + Complex: _pureFunctionsAnyGenerated.Complex, + Fraction: _pureFunctionsAnyGenerated.Fraction, + Matrix: _pureFunctionsAnyGenerated.Matrix, + Node, + ObjectNode, + OperatorNode, + ParenthesisNode, + Range: _pureFunctionsAnyGenerated.Range, + RelationalNode, + ResultSet: _pureFunctionsAnyGenerated.ResultSet, + ArrayNode, + BlockNode, + ConditionalNode, + ConstantNode, + DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, + RangeNode, + Chain, + FunctionAssignmentNode, + SparseMatrix: _pureFunctionsAnyGenerated.SparseMatrix, + IndexNode, + ImmutableDenseMatrix: _pureFunctionsAnyGenerated.ImmutableDenseMatrix, + Index: _pureFunctionsAnyGenerated.Index, + AccessorNode, + AssignmentNode, + FibonacciHeap: _pureFunctionsAnyGenerated.FibonacciHeap, + Spa: _pureFunctionsAnyGenerated.Spa, + Unit: _pureFunctionsAnyGenerated.Unit, + SymbolNode, + FunctionNode, + Help, + Parser +}); +Chain.createProxy(math); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js new file mode 100644 index 0000000..6b687c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js @@ -0,0 +1,515 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.derivative = exports.compile = exports.chain = exports.SymbolNode = exports.RelationalNode = exports.RangeNode = exports.Parser = exports.ParenthesisNode = exports.OperatorNode = exports.ObjectNode = exports.Node = exports.IndexNode = exports.Help = exports.FunctionNode = exports.FunctionAssignmentNode = exports.ConstantNode = exports.ConditionalNode = exports.Chain = exports.BlockNode = exports.AssignmentNode = exports.ArrayNode = exports.AccessorNode = void 0; +Object.defineProperty(exports, "docs", { + enumerable: true, + get: function () { + return _embeddedDocs.embeddedDocs; + } +}); +exports.simplifyCore = exports.simplifyConstant = exports.simplify = exports.reviver = exports.resolve = exports.rationalize = exports.parser = exports.parse = exports.help = exports.evaluate = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _configReadonly = require("./configReadonly.js"); +var _factoriesNumber = require("../factoriesNumber.js"); +var _pureFunctionsNumberGenerated = require("./pureFunctionsNumber.generated.js"); +var _embeddedDocs = require("../expression/embeddedDocs/embeddedDocs.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const math = {}; // NOT pure! +const mathWithTransform = {}; // NOT pure! +const classes = {}; // NOT pure! + +const Chain = exports.Chain = (0, _factoriesNumber.createChainClass)({ + math, + typed: _pureFunctionsNumberGenerated.typed +}); +const Node = exports.Node = (0, _factoriesNumber.createNode)({ + mathWithTransform +}); +const ObjectNode = exports.ObjectNode = (0, _factoriesNumber.createObjectNode)({ + Node +}); +const RangeNode = exports.RangeNode = (0, _factoriesNumber.createRangeNode)({ + Node +}); +const RelationalNode = exports.RelationalNode = (0, _factoriesNumber.createRelationalNode)({ + Node +}); +const reviver = exports.reviver = (0, _factoriesNumber.createReviver)({ + classes +}); +const SymbolNode = exports.SymbolNode = (0, _factoriesNumber.createSymbolNode)({ + Node, + math +}); +const AccessorNode = exports.AccessorNode = (0, _factoriesNumber.createAccessorNode)({ + Node, + subset: _pureFunctionsNumberGenerated.subset +}); +const AssignmentNode = exports.AssignmentNode = (0, _factoriesNumber.createAssignmentNode)({ + matrix: _pureFunctionsNumberGenerated.matrix, + Node, + subset: _pureFunctionsNumberGenerated.subset +}); +const BlockNode = exports.BlockNode = (0, _factoriesNumber.createBlockNode)({ + Node, + ResultSet: _pureFunctionsNumberGenerated.ResultSet +}); +const chain = exports.chain = (0, _factoriesNumber.createChain)({ + Chain, + typed: _pureFunctionsNumberGenerated.typed +}); +const ConditionalNode = exports.ConditionalNode = (0, _factoriesNumber.createConditionalNode)({ + Node +}); +const FunctionNode = exports.FunctionNode = (0, _factoriesNumber.createFunctionNode)({ + Node, + SymbolNode, + math +}); +const IndexNode = exports.IndexNode = (0, _factoriesNumber.createIndexNode)({ + Node, + size: _pureFunctionsNumberGenerated.size +}); +const OperatorNode = exports.OperatorNode = (0, _factoriesNumber.createOperatorNode)({ + Node +}); +const ConstantNode = exports.ConstantNode = (0, _factoriesNumber.createConstantNode)({ + Node +}); +const FunctionAssignmentNode = exports.FunctionAssignmentNode = (0, _factoriesNumber.createFunctionAssignmentNode)({ + Node, + typed: _pureFunctionsNumberGenerated.typed +}); +const ParenthesisNode = exports.ParenthesisNode = (0, _factoriesNumber.createParenthesisNode)({ + Node +}); +const ArrayNode = exports.ArrayNode = (0, _factoriesNumber.createArrayNode)({ + Node +}); +const simplifyConstant = exports.simplifyConstant = (0, _factoriesNumber.createSimplifyConstant)({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + config: _configReadonly.config, + mathWithTransform, + matrix: _pureFunctionsNumberGenerated.matrix, + typed: _pureFunctionsNumberGenerated.typed +}); +const parse = exports.parse = (0, _factoriesNumber.createParse)({ + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode, + config: _configReadonly.config, + numeric: _pureFunctionsNumberGenerated.numeric, + typed: _pureFunctionsNumberGenerated.typed +}); +const resolve = exports.resolve = (0, _factoriesNumber.createResolve)({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + parse, + typed: _pureFunctionsNumberGenerated.typed +}); +const simplifyCore = exports.simplifyCore = (0, _factoriesNumber.createSimplifyCore)({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsNumberGenerated.add, + divide: _pureFunctionsNumberGenerated.divide, + equal: _pureFunctionsNumberGenerated.equal, + isZero: _pureFunctionsNumberGenerated.isZero, + multiply: _pureFunctionsNumberGenerated.multiply, + parse, + pow: _pureFunctionsNumberGenerated.pow, + subtract: _pureFunctionsNumberGenerated.subtract, + typed: _pureFunctionsNumberGenerated.typed +}); +const compile = exports.compile = (0, _factoriesNumber.createCompile)({ + parse, + typed: _pureFunctionsNumberGenerated.typed +}); +const evaluate = exports.evaluate = (0, _factoriesNumber.createEvaluate)({ + parse, + typed: _pureFunctionsNumberGenerated.typed +}); +const Help = exports.Help = (0, _factoriesNumber.createHelpClass)({ + evaluate +}); +const Parser = exports.Parser = (0, _factoriesNumber.createParserClass)({ + evaluate +}); +const simplify = exports.simplify = (0, _factoriesNumber.createSimplify)({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsNumberGenerated.add, + config: _configReadonly.config, + divide: _pureFunctionsNumberGenerated.divide, + equal: _pureFunctionsNumberGenerated.equal, + isZero: _pureFunctionsNumberGenerated.isZero, + mathWithTransform, + matrix: _pureFunctionsNumberGenerated.matrix, + multiply: _pureFunctionsNumberGenerated.multiply, + parse, + pow: _pureFunctionsNumberGenerated.pow, + resolve, + simplifyConstant, + simplifyCore, + subtract: _pureFunctionsNumberGenerated.subtract, + typed: _pureFunctionsNumberGenerated.typed +}); +const derivative = exports.derivative = (0, _factoriesNumber.createDerivative)({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + config: _configReadonly.config, + equal: _pureFunctionsNumberGenerated.equal, + isZero: _pureFunctionsNumberGenerated.isZero, + numeric: _pureFunctionsNumberGenerated.numeric, + parse, + simplify, + typed: _pureFunctionsNumberGenerated.typed +}); +const rationalize = exports.rationalize = (0, _factoriesNumber.createRationalize)({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add: _pureFunctionsNumberGenerated.add, + config: _configReadonly.config, + divide: _pureFunctionsNumberGenerated.divide, + equal: _pureFunctionsNumberGenerated.equal, + isZero: _pureFunctionsNumberGenerated.isZero, + mathWithTransform, + matrix: _pureFunctionsNumberGenerated.matrix, + multiply: _pureFunctionsNumberGenerated.multiply, + parse, + pow: _pureFunctionsNumberGenerated.pow, + simplify, + simplifyConstant, + simplifyCore, + subtract: _pureFunctionsNumberGenerated.subtract, + typed: _pureFunctionsNumberGenerated.typed +}); +const help = exports.help = (0, _factoriesNumber.createHelp)({ + Help, + mathWithTransform, + typed: _pureFunctionsNumberGenerated.typed +}); +const parser = exports.parser = (0, _factoriesNumber.createParser)({ + Parser, + typed: _pureFunctionsNumberGenerated.typed +}); +(0, _extends2.default)(math, { + e: _pureFunctionsNumberGenerated.e, + false: _pureFunctionsNumberGenerated._false, + index: _pureFunctionsNumberGenerated.index, + Infinity: _pureFunctionsNumberGenerated._Infinity, + LN10: _pureFunctionsNumberGenerated.LN10, + LOG10E: _pureFunctionsNumberGenerated.LOG10E, + matrix: _pureFunctionsNumberGenerated.matrix, + NaN: _pureFunctionsNumberGenerated._NaN, + null: _pureFunctionsNumberGenerated._null, + phi: _pureFunctionsNumberGenerated.phi, + replacer: _pureFunctionsNumberGenerated.replacer, + SQRT1_2: _pureFunctionsNumberGenerated.SQRT1_2, + subset: _pureFunctionsNumberGenerated.subset, + tau: _pureFunctionsNumberGenerated.tau, + typed: _pureFunctionsNumberGenerated.typed, + unaryPlus: _pureFunctionsNumberGenerated.unaryPlus, + 'E': _pureFunctionsNumberGenerated.e, + version: _pureFunctionsNumberGenerated.version, + xor: _pureFunctionsNumberGenerated.xor, + abs: _pureFunctionsNumberGenerated.abs, + acos: _pureFunctionsNumberGenerated.acos, + acot: _pureFunctionsNumberGenerated.acot, + acsc: _pureFunctionsNumberGenerated.acsc, + add: _pureFunctionsNumberGenerated.add, + and: _pureFunctionsNumberGenerated.and, + asec: _pureFunctionsNumberGenerated.asec, + asin: _pureFunctionsNumberGenerated.asin, + atan: _pureFunctionsNumberGenerated.atan, + atanh: _pureFunctionsNumberGenerated.atanh, + bigint: _pureFunctionsNumberGenerated.bigint, + bitNot: _pureFunctionsNumberGenerated.bitNot, + bitXor: _pureFunctionsNumberGenerated.bitXor, + boolean: _pureFunctionsNumberGenerated.boolean, + cbrt: _pureFunctionsNumberGenerated.cbrt, + combinations: _pureFunctionsNumberGenerated.combinations, + compare: _pureFunctionsNumberGenerated.compare, + compareText: _pureFunctionsNumberGenerated.compareText, + cos: _pureFunctionsNumberGenerated.cos, + cot: _pureFunctionsNumberGenerated.cot, + csc: _pureFunctionsNumberGenerated.csc, + cube: _pureFunctionsNumberGenerated.cube, + divide: _pureFunctionsNumberGenerated.divide, + equalScalar: _pureFunctionsNumberGenerated.equalScalar, + erf: _pureFunctionsNumberGenerated.erf, + exp: _pureFunctionsNumberGenerated.exp, + filter: _pureFunctionsNumberGenerated.filter, + forEach: _pureFunctionsNumberGenerated.forEach, + format: _pureFunctionsNumberGenerated.format, + gamma: _pureFunctionsNumberGenerated.gamma, + isInteger: _pureFunctionsNumberGenerated.isInteger, + isNegative: _pureFunctionsNumberGenerated.isNegative, + isPositive: _pureFunctionsNumberGenerated.isPositive, + isZero: _pureFunctionsNumberGenerated.isZero, + LOG2E: _pureFunctionsNumberGenerated.LOG2E, + largerEq: _pureFunctionsNumberGenerated.largerEq, + leftShift: _pureFunctionsNumberGenerated.leftShift, + log: _pureFunctionsNumberGenerated.log, + log1p: _pureFunctionsNumberGenerated.log1p, + map: _pureFunctionsNumberGenerated.map, + mean: _pureFunctionsNumberGenerated.mean, + mod: _pureFunctionsNumberGenerated.mod, + multiply: _pureFunctionsNumberGenerated.multiply, + not: _pureFunctionsNumberGenerated.not, + number: _pureFunctionsNumberGenerated.number, + or: _pureFunctionsNumberGenerated.or, + pi: _pureFunctionsNumberGenerated.pi, + pow: _pureFunctionsNumberGenerated.pow, + random: _pureFunctionsNumberGenerated.random, + reviver, + rightLogShift: _pureFunctionsNumberGenerated.rightLogShift, + SQRT2: _pureFunctionsNumberGenerated.SQRT2, + sech: _pureFunctionsNumberGenerated.sech, + sin: _pureFunctionsNumberGenerated.sin, + size: _pureFunctionsNumberGenerated.size, + smallerEq: _pureFunctionsNumberGenerated.smallerEq, + square: _pureFunctionsNumberGenerated.square, + string: _pureFunctionsNumberGenerated.string, + subtract: _pureFunctionsNumberGenerated.subtract, + tanh: _pureFunctionsNumberGenerated.tanh, + typeOf: _pureFunctionsNumberGenerated.typeOf, + unequal: _pureFunctionsNumberGenerated.unequal, + xgcd: _pureFunctionsNumberGenerated.xgcd, + acoth: _pureFunctionsNumberGenerated.acoth, + addScalar: _pureFunctionsNumberGenerated.addScalar, + asech: _pureFunctionsNumberGenerated.asech, + bitAnd: _pureFunctionsNumberGenerated.bitAnd, + chain, + combinationsWithRep: _pureFunctionsNumberGenerated.combinationsWithRep, + cosh: _pureFunctionsNumberGenerated.cosh, + csch: _pureFunctionsNumberGenerated.csch, + divideScalar: _pureFunctionsNumberGenerated.divideScalar, + equalText: _pureFunctionsNumberGenerated.equalText, + expm1: _pureFunctionsNumberGenerated.expm1, + isNumeric: _pureFunctionsNumberGenerated.isNumeric, + LN2: _pureFunctionsNumberGenerated.LN2, + lcm: _pureFunctionsNumberGenerated.lcm, + log10: _pureFunctionsNumberGenerated.log10, + multiplyScalar: _pureFunctionsNumberGenerated.multiplyScalar, + nthRoot: _pureFunctionsNumberGenerated.nthRoot, + pickRandom: _pureFunctionsNumberGenerated.pickRandom, + randomInt: _pureFunctionsNumberGenerated.randomInt, + rightArithShift: _pureFunctionsNumberGenerated.rightArithShift, + sec: _pureFunctionsNumberGenerated.sec, + sinh: _pureFunctionsNumberGenerated.sinh, + sqrt: _pureFunctionsNumberGenerated.sqrt, + tan: _pureFunctionsNumberGenerated.tan, + unaryMinus: _pureFunctionsNumberGenerated.unaryMinus, + acosh: _pureFunctionsNumberGenerated.acosh, + apply: _pureFunctionsNumberGenerated.apply, + asinh: _pureFunctionsNumberGenerated.asinh, + bitOr: _pureFunctionsNumberGenerated.bitOr, + clone: _pureFunctionsNumberGenerated.clone, + coth: _pureFunctionsNumberGenerated.coth, + equal: _pureFunctionsNumberGenerated.equal, + factorial: _pureFunctionsNumberGenerated.factorial, + hasNumericValue: _pureFunctionsNumberGenerated.hasNumericValue, + isNaN: _pureFunctionsNumberGenerated.isNaN, + larger: _pureFunctionsNumberGenerated.larger, + log2: _pureFunctionsNumberGenerated.log2, + mode: _pureFunctionsNumberGenerated.mode, + norm: _pureFunctionsNumberGenerated.norm, + partitionSelect: _pureFunctionsNumberGenerated.partitionSelect, + print: _pureFunctionsNumberGenerated.print, + round: _pureFunctionsNumberGenerated.round, + smaller: _pureFunctionsNumberGenerated.smaller, + subtractScalar: _pureFunctionsNumberGenerated.subtractScalar, + true: _pureFunctionsNumberGenerated._true, + variance: _pureFunctionsNumberGenerated.variance, + zeta: _pureFunctionsNumberGenerated.zeta, + acsch: _pureFunctionsNumberGenerated.acsch, + atan2: _pureFunctionsNumberGenerated.atan2, + catalan: _pureFunctionsNumberGenerated.catalan, + compareNatural: _pureFunctionsNumberGenerated.compareNatural, + composition: _pureFunctionsNumberGenerated.composition, + cumsum: _pureFunctionsNumberGenerated.cumsum, + floor: _pureFunctionsNumberGenerated.floor, + hypot: _pureFunctionsNumberGenerated.hypot, + lgamma: _pureFunctionsNumberGenerated.lgamma, + median: _pureFunctionsNumberGenerated.median, + multinomial: _pureFunctionsNumberGenerated.multinomial, + permutations: _pureFunctionsNumberGenerated.permutations, + quantileSeq: _pureFunctionsNumberGenerated.quantileSeq, + sign: _pureFunctionsNumberGenerated.sign, + std: _pureFunctionsNumberGenerated.std, + stirlingS2: _pureFunctionsNumberGenerated.stirlingS2, + 'PI': _pureFunctionsNumberGenerated.pi, + ceil: _pureFunctionsNumberGenerated.ceil, + deepEqual: _pureFunctionsNumberGenerated.deepEqual, + fix: _pureFunctionsNumberGenerated.fix, + isPrime: _pureFunctionsNumberGenerated.isPrime, + numeric: _pureFunctionsNumberGenerated.numeric, + prod: _pureFunctionsNumberGenerated.prod, + simplifyConstant, + bellNumbers: _pureFunctionsNumberGenerated.bellNumbers, + gcd: _pureFunctionsNumberGenerated.gcd, + mad: _pureFunctionsNumberGenerated.mad, + range: _pureFunctionsNumberGenerated.range, + sum: _pureFunctionsNumberGenerated.sum, + corr: _pureFunctionsNumberGenerated.corr, + max: _pureFunctionsNumberGenerated.max, + parse, + resolve, + simplifyCore, + compile, + evaluate, + simplify, + derivative, + min: _pureFunctionsNumberGenerated.min, + rationalize, + help, + parser, + config: _configReadonly.config +}); +(0, _extends2.default)(mathWithTransform, math, { + cumsum: (0, _factoriesNumber.createCumSumTransform)({ + add: _pureFunctionsNumberGenerated.add, + typed: _pureFunctionsNumberGenerated.typed, + unaryPlus: _pureFunctionsNumberGenerated.unaryPlus + }), + apply: (0, _factoriesNumber.createApplyTransform)({ + isInteger: _pureFunctionsNumberGenerated.isInteger, + typed: _pureFunctionsNumberGenerated.typed + }), + filter: (0, _factoriesNumber.createFilterTransform)({ + typed: _pureFunctionsNumberGenerated.typed + }), + forEach: (0, _factoriesNumber.createForEachTransform)({ + typed: _pureFunctionsNumberGenerated.typed + }), + map: (0, _factoriesNumber.createMapTransform)({ + typed: _pureFunctionsNumberGenerated.typed + }), + mean: (0, _factoriesNumber.createMeanTransform)({ + add: _pureFunctionsNumberGenerated.add, + divide: _pureFunctionsNumberGenerated.divide, + typed: _pureFunctionsNumberGenerated.typed + }), + subset: (0, _factoriesNumber.createSubsetTransform)({}), + range: (0, _factoriesNumber.createRangeTransform)({ + matrix: _pureFunctionsNumberGenerated.matrix, + add: _pureFunctionsNumberGenerated.add, + config: _configReadonly.config, + isPositive: _pureFunctionsNumberGenerated.isPositive, + larger: _pureFunctionsNumberGenerated.larger, + largerEq: _pureFunctionsNumberGenerated.largerEq, + smaller: _pureFunctionsNumberGenerated.smaller, + smallerEq: _pureFunctionsNumberGenerated.smallerEq, + typed: _pureFunctionsNumberGenerated.typed + }), + std: (0, _factoriesNumber.createStdTransform)({ + map: _pureFunctionsNumberGenerated.map, + sqrt: _pureFunctionsNumberGenerated.sqrt, + typed: _pureFunctionsNumberGenerated.typed, + variance: _pureFunctionsNumberGenerated.variance + }), + sum: (0, _factoriesNumber.createSumTransform)({ + add: _pureFunctionsNumberGenerated.add, + config: _configReadonly.config, + numeric: _pureFunctionsNumberGenerated.numeric, + typed: _pureFunctionsNumberGenerated.typed + }), + max: (0, _factoriesNumber.createMaxTransform)({ + config: _configReadonly.config, + larger: _pureFunctionsNumberGenerated.larger, + numeric: _pureFunctionsNumberGenerated.numeric, + typed: _pureFunctionsNumberGenerated.typed + }), + min: (0, _factoriesNumber.createMinTransform)({ + config: _configReadonly.config, + numeric: _pureFunctionsNumberGenerated.numeric, + smaller: _pureFunctionsNumberGenerated.smaller, + typed: _pureFunctionsNumberGenerated.typed + }), + variance: (0, _factoriesNumber.createVarianceTransform)({ + add: _pureFunctionsNumberGenerated.add, + apply: _pureFunctionsNumberGenerated.apply, + divide: _pureFunctionsNumberGenerated.divide, + isNaN: _pureFunctionsNumberGenerated.isNaN, + multiply: _pureFunctionsNumberGenerated.multiply, + subtract: _pureFunctionsNumberGenerated.subtract, + typed: _pureFunctionsNumberGenerated.typed + }) +}); +(0, _extends2.default)(classes, { + Range: _pureFunctionsNumberGenerated.Range, + ResultSet: _pureFunctionsNumberGenerated.ResultSet, + Chain, + Node, + ObjectNode, + RangeNode, + RelationalNode, + SymbolNode, + AccessorNode, + AssignmentNode, + BlockNode, + ConditionalNode, + FunctionNode, + IndexNode, + OperatorNode, + ConstantNode, + FunctionAssignmentNode, + ParenthesisNode, + ArrayNode, + Help, + Parser +}); +Chain.createProxy(math); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainAny.js new file mode 100644 index 0000000..2b46e44 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainAny.js @@ -0,0 +1,115 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + config: true, + IndexError: true, + DimensionError: true, + ArgumentsError: true, + create: true, + factory: true +}; +Object.defineProperty(exports, "ArgumentsError", { + enumerable: true, + get: function () { + return _ArgumentsError.ArgumentsError; + } +}); +Object.defineProperty(exports, "DimensionError", { + enumerable: true, + get: function () { + return _DimensionError.DimensionError; + } +}); +Object.defineProperty(exports, "IndexError", { + enumerable: true, + get: function () { + return _IndexError.IndexError; + } +}); +Object.defineProperty(exports, "config", { + enumerable: true, + get: function () { + return _configReadonly.config; + } +}); +Object.defineProperty(exports, "create", { + enumerable: true, + get: function () { + return _create.create; + } +}); +Object.defineProperty(exports, "factory", { + enumerable: true, + get: function () { + return _factory.factory; + } +}); +var _configReadonly = require("./configReadonly.js"); +var _pureFunctionsAnyGenerated = require("./pureFunctionsAny.generated.js"); +Object.keys(_pureFunctionsAnyGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _pureFunctionsAnyGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _pureFunctionsAnyGenerated[key]; + } + }); +}); +var _impureFunctionsAnyGenerated = require("./impureFunctionsAny.generated.js"); +Object.keys(_impureFunctionsAnyGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _impureFunctionsAnyGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _impureFunctionsAnyGenerated[key]; + } + }); +}); +var _typeChecks = require("./typeChecks.js"); +Object.keys(_typeChecks).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _typeChecks[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _typeChecks[key]; + } + }); +}); +var _IndexError = require("../error/IndexError.js"); +var _DimensionError = require("../error/DimensionError.js"); +var _ArgumentsError = require("../error/ArgumentsError.js"); +var _dependenciesAnyGenerated = require("./dependenciesAny.generated.js"); +Object.keys(_dependenciesAnyGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _dependenciesAnyGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _dependenciesAnyGenerated[key]; + } + }); +}); +var _factoriesAny = require("../factoriesAny.js"); +Object.keys(_factoriesAny).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _factoriesAny[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _factoriesAny[key]; + } + }); +}); +var _create = require("../core/create.js"); +var _factory = require("../utils/factory.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainNumber.js new file mode 100644 index 0000000..8e1e282 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/mainNumber.js @@ -0,0 +1,115 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + config: true, + IndexError: true, + DimensionError: true, + ArgumentsError: true, + create: true, + factory: true +}; +Object.defineProperty(exports, "ArgumentsError", { + enumerable: true, + get: function () { + return _ArgumentsError.ArgumentsError; + } +}); +Object.defineProperty(exports, "DimensionError", { + enumerable: true, + get: function () { + return _DimensionError.DimensionError; + } +}); +Object.defineProperty(exports, "IndexError", { + enumerable: true, + get: function () { + return _IndexError.IndexError; + } +}); +Object.defineProperty(exports, "config", { + enumerable: true, + get: function () { + return _configReadonly.config; + } +}); +Object.defineProperty(exports, "create", { + enumerable: true, + get: function () { + return _create.create; + } +}); +Object.defineProperty(exports, "factory", { + enumerable: true, + get: function () { + return _factory.factory; + } +}); +var _configReadonly = require("./configReadonly.js"); +var _pureFunctionsNumberGenerated = require("./pureFunctionsNumber.generated.js"); +Object.keys(_pureFunctionsNumberGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _pureFunctionsNumberGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _pureFunctionsNumberGenerated[key]; + } + }); +}); +var _impureFunctionsNumberGenerated = require("./impureFunctionsNumber.generated.js"); +Object.keys(_impureFunctionsNumberGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _impureFunctionsNumberGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _impureFunctionsNumberGenerated[key]; + } + }); +}); +var _typeChecks = require("./typeChecks.js"); +Object.keys(_typeChecks).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _typeChecks[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _typeChecks[key]; + } + }); +}); +var _IndexError = require("../error/IndexError.js"); +var _DimensionError = require("../error/DimensionError.js"); +var _ArgumentsError = require("../error/ArgumentsError.js"); +var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); +Object.keys(_dependenciesNumberGenerated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _dependenciesNumberGenerated[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _dependenciesNumberGenerated[key]; + } + }); +}); +var _factoriesNumber = require("../factoriesNumber.js"); +Object.keys(_factoriesNumber).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _factoriesNumber[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _factoriesNumber[key]; + } + }); +}); +var _create = require("../core/create.js"); +var _factory = require("../utils/factory.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js new file mode 100644 index 0000000..c82ccbe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js @@ -0,0 +1,1801 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.e = exports.dotPow = exports.dotMultiply = exports.dotDivide = exports.dot = exports.divideScalar = exports.divide = exports.distance = exports.diff = exports.diag = exports.deuteronMass = exports.det = exports.deepEqual = exports.cumsum = exports.cube = exports.ctranspose = exports.csch = exports.csc = exports.cross = exports.createUnit = exports.count = exports.coulomb = exports.coth = exports.cot = exports.cosh = exports.cos = exports.corr = exports.conj = exports.conductanceQuantum = exports.concat = exports.composition = exports.complex = exports.compareText = exports.compareNatural = exports.compare = exports.combinationsWithRep = exports.combinations = exports.column = exports.clone = exports.classicalElectronRadius = exports.ceil = exports.cbrt = exports.catalan = exports.boolean = exports.boltzmann = exports.bohrRadius = exports.bohrMagneton = exports.bitXor = exports.bitOr = exports.bitNot = exports.bitAnd = exports.bin = exports.bignumber = exports.bigint = exports.bellNumbers = exports.avogadro = exports.atomicMass = exports.atanh = exports.atan2 = exports.atan = exports.asinh = exports.asin = exports.asech = exports.asec = exports.arg = exports.apply = exports.and = exports.addScalar = exports.add = exports.acsch = exports.acsc = exports.acoth = exports.acot = exports.acosh = exports.acos = exports.abs = exports._true = exports._null = exports._false = exports._NaN = exports._Infinity = exports.Unit = exports.SparseMatrix = exports.Spa = exports.SQRT2 = exports.SQRT1_2 = exports.ResultSet = exports.Range = exports.Matrix = exports.LOG2E = exports.LOG10E = exports.LN2 = exports.LN10 = exports.Index = exports.ImmutableDenseMatrix = exports.Fraction = exports.FibonacciHeap = exports.DenseMatrix = exports.Complex = exports.BigNumber = void 0; +exports.oct = exports.numeric = exports.number = exports.nuclearMagneton = exports.nthRoots = exports.nthRoot = exports.not = exports.norm = exports.neutronMass = exports.multiplyScalar = exports.multiply = exports.multinomial = exports.molarVolume = exports.molarPlanckConstant = exports.molarMassC12 = exports.molarMass = exports.mode = exports.mod = exports.min = exports.median = exports.mean = exports.max = exports.matrixFromRows = exports.matrixFromFunction = exports.matrixFromColumns = exports.matrix = exports.map = exports.magneticFluxQuantum = exports.magneticConstant = exports.mad = exports.lyap = exports.lusolve = exports.lup = exports.lsolveAll = exports.lsolve = exports.loschmidt = exports.log2 = exports.log1p = exports.log10 = exports.log = exports.lgamma = exports.leftShift = exports.lcm = exports.largerEq = exports.larger = exports.kron = exports.klitzing = exports.kldivergence = exports.isZero = exports.isPrime = exports.isPositive = exports.isNumeric = exports.isNegative = exports.isNaN = exports.isInteger = exports.invmod = exports.inverseConductanceQuantum = exports.inv = exports.intersect = exports.index = exports.im = exports.ifft = exports.identity = exports.i = exports.hypot = exports.hex = exports.hasNumericValue = exports.hartreeEnergy = exports.gravity = exports.gravitationConstant = exports.getMatrixDataType = exports.gcd = exports.gasConstant = exports.gamma = exports.freqz = exports.fraction = exports.format = exports.forEach = exports.floor = exports.flatten = exports.fix = exports.firstRadiation = exports.fineStructure = exports.filter = exports.fft = exports.fermiCoupling = exports.faraday = exports.factorial = exports.expm1 = exports.expm = exports.exp = exports.erf = exports.equalText = exports.equalScalar = exports.equal = exports.elementaryCharge = exports.electronMass = exports.electricConstant = exports.eigs = exports.efimovFactor = void 0; +exports.zeros = exports.xor = exports.xgcd = exports.wienDisplacement = exports.weakMixingAngle = exports.version = exports.variance = exports.vacuumImpedance = exports.usolveAll = exports.usolve = exports.unit = exports.unequal = exports.unaryPlus = exports.unaryMinus = exports.typed = exports.typeOf = exports.transpose = exports.trace = exports.to = exports.thomsonCrossSection = exports.tau = exports.tanh = exports.tan = exports.sylvester = exports.sum = exports.subtractScalar = exports.subtract = exports.subset = exports.string = exports.stirlingS2 = exports.stefanBoltzmann = exports.std = exports.squeeze = exports.square = exports.sqrtm = exports.sqrt = exports.splitUnit = exports.speedOfLight = exports.sparse = exports.sort = exports.solveODE = exports.smallerEq = exports.smaller = exports.slu = exports.size = exports.sinh = exports.sin = exports.sign = exports.setUnion = exports.setSymDifference = exports.setSize = exports.setPowerset = exports.setMultiplicity = exports.setIsSubset = exports.setIntersect = exports.setDistinct = exports.setDifference = exports.setCartesian = exports.secondRadiation = exports.sech = exports.sec = exports.schur = exports.sackurTetrode = exports.rydberg = exports.row = exports.round = exports.rotationMatrix = exports.rotate = exports.rightLogShift = exports.rightArithShift = exports.resize = exports.reshape = exports.replacer = exports.reducedPlanckConstant = exports.re = exports.range = exports.randomInt = exports.random = exports.quantumOfCirculation = exports.quantileSeq = exports.qr = exports.protonMass = exports.prod = exports.print = exports.pow = exports.polynomialRoot = exports.planckTime = exports.planckTemperature = exports.planckMass = exports.planckLength = exports.planckConstant = exports.planckCharge = exports.pinv = exports.pickRandom = exports.pi = exports.phi = exports.permutations = exports.partitionSelect = exports.or = exports.ones = void 0; +exports.zpk2tf = exports.zeta = void 0; +var _configReadonly = require("./configReadonly.js"); +var _factoriesAny = require("../factoriesAny.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const BigNumber = exports.BigNumber = /* #__PURE__ */(0, _factoriesAny.createBigNumberClass)({ + config: _configReadonly.config +}); +const Complex = exports.Complex = /* #__PURE__ */(0, _factoriesAny.createComplexClass)({}); +const e = exports.e = /* #__PURE__ */(0, _factoriesAny.createE)({ + BigNumber, + config: _configReadonly.config +}); +const _false = exports._false = /* #__PURE__ */(0, _factoriesAny.createFalse)({}); +const fineStructure = exports.fineStructure = /* #__PURE__ */(0, _factoriesAny.createFineStructure)({ + BigNumber, + config: _configReadonly.config +}); +const Fraction = exports.Fraction = /* #__PURE__ */(0, _factoriesAny.createFractionClass)({}); +const i = exports.i = /* #__PURE__ */(0, _factoriesAny.createI)({ + Complex +}); +const _Infinity = exports._Infinity = /* #__PURE__ */(0, _factoriesAny.createInfinity)({ + BigNumber, + config: _configReadonly.config +}); +const LN10 = exports.LN10 = /* #__PURE__ */(0, _factoriesAny.createLN10)({ + BigNumber, + config: _configReadonly.config +}); +const LOG10E = exports.LOG10E = /* #__PURE__ */(0, _factoriesAny.createLOG10E)({ + BigNumber, + config: _configReadonly.config +}); +const Matrix = exports.Matrix = /* #__PURE__ */(0, _factoriesAny.createMatrixClass)({}); +const _NaN = exports._NaN = /* #__PURE__ */(0, _factoriesAny.createNaN)({ + BigNumber, + config: _configReadonly.config +}); +const _null = exports._null = /* #__PURE__ */(0, _factoriesAny.createNull)({}); +const phi = exports.phi = /* #__PURE__ */(0, _factoriesAny.createPhi)({ + BigNumber, + config: _configReadonly.config +}); +const Range = exports.Range = /* #__PURE__ */(0, _factoriesAny.createRangeClass)({}); +const ResultSet = exports.ResultSet = /* #__PURE__ */(0, _factoriesAny.createResultSet)({}); +const SQRT1_2 = exports.SQRT1_2 = /* #__PURE__ */(0, _factoriesAny.createSQRT1_2)({ + BigNumber, + config: _configReadonly.config +}); +const sackurTetrode = exports.sackurTetrode = /* #__PURE__ */(0, _factoriesAny.createSackurTetrode)({ + BigNumber, + config: _configReadonly.config +}); +const tau = exports.tau = /* #__PURE__ */(0, _factoriesAny.createTau)({ + BigNumber, + config: _configReadonly.config +}); +const _true = exports._true = /* #__PURE__ */(0, _factoriesAny.createTrue)({}); +const version = exports.version = /* #__PURE__ */(0, _factoriesAny.createVersion)({}); +const DenseMatrix = exports.DenseMatrix = /* #__PURE__ */(0, _factoriesAny.createDenseMatrixClass)({ + Matrix +}); +const efimovFactor = exports.efimovFactor = /* #__PURE__ */(0, _factoriesAny.createEfimovFactor)({ + BigNumber, + config: _configReadonly.config +}); +const LN2 = exports.LN2 = /* #__PURE__ */(0, _factoriesAny.createLN2)({ + BigNumber, + config: _configReadonly.config +}); +const pi = exports.pi = /* #__PURE__ */(0, _factoriesAny.createPi)({ + BigNumber, + config: _configReadonly.config +}); +const replacer = exports.replacer = /* #__PURE__ */(0, _factoriesAny.createReplacer)({}); +const SQRT2 = exports.SQRT2 = /* #__PURE__ */(0, _factoriesAny.createSQRT2)({ + BigNumber, + config: _configReadonly.config +}); +const typed = exports.typed = /* #__PURE__ */(0, _factoriesAny.createTyped)({ + BigNumber, + Complex, + DenseMatrix, + Fraction +}); +const weakMixingAngle = exports.weakMixingAngle = /* #__PURE__ */(0, _factoriesAny.createWeakMixingAngle)({ + BigNumber, + config: _configReadonly.config +}); +const abs = exports.abs = /* #__PURE__ */(0, _factoriesAny.createAbs)({ + typed +}); +const acos = exports.acos = /* #__PURE__ */(0, _factoriesAny.createAcos)({ + Complex, + config: _configReadonly.config, + typed +}); +const acot = exports.acot = /* #__PURE__ */(0, _factoriesAny.createAcot)({ + BigNumber, + typed +}); +const acsc = exports.acsc = /* #__PURE__ */(0, _factoriesAny.createAcsc)({ + BigNumber, + Complex, + config: _configReadonly.config, + typed +}); +const addScalar = exports.addScalar = /* #__PURE__ */(0, _factoriesAny.createAddScalar)({ + typed +}); +const arg = exports.arg = /* #__PURE__ */(0, _factoriesAny.createArg)({ + typed +}); +const asech = exports.asech = /* #__PURE__ */(0, _factoriesAny.createAsech)({ + BigNumber, + Complex, + config: _configReadonly.config, + typed +}); +const asinh = exports.asinh = /* #__PURE__ */(0, _factoriesAny.createAsinh)({ + typed +}); +const atan = exports.atan = /* #__PURE__ */(0, _factoriesAny.createAtan)({ + typed +}); +const atanh = exports.atanh = /* #__PURE__ */(0, _factoriesAny.createAtanh)({ + Complex, + config: _configReadonly.config, + typed +}); +const bigint = exports.bigint = /* #__PURE__ */(0, _factoriesAny.createBigint)({ + typed +}); +const bitNot = exports.bitNot = /* #__PURE__ */(0, _factoriesAny.createBitNot)({ + typed +}); +const boolean = exports.boolean = /* #__PURE__ */(0, _factoriesAny.createBoolean)({ + typed +}); +const clone = exports.clone = /* #__PURE__ */(0, _factoriesAny.createClone)({ + typed +}); +const combinations = exports.combinations = /* #__PURE__ */(0, _factoriesAny.createCombinations)({ + typed +}); +const complex = exports.complex = /* #__PURE__ */(0, _factoriesAny.createComplex)({ + Complex, + typed +}); +const conj = exports.conj = /* #__PURE__ */(0, _factoriesAny.createConj)({ + typed +}); +const cos = exports.cos = /* #__PURE__ */(0, _factoriesAny.createCos)({ + typed +}); +const cot = exports.cot = /* #__PURE__ */(0, _factoriesAny.createCot)({ + BigNumber, + typed +}); +const csc = exports.csc = /* #__PURE__ */(0, _factoriesAny.createCsc)({ + BigNumber, + typed +}); +const cube = exports.cube = /* #__PURE__ */(0, _factoriesAny.createCube)({ + typed +}); +const equalScalar = exports.equalScalar = /* #__PURE__ */(0, _factoriesAny.createEqualScalar)({ + config: _configReadonly.config, + typed +}); +const erf = exports.erf = /* #__PURE__ */(0, _factoriesAny.createErf)({ + typed +}); +const exp = exports.exp = /* #__PURE__ */(0, _factoriesAny.createExp)({ + typed +}); +const expm1 = exports.expm1 = /* #__PURE__ */(0, _factoriesAny.createExpm1)({ + Complex, + typed +}); +const filter = exports.filter = /* #__PURE__ */(0, _factoriesAny.createFilter)({ + typed +}); +const flatten = exports.flatten = /* #__PURE__ */(0, _factoriesAny.createFlatten)({ + typed +}); +const forEach = exports.forEach = /* #__PURE__ */(0, _factoriesAny.createForEach)({ + typed +}); +const format = exports.format = /* #__PURE__ */(0, _factoriesAny.createFormat)({ + typed +}); +const getMatrixDataType = exports.getMatrixDataType = /* #__PURE__ */(0, _factoriesAny.createGetMatrixDataType)({ + typed +}); +const hex = exports.hex = /* #__PURE__ */(0, _factoriesAny.createHex)({ + format, + typed +}); +const im = exports.im = /* #__PURE__ */(0, _factoriesAny.createIm)({ + typed +}); +const isInteger = exports.isInteger = /* #__PURE__ */(0, _factoriesAny.createIsInteger)({ + typed +}); +const isNegative = exports.isNegative = /* #__PURE__ */(0, _factoriesAny.createIsNegative)({ + config: _configReadonly.config, + typed +}); +const isPositive = exports.isPositive = /* #__PURE__ */(0, _factoriesAny.createIsPositive)({ + config: _configReadonly.config, + typed +}); +const isZero = exports.isZero = /* #__PURE__ */(0, _factoriesAny.createIsZero)({ + equalScalar, + typed +}); +const LOG2E = exports.LOG2E = /* #__PURE__ */(0, _factoriesAny.createLOG2E)({ + BigNumber, + config: _configReadonly.config +}); +const lgamma = exports.lgamma = /* #__PURE__ */(0, _factoriesAny.createLgamma)({ + Complex, + typed +}); +const log10 = exports.log10 = /* #__PURE__ */(0, _factoriesAny.createLog10)({ + Complex, + config: _configReadonly.config, + typed +}); +const log2 = exports.log2 = /* #__PURE__ */(0, _factoriesAny.createLog2)({ + Complex, + config: _configReadonly.config, + typed +}); +const map = exports.map = /* #__PURE__ */(0, _factoriesAny.createMap)({ + typed +}); +const multiplyScalar = exports.multiplyScalar = /* #__PURE__ */(0, _factoriesAny.createMultiplyScalar)({ + typed +}); +const not = exports.not = /* #__PURE__ */(0, _factoriesAny.createNot)({ + typed +}); +const number = exports.number = /* #__PURE__ */(0, _factoriesAny.createNumber)({ + typed +}); +const oct = exports.oct = /* #__PURE__ */(0, _factoriesAny.createOct)({ + format, + typed +}); +const pickRandom = exports.pickRandom = /* #__PURE__ */(0, _factoriesAny.createPickRandom)({ + config: _configReadonly.config, + typed +}); +const print = exports.print = /* #__PURE__ */(0, _factoriesAny.createPrint)({ + typed +}); +const random = exports.random = /* #__PURE__ */(0, _factoriesAny.createRandom)({ + config: _configReadonly.config, + typed +}); +const re = exports.re = /* #__PURE__ */(0, _factoriesAny.createRe)({ + typed +}); +const sec = exports.sec = /* #__PURE__ */(0, _factoriesAny.createSec)({ + BigNumber, + typed +}); +const sign = exports.sign = /* #__PURE__ */(0, _factoriesAny.createSign)({ + BigNumber, + Fraction, + complex, + typed +}); +const sin = exports.sin = /* #__PURE__ */(0, _factoriesAny.createSin)({ + typed +}); +const SparseMatrix = exports.SparseMatrix = /* #__PURE__ */(0, _factoriesAny.createSparseMatrixClass)({ + Matrix, + equalScalar, + typed +}); +const splitUnit = exports.splitUnit = /* #__PURE__ */(0, _factoriesAny.createSplitUnit)({ + typed +}); +const square = exports.square = /* #__PURE__ */(0, _factoriesAny.createSquare)({ + typed +}); +const string = exports.string = /* #__PURE__ */(0, _factoriesAny.createString)({ + typed +}); +const subtractScalar = exports.subtractScalar = /* #__PURE__ */(0, _factoriesAny.createSubtractScalar)({ + typed +}); +const tan = exports.tan = /* #__PURE__ */(0, _factoriesAny.createTan)({ + typed +}); +const typeOf = exports.typeOf = /* #__PURE__ */(0, _factoriesAny.createTypeOf)({ + typed +}); +const acosh = exports.acosh = /* #__PURE__ */(0, _factoriesAny.createAcosh)({ + Complex, + config: _configReadonly.config, + typed +}); +const acsch = exports.acsch = /* #__PURE__ */(0, _factoriesAny.createAcsch)({ + BigNumber, + typed +}); +const apply = exports.apply = /* #__PURE__ */(0, _factoriesAny.createApply)({ + isInteger, + typed +}); +const asec = exports.asec = /* #__PURE__ */(0, _factoriesAny.createAsec)({ + BigNumber, + Complex, + config: _configReadonly.config, + typed +}); +const bignumber = exports.bignumber = /* #__PURE__ */(0, _factoriesAny.createBignumber)({ + BigNumber, + typed +}); +const combinationsWithRep = exports.combinationsWithRep = /* #__PURE__ */(0, _factoriesAny.createCombinationsWithRep)({ + typed +}); +const cosh = exports.cosh = /* #__PURE__ */(0, _factoriesAny.createCosh)({ + typed +}); +const csch = exports.csch = /* #__PURE__ */(0, _factoriesAny.createCsch)({ + BigNumber, + typed +}); +const isNaN = exports.isNaN = /* #__PURE__ */(0, _factoriesAny.createIsNaN)({ + typed +}); +const isPrime = exports.isPrime = /* #__PURE__ */(0, _factoriesAny.createIsPrime)({ + typed +}); +const randomInt = exports.randomInt = /* #__PURE__ */(0, _factoriesAny.createRandomInt)({ + config: _configReadonly.config, + typed +}); +const sech = exports.sech = /* #__PURE__ */(0, _factoriesAny.createSech)({ + BigNumber, + typed +}); +const sinh = exports.sinh = /* #__PURE__ */(0, _factoriesAny.createSinh)({ + typed +}); +const sparse = exports.sparse = /* #__PURE__ */(0, _factoriesAny.createSparse)({ + SparseMatrix, + typed +}); +const sqrt = exports.sqrt = /* #__PURE__ */(0, _factoriesAny.createSqrt)({ + Complex, + config: _configReadonly.config, + typed +}); +const squeeze = exports.squeeze = /* #__PURE__ */(0, _factoriesAny.createSqueeze)({ + typed +}); +const tanh = exports.tanh = /* #__PURE__ */(0, _factoriesAny.createTanh)({ + typed +}); +const unaryMinus = exports.unaryMinus = /* #__PURE__ */(0, _factoriesAny.createUnaryMinus)({ + typed +}); +const acoth = exports.acoth = /* #__PURE__ */(0, _factoriesAny.createAcoth)({ + BigNumber, + Complex, + config: _configReadonly.config, + typed +}); +const bin = exports.bin = /* #__PURE__ */(0, _factoriesAny.createBin)({ + format, + typed +}); +const coth = exports.coth = /* #__PURE__ */(0, _factoriesAny.createCoth)({ + BigNumber, + typed +}); +const fraction = exports.fraction = /* #__PURE__ */(0, _factoriesAny.createFraction)({ + Fraction, + typed +}); +const isNumeric = exports.isNumeric = /* #__PURE__ */(0, _factoriesAny.createIsNumeric)({ + typed +}); +const matrix = exports.matrix = /* #__PURE__ */(0, _factoriesAny.createMatrix)({ + DenseMatrix, + Matrix, + SparseMatrix, + typed +}); +const matrixFromFunction = exports.matrixFromFunction = /* #__PURE__ */(0, _factoriesAny.createMatrixFromFunction)({ + isZero, + matrix, + typed +}); +const mode = exports.mode = /* #__PURE__ */(0, _factoriesAny.createMode)({ + isNaN, + isNumeric, + typed +}); +const numeric = exports.numeric = /* #__PURE__ */(0, _factoriesAny.createNumeric)({ + bignumber, + fraction, + number +}); +const prod = exports.prod = /* #__PURE__ */(0, _factoriesAny.createProd)({ + config: _configReadonly.config, + multiplyScalar, + numeric, + typed +}); +const reshape = exports.reshape = /* #__PURE__ */(0, _factoriesAny.createReshape)({ + isInteger, + matrix, + typed +}); +const size = exports.size = /* #__PURE__ */(0, _factoriesAny.createSize)({ + matrix, + config: _configReadonly.config, + typed +}); +const transpose = exports.transpose = /* #__PURE__ */(0, _factoriesAny.createTranspose)({ + matrix, + typed +}); +const xgcd = exports.xgcd = /* #__PURE__ */(0, _factoriesAny.createXgcd)({ + BigNumber, + config: _configReadonly.config, + matrix, + typed +}); +const zeros = exports.zeros = /* #__PURE__ */(0, _factoriesAny.createZeros)({ + BigNumber, + config: _configReadonly.config, + matrix, + typed +}); +const asin = exports.asin = /* #__PURE__ */(0, _factoriesAny.createAsin)({ + Complex, + config: _configReadonly.config, + typed +}); +const cbrt = exports.cbrt = /* #__PURE__ */(0, _factoriesAny.createCbrt)({ + BigNumber, + Complex, + Fraction, + config: _configReadonly.config, + isNegative, + matrix, + typed, + unaryMinus +}); +const concat = exports.concat = /* #__PURE__ */(0, _factoriesAny.createConcat)({ + isInteger, + matrix, + typed +}); +const count = exports.count = /* #__PURE__ */(0, _factoriesAny.createCount)({ + prod, + size, + typed +}); +const ctranspose = exports.ctranspose = /* #__PURE__ */(0, _factoriesAny.createCtranspose)({ + conj, + transpose, + typed +}); +const diag = exports.diag = /* #__PURE__ */(0, _factoriesAny.createDiag)({ + DenseMatrix, + SparseMatrix, + matrix, + typed +}); +const divideScalar = exports.divideScalar = /* #__PURE__ */(0, _factoriesAny.createDivideScalar)({ + numeric, + typed +}); +const dotDivide = exports.dotDivide = /* #__PURE__ */(0, _factoriesAny.createDotDivide)({ + DenseMatrix, + concat, + divideScalar, + equalScalar, + matrix, + typed +}); +const equal = exports.equal = /* #__PURE__ */(0, _factoriesAny.createEqual)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +const hasNumericValue = exports.hasNumericValue = /* #__PURE__ */(0, _factoriesAny.createHasNumericValue)({ + isNumeric, + typed +}); +const identity = exports.identity = /* #__PURE__ */(0, _factoriesAny.createIdentity)({ + BigNumber, + DenseMatrix, + SparseMatrix, + config: _configReadonly.config, + matrix, + typed +}); +const kron = exports.kron = /* #__PURE__ */(0, _factoriesAny.createKron)({ + matrix, + multiplyScalar, + typed +}); +const largerEq = exports.largerEq = /* #__PURE__ */(0, _factoriesAny.createLargerEq)({ + DenseMatrix, + concat, + config: _configReadonly.config, + matrix, + typed +}); +const leftShift = exports.leftShift = /* #__PURE__ */(0, _factoriesAny.createLeftShift)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +const lsolve = exports.lsolve = /* #__PURE__ */(0, _factoriesAny.createLsolve)({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +const matrixFromColumns = exports.matrixFromColumns = /* #__PURE__ */(0, _factoriesAny.createMatrixFromColumns)({ + flatten, + matrix, + size, + typed +}); +const nthRoot = exports.nthRoot = /* #__PURE__ */(0, _factoriesAny.createNthRoot)({ + BigNumber, + concat, + equalScalar, + matrix, + typed +}); +const ones = exports.ones = /* #__PURE__ */(0, _factoriesAny.createOnes)({ + BigNumber, + config: _configReadonly.config, + matrix, + typed +}); +const qr = exports.qr = /* #__PURE__ */(0, _factoriesAny.createQr)({ + addScalar, + complex, + conj, + divideScalar, + equal, + identity, + isZero, + matrix, + multiplyScalar, + sign, + sqrt, + subtractScalar, + typed, + unaryMinus, + zeros +}); +const resize = exports.resize = /* #__PURE__ */(0, _factoriesAny.createResize)({ + config: _configReadonly.config, + matrix +}); +const rightArithShift = exports.rightArithShift = /* #__PURE__ */(0, _factoriesAny.createRightArithShift)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +const round = exports.round = /* #__PURE__ */(0, _factoriesAny.createRound)({ + BigNumber, + DenseMatrix, + config: _configReadonly.config, + equalScalar, + matrix, + typed, + zeros +}); +const smaller = exports.smaller = /* #__PURE__ */(0, _factoriesAny.createSmaller)({ + DenseMatrix, + concat, + config: _configReadonly.config, + matrix, + typed +}); +const subtract = exports.subtract = /* #__PURE__ */(0, _factoriesAny.createSubtract)({ + DenseMatrix, + concat, + equalScalar, + matrix, + subtractScalar, + typed, + unaryMinus +}); +const to = exports.to = /* #__PURE__ */(0, _factoriesAny.createTo)({ + concat, + matrix, + typed +}); +const unaryPlus = exports.unaryPlus = /* #__PURE__ */(0, _factoriesAny.createUnaryPlus)({ + config: _configReadonly.config, + numeric, + typed +}); +const usolve = exports.usolve = /* #__PURE__ */(0, _factoriesAny.createUsolve)({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +const xor = exports.xor = /* #__PURE__ */(0, _factoriesAny.createXor)({ + DenseMatrix, + concat, + matrix, + typed +}); +const add = exports.add = /* #__PURE__ */(0, _factoriesAny.createAdd)({ + DenseMatrix, + SparseMatrix, + addScalar, + concat, + equalScalar, + matrix, + typed +}); +const atan2 = exports.atan2 = /* #__PURE__ */(0, _factoriesAny.createAtan2)({ + BigNumber, + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +const bitAnd = exports.bitAnd = /* #__PURE__ */(0, _factoriesAny.createBitAnd)({ + concat, + equalScalar, + matrix, + typed +}); +const bitOr = exports.bitOr = /* #__PURE__ */(0, _factoriesAny.createBitOr)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +const bitXor = exports.bitXor = /* #__PURE__ */(0, _factoriesAny.createBitXor)({ + DenseMatrix, + concat, + matrix, + typed +}); +const catalan = exports.catalan = /* #__PURE__ */(0, _factoriesAny.createCatalan)({ + addScalar, + combinations, + divideScalar, + isInteger, + isNegative, + multiplyScalar, + typed +}); +const compare = exports.compare = /* #__PURE__ */(0, _factoriesAny.createCompare)({ + BigNumber, + DenseMatrix, + Fraction, + concat, + config: _configReadonly.config, + equalScalar, + matrix, + typed +}); +const compareText = exports.compareText = /* #__PURE__ */(0, _factoriesAny.createCompareText)({ + concat, + matrix, + typed +}); +const cumsum = exports.cumsum = /* #__PURE__ */(0, _factoriesAny.createCumSum)({ + add, + typed, + unaryPlus +}); +const deepEqual = exports.deepEqual = /* #__PURE__ */(0, _factoriesAny.createDeepEqual)({ + equal, + typed +}); +const diff = exports.diff = /* #__PURE__ */(0, _factoriesAny.createDiff)({ + matrix, + number, + subtract, + typed +}); +const distance = exports.distance = /* #__PURE__ */(0, _factoriesAny.createDistance)({ + abs, + addScalar, + deepEqual, + divideScalar, + multiplyScalar, + sqrt, + subtractScalar, + typed +}); +const dot = exports.dot = /* #__PURE__ */(0, _factoriesAny.createDot)({ + addScalar, + conj, + multiplyScalar, + size, + typed +}); +const equalText = exports.equalText = /* #__PURE__ */(0, _factoriesAny.createEqualText)({ + compareText, + isZero, + typed +}); +const floor = exports.floor = /* #__PURE__ */(0, _factoriesAny.createFloor)({ + DenseMatrix, + config: _configReadonly.config, + equalScalar, + matrix, + round, + typed, + zeros +}); +const gcd = exports.gcd = /* #__PURE__ */(0, _factoriesAny.createGcd)({ + BigNumber, + DenseMatrix, + concat, + config: _configReadonly.config, + equalScalar, + matrix, + round, + typed, + zeros +}); +const hypot = exports.hypot = /* #__PURE__ */(0, _factoriesAny.createHypot)({ + abs, + addScalar, + divideScalar, + isPositive, + multiplyScalar, + smaller, + sqrt, + typed +}); +const ImmutableDenseMatrix = exports.ImmutableDenseMatrix = /* #__PURE__ */(0, _factoriesAny.createImmutableDenseMatrixClass)({ + DenseMatrix, + smaller +}); +const Index = exports.Index = /* #__PURE__ */(0, _factoriesAny.createIndexClass)({ + ImmutableDenseMatrix, + getMatrixDataType +}); +const larger = exports.larger = /* #__PURE__ */(0, _factoriesAny.createLarger)({ + DenseMatrix, + concat, + config: _configReadonly.config, + matrix, + typed +}); +const log = exports.log = /* #__PURE__ */(0, _factoriesAny.createLog)({ + Complex, + config: _configReadonly.config, + divideScalar, + typed +}); +const lsolveAll = exports.lsolveAll = /* #__PURE__ */(0, _factoriesAny.createLsolveAll)({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +const matrixFromRows = exports.matrixFromRows = /* #__PURE__ */(0, _factoriesAny.createMatrixFromRows)({ + flatten, + matrix, + size, + typed +}); +const min = exports.min = /* #__PURE__ */(0, _factoriesAny.createMin)({ + config: _configReadonly.config, + numeric, + smaller, + typed +}); +const mod = exports.mod = /* #__PURE__ */(0, _factoriesAny.createMod)({ + DenseMatrix, + concat, + config: _configReadonly.config, + equalScalar, + matrix, + round, + typed, + zeros +}); +const multiply = exports.multiply = /* #__PURE__ */(0, _factoriesAny.createMultiply)({ + addScalar, + dot, + equalScalar, + matrix, + multiplyScalar, + typed +}); +const nthRoots = exports.nthRoots = /* #__PURE__ */(0, _factoriesAny.createNthRoots)({ + Complex, + config: _configReadonly.config, + divideScalar, + typed +}); +const or = exports.or = /* #__PURE__ */(0, _factoriesAny.createOr)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +const partitionSelect = exports.partitionSelect = /* #__PURE__ */(0, _factoriesAny.createPartitionSelect)({ + compare, + isNaN, + isNumeric, + typed +}); +const rightLogShift = exports.rightLogShift = /* #__PURE__ */(0, _factoriesAny.createRightLogShift)({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +const slu = exports.slu = /* #__PURE__ */(0, _factoriesAny.createSlu)({ + SparseMatrix, + abs, + add, + divideScalar, + larger, + largerEq, + multiply, + subtract, + transpose, + typed +}); +const subset = exports.subset = /* #__PURE__ */(0, _factoriesAny.createSubset)({ + add, + matrix, + typed, + zeros +}); +const sum = exports.sum = /* #__PURE__ */(0, _factoriesAny.createSum)({ + add, + config: _configReadonly.config, + numeric, + typed +}); +const trace = exports.trace = /* #__PURE__ */(0, _factoriesAny.createTrace)({ + add, + matrix, + typed +}); +const usolveAll = exports.usolveAll = /* #__PURE__ */(0, _factoriesAny.createUsolveAll)({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +const zpk2tf = exports.zpk2tf = /* #__PURE__ */(0, _factoriesAny.createZpk2tf)({ + Complex, + add, + multiply, + number, + typed +}); +const ceil = exports.ceil = /* #__PURE__ */(0, _factoriesAny.createCeil)({ + DenseMatrix, + config: _configReadonly.config, + equalScalar, + matrix, + round, + typed, + zeros +}); +const compareNatural = exports.compareNatural = /* #__PURE__ */(0, _factoriesAny.createCompareNatural)({ + compare, + typed +}); +const composition = exports.composition = /* #__PURE__ */(0, _factoriesAny.createComposition)({ + addScalar, + combinations, + isInteger, + isNegative, + isPositive, + larger, + typed +}); +const cross = exports.cross = /* #__PURE__ */(0, _factoriesAny.createCross)({ + matrix, + multiply, + subtract, + typed +}); +const det = exports.det = /* #__PURE__ */(0, _factoriesAny.createDet)({ + divideScalar, + isZero, + matrix, + multiply, + subtractScalar, + typed, + unaryMinus +}); +const dotMultiply = exports.dotMultiply = /* #__PURE__ */(0, _factoriesAny.createDotMultiply)({ + concat, + equalScalar, + matrix, + multiplyScalar, + typed +}); +const FibonacciHeap = exports.FibonacciHeap = /* #__PURE__ */(0, _factoriesAny.createFibonacciHeapClass)({ + larger, + smaller +}); +const fix = exports.fix = /* #__PURE__ */(0, _factoriesAny.createFix)({ + Complex, + DenseMatrix, + ceil, + equalScalar, + floor, + matrix, + typed, + zeros +}); +const index = exports.index = /* #__PURE__ */(0, _factoriesAny.createIndex)({ + Index, + typed +}); +const intersect = exports.intersect = /* #__PURE__ */(0, _factoriesAny.createIntersect)({ + abs, + add, + addScalar, + config: _configReadonly.config, + divideScalar, + equalScalar, + flatten, + isNumeric, + isZero, + matrix, + multiply, + multiplyScalar, + smaller, + subtract, + typed +}); +const invmod = exports.invmod = /* #__PURE__ */(0, _factoriesAny.createInvmod)({ + BigNumber, + add, + config: _configReadonly.config, + equal, + isInteger, + mod, + smaller, + typed, + xgcd +}); +const lcm = exports.lcm = /* #__PURE__ */(0, _factoriesAny.createLcm)({ + concat, + equalScalar, + matrix, + typed +}); +const log1p = exports.log1p = /* #__PURE__ */(0, _factoriesAny.createLog1p)({ + Complex, + config: _configReadonly.config, + divideScalar, + log, + typed +}); +const max = exports.max = /* #__PURE__ */(0, _factoriesAny.createMax)({ + config: _configReadonly.config, + larger, + numeric, + typed +}); +const setCartesian = exports.setCartesian = /* #__PURE__ */(0, _factoriesAny.createSetCartesian)({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +const setDistinct = exports.setDistinct = /* #__PURE__ */(0, _factoriesAny.createSetDistinct)({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +const setIsSubset = exports.setIsSubset = /* #__PURE__ */(0, _factoriesAny.createSetIsSubset)({ + Index, + compareNatural, + size, + subset, + typed +}); +const setPowerset = exports.setPowerset = /* #__PURE__ */(0, _factoriesAny.createSetPowerset)({ + Index, + compareNatural, + size, + subset, + typed +}); +const smallerEq = exports.smallerEq = /* #__PURE__ */(0, _factoriesAny.createSmallerEq)({ + DenseMatrix, + concat, + config: _configReadonly.config, + matrix, + typed +}); +const sort = exports.sort = /* #__PURE__ */(0, _factoriesAny.createSort)({ + compare, + compareNatural, + matrix, + typed +}); +const unequal = exports.unequal = /* #__PURE__ */(0, _factoriesAny.createUnequal)({ + DenseMatrix, + concat, + config: _configReadonly.config, + equalScalar, + matrix, + typed +}); +const and = exports.and = /* #__PURE__ */(0, _factoriesAny.createAnd)({ + concat, + equalScalar, + matrix, + not, + typed, + zeros +}); +const range = exports.range = /* #__PURE__ */(0, _factoriesAny.createRange)({ + bignumber, + matrix, + add, + config: _configReadonly.config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed +}); +const row = exports.row = /* #__PURE__ */(0, _factoriesAny.createRow)({ + Index, + matrix, + range, + typed +}); +const setDifference = exports.setDifference = /* #__PURE__ */(0, _factoriesAny.createSetDifference)({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +const setMultiplicity = exports.setMultiplicity = /* #__PURE__ */(0, _factoriesAny.createSetMultiplicity)({ + Index, + compareNatural, + size, + subset, + typed +}); +const setSymDifference = exports.setSymDifference = /* #__PURE__ */(0, _factoriesAny.createSetSymDifference)({ + Index, + concat, + setDifference, + size, + subset, + typed +}); +const Spa = exports.Spa = /* #__PURE__ */(0, _factoriesAny.createSpaClass)({ + FibonacciHeap, + addScalar, + equalScalar +}); +const column = exports.column = /* #__PURE__ */(0, _factoriesAny.createColumn)({ + Index, + matrix, + range, + typed +}); +const inv = exports.inv = /* #__PURE__ */(0, _factoriesAny.createInv)({ + abs, + addScalar, + det, + divideScalar, + identity, + matrix, + multiply, + typed, + unaryMinus +}); +const lup = exports.lup = /* #__PURE__ */(0, _factoriesAny.createLup)({ + DenseMatrix, + Spa, + SparseMatrix, + abs, + addScalar, + divideScalar, + equalScalar, + larger, + matrix, + multiplyScalar, + subtractScalar, + typed, + unaryMinus +}); +const pinv = exports.pinv = /* #__PURE__ */(0, _factoriesAny.createPinv)({ + Complex, + add, + ctranspose, + deepEqual, + divideScalar, + dot, + dotDivide, + equal, + inv, + matrix, + multiply, + typed +}); +const pow = exports.pow = /* #__PURE__ */(0, _factoriesAny.createPow)({ + Complex, + config: _configReadonly.config, + fraction, + identity, + inv, + matrix, + multiply, + number, + typed +}); +const setIntersect = exports.setIntersect = /* #__PURE__ */(0, _factoriesAny.createSetIntersect)({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +const setUnion = exports.setUnion = /* #__PURE__ */(0, _factoriesAny.createSetUnion)({ + Index, + concat, + setIntersect, + setSymDifference, + size, + subset, + typed +}); +const sqrtm = exports.sqrtm = /* #__PURE__ */(0, _factoriesAny.createSqrtm)({ + abs, + add, + identity, + inv, + map, + max, + multiply, + size, + sqrt, + subtract, + typed +}); +const Unit = exports.Unit = /* #__PURE__ */(0, _factoriesAny.createUnitClass)({ + BigNumber, + Complex, + Fraction, + abs, + addScalar, + config: _configReadonly.config, + divideScalar, + equal, + fix, + format, + isNumeric, + multiplyScalar, + number, + pow, + round, + subtractScalar +}); +const vacuumImpedance = exports.vacuumImpedance = /* #__PURE__ */(0, _factoriesAny.createVacuumImpedance)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const wienDisplacement = exports.wienDisplacement = /* #__PURE__ */(0, _factoriesAny.createWienDisplacement)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const atomicMass = exports.atomicMass = /* #__PURE__ */(0, _factoriesAny.createAtomicMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const bohrMagneton = exports.bohrMagneton = /* #__PURE__ */(0, _factoriesAny.createBohrMagneton)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const boltzmann = exports.boltzmann = /* #__PURE__ */(0, _factoriesAny.createBoltzmann)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const conductanceQuantum = exports.conductanceQuantum = /* #__PURE__ */(0, _factoriesAny.createConductanceQuantum)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const coulomb = exports.coulomb = /* #__PURE__ */(0, _factoriesAny.createCoulomb)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const deuteronMass = exports.deuteronMass = /* #__PURE__ */(0, _factoriesAny.createDeuteronMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const dotPow = exports.dotPow = /* #__PURE__ */(0, _factoriesAny.createDotPow)({ + DenseMatrix, + concat, + equalScalar, + matrix, + pow, + typed +}); +const electricConstant = exports.electricConstant = /* #__PURE__ */(0, _factoriesAny.createElectricConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const elementaryCharge = exports.elementaryCharge = /* #__PURE__ */(0, _factoriesAny.createElementaryCharge)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const expm = exports.expm = /* #__PURE__ */(0, _factoriesAny.createExpm)({ + abs, + add, + identity, + inv, + multiply, + typed +}); +const faraday = exports.faraday = /* #__PURE__ */(0, _factoriesAny.createFaraday)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const fft = exports.fft = /* #__PURE__ */(0, _factoriesAny.createFft)({ + addScalar, + ceil, + conj, + divideScalar, + dotDivide, + exp, + i, + log2, + matrix, + multiplyScalar, + pow, + tau, + typed +}); +const gamma = exports.gamma = /* #__PURE__ */(0, _factoriesAny.createGamma)({ + BigNumber, + Complex, + config: _configReadonly.config, + multiplyScalar, + pow, + typed +}); +const gravitationConstant = exports.gravitationConstant = /* #__PURE__ */(0, _factoriesAny.createGravitationConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const hartreeEnergy = exports.hartreeEnergy = /* #__PURE__ */(0, _factoriesAny.createHartreeEnergy)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const ifft = exports.ifft = /* #__PURE__ */(0, _factoriesAny.createIfft)({ + conj, + dotDivide, + fft, + typed +}); +const klitzing = exports.klitzing = /* #__PURE__ */(0, _factoriesAny.createKlitzing)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const loschmidt = exports.loschmidt = /* #__PURE__ */(0, _factoriesAny.createLoschmidt)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const magneticConstant = exports.magneticConstant = /* #__PURE__ */(0, _factoriesAny.createMagneticConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const molarMass = exports.molarMass = /* #__PURE__ */(0, _factoriesAny.createMolarMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const molarPlanckConstant = exports.molarPlanckConstant = /* #__PURE__ */(0, _factoriesAny.createMolarPlanckConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const neutronMass = exports.neutronMass = /* #__PURE__ */(0, _factoriesAny.createNeutronMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const nuclearMagneton = exports.nuclearMagneton = /* #__PURE__ */(0, _factoriesAny.createNuclearMagneton)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const planckCharge = exports.planckCharge = /* #__PURE__ */(0, _factoriesAny.createPlanckCharge)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const planckLength = exports.planckLength = /* #__PURE__ */(0, _factoriesAny.createPlanckLength)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const planckTemperature = exports.planckTemperature = /* #__PURE__ */(0, _factoriesAny.createPlanckTemperature)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const protonMass = exports.protonMass = /* #__PURE__ */(0, _factoriesAny.createProtonMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const quantumOfCirculation = exports.quantumOfCirculation = /* #__PURE__ */(0, _factoriesAny.createQuantumOfCirculation)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const reducedPlanckConstant = exports.reducedPlanckConstant = /* #__PURE__ */(0, _factoriesAny.createReducedPlanckConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const rydberg = exports.rydberg = /* #__PURE__ */(0, _factoriesAny.createRydberg)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const secondRadiation = exports.secondRadiation = /* #__PURE__ */(0, _factoriesAny.createSecondRadiation)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const speedOfLight = exports.speedOfLight = /* #__PURE__ */(0, _factoriesAny.createSpeedOfLight)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const stefanBoltzmann = exports.stefanBoltzmann = /* #__PURE__ */(0, _factoriesAny.createStefanBoltzmann)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const thomsonCrossSection = exports.thomsonCrossSection = /* #__PURE__ */(0, _factoriesAny.createThomsonCrossSection)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const avogadro = exports.avogadro = /* #__PURE__ */(0, _factoriesAny.createAvogadro)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const bohrRadius = exports.bohrRadius = /* #__PURE__ */(0, _factoriesAny.createBohrRadius)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const createUnit = exports.createUnit = /* #__PURE__ */(0, _factoriesAny.createCreateUnit)({ + Unit, + typed +}); +const divide = exports.divide = /* #__PURE__ */(0, _factoriesAny.createDivide)({ + divideScalar, + equalScalar, + inv, + matrix, + multiply, + typed +}); +const electronMass = exports.electronMass = /* #__PURE__ */(0, _factoriesAny.createElectronMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const factorial = exports.factorial = /* #__PURE__ */(0, _factoriesAny.createFactorial)({ + gamma, + typed +}); +const firstRadiation = exports.firstRadiation = /* #__PURE__ */(0, _factoriesAny.createFirstRadiation)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const gravity = exports.gravity = /* #__PURE__ */(0, _factoriesAny.createGravity)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const inverseConductanceQuantum = exports.inverseConductanceQuantum = /* #__PURE__ */(0, _factoriesAny.createInverseConductanceQuantum)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const lusolve = exports.lusolve = /* #__PURE__ */(0, _factoriesAny.createLusolve)({ + DenseMatrix, + lsolve, + lup, + matrix, + slu, + typed, + usolve +}); +const magneticFluxQuantum = exports.magneticFluxQuantum = /* #__PURE__ */(0, _factoriesAny.createMagneticFluxQuantum)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const molarMassC12 = exports.molarMassC12 = /* #__PURE__ */(0, _factoriesAny.createMolarMassC12)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const multinomial = exports.multinomial = /* #__PURE__ */(0, _factoriesAny.createMultinomial)({ + add, + divide, + factorial, + isInteger, + isPositive, + multiply, + typed +}); +const permutations = exports.permutations = /* #__PURE__ */(0, _factoriesAny.createPermutations)({ + factorial, + typed +}); +const planckMass = exports.planckMass = /* #__PURE__ */(0, _factoriesAny.createPlanckMass)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const polynomialRoot = exports.polynomialRoot = /* #__PURE__ */(0, _factoriesAny.createPolynomialRoot)({ + add, + cbrt, + divide, + equalScalar, + im, + isZero, + multiply, + re, + sqrt, + subtract, + typeOf, + typed, + unaryMinus +}); +const setSize = exports.setSize = /* #__PURE__ */(0, _factoriesAny.createSetSize)({ + compareNatural, + typed +}); +const solveODE = exports.solveODE = /* #__PURE__ */(0, _factoriesAny.createSolveODE)({ + abs, + add, + bignumber, + divide, + isNegative, + isPositive, + larger, + map, + matrix, + max, + multiply, + smaller, + subtract, + typed, + unaryMinus +}); +const stirlingS2 = exports.stirlingS2 = /* #__PURE__ */(0, _factoriesAny.createStirlingS2)({ + bignumber, + addScalar, + combinations, + divideScalar, + factorial, + isInteger, + isNegative, + larger, + multiplyScalar, + number, + pow, + subtractScalar, + typed +}); +const unit = exports.unit = /* #__PURE__ */(0, _factoriesAny.createUnitFunction)({ + Unit, + typed +}); +const bellNumbers = exports.bellNumbers = /* #__PURE__ */(0, _factoriesAny.createBellNumbers)({ + addScalar, + isInteger, + isNegative, + stirlingS2, + typed +}); +const eigs = exports.eigs = /* #__PURE__ */(0, _factoriesAny.createEigs)({ + abs, + add, + addScalar, + atan, + bignumber, + column, + complex, + config: _configReadonly.config, + cos, + diag, + divideScalar, + dot, + equal, + flatten, + im, + inv, + larger, + matrix, + matrixFromColumns, + multiply, + multiplyScalar, + number, + qr, + re, + reshape, + sin, + size, + smaller, + sqrt, + subtract, + typed, + usolve, + usolveAll +}); +const fermiCoupling = exports.fermiCoupling = /* #__PURE__ */(0, _factoriesAny.createFermiCoupling)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const gasConstant = exports.gasConstant = /* #__PURE__ */(0, _factoriesAny.createGasConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const kldivergence = exports.kldivergence = /* #__PURE__ */(0, _factoriesAny.createKldivergence)({ + divide, + dotDivide, + isNumeric, + log, + map, + matrix, + multiply, + sum, + typed +}); +const mean = exports.mean = /* #__PURE__ */(0, _factoriesAny.createMean)({ + add, + divide, + typed +}); +const molarVolume = exports.molarVolume = /* #__PURE__ */(0, _factoriesAny.createMolarVolume)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const planckConstant = exports.planckConstant = /* #__PURE__ */(0, _factoriesAny.createPlanckConstant)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const quantileSeq = exports.quantileSeq = /* #__PURE__ */(0, _factoriesAny.createQuantileSeq)({ + bignumber, + add, + compare, + divide, + isInteger, + larger, + multiply, + partitionSelect, + smaller, + smallerEq, + subtract, + typed +}); +const variance = exports.variance = /* #__PURE__ */(0, _factoriesAny.createVariance)({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed +}); +const classicalElectronRadius = exports.classicalElectronRadius = /* #__PURE__ */(0, _factoriesAny.createClassicalElectronRadius)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const median = exports.median = /* #__PURE__ */(0, _factoriesAny.createMedian)({ + add, + compare, + divide, + partitionSelect, + typed +}); +const corr = exports.corr = /* #__PURE__ */(0, _factoriesAny.createCorr)({ + add, + divide, + matrix, + mean, + multiply, + pow, + sqrt, + subtract, + sum, + typed +}); +const freqz = exports.freqz = /* #__PURE__ */(0, _factoriesAny.createFreqz)({ + Complex, + add, + divide, + matrix, + multiply, + typed +}); +const mad = exports.mad = /* #__PURE__ */(0, _factoriesAny.createMad)({ + abs, + map, + median, + subtract, + typed +}); +const std = exports.std = /* #__PURE__ */(0, _factoriesAny.createStd)({ + map, + sqrt, + typed, + variance +}); +const zeta = exports.zeta = /* #__PURE__ */(0, _factoriesAny.createZeta)({ + BigNumber, + Complex, + add, + config: _configReadonly.config, + divide, + equal, + factorial, + gamma, + isNegative, + multiply, + pi, + pow, + sin, + smallerEq, + subtract, + typed +}); +const norm = exports.norm = /* #__PURE__ */(0, _factoriesAny.createNorm)({ + abs, + add, + conj, + ctranspose, + eigs, + equalScalar, + larger, + matrix, + multiply, + pow, + smaller, + sqrt, + typed +}); +const rotationMatrix = exports.rotationMatrix = /* #__PURE__ */(0, _factoriesAny.createRotationMatrix)({ + BigNumber, + DenseMatrix, + SparseMatrix, + addScalar, + config: _configReadonly.config, + cos, + matrix, + multiplyScalar, + norm, + sin, + typed, + unaryMinus +}); +const planckTime = exports.planckTime = /* #__PURE__ */(0, _factoriesAny.createPlanckTime)({ + BigNumber, + Unit, + config: _configReadonly.config +}); +const schur = exports.schur = /* #__PURE__ */(0, _factoriesAny.createSchur)({ + identity, + matrix, + multiply, + norm, + qr, + subtract, + typed +}); +const rotate = exports.rotate = /* #__PURE__ */(0, _factoriesAny.createRotate)({ + multiply, + rotationMatrix, + typed +}); +const sylvester = exports.sylvester = /* #__PURE__ */(0, _factoriesAny.createSylvester)({ + abs, + add, + concat, + identity, + index, + lusolve, + matrix, + matrixFromColumns, + multiply, + range, + schur, + subset, + subtract, + transpose, + typed +}); +const lyap = exports.lyap = /* #__PURE__ */(0, _factoriesAny.createLyap)({ + matrix, + multiply, + sylvester, + transpose, + typed +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js new file mode 100644 index 0000000..fb71fe2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js @@ -0,0 +1,611 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.median = exports.mean = exports.max = exports.matrix = exports.map = exports.mad = exports.log2 = exports.log1p = exports.log10 = exports.log = exports.lgamma = exports.leftShift = exports.lcm = exports.largerEq = exports.larger = exports.isZero = exports.isPrime = exports.isPositive = exports.isNumeric = exports.isNegative = exports.isNaN = exports.isInteger = exports.index = exports.hypot = exports.hasNumericValue = exports.gcd = exports.gamma = exports.format = exports.forEach = exports.floor = exports.fix = exports.filter = exports.factorial = exports.expm1 = exports.exp = exports.erf = exports.equalText = exports.equalScalar = exports.equal = exports.e = exports.divideScalar = exports.divide = exports.deepEqual = exports.cumsum = exports.cube = exports.csch = exports.csc = exports.coth = exports.cot = exports.cosh = exports.cos = exports.corr = exports.composition = exports.compareText = exports.compareNatural = exports.compare = exports.combinationsWithRep = exports.combinations = exports.clone = exports.ceil = exports.cbrt = exports.catalan = exports.boolean = exports.bitXor = exports.bitOr = exports.bitNot = exports.bitAnd = exports.bigint = exports.bellNumbers = exports.atanh = exports.atan2 = exports.atan = exports.asinh = exports.asin = exports.asech = exports.asec = exports.apply = exports.and = exports.addScalar = exports.add = exports.acsch = exports.acsc = exports.acoth = exports.acot = exports.acosh = exports.acos = exports.abs = exports._true = exports._null = exports._false = exports._NaN = exports._Infinity = exports.SQRT2 = exports.SQRT1_2 = exports.ResultSet = exports.Range = exports.LOG2E = exports.LOG10E = exports.LN2 = exports.LN10 = void 0; +exports.zeta = exports.xor = exports.xgcd = exports.version = exports.variance = exports.unequal = exports.unaryPlus = exports.unaryMinus = exports.typed = exports.typeOf = exports.tau = exports.tanh = exports.tan = exports.sum = exports.subtractScalar = exports.subtract = exports.subset = exports.string = exports.stirlingS2 = exports.std = exports.square = exports.sqrt = exports.smallerEq = exports.smaller = exports.size = exports.sinh = exports.sin = exports.sign = exports.sech = exports.sec = exports.round = exports.rightLogShift = exports.rightArithShift = exports.replacer = exports.range = exports.randomInt = exports.random = exports.quantileSeq = exports.prod = exports.print = exports.pow = exports.pickRandom = exports.pi = exports.phi = exports.permutations = exports.partitionSelect = exports.or = exports.numeric = exports.number = exports.nthRoot = exports.not = exports.norm = exports.multiplyScalar = exports.multiply = exports.multinomial = exports.mode = exports.mod = exports.min = void 0; +var _configReadonly = require("./configReadonly.js"); +var _factoriesNumber = require("../factoriesNumber.js"); +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ + +const e = exports.e = /* #__PURE__ */(0, _factoriesNumber.createE)({ + config: _configReadonly.config +}); +const _false = exports._false = /* #__PURE__ */(0, _factoriesNumber.createFalse)({}); +const index = exports.index = /* #__PURE__ */(0, _factoriesNumber.createIndex)({}); +const _Infinity = exports._Infinity = /* #__PURE__ */(0, _factoriesNumber.createInfinity)({ + config: _configReadonly.config +}); +const LN10 = exports.LN10 = /* #__PURE__ */(0, _factoriesNumber.createLN10)({ + config: _configReadonly.config +}); +const LOG10E = exports.LOG10E = /* #__PURE__ */(0, _factoriesNumber.createLOG10E)({ + config: _configReadonly.config +}); +const matrix = exports.matrix = /* #__PURE__ */(0, _factoriesNumber.createMatrix)({}); +const _NaN = exports._NaN = /* #__PURE__ */(0, _factoriesNumber.createNaN)({ + config: _configReadonly.config +}); +const _null = exports._null = /* #__PURE__ */(0, _factoriesNumber.createNull)({}); +const phi = exports.phi = /* #__PURE__ */(0, _factoriesNumber.createPhi)({ + config: _configReadonly.config +}); +const Range = exports.Range = /* #__PURE__ */(0, _factoriesNumber.createRangeClass)({}); +const replacer = exports.replacer = /* #__PURE__ */(0, _factoriesNumber.createReplacer)({}); +const ResultSet = exports.ResultSet = /* #__PURE__ */(0, _factoriesNumber.createResultSet)({}); +const SQRT1_2 = exports.SQRT1_2 = /* #__PURE__ */(0, _factoriesNumber.createSQRT1_2)({ + config: _configReadonly.config +}); +const subset = exports.subset = /* #__PURE__ */(0, _factoriesNumber.createSubset)({}); +const tau = exports.tau = /* #__PURE__ */(0, _factoriesNumber.createTau)({ + config: _configReadonly.config +}); +const typed = exports.typed = /* #__PURE__ */(0, _factoriesNumber.createTyped)({}); +const unaryPlus = exports.unaryPlus = /* #__PURE__ */(0, _factoriesNumber.createUnaryPlus)({ + typed +}); +const version = exports.version = /* #__PURE__ */(0, _factoriesNumber.createVersion)({}); +const xor = exports.xor = /* #__PURE__ */(0, _factoriesNumber.createXor)({ + typed +}); +const abs = exports.abs = /* #__PURE__ */(0, _factoriesNumber.createAbs)({ + typed +}); +const acos = exports.acos = /* #__PURE__ */(0, _factoriesNumber.createAcos)({ + typed +}); +const acot = exports.acot = /* #__PURE__ */(0, _factoriesNumber.createAcot)({ + typed +}); +const acsc = exports.acsc = /* #__PURE__ */(0, _factoriesNumber.createAcsc)({ + typed +}); +const add = exports.add = /* #__PURE__ */(0, _factoriesNumber.createAdd)({ + typed +}); +const and = exports.and = /* #__PURE__ */(0, _factoriesNumber.createAnd)({ + typed +}); +const asec = exports.asec = /* #__PURE__ */(0, _factoriesNumber.createAsec)({ + typed +}); +const asin = exports.asin = /* #__PURE__ */(0, _factoriesNumber.createAsin)({ + typed +}); +const atan = exports.atan = /* #__PURE__ */(0, _factoriesNumber.createAtan)({ + typed +}); +const atanh = exports.atanh = /* #__PURE__ */(0, _factoriesNumber.createAtanh)({ + typed +}); +const bigint = exports.bigint = /* #__PURE__ */(0, _factoriesNumber.createBigint)({ + typed +}); +const bitNot = exports.bitNot = /* #__PURE__ */(0, _factoriesNumber.createBitNot)({ + typed +}); +const bitXor = exports.bitXor = /* #__PURE__ */(0, _factoriesNumber.createBitXor)({ + typed +}); +const boolean = exports.boolean = /* #__PURE__ */(0, _factoriesNumber.createBoolean)({ + typed +}); +const cbrt = exports.cbrt = /* #__PURE__ */(0, _factoriesNumber.createCbrt)({ + typed +}); +const combinations = exports.combinations = /* #__PURE__ */(0, _factoriesNumber.createCombinations)({ + typed +}); +const compare = exports.compare = /* #__PURE__ */(0, _factoriesNumber.createCompare)({ + config: _configReadonly.config, + typed +}); +const compareText = exports.compareText = /* #__PURE__ */(0, _factoriesNumber.createCompareText)({ + typed +}); +const cos = exports.cos = /* #__PURE__ */(0, _factoriesNumber.createCos)({ + typed +}); +const cot = exports.cot = /* #__PURE__ */(0, _factoriesNumber.createCot)({ + typed +}); +const csc = exports.csc = /* #__PURE__ */(0, _factoriesNumber.createCsc)({ + typed +}); +const cube = exports.cube = /* #__PURE__ */(0, _factoriesNumber.createCube)({ + typed +}); +const divide = exports.divide = /* #__PURE__ */(0, _factoriesNumber.createDivide)({ + typed +}); +const equalScalar = exports.equalScalar = /* #__PURE__ */(0, _factoriesNumber.createEqualScalar)({ + config: _configReadonly.config, + typed +}); +const erf = exports.erf = /* #__PURE__ */(0, _factoriesNumber.createErf)({ + typed +}); +const exp = exports.exp = /* #__PURE__ */(0, _factoriesNumber.createExp)({ + typed +}); +const filter = exports.filter = /* #__PURE__ */(0, _factoriesNumber.createFilter)({ + typed +}); +const forEach = exports.forEach = /* #__PURE__ */(0, _factoriesNumber.createForEach)({ + typed +}); +const format = exports.format = /* #__PURE__ */(0, _factoriesNumber.createFormat)({ + typed +}); +const gamma = exports.gamma = /* #__PURE__ */(0, _factoriesNumber.createGamma)({ + typed +}); +const isInteger = exports.isInteger = /* #__PURE__ */(0, _factoriesNumber.createIsInteger)({ + typed +}); +const isNegative = exports.isNegative = /* #__PURE__ */(0, _factoriesNumber.createIsNegative)({ + typed +}); +const isPositive = exports.isPositive = /* #__PURE__ */(0, _factoriesNumber.createIsPositive)({ + typed +}); +const isZero = exports.isZero = /* #__PURE__ */(0, _factoriesNumber.createIsZero)({ + typed +}); +const LOG2E = exports.LOG2E = /* #__PURE__ */(0, _factoriesNumber.createLOG2E)({ + config: _configReadonly.config +}); +const largerEq = exports.largerEq = /* #__PURE__ */(0, _factoriesNumber.createLargerEq)({ + config: _configReadonly.config, + typed +}); +const leftShift = exports.leftShift = /* #__PURE__ */(0, _factoriesNumber.createLeftShift)({ + typed +}); +const log = exports.log = /* #__PURE__ */(0, _factoriesNumber.createLog)({ + typed +}); +const log1p = exports.log1p = /* #__PURE__ */(0, _factoriesNumber.createLog1p)({ + typed +}); +const map = exports.map = /* #__PURE__ */(0, _factoriesNumber.createMap)({ + typed +}); +const mean = exports.mean = /* #__PURE__ */(0, _factoriesNumber.createMean)({ + add, + divide, + typed +}); +const mod = exports.mod = /* #__PURE__ */(0, _factoriesNumber.createMod)({ + typed +}); +const multiply = exports.multiply = /* #__PURE__ */(0, _factoriesNumber.createMultiply)({ + typed +}); +const not = exports.not = /* #__PURE__ */(0, _factoriesNumber.createNot)({ + typed +}); +const number = exports.number = /* #__PURE__ */(0, _factoriesNumber.createNumber)({ + typed +}); +const or = exports.or = /* #__PURE__ */(0, _factoriesNumber.createOr)({ + typed +}); +const pi = exports.pi = /* #__PURE__ */(0, _factoriesNumber.createPi)({ + config: _configReadonly.config +}); +const pow = exports.pow = /* #__PURE__ */(0, _factoriesNumber.createPow)({ + typed +}); +const random = exports.random = /* #__PURE__ */(0, _factoriesNumber.createRandom)({ + config: _configReadonly.config, + typed +}); +const rightLogShift = exports.rightLogShift = /* #__PURE__ */(0, _factoriesNumber.createRightLogShift)({ + typed +}); +const SQRT2 = exports.SQRT2 = /* #__PURE__ */(0, _factoriesNumber.createSQRT2)({ + config: _configReadonly.config +}); +const sech = exports.sech = /* #__PURE__ */(0, _factoriesNumber.createSech)({ + typed +}); +const sin = exports.sin = /* #__PURE__ */(0, _factoriesNumber.createSin)({ + typed +}); +const size = exports.size = /* #__PURE__ */(0, _factoriesNumber.createSize)({ + matrix, + config: _configReadonly.config, + typed +}); +const smallerEq = exports.smallerEq = /* #__PURE__ */(0, _factoriesNumber.createSmallerEq)({ + config: _configReadonly.config, + typed +}); +const square = exports.square = /* #__PURE__ */(0, _factoriesNumber.createSquare)({ + typed +}); +const string = exports.string = /* #__PURE__ */(0, _factoriesNumber.createString)({ + typed +}); +const subtract = exports.subtract = /* #__PURE__ */(0, _factoriesNumber.createSubtract)({ + typed +}); +const tanh = exports.tanh = /* #__PURE__ */(0, _factoriesNumber.createTanh)({ + typed +}); +const typeOf = exports.typeOf = /* #__PURE__ */(0, _factoriesNumber.createTypeOf)({ + typed +}); +const unequal = exports.unequal = /* #__PURE__ */(0, _factoriesNumber.createUnequal)({ + equalScalar, + typed +}); +const xgcd = exports.xgcd = /* #__PURE__ */(0, _factoriesNumber.createXgcd)({ + typed +}); +const acoth = exports.acoth = /* #__PURE__ */(0, _factoriesNumber.createAcoth)({ + typed +}); +const addScalar = exports.addScalar = /* #__PURE__ */(0, _factoriesNumber.createAddScalar)({ + typed +}); +const asech = exports.asech = /* #__PURE__ */(0, _factoriesNumber.createAsech)({ + typed +}); +const bitAnd = exports.bitAnd = /* #__PURE__ */(0, _factoriesNumber.createBitAnd)({ + typed +}); +const combinationsWithRep = exports.combinationsWithRep = /* #__PURE__ */(0, _factoriesNumber.createCombinationsWithRep)({ + typed +}); +const cosh = exports.cosh = /* #__PURE__ */(0, _factoriesNumber.createCosh)({ + typed +}); +const csch = exports.csch = /* #__PURE__ */(0, _factoriesNumber.createCsch)({ + typed +}); +const divideScalar = exports.divideScalar = /* #__PURE__ */(0, _factoriesNumber.createDivideScalar)({ + typed +}); +const equalText = exports.equalText = /* #__PURE__ */(0, _factoriesNumber.createEqualText)({ + compareText, + isZero, + typed +}); +const expm1 = exports.expm1 = /* #__PURE__ */(0, _factoriesNumber.createExpm1)({ + typed +}); +const isNumeric = exports.isNumeric = /* #__PURE__ */(0, _factoriesNumber.createIsNumeric)({ + typed +}); +const LN2 = exports.LN2 = /* #__PURE__ */(0, _factoriesNumber.createLN2)({ + config: _configReadonly.config +}); +const lcm = exports.lcm = /* #__PURE__ */(0, _factoriesNumber.createLcm)({ + typed +}); +const log10 = exports.log10 = /* #__PURE__ */(0, _factoriesNumber.createLog10)({ + typed +}); +const multiplyScalar = exports.multiplyScalar = /* #__PURE__ */(0, _factoriesNumber.createMultiplyScalar)({ + typed +}); +const nthRoot = exports.nthRoot = /* #__PURE__ */(0, _factoriesNumber.createNthRoot)({ + typed +}); +const pickRandom = exports.pickRandom = /* #__PURE__ */(0, _factoriesNumber.createPickRandom)({ + config: _configReadonly.config, + typed +}); +const randomInt = exports.randomInt = /* #__PURE__ */(0, _factoriesNumber.createRandomInt)({ + config: _configReadonly.config, + typed +}); +const rightArithShift = exports.rightArithShift = /* #__PURE__ */(0, _factoriesNumber.createRightArithShift)({ + typed +}); +const sec = exports.sec = /* #__PURE__ */(0, _factoriesNumber.createSec)({ + typed +}); +const sinh = exports.sinh = /* #__PURE__ */(0, _factoriesNumber.createSinh)({ + typed +}); +const sqrt = exports.sqrt = /* #__PURE__ */(0, _factoriesNumber.createSqrt)({ + typed +}); +const tan = exports.tan = /* #__PURE__ */(0, _factoriesNumber.createTan)({ + typed +}); +const unaryMinus = exports.unaryMinus = /* #__PURE__ */(0, _factoriesNumber.createUnaryMinus)({ + typed +}); +const acosh = exports.acosh = /* #__PURE__ */(0, _factoriesNumber.createAcosh)({ + typed +}); +const apply = exports.apply = /* #__PURE__ */(0, _factoriesNumber.createApply)({ + isInteger, + typed +}); +const asinh = exports.asinh = /* #__PURE__ */(0, _factoriesNumber.createAsinh)({ + typed +}); +const bitOr = exports.bitOr = /* #__PURE__ */(0, _factoriesNumber.createBitOr)({ + typed +}); +const clone = exports.clone = /* #__PURE__ */(0, _factoriesNumber.createClone)({ + typed +}); +const coth = exports.coth = /* #__PURE__ */(0, _factoriesNumber.createCoth)({ + typed +}); +const equal = exports.equal = /* #__PURE__ */(0, _factoriesNumber.createEqual)({ + equalScalar, + typed +}); +const factorial = exports.factorial = /* #__PURE__ */(0, _factoriesNumber.createFactorial)({ + gamma, + typed +}); +const hasNumericValue = exports.hasNumericValue = /* #__PURE__ */(0, _factoriesNumber.createHasNumericValue)({ + isNumeric, + typed +}); +const isNaN = exports.isNaN = /* #__PURE__ */(0, _factoriesNumber.createIsNaN)({ + typed +}); +const larger = exports.larger = /* #__PURE__ */(0, _factoriesNumber.createLarger)({ + config: _configReadonly.config, + typed +}); +const log2 = exports.log2 = /* #__PURE__ */(0, _factoriesNumber.createLog2)({ + typed +}); +const mode = exports.mode = /* #__PURE__ */(0, _factoriesNumber.createMode)({ + isNaN, + isNumeric, + typed +}); +const norm = exports.norm = /* #__PURE__ */(0, _factoriesNumber.createNorm)({ + typed +}); +const partitionSelect = exports.partitionSelect = /* #__PURE__ */(0, _factoriesNumber.createPartitionSelect)({ + compare, + isNaN, + isNumeric, + typed +}); +const print = exports.print = /* #__PURE__ */(0, _factoriesNumber.createPrint)({ + typed +}); +const round = exports.round = /* #__PURE__ */(0, _factoriesNumber.createRound)({ + typed +}); +const smaller = exports.smaller = /* #__PURE__ */(0, _factoriesNumber.createSmaller)({ + config: _configReadonly.config, + typed +}); +const subtractScalar = exports.subtractScalar = /* #__PURE__ */(0, _factoriesNumber.createSubtractScalar)({ + typed +}); +const _true = exports._true = /* #__PURE__ */(0, _factoriesNumber.createTrue)({}); +const variance = exports.variance = /* #__PURE__ */(0, _factoriesNumber.createVariance)({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed +}); +const zeta = exports.zeta = /* #__PURE__ */(0, _factoriesNumber.createZeta)({ + add, + config: _configReadonly.config, + divide, + equal, + factorial, + gamma, + isNegative, + multiply, + pi, + pow, + sin, + smallerEq, + subtract, + typed +}); +const acsch = exports.acsch = /* #__PURE__ */(0, _factoriesNumber.createAcsch)({ + typed +}); +const atan2 = exports.atan2 = /* #__PURE__ */(0, _factoriesNumber.createAtan2)({ + typed +}); +const catalan = exports.catalan = /* #__PURE__ */(0, _factoriesNumber.createCatalan)({ + addScalar, + combinations, + divideScalar, + isInteger, + isNegative, + multiplyScalar, + typed +}); +const compareNatural = exports.compareNatural = /* #__PURE__ */(0, _factoriesNumber.createCompareNatural)({ + compare, + typed +}); +const composition = exports.composition = /* #__PURE__ */(0, _factoriesNumber.createComposition)({ + addScalar, + combinations, + isInteger, + isNegative, + isPositive, + larger, + typed +}); +const cumsum = exports.cumsum = /* #__PURE__ */(0, _factoriesNumber.createCumSum)({ + add, + typed, + unaryPlus +}); +const floor = exports.floor = /* #__PURE__ */(0, _factoriesNumber.createFloor)({ + config: _configReadonly.config, + round, + typed +}); +const hypot = exports.hypot = /* #__PURE__ */(0, _factoriesNumber.createHypot)({ + abs, + addScalar, + divideScalar, + isPositive, + multiplyScalar, + smaller, + sqrt, + typed +}); +const lgamma = exports.lgamma = /* #__PURE__ */(0, _factoriesNumber.createLgamma)({ + typed +}); +const median = exports.median = /* #__PURE__ */(0, _factoriesNumber.createMedian)({ + add, + compare, + divide, + partitionSelect, + typed +}); +const multinomial = exports.multinomial = /* #__PURE__ */(0, _factoriesNumber.createMultinomial)({ + add, + divide, + factorial, + isInteger, + isPositive, + multiply, + typed +}); +const permutations = exports.permutations = /* #__PURE__ */(0, _factoriesNumber.createPermutations)({ + factorial, + typed +}); +const quantileSeq = exports.quantileSeq = /* #__PURE__ */(0, _factoriesNumber.createQuantileSeq)({ + add, + compare, + divide, + isInteger, + larger, + multiply, + partitionSelect, + smaller, + smallerEq, + subtract, + typed +}); +const sign = exports.sign = /* #__PURE__ */(0, _factoriesNumber.createSign)({ + typed +}); +const std = exports.std = /* #__PURE__ */(0, _factoriesNumber.createStd)({ + map, + sqrt, + typed, + variance +}); +const stirlingS2 = exports.stirlingS2 = /* #__PURE__ */(0, _factoriesNumber.createStirlingS2)({ + addScalar, + combinations, + divideScalar, + factorial, + isInteger, + isNegative, + larger, + multiplyScalar, + number, + pow, + subtractScalar, + typed +}); +const ceil = exports.ceil = /* #__PURE__ */(0, _factoriesNumber.createCeil)({ + config: _configReadonly.config, + round, + typed +}); +const deepEqual = exports.deepEqual = /* #__PURE__ */(0, _factoriesNumber.createDeepEqual)({ + equal, + typed +}); +const fix = exports.fix = /* #__PURE__ */(0, _factoriesNumber.createFix)({ + ceil, + floor, + typed +}); +const isPrime = exports.isPrime = /* #__PURE__ */(0, _factoriesNumber.createIsPrime)({ + typed +}); +const numeric = exports.numeric = /* #__PURE__ */(0, _factoriesNumber.createNumeric)({ + number +}); +const prod = exports.prod = /* #__PURE__ */(0, _factoriesNumber.createProd)({ + config: _configReadonly.config, + multiplyScalar, + numeric, + typed +}); +const bellNumbers = exports.bellNumbers = /* #__PURE__ */(0, _factoriesNumber.createBellNumbers)({ + addScalar, + isInteger, + isNegative, + stirlingS2, + typed +}); +const gcd = exports.gcd = /* #__PURE__ */(0, _factoriesNumber.createGcd)({ + typed +}); +const mad = exports.mad = /* #__PURE__ */(0, _factoriesNumber.createMad)({ + abs, + map, + median, + subtract, + typed +}); +const range = exports.range = /* #__PURE__ */(0, _factoriesNumber.createRange)({ + matrix, + add, + config: _configReadonly.config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed +}); +const sum = exports.sum = /* #__PURE__ */(0, _factoriesNumber.createSum)({ + add, + config: _configReadonly.config, + numeric, + typed +}); +const corr = exports.corr = /* #__PURE__ */(0, _factoriesNumber.createCorr)({ + add, + divide, + matrix, + mean, + multiply, + pow, + sqrt, + subtract, + sum, + typed +}); +const max = exports.max = /* #__PURE__ */(0, _factoriesNumber.createMax)({ + config: _configReadonly.config, + larger, + numeric, + typed +}); +const min = exports.min = /* #__PURE__ */(0, _factoriesNumber.createMin)({ + config: _configReadonly.config, + numeric, + smaller, + typed +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/typeChecks.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/typeChecks.js new file mode 100644 index 0000000..44c58bf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/entry/typeChecks.js @@ -0,0 +1,264 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isAccessorNode", { + enumerable: true, + get: function () { + return _is.isAccessorNode; + } +}); +Object.defineProperty(exports, "isArray", { + enumerable: true, + get: function () { + return _is.isArray; + } +}); +Object.defineProperty(exports, "isArrayNode", { + enumerable: true, + get: function () { + return _is.isArrayNode; + } +}); +Object.defineProperty(exports, "isAssignmentNode", { + enumerable: true, + get: function () { + return _is.isAssignmentNode; + } +}); +Object.defineProperty(exports, "isBigInt", { + enumerable: true, + get: function () { + return _is.isBigInt; + } +}); +Object.defineProperty(exports, "isBigNumber", { + enumerable: true, + get: function () { + return _is.isBigNumber; + } +}); +Object.defineProperty(exports, "isBlockNode", { + enumerable: true, + get: function () { + return _is.isBlockNode; + } +}); +Object.defineProperty(exports, "isBoolean", { + enumerable: true, + get: function () { + return _is.isBoolean; + } +}); +Object.defineProperty(exports, "isChain", { + enumerable: true, + get: function () { + return _is.isChain; + } +}); +Object.defineProperty(exports, "isCollection", { + enumerable: true, + get: function () { + return _is.isCollection; + } +}); +Object.defineProperty(exports, "isComplex", { + enumerable: true, + get: function () { + return _is.isComplex; + } +}); +Object.defineProperty(exports, "isConditionalNode", { + enumerable: true, + get: function () { + return _is.isConditionalNode; + } +}); +Object.defineProperty(exports, "isConstantNode", { + enumerable: true, + get: function () { + return _is.isConstantNode; + } +}); +Object.defineProperty(exports, "isDate", { + enumerable: true, + get: function () { + return _is.isDate; + } +}); +Object.defineProperty(exports, "isDenseMatrix", { + enumerable: true, + get: function () { + return _is.isDenseMatrix; + } +}); +Object.defineProperty(exports, "isFraction", { + enumerable: true, + get: function () { + return _is.isFraction; + } +}); +Object.defineProperty(exports, "isFunction", { + enumerable: true, + get: function () { + return _is.isFunction; + } +}); +Object.defineProperty(exports, "isFunctionAssignmentNode", { + enumerable: true, + get: function () { + return _is.isFunctionAssignmentNode; + } +}); +Object.defineProperty(exports, "isFunctionNode", { + enumerable: true, + get: function () { + return _is.isFunctionNode; + } +}); +Object.defineProperty(exports, "isHelp", { + enumerable: true, + get: function () { + return _is.isHelp; + } +}); +Object.defineProperty(exports, "isIndex", { + enumerable: true, + get: function () { + return _is.isIndex; + } +}); +Object.defineProperty(exports, "isIndexNode", { + enumerable: true, + get: function () { + return _is.isIndexNode; + } +}); +Object.defineProperty(exports, "isMap", { + enumerable: true, + get: function () { + return _is.isMap; + } +}); +Object.defineProperty(exports, "isMatrix", { + enumerable: true, + get: function () { + return _is.isMatrix; + } +}); +Object.defineProperty(exports, "isNode", { + enumerable: true, + get: function () { + return _is.isNode; + } +}); +Object.defineProperty(exports, "isNull", { + enumerable: true, + get: function () { + return _is.isNull; + } +}); +Object.defineProperty(exports, "isNumber", { + enumerable: true, + get: function () { + return _is.isNumber; + } +}); +Object.defineProperty(exports, "isObject", { + enumerable: true, + get: function () { + return _is.isObject; + } +}); +Object.defineProperty(exports, "isObjectNode", { + enumerable: true, + get: function () { + return _is.isObjectNode; + } +}); +Object.defineProperty(exports, "isObjectWrappingMap", { + enumerable: true, + get: function () { + return _is.isObjectWrappingMap; + } +}); +Object.defineProperty(exports, "isOperatorNode", { + enumerable: true, + get: function () { + return _is.isOperatorNode; + } +}); +Object.defineProperty(exports, "isParenthesisNode", { + enumerable: true, + get: function () { + return _is.isParenthesisNode; + } +}); +Object.defineProperty(exports, "isPartitionedMap", { + enumerable: true, + get: function () { + return _is.isPartitionedMap; + } +}); +Object.defineProperty(exports, "isRange", { + enumerable: true, + get: function () { + return _is.isRange; + } +}); +Object.defineProperty(exports, "isRangeNode", { + enumerable: true, + get: function () { + return _is.isRangeNode; + } +}); +Object.defineProperty(exports, "isRegExp", { + enumerable: true, + get: function () { + return _is.isRegExp; + } +}); +Object.defineProperty(exports, "isRelationalNode", { + enumerable: true, + get: function () { + return _is.isRelationalNode; + } +}); +Object.defineProperty(exports, "isResultSet", { + enumerable: true, + get: function () { + return _is.isResultSet; + } +}); +Object.defineProperty(exports, "isSparseMatrix", { + enumerable: true, + get: function () { + return _is.isSparseMatrix; + } +}); +Object.defineProperty(exports, "isString", { + enumerable: true, + get: function () { + return _is.isString; + } +}); +Object.defineProperty(exports, "isSymbolNode", { + enumerable: true, + get: function () { + return _is.isSymbolNode; + } +}); +Object.defineProperty(exports, "isUndefined", { + enumerable: true, + get: function () { + return _is.isUndefined; + } +}); +Object.defineProperty(exports, "isUnit", { + enumerable: true, + get: function () { + return _is.isUnit; + } +}); +var _is = require("../utils/is.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/ArgumentsError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/ArgumentsError.js new file mode 100644 index 0000000..78e6de7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/ArgumentsError.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArgumentsError = ArgumentsError; +/** + * Create a syntax error with the message: + * 'Wrong number of arguments in function ( provided, - expected)' + * @param {string} fn Function name + * @param {number} count Actual argument count + * @param {number} min Minimum required argument count + * @param {number} [max] Maximum required argument count + * @extends Error + */ +function ArgumentsError(fn, count, min, max) { + if (!(this instanceof ArgumentsError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.fn = fn; + this.count = count; + this.min = min; + this.max = max; + this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)'; + this.stack = new Error().stack; +} +ArgumentsError.prototype = new Error(); +ArgumentsError.prototype.constructor = Error; +ArgumentsError.prototype.name = 'ArgumentsError'; +ArgumentsError.prototype.isArgumentsError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/DimensionError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/DimensionError.js new file mode 100644 index 0000000..821d407 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/DimensionError.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DimensionError = DimensionError; +/** + * Create a range error with the message: + * 'Dimension mismatch ( != )' + * @param {number | number[]} actual The actual size + * @param {number | number[]} expected The expected size + * @param {string} [relation='!='] Optional relation between actual + * and expected size: '!=', '<', etc. + * @extends RangeError + */ +function DimensionError(actual, expected, relation) { + if (!(this instanceof DimensionError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.actual = actual; + this.expected = expected; + this.relation = relation; + this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')'; + this.stack = new Error().stack; +} +DimensionError.prototype = new RangeError(); +DimensionError.prototype.constructor = RangeError; +DimensionError.prototype.name = 'DimensionError'; +DimensionError.prototype.isDimensionError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/IndexError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/IndexError.js new file mode 100644 index 0000000..ec6c794 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/error/IndexError.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndexError = IndexError; +/** + * Create a range error with the message: + * 'Index out of range (index < min)' + * 'Index out of range (index < max)' + * + * @param {number} index The actual index + * @param {number} [min=0] Minimum index (included) + * @param {number} [max] Maximum index (excluded) + * @extends RangeError + */ +function IndexError(index, min, max) { + if (!(this instanceof IndexError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.index = index; + if (arguments.length < 3) { + this.min = 0; + this.max = min; + } else { + this.min = min; + this.max = max; + } + if (this.min !== undefined && this.index < this.min) { + this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')'; + } else if (this.max !== undefined && this.index >= this.max) { + this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')'; + } else { + this.message = 'Index out of range (' + this.index + ')'; + } + this.stack = new Error().stack; +} +IndexError.prototype = new RangeError(); +IndexError.prototype.constructor = RangeError; +IndexError.prototype.name = 'IndexError'; +IndexError.prototype.isIndexError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Help.js new file mode 100644 index 0000000..a5269c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Help.js @@ -0,0 +1,138 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createHelpClass = void 0; +var _is = require("../utils/is.js"); +var _object = require("../utils/object.js"); +var _string = require("../utils/string.js"); +var _factory = require("../utils/factory.js"); +const name = 'Help'; +const dependencies = ['evaluate']; +const createHelpClass = exports.createHelpClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + evaluate + } = _ref; + /** + * Documentation object + * @param {Object} doc Object containing properties: + * {string} name + * {string} category + * {string} description + * {string[]} syntax + * {string[]} examples + * {string[]} seealso + * @constructor + */ + function Help(doc) { + if (!(this instanceof Help)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (!doc) throw new Error('Argument "doc" missing'); + this.doc = doc; + } + + /** + * Attach type information + */ + Help.prototype.type = 'Help'; + Help.prototype.isHelp = true; + + /** + * Generate a string representation of the Help object + * @return {string} Returns a string + * @private + */ + Help.prototype.toString = function () { + const doc = this.doc || {}; + let desc = '\n'; + if (doc.name) { + desc += 'Name: ' + doc.name + '\n\n'; + } + if (doc.category) { + desc += 'Category: ' + doc.category + '\n\n'; + } + if (doc.description) { + desc += 'Description:\n ' + doc.description + '\n\n'; + } + if (doc.syntax) { + desc += 'Syntax:\n ' + doc.syntax.join('\n ') + '\n\n'; + } + if (doc.examples) { + desc += 'Examples:\n'; + + // after evaluating the examples, we restore config in case the examples + // did change the config. + let configChanged = false; + const originalConfig = evaluate('config()'); + const scope = { + config: newConfig => { + configChanged = true; + return evaluate('config(newConfig)', { + newConfig + }); + } + }; + for (let i = 0; i < doc.examples.length; i++) { + const expr = doc.examples[i]; + desc += ' ' + expr + '\n'; + let res; + try { + // note: res can be undefined when `expr` is an empty string + res = evaluate(expr, scope); + } catch (e) { + res = e; + } + if (res !== undefined && !(0, _is.isHelp)(res)) { + desc += ' ' + (0, _string.format)(res, { + precision: 14 + }) + '\n'; + } + } + desc += '\n'; + if (configChanged) { + evaluate('config(originalConfig)', { + originalConfig + }); + } + } + if (doc.mayThrow && doc.mayThrow.length) { + desc += 'Throws: ' + doc.mayThrow.join(', ') + '\n\n'; + } + if (doc.seealso && doc.seealso.length) { + desc += 'See also: ' + doc.seealso.join(', ') + '\n'; + } + return desc; + }; + + /** + * Export the help object to JSON + */ + Help.prototype.toJSON = function () { + const obj = (0, _object.clone)(this.doc); + obj.mathjs = 'Help'; + return obj; + }; + + /** + * Instantiate a Help object from a JSON object + * @param {Object} json + * @returns {Help} Returns a new Help object + */ + Help.fromJSON = function (json) { + const doc = {}; + Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => { + doc[prop] = json[prop]; + }); + return new Help(doc); + }; + + /** + * Returns a string representation of the Help object + */ + Help.prototype.valueOf = Help.prototype.toString; + return Help; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Parser.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Parser.js new file mode 100644 index 0000000..d6bcb8e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/Parser.js @@ -0,0 +1,147 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createParserClass = void 0; +var _factory = require("../utils/factory.js"); +var _map = require("../utils/map.js"); +const name = 'Parser'; +const dependencies = ['evaluate']; +const createParserClass = exports.createParserClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + evaluate + } = _ref; + /** + * @constructor Parser + * Parser contains methods to evaluate or parse expressions, and has a number + * of convenience methods to get, set, and remove variables from memory. Parser + * keeps a scope containing variables in memory, which is used for all + * evaluations. + * + * Methods: + * const result = parser.evaluate(expr) // evaluate an expression + * const value = parser.get(name) // retrieve a variable from the parser + * const values = parser.getAll() // retrieve all defined variables + * parser.set(name, value) // set a variable in the parser + * parser.remove(name) // clear a variable from the + * // parsers scope + * parser.clear() // clear the parsers scope + * + * Example usage: + * const parser = new Parser() + * // Note: there is a convenience method which can be used instead: + * // const parser = new math.parser() + * + * // evaluate expressions + * parser.evaluate('sqrt(3^2 + 4^2)') // 5 + * parser.evaluate('sqrt(-4)') // 2i + * parser.evaluate('2 inch in cm') // 5.08 cm + * parser.evaluate('cos(45 deg)') // 0.7071067811865476 + * + * // define variables and functions + * parser.evaluate('x = 7 / 2') // 3.5 + * parser.evaluate('x + 3') // 6.5 + * parser.evaluate('f(x, y) = x^y') // f(x, y) + * parser.evaluate('f(2, 3)') // 8 + * + * // get and set variables and functions + * const x = parser.get('x') // 3.5 + * const f = parser.get('f') // function + * const g = f(3, 2) // 9 + * parser.set('h', 500) + * const i = parser.evaluate('h / 2') // 250 + * parser.set('hello', function (name) { + * return 'hello, ' + name + '!' + * }) + * parser.evaluate('hello("user")') // "hello, user!" + * + * // clear defined functions and variables + * parser.clear() + * + */ + function Parser() { + if (!(this instanceof Parser)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + Object.defineProperty(this, 'scope', { + value: (0, _map.createEmptyMap)(), + writable: false + }); + } + + /** + * Attach type information + */ + Parser.prototype.type = 'Parser'; + Parser.prototype.isParser = true; + + /** + * Parse and evaluate the given expression + * @param {string | string[]} expr A string containing an expression, + * for example "2+3", or a list with expressions + * @return {*} result The result, or undefined when the expression was empty + * @throws {Error} + */ + Parser.prototype.evaluate = function (expr) { + // TODO: validate arguments + return evaluate(expr, this.scope); + }; + + /** + * Get a variable (a function or variable) by name from the parsers scope. + * Returns undefined when not found + * @param {string} name + * @return {* | undefined} value + */ + Parser.prototype.get = function (name) { + // TODO: validate arguments + if (this.scope.has(name)) { + return this.scope.get(name); + } + }; + + /** + * Get a map with all defined variables + * @return {Object} values + */ + Parser.prototype.getAll = function () { + return (0, _map.toObject)(this.scope); + }; + + /** + * Get a map with all defined variables + * @return {Map} values + */ + Parser.prototype.getAllAsMap = function () { + return this.scope; + }; + + /** + * Set a symbol (a function or variable) by name from the parsers scope. + * @param {string} name + * @param {* | undefined} value + */ + Parser.prototype.set = function (name, value) { + this.scope.set(name, value); + return value; + }; + + /** + * Remove a variable from the parsers scope + * @param {string} name + */ + Parser.prototype.remove = function (name) { + this.scope.delete(name); + }; + + /** + * Clear the scope with variables and functions + */ + Parser.prototype.clear = function () { + this.scope.clear(); + }; + return Parser; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js new file mode 100644 index 0000000..0d196e7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.InfinityDocs = void 0; +const InfinityDocs = exports.InfinityDocs = { + name: 'Infinity', + category: 'Constants', + syntax: ['Infinity'], + description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.', + examples: ['Infinity', '1 / 0'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js new file mode 100644 index 0000000..cb72ec4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN10Docs = void 0; +const LN10Docs = exports.LN10Docs = { + name: 'LN10', + category: 'Constants', + syntax: ['LN10'], + description: 'Returns the natural logarithm of 10, approximately equal to 2.302', + examples: ['LN10', 'log(10)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js new file mode 100644 index 0000000..8e02ef2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LN2Docs = void 0; +const LN2Docs = exports.LN2Docs = { + name: 'LN2', + category: 'Constants', + syntax: ['LN2'], + description: 'Returns the natural logarithm of 2, approximately equal to 0.693', + examples: ['LN2', 'log(2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js new file mode 100644 index 0000000..b8f4e1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG10EDocs = void 0; +const LOG10EDocs = exports.LOG10EDocs = { + name: 'LOG10E', + category: 'Constants', + syntax: ['LOG10E'], + description: 'Returns the base-10 logarithm of E, approximately equal to 0.434', + examples: ['LOG10E', 'log(e, 10)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js new file mode 100644 index 0000000..9ed7b87 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LOG2EDocs = void 0; +const LOG2EDocs = exports.LOG2EDocs = { + name: 'LOG2E', + category: 'Constants', + syntax: ['LOG2E'], + description: 'Returns the base-2 logarithm of E, approximately equal to 1.442', + examples: ['LOG2E', 'log(e, 2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js new file mode 100644 index 0000000..adab0d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NaNDocs = void 0; +const NaNDocs = exports.NaNDocs = { + name: 'NaN', + category: 'Constants', + syntax: ['NaN'], + description: 'Not a number', + examples: ['NaN', '0 / 0'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js new file mode 100644 index 0000000..76d2977 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT12Docs = void 0; +const SQRT12Docs = exports.SQRT12Docs = { + name: 'SQRT1_2', + category: 'Constants', + syntax: ['SQRT1_2'], + description: 'Returns the square root of 1/2, approximately equal to 0.707', + examples: ['SQRT1_2', 'sqrt(1/2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js new file mode 100644 index 0000000..c119c71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SQRT2Docs = void 0; +const SQRT2Docs = exports.SQRT2Docs = { + name: 'SQRT2', + category: 'Constants', + syntax: ['SQRT2'], + description: 'Returns the square root of 2, approximately equal to 1.414', + examples: ['SQRT2', 'sqrt(2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js new file mode 100644 index 0000000..efd8222 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.eDocs = void 0; +const eDocs = exports.eDocs = { + name: 'e', + category: 'Constants', + syntax: ['e'], + description: 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828', + examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'], + seealso: ['exp'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js new file mode 100644 index 0000000..37d4bbb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.falseDocs = void 0; +const falseDocs = exports.falseDocs = { + name: 'false', + category: 'Constants', + syntax: ['false'], + description: 'Boolean value false', + examples: ['false'], + seealso: ['true'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js new file mode 100644 index 0000000..b0c0f4f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.iDocs = void 0; +const iDocs = exports.iDocs = { + name: 'i', + category: 'Constants', + syntax: ['i'], + description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.', + examples: ['i', 'i * i', 'sqrt(-1)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js new file mode 100644 index 0000000..250eca4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nullDocs = void 0; +const nullDocs = exports.nullDocs = { + name: 'null', + category: 'Constants', + syntax: ['null'], + description: 'Value null', + examples: ['null'], + seealso: ['true', 'false'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js new file mode 100644 index 0000000..46175cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.phiDocs = void 0; +const phiDocs = exports.phiDocs = { + name: 'phi', + category: 'Constants', + syntax: ['phi'], + description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...', + examples: ['phi'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js new file mode 100644 index 0000000..d7b6bea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.piDocs = void 0; +const piDocs = exports.piDocs = { + name: 'pi', + category: 'Constants', + syntax: ['pi'], + description: 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159', + examples: ['pi', 'sin(pi/2)'], + seealso: ['tau'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js new file mode 100644 index 0000000..da38e95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tauDocs = void 0; +const tauDocs = exports.tauDocs = { + name: 'tau', + category: 'Constants', + syntax: ['tau'], + description: 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.', + examples: ['tau', '2 * pi'], + seealso: ['pi'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js new file mode 100644 index 0000000..5719e8c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.trueDocs = void 0; +const trueDocs = exports.trueDocs = { + name: 'true', + category: 'Constants', + syntax: ['true'], + description: 'Boolean value true', + examples: ['true'], + seealso: ['false'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js new file mode 100644 index 0000000..e215e43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.versionDocs = void 0; +const versionDocs = exports.versionDocs = { + name: 'version', + category: 'Constants', + syntax: ['version'], + description: 'A string with the version number of math.js', + examples: ['version'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js new file mode 100644 index 0000000..35a92c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bigintDocs = void 0; +const bigintDocs = exports.bigintDocs = { + name: 'bigint', + category: 'Construction', + syntax: ['bigint(x)'], + description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.', + examples: ['123123123123123123 # a large number will lose digits', 'bigint("123123123123123123")', 'bignumber(["1", "3", "5"])'], + seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js new file mode 100644 index 0000000..e852d27 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bignumberDocs = void 0; +const bignumberDocs = exports.bignumberDocs = { + name: 'bignumber', + category: 'Construction', + syntax: ['bignumber(x)'], + description: 'Create a big number from a number or string.', + examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber("7.2")', 'bignumber("7.2e500")', 'bignumber([0.1, 0.2, 0.3])'], + seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js new file mode 100644 index 0000000..cac2f0a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.booleanDocs = void 0; +const booleanDocs = exports.booleanDocs = { + name: 'boolean', + category: 'Construction', + syntax: ['x', 'boolean(x)'], + description: 'Convert a string or number into a boolean.', + examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean("true")', 'boolean("false")', 'boolean([1, 0, 1, 1])'], + seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js new file mode 100644 index 0000000..c73b0de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.complexDocs = void 0; +const complexDocs = exports.complexDocs = { + name: 'complex', + category: 'Construction', + syntax: ['complex()', 'complex(re, im)', 'complex(string)'], + description: 'Create a complex number.', + examples: ['complex()', 'complex(2, 3)', 'complex("7 - 2i")'], + seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js new file mode 100644 index 0000000..13d213a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnitDocs = void 0; +const createUnitDocs = exports.createUnitDocs = { + name: 'createUnit', + category: 'Construction', + syntax: ['createUnit(definitions)', 'createUnit(name, definition)'], + description: 'Create a user-defined unit and register it with the Unit type.', + examples: ['createUnit("foo")', 'createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})', 'createUnit("mph", "1 mile/hour")'], + seealso: ['unit', 'splitUnit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js new file mode 100644 index 0000000..b51923b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fractionDocs = void 0; +const fractionDocs = exports.fractionDocs = { + name: 'fraction', + category: 'Construction', + syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'], + description: 'Create a fraction from a number or from integer numerator and denominator.', + examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js new file mode 100644 index 0000000..2aedda9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.indexDocs = void 0; +const indexDocs = exports.indexDocs = { + name: 'index', + category: 'Construction', + syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'], + description: 'Create an index to get or replace a subset of a matrix', + examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'], + seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js new file mode 100644 index 0000000..2cd0ecf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixDocs = void 0; +const matrixDocs = exports.matrixDocs = { + name: 'matrix', + category: 'Construction', + syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix("dense")', 'matrix([...])'], + description: 'Create a matrix.', + examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], "sparse")', 'matrix([3, 4; 5, 6], "sparse", "number")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js new file mode 100644 index 0000000..4374c3f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numberDocs = void 0; +const numberDocs = exports.numberDocs = { + name: 'number', + category: 'Construction', + syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'], + description: 'Create a number or convert a string or boolean into a number.', + examples: ['2', '2e3', '4.05', 'number(2)', 'number("7.2")', 'number(true)', 'number([true, false, true, true])', 'number(unit("52cm"), "m")'], + seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js new file mode 100644 index 0000000..062dd57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sparseDocs = void 0; +const sparseDocs = exports.sparseDocs = { + name: 'sparse', + category: 'Construction', + syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], "number")'], + description: 'Create a sparse matrix.', + examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], "number")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js new file mode 100644 index 0000000..7c03ce9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.splitUnitDocs = void 0; +const splitUnitDocs = exports.splitUnitDocs = { + name: 'splitUnit', + category: 'Construction', + syntax: ['splitUnit(unit: Unit, parts: Unit[])'], + description: 'Split a unit in an array of units whose sum is equal to the original unit.', + examples: ['splitUnit(1 m, ["feet", "inch"])'], + seealso: ['unit', 'createUnit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js new file mode 100644 index 0000000..6a07f5f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stringDocs = void 0; +const stringDocs = exports.stringDocs = { + name: 'string', + category: 'Construction', + syntax: ['"text"', 'string(x)'], + description: 'Create a string or convert a value to a string', + examples: ['"Hello World!"', 'string(4.2)', 'string(3 + 2i)'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js new file mode 100644 index 0000000..95bec70 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unitDocs = void 0; +const unitDocs = exports.unitDocs = { + name: 'unit', + category: 'Construction', + syntax: ['value unit', 'unit(value, unit)', 'unit(string)'], + description: 'Create a unit.', + examples: ['5.5 mm', '3 inch', 'unit(7.1, "kilogram")', 'unit("23 deg")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js new file mode 100644 index 0000000..97b9fce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.configDocs = void 0; +const configDocs = exports.configDocs = { + name: 'config', + category: 'Core', + syntax: ['config()', 'config(options)'], + description: 'Get configuration or change configuration.', + examples: ['config()', '1/3 + 1/4', 'config({number: "Fraction"})', '1/3 + 1/4'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js new file mode 100644 index 0000000..38353f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.importDocs = void 0; +const importDocs = exports.importDocs = { + name: 'import', + category: 'Core', + syntax: ['import(functions)', 'import(functions, options)'], + description: 'Import functions or constants from an object.', + examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js new file mode 100644 index 0000000..bddba19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typedDocs = void 0; +const typedDocs = exports.typedDocs = { + name: 'typed', + category: 'Core', + syntax: ['typed(signatures)', 'typed(name, signatures)'], + description: 'Create a typed function.', + examples: ['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })', 'double(2)', 'double("hello")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js new file mode 100644 index 0000000..eb9afbf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js @@ -0,0 +1,726 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.embeddedDocs = void 0; +var _e = require("./constants/e.js"); +var _false = require("./constants/false.js"); +var _i = require("./constants/i.js"); +var _Infinity = require("./constants/Infinity.js"); +var _LN = require("./constants/LN10.js"); +var _LN2 = require("./constants/LN2.js"); +var _LOG10E = require("./constants/LOG10E.js"); +var _LOG2E = require("./constants/LOG2E.js"); +var _NaN = require("./constants/NaN.js"); +var _null = require("./constants/null.js"); +var _phi = require("./constants/phi.js"); +var _pi = require("./constants/pi.js"); +var _SQRT1_ = require("./constants/SQRT1_2.js"); +var _SQRT = require("./constants/SQRT2.js"); +var _tau = require("./constants/tau.js"); +var _true = require("./constants/true.js"); +var _version = require("./constants/version.js"); +var _bignumber = require("./construction/bignumber.js"); +var _bigint = require("./construction/bigint.js"); +var _boolean = require("./construction/boolean.js"); +var _complex = require("./construction/complex.js"); +var _createUnit = require("./construction/createUnit.js"); +var _fraction = require("./construction/fraction.js"); +var _index = require("./construction/index.js"); +var _matrix = require("./construction/matrix.js"); +var _number = require("./construction/number.js"); +var _sparse = require("./construction/sparse.js"); +var _splitUnit = require("./construction/splitUnit.js"); +var _string = require("./construction/string.js"); +var _unit = require("./construction/unit.js"); +var _config = require("./core/config.js"); +var _import = require("./core/import.js"); +var _typed = require("./core/typed.js"); +var _derivative = require("./function/algebra/derivative.js"); +var _leafCount = require("./function/algebra/leafCount.js"); +var _lsolve = require("./function/algebra/lsolve.js"); +var _lsolveAll = require("./function/algebra/lsolveAll.js"); +var _lup = require("./function/algebra/lup.js"); +var _lusolve = require("./function/algebra/lusolve.js"); +var _polynomialRoot = require("./function/algebra/polynomialRoot.js"); +var _qr = require("./function/algebra/qr.js"); +var _rationalize = require("./function/algebra/rationalize.js"); +var _resolve = require("./function/algebra/resolve.js"); +var _simplify = require("./function/algebra/simplify.js"); +var _simplifyConstant = require("./function/algebra/simplifyConstant.js"); +var _simplifyCore = require("./function/algebra/simplifyCore.js"); +var _slu = require("./function/algebra/slu.js"); +var _symbolicEqual = require("./function/algebra/symbolicEqual.js"); +var _usolve = require("./function/algebra/usolve.js"); +var _usolveAll = require("./function/algebra/usolveAll.js"); +var _abs = require("./function/arithmetic/abs.js"); +var _add = require("./function/arithmetic/add.js"); +var _cbrt = require("./function/arithmetic/cbrt.js"); +var _ceil = require("./function/arithmetic/ceil.js"); +var _cube = require("./function/arithmetic/cube.js"); +var _divide = require("./function/arithmetic/divide.js"); +var _dotDivide = require("./function/arithmetic/dotDivide.js"); +var _dotMultiply = require("./function/arithmetic/dotMultiply.js"); +var _dotPow = require("./function/arithmetic/dotPow.js"); +var _exp = require("./function/arithmetic/exp.js"); +var _expm = require("./function/arithmetic/expm.js"); +var _expm2 = require("./function/arithmetic/expm1.js"); +var _fix = require("./function/arithmetic/fix.js"); +var _floor = require("./function/arithmetic/floor.js"); +var _gcd = require("./function/arithmetic/gcd.js"); +var _hypot = require("./function/arithmetic/hypot.js"); +var _invmod = require("./function/arithmetic/invmod.js"); +var _lcm = require("./function/arithmetic/lcm.js"); +var _log = require("./function/arithmetic/log.js"); +var _log2 = require("./function/arithmetic/log10.js"); +var _log1p = require("./function/arithmetic/log1p.js"); +var _log3 = require("./function/arithmetic/log2.js"); +var _mod = require("./function/arithmetic/mod.js"); +var _multiply = require("./function/arithmetic/multiply.js"); +var _norm = require("./function/arithmetic/norm.js"); +var _nthRoot = require("./function/arithmetic/nthRoot.js"); +var _nthRoots = require("./function/arithmetic/nthRoots.js"); +var _pow = require("./function/arithmetic/pow.js"); +var _round = require("./function/arithmetic/round.js"); +var _sign = require("./function/arithmetic/sign.js"); +var _sqrt = require("./function/arithmetic/sqrt.js"); +var _sqrtm = require("./function/arithmetic/sqrtm.js"); +var _sylvester = require("./function/algebra/sylvester.js"); +var _schur = require("./function/algebra/schur.js"); +var _lyap = require("./function/algebra/lyap.js"); +var _square = require("./function/arithmetic/square.js"); +var _subtract = require("./function/arithmetic/subtract.js"); +var _unaryMinus = require("./function/arithmetic/unaryMinus.js"); +var _unaryPlus = require("./function/arithmetic/unaryPlus.js"); +var _xgcd = require("./function/arithmetic/xgcd.js"); +var _bitAnd = require("./function/bitwise/bitAnd.js"); +var _bitNot = require("./function/bitwise/bitNot.js"); +var _bitOr = require("./function/bitwise/bitOr.js"); +var _bitXor = require("./function/bitwise/bitXor.js"); +var _leftShift = require("./function/bitwise/leftShift.js"); +var _rightArithShift = require("./function/bitwise/rightArithShift.js"); +var _rightLogShift = require("./function/bitwise/rightLogShift.js"); +var _bellNumbers = require("./function/combinatorics/bellNumbers.js"); +var _catalan = require("./function/combinatorics/catalan.js"); +var _composition = require("./function/combinatorics/composition.js"); +var _stirlingS = require("./function/combinatorics/stirlingS2.js"); +var _arg = require("./function/complex/arg.js"); +var _conj = require("./function/complex/conj.js"); +var _im = require("./function/complex/im.js"); +var _re = require("./function/complex/re.js"); +var _evaluate = require("./function/expression/evaluate.js"); +var _help = require("./function/expression/help.js"); +var _distance = require("./function/geometry/distance.js"); +var _intersect = require("./function/geometry/intersect.js"); +var _and = require("./function/logical/and.js"); +var _not = require("./function/logical/not.js"); +var _or = require("./function/logical/or.js"); +var _xor = require("./function/logical/xor.js"); +var _column = require("./function/matrix/column.js"); +var _concat = require("./function/matrix/concat.js"); +var _count = require("./function/matrix/count.js"); +var _cross = require("./function/matrix/cross.js"); +var _ctranspose = require("./function/matrix/ctranspose.js"); +var _det = require("./function/matrix/det.js"); +var _diag = require("./function/matrix/diag.js"); +var _diff = require("./function/matrix/diff.js"); +var _dot = require("./function/matrix/dot.js"); +var _eigs = require("./function/matrix/eigs.js"); +var _filter = require("./function/matrix/filter.js"); +var _flatten = require("./function/matrix/flatten.js"); +var _forEach = require("./function/matrix/forEach.js"); +var _getMatrixDataType = require("./function/matrix/getMatrixDataType.js"); +var _identity = require("./function/matrix/identity.js"); +var _inv = require("./function/matrix/inv.js"); +var _pinv = require("./function/matrix/pinv.js"); +var _kron = require("./function/matrix/kron.js"); +var _map = require("./function/matrix/map.js"); +var _matrixFromColumns = require("./function/matrix/matrixFromColumns.js"); +var _matrixFromFunction = require("./function/matrix/matrixFromFunction.js"); +var _matrixFromRows = require("./function/matrix/matrixFromRows.js"); +var _ones = require("./function/matrix/ones.js"); +var _partitionSelect = require("./function/matrix/partitionSelect.js"); +var _range = require("./function/matrix/range.js"); +var _reshape = require("./function/matrix/reshape.js"); +var _resize = require("./function/matrix/resize.js"); +var _rotate = require("./function/matrix/rotate.js"); +var _rotationMatrix = require("./function/matrix/rotationMatrix.js"); +var _row = require("./function/matrix/row.js"); +var _size = require("./function/matrix/size.js"); +var _sort = require("./function/matrix/sort.js"); +var _squeeze = require("./function/matrix/squeeze.js"); +var _subset = require("./function/matrix/subset.js"); +var _trace = require("./function/matrix/trace.js"); +var _transpose = require("./function/matrix/transpose.js"); +var _zeros = require("./function/matrix/zeros.js"); +var _fft = require("./function/matrix/fft.js"); +var _ifft = require("./function/matrix/ifft.js"); +var _combinations = require("./function/probability/combinations.js"); +var _combinationsWithRep = require("./function/probability/combinationsWithRep.js"); +var _factorial = require("./function/probability/factorial.js"); +var _gamma = require("./function/probability/gamma.js"); +var _lgamma = require("./function/probability/lgamma.js"); +var _kldivergence = require("./function/probability/kldivergence.js"); +var _multinomial = require("./function/probability/multinomial.js"); +var _permutations = require("./function/probability/permutations.js"); +var _pickRandom = require("./function/probability/pickRandom.js"); +var _random = require("./function/probability/random.js"); +var _randomInt = require("./function/probability/randomInt.js"); +var _compare = require("./function/relational/compare.js"); +var _compareNatural = require("./function/relational/compareNatural.js"); +var _compareText = require("./function/relational/compareText.js"); +var _deepEqual = require("./function/relational/deepEqual.js"); +var _equal = require("./function/relational/equal.js"); +var _equalText = require("./function/relational/equalText.js"); +var _larger = require("./function/relational/larger.js"); +var _largerEq = require("./function/relational/largerEq.js"); +var _smaller = require("./function/relational/smaller.js"); +var _smallerEq = require("./function/relational/smallerEq.js"); +var _unequal = require("./function/relational/unequal.js"); +var _setCartesian = require("./function/set/setCartesian.js"); +var _setDifference = require("./function/set/setDifference.js"); +var _setDistinct = require("./function/set/setDistinct.js"); +var _setIntersect = require("./function/set/setIntersect.js"); +var _setIsSubset = require("./function/set/setIsSubset.js"); +var _setMultiplicity = require("./function/set/setMultiplicity.js"); +var _setPowerset = require("./function/set/setPowerset.js"); +var _setSize = require("./function/set/setSize.js"); +var _setSymDifference = require("./function/set/setSymDifference.js"); +var _setUnion = require("./function/set/setUnion.js"); +var _zpk2tf = require("./function/signal/zpk2tf.js"); +var _freqz = require("./function/signal/freqz.js"); +var _erf = require("./function/special/erf.js"); +var _zeta = require("./function/special/zeta.js"); +var _mad = require("./function/statistics/mad.js"); +var _max = require("./function/statistics/max.js"); +var _mean = require("./function/statistics/mean.js"); +var _median = require("./function/statistics/median.js"); +var _min = require("./function/statistics/min.js"); +var _mode = require("./function/statistics/mode.js"); +var _prod = require("./function/statistics/prod.js"); +var _quantileSeq = require("./function/statistics/quantileSeq.js"); +var _std = require("./function/statistics/std.js"); +var _cumsum = require("./function/statistics/cumsum.js"); +var _sum = require("./function/statistics/sum.js"); +var _variance = require("./function/statistics/variance.js"); +var _corr = require("./function/statistics/corr.js"); +var _acos = require("./function/trigonometry/acos.js"); +var _acosh = require("./function/trigonometry/acosh.js"); +var _acot = require("./function/trigonometry/acot.js"); +var _acoth = require("./function/trigonometry/acoth.js"); +var _acsc = require("./function/trigonometry/acsc.js"); +var _acsch = require("./function/trigonometry/acsch.js"); +var _asec = require("./function/trigonometry/asec.js"); +var _asech = require("./function/trigonometry/asech.js"); +var _asin = require("./function/trigonometry/asin.js"); +var _asinh = require("./function/trigonometry/asinh.js"); +var _atan = require("./function/trigonometry/atan.js"); +var _atan2 = require("./function/trigonometry/atan2.js"); +var _atanh = require("./function/trigonometry/atanh.js"); +var _cos = require("./function/trigonometry/cos.js"); +var _cosh = require("./function/trigonometry/cosh.js"); +var _cot = require("./function/trigonometry/cot.js"); +var _coth = require("./function/trigonometry/coth.js"); +var _csc = require("./function/trigonometry/csc.js"); +var _csch = require("./function/trigonometry/csch.js"); +var _sec = require("./function/trigonometry/sec.js"); +var _sech = require("./function/trigonometry/sech.js"); +var _sin = require("./function/trigonometry/sin.js"); +var _sinh = require("./function/trigonometry/sinh.js"); +var _tan = require("./function/trigonometry/tan.js"); +var _tanh = require("./function/trigonometry/tanh.js"); +var _to = require("./function/units/to.js"); +var _bin = require("./function/utils/bin.js"); +var _clone = require("./function/utils/clone.js"); +var _format = require("./function/utils/format.js"); +var _hasNumericValue = require("./function/utils/hasNumericValue.js"); +var _hex = require("./function/utils/hex.js"); +var _isInteger = require("./function/utils/isInteger.js"); +var _isNaN = require("./function/utils/isNaN.js"); +var _isNegative = require("./function/utils/isNegative.js"); +var _isNumeric = require("./function/utils/isNumeric.js"); +var _isPositive = require("./function/utils/isPositive.js"); +var _isPrime = require("./function/utils/isPrime.js"); +var _isZero = require("./function/utils/isZero.js"); +var _numeric = require("./function/utils/numeric.js"); +var _oct = require("./function/utils/oct.js"); +var _print = require("./function/utils/print.js"); +var _typeOf = require("./function/utils/typeOf.js"); +var _solveODE = require("./function/numeric/solveODE.js"); +const embeddedDocs = exports.embeddedDocs = { + // construction functions + bignumber: _bignumber.bignumberDocs, + bigint: _bigint.bigintDocs, + boolean: _boolean.booleanDocs, + complex: _complex.complexDocs, + createUnit: _createUnit.createUnitDocs, + fraction: _fraction.fractionDocs, + index: _index.indexDocs, + matrix: _matrix.matrixDocs, + number: _number.numberDocs, + sparse: _sparse.sparseDocs, + splitUnit: _splitUnit.splitUnitDocs, + string: _string.stringDocs, + unit: _unit.unitDocs, + // constants + e: _e.eDocs, + E: _e.eDocs, + false: _false.falseDocs, + i: _i.iDocs, + Infinity: _Infinity.InfinityDocs, + LN2: _LN2.LN2Docs, + LN10: _LN.LN10Docs, + LOG2E: _LOG2E.LOG2EDocs, + LOG10E: _LOG10E.LOG10EDocs, + NaN: _NaN.NaNDocs, + null: _null.nullDocs, + pi: _pi.piDocs, + PI: _pi.piDocs, + phi: _phi.phiDocs, + SQRT1_2: _SQRT1_.SQRT12Docs, + SQRT2: _SQRT.SQRT2Docs, + tau: _tau.tauDocs, + true: _true.trueDocs, + version: _version.versionDocs, + // physical constants + // TODO: more detailed docs for physical constants + speedOfLight: { + description: 'Speed of light in vacuum', + examples: ['speedOfLight'] + }, + gravitationConstant: { + description: 'Newtonian constant of gravitation', + examples: ['gravitationConstant'] + }, + planckConstant: { + description: 'Planck constant', + examples: ['planckConstant'] + }, + reducedPlanckConstant: { + description: 'Reduced Planck constant', + examples: ['reducedPlanckConstant'] + }, + magneticConstant: { + description: 'Magnetic constant (vacuum permeability)', + examples: ['magneticConstant'] + }, + electricConstant: { + description: 'Electric constant (vacuum permeability)', + examples: ['electricConstant'] + }, + vacuumImpedance: { + description: 'Characteristic impedance of vacuum', + examples: ['vacuumImpedance'] + }, + coulomb: { + description: 'Coulomb\'s constant', + examples: ['coulomb'] + }, + elementaryCharge: { + description: 'Elementary charge', + examples: ['elementaryCharge'] + }, + bohrMagneton: { + description: 'Bohr magneton', + examples: ['bohrMagneton'] + }, + conductanceQuantum: { + description: 'Conductance quantum', + examples: ['conductanceQuantum'] + }, + inverseConductanceQuantum: { + description: 'Inverse conductance quantum', + examples: ['inverseConductanceQuantum'] + }, + // josephson: {description: 'Josephson constant', examples: ['josephson']}, + magneticFluxQuantum: { + description: 'Magnetic flux quantum', + examples: ['magneticFluxQuantum'] + }, + nuclearMagneton: { + description: 'Nuclear magneton', + examples: ['nuclearMagneton'] + }, + klitzing: { + description: 'Von Klitzing constant', + examples: ['klitzing'] + }, + bohrRadius: { + description: 'Bohr radius', + examples: ['bohrRadius'] + }, + classicalElectronRadius: { + description: 'Classical electron radius', + examples: ['classicalElectronRadius'] + }, + electronMass: { + description: 'Electron mass', + examples: ['electronMass'] + }, + fermiCoupling: { + description: 'Fermi coupling constant', + examples: ['fermiCoupling'] + }, + fineStructure: { + description: 'Fine-structure constant', + examples: ['fineStructure'] + }, + hartreeEnergy: { + description: 'Hartree energy', + examples: ['hartreeEnergy'] + }, + protonMass: { + description: 'Proton mass', + examples: ['protonMass'] + }, + deuteronMass: { + description: 'Deuteron Mass', + examples: ['deuteronMass'] + }, + neutronMass: { + description: 'Neutron mass', + examples: ['neutronMass'] + }, + quantumOfCirculation: { + description: 'Quantum of circulation', + examples: ['quantumOfCirculation'] + }, + rydberg: { + description: 'Rydberg constant', + examples: ['rydberg'] + }, + thomsonCrossSection: { + description: 'Thomson cross section', + examples: ['thomsonCrossSection'] + }, + weakMixingAngle: { + description: 'Weak mixing angle', + examples: ['weakMixingAngle'] + }, + efimovFactor: { + description: 'Efimov factor', + examples: ['efimovFactor'] + }, + atomicMass: { + description: 'Atomic mass constant', + examples: ['atomicMass'] + }, + avogadro: { + description: 'Avogadro\'s number', + examples: ['avogadro'] + }, + boltzmann: { + description: 'Boltzmann constant', + examples: ['boltzmann'] + }, + faraday: { + description: 'Faraday constant', + examples: ['faraday'] + }, + firstRadiation: { + description: 'First radiation constant', + examples: ['firstRadiation'] + }, + loschmidt: { + description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa', + examples: ['loschmidt'] + }, + gasConstant: { + description: 'Gas constant', + examples: ['gasConstant'] + }, + molarPlanckConstant: { + description: 'Molar Planck constant', + examples: ['molarPlanckConstant'] + }, + molarVolume: { + description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa', + examples: ['molarVolume'] + }, + sackurTetrode: { + description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa', + examples: ['sackurTetrode'] + }, + secondRadiation: { + description: 'Second radiation constant', + examples: ['secondRadiation'] + }, + stefanBoltzmann: { + description: 'Stefan-Boltzmann constant', + examples: ['stefanBoltzmann'] + }, + wienDisplacement: { + description: 'Wien displacement law constant', + examples: ['wienDisplacement'] + }, + // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']}, + + molarMass: { + description: 'Molar mass constant', + examples: ['molarMass'] + }, + molarMassC12: { + description: 'Molar mass constant of carbon-12', + examples: ['molarMassC12'] + }, + gravity: { + description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)', + examples: ['gravity'] + }, + planckLength: { + description: 'Planck length', + examples: ['planckLength'] + }, + planckMass: { + description: 'Planck mass', + examples: ['planckMass'] + }, + planckTime: { + description: 'Planck time', + examples: ['planckTime'] + }, + planckCharge: { + description: 'Planck charge', + examples: ['planckCharge'] + }, + planckTemperature: { + description: 'Planck temperature', + examples: ['planckTemperature'] + }, + // functions - algebra + derivative: _derivative.derivativeDocs, + lsolve: _lsolve.lsolveDocs, + lsolveAll: _lsolveAll.lsolveAllDocs, + lup: _lup.lupDocs, + lusolve: _lusolve.lusolveDocs, + leafCount: _leafCount.leafCountDocs, + polynomialRoot: _polynomialRoot.polynomialRootDocs, + resolve: _resolve.resolveDocs, + simplify: _simplify.simplifyDocs, + simplifyConstant: _simplifyConstant.simplifyConstantDocs, + simplifyCore: _simplifyCore.simplifyCoreDocs, + symbolicEqual: _symbolicEqual.symbolicEqualDocs, + rationalize: _rationalize.rationalizeDocs, + slu: _slu.sluDocs, + usolve: _usolve.usolveDocs, + usolveAll: _usolveAll.usolveAllDocs, + qr: _qr.qrDocs, + // functions - arithmetic + abs: _abs.absDocs, + add: _add.addDocs, + cbrt: _cbrt.cbrtDocs, + ceil: _ceil.ceilDocs, + cube: _cube.cubeDocs, + divide: _divide.divideDocs, + dotDivide: _dotDivide.dotDivideDocs, + dotMultiply: _dotMultiply.dotMultiplyDocs, + dotPow: _dotPow.dotPowDocs, + exp: _exp.expDocs, + expm: _expm.expmDocs, + expm1: _expm2.expm1Docs, + fix: _fix.fixDocs, + floor: _floor.floorDocs, + gcd: _gcd.gcdDocs, + hypot: _hypot.hypotDocs, + lcm: _lcm.lcmDocs, + log: _log.logDocs, + log2: _log3.log2Docs, + log1p: _log1p.log1pDocs, + log10: _log2.log10Docs, + mod: _mod.modDocs, + multiply: _multiply.multiplyDocs, + norm: _norm.normDocs, + nthRoot: _nthRoot.nthRootDocs, + nthRoots: _nthRoots.nthRootsDocs, + pow: _pow.powDocs, + round: _round.roundDocs, + sign: _sign.signDocs, + sqrt: _sqrt.sqrtDocs, + sqrtm: _sqrtm.sqrtmDocs, + square: _square.squareDocs, + subtract: _subtract.subtractDocs, + unaryMinus: _unaryMinus.unaryMinusDocs, + unaryPlus: _unaryPlus.unaryPlusDocs, + xgcd: _xgcd.xgcdDocs, + invmod: _invmod.invmodDocs, + // functions - bitwise + bitAnd: _bitAnd.bitAndDocs, + bitNot: _bitNot.bitNotDocs, + bitOr: _bitOr.bitOrDocs, + bitXor: _bitXor.bitXorDocs, + leftShift: _leftShift.leftShiftDocs, + rightArithShift: _rightArithShift.rightArithShiftDocs, + rightLogShift: _rightLogShift.rightLogShiftDocs, + // functions - combinatorics + bellNumbers: _bellNumbers.bellNumbersDocs, + catalan: _catalan.catalanDocs, + composition: _composition.compositionDocs, + stirlingS2: _stirlingS.stirlingS2Docs, + // functions - core + config: _config.configDocs, + import: _import.importDocs, + typed: _typed.typedDocs, + // functions - complex + arg: _arg.argDocs, + conj: _conj.conjDocs, + re: _re.reDocs, + im: _im.imDocs, + // functions - expression + evaluate: _evaluate.evaluateDocs, + help: _help.helpDocs, + // functions - geometry + distance: _distance.distanceDocs, + intersect: _intersect.intersectDocs, + // functions - logical + and: _and.andDocs, + not: _not.notDocs, + or: _or.orDocs, + xor: _xor.xorDocs, + // functions - matrix + concat: _concat.concatDocs, + count: _count.countDocs, + cross: _cross.crossDocs, + column: _column.columnDocs, + ctranspose: _ctranspose.ctransposeDocs, + det: _det.detDocs, + diag: _diag.diagDocs, + diff: _diff.diffDocs, + dot: _dot.dotDocs, + getMatrixDataType: _getMatrixDataType.getMatrixDataTypeDocs, + identity: _identity.identityDocs, + filter: _filter.filterDocs, + flatten: _flatten.flattenDocs, + forEach: _forEach.forEachDocs, + inv: _inv.invDocs, + pinv: _pinv.pinvDocs, + eigs: _eigs.eigsDocs, + kron: _kron.kronDocs, + matrixFromFunction: _matrixFromFunction.matrixFromFunctionDocs, + matrixFromRows: _matrixFromRows.matrixFromRowsDocs, + matrixFromColumns: _matrixFromColumns.matrixFromColumnsDocs, + map: _map.mapDocs, + ones: _ones.onesDocs, + partitionSelect: _partitionSelect.partitionSelectDocs, + range: _range.rangeDocs, + resize: _resize.resizeDocs, + reshape: _reshape.reshapeDocs, + rotate: _rotate.rotateDocs, + rotationMatrix: _rotationMatrix.rotationMatrixDocs, + row: _row.rowDocs, + size: _size.sizeDocs, + sort: _sort.sortDocs, + squeeze: _squeeze.squeezeDocs, + subset: _subset.subsetDocs, + trace: _trace.traceDocs, + transpose: _transpose.transposeDocs, + zeros: _zeros.zerosDocs, + fft: _fft.fftDocs, + ifft: _ifft.ifftDocs, + sylvester: _sylvester.sylvesterDocs, + schur: _schur.schurDocs, + lyap: _lyap.lyapDocs, + // functions - numeric + solveODE: _solveODE.solveODEDocs, + // functions - probability + combinations: _combinations.combinationsDocs, + combinationsWithRep: _combinationsWithRep.combinationsWithRepDocs, + // distribution: distributionDocs, + factorial: _factorial.factorialDocs, + gamma: _gamma.gammaDocs, + kldivergence: _kldivergence.kldivergenceDocs, + lgamma: _lgamma.lgammaDocs, + multinomial: _multinomial.multinomialDocs, + permutations: _permutations.permutationsDocs, + pickRandom: _pickRandom.pickRandomDocs, + random: _random.randomDocs, + randomInt: _randomInt.randomIntDocs, + // functions - relational + compare: _compare.compareDocs, + compareNatural: _compareNatural.compareNaturalDocs, + compareText: _compareText.compareTextDocs, + deepEqual: _deepEqual.deepEqualDocs, + equal: _equal.equalDocs, + equalText: _equalText.equalTextDocs, + larger: _larger.largerDocs, + largerEq: _largerEq.largerEqDocs, + smaller: _smaller.smallerDocs, + smallerEq: _smallerEq.smallerEqDocs, + unequal: _unequal.unequalDocs, + // functions - set + setCartesian: _setCartesian.setCartesianDocs, + setDifference: _setDifference.setDifferenceDocs, + setDistinct: _setDistinct.setDistinctDocs, + setIntersect: _setIntersect.setIntersectDocs, + setIsSubset: _setIsSubset.setIsSubsetDocs, + setMultiplicity: _setMultiplicity.setMultiplicityDocs, + setPowerset: _setPowerset.setPowersetDocs, + setSize: _setSize.setSizeDocs, + setSymDifference: _setSymDifference.setSymDifferenceDocs, + setUnion: _setUnion.setUnionDocs, + // functions - signal + zpk2tf: _zpk2tf.zpk2tfDocs, + freqz: _freqz.freqzDocs, + // functions - special + erf: _erf.erfDocs, + zeta: _zeta.zetaDocs, + // functions - statistics + cumsum: _cumsum.cumSumDocs, + mad: _mad.madDocs, + max: _max.maxDocs, + mean: _mean.meanDocs, + median: _median.medianDocs, + min: _min.minDocs, + mode: _mode.modeDocs, + prod: _prod.prodDocs, + quantileSeq: _quantileSeq.quantileSeqDocs, + std: _std.stdDocs, + sum: _sum.sumDocs, + variance: _variance.varianceDocs, + corr: _corr.corrDocs, + // functions - trigonometry + acos: _acos.acosDocs, + acosh: _acosh.acoshDocs, + acot: _acot.acotDocs, + acoth: _acoth.acothDocs, + acsc: _acsc.acscDocs, + acsch: _acsch.acschDocs, + asec: _asec.asecDocs, + asech: _asech.asechDocs, + asin: _asin.asinDocs, + asinh: _asinh.asinhDocs, + atan: _atan.atanDocs, + atanh: _atanh.atanhDocs, + atan2: _atan2.atan2Docs, + cos: _cos.cosDocs, + cosh: _cosh.coshDocs, + cot: _cot.cotDocs, + coth: _coth.cothDocs, + csc: _csc.cscDocs, + csch: _csch.cschDocs, + sec: _sec.secDocs, + sech: _sech.sechDocs, + sin: _sin.sinDocs, + sinh: _sinh.sinhDocs, + tan: _tan.tanDocs, + tanh: _tanh.tanhDocs, + // functions - units + to: _to.toDocs, + // functions - utils + clone: _clone.cloneDocs, + format: _format.formatDocs, + bin: _bin.binDocs, + oct: _oct.octDocs, + hex: _hex.hexDocs, + isNaN: _isNaN.isNaNDocs, + isInteger: _isInteger.isIntegerDocs, + isNegative: _isNegative.isNegativeDocs, + isNumeric: _isNumeric.isNumericDocs, + hasNumericValue: _hasNumericValue.hasNumericValueDocs, + isPositive: _isPositive.isPositiveDocs, + isPrime: _isPrime.isPrimeDocs, + isZero: _isZero.isZeroDocs, + print: _print.printDocs, + typeOf: _typeOf.typeOfDocs, + numeric: _numeric.numericDocs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js new file mode 100644 index 0000000..e986679 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.derivativeDocs = void 0; +const derivativeDocs = exports.derivativeDocs = { + name: 'derivative', + category: 'Algebra', + syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'], + description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.', + examples: ['derivative("2x^3", "x")', 'derivative("2x^3", "x", {simplify: false})', 'derivative("2x^2 + 3x + 4", "x")', 'derivative("sin(2x)", "x")', 'f = parse("x^2 + x")', 'x = parse("x")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'], + seealso: ['simplify', 'parse', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js new file mode 100644 index 0000000..93447eb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.leafCountDocs = void 0; +const leafCountDocs = exports.leafCountDocs = { + name: 'leafCount', + category: 'Algebra', + syntax: ['leafCount(expr)'], + description: 'Computes the number of leaves in the parse tree of the given expression', + examples: ['leafCount("e^(i*pi)-1")', 'leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'], + seealso: ['simplify'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js new file mode 100644 index 0000000..0cf5b71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lsolveDocs = void 0; +const lsolveDocs = exports.lsolveDocs = { + name: 'lsolve', + category: 'Algebra', + syntax: ['x=lsolve(L, b)'], + description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'], + seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js new file mode 100644 index 0000000..4472408 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lsolveAllDocs = void 0; +const lsolveAllDocs = exports.lsolveAllDocs = { + name: 'lsolveAll', + category: 'Algebra', + syntax: ['x=lsolveAll(L, b)'], + description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'], + seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js new file mode 100644 index 0000000..4d7030d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lupDocs = void 0; +const lupDocs = exports.lupDocs = { + name: 'lup', + category: 'Algebra', + syntax: ['lup(m)'], + description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U', + examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'], + seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js new file mode 100644 index 0000000..7f17520 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lusolveDocs = void 0; +const lusolveDocs = exports.lusolveDocs = { + name: 'lusolve', + category: 'Algebra', + syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'], + description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'], + seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js new file mode 100644 index 0000000..1c894ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lyapDocs = void 0; +const lyapDocs = exports.lyapDocs = { + name: 'lyap', + category: 'Algebra', + syntax: ['lyap(A,Q)'], + description: 'Solves the Continuous-time Lyapunov equation AP+PA\'+Q=0 for P', + examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'], + seealso: ['schur', 'sylvester'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js new file mode 100644 index 0000000..c329c4b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.polynomialRootDocs = void 0; +const polynomialRootDocs = exports.polynomialRootDocs = { + name: 'polynomialRoot', + category: 'Algebra', + syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'], + description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.', + examples: ['a = polynomialRoot(-6, 11, -6, 1)'], + seealso: ['cbrt', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js new file mode 100644 index 0000000..ea02732 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.qrDocs = void 0; +const qrDocs = exports.qrDocs = { + name: 'qr', + category: 'Algebra', + syntax: ['qr(A)'], + description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.', + examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'], + seealso: ['lup', 'slu', 'matrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js new file mode 100644 index 0000000..d449ce2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rationalizeDocs = void 0; +const rationalizeDocs = exports.rationalizeDocs = { + name: 'rationalize', + category: 'Algebra', + syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'], + description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.', + examples: ['rationalize("2x/y - y/(x+1)")', 'rationalize("2x/y - y/(x+1)", true)'], + seealso: ['simplify'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js new file mode 100644 index 0000000..58eeb4d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolveDocs = void 0; +const resolveDocs = exports.resolveDocs = { + name: 'resolve', + category: 'Algebra', + syntax: ['resolve(node, scope)'], + description: 'Recursively substitute variables in an expression tree.', + examples: ['resolve(parse("1 + x"), { x: 7 })', 'resolve(parse("size(text)"), { text: "Hello World" })', 'resolve(parse("x + y"), { x: parse("3z") })', 'resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'], + seealso: ['simplify', 'evaluate'], + mayThrow: ['ReferenceError'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js new file mode 100644 index 0000000..1fd2f34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.schurDocs = void 0; +const schurDocs = exports.schurDocs = { + name: 'schur', + category: 'Algebra', + syntax: ['schur(A)'], + description: 'Performs a real Schur decomposition of the real matrix A = UTU\'', + examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'], + seealso: ['lyap', 'sylvester'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js new file mode 100644 index 0000000..385e7e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyDocs = void 0; +const simplifyDocs = exports.simplifyDocs = { + name: 'simplify', + category: 'Algebra', + syntax: ['simplify(expr)', 'simplify(expr, rules)'], + description: 'Simplify an expression tree.', + examples: ['simplify("3 + 2 / 4")', 'simplify("2x + x")', 'f = parse("x * (x + 2 + x)")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'], + seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js new file mode 100644 index 0000000..b23cdfc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyConstantDocs = void 0; +const simplifyConstantDocs = exports.simplifyConstantDocs = { + name: 'simplifyConstant', + category: 'Algebra', + syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'], + description: 'Replace constant subexpressions of node with their values.', + examples: ['simplifyConstant("(3-3)*x")', 'simplifyConstant(parse("z-cos(tau/8)"))'], + seealso: ['simplify', 'simplifyCore', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js new file mode 100644 index 0000000..01ebc74 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.simplifyCoreDocs = void 0; +const simplifyCoreDocs = exports.simplifyCoreDocs = { + name: 'simplifyCore', + category: 'Algebra', + syntax: ['simplifyCore(node)'], + description: 'Perform simple one-pass simplifications on an expression tree.', + examples: ['simplifyCore(parse("0*x"))', 'simplifyCore(parse("(x+0)*2"))'], + seealso: ['simplify', 'simplifyConstant', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js new file mode 100644 index 0000000..1403e16 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sluDocs = void 0; +const sluDocs = exports.sluDocs = { + name: 'slu', + category: 'Algebra', + syntax: ['slu(A, order, threshold)'], + description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U', + examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'], + seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js new file mode 100644 index 0000000..d124f2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sylvesterDocs = void 0; +const sylvesterDocs = exports.sylvesterDocs = { + name: 'sylvester', + category: 'Algebra', + syntax: ['sylvester(A,B,C)'], + description: 'Solves the real-valued Sylvester equation AX+XB=C for X', + examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'], + seealso: ['schur', 'lyap'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js new file mode 100644 index 0000000..cdd4c49 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.symbolicEqualDocs = void 0; +const symbolicEqualDocs = exports.symbolicEqualDocs = { + name: 'symbolicEqual', + category: 'Algebra', + syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'], + description: 'Returns true if the difference of the expressions simplifies to 0', + examples: ['symbolicEqual("x*y","y*x")', 'symbolicEqual("abs(x^2)", "x^2")', 'symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'], + seealso: ['simplify', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js new file mode 100644 index 0000000..b0bcb2b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.usolveDocs = void 0; +const usolveDocs = exports.usolveDocs = { + name: 'usolve', + category: 'Algebra', + syntax: ['x=usolve(U, b)'], + description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.', + examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'], + seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js new file mode 100644 index 0000000..8c2af3c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.usolveAllDocs = void 0; +const usolveAllDocs = exports.usolveAllDocs = { + name: 'usolveAll', + category: 'Algebra', + syntax: ['x=usolve(U, b)'], + description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.', + examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'], + seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js new file mode 100644 index 0000000..d12f229 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.absDocs = void 0; +const absDocs = exports.absDocs = { + name: 'abs', + category: 'Arithmetic', + syntax: ['abs(x)'], + description: 'Compute the absolute value.', + examples: ['abs(3.5)', 'abs(-4.2)'], + seealso: ['sign'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js new file mode 100644 index 0000000..a35fdec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDocs = void 0; +const addDocs = exports.addDocs = { + name: 'add', + category: 'Operators', + syntax: ['x + y', 'add(x, y)'], + description: 'Add two values.', + examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '"2.3" + "4"'], + seealso: ['subtract'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js new file mode 100644 index 0000000..c16f047 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cbrtDocs = void 0; +const cbrtDocs = exports.cbrtDocs = { + name: 'cbrt', + category: 'Arithmetic', + syntax: ['cbrt(x)', 'cbrt(x, allRoots)'], + description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned', + examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'], + seealso: ['square', 'sqrt', 'cube', 'multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js new file mode 100644 index 0000000..db22bbd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ceilDocs = void 0; +const ceilDocs = exports.ceilDocs = { + name: 'ceil', + category: 'Arithmetic', + syntax: ['ceil(x)'], + description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.', + examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'], + seealso: ['floor', 'fix', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js new file mode 100644 index 0000000..e81dfb8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cubeDocs = void 0; +const cubeDocs = exports.cubeDocs = { + name: 'cube', + category: 'Arithmetic', + syntax: ['cube(x)'], + description: 'Compute the cube of a value. The cube of x is x * x * x.', + examples: ['cube(2)', '2^3', '2 * 2 * 2'], + seealso: ['multiply', 'square', 'pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js new file mode 100644 index 0000000..97699d4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.divideDocs = void 0; +const divideDocs = exports.divideDocs = { + name: 'divide', + category: 'Operators', + syntax: ['x / y', 'divide(x, y)'], + description: 'Divide two values.', + examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'], + seealso: ['multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js new file mode 100644 index 0000000..4dd03d0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotDivideDocs = void 0; +const dotDivideDocs = exports.dotDivideDocs = { + name: 'dotDivide', + category: 'Operators', + syntax: ['x ./ y', 'dotDivide(x, y)'], + description: 'Divide two values element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'], + seealso: ['multiply', 'dotMultiply', 'divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js new file mode 100644 index 0000000..efa679e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotMultiplyDocs = void 0; +const dotMultiplyDocs = exports.dotMultiplyDocs = { + name: 'dotMultiply', + category: 'Operators', + syntax: ['x .* y', 'dotMultiply(x, y)'], + description: 'Multiply two values element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'], + seealso: ['multiply', 'divide', 'dotDivide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js new file mode 100644 index 0000000..cf9310d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotPowDocs = void 0; +const dotPowDocs = exports.dotPowDocs = { + name: 'dotPow', + category: 'Operators', + syntax: ['x .^ y', 'dotPow(x, y)'], + description: 'Calculates the power of x to y element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'], + seealso: ['pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js new file mode 100644 index 0000000..560d1d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expDocs = void 0; +const expDocs = exports.expDocs = { + name: 'exp', + category: 'Arithmetic', + syntax: ['exp(x)'], + description: 'Calculate the exponent of a value.', + examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\'s formula'], + seealso: ['expm', 'expm1', 'pow', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js new file mode 100644 index 0000000..e1d0279 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expmDocs = void 0; +const expmDocs = exports.expmDocs = { + name: 'expm', + category: 'Arithmetic', + syntax: ['exp(x)'], + description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.', + examples: ['expm([[0,2],[0,0]])'], + seealso: ['exp'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js new file mode 100644 index 0000000..dc95343 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.expm1Docs = void 0; +const expm1Docs = exports.expm1Docs = { + name: 'expm1', + category: 'Arithmetic', + syntax: ['expm1(x)'], + description: 'Calculate the value of subtracting 1 from the exponential value.', + examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'], + seealso: ['exp', 'pow', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js new file mode 100644 index 0000000..293d954 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fixDocs = void 0; +const fixDocs = exports.fixDocs = { + name: 'fix', + category: 'Arithmetic', + syntax: ['fix(x)'], + description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.', + examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'], + seealso: ['ceil', 'floor', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js new file mode 100644 index 0000000..789f941 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.floorDocs = void 0; +const floorDocs = exports.floorDocs = { + name: 'floor', + category: 'Arithmetic', + syntax: ['floor(x)'], + description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.', + examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'], + seealso: ['ceil', 'fix', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js new file mode 100644 index 0000000..fd6c007 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gcdDocs = void 0; +const gcdDocs = exports.gcdDocs = { + name: 'gcd', + category: 'Arithmetic', + syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'], + description: 'Compute the greatest common divisor.', + examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'], + seealso: ['lcm', 'xgcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js new file mode 100644 index 0000000..b10ec20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hypotDocs = void 0; +const hypotDocs = exports.hypotDocs = { + name: 'hypot', + category: 'Arithmetic', + syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'], + description: 'Calculate the hypotenuse of a list with values.', + examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'], + seealso: ['abs', 'norm'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js new file mode 100644 index 0000000..f389aab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.invmodDocs = void 0; +const invmodDocs = exports.invmodDocs = { + name: 'invmod', + category: 'Arithmetic', + syntax: ['invmod(a, b)'], + description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)', + examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'], + seealso: ['gcd', 'xgcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js new file mode 100644 index 0000000..d1621c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lcmDocs = void 0; +const lcmDocs = exports.lcmDocs = { + name: 'lcm', + category: 'Arithmetic', + syntax: ['lcm(x, y)'], + description: 'Compute the least common multiple.', + examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'], + seealso: ['gcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js new file mode 100644 index 0000000..2a7739c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.logDocs = void 0; +const logDocs = exports.logDocs = { + name: 'log', + category: 'Arithmetic', + syntax: ['log(x)', 'log(x, base)'], + description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).', + examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'], + seealso: ['exp', 'log1p', 'log2', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js new file mode 100644 index 0000000..513e9a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log10Docs = void 0; +const log10Docs = exports.log10Docs = { + name: 'log10', + category: 'Arithmetic', + syntax: ['log10(x)'], + description: 'Compute the 10-base logarithm of a value.', + examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'], + seealso: ['exp', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js new file mode 100644 index 0000000..f05ec54 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log1pDocs = void 0; +const log1pDocs = exports.log1pDocs = { + name: 'log1p', + category: 'Arithmetic', + syntax: ['log1p(x)', 'log1p(x, base)'], + description: 'Calculate the logarithm of a `value+1`', + examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'], + seealso: ['exp', 'log', 'log2', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js new file mode 100644 index 0000000..51c098e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log2Docs = void 0; +const log2Docs = exports.log2Docs = { + name: 'log2', + category: 'Arithmetic', + syntax: ['log2(x)'], + description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.', + examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'], + seealso: ['exp', 'log1p', 'log', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js new file mode 100644 index 0000000..42c116c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modDocs = void 0; +const modDocs = exports.modDocs = { + name: 'mod', + category: 'Operators', + syntax: ['x % y', 'x mod y', 'mod(x, y)'], + description: 'Calculates the modulus, the remainder of an integer division.', + examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'], + seealso: ['divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js new file mode 100644 index 0000000..d0af98c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multiplyDocs = void 0; +const multiplyDocs = exports.multiplyDocs = { + name: 'multiply', + category: 'Operators', + syntax: ['x * y', 'multiply(x, y)'], + description: 'multiply two values.', + examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'], + seealso: ['divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js new file mode 100644 index 0000000..80c3935 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normDocs = void 0; +const normDocs = exports.normDocs = { + name: 'norm', + category: 'Arithmetic', + syntax: ['norm(x)', 'norm(x, p)'], + description: 'Calculate the norm of a number, vector or matrix.', + examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], "inf")', 'norm([[1, 2], [3, 4]], "fro")'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js new file mode 100644 index 0000000..77de859 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nthRootDocs = void 0; +const nthRootDocs = exports.nthRootDocs = { + name: 'nthRoot', + category: 'Arithmetic', + syntax: ['nthRoot(a)', 'nthRoot(a, root)'], + description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation "x^root = A".', + examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'], + seealso: ['nthRoots', 'pow', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js new file mode 100644 index 0000000..edef828 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nthRootsDocs = void 0; +const nthRootsDocs = exports.nthRootsDocs = { + name: 'nthRoots', + category: 'Arithmetic', + syntax: ['nthRoots(A)', 'nthRoots(A, root)'], + description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation "x^root = A". ' + 'This function returns an array of complex values.', + examples: ['nthRoots(1)', 'nthRoots(1, 3)'], + seealso: ['sqrt', 'pow', 'nthRoot'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js new file mode 100644 index 0000000..c62f021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.powDocs = void 0; +const powDocs = exports.powDocs = { + name: 'pow', + category: 'Operators', + syntax: ['x ^ y', 'pow(x, y)'], + description: 'Calculates the power of x to y, x^y.', + examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'], + seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js new file mode 100644 index 0000000..ff59b28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.roundDocs = void 0; +const roundDocs = exports.roundDocs = { + name: 'round', + category: 'Arithmetic', + syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'], + description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.', + examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'], + seealso: ['ceil', 'floor', 'fix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js new file mode 100644 index 0000000..e616252 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.signDocs = void 0; +const signDocs = exports.signDocs = { + name: 'sign', + category: 'Arithmetic', + syntax: ['sign(x)'], + description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.', + examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'], + seealso: ['abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js new file mode 100644 index 0000000..78cefc8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sqrtDocs = void 0; +const sqrtDocs = exports.sqrtDocs = { + name: 'sqrt', + category: 'Arithmetic', + syntax: ['sqrt(x)'], + description: 'Compute the square root value. If x = y * y, then y is the square root of x.', + examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'], + seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js new file mode 100644 index 0000000..609612d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sqrtmDocs = void 0; +const sqrtmDocs = exports.sqrtmDocs = { + name: 'sqrtm', + category: 'Arithmetic', + syntax: ['sqrtm(x)'], + description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.', + examples: ['sqrtm([[33, 24], [48, 57]])'], + seealso: ['sqrt', 'abs', 'square', 'multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js new file mode 100644 index 0000000..1a4ea51 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.squareDocs = void 0; +const squareDocs = exports.squareDocs = { + name: 'square', + category: 'Arithmetic', + syntax: ['square(x)'], + description: 'Compute the square of a value. The square of x is x * x.', + examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'], + seealso: ['multiply', 'pow', 'sqrt', 'cube'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js new file mode 100644 index 0000000..2fd1da7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subtractDocs = void 0; +const subtractDocs = exports.subtractDocs = { + name: 'subtract', + category: 'Operators', + syntax: ['x - y', 'subtract(x, y)'], + description: 'subtract two values.', + examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'], + seealso: ['add'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js new file mode 100644 index 0000000..bc2f335 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryMinusDocs = void 0; +const unaryMinusDocs = exports.unaryMinusDocs = { + name: 'unaryMinus', + category: 'Operators', + syntax: ['-x', 'unaryMinus(x)'], + description: 'Inverse the sign of a value. Converts booleans and strings to numbers.', + examples: ['-4.5', '-(-5.6)', '-"22"'], + seealso: ['add', 'subtract', 'unaryPlus'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js new file mode 100644 index 0000000..263b8ee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unaryPlusDocs = void 0; +const unaryPlusDocs = exports.unaryPlusDocs = { + name: 'unaryPlus', + category: 'Operators', + syntax: ['+x', 'unaryPlus(x)'], + description: 'Converts booleans and strings to numbers.', + examples: ['+true', '+"2"'], + seealso: ['add', 'subtract', 'unaryMinus'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js new file mode 100644 index 0000000..1d68e0f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xgcdDocs = void 0; +const xgcdDocs = exports.xgcdDocs = { + name: 'xgcd', + category: 'Arithmetic', + syntax: ['xgcd(a, b)'], + description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.', + examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'], + seealso: ['gcd', 'lcm'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js new file mode 100644 index 0000000..954403d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndDocs = void 0; +const bitAndDocs = exports.bitAndDocs = { + name: 'bitAnd', + category: 'Bitwise', + syntax: ['x & y', 'bitAnd(x, y)'], + description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0', + examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'], + seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js new file mode 100644 index 0000000..ec91700 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitNotDocs = void 0; +const bitNotDocs = exports.bitNotDocs = { + name: 'bitNot', + category: 'Bitwise', + syntax: ['~x', 'bitNot(x)'], + description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.', + examples: ['~1', '~2', 'bitNot([2, -3, 4])'], + seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js new file mode 100644 index 0000000..e252ef4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitOrDocs = void 0; +const bitOrDocs = exports.bitOrDocs = { + name: 'bitOr', + category: 'Bitwise', + syntax: ['x | y', 'bitOr(x, y)'], + description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.', + examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'], + seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js new file mode 100644 index 0000000..b91aa4e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitXorDocs = void 0; +const bitXorDocs = exports.bitXorDocs = { + name: 'bitXor', + category: 'Bitwise', + syntax: ['bitXor(x, y)'], + description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.', + examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js new file mode 100644 index 0000000..ff0368c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.leftShiftDocs = void 0; +const leftShiftDocs = exports.leftShiftDocs = { + name: 'leftShift', + category: 'Bitwise', + syntax: ['x << y', 'leftShift(x, y)'], + description: 'Bitwise left logical shift of a value x by y number of bits.', + examples: ['4 << 1', '8 >> 1'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js new file mode 100644 index 0000000..b8da2a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightArithShiftDocs = void 0; +const rightArithShiftDocs = exports.rightArithShiftDocs = { + name: 'rightArithShift', + category: 'Bitwise', + syntax: ['x >> y', 'rightArithShift(x, y)'], + description: 'Bitwise right arithmetic shift of a value x by y number of bits.', + examples: ['8 >> 1', '4 << 1', '-12 >> 2'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js new file mode 100644 index 0000000..5259600 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rightLogShiftDocs = void 0; +const rightLogShiftDocs = exports.rightLogShiftDocs = { + name: 'rightLogShift', + category: 'Bitwise', + syntax: ['x >>> y', 'rightLogShift(x, y)'], + description: 'Bitwise right logical shift of a value x by y number of bits.', + examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js new file mode 100644 index 0000000..209cfad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bellNumbersDocs = void 0; +const bellNumbersDocs = exports.bellNumbersDocs = { + name: 'bellNumbers', + category: 'Combinatorics', + syntax: ['bellNumbers(n)'], + description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: ['bellNumbers(3)', 'bellNumbers(8)'], + seealso: ['stirlingS2'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js new file mode 100644 index 0000000..b83ff95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.catalanDocs = void 0; +const catalanDocs = exports.catalanDocs = { + name: 'catalan', + category: 'Combinatorics', + syntax: ['catalan(n)'], + description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: ['catalan(3)', 'catalan(8)'], + seealso: ['bellNumbers'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js new file mode 100644 index 0000000..94672a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compositionDocs = void 0; +const compositionDocs = exports.compositionDocs = { + name: 'composition', + category: 'Combinatorics', + syntax: ['composition(n, k)'], + description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.', + examples: ['composition(5, 3)'], + seealso: ['combinations'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js new file mode 100644 index 0000000..b79ec8f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stirlingS2Docs = void 0; +const stirlingS2Docs = exports.stirlingS2Docs = { + name: 'stirlingS2', + category: 'Combinatorics', + syntax: ['stirlingS2(n, k)'], + description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.', + examples: ['stirlingS2(5, 3)'], + seealso: ['bellNumbers'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js new file mode 100644 index 0000000..d128a92 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.argDocs = void 0; +const argDocs = exports.argDocs = { + name: 'arg', + category: 'Complex', + syntax: ['arg(x)'], + description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).', + examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'], + seealso: ['re', 'im', 'conj', 'abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js new file mode 100644 index 0000000..af7e879 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.conjDocs = void 0; +const conjDocs = exports.conjDocs = { + name: 'conj', + category: 'Complex', + syntax: ['conj(x)'], + description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.', + examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'], + seealso: ['re', 'im', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js new file mode 100644 index 0000000..fa841cf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.imDocs = void 0; +const imDocs = exports.imDocs = { + name: 'im', + category: 'Complex', + syntax: ['im(x)'], + description: 'Get the imaginary part of a complex number.', + examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'], + seealso: ['re', 'conj', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js new file mode 100644 index 0000000..c79281f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reDocs = void 0; +const reDocs = exports.reDocs = { + name: 're', + category: 'Complex', + syntax: ['re(x)'], + description: 'Get the real part of a complex number.', + examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'], + seealso: ['im', 'conj', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js new file mode 100644 index 0000000..fafa197 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.evaluateDocs = void 0; +const evaluateDocs = exports.evaluateDocs = { + name: 'evaluate', + category: 'Expression', + syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'], + description: 'Evaluate an expression or an array with expressions.', + examples: ['evaluate("2 + 3")', 'evaluate("sqrt(16)")', 'evaluate("2 inch to cm")', 'evaluate("sin(x * pi)", { "x": 1/2 })', 'evaluate(["width=2", "height=4","width*height"])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js new file mode 100644 index 0000000..bd3871a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.helpDocs = void 0; +const helpDocs = exports.helpDocs = { + name: 'help', + category: 'Expression', + syntax: ['help(object)', 'help(string)'], + description: 'Display documentation on a function or data type.', + examples: ['help(sqrt)', 'help("complex")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js new file mode 100644 index 0000000..0e6d3da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.distanceDocs = void 0; +const distanceDocs = exports.distanceDocs = { + name: 'distance', + category: 'Geometry', + syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'], + description: 'Calculates the Euclidean distance between two points.', + examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js new file mode 100644 index 0000000..935ba7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.intersectDocs = void 0; +const intersectDocs = exports.intersectDocs = { + name: 'intersect', + category: 'Geometry', + syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'], + description: 'Computes the intersection point of lines and/or planes.', + examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js new file mode 100644 index 0000000..248d533 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.andDocs = void 0; +const andDocs = exports.andDocs = { + name: 'and', + category: 'Logical', + syntax: ['x and y', 'and(x, y)'], + description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.', + examples: ['true and false', 'true and true', '2 and 4'], + seealso: ['not', 'or', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js new file mode 100644 index 0000000..47492b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.notDocs = void 0; +const notDocs = exports.notDocs = { + name: 'not', + category: 'Logical', + syntax: ['not x', 'not(x)'], + description: 'Logical not. Flips the boolean value of given argument.', + examples: ['not true', 'not false', 'not 2', 'not 0'], + seealso: ['and', 'or', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js new file mode 100644 index 0000000..ce5abe7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.orDocs = void 0; +const orDocs = exports.orDocs = { + name: 'or', + category: 'Logical', + syntax: ['x or y', 'or(x, y)'], + description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.', + examples: ['true or false', 'false or false', '0 or 4'], + seealso: ['not', 'and', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js new file mode 100644 index 0000000..3d2189c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.xorDocs = void 0; +const xorDocs = exports.xorDocs = { + name: 'xor', + category: 'Logical', + syntax: ['x xor y', 'xor(x, y)'], + description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.', + examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'], + seealso: ['not', 'and', 'or'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js new file mode 100644 index 0000000..cbda3dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.columnDocs = void 0; +const columnDocs = exports.columnDocs = { + name: 'column', + category: 'Matrix', + syntax: ['column(x, index)'], + description: 'Return a column from a matrix or array.', + examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'], + seealso: ['row', 'matrixFromColumns'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js new file mode 100644 index 0000000..66ed0a4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.concatDocs = void 0; +const concatDocs = exports.concatDocs = { + name: 'concat', + category: 'Matrix', + syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'], + description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.', + examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'], + seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js new file mode 100644 index 0000000..49991b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.countDocs = void 0; +const countDocs = exports.countDocs = { + name: 'count', + category: 'Matrix', + syntax: ['count(x)'], + description: 'Count the number of elements of a matrix, array or string.', + examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count("hello world")'], + seealso: ['size'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js new file mode 100644 index 0000000..8df9433 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.crossDocs = void 0; +const crossDocs = exports.crossDocs = { + name: 'cross', + category: 'Matrix', + syntax: ['cross(A, B)'], + description: 'Calculate the cross product for two vectors in three dimensional space.', + examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'], + seealso: ['multiply', 'dot'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js new file mode 100644 index 0000000..3c5567d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ctransposeDocs = void 0; +const ctransposeDocs = exports.ctransposeDocs = { + name: 'ctranspose', + category: 'Matrix', + syntax: ['x\'', 'ctranspose(x)'], + description: 'Complex Conjugate and Transpose a matrix', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\'', 'ctranspose(a)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js new file mode 100644 index 0000000..8902df4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.detDocs = void 0; +const detDocs = exports.detDocs = { + name: 'det', + category: 'Matrix', + syntax: ['det(x)'], + description: 'Calculate the determinant of a matrix', + examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'], + seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js new file mode 100644 index 0000000..55b4dcd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diagDocs = void 0; +const diagDocs = exports.diagDocs = { + name: 'diag', + category: 'Matrix', + syntax: ['diag(x)', 'diag(x, k)'], + description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.', + examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'], + seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js new file mode 100644 index 0000000..44e5aa1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diffDocs = void 0; +const diffDocs = exports.diffDocs = { + name: 'diff', + category: 'Matrix', + syntax: ['diff(arr)', 'diff(arr, dim)'], + description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \'rectangular\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'], + examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'], + seealso: ['subtract', 'partitionSelect'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js new file mode 100644 index 0000000..c3eda6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dotDocs = void 0; +const dotDocs = exports.dotDocs = { + name: 'dot', + category: 'Matrix', + syntax: ['dot(A, B)', 'A * B'], + description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn', + examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'], + seealso: ['multiply', 'cross'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js new file mode 100644 index 0000000..0b960b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.eigsDocs = void 0; +const eigsDocs = exports.eigsDocs = { + name: 'eigs', + category: 'Matrix', + syntax: ['eigs(x)'], + description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix', + examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'], + seealso: ['inv'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js new file mode 100644 index 0000000..487324f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fftDocs = void 0; +const fftDocs = exports.fftDocs = { + name: 'fft', + category: 'Matrix', + syntax: ['fft(x)'], + description: 'Calculate N-dimensional Fourier transform', + examples: ['fft([[1, 0], [1, 0]])'], + seealso: ['ifft'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js new file mode 100644 index 0000000..0e0ba28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.filterDocs = void 0; +const filterDocs = exports.filterDocs = { + name: 'filter', + category: 'Matrix', + syntax: ['filter(x, test)'], + description: 'Filter items in a matrix.', + examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'], + seealso: ['sort', 'map', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js new file mode 100644 index 0000000..971e07f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.flattenDocs = void 0; +const flattenDocs = exports.flattenDocs = { + name: 'flatten', + category: 'Matrix', + syntax: ['flatten(x)'], + description: 'Flatten a multi dimensional matrix into a single dimensional matrix.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'], + seealso: ['concat', 'resize', 'size', 'squeeze'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js new file mode 100644 index 0000000..7e26ff6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forEachDocs = void 0; +const forEachDocs = exports.forEachDocs = { + name: 'forEach', + category: 'Matrix', + syntax: ['forEach(x, callback)'], + description: 'Iterates over all elements of a matrix/array, and executes the given callback function.', + examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach(["Dog","Cat","Cat"], addPet)', 'numberOfPets'], + seealso: ['map', 'sort', 'filter'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js new file mode 100644 index 0000000..6539d57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getMatrixDataTypeDocs = void 0; +const getMatrixDataTypeDocs = exports.getMatrixDataTypeDocs = { + name: 'getMatrixDataType', + category: 'Matrix', + syntax: ['getMatrixDataType(x)'], + description: 'Find the data type of all elements in a matrix or array, ' + 'for example "number" if all items are a number ' + 'and "Complex" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return "mixed".', + examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, "text"])', 'getMatrixDataType([1, bignumber(4)])'], + seealso: ['matrix', 'sparse', 'typeOf'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js new file mode 100644 index 0000000..b1f3704 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.identityDocs = void 0; +const identityDocs = exports.identityDocs = { + name: 'identity', + category: 'Matrix', + syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'], + description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.', + examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'], + seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js new file mode 100644 index 0000000..d86d754 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ifftDocs = void 0; +const ifftDocs = exports.ifftDocs = { + name: 'ifft', + category: 'Matrix', + syntax: ['ifft(x)'], + description: 'Calculate N-dimensional inverse Fourier transform', + examples: ['ifft([[2, 2], [0, 0]])'], + seealso: ['fft'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js new file mode 100644 index 0000000..07078d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.invDocs = void 0; +const invDocs = exports.invDocs = { + name: 'inv', + category: 'Matrix', + syntax: ['inv(x)'], + description: 'Calculate the inverse of a matrix', + examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'], + seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js new file mode 100644 index 0000000..efd5d50 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.kronDocs = void 0; +const kronDocs = exports.kronDocs = { + name: 'kron', + category: 'Matrix', + syntax: ['kron(x, y)'], + description: 'Calculates the Kronecker product of 2 matrices or vectors.', + examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'], + seealso: ['multiply', 'dot', 'cross'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js new file mode 100644 index 0000000..248a84f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mapDocs = void 0; +const mapDocs = exports.mapDocs = { + name: 'map', + category: 'Matrix', + syntax: ['map(x, callback)', 'map(x, y, ..., callback)'], + description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.', + examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'], + seealso: ['filter', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js new file mode 100644 index 0000000..68bba7e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromColumnsDocs = void 0; +const matrixFromColumnsDocs = exports.matrixFromColumnsDocs = { + name: 'matrixFromColumns', + category: 'Matrix', + syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'], + description: 'Create a dense matrix from vectors as individual columns.', + examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'], + seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js new file mode 100644 index 0000000..27ec1c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromFunctionDocs = void 0; +const matrixFromFunctionDocs = exports.matrixFromFunctionDocs = { + name: 'matrixFromFunction', + category: 'Matrix', + syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'], + description: 'Create a matrix by evaluating a generating function at each index.', + examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], "sparse", g)', 'matrixFromFunction([5], random)'], + seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js new file mode 100644 index 0000000..8447fbe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matrixFromRowsDocs = void 0; +const matrixFromRowsDocs = exports.matrixFromRowsDocs = { + name: 'matrixFromRows', + category: 'Matrix', + syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'], + description: 'Create a dense matrix from vectors as individual rows.', + examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'], + seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js new file mode 100644 index 0000000..150d59b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.onesDocs = void 0; +const onesDocs = exports.onesDocs = { + name: 'ones', + category: 'Matrix', + syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'], + description: 'Create a matrix containing ones.', + examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js new file mode 100644 index 0000000..ddc8fbe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.partitionSelectDocs = void 0; +const partitionSelectDocs = exports.partitionSelectDocs = { + name: 'partitionSelect', + category: 'Matrix', + syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'], + description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.', + examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect(["C", "B", "A", "D"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \'desc\') # returns 2, arr is now: [5, 2, 1]', 'arr'], + seealso: ['sort'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js new file mode 100644 index 0000000..84e41db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pinvDocs = void 0; +const pinvDocs = exports.pinvDocs = { + name: 'pinv', + category: 'Matrix', + syntax: ['pinv(x)'], + description: 'Calculate the Moore–Penrose inverse of a matrix', + examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'], + seealso: ['inv'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js new file mode 100644 index 0000000..f16891a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rangeDocs = void 0; +const rangeDocs = exports.rangeDocs = { + name: 'range', + category: 'Type', + syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'], + description: 'Create a range. Lower bound of the range is included, upper bound is excluded.', + examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range("4:10")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js new file mode 100644 index 0000000..d61aa0c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reshapeDocs = void 0; +const reshapeDocs = exports.reshapeDocs = { + name: 'reshape', + category: 'Matrix', + syntax: ['reshape(x, sizes)'], + description: 'Reshape a multi dimensional array to fit the specified dimensions.', + examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'], + seealso: ['size', 'squeeze', 'resize'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js new file mode 100644 index 0000000..9a75b32 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resizeDocs = void 0; +const resizeDocs = exports.resizeDocs = { + name: 'resize', + category: 'Matrix', + syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'], + description: 'Resize a matrix.', + examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize("hello", [8], "!")'], + seealso: ['size', 'subset', 'squeeze', 'reshape'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js new file mode 100644 index 0000000..73e0b1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rotateDocs = void 0; +const rotateDocs = exports.rotateDocs = { + name: 'rotate', + category: 'Matrix', + syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'], + description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.', + examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit("35deg"))', 'rotate([1, 0, 0], unit("90deg"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'], + seealso: ['matrix', 'rotationMatrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js new file mode 100644 index 0000000..262c13d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rotationMatrixDocs = void 0; +const rotationMatrixDocs = exports.rotationMatrixDocs = { + name: 'rotationMatrix', + category: 'Matrix', + syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'], + description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.', + examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit("45deg"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), "sparse")'], + seealso: ['cos', 'sin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js new file mode 100644 index 0000000..24ea4ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rowDocs = void 0; +const rowDocs = exports.rowDocs = { + name: 'row', + category: 'Matrix', + syntax: ['row(x, index)'], + description: 'Return a row from a matrix or array.', + examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'], + seealso: ['column', 'matrixFromRows'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js new file mode 100644 index 0000000..3649021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sizeDocs = void 0; +const sizeDocs = exports.sizeDocs = { + name: 'size', + category: 'Matrix', + syntax: ['size(x)'], + description: 'Calculate the size of a matrix.', + examples: ['size(2.3)', 'size("hello world")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'], + seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js new file mode 100644 index 0000000..e949529 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sortDocs = void 0; +const sortDocs = exports.sortDocs = { + name: 'sort', + category: 'Matrix', + syntax: ['sort(x)', 'sort(x, compare)'], + description: 'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.', + examples: ['sort([5, 10, 1])', 'sort(["C", "B", "A", "D"], "natural")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort(["Langdon", "Tom", "Sara"], sortByLength)', 'sort(["10", "1", "2"], "natural")'], + seealso: ['map', 'filter', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js new file mode 100644 index 0000000..35d2a1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.squeezeDocs = void 0; +const squeezeDocs = exports.squeezeDocs = { + name: 'squeeze', + category: 'Matrix', + syntax: ['squeeze(x)'], + description: 'Remove inner and outer singleton dimensions from a matrix.', + examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js new file mode 100644 index 0000000..c42caa9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subsetDocs = void 0; +const subsetDocs = exports.subsetDocs = { + name: 'subset', + category: 'Matrix', + syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'], + description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.', + examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js new file mode 100644 index 0000000..df95cad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.traceDocs = void 0; +const traceDocs = exports.traceDocs = { + name: 'trace', + category: 'Matrix', + syntax: ['trace(A)'], + description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.', + examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js new file mode 100644 index 0000000..c4ee7ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transposeDocs = void 0; +const transposeDocs = exports.transposeDocs = { + name: 'transpose', + category: 'Matrix', + syntax: ['x\'', 'transpose(x)'], + description: 'Transpose a matrix', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\'', 'transpose(a)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js new file mode 100644 index 0000000..925571f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zerosDocs = void 0; +const zerosDocs = exports.zerosDocs = { + name: 'zeros', + category: 'Matrix', + syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'], + description: 'Create a matrix containing zeros.', + examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js new file mode 100644 index 0000000..2c5f636 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.solveODEDocs = void 0; +const solveODEDocs = exports.solveODEDocs = { + name: 'solveODE', + category: 'Numeric', + syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'], + description: 'Numerical Integration of Ordinary Differential Equations.', + examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'], + seealso: ['derivative', 'simplifyCore'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js new file mode 100644 index 0000000..ab03458 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsDocs = void 0; +const combinationsDocs = exports.combinationsDocs = { + name: 'combinations', + category: 'Probability', + syntax: ['combinations(n, k)'], + description: 'Compute the number of combinations of n items taken k at a time', + examples: ['combinations(7, 5)'], + seealso: ['combinationsWithRep', 'permutations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js new file mode 100644 index 0000000..e23ff36 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsWithRepDocs = void 0; +const combinationsWithRepDocs = exports.combinationsWithRepDocs = { + name: 'combinationsWithRep', + category: 'Probability', + syntax: ['combinationsWithRep(n, k)'], + description: 'Compute the number of combinations of n items taken k at a time with replacements.', + examples: ['combinationsWithRep(7, 5)'], + seealso: ['combinations', 'permutations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js new file mode 100644 index 0000000..7e807d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.distributionDocs = void 0; +const distributionDocs = exports.distributionDocs = { + name: 'distribution', + category: 'Probability', + syntax: ['distribution(name)', 'distribution(name, arg1, arg2, ...)'], + description: 'Create a distribution object of a specific type. ' + 'A distribution object contains functions `random([size,] [min,] [max])`, ' + '`randomInt([size,] [min,] [max])` and `pickRandom(array)`. ' + 'Available types of distributions: "uniform", "normal". ' + 'Note that the function distribution is currently not available via the expression parser.', + examples: [], + seealso: ['random', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js new file mode 100644 index 0000000..9e36255 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.factorialDocs = void 0; +const factorialDocs = exports.factorialDocs = { + name: 'factorial', + category: 'Probability', + syntax: ['n!', 'factorial(n)'], + description: 'Compute the factorial of a value', + examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'], + seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js new file mode 100644 index 0000000..8734aa5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gammaDocs = void 0; +const gammaDocs = exports.gammaDocs = { + name: 'gamma', + category: 'Probability', + syntax: ['gamma(n)'], + description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.', + examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'], + seealso: ['factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js new file mode 100644 index 0000000..1e73b1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.kldivergenceDocs = void 0; +const kldivergenceDocs = exports.kldivergenceDocs = { + name: 'kldivergence', + category: 'Probability', + syntax: ['kldivergence(x, y)'], + description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.', + examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js new file mode 100644 index 0000000..ba562cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lgammaDocs = void 0; +const lgammaDocs = exports.lgammaDocs = { + name: 'lgamma', + category: 'Probability', + syntax: ['lgamma(n)'], + description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.', + examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'], + seealso: ['gamma'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js new file mode 100644 index 0000000..bdcadfc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.multinomialDocs = void 0; +const multinomialDocs = exports.multinomialDocs = { + name: 'multinomial', + category: 'Probability', + syntax: ['multinomial(A)'], + description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.', + examples: ['multinomial([1, 2, 1])'], + seealso: ['combinations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js new file mode 100644 index 0000000..1e0663c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.permutationsDocs = void 0; +const permutationsDocs = exports.permutationsDocs = { + name: 'permutations', + category: 'Probability', + syntax: ['permutations(n)', 'permutations(n, k)'], + description: 'Compute the number of permutations of n items taken k at a time', + examples: ['permutations(5)', 'permutations(5, 3)'], + seealso: ['combinations', 'combinationsWithRep', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js new file mode 100644 index 0000000..a1cd990 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pickRandomDocs = void 0; +const pickRandomDocs = exports.pickRandomDocs = { + name: 'pickRandom', + category: 'Probability', + syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'], + description: 'Pick a random entry from a given array.', + examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'], + seealso: ['random', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js new file mode 100644 index 0000000..2303843 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomDocs = void 0; +const randomDocs = exports.randomDocs = { + name: 'random', + category: 'Probability', + syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'], + description: 'Return a random number.', + examples: ['random()', 'random(10, 20)', 'random([2, 3])'], + seealso: ['pickRandom', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js new file mode 100644 index 0000000..54358ca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomIntDocs = void 0; +const randomIntDocs = exports.randomIntDocs = { + name: 'randomInt', + category: 'Probability', + syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'], + description: 'Return a random integer number', + examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'], + seealso: ['pickRandom', 'random'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js new file mode 100644 index 0000000..931c7a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareDocs = void 0; +const compareDocs = exports.compareDocs = { + name: 'compare', + category: 'Relational', + syntax: ['compare(x, y)'], + description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js new file mode 100644 index 0000000..b470f09 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareNaturalDocs = void 0; +const compareNaturalDocs = exports.compareNaturalDocs = { + name: 'compareNatural', + category: 'Relational', + syntax: ['compareNatural(x, y)'], + description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural("2", "10")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js new file mode 100644 index 0000000..f27f926 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareTextDocs = void 0; +const compareTextDocs = exports.compareTextDocs = { + name: 'compareText', + category: 'Relational', + syntax: ['compareText(x, y)'], + description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compareText("B", "A")', 'compareText("A", "B")', 'compareText("A", "A")', 'compareText("2", "10")', 'compare("2", "10")', 'compare(2, 10)', 'compareNatural("2", "10")', 'compareText("B", ["A", "B", "C"])'], + seealso: ['compare', 'compareNatural'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js new file mode 100644 index 0000000..ff2b901 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deepEqualDocs = void 0; +const deepEqualDocs = exports.deepEqualDocs = { + name: 'deepEqual', + category: 'Relational', + syntax: ['deepEqual(x, y)'], + description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.', + examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'], + seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js new file mode 100644 index 0000000..f2977e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalDocs = void 0; +const equalDocs = exports.equalDocs = { + name: 'equal', + category: 'Relational', + syntax: ['x == y', 'equal(x, y)'], + description: 'Check equality of two values. Returns true if the values are equal, and false if not.', + examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'], + seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js new file mode 100644 index 0000000..e94f9cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.equalTextDocs = void 0; +const equalTextDocs = exports.equalTextDocs = { + name: 'equalText', + category: 'Relational', + syntax: ['equalText(x, y)'], + description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.', + examples: ['equalText("Hello", "Hello")', 'equalText("a", "A")', 'equal("2e3", "2000")', 'equalText("2e3", "2000")', 'equalText("B", ["A", "B", "C"])'], + seealso: ['compare', 'compareNatural', 'compareText', 'equal'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js new file mode 100644 index 0000000..ec79948 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerDocs = void 0; +const largerDocs = exports.largerDocs = { + name: 'larger', + category: 'Relational', + syntax: ['x > y', 'larger(x, y)'], + description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.', + examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js new file mode 100644 index 0000000..d93f194 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.largerEqDocs = void 0; +const largerEqDocs = exports.largerEqDocs = { + name: 'largerEq', + category: 'Relational', + syntax: ['x >= y', 'largerEq(x, y)'], + description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.', + examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'], + seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js new file mode 100644 index 0000000..d185859 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerDocs = void 0; +const smallerDocs = exports.smallerDocs = { + name: 'smaller', + category: 'Relational', + syntax: ['x < y', 'smaller(x, y)'], + description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.', + examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'], + seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js new file mode 100644 index 0000000..ca9df76 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.smallerEqDocs = void 0; +const smallerEqDocs = exports.smallerEqDocs = { + name: 'smallerEq', + category: 'Relational', + syntax: ['x <= y', 'smallerEq(x, y)'], + description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.', + examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'], + seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js new file mode 100644 index 0000000..2b0cafe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unequalDocs = void 0; +const unequalDocs = exports.unequalDocs = { + name: 'unequal', + category: 'Relational', + syntax: ['x != y', 'unequal(x, y)'], + description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.', + examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'], + seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js new file mode 100644 index 0000000..cec3f68 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setCartesianDocs = void 0; +const setCartesianDocs = exports.setCartesianDocs = { + name: 'setCartesian', + category: 'Set', + syntax: ['setCartesian(set1, set2)'], + description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.', + examples: ['setCartesian([1, 2], [3, 4])'], + seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js new file mode 100644 index 0000000..07ebe11 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setDifferenceDocs = void 0; +const setDifferenceDocs = exports.setDifferenceDocs = { + name: 'setDifference', + category: 'Set', + syntax: ['setDifference(set1, set2)'], + description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setIntersect', 'setSymDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js new file mode 100644 index 0000000..c543acd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setDistinctDocs = void 0; +const setDistinctDocs = exports.setDistinctDocs = { + name: 'setDistinct', + category: 'Set', + syntax: ['setDistinct(set)'], + description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setDistinct([1, 1, 1, 2, 2, 3])'], + seealso: ['setMultiplicity'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js new file mode 100644 index 0000000..2ec82c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setIntersectDocs = void 0; +const setIntersectDocs = exports.setIntersectDocs = { + name: 'setIntersect', + category: 'Set', + syntax: ['setIntersect(set1, set2)'], + description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js new file mode 100644 index 0000000..fe4cdef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setIsSubsetDocs = void 0; +const setIsSubsetDocs = exports.setIsSubsetDocs = { + name: 'setIsSubset', + category: 'Set', + syntax: ['setIsSubset(set1, set2)'], + description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js new file mode 100644 index 0000000..cb8e5af --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setMultiplicityDocs = void 0; +const setMultiplicityDocs = exports.setMultiplicityDocs = { + name: 'setMultiplicity', + category: 'Set', + syntax: ['setMultiplicity(element, set)'], + description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'], + seealso: ['setDistinct', 'setSize'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js new file mode 100644 index 0000000..5792aa3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setPowersetDocs = void 0; +const setPowersetDocs = exports.setPowersetDocs = { + name: 'setPowerset', + category: 'Set', + syntax: ['setPowerset(set)'], + description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setPowerset([1, 2, 3])'], + seealso: ['setCartesian'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js new file mode 100644 index 0000000..a6583cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setSizeDocs = void 0; +const setSizeDocs = exports.setSizeDocs = { + name: 'setSize', + category: 'Set', + syntax: ['setSize(set)', 'setSize(set, unique)'], + description: 'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js new file mode 100644 index 0000000..fc5082d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setSymDifferenceDocs = void 0; +const setSymDifferenceDocs = exports.setSymDifferenceDocs = { + name: 'setSymDifference', + category: 'Set', + syntax: ['setSymDifference(set1, set2)'], + description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js new file mode 100644 index 0000000..b04e1a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setUnionDocs = void 0; +const setUnionDocs = exports.setUnionDocs = { + name: 'setUnion', + category: 'Set', + syntax: ['setUnion(set1, set2)'], + description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js new file mode 100644 index 0000000..29ab618 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.freqzDocs = void 0; +const freqzDocs = exports.freqzDocs = { + name: 'freqz', + category: 'Signal', + syntax: ['freqz(b, a)', 'freqz(b, a, w)'], + description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.', + examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js new file mode 100644 index 0000000..b2c782f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zpk2tfDocs = void 0; +const zpk2tfDocs = exports.zpk2tfDocs = { + name: 'zpk2tf', + category: 'Signal', + syntax: ['zpk2tf(z, p, k)'], + description: 'Compute the transfer function of a zero-pole-gain model.', + examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js new file mode 100644 index 0000000..1707384 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.erfDocs = void 0; +const erfDocs = exports.erfDocs = { + name: 'erf', + category: 'Special', + syntax: ['erf(x)'], + description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x', + examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js new file mode 100644 index 0000000..8a729d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.zetaDocs = void 0; +const zetaDocs = exports.zetaDocs = { + name: 'zeta', + category: 'Special', + syntax: ['zeta(s)'], + description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\'s Functional Equation for the entire complex plane', + examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js new file mode 100644 index 0000000..56d061e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.corrDocs = void 0; +const corrDocs = exports.corrDocs = { + name: 'corr', + category: 'Statistics', + syntax: ['corr(A,B)'], + description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.', + examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js new file mode 100644 index 0000000..7ccc28f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cumSumDocs = void 0; +const cumSumDocs = exports.cumSumDocs = { + name: 'cumsum', + category: 'Statistics', + syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'], + description: 'Compute the cumulative sum of all values.', + examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'], + seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js new file mode 100644 index 0000000..f65b29f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.madDocs = void 0; +const madDocs = exports.madDocs = { + name: 'mad', + category: 'Statistics', + syntax: ['mad(a, b, c, ...)', 'mad(A)'], + description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.', + examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'], + seealso: ['mean', 'median', 'std', 'abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js new file mode 100644 index 0000000..52fca24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maxDocs = void 0; +const maxDocs = exports.maxDocs = { + name: 'max', + category: 'Statistics', + syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'], + description: 'Compute the maximum value of a list of values.', + examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'], + seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js new file mode 100644 index 0000000..746490e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.meanDocs = void 0; +const meanDocs = exports.meanDocs = { + name: 'mean', + category: 'Statistics', + syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'], + description: 'Compute the arithmetic mean of a list of values.', + examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'], + seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js new file mode 100644 index 0000000..112d6ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.medianDocs = void 0; +const medianDocs = exports.medianDocs = { + name: 'median', + category: 'Statistics', + syntax: ['median(a, b, c, ...)', 'median(A)'], + description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.', + examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'], + seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js new file mode 100644 index 0000000..17d7bc0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.minDocs = void 0; +const minDocs = exports.minDocs = { + name: 'min', + category: 'Statistics', + syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'], + description: 'Compute the minimum value of a list of values.', + examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'], + seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js new file mode 100644 index 0000000..b086010 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.modeDocs = void 0; +const modeDocs = exports.modeDocs = { + name: 'mode', + category: 'Statistics', + syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'], + description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.', + examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'], + seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js new file mode 100644 index 0000000..3f9a7d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.prodDocs = void 0; +const prodDocs = exports.prodDocs = { + name: 'prod', + category: 'Statistics', + syntax: ['prod(a, b, c, ...)', 'prod(A)'], + description: 'Compute the product of all values.', + examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js new file mode 100644 index 0000000..a72e937 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.quantileSeqDocs = void 0; +const quantileSeqDocs = exports.quantileSeqDocs = { + name: 'quantileSeq', + category: 'Statistics', + syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'], + description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.', + examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'], + seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js new file mode 100644 index 0000000..57ddbdc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stdDocs = void 0; +const stdDocs = exports.stdDocs = { + name: 'std', + category: 'Statistics', + syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'], + description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], "uncorrected")', 'std([2, 4, 6, 8], "biased")', 'std([1, 2, 3; 4, 5, 6])'], + seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js new file mode 100644 index 0000000..feff15c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sumDocs = void 0; +const sumDocs = exports.sumDocs = { + name: 'sum', + category: 'Statistics', + syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'], + description: 'Compute the sum of all values.', + examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'], + seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js new file mode 100644 index 0000000..379f051 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.varianceDocs = void 0; +const varianceDocs = exports.varianceDocs = { + name: 'variance', + category: 'Statistics', + syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'], + description: 'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], "uncorrected")', 'variance([2, 4, 6, 8], "biased")', 'variance([1, 2, 3; 4, 5, 6])'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js new file mode 100644 index 0000000..05d01c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acosDocs = void 0; +const acosDocs = exports.acosDocs = { + name: 'acos', + category: 'Trigonometry', + syntax: ['acos(x)'], + description: 'Compute the inverse cosine of a value in radians.', + examples: ['acos(0.5)', 'acos(cos(2.3))'], + seealso: ['cos', 'atan', 'asin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js new file mode 100644 index 0000000..3ee6f2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acoshDocs = void 0; +const acoshDocs = exports.acoshDocs = { + name: 'acosh', + category: 'Trigonometry', + syntax: ['acosh(x)'], + description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.', + examples: ['acosh(1.5)'], + seealso: ['cosh', 'asinh', 'atanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js new file mode 100644 index 0000000..2f35edf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acotDocs = void 0; +const acotDocs = exports.acotDocs = { + name: 'acot', + category: 'Trigonometry', + syntax: ['acot(x)'], + description: 'Calculate the inverse cotangent of a value.', + examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'], + seealso: ['cot', 'atan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js new file mode 100644 index 0000000..13d0eee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acothDocs = void 0; +const acothDocs = exports.acothDocs = { + name: 'acoth', + category: 'Trigonometry', + syntax: ['acoth(x)'], + description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.', + examples: ['acoth(2)', 'acoth(0.5)'], + seealso: ['acsch', 'asech'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js new file mode 100644 index 0000000..9446b55 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acscDocs = void 0; +const acscDocs = exports.acscDocs = { + name: 'acsc', + category: 'Trigonometry', + syntax: ['acsc(x)'], + description: 'Calculate the inverse cotangent of a value.', + examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'], + seealso: ['csc', 'asin', 'asec'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js new file mode 100644 index 0000000..a89abd9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acschDocs = void 0; +const acschDocs = exports.acschDocs = { + name: 'acsch', + category: 'Trigonometry', + syntax: ['acsch(x)'], + description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.', + examples: ['acsch(0.5)'], + seealso: ['asech', 'acoth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js new file mode 100644 index 0000000..2cdd502 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asecDocs = void 0; +const asecDocs = exports.asecDocs = { + name: 'asec', + category: 'Trigonometry', + syntax: ['asec(x)'], + description: 'Calculate the inverse secant of a value.', + examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'], + seealso: ['acos', 'acot', 'acsc'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js new file mode 100644 index 0000000..61aad99 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asechDocs = void 0; +const asechDocs = exports.asechDocs = { + name: 'asech', + category: 'Trigonometry', + syntax: ['asech(x)'], + description: 'Calculate the inverse secant of a value.', + examples: ['asech(0.5)'], + seealso: ['acsch', 'acoth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js new file mode 100644 index 0000000..e2f4a45 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinDocs = void 0; +const asinDocs = exports.asinDocs = { + name: 'asin', + category: 'Trigonometry', + syntax: ['asin(x)'], + description: 'Compute the inverse sine of a value in radians.', + examples: ['asin(0.5)', 'asin(sin(0.5))'], + seealso: ['sin', 'acos', 'atan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js new file mode 100644 index 0000000..33a23df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.asinhDocs = void 0; +const asinhDocs = exports.asinhDocs = { + name: 'asinh', + category: 'Trigonometry', + syntax: ['asinh(x)'], + description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.', + examples: ['asinh(0.5)'], + seealso: ['acosh', 'atanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js new file mode 100644 index 0000000..ab92912 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanDocs = void 0; +const atanDocs = exports.atanDocs = { + name: 'atan', + category: 'Trigonometry', + syntax: ['atan(x)'], + description: 'Compute the inverse tangent of a value in radians.', + examples: ['atan(0.5)', 'atan(tan(0.5))'], + seealso: ['tan', 'acos', 'asin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js new file mode 100644 index 0000000..0c77024 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atan2Docs = void 0; +const atan2Docs = exports.atan2Docs = { + name: 'atan2', + category: 'Trigonometry', + syntax: ['atan2(y, x)'], + description: 'Computes the principal value of the arc tangent of y/x in radians.', + examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'], + seealso: ['sin', 'cos', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js new file mode 100644 index 0000000..9a40ab9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.atanhDocs = void 0; +const atanhDocs = exports.atanhDocs = { + name: 'atanh', + category: 'Trigonometry', + syntax: ['atanh(x)'], + description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.', + examples: ['atanh(0.5)'], + seealso: ['acosh', 'asinh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js new file mode 100644 index 0000000..1d03c53 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cosDocs = void 0; +const cosDocs = exports.cosDocs = { + name: 'cos', + category: 'Trigonometry', + syntax: ['cos(x)'], + description: 'Compute the cosine of x in radians.', + examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'], + seealso: ['acos', 'sin', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js new file mode 100644 index 0000000..8c4974f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.coshDocs = void 0; +const coshDocs = exports.coshDocs = { + name: 'cosh', + category: 'Trigonometry', + syntax: ['cosh(x)'], + description: 'Compute the hyperbolic cosine of x in radians.', + examples: ['cosh(0.5)'], + seealso: ['sinh', 'tanh', 'coth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js new file mode 100644 index 0000000..dc6d236 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cotDocs = void 0; +const cotDocs = exports.cotDocs = { + name: 'cot', + category: 'Trigonometry', + syntax: ['cot(x)'], + description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)', + examples: ['cot(2)', '1 / tan(2)'], + seealso: ['sec', 'csc', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js new file mode 100644 index 0000000..9befa09 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cothDocs = void 0; +const cothDocs = exports.cothDocs = { + name: 'coth', + category: 'Trigonometry', + syntax: ['coth(x)'], + description: 'Compute the hyperbolic cotangent of x in radians.', + examples: ['coth(2)', '1 / tanh(2)'], + seealso: ['sech', 'csch', 'tanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js new file mode 100644 index 0000000..ef78466 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cscDocs = void 0; +const cscDocs = exports.cscDocs = { + name: 'csc', + category: 'Trigonometry', + syntax: ['csc(x)'], + description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)', + examples: ['csc(2)', '1 / sin(2)'], + seealso: ['sec', 'cot', 'sin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js new file mode 100644 index 0000000..632d002 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cschDocs = void 0; +const cschDocs = exports.cschDocs = { + name: 'csch', + category: 'Trigonometry', + syntax: ['csch(x)'], + description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)', + examples: ['csch(2)', '1 / sinh(2)'], + seealso: ['sech', 'coth', 'sinh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js new file mode 100644 index 0000000..5012d7b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.secDocs = void 0; +const secDocs = exports.secDocs = { + name: 'sec', + category: 'Trigonometry', + syntax: ['sec(x)'], + description: 'Compute the secant of x in radians. Defined as 1/cos(x)', + examples: ['sec(2)', '1 / cos(2)'], + seealso: ['cot', 'csc', 'cos'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js new file mode 100644 index 0000000..8eda9d2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sechDocs = void 0; +const sechDocs = exports.sechDocs = { + name: 'sech', + category: 'Trigonometry', + syntax: ['sech(x)'], + description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)', + examples: ['sech(2)', '1 / cosh(2)'], + seealso: ['coth', 'csch', 'cosh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js new file mode 100644 index 0000000..ca704e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinDocs = void 0; +const sinDocs = exports.sinDocs = { + name: 'sin', + category: 'Trigonometry', + syntax: ['sin(x)'], + description: 'Compute the sine of x in radians.', + examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'], + seealso: ['asin', 'cos', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js new file mode 100644 index 0000000..df0303a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sinhDocs = void 0; +const sinhDocs = exports.sinhDocs = { + name: 'sinh', + category: 'Trigonometry', + syntax: ['sinh(x)'], + description: 'Compute the hyperbolic sine of x in radians.', + examples: ['sinh(0.5)'], + seealso: ['cosh', 'tanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js new file mode 100644 index 0000000..ab89970 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanDocs = void 0; +const tanDocs = exports.tanDocs = { + name: 'tan', + category: 'Trigonometry', + syntax: ['tan(x)'], + description: 'Compute the tangent of x in radians.', + examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'], + seealso: ['atan', 'sin', 'cos'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js new file mode 100644 index 0000000..6c677d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tanhDocs = void 0; +const tanhDocs = exports.tanhDocs = { + name: 'tanh', + category: 'Trigonometry', + syntax: ['tanh(x)'], + description: 'Compute the hyperbolic tangent of x in radians.', + examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'], + seealso: ['sinh', 'cosh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js new file mode 100644 index 0000000..c7c20f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.toDocs = void 0; +const toDocs = exports.toDocs = { + name: 'to', + category: 'Units', + syntax: ['x to unit', 'to(x, unit)'], + description: 'Change the unit of a value.', + examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js new file mode 100644 index 0000000..fe741e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.binDocs = void 0; +const binDocs = exports.binDocs = { + name: 'bin', + category: 'Utils', + syntax: ['bin(value)'], + description: 'Format a number as binary', + examples: ['bin(2)'], + seealso: ['oct', 'hex'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js new file mode 100644 index 0000000..154ef8b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneDocs = void 0; +const cloneDocs = exports.cloneDocs = { + name: 'clone', + category: 'Utils', + syntax: ['clone(x)'], + description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices', + examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone("hello world")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js new file mode 100644 index 0000000..283dfb5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatDocs = void 0; +const formatDocs = exports.formatDocs = { + name: 'format', + category: 'Utils', + syntax: ['format(value)', 'format(value, precision)'], + description: 'Format a value of any type as string.', + examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'], + seealso: ['print'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js new file mode 100644 index 0000000..9026b05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasNumericValueDocs = void 0; +const hasNumericValueDocs = exports.hasNumericValueDocs = { + name: 'hasNumericValue', + category: 'Utils', + syntax: ['hasNumericValue(x)'], + description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.', + examples: ['hasNumericValue(2)', 'hasNumericValue("2")', 'isNumeric("2")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, "foo", false])'], + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js new file mode 100644 index 0000000..b5733cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hexDocs = void 0; +const hexDocs = exports.hexDocs = { + name: 'hex', + category: 'Utils', + syntax: ['hex(value)'], + description: 'Format a number as hexadecimal', + examples: ['hex(240)'], + seealso: ['bin', 'oct'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js new file mode 100644 index 0000000..75108bc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIntegerDocs = void 0; +const isIntegerDocs = exports.isIntegerDocs = { + name: 'isInteger', + category: 'Utils', + syntax: ['isInteger(x)'], + description: 'Test whether a value is an integer number.', + examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'], + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js new file mode 100644 index 0000000..c1c2060 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNaNDocs = void 0; +const isNaNDocs = exports.isNaNDocs = { + name: 'isNaN', + category: 'Utils', + syntax: ['isNaN(x)'], + description: 'Test whether a value is NaN (not a number)', + examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'], + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js new file mode 100644 index 0000000..d6ce6be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNegativeDocs = void 0; +const isNegativeDocs = exports.isNegativeDocs = { + name: 'isNegative', + category: 'Utils', + syntax: ['isNegative(x)'], + description: 'Test whether a value is negative: smaller than zero.', + examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'], + seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js new file mode 100644 index 0000000..669e126 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isNumericDocs = void 0; +const isNumericDocs = exports.isNumericDocs = { + name: 'isNumeric', + category: 'Utils', + syntax: ['isNumeric(x)'], + description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.', + examples: ['isNumeric(2)', 'isNumeric("2")', 'hasNumericValue("2")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, "foo", false])'], + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js new file mode 100644 index 0000000..5d0903c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPositiveDocs = void 0; +const isPositiveDocs = exports.isPositiveDocs = { + name: 'isPositive', + category: 'Utils', + syntax: ['isPositive(x)'], + description: 'Test whether a value is positive: larger than zero.', + examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js new file mode 100644 index 0000000..06c8bbf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPrimeDocs = void 0; +const isPrimeDocs = exports.isPrimeDocs = { + name: 'isPrime', + category: 'Utils', + syntax: ['isPrime(x)'], + description: 'Test whether a value is prime: has no divisors other than itself and one.', + examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js new file mode 100644 index 0000000..ecd3ed1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isZeroDocs = void 0; +const isZeroDocs = exports.isZeroDocs = { + name: 'isZero', + category: 'Utils', + syntax: ['isZero(x)'], + description: 'Test whether a value is zero.', + examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js new file mode 100644 index 0000000..00ff3b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.numericDocs = void 0; +const numericDocs = exports.numericDocs = { + name: 'numeric', + category: 'Utils', + syntax: ['numeric(x)'], + description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.', + examples: ['numeric("4")', 'numeric("4", "number")', 'numeric("4", "bigint")', 'numeric("4", "BigNumber")', 'numeric("4", "Fraction")', 'numeric(4, "Fraction")', 'numeric(fraction(2, 5), "number")'], + seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js new file mode 100644 index 0000000..f34b41f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.octDocs = void 0; +const octDocs = exports.octDocs = { + name: 'oct', + category: 'Utils', + syntax: ['oct(value)'], + description: 'Format a number as octal', + examples: ['oct(56)'], + seealso: ['bin', 'hex'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js new file mode 100644 index 0000000..cfdcef9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printDocs = void 0; +const printDocs = exports.printDocs = { + name: 'print', + category: 'Utils', + syntax: ['print(template, values)', 'print(template, values, precision)'], + description: 'Interpolate values into a string template.', + examples: ['print("Lucy is $age years old", {age: 5})', 'print("The value of pi is $pi", {pi: pi}, 3)', 'print("Hello, $user.name!", {user: {name: "John"}})', 'print("Values: $1, $2, $3", [6, 9, 4])'], + seealso: ['format'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js new file mode 100644 index 0000000..a9a8ad4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeOfDocs = void 0; +const typeOfDocs = exports.typeOfDocs = { + name: 'typeOf', + category: 'Utils', + syntax: ['typeOf(x)'], + description: 'Get the type of a variable.', + examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf("hello world")'], + seealso: ['getMatrixDataType'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/compile.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/compile.js new file mode 100644 index 0000000..14a7e02 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/compile.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCompile = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'compile'; +const dependencies = ['typed', 'parse']; +const createCompile = exports.createCompile = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + parse + } = _ref; + /** + * Parse and compile an expression. + * Returns a an object with a function `evaluate([scope])` to evaluate the + * compiled expression. + * + * Syntax: + * + * math.compile(expr) // returns one node + * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes + * + * Examples: + * + * const code1 = math.compile('sqrt(3^2 + 4^2)') + * code1.evaluate() // 5 + * + * let scope = {a: 3, b: 4} + * const code2 = math.compile('a * b') // 12 + * code2.evaluate(scope) // 12 + * scope.a = 5 + * code2.evaluate(scope) // 20 + * + * const nodes = math.compile(['a = 3', 'b = 4', 'a * b']) + * nodes[2].evaluate() // 12 + * + * See also: + * + * parse, evaluate + * + * @param {string | string[] | Array | Matrix} expr + * The expression to be compiled + * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code + * An object with the compiled expression + * @throws {Error} + */ + return typed(name, { + string: function (expr) { + return parse(expr).compile(); + }, + 'Array | Matrix': function (expr) { + return (0, _collection.deepMap)(expr, function (entry) { + return parse(entry).compile(); + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/evaluate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/evaluate.js new file mode 100644 index 0000000..17e4b9d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/evaluate.js @@ -0,0 +1,74 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEvaluate = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _map = require("../../utils/map.js"); +const name = 'evaluate'; +const dependencies = ['typed', 'parse']; +const createEvaluate = exports.createEvaluate = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + parse + } = _ref; + /** + * Evaluate an expression. + * + * The expression parser does not use JavaScript. Its syntax is close + * to JavaScript but more suited for mathematical expressions. + * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn + * the syntax and get an overview of the exact differences from JavaScript. + * + * Note the evaluating arbitrary expressions may involve security risks, + * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. + * + * Syntax: + * + * math.evaluate(expr) + * math.evaluate(expr, scope) + * math.evaluate([expr1, expr2, expr3, ...]) + * math.evaluate([expr1, expr2, expr3, ...], scope) + * + * Example: + * + * math.evaluate('(2+3)/4') // 1.25 + * math.evaluate('sqrt(3^2 + 4^2)') // 5 + * math.evaluate('sqrt(-4)') // 2i + * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12] + * + * let scope = {a:3, b:4} + * math.evaluate('a * b', scope) // 12 + * + * See also: + * + * parse, compile + * + * @param {string | string[] | Matrix} expr The expression to be evaluated + * @param {Object} [scope] Scope to read/write variables + * @return {*} The result of the expression + * @throws {Error} + */ + return typed(name, { + string: function (expr) { + const scope = (0, _map.createEmptyMap)(); + return parse(expr).compile().evaluate(scope); + }, + 'string, Map | Object': function (expr, scope) { + return parse(expr).compile().evaluate(scope); + }, + 'Array | Matrix': function (expr) { + const scope = (0, _map.createEmptyMap)(); + return (0, _collection.deepMap)(expr, function (entry) { + return parse(entry).compile().evaluate(scope); + }); + }, + 'Array | Matrix, Map | Object': function (expr, scope) { + return (0, _collection.deepMap)(expr, function (entry) { + return parse(entry).compile().evaluate(scope); + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/help.js new file mode 100644 index 0000000..1d8948b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/help.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createHelp = void 0; +var _factory = require("../../utils/factory.js"); +var _customs = require("../../utils/customs.js"); +var _embeddedDocs = require("../embeddedDocs/embeddedDocs.js"); +var _object = require("../../utils/object.js"); +const name = 'help'; +const dependencies = ['typed', 'mathWithTransform', 'Help']; +const createHelp = exports.createHelp = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + mathWithTransform, + Help + } = _ref; + /** + * Retrieve help on a function or data type. + * Help files are retrieved from the embedded documentation in math.docs. + * + * Syntax: + * + * math.help(search) + * + * Examples: + * + * console.log(math.help('sin').toString()) + * console.log(math.help(math.add).toString()) + * console.log(math.help(math.add).toJSON()) + * + * @param {Function | string | Object} search A function or function name + * for which to get help + * @return {Help} A help object + */ + return typed(name, { + any: function (search) { + let prop; + let searchName = search; + if (typeof search !== 'string') { + for (prop in mathWithTransform) { + // search in functions and constants + if ((0, _object.hasOwnProperty)(mathWithTransform, prop) && search === mathWithTransform[prop]) { + searchName = prop; + break; + } + } + + /* TODO: implement help for data types + if (!text) { + // search data type + for (prop in math.type) { + if (hasOwnProperty(math, prop)) { + if (search === math.type[prop]) { + text = prop + break + } + } + } + } + */ + } + const doc = (0, _customs.getSafeProperty)(_embeddedDocs.embeddedDocs, searchName); + if (!doc) { + const searchText = typeof searchName === 'function' ? searchName.name : searchName; + throw new Error('No documentation found on "' + searchText + '"'); + } + return new Help(doc); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/parser.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/parser.js new file mode 100644 index 0000000..60255e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/function/parser.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createParser = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'parser'; +const dependencies = ['typed', 'Parser']; +const createParser = exports.createParser = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Parser + } = _ref; + /** + * Create a parser. The function creates a new `math.Parser` object. + * + * Syntax: + * + * math.parser() + * + * Examples: + * + * const parser = new math.parser() + * + * // evaluate expressions + * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5 + * const b = parser.evaluate('sqrt(-4)') // 2i + * const c = parser.evaluate('2 inch in cm') // 5.08 cm + * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476 + * + * // define variables and functions + * parser.evaluate('x = 7 / 2') // 3.5 + * parser.evaluate('x + 3') // 6.5 + * parser.evaluate('f(x, y) = x^y') // f(x, y) + * parser.evaluate('f(2, 3)') // 8 + * + * // get and set variables and functions + * const x = parser.get('x') // 3.5 + * const f = parser.get('f') // function + * const g = f(3, 2) // 9 + * parser.set('h', 500) + * const i = parser.evaluate('h / 2') // 250 + * parser.set('hello', function (name) { + * return 'hello, ' + name + '!' + * }) + * parser.evaluate('hello("user")') // "hello, user!" + * + * // clear defined functions and variables + * parser.clear() + * + * See also: + * + * evaluate, compile, parse + * + * @return {Parser} Parser + */ + return typed(name, { + '': function () { + return new Parser(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/keywords.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/keywords.js new file mode 100644 index 0000000..e89262f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/keywords.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.keywords = void 0; +// Reserved keywords not allowed to use in the parser +const keywords = exports.keywords = new Set(['end']); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js new file mode 100644 index 0000000..b916377 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js @@ -0,0 +1,196 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAccessorNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _customs = require("../../utils/customs.js"); +var _factory = require("../../utils/factory.js"); +var _access = require("./utils/access.js"); +const name = 'AccessorNode'; +const dependencies = ['subset', 'Node']; +const createAccessorNode = exports.createAccessorNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + subset, + Node + } = _ref; + const access = (0, _access.accessFactory)({ + subset + }); + + /** + * Are parenthesis needed? + * @private + */ + function needParenthesis(node) { + // TODO: maybe make a method on the nodes which tells whether they need parenthesis? + return !((0, _is.isAccessorNode)(node) || (0, _is.isArrayNode)(node) || (0, _is.isConstantNode)(node) || (0, _is.isFunctionNode)(node) || (0, _is.isObjectNode)(node) || (0, _is.isParenthesisNode)(node) || (0, _is.isSymbolNode)(node)); + } + class AccessorNode extends Node { + /** + * @constructor AccessorNode + * @extends {Node} + * Access an object property or get a matrix subset + * + * @param {Node} object The object from which to retrieve + * a property or subset. + * @param {IndexNode} index IndexNode containing ranges + */ + constructor(object, index) { + super(); + if (!(0, _is.isNode)(object)) { + throw new TypeError('Node expected for parameter "object"'); + } + if (!(0, _is.isIndexNode)(index)) { + throw new TypeError('IndexNode expected for parameter "index"'); + } + this.object = object; + this.index = index; + } + + // readonly property name + get name() { + if (this.index) { + return this.index.isObjectProperty() ? this.index.getObjectProperty() : ''; + } else { + return this.object.name || ''; + } + } + get type() { + return name; + } + get isAccessorNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalObject = this.object._compile(math, argNames); + const evalIndex = this.index._compile(math, argNames); + if (this.index.isObjectProperty()) { + const prop = this.index.getObjectProperty(); + return function evalAccessorNode(scope, args, context) { + // get a property from an object evaluated using the scope. + return (0, _customs.getSafeProperty)(evalObject(scope, args, context), prop); + }; + } else { + return function evalAccessorNode(scope, args, context) { + const object = evalObject(scope, args, context); + // we pass just object here instead of context: + const index = evalIndex(scope, args, object); + return access(object, index); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.object, 'object', this); + callback(this.index, 'index', this); + } + + /** + * Create a new AccessorNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {AccessorNode} Returns a transformed copy of the node + */ + map(callback) { + return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {AccessorNode} + */ + clone() { + return new AccessorNode(this.object, this.index); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} + */ + _toString(options) { + let object = this.object.toString(options); + if (needParenthesis(this.object)) { + object = '(' + object + ')'; + } + return object + this.index.toString(options); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} + */ + _toHTML(options) { + let object = this.object.toHTML(options); + if (needParenthesis(this.object)) { + object = '(' + object + ')'; + } + return object + this.index.toHTML(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} + */ + _toTex(options) { + let object = this.object.toTex(options); + if (needParenthesis(this.object)) { + object = '\\left(\' + object + \'\\right)'; + } + return object + this.index.toTex(options); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + object: this.object, + index: this.index + }; + } + + /** + * Instantiate an AccessorNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "AccessorNode", object: ..., index: ...}`, + * where mathjs is optional + * @returns {AccessorNode} + */ + static fromJSON(json) { + return new AccessorNode(json.object, json.index); + } + } + (0, _defineProperty2.default)(AccessorNode, "name", name); + return AccessorNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js new file mode 100644 index 0000000..1392b3e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js @@ -0,0 +1,183 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createArrayNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'ArrayNode'; +const dependencies = ['Node']; +const createArrayNode = exports.createArrayNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + class ArrayNode extends Node { + /** + * @constructor ArrayNode + * @extends {Node} + * Holds an 1-dimensional array with items + * @param {Node[]} [items] 1 dimensional array with items + */ + constructor(items) { + super(); + this.items = items || []; + + // validate input + if (!Array.isArray(this.items) || !this.items.every(_is.isNode)) { + throw new TypeError('Array containing Nodes expected'); + } + } + get type() { + return name; + } + get isArrayNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalItems = (0, _array.map)(this.items, function (item) { + return item._compile(math, argNames); + }); + const asMatrix = math.config.matrix !== 'Array'; + if (asMatrix) { + const matrix = math.matrix; + return function evalArrayNode(scope, args, context) { + return matrix((0, _array.map)(evalItems, function (evalItem) { + return evalItem(scope, args, context); + })); + }; + } else { + return function evalArrayNode(scope, args, context) { + return (0, _array.map)(evalItems, function (evalItem) { + return evalItem(scope, args, context); + }); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (let i = 0; i < this.items.length; i++) { + const node = this.items[i]; + callback(node, 'items[' + i + ']', this); + } + } + + /** + * Create a new ArrayNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ArrayNode} Returns a transformed copy of the node + */ + map(callback) { + const items = []; + for (let i = 0; i < this.items.length; i++) { + items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this)); + } + return new ArrayNode(items); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ArrayNode} + */ + clone() { + return new ArrayNode(this.items.slice(0)); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + const items = this.items.map(function (node) { + return node.toString(options); + }); + return '[' + items.join(', ') + ']'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + items: this.items + }; + } + + /** + * Instantiate an ArrayNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ArrayNode", items: [...]}`, + * where mathjs is optional + * @returns {ArrayNode} + */ + static fromJSON(json) { + return new ArrayNode(json.items); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + const items = this.items.map(function (node) { + return node.toHTML(options); + }); + return '[' + items.join(',') + ']'; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + function itemsToTex(items, nested) { + const mixedItems = items.some(_is.isArrayNode) && !items.every(_is.isArrayNode); + const itemsFormRow = nested || mixedItems; + const itemSep = itemsFormRow ? '&' : '\\\\'; + const itemsTex = items.map(function (node) { + if (node.items) { + return itemsToTex(node.items, !nested); + } else { + return node.toTex(options); + } + }).join(itemSep); + return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\begin{bmatrix}' + itemsTex + '\\end{bmatrix}' : itemsTex; + } + return itemsToTex(this.items, false); + } + } + (0, _defineProperty2.default)(ArrayNode, "name", name); + return ArrayNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js new file mode 100644 index 0000000..ec1a7c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js @@ -0,0 +1,313 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAssignmentNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _customs = require("../../utils/customs.js"); +var _factory = require("../../utils/factory.js"); +var _access = require("./utils/access.js"); +var _assign = require("./utils/assign.js"); +var _operators = require("../operators.js"); +const name = 'AssignmentNode'; +const dependencies = ['subset', '?matrix', +// FIXME: should not be needed at all, should be handled by subset +'Node']; +const createAssignmentNode = exports.createAssignmentNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + subset, + matrix, + Node + } = _ref; + const access = (0, _access.accessFactory)({ + subset + }); + const assign = (0, _assign.assignFactory)({ + subset, + matrix + }); + + /* + * Is parenthesis needed? + * @param {node} node + * @param {string} [parenthesis='keep'] + * @param {string} implicit + * @private + */ + function needParenthesis(node, parenthesis, implicit) { + if (!parenthesis) { + parenthesis = 'keep'; + } + const precedence = (0, _operators.getPrecedence)(node, parenthesis, implicit); + const exprPrecedence = (0, _operators.getPrecedence)(node.value, parenthesis, implicit); + return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence; + } + class AssignmentNode extends Node { + /** + * @constructor AssignmentNode + * @extends {Node} + * + * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or + * replace a subset of a matrix like `A[2,2]=42`. + * + * Syntax: + * + * new AssignmentNode(symbol, value) + * new AssignmentNode(object, index, value) + * + * Usage: + * + * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2 + * new AssignmentNode(new SymbolNode('a'), + * new IndexNode('b'), + * new ConstantNode(2)) // a.b=2 + * new AssignmentNode(new SymbolNode('a'), + * new IndexNode(1, 2), + * new ConstantNode(3)) // a[1,2]=3 + * + * @param {SymbolNode | AccessorNode} object + * Object on which to assign a value + * @param {IndexNode} [index=null] + * Index, property name or matrix index. Optional. If not provided + * and `object` is a SymbolNode, the property is assigned to the + * global scope. + * @param {Node} value + * The value to be assigned + */ + constructor(object, index, value) { + super(); + this.object = object; + this.index = value ? index : null; + this.value = value || index; + + // validate input + if (!(0, _is.isSymbolNode)(object) && !(0, _is.isAccessorNode)(object)) { + throw new TypeError('SymbolNode or AccessorNode expected as "object"'); + } + if ((0, _is.isSymbolNode)(object) && object.name === 'end') { + throw new Error('Cannot assign to symbol "end"'); + } + if (this.index && !(0, _is.isIndexNode)(this.index)) { + // index is optional + throw new TypeError('IndexNode expected as "index"'); + } + if (!(0, _is.isNode)(this.value)) { + throw new TypeError('Node expected as "value"'); + } + } + + // class name for typing purposes: + + // readonly property name + get name() { + if (this.index) { + return this.index.isObjectProperty() ? this.index.getObjectProperty() : ''; + } else { + return this.object.name || ''; + } + } + get type() { + return name; + } + get isAssignmentNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalObject = this.object._compile(math, argNames); + const evalIndex = this.index ? this.index._compile(math, argNames) : null; + const evalValue = this.value._compile(math, argNames); + const name = this.object.name; + if (!this.index) { + // apply a variable to the scope, for example `a=2` + if (!(0, _is.isSymbolNode)(this.object)) { + throw new TypeError('SymbolNode expected as object'); + } + return function evalAssignmentNode(scope, args, context) { + const value = evalValue(scope, args, context); + scope.set(name, value); + return value; + }; + } else if (this.index.isObjectProperty()) { + // apply an object property for example `a.b=2` + const prop = this.index.getObjectProperty(); + return function evalAssignmentNode(scope, args, context) { + const object = evalObject(scope, args, context); + const value = evalValue(scope, args, context); + (0, _customs.setSafeProperty)(object, prop, value); + return value; + }; + } else if ((0, _is.isSymbolNode)(this.object)) { + // update a matrix subset, for example `a[2]=3` + return function evalAssignmentNode(scope, args, context) { + const childObject = evalObject(scope, args, context); + const value = evalValue(scope, args, context); + // Important: we pass childObject instead of context: + const index = evalIndex(scope, args, childObject); + scope.set(name, assign(childObject, index, value)); + return value; + }; + } else { + // isAccessorNode(node.object) === true + // update a matrix subset, for example `a.b[2]=3` + + // we will not use the compile function of the AccessorNode, but + // compile it ourselves here as we need the parent object of the + // AccessorNode: + // wee need to apply the updated object to parent object + const evalParentObject = this.object.object._compile(math, argNames); + if (this.object.index.isObjectProperty()) { + const parentProp = this.object.index.getObjectProperty(); + return function evalAssignmentNode(scope, args, context) { + const parent = evalParentObject(scope, args, context); + const childObject = (0, _customs.getSafeProperty)(parent, parentProp); + // Important: we pass childObject instead of context: + const index = evalIndex(scope, args, childObject); + const value = evalValue(scope, args, context); + (0, _customs.setSafeProperty)(parent, parentProp, assign(childObject, index, value)); + return value; + }; + } else { + // if some parameters use the 'end' parameter, we need to calculate + // the size + const evalParentIndex = this.object.index._compile(math, argNames); + return function evalAssignmentNode(scope, args, context) { + const parent = evalParentObject(scope, args, context); + // Important: we pass parent instead of context: + const parentIndex = evalParentIndex(scope, args, parent); + const childObject = access(parent, parentIndex); + // Important: we pass childObject instead of context + const index = evalIndex(scope, args, childObject); + const value = evalValue(scope, args, context); + assign(parent, parentIndex, assign(childObject, index, value)); + return value; + }; + } + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.object, 'object', this); + if (this.index) { + callback(this.index, 'index', this); + } + callback(this.value, 'value', this); + } + + /** + * Create a new AssignmentNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {AssignmentNode} Returns a transformed copy of the node + */ + map(callback) { + const object = this._ifNode(callback(this.object, 'object', this)); + const index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null; + const value = this._ifNode(callback(this.value, 'value', this)); + return new AssignmentNode(object, index, value); + } + + /** + * Create a clone of this node, a shallow copy + * @return {AssignmentNode} + */ + clone() { + return new AssignmentNode(this.object, this.index, this.value); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} + */ + _toString(options) { + const object = this.object.toString(options); + const index = this.index ? this.index.toString(options) : ''; + let value = this.value.toString(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = '(' + value + ')'; + } + return object + index + ' = ' + value; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + object: this.object, + index: this.index, + value: this.value + }; + } + + /** + * Instantiate an AssignmentNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "AssignmentNode", object: ..., index: ..., value: ...}`, + * where mathjs is optional + * @returns {AssignmentNode} + */ + static fromJSON(json) { + return new AssignmentNode(json.object, json.index, json.value); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} + */ + _toHTML(options) { + const object = this.object.toHTML(options); + const index = this.index ? this.index.toHTML(options) : ''; + let value = this.value.toHTML(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = '(' + value + ')'; + } + return object + index + '=' + value; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} + */ + _toTex(options) { + const object = this.object.toTex(options); + const index = this.index ? this.index.toTex(options) : ''; + let value = this.value.toTex(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = `\\left(${value}\\right)`; + } + return object + index + '=' + value; + } + } + (0, _defineProperty2.default)(AssignmentNode, "name", name); + return AssignmentNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js new file mode 100644 index 0000000..38b32e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js @@ -0,0 +1,192 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBlockNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'BlockNode'; +const dependencies = ['ResultSet', 'Node']; +const createBlockNode = exports.createBlockNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + ResultSet, + Node + } = _ref; + class BlockNode extends Node { + /** + * @constructor BlockNode + * @extends {Node} + * Holds a set with blocks + * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks + * An array with blocks, where a block is constructed as an + * Object with properties block, which is a Node, and visible, + * which is a boolean. The property visible is optional and + * is true by default + */ + constructor(blocks) { + super(); + // validate input, copy blocks + if (!Array.isArray(blocks)) throw new Error('Array expected'); + this.blocks = blocks.map(function (block) { + const node = block && block.node; + const visible = block && block.visible !== undefined ? block.visible : true; + if (!(0, _is.isNode)(node)) throw new TypeError('Property "node" must be a Node'); + if (typeof visible !== 'boolean') { + throw new TypeError('Property "visible" must be a boolean'); + } + return { + node, + visible + }; + }); + } + get type() { + return name; + } + get isBlockNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalBlocks = (0, _array.map)(this.blocks, function (block) { + return { + evaluate: block.node._compile(math, argNames), + visible: block.visible + }; + }); + return function evalBlockNodes(scope, args, context) { + const results = []; + (0, _array.forEach)(evalBlocks, function evalBlockNode(block) { + const result = block.evaluate(scope, args, context); + if (block.visible) { + results.push(result); + } + }); + return new ResultSet(results); + }; + } + + /** + * Execute a callback for each of the child blocks of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (let i = 0; i < this.blocks.length; i++) { + callback(this.blocks[i].node, 'blocks[' + i + '].node', this); + } + } + + /** + * Create a new BlockNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {BlockNode} Returns a transformed copy of the node + */ + map(callback) { + const blocks = []; + for (let i = 0; i < this.blocks.length; i++) { + const block = this.blocks[i]; + const node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this)); + blocks[i] = { + node, + visible: block.visible + }; + } + return new BlockNode(blocks); + } + + /** + * Create a clone of this node, a shallow copy + * @return {BlockNode} + */ + clone() { + const blocks = this.blocks.map(function (block) { + return { + node: block.node, + visible: block.visible + }; + }); + return new BlockNode(blocks); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + return this.blocks.map(function (param) { + return param.node.toString(options) + (param.visible ? '' : ';'); + }).join('\n'); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + blocks: this.blocks + }; + } + + /** + * Instantiate an BlockNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "BlockNode", blocks: [{node: ..., visible: false}, ...]}`, + * where mathjs is optional + * @returns {BlockNode} + */ + static fromJSON(json) { + return new BlockNode(json.blocks); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + return this.blocks.map(function (param) { + return param.node.toHTML(options) + (param.visible ? '' : ';'); + }).join('
    '); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + return this.blocks.map(function (param) { + return param.node.toTex(options) + (param.visible ? '' : ';'); + }).join('\\;\\;\n'); + } + } + (0, _defineProperty2.default)(BlockNode, "name", name); + return BlockNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js new file mode 100644 index 0000000..0839a04 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js @@ -0,0 +1,232 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConditionalNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _operators = require("../operators.js"); +const name = 'ConditionalNode'; +const dependencies = ['Node']; +const createConditionalNode = exports.createConditionalNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + /** + * Test whether a condition is met + * @param {*} condition + * @returns {boolean} true if condition is true or non-zero, else false + */ + function testCondition(condition) { + if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') { + return !!condition; + } + if (condition) { + if ((0, _is.isBigNumber)(condition)) { + return !condition.isZero(); + } + if ((0, _is.isComplex)(condition)) { + return !!(condition.re || condition.im); + } + if ((0, _is.isUnit)(condition)) { + return !!condition.value; + } + } + if (condition === null || condition === undefined) { + return false; + } + throw new TypeError('Unsupported type of condition "' + (0, _is.typeOf)(condition) + '"'); + } + class ConditionalNode extends Node { + /** + * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr' + * + * @param {Node} condition Condition, must result in a boolean + * @param {Node} trueExpr Expression evaluated when condition is true + * @param {Node} falseExpr Expression evaluated when condition is true + * + * @constructor ConditionalNode + * @extends {Node} + */ + constructor(condition, trueExpr, falseExpr) { + super(); + if (!(0, _is.isNode)(condition)) { + throw new TypeError('Parameter condition must be a Node'); + } + if (!(0, _is.isNode)(trueExpr)) { + throw new TypeError('Parameter trueExpr must be a Node'); + } + if (!(0, _is.isNode)(falseExpr)) { + throw new TypeError('Parameter falseExpr must be a Node'); + } + this.condition = condition; + this.trueExpr = trueExpr; + this.falseExpr = falseExpr; + } + get type() { + return name; + } + get isConditionalNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalCondition = this.condition._compile(math, argNames); + const evalTrueExpr = this.trueExpr._compile(math, argNames); + const evalFalseExpr = this.falseExpr._compile(math, argNames); + return function evalConditionalNode(scope, args, context) { + return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context); + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.condition, 'condition', this); + callback(this.trueExpr, 'trueExpr', this); + callback(this.falseExpr, 'falseExpr', this); + } + + /** + * Create a new ConditionalNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ConditionalNode} Returns a transformed copy of the node + */ + map(callback) { + return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ConditionalNode} + */ + clone() { + return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const precedence = (0, _operators.getPrecedence)(this, parenthesis, options && options.implicit); + + // Enclose Arguments in parentheses if they are an OperatorNode + // or have lower or equal precedence + // NOTE: enclosing all OperatorNodes in parentheses is a decision + // purely based on aesthetics and readability + let condition = this.condition.toString(options); + const conditionPrecedence = (0, _operators.getPrecedence)(this.condition, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) { + condition = '(' + condition + ')'; + } + let trueExpr = this.trueExpr.toString(options); + const truePrecedence = (0, _operators.getPrecedence)(this.trueExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) { + trueExpr = '(' + trueExpr + ')'; + } + let falseExpr = this.falseExpr.toString(options); + const falsePrecedence = (0, _operators.getPrecedence)(this.falseExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) { + falseExpr = '(' + falseExpr + ')'; + } + return condition + ' ? ' + trueExpr + ' : ' + falseExpr; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + condition: this.condition, + trueExpr: this.trueExpr, + falseExpr: this.falseExpr + }; + } + + /** + * Instantiate an ConditionalNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "ConditionalNode", + * "condition": ..., + * "trueExpr": ..., + * "falseExpr": ...} + * ``` + * where mathjs is optional + * @returns {ConditionalNode} + */ + static fromJSON(json) { + return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const precedence = (0, _operators.getPrecedence)(this, parenthesis, options && options.implicit); + + // Enclose Arguments in parentheses if they are an OperatorNode + // or have lower or equal precedence + // NOTE: enclosing all OperatorNodes in parentheses is a decision + // purely based on aesthetics and readability + let condition = this.condition.toHTML(options); + const conditionPrecedence = (0, _operators.getPrecedence)(this.condition, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) { + condition = '(' + condition + ')'; + } + let trueExpr = this.trueExpr.toHTML(options); + const truePrecedence = (0, _operators.getPrecedence)(this.trueExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) { + trueExpr = '(' + trueExpr + ')'; + } + let falseExpr = this.falseExpr.toHTML(options); + const falsePrecedence = (0, _operators.getPrecedence)(this.falseExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) { + falseExpr = '(' + falseExpr + ')'; + } + return condition + '?' + trueExpr + ':' + falseExpr; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + return '\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\quad{\\text{if }\\;' + this.condition.toTex(options) + '}\\\\{' + this.falseExpr.toTex(options) + '}, &\\quad{\\text{otherwise}}\\end{cases}'; + } + } + (0, _defineProperty2.default)(ConditionalNode, "name", name); + return ConditionalNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js new file mode 100644 index 0000000..7c1bba0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js @@ -0,0 +1,186 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConstantNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _string = require("../../utils/string.js"); +var _is = require("../../utils/is.js"); +var _latex = require("../../utils/latex.js"); +var _factory = require("../../utils/factory.js"); +const name = 'ConstantNode'; +const dependencies = ['Node']; +const createConstantNode = exports.createConstantNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + class ConstantNode extends Node { + /** + * A ConstantNode holds a constant value like a number or string. + * + * Usage: + * + * new ConstantNode(2.3) + * new ConstantNode('hello') + * + * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...) + * @constructor ConstantNode + * @extends {Node} + */ + constructor(value) { + super(); + this.value = value; + } + get type() { + return name; + } + get isConstantNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const value = this.value; + return function evalConstantNode() { + return value; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // nothing to do, we don't have any children + } + + /** + * Create a new ConstantNode with children produced by the given callback. + * Trivial because there are no children. + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {ConstantNode} Returns a clone of the node + */ + map(callback) { + return this.clone(); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ConstantNode} + */ + clone() { + return new ConstantNode(this.value); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + return (0, _string.format)(this.value, options); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const value = this._toString(options); + switch ((0, _is.typeOf)(this.value)) { + case 'number': + case 'bigint': + case 'BigNumber': + case 'Fraction': + return '' + value + ''; + case 'string': + return '' + value + ''; + case 'boolean': + return '' + value + ''; + case 'null': + return '' + value + ''; + case 'undefined': + return '' + value + ''; + default: + return '' + value + ''; + } + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + value: this.value + }; + } + + /** + * Instantiate a ConstantNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "SymbolNode", value: 2.3}`, + * where mathjs is optional + * @returns {ConstantNode} + */ + static fromJSON(json) { + return new ConstantNode(json.value); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const value = this._toString(options); + const type = (0, _is.typeOf)(this.value); + switch (type) { + case 'string': + return '\\mathtt{' + (0, _latex.escapeLatex)(value) + '}'; + case 'number': + case 'BigNumber': + { + const finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value); + if (!finite) { + return this.value.valueOf() < 0 ? '-\\infty' : '\\infty'; + } + const index = value.toLowerCase().indexOf('e'); + if (index !== -1) { + return value.substring(0, index) + '\\cdot10^{' + value.substring(index + 1) + '}'; + } + return value; + } + case 'bigint': + { + return value.toString(); + } + case 'Fraction': + return this.value.toLatex(); + default: + return value; + } + } + } + (0, _defineProperty2.default)(ConstantNode, "name", name); + return ConstantNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js new file mode 100644 index 0000000..63df6cf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js @@ -0,0 +1,242 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFunctionAssignmentNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _keywords = require("../keywords.js"); +var _string = require("../../utils/string.js"); +var _array = require("../../utils/array.js"); +var _latex = require("../../utils/latex.js"); +var _operators = require("../operators.js"); +var _factory = require("../../utils/factory.js"); +const name = 'FunctionAssignmentNode'; +const dependencies = ['typed', 'Node']; +const createFunctionAssignmentNode = exports.createFunctionAssignmentNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Node + } = _ref; + /** + * Is parenthesis needed? + * @param {Node} node + * @param {Object} parenthesis + * @param {string} implicit + * @private + */ + function needParenthesis(node, parenthesis, implicit) { + const precedence = (0, _operators.getPrecedence)(node, parenthesis, implicit); + const exprPrecedence = (0, _operators.getPrecedence)(node.expr, parenthesis, implicit); + return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence; + } + class FunctionAssignmentNode extends Node { + /** + * @constructor FunctionAssignmentNode + * @extends {Node} + * Function assignment + * + * @param {string} name Function name + * @param {string[] | Array.<{name: string, type: string}>} params + * Array with function parameter names, or an + * array with objects containing the name + * and type of the parameter + * @param {Node} expr The function expression + */ + constructor(name, params, expr) { + super(); + // validate input + if (typeof name !== 'string') { + throw new TypeError('String expected for parameter "name"'); + } + if (!Array.isArray(params)) { + throw new TypeError('Array containing strings or objects expected for parameter "params"'); + } + if (!(0, _is.isNode)(expr)) { + throw new TypeError('Node expected for parameter "expr"'); + } + if (_keywords.keywords.has(name)) { + throw new Error('Illegal function name, "' + name + '" is a reserved keyword'); + } + const paramNames = new Set(); + for (const param of params) { + const name = typeof param === 'string' ? param : param.name; + if (paramNames.has(name)) { + throw new Error(`Duplicate parameter name "${name}"`); + } else { + paramNames.add(name); + } + } + this.name = name; + this.params = params.map(function (param) { + return param && param.name || param; + }); + this.types = params.map(function (param) { + return param && param.type || 'any'; + }); + this.expr = expr; + } + get type() { + return name; + } + get isFunctionAssignmentNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const childArgNames = Object.create(argNames); + (0, _array.forEach)(this.params, function (param) { + childArgNames[param] = true; + }); + + // compile the function expression with the child args + const evalExpr = this.expr._compile(math, childArgNames); + const name = this.name; + const params = this.params; + const signature = (0, _array.join)(this.types, ','); + const syntax = name + '(' + (0, _array.join)(this.params, ', ') + ')'; + return function evalFunctionAssignmentNode(scope, args, context) { + const signatures = {}; + signatures[signature] = function () { + const childArgs = Object.create(args); + for (let i = 0; i < params.length; i++) { + childArgs[params[i]] = arguments[i]; + } + return evalExpr(scope, childArgs, context); + }; + const fn = typed(name, signatures); + fn.syntax = syntax; + scope.set(name, fn); + return fn; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.expr, 'expr', this); + } + + /** + * Create a new FunctionAssignmentNode whose children are the results of + * calling the provided callback function for each child of the original + * node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {FunctionAssignmentNode} Returns a transformed copy of the node + */ + map(callback) { + const expr = this._ifNode(callback(this.expr, 'expr', this)); + return new FunctionAssignmentNode(this.name, this.params.slice(0), expr); + } + + /** + * Create a clone of this node, a shallow copy + * @return {FunctionAssignmentNode} + */ + clone() { + return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr); + } + + /** + * get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + let expr = this.expr.toString(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = '(' + expr + ')'; + } + return this.name + '(' + this.params.join(', ') + ') = ' + expr; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + const types = this.types; + return { + mathjs: name, + name: this.name, + params: this.params.map(function (param, index) { + return { + name: param, + type: types[index] + }; + }), + expr: this.expr + }; + } + + /** + * Instantiate an FunctionAssignmentNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "FunctionAssignmentNode", + * name: ..., params: ..., expr: ...} + * ``` + * where mathjs is optional + * @returns {FunctionAssignmentNode} + */ + static fromJSON(json) { + return new FunctionAssignmentNode(json.name, json.params, json.expr); + } + + /** + * get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const params = []; + for (let i = 0; i < this.params.length; i++) { + params.push('' + (0, _string.escape)(this.params[i]) + ''); + } + let expr = this.expr.toHTML(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = '(' + expr + ')'; + } + return '' + (0, _string.escape)(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr; + } + + /** + * get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + let expr = this.expr.toTex(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = `\\left(${expr}\\right)`; + } + return '\\mathrm{' + this.name + '}\\left(' + this.params.map(_latex.toSymbol).join(',') + '\\right)=' + expr; + } + } + (0, _defineProperty2.default)(FunctionAssignmentNode, "name", name); + return FunctionAssignmentNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js new file mode 100644 index 0000000..0d700b0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js @@ -0,0 +1,486 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFunctionNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +var _customs = require("../../utils/customs.js"); +var _scope = require("../../utils/scope.js"); +var _factory = require("../../utils/factory.js"); +var _latex = require("../../utils/latex.js"); +const name = 'FunctionNode'; +const dependencies = ['math', 'Node', 'SymbolNode']; +const createFunctionNode = exports.createFunctionNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + var _FunctionNode; + let { + math, + Node, + SymbolNode + } = _ref; + /* format to fixed length */ + const strin = entity => (0, _string.format)(entity, { + truncate: 78 + }); + + /* + * Expand a LaTeX template + * + * @param {string} template + * @param {Node} node + * @param {Object} options + * @private + **/ + function expandTemplate(template, node, options) { + let latex = ''; + + // Match everything of the form ${identifier} or ${identifier[2]} or $$ + // while submatching identifier and 2 (in the second case) + const regex = /\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi; + let inputPos = 0; // position in the input string + let match; + while ((match = regex.exec(template)) !== null) { + // go through all matches + // add everything in front of the match to the LaTeX string + latex += template.substring(inputPos, match.index); + inputPos = match.index; + if (match[0] === '$$') { + // escaped dollar sign + latex += '$'; + inputPos++; + } else { + // template parameter + inputPos += match[0].length; + const property = node[match[1]]; + if (!property) { + throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.'); + } + if (match[2] === undefined) { + // no square brackets + switch (typeof property) { + case 'string': + latex += property; + break; + case 'object': + if ((0, _is.isNode)(property)) { + latex += property.toTex(options); + } else if (Array.isArray(property)) { + // make array of Nodes into comma separated list + latex += property.map(function (arg, index) { + if ((0, _is.isNode)(arg)) { + return arg.toTex(options); + } + throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.'); + }).join(','); + } else { + throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes'); + } + break; + default: + throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes'); + } + } else { + // with square brackets + if ((0, _is.isNode)(property[match[2]] && property[match[2]])) { + latex += property[match[2]].toTex(options); + } else { + throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.'); + } + } + } + } + latex += template.slice(inputPos); // append rest of the template + + return latex; + } + class FunctionNode extends Node { + /** + * @constructor FunctionNode + * @extends {./Node} + * invoke a list with arguments on a node + * @param {./Node | string} fn + * Item resolving to a function on which to invoke + * the arguments, typically a SymbolNode or AccessorNode + * @param {./Node[]} args + */ + constructor(fn, args) { + super(); + if (typeof fn === 'string') { + fn = new SymbolNode(fn); + } + + // validate input + if (!(0, _is.isNode)(fn)) throw new TypeError('Node expected as parameter "fn"'); + if (!Array.isArray(args) || !args.every(_is.isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "args"'); + } + this.fn = fn; + this.args = args || []; + } + + // readonly property name + get name() { + return this.fn.name || ''; + } + get type() { + return name; + } + get isFunctionNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // compile arguments + const evalArgs = this.args.map(arg => arg._compile(math, argNames)); + if ((0, _is.isSymbolNode)(this.fn)) { + const name = this.fn.name; + if (!argNames[name]) { + // we can statically determine whether the function + // has the rawArgs property + const fn = name in math ? (0, _customs.getSafeProperty)(math, name) : undefined; + const isRaw = typeof fn === 'function' && fn.rawArgs === true; + const resolveFn = scope => { + let value; + if (scope.has(name)) { + value = scope.get(name); + } else if (name in math) { + value = (0, _customs.getSafeProperty)(math, name); + } else { + return FunctionNode.onUndefinedFunction(name); + } + if (typeof value === 'function') { + return value; + } + throw new TypeError(`'${name}' is not a function; its value is:\n ${strin(value)}`); + }; + if (isRaw) { + // pass unevaluated parameters (nodes) to the function + // "raw" evaluation + const rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + const fn = resolveFn(scope); + + // the original function can be overwritten in the scope with a non-rawArgs function + if (fn.rawArgs === true) { + return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args)); + } else { + // "regular" evaluation + const values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn(...values); + } + }; + } else { + // "regular" evaluation + switch (evalArgs.length) { + case 0: + return function evalFunctionNode(scope, args, context) { + const fn = resolveFn(scope); + return fn(); + }; + case 1: + return function evalFunctionNode(scope, args, context) { + const fn = resolveFn(scope); + const evalArg0 = evalArgs[0]; + return fn(evalArg0(scope, args, context)); + }; + case 2: + return function evalFunctionNode(scope, args, context) { + const fn = resolveFn(scope); + const evalArg0 = evalArgs[0]; + const evalArg1 = evalArgs[1]; + return fn(evalArg0(scope, args, context), evalArg1(scope, args, context)); + }; + default: + return function evalFunctionNode(scope, args, context) { + const fn = resolveFn(scope); + const values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn(...values); + }; + } + } + } else { + // the function symbol is an argName + const rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + const fn = (0, _customs.getSafeProperty)(args, name); + if (typeof fn !== 'function') { + throw new TypeError(`Argument '${name}' was not a function; received: ${strin(fn)}`); + } + if (fn.rawArgs) { + // "Raw" evaluation + return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args)); + } else { + const values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(fn, values); + } + }; + } + } else if ((0, _is.isAccessorNode)(this.fn) && (0, _is.isIndexNode)(this.fn.index) && this.fn.index.isObjectProperty()) { + // execute the function with the right context: + // the object of the AccessorNode + + const evalObject = this.fn.object._compile(math, argNames); + const prop = this.fn.index.getObjectProperty(); + const rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + const object = evalObject(scope, args, context); + const fn = (0, _customs.getSafeMethod)(object, prop); + if (fn !== null && fn !== void 0 && fn.rawArgs) { + // "Raw" evaluation + return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args)); + } else { + // "regular" evaluation + const values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(object, values); + } + }; + } else { + // node.fn.isAccessorNode && !node.fn.index.isObjectProperty() + // we have to dynamically determine whether the function has the + // rawArgs property + const fnExpr = this.fn.toString(); + const evalFn = this.fn._compile(math, argNames); + const rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + const fn = evalFn(scope, args, context); + if (typeof fn !== 'function') { + throw new TypeError(`Expression '${fnExpr}' did not evaluate to a function; value is:` + `\n ${strin(fn)}`); + } + if (fn.rawArgs) { + // "Raw" evaluation + return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args)); + } else { + // "regular" evaluation + const values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(fn, values); + } + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.fn, 'fn', this); + for (let i = 0; i < this.args.length; i++) { + callback(this.args[i], 'args[' + i + ']', this); + } + } + + /** + * Create a new FunctionNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {FunctionNode} Returns a transformed copy of the node + */ + map(callback) { + const fn = this._ifNode(callback(this.fn, 'fn', this)); + const args = []; + for (let i = 0; i < this.args.length; i++) { + args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this)); + } + return new FunctionNode(fn, args); + } + + /** + * Create a clone of this node, a shallow copy + * @return {FunctionNode} + */ + clone() { + return new FunctionNode(this.fn, this.args.slice(0)); + } + + /** + * Throws an error 'Undefined function {name}' + * @param {string} name + */ + + /** + * Get string representation. (wrapper function) + * This overrides parts of Node's toString function. + * If callback is an object containing callbacks, it + * calls the correct callback for the current node, + * otherwise it falls back to calling Node's toString + * function. + * + * @param {Object} options + * @return {string} str + * @override + */ + toString(options) { + let customString; + const name = this.fn.toString(options); + if (options && typeof options.handler === 'object' && (0, _object.hasOwnProperty)(options.handler, name)) { + // callback is a map of callback functions + customString = options.handler[name](this, options); + } + if (typeof customString !== 'undefined') { + return customString; + } + + // fall back to Node's toString + return super.toString(options); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const args = this.args.map(function (arg) { + return arg.toString(options); + }); + const fn = (0, _is.isFunctionAssignmentNode)(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options); + + // format the arguments like "add(2, 4.2)" + return fn + '(' + args.join(', ') + ')'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + fn: this.fn, + args: this.args + }; + } + + /** + * Instantiate an AssignmentNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "FunctionNode", fn: ..., args: ...}`, + * where mathjs is optional + * @returns {FunctionNode} + */ + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const args = this.args.map(function (arg) { + return arg.toHTML(options); + }); + + // format the arguments like "add(2, 4.2)" + return '' + (0, _string.escape)(this.fn) + '(' + args.join(',') + ')'; + } + + /** + * Get LaTeX representation. (wrapper function) + * This overrides parts of Node's toTex function. + * If callback is an object containing callbacks, it + * calls the correct callback for the current node, + * otherwise it falls back to calling Node's toTex + * function. + * + * @param {Object} options + * @return {string} + */ + toTex(options) { + let customTex; + if (options && typeof options.handler === 'object' && (0, _object.hasOwnProperty)(options.handler, this.name)) { + // callback is a map of callback functions + customTex = options.handler[this.name](this, options); + } + if (typeof customTex !== 'undefined') { + return customTex; + } + + // fall back to Node's toTex + return super.toTex(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const args = this.args.map(function (arg) { + // get LaTeX of the arguments + return arg.toTex(options); + }); + let latexConverter; + if (_latex.latexFunctions[this.name]) { + latexConverter = _latex.latexFunctions[this.name]; + } + + // toTex property on the function itself + if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) { + // .toTex is a callback function + latexConverter = math[this.name].toTex; + } + let customToTex; + switch (typeof latexConverter) { + case 'function': + // a callback function + customToTex = latexConverter(this, options); + break; + case 'string': + // a template string + customToTex = expandTemplate(latexConverter, this, options); + break; + case 'object': + // an object with different "converters" for different + // numbers of arguments + switch (typeof latexConverter[args.length]) { + case 'function': + customToTex = latexConverter[args.length](this, options); + break; + case 'string': + customToTex = expandTemplate(latexConverter[args.length], this, options); + break; + } + } + if (typeof customToTex !== 'undefined') { + return customToTex; + } + return expandTemplate(_latex.defaultTemplate, this, options); + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type + ':' + this.name; + } + } + _FunctionNode = FunctionNode; + (0, _defineProperty2.default)(FunctionNode, "name", name); + (0, _defineProperty2.default)(FunctionNode, "onUndefinedFunction", function (name) { + throw new Error('Undefined function ' + name); + }); + (0, _defineProperty2.default)(FunctionNode, "fromJSON", function (json) { + return new _FunctionNode(json.fn, json.args); + }); + return FunctionNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js new file mode 100644 index 0000000..aa3a7db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js @@ -0,0 +1,226 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIndexNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _array = require("../../utils/array.js"); +var _customs = require("../../utils/customs.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _string = require("../../utils/string.js"); +const name = 'IndexNode'; +const dependencies = ['Node', 'size']; +const createIndexNode = exports.createIndexNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node, + size + } = _ref; + class IndexNode extends Node { + /** + * @constructor IndexNode + * @extends Node + * + * Describes a subset of a matrix or an object property. + * Cannot be used on its own, needs to be used within an AccessorNode or + * AssignmentNode. + * + * @param {Node[]} dimensions + * @param {boolean} [dotNotation=false] + * Optional property describing whether this index was written using dot + * notation like `a.b`, or using bracket notation like `a["b"]` + * (which is the default). This property is used for string conversion. + */ + constructor(dimensions, dotNotation) { + super(); + this.dimensions = dimensions; + this.dotNotation = dotNotation || false; + + // validate input + if (!Array.isArray(dimensions) || !dimensions.every(_is.isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "dimensions"'); + } + if (this.dotNotation && !this.isObjectProperty()) { + throw new Error('dotNotation only applicable for object properties'); + } + } + get type() { + return name; + } + get isIndexNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // TODO: implement support for bignumber (currently bignumbers are silently + // reduced to numbers when changing the value to zero-based) + + // TODO: Optimization: when the range values are ConstantNodes, + // we can beforehand resolve the zero-based value + + // optimization for a simple object property + const evalDimensions = (0, _array.map)(this.dimensions, function (dimension, i) { + const needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0; + if (needsEnd) { + // SymbolNode 'end' is used inside the index, + // like in `A[end]` or `A[end - 2]` + const childArgNames = Object.create(argNames); + childArgNames.end = true; + const _evalDimension = dimension._compile(math, childArgNames); + return function evalDimension(scope, args, context) { + if (!(0, _is.isMatrix)(context) && !(0, _is.isArray)(context) && !(0, _is.isString)(context)) { + throw new TypeError('Cannot resolve "end": ' + 'context must be a Matrix, Array, or string but is ' + (0, _is.typeOf)(context)); + } + const s = size(context).valueOf(); + const childArgs = Object.create(args); + childArgs.end = s[i]; + return _evalDimension(scope, childArgs, context); + }; + } else { + // SymbolNode `end` not used + return dimension._compile(math, argNames); + } + }); + const index = (0, _customs.getSafeProperty)(math, 'index'); + return function evalIndexNode(scope, args, context) { + const dimensions = (0, _array.map)(evalDimensions, function (evalDimension) { + return evalDimension(scope, args, context); + }); + return index(...dimensions); + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (let i = 0; i < this.dimensions.length; i++) { + callback(this.dimensions[i], 'dimensions[' + i + ']', this); + } + } + + /** + * Create a new IndexNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {IndexNode} Returns a transformed copy of the node + */ + map(callback) { + const dimensions = []; + for (let i = 0; i < this.dimensions.length; i++) { + dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this)); + } + return new IndexNode(dimensions, this.dotNotation); + } + + /** + * Create a clone of this node, a shallow copy + * @return {IndexNode} + */ + clone() { + return new IndexNode(this.dimensions.slice(0), this.dotNotation); + } + + /** + * Test whether this IndexNode contains a single property name + * @return {boolean} + */ + isObjectProperty() { + return this.dimensions.length === 1 && (0, _is.isConstantNode)(this.dimensions[0]) && typeof this.dimensions[0].value === 'string'; + } + + /** + * Returns the property name if IndexNode contains a property. + * If not, returns null. + * @return {string | null} + */ + getObjectProperty() { + return this.isObjectProperty() ? this.dimensions[0].value : null; + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + // format the parameters like "[1, 0:5]" + return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + dimensions: this.dimensions, + dotNotation: this.dotNotation + }; + } + + /** + * Instantiate an IndexNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "IndexNode", dimensions: [...], dotNotation: false}`, + * where mathjs is optional + * @returns {IndexNode} + */ + static fromJSON(json) { + return new IndexNode(json.dimensions, json.dotNotation); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + // format the parameters like "[1, 0:5]" + const dimensions = []; + for (let i = 0; i < this.dimensions.length; i++) { + dimensions[i] = this.dimensions[i].toHTML(); + } + if (this.dotNotation) { + return '.' + '' + (0, _string.escape)(this.getObjectProperty()) + ''; + } else { + return '[' + dimensions.join(',') + ']'; + } + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const dimensions = this.dimensions.map(function (range) { + return range.toTex(options); + }); + return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}'; + } + } + (0, _defineProperty2.default)(IndexNode, "name", name); + return IndexNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/Node.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/Node.js new file mode 100644 index 0000000..9274295 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/Node.js @@ -0,0 +1,378 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNode = void 0; +var _is = require("../../utils/is.js"); +var _keywords = require("../keywords.js"); +var _object = require("../../utils/object.js"); +var _factory = require("../../utils/factory.js"); +var _map = require("../../utils/map.js"); +const name = 'Node'; +const dependencies = ['mathWithTransform']; +const createNode = exports.createNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + mathWithTransform + } = _ref; + /** + * Validate the symbol names of a scope. + * Throws an error when the scope contains an illegal symbol. + * @param {Object} scope + */ + function _validateScope(scope) { + for (const symbol of [..._keywords.keywords]) { + if (scope.has(symbol)) { + throw new Error('Scope contains an illegal symbol, "' + symbol + '" is a reserved keyword'); + } + } + } + class Node { + get type() { + return 'Node'; + } + get isNode() { + return true; + } + + /** + * Evaluate the node + * @param {Object} [scope] Scope to read/write variables + * @return {*} Returns the result + */ + evaluate(scope) { + return this.compile().evaluate(scope); + } + + /** + * Compile the node into an optimized, evauatable JavaScript function + * @return {{evaluate: function([Object])}} object + * Returns an object with a function 'evaluate', + * which can be invoked as expr.evaluate([scope: Object]), + * where scope is an optional object with + * variables. + */ + compile() { + const expr = this._compile(mathWithTransform, {}); + const args = {}; + const context = null; + function evaluate(scope) { + const s = (0, _map.createMap)(scope); + _validateScope(s); + return expr(s, args, context); + } + return { + evaluate + }; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + throw new Error('Method _compile must be implemented by type ' + this.type); + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // must be implemented by each of the Node implementations + throw new Error('Cannot run forEach on a Node interface'); + } + + /** + * Create a new Node whose children are the results of calling the + * provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {OperatorNode} Returns a transformed copy of the node + */ + map(callback) { + // must be implemented by each of the Node implementations + throw new Error('Cannot run map on a Node interface'); + } + + /** + * Validate whether an object is a Node, for use with map + * @param {Node} node + * @returns {Node} Returns the input if it's a node, else throws an Error + * @protected + */ + _ifNode(node) { + if (!(0, _is.isNode)(node)) { + throw new TypeError('Callback function must return a Node'); + } + return node; + } + + /** + * Recursively traverse all nodes in a node tree. Executes given callback for + * this node and each of its child nodes. + * @param {function(node: Node, path: string, parent: Node)} callback + * A callback called for every node in the node tree. + */ + traverse(callback) { + // execute callback for itself + // eslint-disable-next-line + callback(this, null, null); + + // recursively traverse over all children of a node + function _traverse(node, callback) { + node.forEach(function (child, path, parent) { + callback(child, path, parent); + _traverse(child, callback); + }); + } + _traverse(this, callback); + } + + /** + * Recursively transform a node tree via a transform function. + * + * For example, to replace all nodes of type SymbolNode having name 'x' with + * a ConstantNode with value 2: + * + * const res = Node.transform(function (node, path, parent) { + * if (node && node.isSymbolNode) && (node.name === 'x')) { + * return new ConstantNode(2) + * } + * else { + * return node + * } + * }) + * + * @param {function(node: Node, path: string, parent: Node) : Node} callback + * A mapping function accepting a node, and returning + * a replacement for the node or the original node. The "signature" + * of the callback must be: + * callback(node: Node, index: string, parent: Node) : Node + * @return {Node} Returns the original node or its replacement + */ + transform(callback) { + function _transform(child, path, parent) { + const replacement = callback(child, path, parent); + if (replacement !== child) { + // stop iterating when the node is replaced + return replacement; + } + return child.map(_transform); + } + return _transform(this, null, null); + } + + /** + * Find any node in the node tree matching given filter function. For + * example, to find all nodes of type SymbolNode having name 'x': + * + * const results = Node.filter(function (node) { + * return (node && node.isSymbolNode) && (node.name === 'x') + * }) + * + * @param {function(node: Node, path: string, parent: Node) : Node} callback + * A test function returning true when a node matches, and false + * otherwise. Function signature: + * callback(node: Node, index: string, parent: Node) : boolean + * @return {Node[]} nodes + * An array with nodes matching given filter criteria + */ + filter(callback) { + const nodes = []; + this.traverse(function (node, path, parent) { + if (callback(node, path, parent)) { + nodes.push(node); + } + }); + return nodes; + } + + /** + * Create a shallow clone of this node + * @return {Node} + */ + clone() { + // must be implemented by each of the Node implementations + throw new Error('Cannot clone a Node interface'); + } + + /** + * Create a deep clone of this node + * @return {Node} + */ + cloneDeep() { + return this.map(function (node) { + return node.cloneDeep(); + }); + } + + /** + * Deep compare this node with another node. + * @param {Node} other + * @return {boolean} Returns true when both nodes are of the same type and + * contain the same values (as do their childs) + */ + equals(other) { + return other ? this.type === other.type && (0, _object.deepStrictEqual)(this, other) : false; + } + + /** + * Get string representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)"or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toString(options) { + const customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toString(options); + } + + /** + * Internal function to generate the string output. + * This has to be implemented by every Node + * + * @throws {Error} + */ + _toString() { + // must be implemented by each of the Node implementations + throw new Error('_toString not implemented for ' + this.type); + } + + /** + * Get a JSON representation of the node + * Both .toJSON() and the static .fromJSON(json) should be implemented by all + * implementations of Node + * @returns {Object} + */ + toJSON() { + throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type); + } + + /** + * Get HTML representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)" or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toHTML(options) { + const customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toHTML(options); + } + + /** + * Internal function to generate the HTML output. + * This has to be implemented by every Node + * + * @throws {Error} + */ + _toHTML() { + // must be implemented by each of the Node implementations + throw new Error('_toHTML not implemented for ' + this.type); + } + + /** + * Get LaTeX representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)"or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toTex(options) { + const customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toTex(options); + } + + /** + * Internal function to generate the LaTeX output. + * This has to be implemented by every Node + * + * @param {Object} [options] + * @throws {Error} + */ + _toTex(options) { + // must be implemented by each of the Node implementations + throw new Error('_toTex not implemented for ' + this.type); + } + + /** + * Helper used by `to...` functions. + */ + _getCustomString(options) { + if (options && typeof options === 'object') { + switch (typeof options.handler) { + case 'object': + case 'undefined': + return; + case 'function': + return options.handler(this, options); + default: + throw new TypeError('Object or function expected as callback'); + } + } + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type; + } + + /** + * Get the content of the current Node. + * @return {Node} node + **/ + getContent() { + return this; + } + } + return Node; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js new file mode 100644 index 0000000..0efc8aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js @@ -0,0 +1,200 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createObjectNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _customs = require("../../utils/customs.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _string = require("../../utils/string.js"); +const name = 'ObjectNode'; +const dependencies = ['Node']; +const createObjectNode = exports.createObjectNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + class ObjectNode extends Node { + /** + * @constructor ObjectNode + * @extends {Node} + * Holds an object with keys/values + * @param {Object.} [properties] object with key/value pairs + */ + constructor(properties) { + super(); + this.properties = properties || {}; + + // validate input + if (properties) { + if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) { + return (0, _is.isNode)(properties[key]); + })) { + throw new TypeError('Object containing Nodes expected'); + } + } + } + get type() { + return name; + } + get isObjectNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const evalEntries = {}; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + // we stringify/parse the key here to resolve unicode characters, + // so you cannot create a key like {"co\\u006Estructor": null} + const stringifiedKey = (0, _string.stringify)(key); + const parsedKey = JSON.parse(stringifiedKey); + const prop = (0, _customs.getSafeProperty)(this.properties, key); + evalEntries[parsedKey] = prop._compile(math, argNames); + } + } + return function evalObjectNode(scope, args, context) { + const obj = {}; + for (const key in evalEntries) { + if ((0, _object.hasOwnProperty)(evalEntries, key)) { + obj[key] = evalEntries[key](scope, args, context); + } + } + return obj; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + callback(this.properties[key], 'properties[' + (0, _string.stringify)(key) + ']', this); + } + } + } + + /** + * Create a new ObjectNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ObjectNode} Returns a transformed copy of the node + */ + map(callback) { + const properties = {}; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + (0, _string.stringify)(key) + ']', this)); + } + } + return new ObjectNode(properties); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ObjectNode} + */ + clone() { + const properties = {}; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + properties[key] = this.properties[key]; + } + } + return new ObjectNode(properties); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + const entries = []; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + entries.push((0, _string.stringify)(key) + ': ' + this.properties[key].toString(options)); + } + } + return '{' + entries.join(', ') + '}'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + properties: this.properties + }; + } + + /** + * Instantiate an OperatorNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ObjectNode", "properties": {...}}`, + * where mathjs is optional + * @returns {ObjectNode} + */ + static fromJSON(json) { + return new ObjectNode(json.properties); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + const entries = []; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + entries.push('' + (0, _string.escape)(key) + '' + '' + ':' + this.properties[key].toHTML(options)); + } + } + return '{' + entries.join(',') + '}'; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const entries = []; + for (const key in this.properties) { + if ((0, _object.hasOwnProperty)(this.properties, key)) { + entries.push('\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\'); + } + } + const tex = '\\left\\{\\begin{array}{ll}' + entries.join('\n') + '\\end{array}\\right\\}'; + return tex; + } + } + (0, _defineProperty2.default)(ObjectNode, "name", name); + return ObjectNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js new file mode 100644 index 0000000..c1d8bdd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js @@ -0,0 +1,636 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createOperatorNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _scope = require("../../utils/scope.js"); +var _string = require("../../utils/string.js"); +var _customs = require("../../utils/customs.js"); +var _operators = require("../operators.js"); +var _latex = require("../../utils/latex.js"); +var _factory = require("../../utils/factory.js"); +const name = 'OperatorNode'; +const dependencies = ['Node']; +const createOperatorNode = exports.createOperatorNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + /** + * Returns true if the expression starts with a constant, under + * the current parenthesization: + * @param {Node} expression + * @param {string} parenthesis + * @return {boolean} + */ + function startsWithConstant(expr, parenthesis) { + let curNode = expr; + if (parenthesis === 'auto') { + while ((0, _is.isParenthesisNode)(curNode)) curNode = curNode.content; + } + if ((0, _is.isConstantNode)(curNode)) return true; + if ((0, _is.isOperatorNode)(curNode)) { + return startsWithConstant(curNode.args[0], parenthesis); + } + return false; + } + + /** + * Calculate which parentheses are necessary. Gets an OperatorNode + * (which is the root of the tree) and an Array of Nodes + * (this.args) and returns an array where 'true' means that an argument + * has to be enclosed in parentheses whereas 'false' means the opposite. + * + * @param {OperatorNode} root + * @param {string} parenthesis + * @param {Node[]} args + * @param {boolean} latex + * @return {boolean[]} + * @private + */ + function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) { + // precedence of the root OperatorNode + const precedence = (0, _operators.getPrecedence)(root, parenthesis, implicit); + const associativity = (0, _operators.getAssociativity)(root, parenthesis); + if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') { + return args.map(function (arg) { + switch (arg.getContent().type) { + // Nodes that don't need extra parentheses + case 'ArrayNode': + case 'ConstantNode': + case 'SymbolNode': + case 'ParenthesisNode': + return false; + default: + return true; + } + }); + } + let result; + switch (args.length) { + case 0: + result = []; + break; + case 1: + // unary operators + { + // precedence of the operand + const operandPrecedence = (0, _operators.getPrecedence)(args[0], parenthesis, implicit, root); + + // handle special cases for LaTeX, where some of the parentheses aren't needed + if (latex && operandPrecedence !== null) { + let operandIdentifier; + let rootIdentifier; + if (parenthesis === 'keep') { + operandIdentifier = args[0].getIdentifier(); + rootIdentifier = root.getIdentifier(); + } else { + // Ignore Parenthesis Nodes when not in 'keep' mode + operandIdentifier = args[0].getContent().getIdentifier(); + rootIdentifier = root.getContent().getIdentifier(); + } + if (_operators.properties[precedence][rootIdentifier].latexLeftParens === false) { + result = [false]; + break; + } + if (_operators.properties[operandPrecedence][operandIdentifier].latexParens === false) { + result = [false]; + break; + } + } + if (operandPrecedence === null) { + // if the operand has no defined precedence, no parens are needed + result = [false]; + break; + } + if (operandPrecedence <= precedence) { + // if the operands precedence is lower, parens are needed + result = [true]; + break; + } + + // otherwise, no parens needed + result = [false]; + } + break; + case 2: + // binary operators + { + let lhsParens; // left hand side needs parenthesis? + // precedence of the left hand side + const lhsPrecedence = (0, _operators.getPrecedence)(args[0], parenthesis, implicit, root); + // is the root node associative with the left hand side + const assocWithLhs = (0, _operators.isAssociativeWith)(root, args[0], parenthesis); + if (lhsPrecedence === null) { + // if the left hand side has no defined precedence, no parens are needed + // FunctionNode for example + lhsParens = false; + } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) { + // In case of equal precedence, if the root node is left associative + // parens are **never** necessary for the left hand side. + // If it is right associative however, parens are necessary + // if the root node isn't associative with the left hand side + lhsParens = true; + } else if (lhsPrecedence < precedence) { + lhsParens = true; + } else { + lhsParens = false; + } + let rhsParens; // right hand side needs parenthesis? + // precedence of the right hand side + const rhsPrecedence = (0, _operators.getPrecedence)(args[1], parenthesis, implicit, root); + // is the root node associative with the right hand side? + const assocWithRhs = (0, _operators.isAssociativeWith)(root, args[1], parenthesis); + if (rhsPrecedence === null) { + // if the right hand side has no defined precedence, no parens are needed + // FunctionNode for example + rhsParens = false; + } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) { + // In case of equal precedence, if the root node is right associative + // parens are **never** necessary for the right hand side. + // If it is left associative however, parens are necessary + // if the root node isn't associative with the right hand side + rhsParens = true; + } else if (rhsPrecedence < precedence) { + rhsParens = true; + } else { + rhsParens = false; + } + + // handle special cases for LaTeX, where some of the parentheses aren't needed + if (latex) { + let rootIdentifier; + let lhsIdentifier; + let rhsIdentifier; + if (parenthesis === 'keep') { + rootIdentifier = root.getIdentifier(); + lhsIdentifier = root.args[0].getIdentifier(); + rhsIdentifier = root.args[1].getIdentifier(); + } else { + // Ignore ParenthesisNodes when not in 'keep' mode + rootIdentifier = root.getContent().getIdentifier(); + lhsIdentifier = root.args[0].getContent().getIdentifier(); + rhsIdentifier = root.args[1].getContent().getIdentifier(); + } + if (lhsPrecedence !== null) { + if (_operators.properties[precedence][rootIdentifier].latexLeftParens === false) { + lhsParens = false; + } + if (_operators.properties[lhsPrecedence][lhsIdentifier].latexParens === false) { + lhsParens = false; + } + } + if (rhsPrecedence !== null) { + if (_operators.properties[precedence][rootIdentifier].latexRightParens === false) { + rhsParens = false; + } + if (_operators.properties[rhsPrecedence][rhsIdentifier].latexParens === false) { + rhsParens = false; + } + } + } + result = [lhsParens, rhsParens]; + } + break; + default: + if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') { + result = args.map(function (arg) { + const argPrecedence = (0, _operators.getPrecedence)(arg, parenthesis, implicit, root); + const assocWithArg = (0, _operators.isAssociativeWith)(root, arg, parenthesis); + const argAssociativity = (0, _operators.getAssociativity)(arg, parenthesis); + if (argPrecedence === null) { + // if the argument has no defined precedence, no parens are needed + return false; + } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) { + return true; + } else if (argPrecedence < precedence) { + return true; + } + return false; + }); + } + break; + } + + // Handles an edge case of parentheses with implicit multiplication + // of ConstantNode. + // In that case, parenthesize ConstantNodes that follow an unparenthesized + // expression, even though they normally wouldn't be printed. + if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') { + for (let i = 1; i < result.length; ++i) { + if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !(0, _is.isParenthesisNode)(args[i - 1]))) { + result[i] = true; + } + } + } + return result; + } + class OperatorNode extends Node { + /** + * @constructor OperatorNode + * @extends {Node} + * An operator with two arguments, like 2+3 + * + * @param {string} op Operator name, for example '+' + * @param {string} fn Function name, for example 'add' + * @param {Node[]} args Operator arguments + * @param {boolean} [implicit] Is this an implicit multiplication? + * @param {boolean} [isPercentage] Is this an percentage Operation? + */ + constructor(op, fn, args, implicit, isPercentage) { + super(); + // validate input + if (typeof op !== 'string') { + throw new TypeError('string expected for parameter "op"'); + } + if (typeof fn !== 'string') { + throw new TypeError('string expected for parameter "fn"'); + } + if (!Array.isArray(args) || !args.every(_is.isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "args"'); + } + this.implicit = implicit === true; + this.isPercentage = isPercentage === true; + this.op = op; + this.fn = fn; + this.args = args || []; + } + get type() { + return name; + } + get isOperatorNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // validate fn + if (typeof this.fn !== 'string' || !(0, _customs.isSafeMethod)(math, this.fn)) { + if (!math[this.fn]) { + throw new Error('Function ' + this.fn + ' missing in provided namespace "math"'); + } else { + throw new Error('No access to function "' + this.fn + '"'); + } + } + const fn = (0, _customs.getSafeProperty)(math, this.fn); + const evalArgs = (0, _array.map)(this.args, function (arg) { + return arg._compile(math, argNames); + }); + if (typeof fn === 'function' && fn.rawArgs === true) { + // pass unevaluated parameters (nodes) to the function + // "raw" evaluation + const rawArgs = this.args; + return function evalOperatorNode(scope, args, context) { + return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args)); + }; + } else if (evalArgs.length === 1) { + const evalArg0 = evalArgs[0]; + return function evalOperatorNode(scope, args, context) { + return fn(evalArg0(scope, args, context)); + }; + } else if (evalArgs.length === 2) { + const evalArg0 = evalArgs[0]; + const evalArg1 = evalArgs[1]; + return function evalOperatorNode(scope, args, context) { + return fn(evalArg0(scope, args, context), evalArg1(scope, args, context)); + }; + } else { + return function evalOperatorNode(scope, args, context) { + return fn.apply(null, (0, _array.map)(evalArgs, function (evalArg) { + return evalArg(scope, args, context); + })); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (let i = 0; i < this.args.length; i++) { + callback(this.args[i], 'args[' + i + ']', this); + } + } + + /** + * Create a new OperatorNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {OperatorNode} Returns a transformed copy of the node + */ + map(callback) { + const args = []; + for (let i = 0; i < this.args.length; i++) { + args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this)); + } + return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage); + } + + /** + * Create a clone of this node, a shallow copy + * @return {OperatorNode} + */ + clone() { + return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage); + } + + /** + * Check whether this is an unary OperatorNode: + * has exactly one argument, like `-a`. + * @return {boolean} + * Returns true when an unary operator node, false otherwise. + */ + isUnary() { + return this.args.length === 1; + } + + /** + * Check whether this is a binary OperatorNode: + * has exactly two arguments, like `a + b`. + * @return {boolean} + * Returns true when a binary operator node, false otherwise. + */ + isBinary() { + return this.args.length === 2; + } + + /** + * Get string representation. + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const implicit = options && options.implicit ? options.implicit : 'hide'; + const args = this.args; + const parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false); + if (args.length === 1) { + // unary operators + const assoc = (0, _operators.getAssociativity)(this, parenthesis); + let operand = args[0].toString(options); + if (parens[0]) { + operand = '(' + operand + ')'; + } + + // for example for "not", we want a space between operand and argument + const opIsNamed = /[a-zA-Z]+/.test(this.op); + if (assoc === 'right') { + // prefix operator + return this.op + (opIsNamed ? ' ' : '') + operand; + } else if (assoc === 'left') { + // postfix + return operand + (opIsNamed ? ' ' : '') + this.op; + } + + // fall back to postfix + return operand + this.op; + } else if (args.length === 2) { + let lhs = args[0].toString(options); // left hand side + let rhs = args[1].toString(options); // right hand side + if (parens[0]) { + // left hand side in parenthesis? + lhs = '(' + lhs + ')'; + } + if (parens[1]) { + // right hand side in parenthesis? + rhs = '(' + rhs + ')'; + } + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return lhs + ' ' + rhs; + } + return lhs + ' ' + this.op + ' ' + rhs; + } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + const stringifiedArgs = args.map(function (arg, index) { + arg = arg.toString(options); + if (parens[index]) { + // put in parenthesis? + arg = '(' + arg + ')'; + } + return arg; + }); + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return stringifiedArgs.join(' '); + } + return stringifiedArgs.join(' ' + this.op + ' '); + } else { + // fallback to formatting as a function call + return this.fn + '(' + this.args.join(', ') + ')'; + } + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + op: this.op, + fn: this.fn, + args: this.args, + implicit: this.implicit, + isPercentage: this.isPercentage + }; + } + + /** + * Instantiate an OperatorNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "OperatorNode", + * "op": "+", "fn": "add", "args": [...], + * "implicit": false, + * "isPercentage":false} + * ``` + * where mathjs is optional + * @returns {OperatorNode} + */ + static fromJSON(json) { + return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage); + } + + /** + * Get HTML representation. + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const implicit = options && options.implicit ? options.implicit : 'hide'; + const args = this.args; + const parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false); + if (args.length === 1) { + // unary operators + const assoc = (0, _operators.getAssociativity)(this, parenthesis); + let operand = args[0].toHTML(options); + if (parens[0]) { + operand = '(' + operand + ')'; + } + if (assoc === 'right') { + // prefix operator + return '' + (0, _string.escape)(this.op) + '' + operand; + } else { + // postfix when assoc === 'left' or undefined + return operand + '' + (0, _string.escape)(this.op) + ''; + } + } else if (args.length === 2) { + // binary operatoes + let lhs = args[0].toHTML(options); // left hand side + let rhs = args[1].toHTML(options); // right hand side + if (parens[0]) { + // left hand side in parenthesis? + lhs = '(' + lhs + ')'; + } + if (parens[1]) { + // right hand side in parenthesis? + rhs = '(' + rhs + ')'; + } + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return lhs + '' + rhs; + } + return lhs + '' + (0, _string.escape)(this.op) + '' + rhs; + } else { + const stringifiedArgs = args.map(function (arg, index) { + arg = arg.toHTML(options); + if (parens[index]) { + // put in parenthesis? + arg = '(' + arg + ')'; + } + return arg; + }); + if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return stringifiedArgs.join(''); + } + return stringifiedArgs.join('' + (0, _string.escape)(this.op) + ''); + } else { + // fallback to formatting as a function call + return '' + (0, _string.escape)(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')'; + } + } + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const implicit = options && options.implicit ? options.implicit : 'hide'; + const args = this.args; + const parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true); + let op = _latex.latexOperators[this.fn]; + op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op + + if (args.length === 1) { + // unary operators + const assoc = (0, _operators.getAssociativity)(this, parenthesis); + let operand = args[0].toTex(options); + if (parens[0]) { + operand = `\\left(${operand}\\right)`; + } + if (assoc === 'right') { + // prefix operator + return op + operand; + } else if (assoc === 'left') { + // postfix operator + return operand + op; + } + + // fall back to postfix + return operand + op; + } else if (args.length === 2) { + // binary operators + const lhs = args[0]; // left hand side + let lhsTex = lhs.toTex(options); + if (parens[0]) { + lhsTex = `\\left(${lhsTex}\\right)`; + } + const rhs = args[1]; // right hand side + let rhsTex = rhs.toTex(options); + if (parens[1]) { + rhsTex = `\\left(${rhsTex}\\right)`; + } + + // handle some exceptions (due to the way LaTeX works) + let lhsIdentifier; + if (parenthesis === 'keep') { + lhsIdentifier = lhs.getIdentifier(); + } else { + // Ignore ParenthesisNodes if in 'keep' mode + lhsIdentifier = lhs.getContent().getIdentifier(); + } + switch (this.getIdentifier()) { + case 'OperatorNode:divide': + // op contains '\\frac' at this point + return op + '{' + lhsTex + '}' + '{' + rhsTex + '}'; + case 'OperatorNode:pow': + lhsTex = '{' + lhsTex + '}'; + rhsTex = '{' + rhsTex + '}'; + switch (lhsIdentifier) { + case 'ConditionalNode': // + case 'OperatorNode:divide': + lhsTex = `\\left(${lhsTex}\\right)`; + } + break; + case 'OperatorNode:multiply': + if (this.implicit && implicit === 'hide') { + return lhsTex + '~' + rhsTex; + } + } + return lhsTex + op + rhsTex; + } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + const texifiedArgs = args.map(function (arg, index) { + arg = arg.toTex(options); + if (parens[index]) { + arg = `\\left(${arg}\\right)`; + } + return arg; + }); + if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') { + return texifiedArgs.join('~'); + } + return texifiedArgs.join(op); + } else { + // fall back to formatting as a function call + // as this is a fallback, it doesn't use + // fancy function names + return '\\mathrm{' + this.fn + '}\\left(' + args.map(function (arg) { + return arg.toTex(options); + }).join(',') + '\\right)'; + } + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type + ':' + this.fn; + } + } + (0, _defineProperty2.default)(OperatorNode, "name", name); + return OperatorNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js new file mode 100644 index 0000000..f618575 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js @@ -0,0 +1,159 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createParenthesisNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'ParenthesisNode'; +const dependencies = ['Node']; +const createParenthesisNode = exports.createParenthesisNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + class ParenthesisNode extends Node { + /** + * @constructor ParenthesisNode + * @extends {Node} + * A parenthesis node describes manual parenthesis from the user input + * @param {Node} content + * @extends {Node} + */ + constructor(content) { + super(); + // validate input + if (!(0, _is.isNode)(content)) { + throw new TypeError('Node expected for parameter "content"'); + } + this.content = content; + } + get type() { + return name; + } + get isParenthesisNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + return this.content._compile(math, argNames); + } + + /** + * Get the content of the current Node. + * @return {Node} content + * @override + **/ + getContent() { + return this.content.getContent(); + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.content, 'content', this); + } + + /** + * Create a new ParenthesisNode whose child is the result of calling + * the provided callback function on the child of this node. + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {ParenthesisNode} Returns a clone of the node + */ + map(callback) { + const content = callback(this.content, 'content', this); + return new ParenthesisNode(content); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ParenthesisNode} + */ + clone() { + return new ParenthesisNode(this.content); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return '(' + this.content.toString(options) + ')'; + } + return this.content.toString(options); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + content: this.content + }; + } + + /** + * Instantiate an ParenthesisNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ParenthesisNode", "content": ...}`, + * where mathjs is optional + * @returns {ParenthesisNode} + */ + static fromJSON(json) { + return new ParenthesisNode(json.content); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return '(' + this.content.toHTML(options) + ')'; + } + return this.content.toHTML(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + * @override + */ + _toTex(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return `\\left(${this.content.toTex(options)}\\right)`; + } + return this.content.toTex(options); + } + } + (0, _defineProperty2.default)(ParenthesisNode, "name", name); + return ParenthesisNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js new file mode 100644 index 0000000..8d4c09b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js @@ -0,0 +1,257 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRangeNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _operators = require("../operators.js"); +const name = 'RangeNode'; +const dependencies = ['Node']; +const createRangeNode = exports.createRangeNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + /** + * Calculate the necessary parentheses + * @param {Node} node + * @param {string} parenthesis + * @param {string} implicit + * @return {Object} parentheses + * @private + */ + function calculateNecessaryParentheses(node, parenthesis, implicit) { + const precedence = (0, _operators.getPrecedence)(node, parenthesis, implicit); + const parens = {}; + const startPrecedence = (0, _operators.getPrecedence)(node.start, parenthesis, implicit); + parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all'; + if (node.step) { + const stepPrecedence = (0, _operators.getPrecedence)(node.step, parenthesis, implicit); + parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all'; + } + const endPrecedence = (0, _operators.getPrecedence)(node.end, parenthesis, implicit); + parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all'; + return parens; + } + class RangeNode extends Node { + /** + * @constructor RangeNode + * @extends {Node} + * create a range + * @param {Node} start included lower-bound + * @param {Node} end included upper-bound + * @param {Node} [step] optional step + */ + constructor(start, end, step) { + super(); + // validate inputs + if (!(0, _is.isNode)(start)) throw new TypeError('Node expected'); + if (!(0, _is.isNode)(end)) throw new TypeError('Node expected'); + if (step && !(0, _is.isNode)(step)) throw new TypeError('Node expected'); + if (arguments.length > 3) throw new Error('Too many arguments'); + this.start = start; // included lower-bound + this.end = end; // included upper-bound + this.step = step || null; // optional step + } + get type() { + return name; + } + get isRangeNode() { + return true; + } + + /** + * Check whether the RangeNode needs the `end` symbol to be defined. + * This end is the size of the Matrix in current dimension. + * @return {boolean} + */ + needsEnd() { + // find all `end` symbols in this RangeNode + const endSymbols = this.filter(function (node) { + return (0, _is.isSymbolNode)(node) && node.name === 'end'; + }); + return endSymbols.length > 0; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const range = math.range; + const evalStart = this.start._compile(math, argNames); + const evalEnd = this.end._compile(math, argNames); + if (this.step) { + const evalStep = this.step._compile(math, argNames); + return function evalRangeNode(scope, args, context) { + return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context)); + }; + } else { + return function evalRangeNode(scope, args, context) { + return range(evalStart(scope, args, context), evalEnd(scope, args, context)); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.start, 'start', this); + callback(this.end, 'end', this); + if (this.step) { + callback(this.step, 'step', this); + } + } + + /** + * Create a new RangeNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {RangeNode} Returns a transformed copy of the node + */ + map(callback) { + return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {RangeNode} + */ + clone() { + return new RangeNode(this.start, this.end, this.step && this.step); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + + // format string as start:step:stop + let str; + let start = this.start.toString(options); + if (parens.start) { + start = '(' + start + ')'; + } + str = start; + if (this.step) { + let step = this.step.toString(options); + if (parens.step) { + step = '(' + step + ')'; + } + str += ':' + step; + } + let end = this.end.toString(options); + if (parens.end) { + end = '(' + end + ')'; + } + str += ':' + end; + return str; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + start: this.start, + end: this.end, + step: this.step + }; + } + + /** + * Instantiate an RangeNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "RangeNode", "start": ..., "end": ..., "step": ...}`, + * where mathjs is optional + * @returns {RangeNode} + */ + static fromJSON(json) { + return new RangeNode(json.start, json.end, json.step); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + + // format string as start:step:stop + let str; + let start = this.start.toHTML(options); + if (parens.start) { + start = '(' + start + ')'; + } + str = start; + if (this.step) { + let step = this.step.toHTML(options); + if (parens.step) { + step = '(' + step + ')'; + } + str += ':' + step; + } + let end = this.end.toHTML(options); + if (parens.end) { + end = '(' + end + ')'; + } + str += ':' + end; + return str; + } + + /** + * Get LaTeX representation + * @params {Object} options + * @return {string} str + */ + _toTex(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + let str = this.start.toTex(options); + if (parens.start) { + str = `\\left(${str}\\right)`; + } + if (this.step) { + let step = this.step.toTex(options); + if (parens.step) { + step = `\\left(${step}\\right)`; + } + str += ':' + step; + } + let end = this.end.toTex(options); + if (parens.end) { + end = `\\left(${end}\\right)`; + } + str += ':' + end; + return str; + } + } + (0, _defineProperty2.default)(RangeNode, "name", name); + return RangeNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js new file mode 100644 index 0000000..b458007 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js @@ -0,0 +1,205 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRelationalNode = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _operators = require("../operators.js"); +var _string = require("../../utils/string.js"); +var _customs = require("../../utils/customs.js"); +var _latex = require("../../utils/latex.js"); +var _factory = require("../../utils/factory.js"); +const name = 'RelationalNode'; +const dependencies = ['Node']; +const createRelationalNode = exports.createRelationalNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Node + } = _ref; + const operatorMap = { + equal: '==', + unequal: '!=', + smaller: '<', + larger: '>', + smallerEq: '<=', + largerEq: '>=' + }; + class RelationalNode extends Node { + /** + * A node representing a chained conditional expression, such as 'x > y > z' + * + * @param {String[]} conditionals + * An array of conditional operators used to compare the parameters + * @param {Node[]} params + * The parameters that will be compared + * + * @constructor RelationalNode + * @extends {Node} + */ + constructor(conditionals, params) { + super(); + if (!Array.isArray(conditionals)) { + throw new TypeError('Parameter conditionals must be an array'); + } + if (!Array.isArray(params)) { + throw new TypeError('Parameter params must be an array'); + } + if (conditionals.length !== params.length - 1) { + throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals'); + } + this.conditionals = conditionals; + this.params = params; + } + get type() { + return name; + } + get isRelationalNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const self = this; + const compiled = this.params.map(p => p._compile(math, argNames)); + return function evalRelationalNode(scope, args, context) { + let evalLhs; + let evalRhs = compiled[0](scope, args, context); + for (let i = 0; i < self.conditionals.length; i++) { + evalLhs = evalRhs; + evalRhs = compiled[i + 1](scope, args, context); + const condFn = (0, _customs.getSafeProperty)(math, self.conditionals[i]); + if (!condFn(evalLhs, evalRhs)) { + return false; + } + } + return true; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this); + } + + /** + * Create a new RelationalNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {RelationalNode} Returns a transformed copy of the node + */ + map(callback) { + return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this)); + } + + /** + * Create a clone of this node, a shallow copy + * @return {RelationalNode} + */ + clone() { + return new RelationalNode(this.conditionals, this.params); + } + + /** + * Get string representation. + * @param {Object} options + * @return {string} str + */ + _toString(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const precedence = (0, _operators.getPrecedence)(this, parenthesis, options && options.implicit); + const paramStrings = this.params.map(function (p, index) { + const paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options); + }); + let ret = paramStrings[0]; + for (let i = 0; i < this.conditionals.length; i++) { + ret += ' ' + operatorMap[this.conditionals[i]]; + ret += ' ' + paramStrings[i + 1]; + } + return ret; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + conditionals: this.conditionals, + params: this.params + }; + } + + /** + * Instantiate a RelationalNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "RelationalNode", "conditionals": ..., "params": ...}`, + * where mathjs is optional + * @returns {RelationalNode} + */ + static fromJSON(json) { + return new RelationalNode(json.conditionals, json.params); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const precedence = (0, _operators.getPrecedence)(this, parenthesis, options && options.implicit); + const paramStrings = this.params.map(function (p, index) { + const paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options); + }); + let ret = paramStrings[0]; + for (let i = 0; i < this.conditionals.length; i++) { + ret += '' + (0, _string.escape)(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1]; + } + return ret; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + const parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + const precedence = (0, _operators.getPrecedence)(this, parenthesis, options && options.implicit); + const paramStrings = this.params.map(function (p, index) { + const paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\left(' + p.toTex(options) + '\right)' : p.toTex(options); + }); + let ret = paramStrings[0]; + for (let i = 0; i < this.conditionals.length; i++) { + ret += _latex.latexOperators[this.conditionals[i]] + paramStrings[i + 1]; + } + return ret; + } + } + (0, _defineProperty2.default)(RelationalNode, "name", name); + return RelationalNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js new file mode 100644 index 0000000..90aa5d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js @@ -0,0 +1,199 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSymbolNode = void 0; +var _string = require("../../utils/string.js"); +var _customs = require("../../utils/customs.js"); +var _factory = require("../../utils/factory.js"); +var _latex = require("../../utils/latex.js"); +const name = 'SymbolNode'; +const dependencies = ['math', '?Unit', 'Node']; +const createSymbolNode = exports.createSymbolNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + math, + Unit, + Node + } = _ref; + /** + * Check whether some name is a valueless unit like "inch". + * @param {string} name + * @return {boolean} + */ + function isValuelessUnit(name) { + return Unit ? Unit.isValuelessUnit(name) : false; + } + class SymbolNode extends Node { + /** + * @constructor SymbolNode + * @extends {Node} + * A symbol node can hold and resolve a symbol + * @param {string} name + * @extends {Node} + */ + constructor(name) { + super(); + // validate input + if (typeof name !== 'string') { + throw new TypeError('String expected for parameter "name"'); + } + this.name = name; + } + get type() { + return 'SymbolNode'; + } + get isSymbolNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + const name = this.name; + if (argNames[name] === true) { + // this is a FunctionAssignment argument + // (like an x when inside the expression of a function + // assignment `f(x) = ...`) + return function (scope, args, context) { + return (0, _customs.getSafeProperty)(args, name); + }; + } else if (name in math) { + return function (scope, args, context) { + return scope.has(name) ? scope.get(name) : (0, _customs.getSafeProperty)(math, name); + }; + } else { + const isUnit = isValuelessUnit(name); + return function (scope, args, context) { + return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // nothing to do, we don't have any children + } + + /** + * Create a new SymbolNode with children produced by the given callback. + * Trivial since a SymbolNode has no children + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {SymbolNode} Returns a clone of the node + */ + map(callback) { + return this.clone(); + } + + /** + * Throws an error 'Undefined symbol {name}' + * @param {string} name + */ + static onUndefinedSymbol(name) { + throw new Error('Undefined symbol ' + name); + } + + /** + * Create a clone of this node, a shallow copy + * @return {SymbolNode} + */ + clone() { + return new SymbolNode(this.name); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + return this.name; + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + const name = (0, _string.escape)(this.name); + if (name === 'true' || name === 'false') { + return '' + name + ''; + } else if (name === 'i') { + return '' + name + ''; + } else if (name === 'Infinity') { + return '' + name + ''; + } else if (name === 'NaN') { + return '' + name + ''; + } else if (name === 'null') { + return '' + name + ''; + } else if (name === 'undefined') { + return '' + name + ''; + } + return '' + name + ''; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: 'SymbolNode', + name: this.name + }; + } + + /** + * Instantiate a SymbolNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "SymbolNode", name: "x"}`, + * where mathjs is optional + * @returns {SymbolNode} + */ + static fromJSON(json) { + return new SymbolNode(json.name); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + * @override + */ + _toTex(options) { + let isUnit = false; + if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) { + isUnit = true; + } + const symbol = (0, _latex.toSymbol)(this.name, isUnit); + if (symbol[0] === '\\') { + // no space needed if the symbol starts with '\' + return symbol; + } + // the space prevents symbols from breaking stuff like '\cdot' + // if it's written right before the symbol + return ' ' + symbol; + } + } + return SymbolNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/access.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/access.js new file mode 100644 index 0000000..1e7b9a0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/access.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.accessFactory = accessFactory; +var _errorTransform = require("../../transform/utils/errorTransform.js"); +var _customs = require("../../../utils/customs.js"); +function accessFactory(_ref) { + let { + subset + } = _ref; + /** + * Retrieve part of an object: + * + * - Retrieve a property from an object + * - Retrieve a part of a string + * - Retrieve a matrix subset + * + * @param {Object | Array | Matrix | string} object + * @param {Index} index + * @return {Object | Array | Matrix | string} Returns the subset + */ + return function access(object, index) { + try { + if (Array.isArray(object)) { + return subset(object, index); + } else if (object && typeof object.subset === 'function') { + // Matrix + return object.subset(index); + } else if (typeof object === 'string') { + // TODO: move getStringSubset into a separate util file, use that + return subset(object, index); + } else if (typeof object === 'object') { + if (!index.isObjectProperty()) { + throw new TypeError('Cannot apply a numeric index as object property'); + } + return (0, _customs.getSafeProperty)(object, index.getObjectProperty()); + } else { + throw new TypeError('Cannot apply index: unsupported type of object'); + } + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js new file mode 100644 index 0000000..1e86dab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assignFactory = assignFactory; +var _errorTransform = require("../../transform/utils/errorTransform.js"); +var _customs = require("../../../utils/customs.js"); +function assignFactory(_ref) { + let { + subset, + matrix + } = _ref; + /** + * Replace part of an object: + * + * - Assign a property to an object + * - Replace a part of a string + * - Replace a matrix subset + * + * @param {Object | Array | Matrix | string} object + * @param {Index} index + * @param {*} value + * @return {Object | Array | Matrix | string} Returns the original object + * except in case of a string + */ + // TODO: change assign to return the value instead of the object + return function assign(object, index, value) { + try { + if (Array.isArray(object)) { + const result = matrix(object).subset(index, value).valueOf(); + + // shallow copy all (updated) items into the original array + result.forEach((item, index) => { + object[index] = item; + }); + return object; + } else if (object && typeof object.subset === 'function') { + // Matrix + return object.subset(index, value); + } else if (typeof object === 'string') { + // TODO: move setStringSubset into a separate util file, use that + return subset(object, index, value); + } else if (typeof object === 'object') { + if (!index.isObjectProperty()) { + throw TypeError('Cannot apply a numeric index as object property'); + } + (0, _customs.setSafeProperty)(object, index.getObjectProperty(), value); + return object; + } else { + throw new TypeError('Cannot apply index: unsupported type of object'); + } + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/operators.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/operators.js new file mode 100644 index 0000000..cf75da4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/operators.js @@ -0,0 +1,388 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getAssociativity = getAssociativity; +exports.getOperator = getOperator; +exports.getPrecedence = getPrecedence; +exports.isAssociativeWith = isAssociativeWith; +exports.properties = void 0; +var _object = require("../utils/object.js"); +var _is = require("../utils/is.js"); +// list of identifiers of nodes in order of their precedence +// also contains information about left/right associativity +// and which other operator the operator is associative with +// Example: +// addition is associative with addition and subtraction, because: +// (a+b)+c=a+(b+c) +// (a+b)-c=a+(b-c) +// +// postfix operators are left associative, prefix operators +// are right associative +// +// It's also possible to set the following properties: +// latexParens: if set to false, this node doesn't need to be enclosed +// in parentheses when using LaTeX +// latexLeftParens: if set to false, this !OperatorNode's! +// left argument doesn't need to be enclosed +// in parentheses +// latexRightParens: the same for the right argument + +const properties = exports.properties = [{ + // assignment + AssignmentNode: {}, + FunctionAssignmentNode: {} +}, { + // conditional expression + ConditionalNode: { + latexLeftParens: false, + latexRightParens: false, + latexParens: false + // conditionals don't need parentheses in LaTeX because + // they are 2 dimensional + } +}, { + // logical or + 'OperatorNode:or': { + op: 'or', + associativity: 'left', + associativeWith: [] + } +}, { + // logical xor + 'OperatorNode:xor': { + op: 'xor', + associativity: 'left', + associativeWith: [] + } +}, { + // logical and + 'OperatorNode:and': { + op: 'and', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise or + 'OperatorNode:bitOr': { + op: '|', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise xor + 'OperatorNode:bitXor': { + op: '^|', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise and + 'OperatorNode:bitAnd': { + op: '&', + associativity: 'left', + associativeWith: [] + } +}, { + // relational operators + 'OperatorNode:equal': { + op: '==', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:unequal': { + op: '!=', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:smaller': { + op: '<', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:larger': { + op: '>', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:smallerEq': { + op: '<=', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:largerEq': { + op: '>=', + associativity: 'left', + associativeWith: [] + }, + RelationalNode: { + associativity: 'left', + associativeWith: [] + } +}, { + // bitshift operators + 'OperatorNode:leftShift': { + op: '<<', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:rightArithShift': { + op: '>>', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:rightLogShift': { + op: '>>>', + associativity: 'left', + associativeWith: [] + } +}, { + // unit conversion + 'OperatorNode:to': { + op: 'to', + associativity: 'left', + associativeWith: [] + } +}, { + // range + RangeNode: {} +}, { + // addition, subtraction + 'OperatorNode:add': { + op: '+', + associativity: 'left', + associativeWith: ['OperatorNode:add', 'OperatorNode:subtract'] + }, + 'OperatorNode:subtract': { + op: '-', + associativity: 'left', + associativeWith: [] + } +}, { + // multiply, divide, modulus + 'OperatorNode:multiply': { + op: '*', + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide'] + }, + 'OperatorNode:divide': { + op: '/', + associativity: 'left', + associativeWith: [], + latexLeftParens: false, + latexRightParens: false, + latexParens: false + // fractions don't require parentheses because + // they're 2 dimensional, so parens aren't needed + // in LaTeX + }, + 'OperatorNode:dotMultiply': { + op: '.*', + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide'] + }, + 'OperatorNode:dotDivide': { + op: './', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:mod': { + op: 'mod', + associativity: 'left', + associativeWith: [] + } +}, { + // Repeat multiplication for implicit multiplication + 'OperatorNode:multiply': { + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide'] + } +}, { + // unary prefix operators + 'OperatorNode:unaryPlus': { + op: '+', + associativity: 'right' + }, + 'OperatorNode:unaryMinus': { + op: '-', + associativity: 'right' + }, + 'OperatorNode:bitNot': { + op: '~', + associativity: 'right' + }, + 'OperatorNode:not': { + op: 'not', + associativity: 'right' + } +}, { + // exponentiation + 'OperatorNode:pow': { + op: '^', + associativity: 'right', + associativeWith: [], + latexRightParens: false + // the exponent doesn't need parentheses in + // LaTeX because it's 2 dimensional + // (it's on top) + }, + 'OperatorNode:dotPow': { + op: '.^', + associativity: 'right', + associativeWith: [] + } +}, { + // factorial + 'OperatorNode:factorial': { + op: '!', + associativity: 'left' + } +}, { + // matrix transpose + 'OperatorNode:ctranspose': { + op: "'", + associativity: 'left' + } +}]; + +/** + * Returns the first non-parenthesis internal node, but only + * when the 'parenthesis' option is unset or auto. + * @param {Node} _node + * @param {string} parenthesis + * @return {Node} + */ +function unwrapParen(_node, parenthesis) { + if (!parenthesis || parenthesis !== 'auto') return _node; + let node = _node; + while ((0, _is.isParenthesisNode)(node)) node = node.content; + return node; +} + +/** + * Get the precedence of a Node. + * Higher number for higher precedence, starting with 0. + * Returns null if the precedence is undefined. + * + * @param {Node} _node + * @param {string} parenthesis + * @param {string} implicit + * @param {Node} parent (for determining context for implicit multiplication) + * @return {number | null} + */ +function getPrecedence(_node, parenthesis, implicit, parent) { + let node = _node; + if (parenthesis !== 'keep') { + // ParenthesisNodes are only ignored when not in 'keep' mode + node = _node.getContent(); + } + const identifier = node.getIdentifier(); + let precedence = null; + for (let i = 0; i < properties.length; i++) { + if (identifier in properties[i]) { + precedence = i; + break; + } + } + // Bump up precedence of implicit multiplication, except when preceded + // by a "Rule 2" fraction ( [unaryOp]constant / constant ) + if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') { + const leftArg = unwrapParen(node.args[0], parenthesis); + if (!((0, _is.isConstantNode)(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && (0, _is.rule2Node)(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && (0, _is.rule2Node)(unwrapParen(leftArg.args[0], parenthesis)) && (0, _is.isConstantNode)(unwrapParen(leftArg.args[1])))) { + precedence += 1; + } + } + return precedence; +} + +/** + * Get the associativity of an operator (left or right). + * Returns a string containing 'left' or 'right' or null if + * the associativity is not defined. + * + * @param {Node} _node + * @param {string} parenthesis + * @return {string|null} + * @throws {Error} + */ +function getAssociativity(_node, parenthesis) { + let node = _node; + if (parenthesis !== 'keep') { + // ParenthesisNodes are only ignored when not in 'keep' mode + node = _node.getContent(); + } + const identifier = node.getIdentifier(); + const index = getPrecedence(node, parenthesis); + if (index === null) { + // node isn't in the list + return null; + } + const property = properties[index][identifier]; + if ((0, _object.hasOwnProperty)(property, 'associativity')) { + if (property.associativity === 'left') { + return 'left'; + } + if (property.associativity === 'right') { + return 'right'; + } + // associativity is invalid + throw Error('\'' + identifier + '\' has the invalid associativity \'' + property.associativity + '\'.'); + } + + // associativity is undefined + return null; +} + +/** + * Check if an operator is associative with another operator. + * Returns either true or false or null if not defined. + * + * @param {Node} nodeA + * @param {Node} nodeB + * @param {string} parenthesis + * @return {boolean | null} + */ +function isAssociativeWith(nodeA, nodeB, parenthesis) { + // ParenthesisNodes are only ignored when not in 'keep' mode + const a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA; + const b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB; + const identifierA = a.getIdentifier(); + const identifierB = b.getIdentifier(); + const index = getPrecedence(a, parenthesis); + if (index === null) { + // node isn't in the list + return null; + } + const property = properties[index][identifierA]; + if ((0, _object.hasOwnProperty)(property, 'associativeWith') && property.associativeWith instanceof Array) { + for (let i = 0; i < property.associativeWith.length; i++) { + if (property.associativeWith[i] === identifierB) { + return true; + } + } + return false; + } + + // associativeWith is not defined + return null; +} + +/** + * Get the operator associated with a function name. + * Returns a string with the operator symbol, or null if the + * input is not the name of a function associated with an + * operator. + * + * @param {string} Function name + * @return {string | null} Associated operator symbol, if any + */ +function getOperator(fn) { + const identifier = 'OperatorNode:' + fn; + for (const group of properties) { + if (identifier in group) { + return group[identifier].op; + } + } + return null; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/parse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/parse.js new file mode 100644 index 0000000..0d35cec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/parse.js @@ -0,0 +1,1641 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createParse = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _factory = require("../utils/factory.js"); +var _is = require("../utils/is.js"); +var _collection = require("../utils/collection.js"); +var _number = require("../utils/number.js"); +var _object = require("../utils/object.js"); +const name = 'parse'; +const dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode']; +const createParse = exports.createParse = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + numeric, + config, + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode + } = _ref; + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(). + * + * Note the evaluating arbitrary expressions may involve security risks, + * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. + * + * Syntax: + * + * math.parse(expr) + * math.parse(expr, options) + * math.parse([expr1, expr2, expr3, ...]) + * math.parse([expr1, expr2, expr3, ...], options) + * + * Example: + * + * const node1 = math.parse('sqrt(3^2 + 4^2)') + * node1.compile().evaluate() // 5 + * + * let scope = {a:3, b:4} + * const node2 = math.parse('a * b') // 12 + * const code2 = node2.compile() + * code2.evaluate(scope) // 12 + * scope.a = 5 + * code2.evaluate(scope) // 20 + * + * const nodes = math.parse(['a = 3', 'b = 4', 'a * b']) + * nodes[2].compile().evaluate() // 12 + * + * See also: + * + * evaluate, compile + * + * @param {string | string[] | Matrix} expr Expression to be parsed + * @param {{nodes: Object}} [options] Available options: + * - `nodes` a set of custom nodes + * @return {Node | Node[]} node + * @throws {Error} + */ + const parse = typed(name, { + string: function (expression) { + return parseStart(expression, {}); + }, + 'Array | Matrix': function (expressions) { + return parseMultiple(expressions, {}); + }, + 'string, Object': function (expression, options) { + const extraNodes = options.nodes !== undefined ? options.nodes : {}; + return parseStart(expression, extraNodes); + }, + 'Array | Matrix, Object': parseMultiple + }); + function parseMultiple(expressions) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const extraNodes = options.nodes !== undefined ? options.nodes : {}; + + // parse an array or matrix with expressions + return (0, _collection.deepMap)(expressions, function (elem) { + if (typeof elem !== 'string') throw new TypeError('String expected'); + return parseStart(elem, extraNodes); + }); + } + + // token types enumeration + const TOKENTYPE = { + NULL: 0, + DELIMITER: 1, + NUMBER: 2, + SYMBOL: 3, + UNKNOWN: 4 + }; + + // map with all delimiters + const DELIMITERS = { + ',': true, + '(': true, + ')': true, + '[': true, + ']': true, + '{': true, + '}': true, + '"': true, + '\'': true, + ';': true, + '+': true, + '-': true, + '*': true, + '.*': true, + '/': true, + './': true, + '%': true, + '^': true, + '.^': true, + '~': true, + '!': true, + '&': true, + '|': true, + '^|': true, + '=': true, + ':': true, + '?': true, + '==': true, + '!=': true, + '<': true, + '>': true, + '<=': true, + '>=': true, + '<<': true, + '>>': true, + '>>>': true + }; + + // map with all named delimiters + const NAMED_DELIMITERS = { + mod: true, + to: true, + in: true, + and: true, + xor: true, + or: true, + not: true + }; + const CONSTANTS = { + true: true, + false: false, + null: null, + undefined + }; + const NUMERIC_CONSTANTS = ['NaN', 'Infinity']; + const ESCAPE_CHARACTERS = { + '"': '"', + "'": "'", + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + // note that \u is handled separately in parseStringToken() + }; + function initialState() { + return { + extraNodes: {}, + // current extra nodes, must be careful not to mutate + expression: '', + // current expression + comment: '', + // last parsed comment + index: 0, + // current index in expr + token: '', + // current token + tokenType: TOKENTYPE.NULL, + // type of the token + nestingLevel: 0, + // level of nesting inside parameters, used to ignore newline characters + conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here + }; + } + + /** + * View upto `length` characters of the expression starting at the current character. + * + * @param {Object} state + * @param {number} [length=1] Number of characters to view + * @returns {string} + * @private + */ + function currentString(state, length) { + return state.expression.substr(state.index, length); + } + + /** + * View the current character. Returns '' if end of expression is reached. + * + * @param {Object} state + * @returns {string} + * @private + */ + function currentCharacter(state) { + return currentString(state, 1); + } + + /** + * Get the next character from the expression. + * The character is stored into the char c. If the end of the expression is + * reached, the function puts an empty string in c. + * @private + */ + function next(state) { + state.index++; + } + + /** + * Preview the previous character from the expression. + * @return {string} cNext + * @private + */ + function prevCharacter(state) { + return state.expression.charAt(state.index - 1); + } + + /** + * Preview the next character from the expression. + * @return {string} cNext + * @private + */ + function nextCharacter(state) { + return state.expression.charAt(state.index + 1); + } + + /** + * Get next token in the current string expr. + * The token and token type are available as token and tokenType + * @private + */ + function getToken(state) { + state.tokenType = TOKENTYPE.NULL; + state.token = ''; + state.comment = ''; + + // skip over ignored characters: + while (true) { + // comments: + if (currentCharacter(state) === '#') { + while (currentCharacter(state) !== '\n' && currentCharacter(state) !== '') { + state.comment += currentCharacter(state); + next(state); + } + } + // whitespace: space, tab, and newline when inside parameters + if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) { + next(state); + } else { + break; + } + } + + // check for end of expression + if (currentCharacter(state) === '') { + // token is still empty + state.tokenType = TOKENTYPE.DELIMITER; + return; + } + + // check for new line character + if (currentCharacter(state) === '\n' && !state.nestingLevel) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = currentCharacter(state); + next(state); + return; + } + const c1 = currentCharacter(state); + const c2 = currentString(state, 2); + const c3 = currentString(state, 3); + if (c3.length === 3 && DELIMITERS[c3]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c3; + next(state); + next(state); + next(state); + return; + } + + // check for delimiters consisting of 2 characters + if (c2.length === 2 && DELIMITERS[c2]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c2; + next(state); + next(state); + return; + } + + // check for delimiters consisting of 1 character + if (DELIMITERS[c1]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c1; + next(state); + return; + } + + // check for a number + if (parse.isDigitDot(c1)) { + state.tokenType = TOKENTYPE.NUMBER; + + // check for binary, octal, or hex + const c2 = currentString(state, 2); + if (c2 === '0b' || c2 === '0o' || c2 === '0x') { + state.token += currentCharacter(state); + next(state); + state.token += currentCharacter(state); + next(state); + while (parse.isHexDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (currentCharacter(state) === '.') { + // this number has a radix point + state.token += '.'; + next(state); + // get the digits after the radix + while (parse.isHexDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } else if (currentCharacter(state) === 'i') { + // this number has a word size suffix + state.token += 'i'; + next(state); + // get the word size + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } + return; + } + + // get number, can have a single dot + if (currentCharacter(state) === '.') { + state.token += currentCharacter(state); + next(state); + if (!parse.isDigit(currentCharacter(state))) { + // this is no number, it is just a dot (can be dot notation) + state.tokenType = TOKENTYPE.DELIMITER; + return; + } + } else { + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + // check for exponential notation like "2.3e-4", "1.23e50" or "2e+4" + if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') { + if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') { + state.token += currentCharacter(state); + next(state); + if (currentCharacter(state) === '+' || currentCharacter(state) === '-') { + state.token += currentCharacter(state); + next(state); + } + // Scientific notation MUST be followed by an exponent + if (!parse.isDigit(currentCharacter(state))) { + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) { + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + } else if (nextCharacter(state) === '.') { + next(state); + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + } + return; + } + + // check for variables, functions, named operators + if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) { + while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if ((0, _object.hasOwnProperty)(NAMED_DELIMITERS, state.token)) { + state.tokenType = TOKENTYPE.DELIMITER; + } else { + state.tokenType = TOKENTYPE.SYMBOL; + } + return; + } + + // something unknown is found, wrong characters -> a syntax error + state.tokenType = TOKENTYPE.UNKNOWN; + while (currentCharacter(state) !== '') { + state.token += currentCharacter(state); + next(state); + } + throw createSyntaxError(state, 'Syntax error in part "' + state.token + '"'); + } + + /** + * Get next token and skip newline tokens + */ + function getTokenSkipNewline(state) { + do { + getToken(state); + } while (state.token === '\n'); // eslint-disable-line no-unmodified-loop-condition + } + + /** + * Open parameters. + * New line characters will be ignored until closeParams(state) is called + */ + function openParams(state) { + state.nestingLevel++; + } + + /** + * Close parameters. + * New line characters will no longer be ignored + */ + function closeParams(state) { + state.nestingLevel--; + } + + /** + * Checks whether the current character `c` is a valid alpha character: + * + * - A latin letter (upper or lower case) Ascii: a-z, A-Z + * - An underscore Ascii: _ + * - A dollar sign Ascii: $ + * - A latin letter with accents Unicode: \u00C0 - \u02AF + * - A greek letter Unicode: \u0370 - \u03FF + * - A mathematical alphanumeric symbol Unicode: \u{1D400} - \u{1D7FF} excluding invalid code points + * + * The previous and next characters are needed to determine whether + * this character is part of a unicode surrogate pair. + * + * @param {string} c Current character in the expression + * @param {string} cPrev Previous character + * @param {string} cNext Next character + * @return {boolean} + */ + parse.isAlpha = function isAlpha(c, cPrev, cNext) { + return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c); + }; + + /** + * Test whether a character is a valid latin, greek, or letter-like character + * @param {string} c + * @return {boolean} + */ + parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) { + return /^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(c); + }; + + /** + * Test whether two given 16 bit characters form a surrogate pair of a + * unicode math symbol. + * + * https://unicode-table.com/en/ + * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode + * + * Note: In ES6 will be unicode aware: + * https://stackoverflow.com/questions/280712/javascript-unicode-regexes + * https://mathiasbynens.be/notes/es6-unicode-regex + * + * @param {string} high + * @param {string} low + * @return {boolean} + */ + parse.isValidMathSymbol = function isValidMathSymbol(high, low) { + return /^[\uD835]$/.test(high) && /^[\uDC00-\uDFFF]$/.test(low) && /^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(low); + }; + + /** + * Check whether given character c is a white space character: space, tab, or enter + * @param {string} c + * @param {number} nestingLevel + * @return {boolean} + */ + parse.isWhitespace = function isWhitespace(c, nestingLevel) { + // TODO: also take '\r' carriage return as newline? Or does that give problems on mac? + return c === ' ' || c === '\t' || c === '\n' && nestingLevel > 0; + }; + + /** + * Test whether the character c is a decimal mark (dot). + * This is the case when it's not the start of a delimiter '.*', './', or '.^' + * @param {string} c + * @param {string} cNext + * @return {boolean} + */ + parse.isDecimalMark = function isDecimalMark(c, cNext) { + return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^'; + }; + + /** + * checks if the given char c is a digit or dot + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isDigitDot = function isDigitDot(c) { + return c >= '0' && c <= '9' || c === '.'; + }; + + /** + * checks if the given char c is a digit + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isDigit = function isDigit(c) { + return c >= '0' && c <= '9'; + }; + + /** + * checks if the given char c is a hex digit + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isHexDigit = function isHexDigit(c) { + return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F'; + }; + + /** + * Start of the parse levels below, in order of precedence + * @return {Node} node + * @private + */ + function parseStart(expression, extraNodes) { + const state = initialState(); + (0, _extends2.default)(state, { + expression, + extraNodes + }); + getToken(state); + const node = parseBlock(state); + + // check for garbage at the end of the expression + // an expression ends with a empty character '' and tokenType DELIMITER + if (state.token !== '') { + if (state.tokenType === TOKENTYPE.DELIMITER) { + // user entered a not existing operator like "//" + + // TODO: give hints for aliases, for example with "<>" give as hint " did you mean !== ?" + throw createError(state, 'Unexpected operator ' + state.token); + } else { + throw createSyntaxError(state, 'Unexpected part "' + state.token + '"'); + } + } + return node; + } + + /** + * Parse a block with expressions. Expressions can be separated by a newline + * character '\n', or by a semicolon ';'. In case of a semicolon, no output + * of the preceding line is returned. + * @return {Node} node + * @private + */ + function parseBlock(state) { + let node; + const blocks = []; + let visible; + if (state.token !== '' && state.token !== '\n' && state.token !== ';') { + node = parseAssignment(state); + if (state.comment) { + node.comment = state.comment; + } + } + + // TODO: simplify this loop + while (state.token === '\n' || state.token === ';') { + // eslint-disable-line no-unmodified-loop-condition + if (blocks.length === 0 && node) { + visible = state.token !== ';'; + blocks.push({ + node, + visible + }); + } + getToken(state); + if (state.token !== '\n' && state.token !== ';' && state.token !== '') { + node = parseAssignment(state); + if (state.comment) { + node.comment = state.comment; + } + visible = state.token !== ';'; + blocks.push({ + node, + visible + }); + } + } + if (blocks.length > 0) { + return new BlockNode(blocks); + } else { + if (!node) { + node = new ConstantNode(undefined); + if (state.comment) { + node.comment = state.comment; + } + } + return node; + } + } + + /** + * Assignment of a function or variable, + * - can be a variable like 'a=2.3' + * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]' + * - defining a function like 'f(x) = x^2' + * @return {Node} node + * @private + */ + function parseAssignment(state) { + let name, args, value, valid; + const node = parseConditional(state); + if (state.token === '=') { + if ((0, _is.isSymbolNode)(node)) { + // parse a variable assignment like 'a = 2/3' + name = node.name; + getTokenSkipNewline(state); + value = parseAssignment(state); + return new AssignmentNode(new SymbolNode(name), value); + } else if ((0, _is.isAccessorNode)(node)) { + // parse a matrix subset assignment like 'A[1,2] = 4' + getTokenSkipNewline(state); + value = parseAssignment(state); + return new AssignmentNode(node.object, node.index, value); + } else if ((0, _is.isFunctionNode)(node) && (0, _is.isSymbolNode)(node.fn)) { + // parse function assignment like 'f(x) = x^2' + valid = true; + args = []; + name = node.name; + node.args.forEach(function (arg, index) { + if ((0, _is.isSymbolNode)(arg)) { + args[index] = arg.name; + } else { + valid = false; + } + }); + if (valid) { + getTokenSkipNewline(state); + value = parseAssignment(state); + return new FunctionAssignmentNode(name, args, value); + } + } + throw createSyntaxError(state, 'Invalid left hand side of assignment operator ='); + } + return node; + } + + /** + * conditional operation + * + * condition ? truePart : falsePart + * + * Note: conditional operator is right-associative + * + * @return {Node} node + * @private + */ + function parseConditional(state) { + let node = parseLogicalOr(state); + while (state.token === '?') { + // eslint-disable-line no-unmodified-loop-condition + // set a conditional level, the range operator will be ignored as long + // as conditionalLevel === state.nestingLevel. + const prev = state.conditionalLevel; + state.conditionalLevel = state.nestingLevel; + getTokenSkipNewline(state); + const condition = node; + const trueExpr = parseAssignment(state); + if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected'); + state.conditionalLevel = null; + getTokenSkipNewline(state); + const falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity + + node = new ConditionalNode(condition, trueExpr, falseExpr); + + // restore the previous conditional level + state.conditionalLevel = prev; + } + return node; + } + + /** + * logical or, 'x or y' + * @return {Node} node + * @private + */ + function parseLogicalOr(state) { + let node = parseLogicalXor(state); + while (state.token === 'or') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]); + } + return node; + } + + /** + * logical exclusive or, 'x xor y' + * @return {Node} node + * @private + */ + function parseLogicalXor(state) { + let node = parseLogicalAnd(state); + while (state.token === 'xor') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]); + } + return node; + } + + /** + * logical and, 'x and y' + * @return {Node} node + * @private + */ + function parseLogicalAnd(state) { + let node = parseBitwiseOr(state); + while (state.token === 'and') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]); + } + return node; + } + + /** + * bitwise or, 'x | y' + * @return {Node} node + * @private + */ + function parseBitwiseOr(state) { + let node = parseBitwiseXor(state); + while (state.token === '|') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]); + } + return node; + } + + /** + * bitwise exclusive or (xor), 'x ^| y' + * @return {Node} node + * @private + */ + function parseBitwiseXor(state) { + let node = parseBitwiseAnd(state); + while (state.token === '^|') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]); + } + return node; + } + + /** + * bitwise and, 'x & y' + * @return {Node} node + * @private + */ + function parseBitwiseAnd(state) { + let node = parseRelational(state); + while (state.token === '&') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]); + } + return node; + } + + /** + * Parse a chained conditional, like 'a > b >= c' + * @return {Node} node + */ + function parseRelational(state) { + const params = [parseShift(state)]; + const conditionals = []; + const operators = { + '==': 'equal', + '!=': 'unequal', + '<': 'smaller', + '>': 'larger', + '<=': 'smallerEq', + '>=': 'largerEq' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + // eslint-disable-line no-unmodified-loop-condition + const cond = { + name: state.token, + fn: operators[state.token] + }; + conditionals.push(cond); + getTokenSkipNewline(state); + params.push(parseShift(state)); + } + if (params.length === 1) { + return params[0]; + } else if (params.length === 2) { + return new OperatorNode(conditionals[0].name, conditionals[0].fn, params); + } else { + return new RelationalNode(conditionals.map(c => c.fn), params); + } + } + + /** + * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift + * @return {Node} node + * @private + */ + function parseShift(state) { + let node, name, fn, params; + node = parseConversion(state); + const operators = { + '<<': 'leftShift', + '>>': 'rightArithShift', + '>>>': 'rightLogShift' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + params = [node, parseConversion(state)]; + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * conversion operators 'to' and 'in' + * @return {Node} node + * @private + */ + function parseConversion(state) { + let node, name, fn, params; + node = parseRange(state); + const operators = { + to: 'to', + in: 'to' // alias of 'to' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + if (name === 'in' && state.token === '') { + // end of expression -> this is the unit 'in' ('inch') + node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true); + } else { + // operator 'a to b' or 'a in b' + params = [node, parseRange(state)]; + node = new OperatorNode(name, fn, params); + } + } + return node; + } + + /** + * parse range, "start:end", "start:step:end", ":", "start:", ":end", etc + * @return {Node} node + * @private + */ + function parseRange(state) { + let node; + const params = []; + if (state.token === ':') { + // implicit start=1 (one-based) + node = new ConstantNode(1); + } else { + // explicit start + node = parseAddSubtract(state); + } + if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) { + // we ignore the range operator when a conditional operator is being processed on the same level + params.push(node); + + // parse step and end + while (state.token === ':' && params.length < 3) { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') { + // implicit end + params.push(new SymbolNode('end')); + } else { + // explicit end + params.push(parseAddSubtract(state)); + } + } + if (params.length === 3) { + // params = [start, step, end] + node = new RangeNode(params[0], params[2], params[1]); // start, end, step + } else { + // length === 2 + // params = [start, end] + node = new RangeNode(params[0], params[1]); // start, end + } + } + return node; + } + + /** + * add or subtract + * @return {Node} node + * @private + */ + function parseAddSubtract(state) { + let node, name, fn, params; + node = parseMultiplyDivide(state); + const operators = { + '+': 'add', + '-': 'subtract' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + const rightNode = parseMultiplyDivide(state); + if (rightNode.isPercentage) { + params = [node, new OperatorNode('*', 'multiply', [node, rightNode])]; + } else { + params = [node, rightNode]; + } + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * multiply, divide + * @return {Node} node + * @private + */ + function parseMultiplyDivide(state) { + let node, last, name, fn; + node = parseImplicitMultiplication(state); + last = node; + const operators = { + '*': 'multiply', + '.*': 'dotMultiply', + '/': 'divide', + './': 'dotDivide' + }; + while (true) { + if ((0, _object.hasOwnProperty)(operators, state.token)) { + // explicit operators + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + last = parseImplicitMultiplication(state); + node = new OperatorNode(name, fn, [node, last]); + } else { + break; + } + } + return node; + } + + /** + * implicit multiplication + * @return {Node} node + * @private + */ + function parseImplicitMultiplication(state) { + let node, last; + node = parseRule2(state); + last = node; + while (true) { + if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && (0, _is.isConstantNode)(node) || state.token === 'in' && (0, _is.isOperatorNode)(node) && node.fn === 'unaryMinus' && (0, _is.isConstantNode)(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !(0, _is.isConstantNode)(last) && (!(0, _is.isOperatorNode)(last) || last.op === '!') || state.token === '(') { + // parse implicit multiplication + // + // symbol: implicit multiplication like '2a', '(2+3)a', 'a b' + // number: implicit multiplication like '(2+3)2' + // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)' + last = parseRule2(state); + node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */); + } else { + break; + } + } + return node; + } + + /** + * Infamous "rule 2" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370 + * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164 + * Explicit division gets higher precedence than implicit multiplication + * when the division matches this pattern: + * [unaryPrefixOp]?[number] / [number] [symbol] + * @return {Node} node + * @private + */ + function parseRule2(state) { + let node = parseModulusPercentage(state); + let last = node; + const tokenStates = []; + while (true) { + // Match the "number /" part of the pattern "number / number symbol" + if (state.token === '/' && (0, _is.rule2Node)(last)) { + // Look ahead to see if the next token is a number + tokenStates.push((0, _extends2.default)({}, state)); + getTokenSkipNewline(state); + + // Match the "number / number" part of the pattern + if (state.tokenType === TOKENTYPE.NUMBER) { + // Look ahead again + tokenStates.push((0, _extends2.default)({}, state)); + getTokenSkipNewline(state); + + // Match the "symbol" part of the pattern, or a left parenthesis + if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') { + // We've matched the pattern "number / number symbol". + // Rewind once and build the "number / number" node; the symbol will be consumed later + (0, _extends2.default)(state, tokenStates.pop()); + tokenStates.pop(); + last = parseModulusPercentage(state); + node = new OperatorNode('/', 'divide', [node, last]); + } else { + // Not a match, so rewind + tokenStates.pop(); + (0, _extends2.default)(state, tokenStates.pop()); + break; + } + } else { + // Not a match, so rewind + (0, _extends2.default)(state, tokenStates.pop()); + break; + } + } else { + break; + } + } + return node; + } + + /** + * modulus and percentage + * @return {Node} node + * @private + */ + function parseModulusPercentage(state) { + let node, name, fn, params; + node = parseUnary(state); + const operators = { + '%': 'mod', + mod: 'mod' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') { + // If the expression contains only %, then treat that as /100 + node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true); + } else { + params = [node, parseUnary(state)]; + node = new OperatorNode(name, fn, params); + } + } + return node; + } + + /** + * Unary plus and minus, and logical and bitwise not + * @return {Node} node + * @private + */ + function parseUnary(state) { + let name, params, fn; + const operators = { + '-': 'unaryMinus', + '+': 'unaryPlus', + '~': 'bitNot', + not: 'not' + }; + if ((0, _object.hasOwnProperty)(operators, state.token)) { + fn = operators[state.token]; + name = state.token; + getTokenSkipNewline(state); + params = [parseUnary(state)]; + return new OperatorNode(name, fn, params); + } + return parsePow(state); + } + + /** + * power + * Note: power operator is right associative + * @return {Node} node + * @private + */ + function parsePow(state) { + let node, name, fn, params; + node = parseLeftHandOperators(state); + if (state.token === '^' || state.token === '.^') { + name = state.token; + fn = name === '^' ? 'pow' : 'dotPow'; + getTokenSkipNewline(state); + params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3' + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * Left hand operators: factorial x!, ctranspose x' + * @return {Node} node + * @private + */ + function parseLeftHandOperators(state) { + let node, name, fn, params; + node = parseCustomNodes(state); + const operators = { + '!': 'factorial', + '\'': 'ctranspose' + }; + while ((0, _object.hasOwnProperty)(operators, state.token)) { + name = state.token; + fn = operators[name]; + getToken(state); + params = [node]; + node = new OperatorNode(name, fn, params); + node = parseAccessors(state, node); + } + return node; + } + + /** + * Parse a custom node handler. A node handler can be used to process + * nodes in a custom way, for example for handling a plot. + * + * A handler must be passed as second argument of the parse function. + * - must extend math.Node + * - must contain a function _compile(defs: Object) : string + * - must contain a function find(filter: Object) : Node[] + * - must contain a function toString() : string + * - the constructor is called with a single argument containing all parameters + * + * For example: + * + * nodes = { + * 'plot': PlotHandler + * } + * + * The constructor of the handler is called as: + * + * node = new PlotHandler(params) + * + * The handler will be invoked when evaluating an expression like: + * + * node = math.parse('plot(sin(x), x)', nodes) + * + * @return {Node} node + * @private + */ + function parseCustomNodes(state) { + let params = []; + if (state.tokenType === TOKENTYPE.SYMBOL && (0, _object.hasOwnProperty)(state.extraNodes, state.token)) { + const CustomNode = state.extraNodes[state.token]; + getToken(state); + + // parse parameters + if (state.token === '(') { + params = []; + openParams(state); + getToken(state); + if (state.token !== ')') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + } + + // create a new custom node + // noinspection JSValidateTypes + return new CustomNode(params); + } + return parseSymbol(state); + } + + /** + * parse symbols: functions, variables, constants, units + * @return {Node} node + * @private + */ + function parseSymbol(state) { + let node, name; + if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) { + name = state.token; + getToken(state); + if ((0, _object.hasOwnProperty)(CONSTANTS, name)) { + // true, false, null, ... + node = new ConstantNode(CONSTANTS[name]); + } else if (NUMERIC_CONSTANTS.includes(name)) { + // NaN, Infinity + node = new ConstantNode(numeric(name, 'number')); + } else { + node = new SymbolNode(name); + } + + // parse function parameters and matrix index + node = parseAccessors(state, node); + return node; + } + return parseString(state); + } + + /** + * parse accessors: + * - function invocation in round brackets (...), for example sqrt(2) + * - index enclosed in square brackets [...], for example A[2,3] + * - dot notation for properties, like foo.bar + * @param {Object} state + * @param {Node} node Node on which to apply the parameters. If there + * are no parameters in the expression, the node + * itself is returned + * @param {string[]} [types] Filter the types of notations + * can be ['(', '[', '.'] + * @return {Node} node + * @private + */ + function parseAccessors(state, node, types) { + let params; + while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) { + // eslint-disable-line no-unmodified-loop-condition + params = []; + if (state.token === '(') { + if ((0, _is.isSymbolNode)(node) || (0, _is.isAccessorNode)(node)) { + // function invocation like fn(2, 3) or obj.fn(2, 3) + openParams(state); + getToken(state); + if (state.token !== ')') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + node = new FunctionNode(node, params); + } else { + // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2) + // don't parse it here but let it be handled by parseImplicitMultiplication + // with correct precedence + return node; + } + } else if (state.token === '[') { + // index notation like variable[2, 3] + openParams(state); + getToken(state); + if (state.token !== ']') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ']') { + throw createSyntaxError(state, 'Parenthesis ] expected'); + } + closeParams(state); + getToken(state); + node = new AccessorNode(node, new IndexNode(params)); + } else { + // dot notation like variable.prop + getToken(state); + const isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS; + if (!isPropertyName) { + throw createSyntaxError(state, 'Property name expected after dot'); + } + params.push(new ConstantNode(state.token)); + getToken(state); + const dotNotation = true; + node = new AccessorNode(node, new IndexNode(params, dotNotation)); + } + } + return node; + } + + /** + * Parse a single or double quoted string. + * @return {Node} node + * @private + */ + function parseString(state) { + let node, str; + if (state.token === '"' || state.token === "'") { + str = parseStringToken(state, state.token); + + // create constant + node = new ConstantNode(str); + + // parse index parameters + node = parseAccessors(state, node); + return node; + } + return parseMatrix(state); + } + + /** + * Parse a string surrounded by single or double quotes + * @param {Object} state + * @param {"'" | "\""} quote + * @return {string} + */ + function parseStringToken(state, quote) { + let str = ''; + while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) { + if (currentCharacter(state) === '\\') { + next(state); + const char = currentCharacter(state); + const escapeChar = ESCAPE_CHARACTERS[char]; + if (escapeChar !== undefined) { + // an escaped control character like \" or \n + str += escapeChar; + state.index += 1; + } else if (char === 'u') { + // escaped unicode character + const unicode = state.expression.slice(state.index + 1, state.index + 5); + if (/^[0-9A-Fa-f]{4}$/.test(unicode)) { + // test whether the string holds four hexadecimal values + str += String.fromCharCode(parseInt(unicode, 16)); + state.index += 5; + } else { + throw createSyntaxError(state, `Invalid unicode character \\u${unicode}`); + } + } else { + throw createSyntaxError(state, `Bad escape character \\${char}`); + } + } else { + // any regular character + str += currentCharacter(state); + next(state); + } + } + getToken(state); + if (state.token !== quote) { + throw createSyntaxError(state, `End of string ${quote} expected`); + } + getToken(state); + return str; + } + + /** + * parse the matrix + * @return {Node} node + * @private + */ + function parseMatrix(state) { + let array, params, rows, cols; + if (state.token === '[') { + // matrix [...] + openParams(state); + getToken(state); + if (state.token !== ']') { + // this is a non-empty matrix + const row = parseRow(state); + if (state.token === ';') { + // 2 dimensional array + rows = 1; + params = [row]; + + // the rows of the matrix are separated by dot-comma's + while (state.token === ';') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + if (state.token !== ']') { + params[rows] = parseRow(state); + rows++; + } + } + if (state.token !== ']') { + throw createSyntaxError(state, 'End of matrix ] expected'); + } + closeParams(state); + getToken(state); + + // check if the number of columns matches in all rows + cols = params[0].items.length; + for (let r = 1; r < rows; r++) { + if (params[r].items.length !== cols) { + throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')'); + } + } + array = new ArrayNode(params); + } else { + // 1 dimensional vector + if (state.token !== ']') { + throw createSyntaxError(state, 'End of matrix ] expected'); + } + closeParams(state); + getToken(state); + array = row; + } + } else { + // this is an empty matrix "[ ]" + closeParams(state); + getToken(state); + array = new ArrayNode([]); + } + return parseAccessors(state, array); + } + return parseObject(state); + } + + /** + * Parse a single comma-separated row from a matrix, like 'a, b, c' + * @return {ArrayNode} node + */ + function parseRow(state) { + const params = [parseAssignment(state)]; + let len = 1; + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + + // parse expression + if (state.token !== ']' && state.token !== ';') { + params[len] = parseAssignment(state); + len++; + } + } + return new ArrayNode(params); + } + + /** + * parse an object, enclosed in angle brackets{...}, for example {value: 2} + * @return {Node} node + * @private + */ + function parseObject(state) { + if (state.token === '{') { + openParams(state); + let key; + const properties = {}; + do { + getToken(state); + if (state.token !== '}') { + // parse key + if (state.token === '"' || state.token === "'") { + key = parseStringToken(state, state.token); + } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) { + key = state.token; + getToken(state); + } else { + throw createSyntaxError(state, 'Symbol or string expected as object key'); + } + + // parse key/value separator + if (state.token !== ':') { + throw createSyntaxError(state, 'Colon : expected after object key'); + } + getToken(state); + + // parse key + properties[key] = parseAssignment(state); + } + } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition + + if (state.token !== '}') { + throw createSyntaxError(state, 'Comma , or bracket } expected after object value'); + } + closeParams(state); + getToken(state); + let node = new ObjectNode(properties); + + // parse index parameters + node = parseAccessors(state, node); + return node; + } + return parseNumber(state); + } + + /** + * parse a number + * @return {Node} node + * @private + */ + function parseNumber(state) { + let numberStr; + if (state.tokenType === TOKENTYPE.NUMBER) { + // this is a number + numberStr = state.token; + getToken(state); + const numericType = (0, _number.safeNumberType)(numberStr, config); + const value = numeric(numberStr, numericType); + return new ConstantNode(value); + } + return parseParentheses(state); + } + + /** + * parentheses + * @return {Node} node + * @private + */ + function parseParentheses(state) { + let node; + + // check if it is a parenthesized expression + if (state.token === '(') { + // parentheses (...) + openParams(state); + getToken(state); + node = parseAssignment(state); // start again + + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + node = new ParenthesisNode(node); + node = parseAccessors(state, node); + return node; + } + return parseEnd(state); + } + + /** + * Evaluated when the expression is not yet ended but expected to end + * @return {Node} res + * @private + */ + function parseEnd(state) { + if (state.token === '') { + // syntax error or unexpected end of expression + throw createSyntaxError(state, 'Unexpected end of expression'); + } else { + throw createSyntaxError(state, 'Value expected'); + } + } + + /** + * Shortcut for getting the current row value (one based) + * Returns the line of the currently handled expression + * @private + */ + /* TODO: implement keeping track on the row number + function row () { + return null + } + */ + + /** + * Shortcut for getting the current col value (one based) + * Returns the column (position) where the last state.token starts + * @private + */ + function col(state) { + return state.index - state.token.length + 1; + } + + /** + * Create an error + * @param {Object} state + * @param {string} message + * @return {SyntaxError} instantiated error + * @private + */ + function createSyntaxError(state, message) { + const c = col(state); + const error = new SyntaxError(message + ' (char ' + c + ')'); + error.char = c; + return error; + } + + /** + * Create an error + * @param {Object} state + * @param {string} message + * @return {Error} instantiated error + * @private + */ + function createError(state, message) { + const c = col(state); + const error = new SyntaxError(message + ' (char ' + c + ')'); + error.char = c; + return error; + } + + // Now that we can parse, automatically convert strings to Nodes by parsing + typed.addConversion({ + from: 'string', + to: 'Node', + convert: parse + }); + return parse; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js new file mode 100644 index 0000000..494f509 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAndTransform = void 0; +var _and = require("../../function/logical/and.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'and'; +const dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']; +const createAndTransform = exports.createAndTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + const and = (0, _and.createAnd)({ + typed, + matrix, + equalScalar, + zeros, + not, + concat + }); + function andTransform(args, math, scope) { + const condition1 = args[0].compile().evaluate(scope); + if (!(0, _is.isCollection)(condition1) && !and(condition1, true)) { + return false; + } + const condition2 = args[1].compile().evaluate(scope); + return and(condition1, condition2); + } + andTransform.rawArgs = true; + return andTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/apply.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/apply.transform.js new file mode 100644 index 0000000..59aefc8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/apply.transform.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createApplyTransform = void 0; +var _errorTransform = require("./utils/errorTransform.js"); +var _factory = require("../../utils/factory.js"); +var _apply = require("../../function/matrix/apply.js"); +var _is = require("../../utils/is.js"); +const name = 'apply'; +const dependencies = ['typed', 'isInteger']; + +/** + * Attach a transform function to math.apply + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function apply + * from one-based to zero based + */ +const createApplyTransform = exports.createApplyTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isInteger + } = _ref; + const apply = (0, _apply.createApply)({ + typed, + isInteger + }); + + // @see: comment of concat itself + return typed('apply', { + '...any': function (args) { + // change dim from one-based to zero-based + const dim = args[1]; + if ((0, _is.isNumber)(dim)) { + args[1] = dim - 1; + } else if ((0, _is.isBigNumber)(dim)) { + args[1] = dim.minus(1); + } + try { + return apply.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js new file mode 100644 index 0000000..bd1cb36 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitAndTransform = void 0; +var _bitAnd = require("../../function/bitwise/bitAnd.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'bitAnd'; +const dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']; +const createBitAndTransform = exports.createBitAndTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + const bitAnd = (0, _bitAnd.createBitAnd)({ + typed, + matrix, + equalScalar, + zeros, + not, + concat + }); + function bitAndTransform(args, math, scope) { + const condition1 = args[0].compile().evaluate(scope); + if (!(0, _is.isCollection)(condition1)) { + if (isNaN(condition1)) { + return NaN; + } + if (condition1 === 0 || condition1 === false) { + return 0; + } + } + const condition2 = args[1].compile().evaluate(scope); + return bitAnd(condition1, condition2); + } + bitAndTransform.rawArgs = true; + return bitAndTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js new file mode 100644 index 0000000..41c0927 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitOrTransform = void 0; +var _bitOr = require("../../function/bitwise/bitOr.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'bitOr'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +const createBitOrTransform = exports.createBitOrTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + const bitOr = (0, _bitOr.createBitOr)({ + typed, + matrix, + equalScalar, + DenseMatrix, + concat + }); + function bitOrTransform(args, math, scope) { + const condition1 = args[0].compile().evaluate(scope); + if (!(0, _is.isCollection)(condition1)) { + if (isNaN(condition1)) { + return NaN; + } + if (condition1 === -1) { + return -1; + } + if (condition1 === true) { + return 1; + } + } + const condition2 = args[1].compile().evaluate(scope); + return bitOr(condition1, condition2); + } + bitOrTransform.rawArgs = true; + return bitOrTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js new file mode 100644 index 0000000..b03d33c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createColumnTransform = void 0; +var _errorTransform = require("./utils/errorTransform.js"); +var _factory = require("../../utils/factory.js"); +var _column = require("../../function/matrix/column.js"); +var _is = require("../../utils/is.js"); +const name = 'column'; +const dependencies = ['typed', 'Index', 'matrix', 'range']; + +/** + * Attach a transform function to matrix.column + * Adds a property transform containing the transform function. + * + * This transform changed the last `index` parameter of function column + * from zero-based to one-based + */ +const createColumnTransform = exports.createColumnTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Index, + matrix, + range + } = _ref; + const column = (0, _column.createColumn)({ + typed, + Index, + matrix, + range + }); + + // @see: comment of column itself + return typed('column', { + '...any': function (args) { + // change last argument from zero-based to one-based + const lastIndex = args.length - 1; + const last = args[lastIndex]; + if ((0, _is.isNumber)(last)) { + args[lastIndex] = last - 1; + } + try { + return column.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js new file mode 100644 index 0000000..a715ea5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConcatTransform = void 0; +var _is = require("../../utils/is.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _factory = require("../../utils/factory.js"); +var _concat = require("../../function/matrix/concat.js"); +const name = 'concat'; +const dependencies = ['typed', 'matrix', 'isInteger']; +const createConcatTransform = exports.createConcatTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + isInteger + } = _ref; + const concat = (0, _concat.createConcat)({ + typed, + matrix, + isInteger + }); + + /** + * Attach a transform function to math.range + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function concat + * from one-based to zero based + */ + return typed('concat', { + '...any': function (args) { + // change last argument from one-based to zero-based + const lastIndex = args.length - 1; + const last = args[lastIndex]; + if ((0, _is.isNumber)(last)) { + args[lastIndex] = last - 1; + } else if ((0, _is.isBigNumber)(last)) { + args[lastIndex] = last.minus(1); + } + try { + return concat.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js new file mode 100644 index 0000000..91a6b40 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCumSumTransform = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _cumsum = require("../../function/statistics/cumsum.js"); +/** + * Attach a transform function to math.sum + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function sum + * from one-based to zero based + */ +const name = 'cumsum'; +const dependencies = ['typed', 'add', 'unaryPlus']; +const createCumSumTransform = exports.createCumSumTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + unaryPlus + } = _ref; + const cumsum = (0, _cumsum.createCumSum)({ + typed, + add, + unaryPlus + }); + return typed(name, { + '...any': function (args) { + // change last argument dim from one-based to zero-based + if (args.length === 2 && (0, _is.isCollection)(args[0])) { + const dim = args[1]; + if ((0, _is.isNumber)(dim)) { + args[1] = dim - 1; + } else if ((0, _is.isBigNumber)(dim)) { + args[1] = dim.minus(1); + } + } + try { + return cumsum.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js new file mode 100644 index 0000000..dd0015e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDiffTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _diff = require("../../function/matrix/diff.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'diff'; +const dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber']; +const createDiffTransform = exports.createDiffTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + subtract, + number, + bignumber + } = _ref; + const diff = (0, _diff.createDiff)({ + typed, + matrix, + subtract, + number, + bignumber + }); + + /** + * Attach a transform function to math.diff + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed(name, { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return diff.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js new file mode 100644 index 0000000..5b816f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFilterTransform = void 0; +var _filter = require("../../function/matrix/filter.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _compileInlineExpression = require("./utils/compileInlineExpression.js"); +var _transformCallback = require("./utils/transformCallback.js"); +const name = 'filter'; +const dependencies = ['typed']; +const createFilterTransform = exports.createFilterTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Attach a transform function to math.filter + * Adds a property transform containing the transform function. + * + * This transform adds support for equations as test function for math.filter, + * so you can do something like 'filter([3, -2, 5], x > 0)'. + */ + function filterTransform(args, math, scope) { + const filter = (0, _filter.createFilter)({ + typed + }); + const transformCallback = (0, _transformCallback.createTransformCallback)({ + typed + }); + if (args.length === 0) { + return filter(); + } + let x = args[0]; + if (args.length === 1) { + return filter(x); + } + const N = args.length - 1; + let callback = args[N]; + if (x) { + x = _compileAndEvaluate(x, scope); + } + if (callback) { + if ((0, _is.isSymbolNode)(callback) || (0, _is.isFunctionAssignmentNode)(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = (0, _compileInlineExpression.compileInlineExpression)(callback, math, scope); + } + } + return filter(x, transformCallback(callback, N)); + } + filterTransform.rawArgs = true; + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + return filterTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js new file mode 100644 index 0000000..e84c4c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createForEachTransform = void 0; +var _forEach = require("../../function/matrix/forEach.js"); +var _transformCallback = require("./utils/transformCallback.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _compileInlineExpression = require("./utils/compileInlineExpression.js"); +const name = 'forEach'; +const dependencies = ['typed']; +const createForEachTransform = exports.createForEachTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Attach a transform function to math.forEach + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + const forEach = (0, _forEach.createForEach)({ + typed + }); + const transformCallback = (0, _transformCallback.createTransformCallback)({ + typed + }); + function forEachTransform(args, math, scope) { + if (args.length === 0) { + return forEach(); + } + let x = args[0]; + if (args.length === 1) { + return forEach(x); + } + const N = args.length - 1; + let callback = args[N]; + if (x) { + x = _compileAndEvaluate(x, scope); + } + if (callback) { + if ((0, _is.isSymbolNode)(callback) || (0, _is.isFunctionAssignmentNode)(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = (0, _compileInlineExpression.compileInlineExpression)(callback, math, scope); + } + } + return forEach(x, transformCallback(callback, N)); + } + forEachTransform.rawArgs = true; + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + return forEachTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js new file mode 100644 index 0000000..d2df23d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIndexTransform = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'index'; +const dependencies = ['Index', 'getMatrixDataType']; +const createIndexTransform = exports.createIndexTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Index, + getMatrixDataType + } = _ref; + /** + * Attach a transform function to math.index + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + return function indexTransform() { + const args = []; + for (let i = 0, ii = arguments.length; i < ii; i++) { + let arg = arguments[i]; + + // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is + if ((0, _is.isRange)(arg)) { + arg.start--; + arg.end -= arg.step > 0 ? 0 : 2; + } else if (arg && arg.isSet === true) { + arg = arg.map(function (v) { + return v - 1; + }); + } else if ((0, _is.isArray)(arg) || (0, _is.isMatrix)(arg)) { + if (getMatrixDataType(arg) !== 'boolean') { + arg = arg.map(function (v) { + return v - 1; + }); + } + } else if ((0, _is.isNumber)(arg)) { + arg--; + } else if ((0, _is.isBigNumber)(arg)) { + arg = arg.toNumber() - 1; + } else if (typeof arg === 'string') { + // leave as is + } else { + throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range'); + } + args[i] = arg; + } + const res = new Index(); + Index.apply(res, args); + return res; + }; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js new file mode 100644 index 0000000..152eb0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMapTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _map = require("../../function/matrix/map.js"); +var _compileInlineExpression = require("./utils/compileInlineExpression.js"); +var _transformCallback = require("./utils/transformCallback.js"); +const name = 'map'; +const dependencies = ['typed']; +const createMapTransform = exports.createMapTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Attach a transform function to math.map + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + const map = (0, _map.createMap)({ + typed + }); + const transformCallback = (0, _transformCallback.createTransformCallback)({ + typed + }); + function mapTransform(args, math, scope) { + if (args.length === 0) { + return map(); + } + if (args.length === 1) { + return map(args[0]); + } + const N = args.length - 1; + let X = args.slice(0, N); + let callback = args[N]; + X = X.map(arg => _compileAndEvaluate(arg, scope)); + if (callback) { + if ((0, _is.isSymbolNode)(callback) || (0, _is.isFunctionAssignmentNode)(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = (0, _compileInlineExpression.compileInlineExpression)(callback, math, scope); + } + } + return map(...X, transformCallback(callback, N)); + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + } + mapTransform.rawArgs = true; + return mapTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js new file mode 100644 index 0000000..35666ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMaxTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _max = require("../../function/statistics/max.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'max'; +const dependencies = ['typed', 'config', 'numeric', 'larger']; +const createMaxTransform = exports.createMaxTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + numeric, + larger + } = _ref; + const max = (0, _max.createMax)({ + typed, + config, + numeric, + larger + }); + + /** + * Attach a transform function to math.max + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function max + * from one-based to zero based + */ + return typed('max', { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return max.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js new file mode 100644 index 0000000..3786f73 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMeanTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _mean = require("../../function/statistics/mean.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'mean'; +const dependencies = ['typed', 'add', 'divide']; +const createMeanTransform = exports.createMeanTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + divide + } = _ref; + const mean = (0, _mean.createMean)({ + typed, + add, + divide + }); + + /** + * Attach a transform function to math.mean + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function mean + * from one-based to zero based + */ + return typed('mean', { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return mean.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js new file mode 100644 index 0000000..3548043 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMinTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _min = require("../../function/statistics/min.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'min'; +const dependencies = ['typed', 'config', 'numeric', 'smaller']; +const createMinTransform = exports.createMinTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + numeric, + smaller + } = _ref; + const min = (0, _min.createMin)({ + typed, + config, + numeric, + smaller + }); + + /** + * Attach a transform function to math.min + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function min + * from one-based to zero based + */ + return typed('min', { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return min.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js new file mode 100644 index 0000000..08169e7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createOrTransform = void 0; +var _or = require("../../function/logical/or.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'or'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +const createOrTransform = exports.createOrTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + const or = (0, _or.createOr)({ + typed, + matrix, + equalScalar, + DenseMatrix, + concat + }); + function orTransform(args, math, scope) { + const condition1 = args[0].compile().evaluate(scope); + if (!(0, _is.isCollection)(condition1) && or(condition1, false)) { + return true; + } + const condition2 = args[1].compile().evaluate(scope); + return or(condition1, condition2); + } + orTransform.rawArgs = true; + return orTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js new file mode 100644 index 0000000..8872817 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPrintTransform = void 0; +var _print = require("../../function/string/print.js"); +var _factory = require("../../utils/factory.js"); +var _print2 = require("../../utils/print.js"); +const name = 'print'; +const dependencies = ['typed', 'matrix', 'zeros', 'add']; +const createPrintTransform = exports.createPrintTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + zeros, + add + } = _ref; + const print = (0, _print.createPrint)({ + typed, + matrix, + zeros, + add + }); + return typed(name, { + 'string, Object | Array': function (template, values) { + return print(_convertTemplateToZeroBasedIndex(template), values); + }, + 'string, Object | Array, number | Object': function (template, values, options) { + return print(_convertTemplateToZeroBasedIndex(template), values, options); + } + }); + function _convertTemplateToZeroBasedIndex(template) { + return template.replace(_print2.printTemplate, x => { + const parts = x.slice(1).split('.'); + const result = parts.map(function (part) { + if (!isNaN(part) && part.length > 0) { + return parseInt(part) - 1; + } else { + return part; + } + }); + return '$' + result.join('.'); + }); + } +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js new file mode 100644 index 0000000..1c5a5aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createQuantileSeqTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _quantileSeq = require("../../function/statistics/quantileSeq.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'quantileSeq'; +const dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']; + +/** + * Attach a transform function to math.quantileSeq + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function std + * from one-based to zero based + */ +const createQuantileSeqTransform = exports.createQuantileSeqTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + } = _ref; + const quantileSeq = (0, _quantileSeq.createQuantileSeq)({ + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + }); + return typed('quantileSeq', { + 'Array | Matrix, number | BigNumber': quantileSeq, + 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)), + 'Array | Matrix, number | BigNumber, boolean': quantileSeq, + 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)), + 'Array | Matrix, Array | Matrix': quantileSeq, + 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)), + 'Array | Matrix, Array | Matrix, boolean': quantileSeq, + 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim)) + }); + function dimToZeroBase(dim) { + // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases. + return (0, _lastDimToZeroBase.lastDimToZeroBase)([[], dim])[1]; + } +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js new file mode 100644 index 0000000..3facb04 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRangeTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _range = require("../../function/matrix/range.js"); +const name = 'range'; +const dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']; +const createRangeTransform = exports.createRangeTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + } = _ref; + const range = (0, _range.createRange)({ + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + }); + + /** + * Attach a transform function to math.range + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed('range', { + '...any': function (args) { + const lastIndex = args.length - 1; + const last = args[lastIndex]; + if (typeof last !== 'boolean') { + // append a parameter includeEnd=true + args.push(true); + } + return range.apply(null, args); + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js new file mode 100644 index 0000000..de1844f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRowTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _row = require("../../function/matrix/row.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _is = require("../../utils/is.js"); +const name = 'row'; +const dependencies = ['typed', 'Index', 'matrix', 'range']; + +/** + * Attach a transform function to matrix.column + * Adds a property transform containing the transform function. + * + * This transform changed the last `index` parameter of function column + * from zero-based to one-based + */ +const createRowTransform = exports.createRowTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Index, + matrix, + range + } = _ref; + const row = (0, _row.createRow)({ + typed, + Index, + matrix, + range + }); + + // @see: comment of row itself + return typed('row', { + '...any': function (args) { + // change last argument from zero-based to one-based + const lastIndex = args.length - 1; + const last = args[lastIndex]; + if ((0, _is.isNumber)(last)) { + args[lastIndex] = last - 1; + } + try { + return row.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js new file mode 100644 index 0000000..c8e5138 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createStdTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _std = require("../../function/statistics/std.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'std'; +const dependencies = ['typed', 'map', 'sqrt', 'variance']; + +/** + * Attach a transform function to math.std + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function std + * from one-based to zero based + */ +const createStdTransform = exports.createStdTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + map, + sqrt, + variance + } = _ref; + const std = (0, _std.createStd)({ + typed, + map, + sqrt, + variance + }); + return typed('std', { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return std.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js new file mode 100644 index 0000000..f15ec68 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSubsetTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _subset = require("../../function/matrix/subset.js"); +const name = 'subset'; +const dependencies = ['typed', 'matrix', 'zeros', 'add']; +const createSubsetTransform = exports.createSubsetTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + zeros, + add + } = _ref; + const subset = (0, _subset.createSubset)({ + typed, + matrix, + zeros, + add + }); + + /** + * Attach a transform function to math.subset + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed('subset', { + '...any': function (args) { + try { + return subset.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js new file mode 100644 index 0000000..f6a6bd8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSumTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _sum = require("../../function/statistics/sum.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +/** + * Attach a transform function to math.sum + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function sum + * from one-based to zero based + */ +const name = 'sum'; +const dependencies = ['typed', 'config', 'add', 'numeric']; +const createSumTransform = exports.createSumTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + add, + numeric + } = _ref; + const sum = (0, _sum.createSum)({ + typed, + config, + add, + numeric + }); + return typed(name, { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return sum.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js new file mode 100644 index 0000000..89b07ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compileInlineExpression = compileInlineExpression; +var _is = require("../../../utils/is.js"); +var _map = require("../../../utils/map.js"); +/** + * Compile an inline expression like "x > 0" + * @param {Node} expression + * @param {Object} math + * @param {Map} scope + * @return {function} Returns a function with one argument which fills in the + * undefined variable (like "x") and evaluates the expression + */ +function compileInlineExpression(expression, math, scope) { + // find an undefined symbol + const symbol = expression.filter(function (node) { + return (0, _is.isSymbolNode)(node) && !(node.name in math) && !scope.has(node.name); + })[0]; + if (!symbol) { + throw new Error('No undefined variable found in inline expression "' + expression + '"'); + } + + // create a test function for this equation + const name = symbol.name; // variable name + const argsScope = new Map(); + const subScope = new _map.PartitionedMap(scope, argsScope, new Set([name])); + const eq = expression.compile(); + return function inlineExpression(x) { + argsScope.set(name, x); + return eq.evaluate(subScope); + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js new file mode 100644 index 0000000..cbc2cc5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dimToZeroBase = dimToZeroBase; +exports.isNumberOrBigNumber = isNumberOrBigNumber; +var _is = require("../../../utils/is.js"); +/** + * Change last argument dim from one-based to zero-based. + */ +function dimToZeroBase(dim) { + if ((0, _is.isNumber)(dim)) { + return dim - 1; + } else if ((0, _is.isBigNumber)(dim)) { + return dim.minus(1); + } else { + return dim; + } +} +function isNumberOrBigNumber(n) { + return (0, _is.isNumber)(n) || (0, _is.isBigNumber)(n); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js new file mode 100644 index 0000000..3e85344 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.errorTransform = errorTransform; +var _IndexError = require("../../../error/IndexError.js"); +/** + * Transform zero-based indices to one-based indices in errors + * @param {Error} err + * @returns {Error | IndexError} Returns the transformed error + */ +function errorTransform(err) { + if (err && err.isIndexError) { + return new _IndexError.IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined); + } + return err; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js new file mode 100644 index 0000000..dc3cdaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lastDimToZeroBase = lastDimToZeroBase; +var _is = require("../../../utils/is.js"); +var _dimToZeroBase = require("./dimToZeroBase.js"); +/** + * Change last argument dim from one-based to zero-based. + */ +function lastDimToZeroBase(args) { + if (args.length === 2 && (0, _is.isCollection)(args[0])) { + args = args.slice(); + const dim = args[1]; + if ((0, _dimToZeroBase.isNumberOrBigNumber)(dim)) { + args[1] = (0, _dimToZeroBase.dimToZeroBase)(dim); + } + } + return args; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js new file mode 100644 index 0000000..1fdae2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTransformCallback = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'transformCallback'; +const dependencies = ['typed']; +const createTransformCallback = exports.createTransformCallback = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Transforms the given callback function based on its type and number of arrays. + * + * @param {Function} callback - The callback function to transform. + * @param {number} numberOfArrays - The number of arrays to pass to the callback function. + * @returns {*} - The transformed callback function. + */ + return function (callback, numberOfArrays) { + if (typed.isTypedFunction(callback)) { + return _transformTypedCallbackFunction(callback, numberOfArrays); + } else { + return _transformCallbackFunction(callback, callback.length, numberOfArrays); + } + }; + + /** + * Transforms the given typed callback function based on the number of arrays. + * + * @param {Function} typedFunction - The typed callback function to transform. + * @param {number} numberOfArrays - The number of arrays to pass to the callback function. + * @returns {*} - The transformed callback function. + */ + function _transformTypedCallbackFunction(typedFunction, numberOfArrays) { + const signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => { + let [signature, callbackFunction] = _ref2; + const numberOfCallbackInputs = signature.split(',').length; + if (typed.isTypedFunction(callbackFunction)) { + return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)]; + } else { + return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)]; + } + })); + if (typeof typedFunction.name === 'string') { + return typed(typedFunction.name, signatures); + } else { + return typed(signatures); + } + } +}); + +/** + * Transforms the callback function based on the number of callback inputs and arrays. + * There are three cases: + * 1. The callback function has N arguments. + * 2. The callback function has N+1 arguments. + * 3. The callback function has 2N+1 arguments. + * + * @param {Function} callbackFunction - The callback function to transform. + * @param {number} numberOfCallbackInputs - The number of callback inputs. + * @param {number} numberOfArrays - The number of arrays. + * @returns {Function} The transformed callback function. + */ +function _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) { + if (numberOfCallbackInputs === numberOfArrays) { + return callbackFunction; + } else if (numberOfCallbackInputs === numberOfArrays + 1) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + const vals = args.slice(0, numberOfArrays); + const idx = _transformDims(args[numberOfArrays]); + return callbackFunction(...vals, idx); + }; + } else if (numberOfCallbackInputs > numberOfArrays + 1) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + const vals = args.slice(0, numberOfArrays); + const idx = _transformDims(args[numberOfArrays]); + const rest = args.slice(numberOfArrays + 1); + return callbackFunction(...vals, idx, ...rest); + }; + } else { + return callbackFunction; + } +} + +/** + * Transforms the dimensions by adding 1 to each dimension. + * + * @param {Array} dims - The dimensions to transform. + * @returns {Array} The transformed dimensions. + */ +function _transformDims(dims) { + return dims.map(dim => dim + 1); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js new file mode 100644 index 0000000..1eaf44e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createVarianceTransform = void 0; +var _factory = require("../../utils/factory.js"); +var _errorTransform = require("./utils/errorTransform.js"); +var _variance = require("../../function/statistics/variance.js"); +var _lastDimToZeroBase = require("./utils/lastDimToZeroBase.js"); +const name = 'variance'; +const dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']; + +/** + * Attach a transform function to math.var + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function var + * from one-based to zero based + */ +const createVarianceTransform = exports.createVarianceTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + } = _ref; + const variance = (0, _variance.createVariance)({ + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + }); + return typed(name, { + '...any': function (args) { + args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args); + try { + return variance.apply(null, args); + } catch (err) { + throw (0, _errorTransform.errorTransform)(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesAny.js new file mode 100644 index 0000000..71b14f9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesAny.js @@ -0,0 +1,2472 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "createAbs", { + enumerable: true, + get: function () { + return _abs.createAbs; + } +}); +Object.defineProperty(exports, "createAccessorNode", { + enumerable: true, + get: function () { + return _AccessorNode.createAccessorNode; + } +}); +Object.defineProperty(exports, "createAcos", { + enumerable: true, + get: function () { + return _acos.createAcos; + } +}); +Object.defineProperty(exports, "createAcosh", { + enumerable: true, + get: function () { + return _acosh.createAcosh; + } +}); +Object.defineProperty(exports, "createAcot", { + enumerable: true, + get: function () { + return _acot.createAcot; + } +}); +Object.defineProperty(exports, "createAcoth", { + enumerable: true, + get: function () { + return _acoth.createAcoth; + } +}); +Object.defineProperty(exports, "createAcsc", { + enumerable: true, + get: function () { + return _acsc.createAcsc; + } +}); +Object.defineProperty(exports, "createAcsch", { + enumerable: true, + get: function () { + return _acsch.createAcsch; + } +}); +Object.defineProperty(exports, "createAdd", { + enumerable: true, + get: function () { + return _add.createAdd; + } +}); +Object.defineProperty(exports, "createAddScalar", { + enumerable: true, + get: function () { + return _addScalar.createAddScalar; + } +}); +Object.defineProperty(exports, "createAnd", { + enumerable: true, + get: function () { + return _and.createAnd; + } +}); +Object.defineProperty(exports, "createAndTransform", { + enumerable: true, + get: function () { + return _andTransform.createAndTransform; + } +}); +Object.defineProperty(exports, "createApply", { + enumerable: true, + get: function () { + return _apply.createApply; + } +}); +Object.defineProperty(exports, "createApplyTransform", { + enumerable: true, + get: function () { + return _applyTransform.createApplyTransform; + } +}); +Object.defineProperty(exports, "createArg", { + enumerable: true, + get: function () { + return _arg.createArg; + } +}); +Object.defineProperty(exports, "createArrayNode", { + enumerable: true, + get: function () { + return _ArrayNode.createArrayNode; + } +}); +Object.defineProperty(exports, "createAsec", { + enumerable: true, + get: function () { + return _asec.createAsec; + } +}); +Object.defineProperty(exports, "createAsech", { + enumerable: true, + get: function () { + return _asech.createAsech; + } +}); +Object.defineProperty(exports, "createAsin", { + enumerable: true, + get: function () { + return _asin.createAsin; + } +}); +Object.defineProperty(exports, "createAsinh", { + enumerable: true, + get: function () { + return _asinh.createAsinh; + } +}); +Object.defineProperty(exports, "createAssignmentNode", { + enumerable: true, + get: function () { + return _AssignmentNode.createAssignmentNode; + } +}); +Object.defineProperty(exports, "createAtan", { + enumerable: true, + get: function () { + return _atan.createAtan; + } +}); +Object.defineProperty(exports, "createAtan2", { + enumerable: true, + get: function () { + return _atan2.createAtan2; + } +}); +Object.defineProperty(exports, "createAtanh", { + enumerable: true, + get: function () { + return _atanh.createAtanh; + } +}); +Object.defineProperty(exports, "createAtomicMass", { + enumerable: true, + get: function () { + return _physicalConstants.createAtomicMass; + } +}); +Object.defineProperty(exports, "createAvogadro", { + enumerable: true, + get: function () { + return _physicalConstants.createAvogadro; + } +}); +Object.defineProperty(exports, "createBellNumbers", { + enumerable: true, + get: function () { + return _bellNumbers.createBellNumbers; + } +}); +Object.defineProperty(exports, "createBigNumberClass", { + enumerable: true, + get: function () { + return _BigNumber.createBigNumberClass; + } +}); +Object.defineProperty(exports, "createBigint", { + enumerable: true, + get: function () { + return _bigint.createBigint; + } +}); +Object.defineProperty(exports, "createBignumber", { + enumerable: true, + get: function () { + return _bignumber.createBignumber; + } +}); +Object.defineProperty(exports, "createBin", { + enumerable: true, + get: function () { + return _bin.createBin; + } +}); +Object.defineProperty(exports, "createBitAnd", { + enumerable: true, + get: function () { + return _bitAnd.createBitAnd; + } +}); +Object.defineProperty(exports, "createBitAndTransform", { + enumerable: true, + get: function () { + return _bitAndTransform.createBitAndTransform; + } +}); +Object.defineProperty(exports, "createBitNot", { + enumerable: true, + get: function () { + return _bitNot.createBitNot; + } +}); +Object.defineProperty(exports, "createBitOr", { + enumerable: true, + get: function () { + return _bitOr.createBitOr; + } +}); +Object.defineProperty(exports, "createBitOrTransform", { + enumerable: true, + get: function () { + return _bitOrTransform.createBitOrTransform; + } +}); +Object.defineProperty(exports, "createBitXor", { + enumerable: true, + get: function () { + return _bitXor.createBitXor; + } +}); +Object.defineProperty(exports, "createBlockNode", { + enumerable: true, + get: function () { + return _BlockNode.createBlockNode; + } +}); +Object.defineProperty(exports, "createBohrMagneton", { + enumerable: true, + get: function () { + return _physicalConstants.createBohrMagneton; + } +}); +Object.defineProperty(exports, "createBohrRadius", { + enumerable: true, + get: function () { + return _physicalConstants.createBohrRadius; + } +}); +Object.defineProperty(exports, "createBoltzmann", { + enumerable: true, + get: function () { + return _physicalConstants.createBoltzmann; + } +}); +Object.defineProperty(exports, "createBoolean", { + enumerable: true, + get: function () { + return _boolean.createBoolean; + } +}); +Object.defineProperty(exports, "createCatalan", { + enumerable: true, + get: function () { + return _catalan.createCatalan; + } +}); +Object.defineProperty(exports, "createCbrt", { + enumerable: true, + get: function () { + return _cbrt.createCbrt; + } +}); +Object.defineProperty(exports, "createCeil", { + enumerable: true, + get: function () { + return _ceil.createCeil; + } +}); +Object.defineProperty(exports, "createChain", { + enumerable: true, + get: function () { + return _chain.createChain; + } +}); +Object.defineProperty(exports, "createChainClass", { + enumerable: true, + get: function () { + return _Chain.createChainClass; + } +}); +Object.defineProperty(exports, "createClassicalElectronRadius", { + enumerable: true, + get: function () { + return _physicalConstants.createClassicalElectronRadius; + } +}); +Object.defineProperty(exports, "createClone", { + enumerable: true, + get: function () { + return _clone.createClone; + } +}); +Object.defineProperty(exports, "createColumn", { + enumerable: true, + get: function () { + return _column.createColumn; + } +}); +Object.defineProperty(exports, "createColumnTransform", { + enumerable: true, + get: function () { + return _columnTransform.createColumnTransform; + } +}); +Object.defineProperty(exports, "createCombinations", { + enumerable: true, + get: function () { + return _combinations.createCombinations; + } +}); +Object.defineProperty(exports, "createCombinationsWithRep", { + enumerable: true, + get: function () { + return _combinationsWithRep.createCombinationsWithRep; + } +}); +Object.defineProperty(exports, "createCompare", { + enumerable: true, + get: function () { + return _compare.createCompare; + } +}); +Object.defineProperty(exports, "createCompareNatural", { + enumerable: true, + get: function () { + return _compareNatural.createCompareNatural; + } +}); +Object.defineProperty(exports, "createCompareText", { + enumerable: true, + get: function () { + return _compareText.createCompareText; + } +}); +Object.defineProperty(exports, "createCompile", { + enumerable: true, + get: function () { + return _compile.createCompile; + } +}); +Object.defineProperty(exports, "createComplex", { + enumerable: true, + get: function () { + return _complex.createComplex; + } +}); +Object.defineProperty(exports, "createComplexClass", { + enumerable: true, + get: function () { + return _Complex.createComplexClass; + } +}); +Object.defineProperty(exports, "createComposition", { + enumerable: true, + get: function () { + return _composition.createComposition; + } +}); +Object.defineProperty(exports, "createConcat", { + enumerable: true, + get: function () { + return _concat.createConcat; + } +}); +Object.defineProperty(exports, "createConcatTransform", { + enumerable: true, + get: function () { + return _concatTransform.createConcatTransform; + } +}); +Object.defineProperty(exports, "createConditionalNode", { + enumerable: true, + get: function () { + return _ConditionalNode.createConditionalNode; + } +}); +Object.defineProperty(exports, "createConductanceQuantum", { + enumerable: true, + get: function () { + return _physicalConstants.createConductanceQuantum; + } +}); +Object.defineProperty(exports, "createConj", { + enumerable: true, + get: function () { + return _conj.createConj; + } +}); +Object.defineProperty(exports, "createConstantNode", { + enumerable: true, + get: function () { + return _ConstantNode.createConstantNode; + } +}); +Object.defineProperty(exports, "createCorr", { + enumerable: true, + get: function () { + return _corr.createCorr; + } +}); +Object.defineProperty(exports, "createCos", { + enumerable: true, + get: function () { + return _cos.createCos; + } +}); +Object.defineProperty(exports, "createCosh", { + enumerable: true, + get: function () { + return _cosh.createCosh; + } +}); +Object.defineProperty(exports, "createCot", { + enumerable: true, + get: function () { + return _cot.createCot; + } +}); +Object.defineProperty(exports, "createCoth", { + enumerable: true, + get: function () { + return _coth.createCoth; + } +}); +Object.defineProperty(exports, "createCoulomb", { + enumerable: true, + get: function () { + return _physicalConstants.createCoulomb; + } +}); +Object.defineProperty(exports, "createCount", { + enumerable: true, + get: function () { + return _count.createCount; + } +}); +Object.defineProperty(exports, "createCreateUnit", { + enumerable: true, + get: function () { + return _createUnit.createCreateUnit; + } +}); +Object.defineProperty(exports, "createCross", { + enumerable: true, + get: function () { + return _cross.createCross; + } +}); +Object.defineProperty(exports, "createCsc", { + enumerable: true, + get: function () { + return _csc.createCsc; + } +}); +Object.defineProperty(exports, "createCsch", { + enumerable: true, + get: function () { + return _csch.createCsch; + } +}); +Object.defineProperty(exports, "createCtranspose", { + enumerable: true, + get: function () { + return _ctranspose.createCtranspose; + } +}); +Object.defineProperty(exports, "createCube", { + enumerable: true, + get: function () { + return _cube.createCube; + } +}); +Object.defineProperty(exports, "createCumSum", { + enumerable: true, + get: function () { + return _cumsum.createCumSum; + } +}); +Object.defineProperty(exports, "createCumSumTransform", { + enumerable: true, + get: function () { + return _cumsumTransform.createCumSumTransform; + } +}); +Object.defineProperty(exports, "createDeepEqual", { + enumerable: true, + get: function () { + return _deepEqual.createDeepEqual; + } +}); +Object.defineProperty(exports, "createDenseMatrixClass", { + enumerable: true, + get: function () { + return _DenseMatrix.createDenseMatrixClass; + } +}); +Object.defineProperty(exports, "createDerivative", { + enumerable: true, + get: function () { + return _derivative.createDerivative; + } +}); +Object.defineProperty(exports, "createDet", { + enumerable: true, + get: function () { + return _det.createDet; + } +}); +Object.defineProperty(exports, "createDeuteronMass", { + enumerable: true, + get: function () { + return _physicalConstants.createDeuteronMass; + } +}); +Object.defineProperty(exports, "createDiag", { + enumerable: true, + get: function () { + return _diag.createDiag; + } +}); +Object.defineProperty(exports, "createDiff", { + enumerable: true, + get: function () { + return _diff.createDiff; + } +}); +Object.defineProperty(exports, "createDiffTransform", { + enumerable: true, + get: function () { + return _diffTransform.createDiffTransform; + } +}); +Object.defineProperty(exports, "createDistance", { + enumerable: true, + get: function () { + return _distance.createDistance; + } +}); +Object.defineProperty(exports, "createDivide", { + enumerable: true, + get: function () { + return _divide.createDivide; + } +}); +Object.defineProperty(exports, "createDivideScalar", { + enumerable: true, + get: function () { + return _divideScalar.createDivideScalar; + } +}); +Object.defineProperty(exports, "createDot", { + enumerable: true, + get: function () { + return _dot.createDot; + } +}); +Object.defineProperty(exports, "createDotDivide", { + enumerable: true, + get: function () { + return _dotDivide.createDotDivide; + } +}); +Object.defineProperty(exports, "createDotMultiply", { + enumerable: true, + get: function () { + return _dotMultiply.createDotMultiply; + } +}); +Object.defineProperty(exports, "createDotPow", { + enumerable: true, + get: function () { + return _dotPow.createDotPow; + } +}); +Object.defineProperty(exports, "createE", { + enumerable: true, + get: function () { + return _constants.createE; + } +}); +Object.defineProperty(exports, "createEfimovFactor", { + enumerable: true, + get: function () { + return _physicalConstants.createEfimovFactor; + } +}); +Object.defineProperty(exports, "createEigs", { + enumerable: true, + get: function () { + return _eigs.createEigs; + } +}); +Object.defineProperty(exports, "createElectricConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createElectricConstant; + } +}); +Object.defineProperty(exports, "createElectronMass", { + enumerable: true, + get: function () { + return _physicalConstants.createElectronMass; + } +}); +Object.defineProperty(exports, "createElementaryCharge", { + enumerable: true, + get: function () { + return _physicalConstants.createElementaryCharge; + } +}); +Object.defineProperty(exports, "createEqual", { + enumerable: true, + get: function () { + return _equal.createEqual; + } +}); +Object.defineProperty(exports, "createEqualScalar", { + enumerable: true, + get: function () { + return _equalScalar.createEqualScalar; + } +}); +Object.defineProperty(exports, "createEqualText", { + enumerable: true, + get: function () { + return _equalText.createEqualText; + } +}); +Object.defineProperty(exports, "createErf", { + enumerable: true, + get: function () { + return _erf.createErf; + } +}); +Object.defineProperty(exports, "createEvaluate", { + enumerable: true, + get: function () { + return _evaluate.createEvaluate; + } +}); +Object.defineProperty(exports, "createExp", { + enumerable: true, + get: function () { + return _exp.createExp; + } +}); +Object.defineProperty(exports, "createExpm", { + enumerable: true, + get: function () { + return _expm2.createExpm; + } +}); +Object.defineProperty(exports, "createExpm1", { + enumerable: true, + get: function () { + return _expm.createExpm1; + } +}); +Object.defineProperty(exports, "createFactorial", { + enumerable: true, + get: function () { + return _factorial.createFactorial; + } +}); +Object.defineProperty(exports, "createFalse", { + enumerable: true, + get: function () { + return _constants.createFalse; + } +}); +Object.defineProperty(exports, "createFaraday", { + enumerable: true, + get: function () { + return _physicalConstants.createFaraday; + } +}); +Object.defineProperty(exports, "createFermiCoupling", { + enumerable: true, + get: function () { + return _physicalConstants.createFermiCoupling; + } +}); +Object.defineProperty(exports, "createFft", { + enumerable: true, + get: function () { + return _fft.createFft; + } +}); +Object.defineProperty(exports, "createFibonacciHeapClass", { + enumerable: true, + get: function () { + return _FibonacciHeap.createFibonacciHeapClass; + } +}); +Object.defineProperty(exports, "createFilter", { + enumerable: true, + get: function () { + return _filter.createFilter; + } +}); +Object.defineProperty(exports, "createFilterTransform", { + enumerable: true, + get: function () { + return _filterTransform.createFilterTransform; + } +}); +Object.defineProperty(exports, "createFineStructure", { + enumerable: true, + get: function () { + return _physicalConstants.createFineStructure; + } +}); +Object.defineProperty(exports, "createFirstRadiation", { + enumerable: true, + get: function () { + return _physicalConstants.createFirstRadiation; + } +}); +Object.defineProperty(exports, "createFix", { + enumerable: true, + get: function () { + return _fix.createFix; + } +}); +Object.defineProperty(exports, "createFlatten", { + enumerable: true, + get: function () { + return _flatten.createFlatten; + } +}); +Object.defineProperty(exports, "createFloor", { + enumerable: true, + get: function () { + return _floor.createFloor; + } +}); +Object.defineProperty(exports, "createForEach", { + enumerable: true, + get: function () { + return _forEach.createForEach; + } +}); +Object.defineProperty(exports, "createForEachTransform", { + enumerable: true, + get: function () { + return _forEachTransform.createForEachTransform; + } +}); +Object.defineProperty(exports, "createFormat", { + enumerable: true, + get: function () { + return _format.createFormat; + } +}); +Object.defineProperty(exports, "createFraction", { + enumerable: true, + get: function () { + return _fraction.createFraction; + } +}); +Object.defineProperty(exports, "createFractionClass", { + enumerable: true, + get: function () { + return _Fraction.createFractionClass; + } +}); +Object.defineProperty(exports, "createFreqz", { + enumerable: true, + get: function () { + return _freqz.createFreqz; + } +}); +Object.defineProperty(exports, "createFunctionAssignmentNode", { + enumerable: true, + get: function () { + return _FunctionAssignmentNode.createFunctionAssignmentNode; + } +}); +Object.defineProperty(exports, "createFunctionNode", { + enumerable: true, + get: function () { + return _FunctionNode.createFunctionNode; + } +}); +Object.defineProperty(exports, "createGamma", { + enumerable: true, + get: function () { + return _gamma.createGamma; + } +}); +Object.defineProperty(exports, "createGasConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createGasConstant; + } +}); +Object.defineProperty(exports, "createGcd", { + enumerable: true, + get: function () { + return _gcd.createGcd; + } +}); +Object.defineProperty(exports, "createGetMatrixDataType", { + enumerable: true, + get: function () { + return _getMatrixDataType.createGetMatrixDataType; + } +}); +Object.defineProperty(exports, "createGravitationConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createGravitationConstant; + } +}); +Object.defineProperty(exports, "createGravity", { + enumerable: true, + get: function () { + return _physicalConstants.createGravity; + } +}); +Object.defineProperty(exports, "createHartreeEnergy", { + enumerable: true, + get: function () { + return _physicalConstants.createHartreeEnergy; + } +}); +Object.defineProperty(exports, "createHasNumericValue", { + enumerable: true, + get: function () { + return _hasNumericValue.createHasNumericValue; + } +}); +Object.defineProperty(exports, "createHelp", { + enumerable: true, + get: function () { + return _help.createHelp; + } +}); +Object.defineProperty(exports, "createHelpClass", { + enumerable: true, + get: function () { + return _Help.createHelpClass; + } +}); +Object.defineProperty(exports, "createHex", { + enumerable: true, + get: function () { + return _hex.createHex; + } +}); +Object.defineProperty(exports, "createHypot", { + enumerable: true, + get: function () { + return _hypot.createHypot; + } +}); +Object.defineProperty(exports, "createI", { + enumerable: true, + get: function () { + return _constants.createI; + } +}); +Object.defineProperty(exports, "createIdentity", { + enumerable: true, + get: function () { + return _identity.createIdentity; + } +}); +Object.defineProperty(exports, "createIfft", { + enumerable: true, + get: function () { + return _ifft.createIfft; + } +}); +Object.defineProperty(exports, "createIm", { + enumerable: true, + get: function () { + return _im.createIm; + } +}); +Object.defineProperty(exports, "createImmutableDenseMatrixClass", { + enumerable: true, + get: function () { + return _ImmutableDenseMatrix.createImmutableDenseMatrixClass; + } +}); +Object.defineProperty(exports, "createIndex", { + enumerable: true, + get: function () { + return _index.createIndex; + } +}); +Object.defineProperty(exports, "createIndexClass", { + enumerable: true, + get: function () { + return _MatrixIndex.createIndexClass; + } +}); +Object.defineProperty(exports, "createIndexNode", { + enumerable: true, + get: function () { + return _IndexNode.createIndexNode; + } +}); +Object.defineProperty(exports, "createIndexTransform", { + enumerable: true, + get: function () { + return _indexTransform.createIndexTransform; + } +}); +Object.defineProperty(exports, "createInfinity", { + enumerable: true, + get: function () { + return _constants.createInfinity; + } +}); +Object.defineProperty(exports, "createIntersect", { + enumerable: true, + get: function () { + return _intersect.createIntersect; + } +}); +Object.defineProperty(exports, "createInv", { + enumerable: true, + get: function () { + return _inv.createInv; + } +}); +Object.defineProperty(exports, "createInverseConductanceQuantum", { + enumerable: true, + get: function () { + return _physicalConstants.createInverseConductanceQuantum; + } +}); +Object.defineProperty(exports, "createInvmod", { + enumerable: true, + get: function () { + return _invmod.createInvmod; + } +}); +Object.defineProperty(exports, "createIsInteger", { + enumerable: true, + get: function () { + return _isInteger.createIsInteger; + } +}); +Object.defineProperty(exports, "createIsNaN", { + enumerable: true, + get: function () { + return _isNaN.createIsNaN; + } +}); +Object.defineProperty(exports, "createIsNegative", { + enumerable: true, + get: function () { + return _isNegative.createIsNegative; + } +}); +Object.defineProperty(exports, "createIsNumeric", { + enumerable: true, + get: function () { + return _isNumeric.createIsNumeric; + } +}); +Object.defineProperty(exports, "createIsPositive", { + enumerable: true, + get: function () { + return _isPositive.createIsPositive; + } +}); +Object.defineProperty(exports, "createIsPrime", { + enumerable: true, + get: function () { + return _isPrime.createIsPrime; + } +}); +Object.defineProperty(exports, "createIsZero", { + enumerable: true, + get: function () { + return _isZero.createIsZero; + } +}); +Object.defineProperty(exports, "createKldivergence", { + enumerable: true, + get: function () { + return _kldivergence.createKldivergence; + } +}); +Object.defineProperty(exports, "createKlitzing", { + enumerable: true, + get: function () { + return _physicalConstants.createKlitzing; + } +}); +Object.defineProperty(exports, "createKron", { + enumerable: true, + get: function () { + return _kron.createKron; + } +}); +Object.defineProperty(exports, "createLN10", { + enumerable: true, + get: function () { + return _constants.createLN10; + } +}); +Object.defineProperty(exports, "createLN2", { + enumerable: true, + get: function () { + return _constants.createLN2; + } +}); +Object.defineProperty(exports, "createLOG10E", { + enumerable: true, + get: function () { + return _constants.createLOG10E; + } +}); +Object.defineProperty(exports, "createLOG2E", { + enumerable: true, + get: function () { + return _constants.createLOG2E; + } +}); +Object.defineProperty(exports, "createLarger", { + enumerable: true, + get: function () { + return _larger.createLarger; + } +}); +Object.defineProperty(exports, "createLargerEq", { + enumerable: true, + get: function () { + return _largerEq.createLargerEq; + } +}); +Object.defineProperty(exports, "createLcm", { + enumerable: true, + get: function () { + return _lcm.createLcm; + } +}); +Object.defineProperty(exports, "createLeafCount", { + enumerable: true, + get: function () { + return _leafCount.createLeafCount; + } +}); +Object.defineProperty(exports, "createLeftShift", { + enumerable: true, + get: function () { + return _leftShift.createLeftShift; + } +}); +Object.defineProperty(exports, "createLgamma", { + enumerable: true, + get: function () { + return _lgamma.createLgamma; + } +}); +Object.defineProperty(exports, "createLog", { + enumerable: true, + get: function () { + return _log3.createLog; + } +}); +Object.defineProperty(exports, "createLog10", { + enumerable: true, + get: function () { + return _log.createLog10; + } +}); +Object.defineProperty(exports, "createLog1p", { + enumerable: true, + get: function () { + return _log1p.createLog1p; + } +}); +Object.defineProperty(exports, "createLog2", { + enumerable: true, + get: function () { + return _log2.createLog2; + } +}); +Object.defineProperty(exports, "createLoschmidt", { + enumerable: true, + get: function () { + return _physicalConstants.createLoschmidt; + } +}); +Object.defineProperty(exports, "createLsolve", { + enumerable: true, + get: function () { + return _lsolve.createLsolve; + } +}); +Object.defineProperty(exports, "createLsolveAll", { + enumerable: true, + get: function () { + return _lsolveAll.createLsolveAll; + } +}); +Object.defineProperty(exports, "createLup", { + enumerable: true, + get: function () { + return _lup.createLup; + } +}); +Object.defineProperty(exports, "createLusolve", { + enumerable: true, + get: function () { + return _lusolve.createLusolve; + } +}); +Object.defineProperty(exports, "createLyap", { + enumerable: true, + get: function () { + return _lyap.createLyap; + } +}); +Object.defineProperty(exports, "createMad", { + enumerable: true, + get: function () { + return _mad.createMad; + } +}); +Object.defineProperty(exports, "createMagneticConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createMagneticConstant; + } +}); +Object.defineProperty(exports, "createMagneticFluxQuantum", { + enumerable: true, + get: function () { + return _physicalConstants.createMagneticFluxQuantum; + } +}); +Object.defineProperty(exports, "createMap", { + enumerable: true, + get: function () { + return _map.createMap; + } +}); +Object.defineProperty(exports, "createMapTransform", { + enumerable: true, + get: function () { + return _mapTransform.createMapTransform; + } +}); +Object.defineProperty(exports, "createMatrix", { + enumerable: true, + get: function () { + return _matrix.createMatrix; + } +}); +Object.defineProperty(exports, "createMatrixClass", { + enumerable: true, + get: function () { + return _Matrix.createMatrixClass; + } +}); +Object.defineProperty(exports, "createMatrixFromColumns", { + enumerable: true, + get: function () { + return _matrixFromColumns.createMatrixFromColumns; + } +}); +Object.defineProperty(exports, "createMatrixFromFunction", { + enumerable: true, + get: function () { + return _matrixFromFunction.createMatrixFromFunction; + } +}); +Object.defineProperty(exports, "createMatrixFromRows", { + enumerable: true, + get: function () { + return _matrixFromRows.createMatrixFromRows; + } +}); +Object.defineProperty(exports, "createMax", { + enumerable: true, + get: function () { + return _max.createMax; + } +}); +Object.defineProperty(exports, "createMaxTransform", { + enumerable: true, + get: function () { + return _maxTransform.createMaxTransform; + } +}); +Object.defineProperty(exports, "createMean", { + enumerable: true, + get: function () { + return _mean.createMean; + } +}); +Object.defineProperty(exports, "createMeanTransform", { + enumerable: true, + get: function () { + return _meanTransform.createMeanTransform; + } +}); +Object.defineProperty(exports, "createMedian", { + enumerable: true, + get: function () { + return _median.createMedian; + } +}); +Object.defineProperty(exports, "createMin", { + enumerable: true, + get: function () { + return _min.createMin; + } +}); +Object.defineProperty(exports, "createMinTransform", { + enumerable: true, + get: function () { + return _minTransform.createMinTransform; + } +}); +Object.defineProperty(exports, "createMod", { + enumerable: true, + get: function () { + return _mod.createMod; + } +}); +Object.defineProperty(exports, "createMode", { + enumerable: true, + get: function () { + return _mode.createMode; + } +}); +Object.defineProperty(exports, "createMolarMass", { + enumerable: true, + get: function () { + return _physicalConstants.createMolarMass; + } +}); +Object.defineProperty(exports, "createMolarMassC12", { + enumerable: true, + get: function () { + return _physicalConstants.createMolarMassC12; + } +}); +Object.defineProperty(exports, "createMolarPlanckConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createMolarPlanckConstant; + } +}); +Object.defineProperty(exports, "createMolarVolume", { + enumerable: true, + get: function () { + return _physicalConstants.createMolarVolume; + } +}); +Object.defineProperty(exports, "createMultinomial", { + enumerable: true, + get: function () { + return _multinomial.createMultinomial; + } +}); +Object.defineProperty(exports, "createMultiply", { + enumerable: true, + get: function () { + return _multiply.createMultiply; + } +}); +Object.defineProperty(exports, "createMultiplyScalar", { + enumerable: true, + get: function () { + return _multiplyScalar.createMultiplyScalar; + } +}); +Object.defineProperty(exports, "createNaN", { + enumerable: true, + get: function () { + return _constants.createNaN; + } +}); +Object.defineProperty(exports, "createNeutronMass", { + enumerable: true, + get: function () { + return _physicalConstants.createNeutronMass; + } +}); +Object.defineProperty(exports, "createNode", { + enumerable: true, + get: function () { + return _Node.createNode; + } +}); +Object.defineProperty(exports, "createNorm", { + enumerable: true, + get: function () { + return _norm.createNorm; + } +}); +Object.defineProperty(exports, "createNot", { + enumerable: true, + get: function () { + return _not.createNot; + } +}); +Object.defineProperty(exports, "createNthRoot", { + enumerable: true, + get: function () { + return _nthRoot.createNthRoot; + } +}); +Object.defineProperty(exports, "createNthRoots", { + enumerable: true, + get: function () { + return _nthRoots.createNthRoots; + } +}); +Object.defineProperty(exports, "createNuclearMagneton", { + enumerable: true, + get: function () { + return _physicalConstants.createNuclearMagneton; + } +}); +Object.defineProperty(exports, "createNull", { + enumerable: true, + get: function () { + return _constants.createNull; + } +}); +Object.defineProperty(exports, "createNumber", { + enumerable: true, + get: function () { + return _number.createNumber; + } +}); +Object.defineProperty(exports, "createNumeric", { + enumerable: true, + get: function () { + return _numeric.createNumeric; + } +}); +Object.defineProperty(exports, "createObjectNode", { + enumerable: true, + get: function () { + return _ObjectNode.createObjectNode; + } +}); +Object.defineProperty(exports, "createOct", { + enumerable: true, + get: function () { + return _oct.createOct; + } +}); +Object.defineProperty(exports, "createOnes", { + enumerable: true, + get: function () { + return _ones.createOnes; + } +}); +Object.defineProperty(exports, "createOperatorNode", { + enumerable: true, + get: function () { + return _OperatorNode.createOperatorNode; + } +}); +Object.defineProperty(exports, "createOr", { + enumerable: true, + get: function () { + return _or.createOr; + } +}); +Object.defineProperty(exports, "createOrTransform", { + enumerable: true, + get: function () { + return _orTransform.createOrTransform; + } +}); +Object.defineProperty(exports, "createParenthesisNode", { + enumerable: true, + get: function () { + return _ParenthesisNode.createParenthesisNode; + } +}); +Object.defineProperty(exports, "createParse", { + enumerable: true, + get: function () { + return _parse.createParse; + } +}); +Object.defineProperty(exports, "createParser", { + enumerable: true, + get: function () { + return _parser.createParser; + } +}); +Object.defineProperty(exports, "createParserClass", { + enumerable: true, + get: function () { + return _Parser.createParserClass; + } +}); +Object.defineProperty(exports, "createPartitionSelect", { + enumerable: true, + get: function () { + return _partitionSelect.createPartitionSelect; + } +}); +Object.defineProperty(exports, "createPermutations", { + enumerable: true, + get: function () { + return _permutations.createPermutations; + } +}); +Object.defineProperty(exports, "createPhi", { + enumerable: true, + get: function () { + return _constants.createPhi; + } +}); +Object.defineProperty(exports, "createPi", { + enumerable: true, + get: function () { + return _constants.createPi; + } +}); +Object.defineProperty(exports, "createPickRandom", { + enumerable: true, + get: function () { + return _pickRandom.createPickRandom; + } +}); +Object.defineProperty(exports, "createPinv", { + enumerable: true, + get: function () { + return _pinv.createPinv; + } +}); +Object.defineProperty(exports, "createPlanckCharge", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckCharge; + } +}); +Object.defineProperty(exports, "createPlanckConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckConstant; + } +}); +Object.defineProperty(exports, "createPlanckLength", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckLength; + } +}); +Object.defineProperty(exports, "createPlanckMass", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckMass; + } +}); +Object.defineProperty(exports, "createPlanckTemperature", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckTemperature; + } +}); +Object.defineProperty(exports, "createPlanckTime", { + enumerable: true, + get: function () { + return _physicalConstants.createPlanckTime; + } +}); +Object.defineProperty(exports, "createPolynomialRoot", { + enumerable: true, + get: function () { + return _polynomialRoot.createPolynomialRoot; + } +}); +Object.defineProperty(exports, "createPow", { + enumerable: true, + get: function () { + return _pow.createPow; + } +}); +Object.defineProperty(exports, "createPrint", { + enumerable: true, + get: function () { + return _print.createPrint; + } +}); +Object.defineProperty(exports, "createPrintTransform", { + enumerable: true, + get: function () { + return _printTransform.createPrintTransform; + } +}); +Object.defineProperty(exports, "createProd", { + enumerable: true, + get: function () { + return _prod.createProd; + } +}); +Object.defineProperty(exports, "createProtonMass", { + enumerable: true, + get: function () { + return _physicalConstants.createProtonMass; + } +}); +Object.defineProperty(exports, "createQr", { + enumerable: true, + get: function () { + return _qr.createQr; + } +}); +Object.defineProperty(exports, "createQuantileSeq", { + enumerable: true, + get: function () { + return _quantileSeq.createQuantileSeq; + } +}); +Object.defineProperty(exports, "createQuantileSeqTransform", { + enumerable: true, + get: function () { + return _quantileSeqTransform.createQuantileSeqTransform; + } +}); +Object.defineProperty(exports, "createQuantumOfCirculation", { + enumerable: true, + get: function () { + return _physicalConstants.createQuantumOfCirculation; + } +}); +Object.defineProperty(exports, "createRandom", { + enumerable: true, + get: function () { + return _random.createRandom; + } +}); +Object.defineProperty(exports, "createRandomInt", { + enumerable: true, + get: function () { + return _randomInt.createRandomInt; + } +}); +Object.defineProperty(exports, "createRange", { + enumerable: true, + get: function () { + return _range.createRange; + } +}); +Object.defineProperty(exports, "createRangeClass", { + enumerable: true, + get: function () { + return _Range.createRangeClass; + } +}); +Object.defineProperty(exports, "createRangeNode", { + enumerable: true, + get: function () { + return _RangeNode.createRangeNode; + } +}); +Object.defineProperty(exports, "createRangeTransform", { + enumerable: true, + get: function () { + return _rangeTransform.createRangeTransform; + } +}); +Object.defineProperty(exports, "createRationalize", { + enumerable: true, + get: function () { + return _rationalize.createRationalize; + } +}); +Object.defineProperty(exports, "createRe", { + enumerable: true, + get: function () { + return _re.createRe; + } +}); +Object.defineProperty(exports, "createReducedPlanckConstant", { + enumerable: true, + get: function () { + return _physicalConstants.createReducedPlanckConstant; + } +}); +Object.defineProperty(exports, "createRelationalNode", { + enumerable: true, + get: function () { + return _RelationalNode.createRelationalNode; + } +}); +Object.defineProperty(exports, "createReplacer", { + enumerable: true, + get: function () { + return _replacer.createReplacer; + } +}); +Object.defineProperty(exports, "createReshape", { + enumerable: true, + get: function () { + return _reshape.createReshape; + } +}); +Object.defineProperty(exports, "createResize", { + enumerable: true, + get: function () { + return _resize.createResize; + } +}); +Object.defineProperty(exports, "createResolve", { + enumerable: true, + get: function () { + return _resolve.createResolve; + } +}); +Object.defineProperty(exports, "createResultSet", { + enumerable: true, + get: function () { + return _ResultSet.createResultSet; + } +}); +Object.defineProperty(exports, "createReviver", { + enumerable: true, + get: function () { + return _reviver.createReviver; + } +}); +Object.defineProperty(exports, "createRightArithShift", { + enumerable: true, + get: function () { + return _rightArithShift.createRightArithShift; + } +}); +Object.defineProperty(exports, "createRightLogShift", { + enumerable: true, + get: function () { + return _rightLogShift.createRightLogShift; + } +}); +Object.defineProperty(exports, "createRotate", { + enumerable: true, + get: function () { + return _rotate.createRotate; + } +}); +Object.defineProperty(exports, "createRotationMatrix", { + enumerable: true, + get: function () { + return _rotationMatrix.createRotationMatrix; + } +}); +Object.defineProperty(exports, "createRound", { + enumerable: true, + get: function () { + return _round.createRound; + } +}); +Object.defineProperty(exports, "createRow", { + enumerable: true, + get: function () { + return _row.createRow; + } +}); +Object.defineProperty(exports, "createRowTransform", { + enumerable: true, + get: function () { + return _rowTransform.createRowTransform; + } +}); +Object.defineProperty(exports, "createRydberg", { + enumerable: true, + get: function () { + return _physicalConstants.createRydberg; + } +}); +Object.defineProperty(exports, "createSQRT1_2", { + enumerable: true, + get: function () { + return _constants.createSQRT1_2; + } +}); +Object.defineProperty(exports, "createSQRT2", { + enumerable: true, + get: function () { + return _constants.createSQRT2; + } +}); +Object.defineProperty(exports, "createSackurTetrode", { + enumerable: true, + get: function () { + return _physicalConstants.createSackurTetrode; + } +}); +Object.defineProperty(exports, "createSchur", { + enumerable: true, + get: function () { + return _schur.createSchur; + } +}); +Object.defineProperty(exports, "createSec", { + enumerable: true, + get: function () { + return _sec.createSec; + } +}); +Object.defineProperty(exports, "createSech", { + enumerable: true, + get: function () { + return _sech.createSech; + } +}); +Object.defineProperty(exports, "createSecondRadiation", { + enumerable: true, + get: function () { + return _physicalConstants.createSecondRadiation; + } +}); +Object.defineProperty(exports, "createSetCartesian", { + enumerable: true, + get: function () { + return _setCartesian.createSetCartesian; + } +}); +Object.defineProperty(exports, "createSetDifference", { + enumerable: true, + get: function () { + return _setDifference.createSetDifference; + } +}); +Object.defineProperty(exports, "createSetDistinct", { + enumerable: true, + get: function () { + return _setDistinct.createSetDistinct; + } +}); +Object.defineProperty(exports, "createSetIntersect", { + enumerable: true, + get: function () { + return _setIntersect.createSetIntersect; + } +}); +Object.defineProperty(exports, "createSetIsSubset", { + enumerable: true, + get: function () { + return _setIsSubset.createSetIsSubset; + } +}); +Object.defineProperty(exports, "createSetMultiplicity", { + enumerable: true, + get: function () { + return _setMultiplicity.createSetMultiplicity; + } +}); +Object.defineProperty(exports, "createSetPowerset", { + enumerable: true, + get: function () { + return _setPowerset.createSetPowerset; + } +}); +Object.defineProperty(exports, "createSetSize", { + enumerable: true, + get: function () { + return _setSize.createSetSize; + } +}); +Object.defineProperty(exports, "createSetSymDifference", { + enumerable: true, + get: function () { + return _setSymDifference.createSetSymDifference; + } +}); +Object.defineProperty(exports, "createSetUnion", { + enumerable: true, + get: function () { + return _setUnion.createSetUnion; + } +}); +Object.defineProperty(exports, "createSign", { + enumerable: true, + get: function () { + return _sign.createSign; + } +}); +Object.defineProperty(exports, "createSimplify", { + enumerable: true, + get: function () { + return _simplify.createSimplify; + } +}); +Object.defineProperty(exports, "createSimplifyConstant", { + enumerable: true, + get: function () { + return _simplifyConstant.createSimplifyConstant; + } +}); +Object.defineProperty(exports, "createSimplifyCore", { + enumerable: true, + get: function () { + return _simplifyCore.createSimplifyCore; + } +}); +Object.defineProperty(exports, "createSin", { + enumerable: true, + get: function () { + return _sin.createSin; + } +}); +Object.defineProperty(exports, "createSinh", { + enumerable: true, + get: function () { + return _sinh.createSinh; + } +}); +Object.defineProperty(exports, "createSize", { + enumerable: true, + get: function () { + return _size.createSize; + } +}); +Object.defineProperty(exports, "createSlu", { + enumerable: true, + get: function () { + return _slu.createSlu; + } +}); +Object.defineProperty(exports, "createSmaller", { + enumerable: true, + get: function () { + return _smaller.createSmaller; + } +}); +Object.defineProperty(exports, "createSmallerEq", { + enumerable: true, + get: function () { + return _smallerEq.createSmallerEq; + } +}); +Object.defineProperty(exports, "createSolveODE", { + enumerable: true, + get: function () { + return _solveODE.createSolveODE; + } +}); +Object.defineProperty(exports, "createSort", { + enumerable: true, + get: function () { + return _sort.createSort; + } +}); +Object.defineProperty(exports, "createSpaClass", { + enumerable: true, + get: function () { + return _Spa.createSpaClass; + } +}); +Object.defineProperty(exports, "createSparse", { + enumerable: true, + get: function () { + return _sparse.createSparse; + } +}); +Object.defineProperty(exports, "createSparseMatrixClass", { + enumerable: true, + get: function () { + return _SparseMatrix.createSparseMatrixClass; + } +}); +Object.defineProperty(exports, "createSpeedOfLight", { + enumerable: true, + get: function () { + return _physicalConstants.createSpeedOfLight; + } +}); +Object.defineProperty(exports, "createSplitUnit", { + enumerable: true, + get: function () { + return _splitUnit.createSplitUnit; + } +}); +Object.defineProperty(exports, "createSqrt", { + enumerable: true, + get: function () { + return _sqrt.createSqrt; + } +}); +Object.defineProperty(exports, "createSqrtm", { + enumerable: true, + get: function () { + return _sqrtm.createSqrtm; + } +}); +Object.defineProperty(exports, "createSquare", { + enumerable: true, + get: function () { + return _square.createSquare; + } +}); +Object.defineProperty(exports, "createSqueeze", { + enumerable: true, + get: function () { + return _squeeze.createSqueeze; + } +}); +Object.defineProperty(exports, "createStd", { + enumerable: true, + get: function () { + return _std.createStd; + } +}); +Object.defineProperty(exports, "createStdTransform", { + enumerable: true, + get: function () { + return _stdTransform.createStdTransform; + } +}); +Object.defineProperty(exports, "createStefanBoltzmann", { + enumerable: true, + get: function () { + return _physicalConstants.createStefanBoltzmann; + } +}); +Object.defineProperty(exports, "createStirlingS2", { + enumerable: true, + get: function () { + return _stirlingS.createStirlingS2; + } +}); +Object.defineProperty(exports, "createString", { + enumerable: true, + get: function () { + return _string.createString; + } +}); +Object.defineProperty(exports, "createSubset", { + enumerable: true, + get: function () { + return _subset.createSubset; + } +}); +Object.defineProperty(exports, "createSubsetTransform", { + enumerable: true, + get: function () { + return _subsetTransform.createSubsetTransform; + } +}); +Object.defineProperty(exports, "createSubtract", { + enumerable: true, + get: function () { + return _subtract.createSubtract; + } +}); +Object.defineProperty(exports, "createSubtractScalar", { + enumerable: true, + get: function () { + return _subtractScalar.createSubtractScalar; + } +}); +Object.defineProperty(exports, "createSum", { + enumerable: true, + get: function () { + return _sum.createSum; + } +}); +Object.defineProperty(exports, "createSumTransform", { + enumerable: true, + get: function () { + return _sumTransform.createSumTransform; + } +}); +Object.defineProperty(exports, "createSylvester", { + enumerable: true, + get: function () { + return _sylvester.createSylvester; + } +}); +Object.defineProperty(exports, "createSymbolNode", { + enumerable: true, + get: function () { + return _SymbolNode.createSymbolNode; + } +}); +Object.defineProperty(exports, "createSymbolicEqual", { + enumerable: true, + get: function () { + return _symbolicEqual.createSymbolicEqual; + } +}); +Object.defineProperty(exports, "createTan", { + enumerable: true, + get: function () { + return _tan.createTan; + } +}); +Object.defineProperty(exports, "createTanh", { + enumerable: true, + get: function () { + return _tanh.createTanh; + } +}); +Object.defineProperty(exports, "createTau", { + enumerable: true, + get: function () { + return _constants.createTau; + } +}); +Object.defineProperty(exports, "createThomsonCrossSection", { + enumerable: true, + get: function () { + return _physicalConstants.createThomsonCrossSection; + } +}); +Object.defineProperty(exports, "createTo", { + enumerable: true, + get: function () { + return _to.createTo; + } +}); +Object.defineProperty(exports, "createTrace", { + enumerable: true, + get: function () { + return _trace.createTrace; + } +}); +Object.defineProperty(exports, "createTranspose", { + enumerable: true, + get: function () { + return _transpose.createTranspose; + } +}); +Object.defineProperty(exports, "createTrue", { + enumerable: true, + get: function () { + return _constants.createTrue; + } +}); +Object.defineProperty(exports, "createTypeOf", { + enumerable: true, + get: function () { + return _typeOf.createTypeOf; + } +}); +Object.defineProperty(exports, "createTyped", { + enumerable: true, + get: function () { + return _typed.createTyped; + } +}); +Object.defineProperty(exports, "createUnaryMinus", { + enumerable: true, + get: function () { + return _unaryMinus.createUnaryMinus; + } +}); +Object.defineProperty(exports, "createUnaryPlus", { + enumerable: true, + get: function () { + return _unaryPlus.createUnaryPlus; + } +}); +Object.defineProperty(exports, "createUnequal", { + enumerable: true, + get: function () { + return _unequal.createUnequal; + } +}); +Object.defineProperty(exports, "createUnitClass", { + enumerable: true, + get: function () { + return _Unit.createUnitClass; + } +}); +Object.defineProperty(exports, "createUnitFunction", { + enumerable: true, + get: function () { + return _unit.createUnitFunction; + } +}); +Object.defineProperty(exports, "createUppercaseE", { + enumerable: true, + get: function () { + return _constants.createUppercaseE; + } +}); +Object.defineProperty(exports, "createUppercasePi", { + enumerable: true, + get: function () { + return _constants.createUppercasePi; + } +}); +Object.defineProperty(exports, "createUsolve", { + enumerable: true, + get: function () { + return _usolve.createUsolve; + } +}); +Object.defineProperty(exports, "createUsolveAll", { + enumerable: true, + get: function () { + return _usolveAll.createUsolveAll; + } +}); +Object.defineProperty(exports, "createVacuumImpedance", { + enumerable: true, + get: function () { + return _physicalConstants.createVacuumImpedance; + } +}); +Object.defineProperty(exports, "createVariance", { + enumerable: true, + get: function () { + return _variance.createVariance; + } +}); +Object.defineProperty(exports, "createVarianceTransform", { + enumerable: true, + get: function () { + return _varianceTransform.createVarianceTransform; + } +}); +Object.defineProperty(exports, "createVersion", { + enumerable: true, + get: function () { + return _constants.createVersion; + } +}); +Object.defineProperty(exports, "createWeakMixingAngle", { + enumerable: true, + get: function () { + return _physicalConstants.createWeakMixingAngle; + } +}); +Object.defineProperty(exports, "createWienDisplacement", { + enumerable: true, + get: function () { + return _physicalConstants.createWienDisplacement; + } +}); +Object.defineProperty(exports, "createXgcd", { + enumerable: true, + get: function () { + return _xgcd.createXgcd; + } +}); +Object.defineProperty(exports, "createXor", { + enumerable: true, + get: function () { + return _xor.createXor; + } +}); +Object.defineProperty(exports, "createZeros", { + enumerable: true, + get: function () { + return _zeros.createZeros; + } +}); +Object.defineProperty(exports, "createZeta", { + enumerable: true, + get: function () { + return _zeta.createZeta; + } +}); +Object.defineProperty(exports, "createZpk2tf", { + enumerable: true, + get: function () { + return _zpk2tf.createZpk2tf; + } +}); +var _typed = require("./core/function/typed.js"); +var _ResultSet = require("./type/resultset/ResultSet.js"); +var _BigNumber = require("./type/bignumber/BigNumber.js"); +var _Complex = require("./type/complex/Complex.js"); +var _Fraction = require("./type/fraction/Fraction.js"); +var _Range = require("./type/matrix/Range.js"); +var _Matrix = require("./type/matrix/Matrix.js"); +var _DenseMatrix = require("./type/matrix/DenseMatrix.js"); +var _clone = require("./function/utils/clone.js"); +var _isInteger = require("./function/utils/isInteger.js"); +var _isNegative = require("./function/utils/isNegative.js"); +var _isNumeric = require("./function/utils/isNumeric.js"); +var _hasNumericValue = require("./function/utils/hasNumericValue.js"); +var _isPositive = require("./function/utils/isPositive.js"); +var _isZero = require("./function/utils/isZero.js"); +var _isNaN = require("./function/utils/isNaN.js"); +var _typeOf = require("./function/utils/typeOf.js"); +var _equalScalar = require("./function/relational/equalScalar.js"); +var _SparseMatrix = require("./type/matrix/SparseMatrix.js"); +var _number = require("./type/number.js"); +var _bigint = require("./type/bigint.js"); +var _string = require("./type/string.js"); +var _boolean = require("./type/boolean.js"); +var _bignumber = require("./type/bignumber/function/bignumber.js"); +var _complex = require("./type/complex/function/complex.js"); +var _fraction = require("./type/fraction/function/fraction.js"); +var _matrix = require("./type/matrix/function/matrix.js"); +var _matrixFromFunction = require("./function/matrix/matrixFromFunction.js"); +var _matrixFromRows = require("./function/matrix/matrixFromRows.js"); +var _matrixFromColumns = require("./function/matrix/matrixFromColumns.js"); +var _splitUnit = require("./type/unit/function/splitUnit.js"); +var _unaryMinus = require("./function/arithmetic/unaryMinus.js"); +var _unaryPlus = require("./function/arithmetic/unaryPlus.js"); +var _abs = require("./function/arithmetic/abs.js"); +var _apply = require("./function/matrix/apply.js"); +var _addScalar = require("./function/arithmetic/addScalar.js"); +var _subtractScalar = require("./function/arithmetic/subtractScalar.js"); +var _cbrt = require("./function/arithmetic/cbrt.js"); +var _ceil = require("./function/arithmetic/ceil.js"); +var _cube = require("./function/arithmetic/cube.js"); +var _exp = require("./function/arithmetic/exp.js"); +var _expm = require("./function/arithmetic/expm1.js"); +var _fix = require("./function/arithmetic/fix.js"); +var _floor = require("./function/arithmetic/floor.js"); +var _gcd = require("./function/arithmetic/gcd.js"); +var _lcm = require("./function/arithmetic/lcm.js"); +var _log = require("./function/arithmetic/log10.js"); +var _log2 = require("./function/arithmetic/log2.js"); +var _mod = require("./function/arithmetic/mod.js"); +var _multiplyScalar = require("./function/arithmetic/multiplyScalar.js"); +var _multiply = require("./function/arithmetic/multiply.js"); +var _nthRoot = require("./function/arithmetic/nthRoot.js"); +var _sign = require("./function/arithmetic/sign.js"); +var _sqrt = require("./function/arithmetic/sqrt.js"); +var _square = require("./function/arithmetic/square.js"); +var _subtract = require("./function/arithmetic/subtract.js"); +var _xgcd = require("./function/arithmetic/xgcd.js"); +var _invmod = require("./function/arithmetic/invmod.js"); +var _dotMultiply = require("./function/arithmetic/dotMultiply.js"); +var _bitAnd = require("./function/bitwise/bitAnd.js"); +var _bitNot = require("./function/bitwise/bitNot.js"); +var _bitOr = require("./function/bitwise/bitOr.js"); +var _bitXor = require("./function/bitwise/bitXor.js"); +var _arg = require("./function/complex/arg.js"); +var _conj = require("./function/complex/conj.js"); +var _im = require("./function/complex/im.js"); +var _re = require("./function/complex/re.js"); +var _not = require("./function/logical/not.js"); +var _or = require("./function/logical/or.js"); +var _xor = require("./function/logical/xor.js"); +var _concat = require("./function/matrix/concat.js"); +var _column = require("./function/matrix/column.js"); +var _count = require("./function/matrix/count.js"); +var _cross = require("./function/matrix/cross.js"); +var _diag = require("./function/matrix/diag.js"); +var _filter = require("./function/matrix/filter.js"); +var _flatten = require("./function/matrix/flatten.js"); +var _forEach = require("./function/matrix/forEach.js"); +var _getMatrixDataType = require("./function/matrix/getMatrixDataType.js"); +var _identity = require("./function/matrix/identity.js"); +var _kron = require("./function/matrix/kron.js"); +var _map = require("./function/matrix/map.js"); +var _diff = require("./function/matrix/diff.js"); +var _ones = require("./function/matrix/ones.js"); +var _range = require("./function/matrix/range.js"); +var _reshape = require("./function/matrix/reshape.js"); +var _resize = require("./function/matrix/resize.js"); +var _rotate = require("./function/matrix/rotate.js"); +var _rotationMatrix = require("./function/matrix/rotationMatrix.js"); +var _row = require("./function/matrix/row.js"); +var _size = require("./function/matrix/size.js"); +var _squeeze = require("./function/matrix/squeeze.js"); +var _subset = require("./function/matrix/subset.js"); +var _transpose = require("./function/matrix/transpose.js"); +var _ctranspose = require("./function/matrix/ctranspose.js"); +var _zeros = require("./function/matrix/zeros.js"); +var _fft = require("./function/matrix/fft.js"); +var _ifft = require("./function/matrix/ifft.js"); +var _solveODE = require("./function/numeric/solveODE.js"); +var _erf = require("./function/special/erf.js"); +var _zeta = require("./function/special/zeta.js"); +var _mode = require("./function/statistics/mode.js"); +var _prod = require("./function/statistics/prod.js"); +var _format = require("./function/string/format.js"); +var _bin = require("./function/string/bin.js"); +var _oct = require("./function/string/oct.js"); +var _hex = require("./function/string/hex.js"); +var _print = require("./function/string/print.js"); +var _to = require("./function/unit/to.js"); +var _isPrime = require("./function/utils/isPrime.js"); +var _numeric = require("./function/utils/numeric.js"); +var _divideScalar = require("./function/arithmetic/divideScalar.js"); +var _pow = require("./function/arithmetic/pow.js"); +var _round = require("./function/arithmetic/round.js"); +var _log3 = require("./function/arithmetic/log.js"); +var _log1p = require("./function/arithmetic/log1p.js"); +var _nthRoots = require("./function/arithmetic/nthRoots.js"); +var _dotPow = require("./function/arithmetic/dotPow.js"); +var _dotDivide = require("./function/arithmetic/dotDivide.js"); +var _lsolve = require("./function/algebra/solver/lsolve.js"); +var _usolve = require("./function/algebra/solver/usolve.js"); +var _lsolveAll = require("./function/algebra/solver/lsolveAll.js"); +var _usolveAll = require("./function/algebra/solver/usolveAll.js"); +var _leftShift = require("./function/bitwise/leftShift.js"); +var _rightArithShift = require("./function/bitwise/rightArithShift.js"); +var _rightLogShift = require("./function/bitwise/rightLogShift.js"); +var _and = require("./function/logical/and.js"); +var _compare = require("./function/relational/compare.js"); +var _compareNatural = require("./function/relational/compareNatural.js"); +var _compareText = require("./function/relational/compareText.js"); +var _equal = require("./function/relational/equal.js"); +var _equalText = require("./function/relational/equalText.js"); +var _smaller = require("./function/relational/smaller.js"); +var _smallerEq = require("./function/relational/smallerEq.js"); +var _larger = require("./function/relational/larger.js"); +var _largerEq = require("./function/relational/largerEq.js"); +var _deepEqual = require("./function/relational/deepEqual.js"); +var _unequal = require("./function/relational/unequal.js"); +var _partitionSelect = require("./function/matrix/partitionSelect.js"); +var _sort = require("./function/matrix/sort.js"); +var _max = require("./function/statistics/max.js"); +var _min = require("./function/statistics/min.js"); +var _ImmutableDenseMatrix = require("./type/matrix/ImmutableDenseMatrix.js"); +var _MatrixIndex = require("./type/matrix/MatrixIndex.js"); +var _FibonacciHeap = require("./type/matrix/FibonacciHeap.js"); +var _Spa = require("./type/matrix/Spa.js"); +var _Unit = require("./type/unit/Unit.js"); +var _unit = require("./type/unit/function/unit.js"); +var _sparse = require("./type/matrix/function/sparse.js"); +var _createUnit = require("./type/unit/function/createUnit.js"); +var _acos = require("./function/trigonometry/acos.js"); +var _acosh = require("./function/trigonometry/acosh.js"); +var _acot = require("./function/trigonometry/acot.js"); +var _acoth = require("./function/trigonometry/acoth.js"); +var _acsc = require("./function/trigonometry/acsc.js"); +var _acsch = require("./function/trigonometry/acsch.js"); +var _asec = require("./function/trigonometry/asec.js"); +var _asech = require("./function/trigonometry/asech.js"); +var _asin = require("./function/trigonometry/asin.js"); +var _asinh = require("./function/trigonometry/asinh.js"); +var _atan = require("./function/trigonometry/atan.js"); +var _atan2 = require("./function/trigonometry/atan2.js"); +var _atanh = require("./function/trigonometry/atanh.js"); +var _cos = require("./function/trigonometry/cos.js"); +var _cosh = require("./function/trigonometry/cosh.js"); +var _cot = require("./function/trigonometry/cot.js"); +var _coth = require("./function/trigonometry/coth.js"); +var _csc = require("./function/trigonometry/csc.js"); +var _csch = require("./function/trigonometry/csch.js"); +var _sec = require("./function/trigonometry/sec.js"); +var _sech = require("./function/trigonometry/sech.js"); +var _sin = require("./function/trigonometry/sin.js"); +var _sinh = require("./function/trigonometry/sinh.js"); +var _tan = require("./function/trigonometry/tan.js"); +var _tanh = require("./function/trigonometry/tanh.js"); +var _setCartesian = require("./function/set/setCartesian.js"); +var _setDifference = require("./function/set/setDifference.js"); +var _setDistinct = require("./function/set/setDistinct.js"); +var _setIntersect = require("./function/set/setIntersect.js"); +var _setIsSubset = require("./function/set/setIsSubset.js"); +var _setMultiplicity = require("./function/set/setMultiplicity.js"); +var _setPowerset = require("./function/set/setPowerset.js"); +var _setSize = require("./function/set/setSize.js"); +var _setSymDifference = require("./function/set/setSymDifference.js"); +var _setUnion = require("./function/set/setUnion.js"); +var _add = require("./function/arithmetic/add.js"); +var _hypot = require("./function/arithmetic/hypot.js"); +var _norm = require("./function/arithmetic/norm.js"); +var _dot = require("./function/matrix/dot.js"); +var _trace = require("./function/matrix/trace.js"); +var _index = require("./type/matrix/function/index.js"); +var _Node = require("./expression/node/Node.js"); +var _AccessorNode = require("./expression/node/AccessorNode.js"); +var _ArrayNode = require("./expression/node/ArrayNode.js"); +var _AssignmentNode = require("./expression/node/AssignmentNode.js"); +var _BlockNode = require("./expression/node/BlockNode.js"); +var _ConditionalNode = require("./expression/node/ConditionalNode.js"); +var _ConstantNode = require("./expression/node/ConstantNode.js"); +var _FunctionAssignmentNode = require("./expression/node/FunctionAssignmentNode.js"); +var _IndexNode = require("./expression/node/IndexNode.js"); +var _ObjectNode = require("./expression/node/ObjectNode.js"); +var _OperatorNode = require("./expression/node/OperatorNode.js"); +var _ParenthesisNode = require("./expression/node/ParenthesisNode.js"); +var _RangeNode = require("./expression/node/RangeNode.js"); +var _RelationalNode = require("./expression/node/RelationalNode.js"); +var _SymbolNode = require("./expression/node/SymbolNode.js"); +var _FunctionNode = require("./expression/node/FunctionNode.js"); +var _parse = require("./expression/parse.js"); +var _compile = require("./expression/function/compile.js"); +var _evaluate = require("./expression/function/evaluate.js"); +var _Parser = require("./expression/Parser.js"); +var _parser = require("./expression/function/parser.js"); +var _lup = require("./function/algebra/decomposition/lup.js"); +var _qr = require("./function/algebra/decomposition/qr.js"); +var _slu = require("./function/algebra/decomposition/slu.js"); +var _lusolve = require("./function/algebra/solver/lusolve.js"); +var _polynomialRoot = require("./function/algebra/polynomialRoot.js"); +var _Help = require("./expression/Help.js"); +var _Chain = require("./type/chain/Chain.js"); +var _help = require("./expression/function/help.js"); +var _chain = require("./type/chain/function/chain.js"); +var _det = require("./function/matrix/det.js"); +var _inv = require("./function/matrix/inv.js"); +var _pinv = require("./function/matrix/pinv.js"); +var _eigs = require("./function/matrix/eigs.js"); +var _expm2 = require("./function/matrix/expm.js"); +var _sqrtm = require("./function/matrix/sqrtm.js"); +var _sylvester = require("./function/algebra/sylvester.js"); +var _schur = require("./function/algebra/decomposition/schur.js"); +var _lyap = require("./function/algebra/lyap.js"); +var _divide = require("./function/arithmetic/divide.js"); +var _distance = require("./function/geometry/distance.js"); +var _intersect = require("./function/geometry/intersect.js"); +var _sum = require("./function/statistics/sum.js"); +var _cumsum = require("./function/statistics/cumsum.js"); +var _mean = require("./function/statistics/mean.js"); +var _median = require("./function/statistics/median.js"); +var _mad = require("./function/statistics/mad.js"); +var _variance = require("./function/statistics/variance.js"); +var _quantileSeq = require("./function/statistics/quantileSeq.js"); +var _std = require("./function/statistics/std.js"); +var _corr = require("./function/statistics/corr.js"); +var _combinations = require("./function/probability/combinations.js"); +var _combinationsWithRep = require("./function/probability/combinationsWithRep.js"); +var _gamma = require("./function/probability/gamma.js"); +var _lgamma = require("./function/probability/lgamma.js"); +var _factorial = require("./function/probability/factorial.js"); +var _kldivergence = require("./function/probability/kldivergence.js"); +var _multinomial = require("./function/probability/multinomial.js"); +var _permutations = require("./function/probability/permutations.js"); +var _pickRandom = require("./function/probability/pickRandom.js"); +var _random = require("./function/probability/random.js"); +var _randomInt = require("./function/probability/randomInt.js"); +var _stirlingS = require("./function/combinatorics/stirlingS2.js"); +var _bellNumbers = require("./function/combinatorics/bellNumbers.js"); +var _catalan = require("./function/combinatorics/catalan.js"); +var _composition = require("./function/combinatorics/composition.js"); +var _leafCount = require("./function/algebra/leafCount.js"); +var _simplify = require("./function/algebra/simplify.js"); +var _simplifyConstant = require("./function/algebra/simplifyConstant.js"); +var _simplifyCore = require("./function/algebra/simplifyCore.js"); +var _resolve = require("./function/algebra/resolve.js"); +var _symbolicEqual = require("./function/algebra/symbolicEqual.js"); +var _derivative = require("./function/algebra/derivative.js"); +var _rationalize = require("./function/algebra/rationalize.js"); +var _zpk2tf = require("./function/signal/zpk2tf.js"); +var _freqz = require("./function/signal/freqz.js"); +var _reviver = require("./json/reviver.js"); +var _replacer = require("./json/replacer.js"); +var _constants = require("./constants.js"); +var _physicalConstants = require("./type/unit/physicalConstants.js"); +var _applyTransform = require("./expression/transform/apply.transform.js"); +var _columnTransform = require("./expression/transform/column.transform.js"); +var _filterTransform = require("./expression/transform/filter.transform.js"); +var _forEachTransform = require("./expression/transform/forEach.transform.js"); +var _indexTransform = require("./expression/transform/index.transform.js"); +var _mapTransform = require("./expression/transform/map.transform.js"); +var _maxTransform = require("./expression/transform/max.transform.js"); +var _meanTransform = require("./expression/transform/mean.transform.js"); +var _minTransform = require("./expression/transform/min.transform.js"); +var _rangeTransform = require("./expression/transform/range.transform.js"); +var _rowTransform = require("./expression/transform/row.transform.js"); +var _subsetTransform = require("./expression/transform/subset.transform.js"); +var _concatTransform = require("./expression/transform/concat.transform.js"); +var _diffTransform = require("./expression/transform/diff.transform.js"); +var _stdTransform = require("./expression/transform/std.transform.js"); +var _sumTransform = require("./expression/transform/sum.transform.js"); +var _quantileSeqTransform = require("./expression/transform/quantileSeq.transform.js"); +var _cumsumTransform = require("./expression/transform/cumsum.transform.js"); +var _varianceTransform = require("./expression/transform/variance.transform.js"); +var _printTransform = require("./expression/transform/print.transform.js"); +var _andTransform = require("./expression/transform/and.transform.js"); +var _orTransform = require("./expression/transform/or.transform.js"); +var _bitAndTransform = require("./expression/transform/bitAnd.transform.js"); +var _bitOrTransform = require("./expression/transform/bitOr.transform.js"); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesNumber.js new file mode 100644 index 0000000..01a8f83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/factoriesNumber.js @@ -0,0 +1,1062 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAbs = void 0; +Object.defineProperty(exports, "createAccessorNode", { + enumerable: true, + get: function () { + return _AccessorNode.createAccessorNode; + } +}); +exports.createAnd = exports.createAddScalar = exports.createAdd = exports.createAcsch = exports.createAcsc = exports.createAcoth = exports.createAcot = exports.createAcosh = exports.createAcos = void 0; +Object.defineProperty(exports, "createApply", { + enumerable: true, + get: function () { + return _apply.createApply; + } +}); +Object.defineProperty(exports, "createApplyTransform", { + enumerable: true, + get: function () { + return _applyTransform.createApplyTransform; + } +}); +Object.defineProperty(exports, "createArrayNode", { + enumerable: true, + get: function () { + return _ArrayNode.createArrayNode; + } +}); +exports.createAsinh = exports.createAsin = exports.createAsech = exports.createAsec = void 0; +Object.defineProperty(exports, "createAssignmentNode", { + enumerable: true, + get: function () { + return _AssignmentNode.createAssignmentNode; + } +}); +exports.createAtanh = exports.createAtan2 = exports.createAtan = void 0; +Object.defineProperty(exports, "createBellNumbers", { + enumerable: true, + get: function () { + return _bellNumbers.createBellNumbers; + } +}); +Object.defineProperty(exports, "createBigint", { + enumerable: true, + get: function () { + return _bigint.createBigint; + } +}); +exports.createBitXor = exports.createBitOr = exports.createBitNot = exports.createBitAnd = void 0; +Object.defineProperty(exports, "createBlockNode", { + enumerable: true, + get: function () { + return _BlockNode.createBlockNode; + } +}); +Object.defineProperty(exports, "createBoolean", { + enumerable: true, + get: function () { + return _boolean.createBoolean; + } +}); +Object.defineProperty(exports, "createCatalan", { + enumerable: true, + get: function () { + return _catalan.createCatalan; + } +}); +exports.createCbrt = void 0; +Object.defineProperty(exports, "createCeil", { + enumerable: true, + get: function () { + return _ceil.createCeilNumber; + } +}); +Object.defineProperty(exports, "createChain", { + enumerable: true, + get: function () { + return _chain.createChain; + } +}); +Object.defineProperty(exports, "createChainClass", { + enumerable: true, + get: function () { + return _Chain.createChainClass; + } +}); +Object.defineProperty(exports, "createClone", { + enumerable: true, + get: function () { + return _clone.createClone; + } +}); +exports.createCombinations = void 0; +Object.defineProperty(exports, "createCombinationsWithRep", { + enumerable: true, + get: function () { + return _combinationsWithRep.createCombinationsWithRep; + } +}); +Object.defineProperty(exports, "createCompare", { + enumerable: true, + get: function () { + return _compare.createCompareNumber; + } +}); +Object.defineProperty(exports, "createCompareNatural", { + enumerable: true, + get: function () { + return _compareNatural.createCompareNatural; + } +}); +Object.defineProperty(exports, "createCompareText", { + enumerable: true, + get: function () { + return _compareText.createCompareTextNumber; + } +}); +Object.defineProperty(exports, "createCompile", { + enumerable: true, + get: function () { + return _compile.createCompile; + } +}); +Object.defineProperty(exports, "createComposition", { + enumerable: true, + get: function () { + return _composition.createComposition; + } +}); +Object.defineProperty(exports, "createConditionalNode", { + enumerable: true, + get: function () { + return _ConditionalNode.createConditionalNode; + } +}); +Object.defineProperty(exports, "createConstantNode", { + enumerable: true, + get: function () { + return _ConstantNode.createConstantNode; + } +}); +Object.defineProperty(exports, "createCorr", { + enumerable: true, + get: function () { + return _corr.createCorr; + } +}); +exports.createCube = exports.createCsch = exports.createCsc = exports.createCoth = exports.createCot = exports.createCosh = exports.createCos = void 0; +Object.defineProperty(exports, "createCumSum", { + enumerable: true, + get: function () { + return _cumsum.createCumSum; + } +}); +Object.defineProperty(exports, "createCumSumTransform", { + enumerable: true, + get: function () { + return _cumsumTransform.createCumSumTransform; + } +}); +Object.defineProperty(exports, "createDeepEqual", { + enumerable: true, + get: function () { + return _deepEqual.createDeepEqual; + } +}); +Object.defineProperty(exports, "createDerivative", { + enumerable: true, + get: function () { + return _derivative.createDerivative; + } +}); +exports.createDivideScalar = exports.createDivide = void 0; +Object.defineProperty(exports, "createE", { + enumerable: true, + get: function () { + return _constants.createE; + } +}); +Object.defineProperty(exports, "createEqual", { + enumerable: true, + get: function () { + return _equal.createEqualNumber; + } +}); +Object.defineProperty(exports, "createEqualScalar", { + enumerable: true, + get: function () { + return _equalScalar.createEqualScalarNumber; + } +}); +Object.defineProperty(exports, "createEqualText", { + enumerable: true, + get: function () { + return _equalText.createEqualText; + } +}); +Object.defineProperty(exports, "createErf", { + enumerable: true, + get: function () { + return _erf.createErf; + } +}); +Object.defineProperty(exports, "createEvaluate", { + enumerable: true, + get: function () { + return _evaluate.createEvaluate; + } +}); +exports.createExpm1 = exports.createExp = void 0; +Object.defineProperty(exports, "createFactorial", { + enumerable: true, + get: function () { + return _factorial.createFactorial; + } +}); +Object.defineProperty(exports, "createFalse", { + enumerable: true, + get: function () { + return _constants.createFalse; + } +}); +Object.defineProperty(exports, "createFilter", { + enumerable: true, + get: function () { + return _filter.createFilter; + } +}); +Object.defineProperty(exports, "createFilterTransform", { + enumerable: true, + get: function () { + return _filterTransform.createFilterTransform; + } +}); +Object.defineProperty(exports, "createFix", { + enumerable: true, + get: function () { + return _fix.createFixNumber; + } +}); +Object.defineProperty(exports, "createFloor", { + enumerable: true, + get: function () { + return _floor.createFloorNumber; + } +}); +Object.defineProperty(exports, "createForEach", { + enumerable: true, + get: function () { + return _forEach.createForEach; + } +}); +Object.defineProperty(exports, "createForEachTransform", { + enumerable: true, + get: function () { + return _forEachTransform.createForEachTransform; + } +}); +Object.defineProperty(exports, "createFormat", { + enumerable: true, + get: function () { + return _format.createFormat; + } +}); +Object.defineProperty(exports, "createFunctionAssignmentNode", { + enumerable: true, + get: function () { + return _FunctionAssignmentNode.createFunctionAssignmentNode; + } +}); +Object.defineProperty(exports, "createFunctionNode", { + enumerable: true, + get: function () { + return _FunctionNode.createFunctionNode; + } +}); +exports.createGcd = exports.createGamma = void 0; +Object.defineProperty(exports, "createHasNumericValue", { + enumerable: true, + get: function () { + return _hasNumericValue.createHasNumericValue; + } +}); +Object.defineProperty(exports, "createHelp", { + enumerable: true, + get: function () { + return _help.createHelp; + } +}); +Object.defineProperty(exports, "createHelpClass", { + enumerable: true, + get: function () { + return _Help.createHelpClass; + } +}); +Object.defineProperty(exports, "createHypot", { + enumerable: true, + get: function () { + return _hypot.createHypot; + } +}); +exports.createIndex = void 0; +Object.defineProperty(exports, "createIndexNode", { + enumerable: true, + get: function () { + return _IndexNode.createIndexNode; + } +}); +Object.defineProperty(exports, "createInfinity", { + enumerable: true, + get: function () { + return _constants.createInfinity; + } +}); +exports.createIsNegative = exports.createIsNaN = exports.createIsInteger = void 0; +Object.defineProperty(exports, "createIsNumeric", { + enumerable: true, + get: function () { + return _isNumeric.createIsNumeric; + } +}); +exports.createIsPositive = void 0; +Object.defineProperty(exports, "createIsPrime", { + enumerable: true, + get: function () { + return _isPrime.createIsPrime; + } +}); +exports.createIsZero = void 0; +Object.defineProperty(exports, "createLN10", { + enumerable: true, + get: function () { + return _constants.createLN10; + } +}); +Object.defineProperty(exports, "createLN2", { + enumerable: true, + get: function () { + return _constants.createLN2; + } +}); +Object.defineProperty(exports, "createLOG10E", { + enumerable: true, + get: function () { + return _constants.createLOG10E; + } +}); +Object.defineProperty(exports, "createLOG2E", { + enumerable: true, + get: function () { + return _constants.createLOG2E; + } +}); +Object.defineProperty(exports, "createLarger", { + enumerable: true, + get: function () { + return _larger.createLargerNumber; + } +}); +Object.defineProperty(exports, "createLargerEq", { + enumerable: true, + get: function () { + return _largerEq.createLargerEqNumber; + } +}); +exports.createLog2 = exports.createLog1p = exports.createLog10 = exports.createLog = exports.createLgamma = exports.createLeftShift = exports.createLcm = void 0; +Object.defineProperty(exports, "createMad", { + enumerable: true, + get: function () { + return _mad.createMad; + } +}); +Object.defineProperty(exports, "createMap", { + enumerable: true, + get: function () { + return _map.createMap; + } +}); +Object.defineProperty(exports, "createMapTransform", { + enumerable: true, + get: function () { + return _mapTransform.createMapTransform; + } +}); +exports.createMatrix = void 0; +Object.defineProperty(exports, "createMax", { + enumerable: true, + get: function () { + return _max.createMax; + } +}); +Object.defineProperty(exports, "createMaxTransform", { + enumerable: true, + get: function () { + return _maxTransform.createMaxTransform; + } +}); +Object.defineProperty(exports, "createMean", { + enumerable: true, + get: function () { + return _mean.createMean; + } +}); +Object.defineProperty(exports, "createMeanTransform", { + enumerable: true, + get: function () { + return _meanTransform.createMeanTransform; + } +}); +Object.defineProperty(exports, "createMedian", { + enumerable: true, + get: function () { + return _median.createMedian; + } +}); +Object.defineProperty(exports, "createMin", { + enumerable: true, + get: function () { + return _min.createMin; + } +}); +Object.defineProperty(exports, "createMinTransform", { + enumerable: true, + get: function () { + return _minTransform.createMinTransform; + } +}); +exports.createMod = void 0; +Object.defineProperty(exports, "createMode", { + enumerable: true, + get: function () { + return _mode.createMode; + } +}); +Object.defineProperty(exports, "createMultinomial", { + enumerable: true, + get: function () { + return _multinomial.createMultinomial; + } +}); +exports.createMultiplyScalar = exports.createMultiply = void 0; +Object.defineProperty(exports, "createNaN", { + enumerable: true, + get: function () { + return _constants.createNaN; + } +}); +Object.defineProperty(exports, "createNode", { + enumerable: true, + get: function () { + return _Node.createNode; + } +}); +exports.createNthRoot = exports.createNot = exports.createNorm = void 0; +Object.defineProperty(exports, "createNull", { + enumerable: true, + get: function () { + return _constants.createNull; + } +}); +Object.defineProperty(exports, "createNumber", { + enumerable: true, + get: function () { + return _number.createNumber; + } +}); +Object.defineProperty(exports, "createNumeric", { + enumerable: true, + get: function () { + return _numeric.createNumeric; + } +}); +Object.defineProperty(exports, "createObjectNode", { + enumerable: true, + get: function () { + return _ObjectNode.createObjectNode; + } +}); +Object.defineProperty(exports, "createOperatorNode", { + enumerable: true, + get: function () { + return _OperatorNode.createOperatorNode; + } +}); +exports.createOr = void 0; +Object.defineProperty(exports, "createParenthesisNode", { + enumerable: true, + get: function () { + return _ParenthesisNode.createParenthesisNode; + } +}); +Object.defineProperty(exports, "createParse", { + enumerable: true, + get: function () { + return _parse.createParse; + } +}); +Object.defineProperty(exports, "createParser", { + enumerable: true, + get: function () { + return _parser.createParser; + } +}); +Object.defineProperty(exports, "createParserClass", { + enumerable: true, + get: function () { + return _Parser.createParserClass; + } +}); +Object.defineProperty(exports, "createPartitionSelect", { + enumerable: true, + get: function () { + return _partitionSelect.createPartitionSelect; + } +}); +Object.defineProperty(exports, "createPermutations", { + enumerable: true, + get: function () { + return _permutations.createPermutations; + } +}); +Object.defineProperty(exports, "createPhi", { + enumerable: true, + get: function () { + return _constants.createPhi; + } +}); +Object.defineProperty(exports, "createPi", { + enumerable: true, + get: function () { + return _constants.createPi; + } +}); +Object.defineProperty(exports, "createPickRandom", { + enumerable: true, + get: function () { + return _pickRandom.createPickRandom; + } +}); +exports.createPow = void 0; +Object.defineProperty(exports, "createPrint", { + enumerable: true, + get: function () { + return _print.createPrint; + } +}); +Object.defineProperty(exports, "createProd", { + enumerable: true, + get: function () { + return _prod.createProd; + } +}); +Object.defineProperty(exports, "createQuantileSeq", { + enumerable: true, + get: function () { + return _quantileSeq.createQuantileSeq; + } +}); +Object.defineProperty(exports, "createRandom", { + enumerable: true, + get: function () { + return _random.createRandomNumber; + } +}); +Object.defineProperty(exports, "createRandomInt", { + enumerable: true, + get: function () { + return _randomInt.createRandomInt; + } +}); +Object.defineProperty(exports, "createRange", { + enumerable: true, + get: function () { + return _range.createRange; + } +}); +Object.defineProperty(exports, "createRangeClass", { + enumerable: true, + get: function () { + return _Range.createRangeClass; + } +}); +Object.defineProperty(exports, "createRangeNode", { + enumerable: true, + get: function () { + return _RangeNode.createRangeNode; + } +}); +Object.defineProperty(exports, "createRangeTransform", { + enumerable: true, + get: function () { + return _rangeTransform.createRangeTransform; + } +}); +Object.defineProperty(exports, "createRationalize", { + enumerable: true, + get: function () { + return _rationalize.createRationalize; + } +}); +Object.defineProperty(exports, "createRelationalNode", { + enumerable: true, + get: function () { + return _RelationalNode.createRelationalNode; + } +}); +Object.defineProperty(exports, "createReplacer", { + enumerable: true, + get: function () { + return _replacer.createReplacer; + } +}); +Object.defineProperty(exports, "createResolve", { + enumerable: true, + get: function () { + return _resolve.createResolve; + } +}); +Object.defineProperty(exports, "createResultSet", { + enumerable: true, + get: function () { + return _ResultSet.createResultSet; + } +}); +Object.defineProperty(exports, "createReviver", { + enumerable: true, + get: function () { + return _reviver.createReviver; + } +}); +exports.createRound = exports.createRightLogShift = exports.createRightArithShift = void 0; +Object.defineProperty(exports, "createSQRT1_2", { + enumerable: true, + get: function () { + return _constants.createSQRT1_2; + } +}); +Object.defineProperty(exports, "createSQRT2", { + enumerable: true, + get: function () { + return _constants.createSQRT2; + } +}); +exports.createSign = exports.createSech = exports.createSec = void 0; +Object.defineProperty(exports, "createSimplify", { + enumerable: true, + get: function () { + return _simplify.createSimplify; + } +}); +Object.defineProperty(exports, "createSimplifyConstant", { + enumerable: true, + get: function () { + return _simplifyConstant.createSimplifyConstant; + } +}); +Object.defineProperty(exports, "createSimplifyCore", { + enumerable: true, + get: function () { + return _simplifyCore.createSimplifyCore; + } +}); +exports.createSinh = exports.createSin = void 0; +Object.defineProperty(exports, "createSize", { + enumerable: true, + get: function () { + return _size.createSize; + } +}); +Object.defineProperty(exports, "createSmaller", { + enumerable: true, + get: function () { + return _smaller.createSmallerNumber; + } +}); +Object.defineProperty(exports, "createSmallerEq", { + enumerable: true, + get: function () { + return _smallerEq.createSmallerEqNumber; + } +}); +exports.createSquare = exports.createSqrt = void 0; +Object.defineProperty(exports, "createStd", { + enumerable: true, + get: function () { + return _std.createStd; + } +}); +Object.defineProperty(exports, "createStdTransform", { + enumerable: true, + get: function () { + return _stdTransform.createStdTransform; + } +}); +Object.defineProperty(exports, "createStirlingS2", { + enumerable: true, + get: function () { + return _stirlingS.createStirlingS2; + } +}); +Object.defineProperty(exports, "createString", { + enumerable: true, + get: function () { + return _string.createString; + } +}); +exports.createSubtractScalar = exports.createSubtract = exports.createSubsetTransform = exports.createSubset = void 0; +Object.defineProperty(exports, "createSum", { + enumerable: true, + get: function () { + return _sum.createSum; + } +}); +Object.defineProperty(exports, "createSumTransform", { + enumerable: true, + get: function () { + return _sumTransform.createSumTransform; + } +}); +Object.defineProperty(exports, "createSymbolNode", { + enumerable: true, + get: function () { + return _SymbolNode.createSymbolNode; + } +}); +exports.createTanh = exports.createTan = void 0; +Object.defineProperty(exports, "createTau", { + enumerable: true, + get: function () { + return _constants.createTau; + } +}); +Object.defineProperty(exports, "createTrue", { + enumerable: true, + get: function () { + return _constants.createTrue; + } +}); +Object.defineProperty(exports, "createTypeOf", { + enumerable: true, + get: function () { + return _typeOf.createTypeOf; + } +}); +Object.defineProperty(exports, "createTyped", { + enumerable: true, + get: function () { + return _typed.createTyped; + } +}); +exports.createUnaryPlus = exports.createUnaryMinus = void 0; +Object.defineProperty(exports, "createUnequal", { + enumerable: true, + get: function () { + return _unequal.createUnequalNumber; + } +}); +Object.defineProperty(exports, "createUppercaseE", { + enumerable: true, + get: function () { + return _constants.createUppercaseE; + } +}); +Object.defineProperty(exports, "createUppercasePi", { + enumerable: true, + get: function () { + return _constants.createUppercasePi; + } +}); +Object.defineProperty(exports, "createVariance", { + enumerable: true, + get: function () { + return _variance.createVariance; + } +}); +Object.defineProperty(exports, "createVarianceTransform", { + enumerable: true, + get: function () { + return _varianceTransform.createVarianceTransform; + } +}); +Object.defineProperty(exports, "createVersion", { + enumerable: true, + get: function () { + return _constants.createVersion; + } +}); +exports.createXor = exports.createXgcd = void 0; +Object.defineProperty(exports, "createZeta", { + enumerable: true, + get: function () { + return _zeta.createZeta; + } +}); +var _index = require("./plain/number/index.js"); +var _factory = require("./utils/factory.js"); +var _noop = require("./utils/noop.js"); +var _typed = require("./core/function/typed.js"); +var _ResultSet = require("./type/resultset/ResultSet.js"); +var _Range = require("./type/matrix/Range.js"); +var _Help = require("./expression/Help.js"); +var _Chain = require("./type/chain/Chain.js"); +var _help = require("./expression/function/help.js"); +var _chain = require("./type/chain/function/chain.js"); +var _resolve = require("./function/algebra/resolve.js"); +var _simplify = require("./function/algebra/simplify.js"); +var _simplifyConstant = require("./function/algebra/simplifyConstant.js"); +var _simplifyCore = require("./function/algebra/simplifyCore.js"); +var _derivative = require("./function/algebra/derivative.js"); +var _rationalize = require("./function/algebra/rationalize.js"); +var _ceil = require("./function/arithmetic/ceil.js"); +var _fix = require("./function/arithmetic/fix.js"); +var _floor = require("./function/arithmetic/floor.js"); +var _hypot = require("./function/arithmetic/hypot.js"); +var _stirlingS = require("./function/combinatorics/stirlingS2.js"); +var _bellNumbers = require("./function/combinatorics/bellNumbers.js"); +var _catalan = require("./function/combinatorics/catalan.js"); +var _composition = require("./function/combinatorics/composition.js"); +var _constants = require("./constants.js"); +var _number = require("./type/number.js"); +var _bigint = require("./type/bigint.js"); +var _string = require("./type/string.js"); +var _boolean = require("./type/boolean.js"); +var _parser = require("./expression/function/parser.js"); +var _Node = require("./expression/node/Node.js"); +var _AccessorNode = require("./expression/node/AccessorNode.js"); +var _ArrayNode = require("./expression/node/ArrayNode.js"); +var _AssignmentNode = require("./expression/node/AssignmentNode.js"); +var _BlockNode = require("./expression/node/BlockNode.js"); +var _ConditionalNode = require("./expression/node/ConditionalNode.js"); +var _ConstantNode = require("./expression/node/ConstantNode.js"); +var _FunctionAssignmentNode = require("./expression/node/FunctionAssignmentNode.js"); +var _IndexNode = require("./expression/node/IndexNode.js"); +var _ObjectNode = require("./expression/node/ObjectNode.js"); +var _OperatorNode = require("./expression/node/OperatorNode.js"); +var _ParenthesisNode = require("./expression/node/ParenthesisNode.js"); +var _RangeNode = require("./expression/node/RangeNode.js"); +var _RelationalNode = require("./expression/node/RelationalNode.js"); +var _SymbolNode = require("./expression/node/SymbolNode.js"); +var _FunctionNode = require("./expression/node/FunctionNode.js"); +var _parse = require("./expression/parse.js"); +var _compile = require("./expression/function/compile.js"); +var _evaluate = require("./expression/function/evaluate.js"); +var _Parser = require("./expression/Parser.js"); +var _apply = require("./function/matrix/apply.js"); +var _filter = require("./function/matrix/filter.js"); +var _forEach = require("./function/matrix/forEach.js"); +var _map = require("./function/matrix/map.js"); +var _range = require("./function/matrix/range.js"); +var _size = require("./function/matrix/size.js"); +var _partitionSelect = require("./function/matrix/partitionSelect.js"); +var _combinationsWithRep = require("./function/probability/combinationsWithRep.js"); +var _factorial = require("./function/probability/factorial.js"); +var _multinomial = require("./function/probability/multinomial.js"); +var _permutations = require("./function/probability/permutations.js"); +var _pickRandom = require("./function/probability/pickRandom.js"); +var _random = require("./function/probability/random.js"); +var _randomInt = require("./function/probability/randomInt.js"); +var _equalScalar = require("./function/relational/equalScalar.js"); +var _compare = require("./function/relational/compare.js"); +var _compareNatural = require("./function/relational/compareNatural.js"); +var _compareText = require("./function/relational/compareText.js"); +var _equal = require("./function/relational/equal.js"); +var _equalText = require("./function/relational/equalText.js"); +var _smaller = require("./function/relational/smaller.js"); +var _smallerEq = require("./function/relational/smallerEq.js"); +var _larger = require("./function/relational/larger.js"); +var _largerEq = require("./function/relational/largerEq.js"); +var _deepEqual = require("./function/relational/deepEqual.js"); +var _unequal = require("./function/relational/unequal.js"); +var _erf = require("./function/special/erf.js"); +var _zeta = require("./function/special/zeta.js"); +var _mode = require("./function/statistics/mode.js"); +var _prod = require("./function/statistics/prod.js"); +var _max = require("./function/statistics/max.js"); +var _min = require("./function/statistics/min.js"); +var _sum = require("./function/statistics/sum.js"); +var _cumsum = require("./function/statistics/cumsum.js"); +var _mean = require("./function/statistics/mean.js"); +var _median = require("./function/statistics/median.js"); +var _mad = require("./function/statistics/mad.js"); +var _variance = require("./function/statistics/variance.js"); +var _quantileSeq = require("./function/statistics/quantileSeq.js"); +var _std = require("./function/statistics/std.js"); +var _corr = require("./function/statistics/corr.js"); +var _format = require("./function/string/format.js"); +var _print = require("./function/string/print.js"); +var _applyTransform = require("./expression/transform/apply.transform.js"); +var _filterTransform = require("./expression/transform/filter.transform.js"); +var _forEachTransform = require("./expression/transform/forEach.transform.js"); +var _mapTransform = require("./expression/transform/map.transform.js"); +var _maxTransform = require("./expression/transform/max.transform.js"); +var _meanTransform = require("./expression/transform/mean.transform.js"); +var _minTransform = require("./expression/transform/min.transform.js"); +var _rangeTransform = require("./expression/transform/range.transform.js"); +var _stdTransform = require("./expression/transform/std.transform.js"); +var _sumTransform = require("./expression/transform/sum.transform.js"); +var _cumsumTransform = require("./expression/transform/cumsum.transform.js"); +var _varianceTransform = require("./expression/transform/variance.transform.js"); +var _clone = require("./function/utils/clone.js"); +var _isNumeric = require("./function/utils/isNumeric.js"); +var _hasNumericValue = require("./function/utils/hasNumericValue.js"); +var _typeOf = require("./function/utils/typeOf.js"); +var _isPrime = require("./function/utils/isPrime.js"); +var _numeric = require("./function/utils/numeric.js"); +var _reviver = require("./json/reviver.js"); +var _replacer = require("./json/replacer.js"); +// ---------------------------------------------------------------------------- +// classes and functions + +// core + +// classes + +// algebra + +// arithmetic +const createUnaryMinus = exports.createUnaryMinus = /* #__PURE__ */createNumberFactory('unaryMinus', _index.unaryMinusNumber); +const createUnaryPlus = exports.createUnaryPlus = /* #__PURE__ */createNumberFactory('unaryPlus', _index.unaryPlusNumber); +const createAbs = exports.createAbs = /* #__PURE__ */createNumberFactory('abs', _index.absNumber); +const createAddScalar = exports.createAddScalar = /* #__PURE__ */createNumberFactory('addScalar', _index.addNumber); +const createSubtractScalar = exports.createSubtractScalar = /* #__PURE__ */createNumberFactory('subtractScalar', _index.subtractNumber); +const createCbrt = exports.createCbrt = /* #__PURE__ */createNumberFactory('cbrt', _index.cbrtNumber); +const createCube = exports.createCube = /* #__PURE__ */createNumberFactory('cube', _index.cubeNumber); +const createExp = exports.createExp = /* #__PURE__ */createNumberFactory('exp', _index.expNumber); +const createExpm1 = exports.createExpm1 = /* #__PURE__ */createNumberFactory('expm1', _index.expm1Number); +const createGcd = exports.createGcd = /* #__PURE__ */createNumberFactory('gcd', _index.gcdNumber); +const createLcm = exports.createLcm = /* #__PURE__ */createNumberFactory('lcm', _index.lcmNumber); +const createLog10 = exports.createLog10 = /* #__PURE__ */createNumberFactory('log10', _index.log10Number); +const createLog2 = exports.createLog2 = /* #__PURE__ */createNumberFactory('log2', _index.log2Number); +const createMod = exports.createMod = /* #__PURE__ */createNumberFactory('mod', _index.modNumber); +const createMultiplyScalar = exports.createMultiplyScalar = /* #__PURE__ */createNumberFactory('multiplyScalar', _index.multiplyNumber); +const createMultiply = exports.createMultiply = /* #__PURE__ */createNumberFactory('multiply', _index.multiplyNumber); +const createNthRoot = exports.createNthRoot = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('nthRoot', _index.nthRootNumber); +const createSign = exports.createSign = /* #__PURE__ */createNumberFactory('sign', _index.signNumber); +const createSqrt = exports.createSqrt = /* #__PURE__ */createNumberFactory('sqrt', _index.sqrtNumber); +const createSquare = exports.createSquare = /* #__PURE__ */createNumberFactory('square', _index.squareNumber); +const createSubtract = exports.createSubtract = /* #__PURE__ */createNumberFactory('subtract', _index.subtractNumber); +const createXgcd = exports.createXgcd = /* #__PURE__ */createNumberFactory('xgcd', _index.xgcdNumber); +const createDivideScalar = exports.createDivideScalar = /* #__PURE__ */createNumberFactory('divideScalar', _index.divideNumber); +const createPow = exports.createPow = /* #__PURE__ */createNumberFactory('pow', _index.powNumber); +const createRound = exports.createRound = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('round', _index.roundNumber); +const createLog = exports.createLog = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('log', _index.logNumber); +const createLog1p = exports.createLog1p = /* #__PURE__ */createNumberFactory('log1p', _index.log1pNumber); +const createAdd = exports.createAdd = /* #__PURE__ */createNumberFactory('add', _index.addNumber); +const createNorm = exports.createNorm = /* #__PURE__ */createNumberFactory('norm', _index.normNumber); +const createDivide = exports.createDivide = /* #__PURE__ */createNumberFactory('divide', _index.divideNumber); + +// bitwise +const createBitAnd = exports.createBitAnd = /* #__PURE__ */createNumberFactory('bitAnd', _index.bitAndNumber); +const createBitNot = exports.createBitNot = /* #__PURE__ */createNumberFactory('bitNot', _index.bitNotNumber); +const createBitOr = exports.createBitOr = /* #__PURE__ */createNumberFactory('bitOr', _index.bitOrNumber); +const createBitXor = exports.createBitXor = /* #__PURE__ */createNumberFactory('bitXor', _index.bitXorNumber); +const createLeftShift = exports.createLeftShift = /* #__PURE__ */createNumberFactory('leftShift', _index.leftShiftNumber); +const createRightArithShift = exports.createRightArithShift = /* #__PURE__ */createNumberFactory('rightArithShift', _index.rightArithShiftNumber); +const createRightLogShift = exports.createRightLogShift = /* #__PURE__ */createNumberFactory('rightLogShift', _index.rightLogShiftNumber); + +// combinatorics + +// constants + +// create + +// expression + +// logical +const createAnd = exports.createAnd = /* #__PURE__ */createNumberFactory('and', _index.andNumber); +const createNot = exports.createNot = /* #__PURE__ */createNumberFactory('not', _index.notNumber); +const createOr = exports.createOr = /* #__PURE__ */createNumberFactory('or', _index.orNumber); +const createXor = exports.createXor = /* #__PURE__ */createNumberFactory('xor', _index.xorNumber); + +// matrix + +// FIXME: create a lightweight "number" implementation of subset only supporting plain objects/arrays +const createIndex = exports.createIndex = /* #__PURE__ */(0, _factory.factory)('index', [], () => _noop.noIndex); +const createMatrix = exports.createMatrix = /* #__PURE__ */(0, _factory.factory)('matrix', [], () => _noop.noMatrix); // FIXME: needed now because subset transform needs it. Remove the need for it in subset +const createSubset = exports.createSubset = /* #__PURE__ */(0, _factory.factory)('subset', [], () => _noop.noSubset); +// TODO: provide number+array implementations for map, filter, forEach, zeros, ...? +// TODO: create range implementation for range? + +// probability +const createCombinations = exports.createCombinations = createNumberFactory('combinations', _index.combinationsNumber); +const createGamma = exports.createGamma = createNumberFactory('gamma', _index.gammaNumber); +const createLgamma = exports.createLgamma = createNumberFactory('lgamma', _index.lgammaNumber); + +// relational + +// special + +// statistics + +// string + +// trigonometry +const createAcos = exports.createAcos = /* #__PURE__ */createNumberFactory('acos', _index.acosNumber); +const createAcosh = exports.createAcosh = /* #__PURE__ */createNumberFactory('acosh', _index.acoshNumber); +const createAcot = exports.createAcot = /* #__PURE__ */createNumberFactory('acot', _index.acotNumber); +const createAcoth = exports.createAcoth = /* #__PURE__ */createNumberFactory('acoth', _index.acothNumber); +const createAcsc = exports.createAcsc = /* #__PURE__ */createNumberFactory('acsc', _index.acscNumber); +const createAcsch = exports.createAcsch = /* #__PURE__ */createNumberFactory('acsch', _index.acschNumber); +const createAsec = exports.createAsec = /* #__PURE__ */createNumberFactory('asec', _index.asecNumber); +const createAsech = exports.createAsech = /* #__PURE__ */createNumberFactory('asech', _index.asechNumber); +const createAsin = exports.createAsin = /* #__PURE__ */createNumberFactory('asin', _index.asinNumber); +const createAsinh = exports.createAsinh = /* #__PURE__ */createNumberFactory('asinh', _index.asinhNumber); +const createAtan = exports.createAtan = /* #__PURE__ */createNumberFactory('atan', _index.atanNumber); +const createAtan2 = exports.createAtan2 = /* #__PURE__ */createNumberFactory('atan2', _index.atan2Number); +const createAtanh = exports.createAtanh = /* #__PURE__ */createNumberFactory('atanh', _index.atanhNumber); +const createCos = exports.createCos = /* #__PURE__ */createNumberFactory('cos', _index.cosNumber); +const createCosh = exports.createCosh = /* #__PURE__ */createNumberFactory('cosh', _index.coshNumber); +const createCot = exports.createCot = /* #__PURE__ */createNumberFactory('cot', _index.cotNumber); +const createCoth = exports.createCoth = /* #__PURE__ */createNumberFactory('coth', _index.cothNumber); +const createCsc = exports.createCsc = /* #__PURE__ */createNumberFactory('csc', _index.cscNumber); +const createCsch = exports.createCsch = /* #__PURE__ */createNumberFactory('csch', _index.cschNumber); +const createSec = exports.createSec = /* #__PURE__ */createNumberFactory('sec', _index.secNumber); +const createSech = exports.createSech = /* #__PURE__ */createNumberFactory('sech', _index.sechNumber); +const createSin = exports.createSin = /* #__PURE__ */createNumberFactory('sin', _index.sinNumber); +const createSinh = exports.createSinh = /* #__PURE__ */createNumberFactory('sinh', _index.sinhNumber); +const createTan = exports.createTan = /* #__PURE__ */createNumberFactory('tan', _index.tanNumber); +const createTanh = exports.createTanh = /* #__PURE__ */createNumberFactory('tanh', _index.tanhNumber); + +// transforms + +const createSubsetTransform = exports.createSubsetTransform = /* #__PURE__ */(0, _factory.factory)('subset', [], () => _noop.noSubset, { + isTransformFunction: true +}); + +// utils + +const createIsInteger = exports.createIsInteger = /* #__PURE__ */createNumberFactory('isInteger', _index.isIntegerNumber); +const createIsNegative = exports.createIsNegative = /* #__PURE__ */createNumberFactory('isNegative', _index.isNegativeNumber); +const createIsPositive = exports.createIsPositive = /* #__PURE__ */createNumberFactory('isPositive', _index.isPositiveNumber); +const createIsZero = exports.createIsZero = /* #__PURE__ */createNumberFactory('isZero', _index.isZeroNumber); +const createIsNaN = exports.createIsNaN = /* #__PURE__ */createNumberFactory('isNaN', _index.isNaNNumber); + +// json + +// helper functions to create a factory function for a function which only needs typed-function +function createNumberFactory(name, fn) { + return (0, _factory.factory)(name, ['typed'], _ref => { + let { + typed + } = _ref; + return typed(fn); + }); +} +function createNumberOptionalSecondArgFactory(name, fn) { + return (0, _factory.factory)(name, ['typed'], _ref2 => { + let { + typed + } = _ref2; + return typed({ + number: fn, + 'number,number': fn + }); + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js new file mode 100644 index 0000000..e3327e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js @@ -0,0 +1,382 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLup = void 0; +var _object = require("../../../utils/object.js"); +var _factory = require("../../../utils/factory.js"); +const name = 'lup'; +const dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa']; +const createLup = exports.createLup = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + abs, + addScalar, + divideScalar, + multiplyScalar, + subtractScalar, + larger, + equalScalar, + unaryMinus, + DenseMatrix, + SparseMatrix, + Spa + } = _ref; + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a + * row permutation vector `p` where `A[p,:] = L * U` + * + * Syntax: + * + * math.lup(A) + * + * Example: + * + * const m = [[2, 1], [1, 4]] + * const r = math.lup(m) + * // r = { + * // L: [[1, 0], [0.5, 1]], + * // U: [[2, 1], [0, 3.5]], + * // P: [0, 1] + * // } + * + * See also: + * + * slu, lsolve, lusolve, usolve + * + * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition. + * + * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix. + */ + return typed(name, { + DenseMatrix: function (m) { + return _denseLUP(m); + }, + SparseMatrix: function (m) { + return _sparseLUP(m); + }, + Array: function (a) { + // create dense matrix from array + const m = matrix(a); + // lup, use matrix implementation + const r = _denseLUP(m); + // result + return { + L: r.L.valueOf(), + U: r.U.valueOf(), + p: r.p + }; + } + }); + function _denseLUP(m) { + // rows & columns + const rows = m._size[0]; + const columns = m._size[1]; + // minimum rows and columns + let n = Math.min(rows, columns); + // matrix array, clone original data + const data = (0, _object.clone)(m._data); + // l matrix arrays + const ldata = []; + const lsize = [rows, n]; + // u matrix arrays + const udata = []; + const usize = [n, columns]; + // vars + let i, j, k; + // permutation vector + const p = []; + for (i = 0; i < rows; i++) { + p[i] = i; + } + // loop columns + for (j = 0; j < columns; j++) { + // skip first column in upper triangular matrix + if (j > 0) { + // loop rows + for (i = 0; i < rows; i++) { + // min i,j + const min = Math.min(i, j); + // v[i, j] + let s = 0; + // loop up to min + for (k = 0; k < min; k++) { + // s = l[i, k] - data[k, j] + s = addScalar(s, multiplyScalar(data[i][k], data[k][j])); + } + data[i][j] = subtractScalar(data[i][j], s); + } + } + // row with larger value in cvector, row >= j + let pi = j; + let pabsv = 0; + let vjj = 0; + // loop rows + for (i = j; i < rows; i++) { + // data @ i, j + const v = data[i][j]; + // absolute value + const absv = abs(v); + // value is greater than pivote value + if (larger(absv, pabsv)) { + // store row + pi = i; + // update max value + pabsv = absv; + // value @ [j, j] + vjj = v; + } + } + // swap rows (j <-> pi) + if (j !== pi) { + // swap values j <-> pi in p + p[j] = [p[pi], p[pi] = p[j]][0]; + // swap j <-> pi in data + DenseMatrix._swapRows(j, pi, data); + } + // check column is in lower triangular matrix + if (j < rows) { + // loop rows (lower triangular matrix) + for (i = j + 1; i < rows; i++) { + // value @ i, j + const vij = data[i][j]; + if (!equalScalar(vij, 0)) { + // update data + data[i][j] = divideScalar(data[i][j], vjj); + } + } + } + } + // loop columns + for (j = 0; j < columns; j++) { + // loop rows + for (i = 0; i < rows; i++) { + // initialize row in arrays + if (j === 0) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i] = []; + } + // L + ldata[i] = []; + } + // check we are in the upper triangular matrix + if (i < j) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = data[i][j]; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = 0; + } + continue; + } + // diagonal value + if (i === j) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = data[i][j]; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = 1; + } + continue; + } + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = 0; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = data[i][j]; + } + } + } + // l matrix + const l = new DenseMatrix({ + data: ldata, + size: lsize + }); + // u matrix + const u = new DenseMatrix({ + data: udata, + size: usize + }); + // p vector + const pv = []; + for (i = 0, n = p.length; i < n; i++) { + pv[p[i]] = i; + } + // return matrices + return { + L: l, + U: u, + p: pv, + toString: function () { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\nP: ' + this.p; + } + }; + } + function _sparseLUP(m) { + // rows & columns + const rows = m._size[0]; + const columns = m._size[1]; + // minimum rows and columns + const n = Math.min(rows, columns); + // matrix arrays (will not be modified, thanks to permutation vector) + const values = m._values; + const index = m._index; + const ptr = m._ptr; + // l matrix arrays + const lvalues = []; + const lindex = []; + const lptr = []; + const lsize = [rows, n]; + // u matrix arrays + const uvalues = []; + const uindex = []; + const uptr = []; + const usize = [n, columns]; + // vars + let i, j, k; + // permutation vectors, (current index -> original index) and (original index -> current index) + const pvCo = []; + const pvOc = []; + for (i = 0; i < rows; i++) { + pvCo[i] = i; + pvOc[i] = i; + } + // swap indices in permutation vectors (condition x < y)! + const swapIndeces = function (x, y) { + // find pv indeces getting data from x and y + const kx = pvOc[x]; + const ky = pvOc[y]; + // update permutation vector current -> original + pvCo[kx] = y; + pvCo[ky] = x; + // update permutation vector original -> current + pvOc[x] = ky; + pvOc[y] = kx; + }; + // loop columns + for (j = 0; j < columns; j++) { + // sparse accumulator + const spa = new Spa(); + // check lower triangular matrix has a value @ column j + if (j < rows) { + // update ptr + lptr.push(lvalues.length); + // first value in j column for lower triangular matrix + lvalues.push(1); + lindex.push(j); + } + // update ptr + uptr.push(uvalues.length); + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = ptr[j]; + const k1 = ptr[j + 1]; + // copy column j into sparse accumulator + for (k = k0; k < k1; k++) { + // row + i = index[k]; + // copy column values into sparse accumulator (use permutation vector) + spa.set(pvCo[i], values[k]); + } + // skip first column in upper triangular matrix + if (j > 0) { + // loop rows in column j (above diagonal) + spa.forEach(0, j - 1, function (k, vkj) { + // loop rows in column k (L) + SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) { + // check row is below k + if (i > k) { + // update spa value + spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj))); + } + }); + }); + } + // row with larger value in spa, row >= j + let pi = j; + let vjj = spa.get(j); + let pabsv = abs(vjj); + // loop values in spa (order by row, below diagonal) + spa.forEach(j + 1, rows - 1, function (x, v) { + // absolute value + const absv = abs(v); + // value is greater than pivote value + if (larger(absv, pabsv)) { + // store row + pi = x; + // update max value + pabsv = absv; + // value @ [j, j] + vjj = v; + } + }); + // swap rows (j <-> pi) + if (j !== pi) { + // swap values j <-> pi in L + SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr); + // swap values j <-> pi in U + SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr); + // swap values in spa + spa.swap(j, pi); + // update permutation vector (swap values @ j, pi) + swapIndeces(j, pi); + } + // loop values in spa (order by row) + spa.forEach(0, rows - 1, function (x, v) { + // check we are above diagonal + if (x <= j) { + // update upper triangular matrix + uvalues.push(v); + uindex.push(x); + } else { + // update value + v = divideScalar(v, vjj); + // check value is non zero + if (!equalScalar(v, 0)) { + // update lower triangular matrix + lvalues.push(v); + lindex.push(x); + } + } + }); + } + // update ptrs + uptr.push(uvalues.length); + lptr.push(lvalues.length); + + // return matrices + return { + L: new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: lsize + }), + U: new SparseMatrix({ + values: uvalues, + index: uindex, + ptr: uptr, + size: usize + }), + p: pvCo, + toString: function () { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\nP: ' + this.p; + } + }; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js new file mode 100644 index 0000000..09aa2e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js @@ -0,0 +1,229 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createQr = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _factory = require("../../../utils/factory.js"); +const name = 'qr'; +const dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex']; +const createQr = exports.createQr = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + zeros, + identity, + isZero, + equal, + sign, + sqrt, + conj, + unaryMinus, + addScalar, + divideScalar, + multiplyScalar, + subtractScalar, + complex + } = _ref; + /** + * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in + * two matrices (`Q`, `R`) where `Q` is an + * orthogonal matrix and `R` is an upper triangular matrix. + * + * Syntax: + * + * math.qr(A) + * + * Example: + * + * const m = [ + * [1, -1, 4], + * [1, 4, -2], + * [1, 4, 2], + * [1, -1, 0] + * ] + * const result = math.qr(m) + * // r = { + * // Q: [ + * // [0.5, -0.5, 0.5], + * // [0.5, 0.5, -0.5], + * // [0.5, 0.5, 0.5], + * // [0.5, -0.5, -0.5], + * // ], + * // R: [ + * // [2, 3, 2], + * // [0, 5, -2], + * // [0, 0, 4], + * // [0, 0, 0] + * // ] + * // } + * + * See also: + * + * lup, lusolve + * + * @param {Matrix | Array} A A two dimensional matrix or array + * for which to get the QR decomposition. + * + * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal + * matrix and R: the upper triangular matrix + */ + return (0, _extends2.default)(typed(name, { + DenseMatrix: function (m) { + return _denseQR(m); + }, + SparseMatrix: function (m) { + return _sparseQR(m); + }, + Array: function (a) { + // create dense matrix from array + const m = matrix(a); + // lup, use matrix implementation + const r = _denseQR(m); + // result + return { + Q: r.Q.valueOf(), + R: r.R.valueOf() + }; + } + }), { + _denseQRimpl + }); + function _denseQRimpl(m) { + // rows & columns (m x n) + const rows = m._size[0]; // m + const cols = m._size[1]; // n + + const Q = identity([rows], 'dense'); + const Qdata = Q._data; + const R = m.clone(); + const Rdata = R._data; + + // vars + let i, j, k; + const w = zeros([rows], ''); + for (k = 0; k < Math.min(cols, rows); ++k) { + /* + * **k-th Household matrix** + * + * The matrix I - 2*v*transpose(v) + * x = first column of A + * x1 = first element of x + * alpha = x1 / |x1| * |x| + * e1 = tranpose([1, 0, 0, ...]) + * u = x - alpha * e1 + * v = u / |u| + * + * Household matrix = I - 2 * v * tranpose(v) + * + * * Initially Q = I and R = A. + * * Household matrix is a reflection in a plane normal to v which + * will zero out all but the top right element in R. + * * Appplying reflection to both Q and R will not change product. + * * Repeat this process on the (1,1) minor to get R as an upper + * triangular matrix. + * * Reflections leave the magnitude of the columns of Q unchanged + * so Q remains othoganal. + * + */ + + const pivot = Rdata[k][k]; + const sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot)); + const conjSgn = conj(sgn); + let alphaSquared = 0; + for (i = k; i < rows; i++) { + alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k]))); + } + const alpha = multiplyScalar(sgn, sqrt(alphaSquared)); + if (!isZero(alpha)) { + // first element in vector u + const u1 = subtractScalar(pivot, alpha); + + // w = v * u1 / |u| (only elements k to (rows-1) are used) + w[k] = 1; + for (i = k + 1; i < rows; i++) { + w[i] = divideScalar(Rdata[i][k], u1); + } + + // tau = - conj(u1 / alpha) + const tau = unaryMinus(conj(divideScalar(u1, alpha))); + let s; + + /* + * tau and w have been choosen so that + * + * 2 * v * tranpose(v) = tau * w * tranpose(w) + */ + + /* + * -- calculate R = R - tau * w * tranpose(w) * R -- + * Only do calculation with rows k to (rows-1) + * Additionally columns 0 to (k-1) will not be changed by this + * multiplication so do not bother recalculating them + */ + for (j = k; j < cols; j++) { + s = 0.0; + + // calculate jth element of [tranpose(w) * R] + for (i = k; i < rows; i++) { + s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j])); + } + + // calculate the jth element of [tau * transpose(w) * R] + s = multiplyScalar(s, tau); + for (i = k; i < rows; i++) { + Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn); + } + } + /* + * -- calculate Q = Q - tau * Q * w * transpose(w) -- + * Q is a square matrix (rows x rows) + * Only do calculation with columns k to (rows-1) + * Additionally rows 0 to (k-1) will not be changed by this + * multiplication so do not bother recalculating them + */ + for (i = 0; i < rows; i++) { + s = 0.0; + + // calculate ith element of [Q * w] + for (j = k; j < rows; j++) { + s = addScalar(s, multiplyScalar(Qdata[i][j], w[j])); + } + + // calculate the ith element of [tau * Q * w] + s = multiplyScalar(s, tau); + for (j = k; j < rows; ++j) { + Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn); + } + } + } + } + + // return matrices + return { + Q, + R, + toString: function () { + return 'Q: ' + this.Q.toString() + '\nR: ' + this.R.toString(); + } + }; + } + function _denseQR(m) { + const ret = _denseQRimpl(m); + const Rdata = ret.R._data; + if (m._data.length > 0) { + const zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0; + for (let i = 0; i < Rdata.length; ++i) { + for (let j = 0; j < i && j < (Rdata[0] || []).length; ++j) { + Rdata[i][j] = zero; + } + } + } + return ret; + } + function _sparseQR(m) { + throw new Error('qr not implemented for sparse matrices yet'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js new file mode 100644 index 0000000..a00a947 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSchur = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'schur'; +const dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract']; +const createSchur = exports.createSchur = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + identity, + multiply, + qr, + norm, + subtract + } = _ref; + /** + * + * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal + * and T is upper quasi-triangular. + * https://en.wikipedia.org/wiki/Schur_decomposition + * + * Syntax: + * + * math.schur(A) + * + * Examples: + * + * const A = [[1, 0], [-4, 3]] + * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]} + * + * See also: + * + * sylvester, lyap, qr + * + * @param {Array | Matrix} A Matrix A + * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU' + */ + return typed(name, { + Array: function (X) { + const r = _schur(matrix(X)); + return { + U: r.U.valueOf(), + T: r.T.valueOf() + }; + }, + Matrix: function (X) { + return _schur(X); + } + }); + function _schur(X) { + const n = X.size()[0]; + let A = X; + let U = identity(n); + let k = 0; + let A0; + do { + A0 = A; + const QR = qr(A); + const Q = QR.Q; + const R = QR.R; + A = multiply(R, Q); + U = multiply(U, Q); + if (k++ > 100) { + break; + } + } while (norm(subtract(A, A0)) > 1e-4); + return { + U, + T: A + }; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js new file mode 100644 index 0000000..a471b82 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSlu = void 0; +var _number = require("../../../utils/number.js"); +var _factory = require("../../../utils/factory.js"); +var _csSqr = require("../sparse/csSqr.js"); +var _csLu = require("../sparse/csLu.js"); +const name = 'slu'; +const dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix']; +const createSlu = exports.createSlu = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + add, + multiply, + transpose, + divideScalar, + subtract, + larger, + largerEq, + SparseMatrix + } = _ref; + const csSqr = (0, _csSqr.createCsSqr)({ + add, + multiply, + transpose + }); + const csLu = (0, _csLu.createCsLu)({ + abs, + divideScalar, + multiply, + subtract, + larger, + largerEq, + SparseMatrix + }); + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where + * + * `P * A * Q = L * U` + * + * Syntax: + * + * math.slu(A, order, threshold) + * + * Examples: + * + * const A = math.sparse([[4,3], [6, 3]]) + * math.slu(A, 1, 0.001) + * // returns: + * // { + * // L: [[1, 0], [1.5, 1]] + * // U: [[4, 3], [0, -1.5]] + * // p: [0, 1] + * // q: [0, 1] + * // } + * + * See also: + * + * lup, lsolve, usolve, lusolve + * + * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition. + * @param {Number} order The Symbolic Ordering and Analysis order: + * 0 - Natural ordering, no permutation vector q is returned + * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' + * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. + * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. + * A dense row is a row with more than 10*sqr(columns) entries. + * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting) + * + * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors. + */ + return typed(name, { + 'SparseMatrix, number, number': function (a, order, threshold) { + // verify order + if (!(0, _number.isInteger)(order) || order < 0 || order > 3) { + throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]'); + } + // verify threshold + if (threshold < 0 || threshold > 1) { + throw new Error('Partial pivoting threshold must be a number from 0 to 1'); + } + + // perform symbolic ordering and analysis + const s = csSqr(order, a, false); + + // perform lu decomposition + const f = csLu(a, s, threshold); + + // return decomposition + return { + L: f.L, + U: f.U, + p: f.pinv, + q: s.q, + toString: function () { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\np: ' + this.p.toString() + (this.q ? '\nq: ' + this.q.toString() : '') + '\n'; + } + }; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/derivative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/derivative.js new file mode 100644 index 0000000..5e12897 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/derivative.js @@ -0,0 +1,525 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDerivative = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +const name = 'derivative'; +const dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +const createDerivative = exports.createDerivative = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + parse, + simplify, + equal, + isZero, + numeric, + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + /** + * Takes the derivative of an expression expressed in parser Nodes. + * The derivative will be taken over the supplied variable in the + * second parameter. If there are multiple variables in the expression, + * it will return a partial derivative. + * + * This uses rules of differentiation which can be found here: + * + * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules) + * + * Syntax: + * + * math.derivative(expr, variable) + * math.derivative(expr, variable, options) + * + * Examples: + * + * math.derivative('x^2', 'x') // Node '2 * x' + * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)' + * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)' + * math.derivative('2*x', 'x').evaluate() // number 2 + * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8 + * const f = math.parse('x^2') + * const x = math.parse('x') + * math.derivative(f, x) // Node {2 * x} + * + * See also: + * + * simplify, parse, evaluate + * + * @param {Node | string} expr The expression to differentiate + * @param {SymbolNode | string} variable The variable over which to differentiate + * @param {{simplify: boolean}} [options] + * There is one option available, `simplify`, which + * is true by default. When false, output will not + * be simplified. + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` + */ + function plainDerivative(expr, variable) { + let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { + simplify: true + }; + const constNodes = {}; + constTag(constNodes, expr, variable.name); + const res = _derivative(expr, constNodes); + return options.simplify ? simplify(res) : res; + } + function parseIdentifier(string) { + const symbol = parse(string); + if (!symbol.isSymbolNode) { + throw new TypeError('Invalid variable. ' + `Cannot parse ${JSON.stringify(string)} into a variable in function derivative`); + } + return symbol; + } + const derivative = typed(name, { + 'Node, SymbolNode': plainDerivative, + 'Node, SymbolNode, Object': plainDerivative, + 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)), + 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options) + + /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number} + 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) { + let res = expr + for (let i = 0; i < order; i++) { + let constNodes = {} + constTag(constNodes, expr, variable.name) + res = _derivative(res, constNodes) + } + return res + } + */ + }); + derivative._simplify = true; + derivative.toTex = function (deriv) { + return _derivTex.apply(null, deriv.args); + }; + + // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse. + // NOTE: the optional "order" parameter here is currently unused + const _derivTex = typed('_derivTex', { + 'Node, SymbolNode': function (expr, x) { + if ((0, _is.isConstantNode)(expr) && (0, _is.typeOf)(expr.value) === 'string') { + return _derivTex(parse(expr.value).toString(), x.toString(), 1); + } else { + return _derivTex(expr.toTex(), x.toString(), 1); + } + }, + 'Node, ConstantNode': function (expr, x) { + if ((0, _is.typeOf)(x.value) === 'string') { + return _derivTex(expr, parse(x.value)); + } else { + throw new Error("The second parameter to 'derivative' is a non-string constant"); + } + }, + 'Node, SymbolNode, ConstantNode': function (expr, x, order) { + return _derivTex(expr.toString(), x.name, order.value); + }, + 'string, string, number': function (expr, x, order) { + let d; + if (order === 1) { + d = '{d\\over d' + x + '}'; + } else { + d = '{d^{' + order + '}\\over d' + x + '^{' + order + '}}'; + } + return d + `\\left[${expr}\\right]`; + } + }); + + /** + * Does a depth-first search on the expression tree to identify what Nodes + * are constants (e.g. 2 + 2), and stores the ones that are constants in + * constNodes. Classification is done as follows: + * + * 1. ConstantNodes are constants. + * 2. If there exists a SymbolNode, of which we are differentiating over, + * in the subtree it is not constant. + * + * @param {Object} constNodes Holds the nodes that are constant + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {string} varName Variable that we are differentiating + * @return {boolean} if node is constant + */ + // TODO: can we rewrite constTag into a pure function? + const constTag = typed('constTag', { + 'Object, ConstantNode, string': function (constNodes, node) { + constNodes[node] = true; + return true; + }, + 'Object, SymbolNode, string': function (constNodes, node, varName) { + // Treat other variables like constants. For reasoning, see: + // https://en.wikipedia.org/wiki/Partial_derivative + if (node.name !== varName) { + constNodes[node] = true; + return true; + } + return false; + }, + 'Object, ParenthesisNode, string': function (constNodes, node, varName) { + return constTag(constNodes, node.content, varName); + }, + 'Object, FunctionAssignmentNode, string': function (constNodes, node, varName) { + if (!node.params.includes(varName)) { + constNodes[node] = true; + return true; + } + return constTag(constNodes, node.expr, varName); + }, + 'Object, FunctionNode | OperatorNode, string': function (constNodes, node, varName) { + if (node.args.length > 0) { + let isConst = constTag(constNodes, node.args[0], varName); + for (let i = 1; i < node.args.length; ++i) { + isConst = constTag(constNodes, node.args[i], varName) && isConst; + } + if (isConst) { + constNodes[node] = true; + return true; + } + } + return false; + } + }); + + /** + * Applies differentiation rules. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object} constNodes Holds the nodes that are constant + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` + */ + const _derivative = typed('_derivative', { + 'ConstantNode, Object': function (node) { + return createConstantNode(0); + }, + 'SymbolNode, Object': function (node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + return createConstantNode(1); + }, + 'ParenthesisNode, Object': function (node, constNodes) { + return new ParenthesisNode(_derivative(node.content, constNodes)); + }, + 'FunctionAssignmentNode, Object': function (node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + return _derivative(node.expr, constNodes); + }, + 'FunctionNode, Object': function (node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + const arg0 = node.args[0]; + let arg1; + let div = false; // is output a fraction? + let negative = false; // is output negative? + + let funcDerivative; + switch (node.name) { + case 'cbrt': + // d/dx(cbrt(x)) = 1 / (3x^(2/3)) + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]); + break; + case 'sqrt': + case 'nthRoot': + // d/dx(sqrt(x)) = 1 / (2*sqrt(x)) + if (node.args.length === 1) { + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]); + } else if (node.args.length === 2) { + // Rearrange from nthRoot(x, a) -> x^(1/a) + arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]); + + // Is a variable? + constNodes[arg1] = constNodes[node.args[1]]; + return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes); + } + break; + case 'log10': + arg1 = createConstantNode(10); + /* fall through! */ + case 'log': + if (!arg1 && node.args.length === 1) { + // d/dx(log(x)) = 1 / x + funcDerivative = arg0.clone(); + div = true; + } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) { + // d/dx(log(x, c)) = 1 / (x*ln(c)) + funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]); + div = true; + } else if (node.args.length === 2) { + // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x))) + return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes); + } + break; + case 'pow': + if (node.args.length === 2) { + constNodes[arg1] = constNodes[node.args[1]]; + // Pass to pow operator node parser + return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes); + } + break; + case 'exp': + // d/dx(e^x) = e^x + funcDerivative = new FunctionNode('exp', [arg0.clone()]); + break; + case 'sin': + // d/dx(sin(x)) = cos(x) + funcDerivative = new FunctionNode('cos', [arg0.clone()]); + break; + case 'cos': + // d/dx(cos(x)) = -sin(x) + funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]); + break; + case 'tan': + // d/dx(tan(x)) = sec(x)^2 + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]); + break; + case 'sec': + // d/dx(sec(x)) = sec(x)tan(x) + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]); + break; + case 'csc': + // d/dx(csc(x)) = -csc(x)cot(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]); + break; + case 'cot': + // d/dx(cot(x)) = -csc(x)^2 + negative = true; + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]); + break; + case 'asin': + // d/dx(asin(x)) = 1 / sqrt(1 - x^2) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]); + break; + case 'acos': + // d/dx(acos(x)) = -1 / sqrt(1 - x^2) + div = true; + negative = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]); + break; + case 'atan': + // d/dx(atan(x)) = 1 / (x^2 + 1) + div = true; + funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]); + break; + case 'asec': + // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1)) + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acsc': + // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acot': + // d/dx(acot(x)) = -1 / (x^2 + 1) + div = true; + negative = true; + funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]); + break; + case 'sinh': + // d/dx(sinh(x)) = cosh(x) + funcDerivative = new FunctionNode('cosh', [arg0.clone()]); + break; + case 'cosh': + // d/dx(cosh(x)) = sinh(x) + funcDerivative = new FunctionNode('sinh', [arg0.clone()]); + break; + case 'tanh': + // d/dx(tanh(x)) = sech(x)^2 + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]); + break; + case 'sech': + // d/dx(sech(x)) = -sech(x)tanh(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]); + break; + case 'csch': + // d/dx(csch(x)) = -csch(x)coth(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]); + break; + case 'coth': + // d/dx(coth(x)) = -csch(x)^2 + negative = true; + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]); + break; + case 'asinh': + // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]); + break; + case 'acosh': + // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]); + break; + case 'atanh': + // d/dx(atanh(x)) = 1 / (1 - x^2) + div = true; + funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]); + break; + case 'asech': + // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]); + break; + case 'acsch': + // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acoth': + // d/dx(acoth(x)) = -1 / (1 - x^2) + div = true; + negative = true; + funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]); + break; + case 'abs': + // d/dx(abs(x)) = abs(x)/x + funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]); + break; + case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x) + default: + throw new Error('Cannot process function "' + node.name + '" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported'); + } + let op, func; + if (div) { + op = '/'; + func = 'divide'; + } else { + op = '*'; + func = 'multiply'; + } + + /* Apply chain rule to all functions: + F(x) = f(g(x)) + F'(x) = g'(x)*f'(g(x)) */ + let chainDerivative = _derivative(arg0, constNodes); + if (negative) { + chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]); + } + return new OperatorNode(op, func, [chainDerivative, funcDerivative]); + }, + 'OperatorNode, Object': function (node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + if (node.op === '+') { + // d/dx(sum(f(x)) = sum(f'(x)) + return new OperatorNode(node.op, node.fn, node.args.map(function (arg) { + return _derivative(arg, constNodes); + })); + } + if (node.op === '-') { + // d/dx(+/-f(x)) = +/-f'(x) + if (node.isUnary()) { + return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]); + } + + // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x) + if (node.isBinary()) { + return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]); + } + } + if (node.op === '*') { + // d/dx(c*f(x)) = c*f'(x) + const constantTerms = node.args.filter(function (arg) { + return constNodes[arg] !== undefined; + }); + if (constantTerms.length > 0) { + const nonConstantTerms = node.args.filter(function (arg) { + return constNodes[arg] === undefined; + }); + const nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms); + const newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes)); + return new OperatorNode('*', 'multiply', newArgs); + } + + // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x) + return new OperatorNode('+', 'add', node.args.map(function (argOuter) { + return new OperatorNode('*', 'multiply', node.args.map(function (argInner) { + return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone(); + })); + })); + } + if (node.op === '/' && node.isBinary()) { + const arg0 = node.args[0]; + const arg1 = node.args[1]; + + // d/dx(f(x) / c) = f'(x) / c + if (constNodes[arg1] !== undefined) { + return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]); + } + + // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2) + if (constNodes[arg0] !== undefined) { + return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]); + } + + // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2 + return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]); + } + if (node.op === '^' && node.isBinary()) { + const arg0 = node.args[0]; + const arg1 = node.args[1]; + if (constNodes[arg0] !== undefined) { + // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1 + if ((0, _is.isConstantNode)(arg0) && (isZero(arg0.value) || equal(arg0.value, 1))) { + return createConstantNode(0); + } + + // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x) + return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [arg0.clone()]), _derivative(arg1.clone(), constNodes)])]); + } + if (constNodes[arg1] !== undefined) { + if ((0, _is.isConstantNode)(arg1)) { + // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0 + if (isZero(arg1.value)) { + return createConstantNode(0); + } + // Ignore exponent; f(x)^1 = f(x) + if (equal(arg1.value, 1)) { + return _derivative(arg0, constNodes); + } + } + + // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1) + const powMinusOne = new OperatorNode('^', 'pow', [arg0.clone(), new OperatorNode('-', 'subtract', [arg1, createConstantNode(1)])]); + return new OperatorNode('*', 'multiply', [arg1.clone(), new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), powMinusOne])]); + } + + // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)] + return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [arg0.clone(), arg1.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), new OperatorNode('/', 'divide', [arg1.clone(), arg0.clone()])]), new OperatorNode('*', 'multiply', [_derivative(arg1, constNodes), new FunctionNode('log', [arg0.clone()])])])]); + } + throw new Error('Cannot process operator "' + node.op + '" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported'); + } + }); + + /** + * Helper function to create a constant node with a specific type + * (number, BigNumber, Fraction) + * @param {number} value + * @param {string} [valueType] + * @return {ConstantNode} + */ + function createConstantNode(value, valueType) { + return new ConstantNode(numeric(value, valueType || (0, _number.safeNumberType)(String(value), config))); + } + return derivative; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js new file mode 100644 index 0000000..bb6d65a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLeafCount = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'leafCount'; +const dependencies = ['parse', 'typed']; +const createLeafCount = exports.createLeafCount = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + parse, + typed + } = _ref; + // This does the real work, but we don't have to recurse through + // a typed call if we separate it out + function countLeaves(node) { + let count = 0; + node.forEach(n => { + count += countLeaves(n); + }); + return count || 1; + } + + /** + * Gives the number of "leaf nodes" in the parse tree of the given expression + * A leaf node is one that has no subexpressions, essentially either a + * symbol or a constant. Note that `5!` has just one leaf, the '5'; the + * unary factorial operator does not add a leaf. On the other hand, + * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves. + * + * The `simplify()` function should generally not increase the `leafCount()` + * of an expression, although currently there is no guarantee that it never + * does so. In many cases, `simplify()` reduces the leaf count. + * + * Syntax: + * + * math.leafCount(expr) + * + * Examples: + * + * math.leafCount('x') // 1 + * math.leafCount(math.parse('a*d-b*c')) // 4 + * math.leafCount('[a,b;c,d][0,1]') // 6 + * + * See also: + * + * simplify + * + * @param {Node|string} expr The expression to count the leaves of + * + * @return {number} The number of leaves of `expr` + * + */ + return typed(name, { + Node: function (expr) { + return countLeaves(expr); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/lyap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/lyap.js new file mode 100644 index 0000000..1548e7b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/lyap.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLyap = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'lyap'; +const dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose']; +const createLyap = exports.createLyap = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + sylvester, + multiply, + transpose + } = _ref; + /** + * + * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where + * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice + * that different equivalent definitions exist for the Continuous-time + * Lyapunov equation. + * https://en.wikipedia.org/wiki/Lyapunov_equation + * + * Syntax: + * + * math.lyap(A, Q) + * + * Examples: + * + * const A = [[-2, 0], [1, -4]] + * const Q = [[3, 1], [1, 3]] + * const P = math.lyap(A, Q) + * + * See also: + * + * sylvester, schur + * + * @param {Matrix | Array} A Matrix A + * @param {Matrix | Array} Q Matrix Q + * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q + */ + return typed(name, { + 'Matrix, Matrix': function (A, Q) { + return sylvester(A, transpose(A), multiply(-1, Q)); + }, + 'Array, Matrix': function (A, Q) { + return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q)); + }, + 'Matrix, Array': function (A, Q) { + return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q))); + }, + 'Array, Array': function (A, Q) { + return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js new file mode 100644 index 0000000..dc7ec39 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js @@ -0,0 +1,128 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPolynomialRoot = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'polynomialRoot'; +const dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're']; +const createPolynomialRoot = exports.createPolynomialRoot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isZero, + equalScalar, + add, + subtract, + multiply, + divide, + sqrt, + unaryMinus, + cbrt, + typeOf, + im, + re + } = _ref; + /** + * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients. + * Currently operates only on linear, quadratic, and cubic polynomials using the standard + * formulas for the roots. + * + * Syntax: + * + * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff) + * + * Examples: + * // linear + * math.polynomialRoot(6, 3) // [-2] + * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i] + * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i] + * // quadratic + * math.polynomialRoot(2, -3, 1) // [2, 1] + * math.polynomialRoot(8, 8, 2) // [-2] + * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951] + * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i] + * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i] + * // cubic + * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2] + * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i] + * math.polynomialRoot(0, 8, 8, 2) // [0, -2] + * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i] + * + * See also: + * cbrt, sqrt + * + * @param {... number | Complex} coeffs + * The coefficients of the polynomial, starting with with the constant coefficent, followed + * by the linear coefficient and subsequent coefficients of increasing powers. + * @return {Array} The distinct roots of the polynomial + */ + + return typed(name, { + 'number|Complex, ...number|Complex': (constant, restCoeffs) => { + const coeffs = [constant, ...restCoeffs]; + while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) { + coeffs.pop(); + } + if (coeffs.length < 2) { + throw new RangeError(`Polynomial [${constant}, ${restCoeffs}] must have a non-zero non-constant coefficient`); + } + switch (coeffs.length) { + case 2: + // linear + return [unaryMinus(divide(coeffs[0], coeffs[1]))]; + case 3: + { + // quadratic + const [c, b, a] = coeffs; + const denom = multiply(2, a); + const d1 = multiply(b, b); + const d2 = multiply(4, a, c); + if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)]; + const discriminant = sqrt(subtract(d1, d2)); + return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)]; + } + case 4: + { + // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation + const [d, c, b, a] = coeffs; + const denom = unaryMinus(multiply(3, a)); + const D0_1 = multiply(b, b); + const D0_2 = multiply(3, a, c); + const D1_1 = add(multiply(2, b, b, b), multiply(27, a, a, d)); + const D1_2 = multiply(9, a, b, c); + if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) { + return [divide(b, denom)]; + } + const Delta0 = subtract(D0_1, D0_2); + const Delta1 = subtract(D1_1, D1_2); + const discriminant1 = add(multiply(18, a, b, c, d), multiply(b, b, c, c)); + const discriminant2 = add(multiply(4, b, b, b, d), multiply(4, a, c, c, c), multiply(27, a, a, d, d)); + if (equalScalar(discriminant1, discriminant2)) { + return [divide(subtract(multiply(4, a, b, c), add(multiply(9, a, a, d), multiply(b, b, b))), multiply(a, Delta0)), + // simple root + divide(subtract(multiply(9, a, d), multiply(b, c)), multiply(2, Delta0)) // double root + ]; + } + // OK, we have three distinct roots + let Ccubed; + if (equalScalar(D0_1, D0_2)) { + Ccubed = Delta1; + } else { + Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2); + } + const allRoots = true; + const rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(b, C, divide(Delta0, C)), denom)); + return rawRoots.map(r => { + if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) { + return re(r); + } + return r; + }); + } + default: + throw new RangeError(`only implemented for cubic or lower-order polynomials, not ${coeffs}`); + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js new file mode 100644 index 0000000..49ea9a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js @@ -0,0 +1,825 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRationalize = void 0; +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'rationalize'; +const dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode']; +const createRationalize = exports.createRationalize = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + typed, + equal, + isZero, + add, + subtract, + multiply, + divide, + pow, + parse, + simplifyConstant, + simplifyCore, + simplify, + fraction, + bignumber, + mathWithTransform, + matrix, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + ParenthesisNode + } = _ref; + /** + * Transform a rationalizable expression in a rational fraction. + * If rational fraction is one variable polynomial then converts + * the numerator and denominator in canonical form, with decreasing + * exponents, returning the coefficients of numerator. + * + * Syntax: + * + * math.rationalize(expr) + * math.rationalize(expr, detailed) + * math.rationalize(expr, scope) + * math.rationalize(expr, scope, detailed) + * + * Examples: + * + * math.rationalize('sin(x)+y') + * // Error: There is an unsolved function call + * math.rationalize('2x/y - y/(x+1)') + * // (2*x^2-y^2+2*x)/(x*y+y) + * math.rationalize('(2x+1)^6') + * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1 + * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3') + * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4) + * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') = + * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/ + * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72) + * + * math.rationalize('x+x+x+y',{y:1}) // 3*x+1 + * math.rationalize('x+x+x+y',{}) // 3*x+y + * + * const ret = math.rationalize('x+x+x+y',{},true) + * // ret.expression=3*x+y, ret.variables = ["x","y"] + * const ret = math.rationalize('-2+5x^2',{},true) + * // ret.expression=5*x^2-2, ret.variables = ["x"], ret.coefficients=[-2,0,5] + * + * See also: + * + * simplify + * + * @param {Node|string} expr The expression to check if is a polynomial expression + * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input + * @param {Boolean} detailed optional True if return an object, false if return expression node (default) + * + * @return {Object | Node} The rational polynomial of `expr` or an object + * `{expression, numerator, denominator, variables, coefficients}`, where + * `expression` is a `Node` with the node simplified expression, + * `numerator` is a `Node` with the simplified numerator of expression, + * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator), + * `variables` is an array with variable names, + * and `coefficients` is an array with coefficients of numerator sorted by increased exponent + * {Expression Node} node simplified expression + * + */ + function _rationalize(expr) { + let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const setRules = rulesRationalize(); // Rules for change polynomial in near canonical form + const polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial + const nVars = polyRet.variables.length; + const noExactFractions = { + exactFractions: false + }; + const withExactFractions = { + exactFractions: true + }; + expr = polyRet.expression; + if (nVars >= 1) { + // If expression in not a constant + expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!) + let sBefore; // Previous expression + let rules; + let eDistrDiv = true; + let redoInic = false; + // Apply the initial rules, including succ div rules: + expr = simplify(expr, setRules.firstRules, {}, noExactFractions); + let s; + while (true) { + // Alternate applying successive division rules and distr.div.rules + // until there are no more changes: + rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules; + expr = simplify(expr, rules, {}, withExactFractions); + eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules + + s = expr.toString(); + if (s === sBefore) { + break; // No changes : end of the loop + } + redoInic = true; + sBefore = s; + } + if (redoInic) { + // Apply first rules again without succ div rules (if there are changes) + expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions); + } + // Apply final rules: + expr = simplify(expr, setRules.finalRules, {}, noExactFractions); + } // NVars >= 1 + + const coefficients = []; + const retRationalize = {}; + if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') { + // Separate numerator from denominator + if (nVars === 1) { + expr.args[0] = polyToCanonical(expr.args[0], coefficients); + expr.args[1] = polyToCanonical(expr.args[1]); + } + if (detailed) { + retRationalize.numerator = expr.args[0]; + retRationalize.denominator = expr.args[1]; + } + } else { + if (nVars === 1) { + expr = polyToCanonical(expr, coefficients); + } + if (detailed) { + retRationalize.numerator = expr; + retRationalize.denominator = null; + } + } + // nVars + + if (!detailed) return expr; + retRationalize.coefficients = coefficients; + retRationalize.variables = polyRet.variables; + retRationalize.expression = expr; + return retRationalize; + } + return typed(name, { + Node: _rationalize, + 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed), + 'Node, Object': _rationalize, + 'Node, Object, boolean': _rationalize + }); // end of typed rationalize + + /** + * Function to simplify an expression using an optional scope and + * return it if the expression is a polynomial expression, i.e. + * an expression with one or more variables and the operators + * +, -, *, and ^, where the exponent can only be a positive integer. + * + * Syntax: + * + * polynomial(expr,scope,extended, rules) + * + * @param {Node | string} expr The expression to simplify and check if is polynomial expression + * @param {object} scope Optional scope for expression simplification + * @param {boolean} extended Optional. Default is false. When true allows divide operator. + * @param {array} rules Optional. Default is no rule. + * + * + * @return {Object} + * {Object} node: node simplified expression + * {Array} variables: variable names + */ + function polynomial(expr, scope, extended, rules) { + const variables = []; + const node = simplify(expr, rules, scope, { + exactFractions: false + }); // Resolves any variables and functions with all defined parameters + extended = !!extended; + const oper = '+-*' + (extended ? '/' : ''); + recPoly(node); + const retFunc = {}; + retFunc.expression = node; + retFunc.variables = variables; + return retFunc; + + // ------------------------------------------------------------------------------------------------------- + + /** + * Function to simplify an expression using an optional scope and + * return it if the expression is a polynomial expression, i.e. + * an expression with one or more variables and the operators + * +, -, *, and ^, where the exponent can only be a positive integer. + * + * Syntax: + * + * recPoly(node) + * + * + * @param {Node} node The current sub tree expression in recursion + * + * @return nothing, throw an exception if error + */ + function recPoly(node) { + const tp = node.type; // node type + if (tp === 'FunctionNode') { + // No function call in polynomial expression + throw new Error('There is an unsolved function call'); + } else if (tp === 'OperatorNode') { + if (node.op === '^') { + // TODO: handle negative exponents like in '1/x^(-2)' + if (node.args[1].type !== 'ConstantNode' || !(0, _number.isInteger)(parseFloat(node.args[1].value))) { + throw new Error('There is a non-integer exponent'); + } else { + recPoly(node.args[0]); + } + } else { + if (!oper.includes(node.op)) { + throw new Error('Operator ' + node.op + ' invalid in polynomial expression'); + } + for (let i = 0; i < node.args.length; i++) { + recPoly(node.args[i]); + } + } // type of operator + } else if (tp === 'SymbolNode') { + const name = node.name; // variable name + const pos = variables.indexOf(name); + if (pos === -1) { + // new variable in expression + variables.push(name); + } + } else if (tp === 'ParenthesisNode') { + recPoly(node.content); + } else if (tp !== 'ConstantNode') { + throw new Error('type ' + tp + ' is not allowed in polynomial expression'); + } + } // end of recPoly + } // end of polynomial + + // --------------------------------------------------------------------------------------- + /** + * Return a rule set to rationalize an polynomial expression in rationalize + * + * Syntax: + * + * rulesRationalize() + * + * @return {array} rule set to rationalize an polynomial expression + */ + function rulesRationalize() { + const oldRules = [simplifyCore, + // sCore + { + l: 'n+n', + r: '2*n' + }, { + l: 'n+-n', + r: '0' + }, simplifyConstant, + // sConstant + { + l: 'n*(n1^-1)', + r: 'n/n1' + }, { + l: 'n*n1^-n2', + r: 'n/n1^n2' + }, { + l: 'n1^-1', + r: '1/n1' + }, { + l: 'n*(n1/n2)', + r: '(n*n1)/n2' + }, { + l: '1*n', + r: 'n' + }]; + const rulesFirst = [{ + l: '(-n1)/(-n2)', + r: 'n1/n2' + }, + // Unary division + { + l: '(-n1)*(-n2)', + r: 'n1*n2' + }, + // Unary multiplication + { + l: 'n1--n2', + r: 'n1+n2' + }, + // '--' elimination + { + l: 'n1-n2', + r: 'n1+(-n2)' + }, + // Subtraction turn into add with un�ry minus + { + l: '(n1+n2)*n3', + r: '(n1*n3 + n2*n3)' + }, + // Distributive 1 + { + l: 'n1*(n2+n3)', + r: '(n1*n2+n1*n3)' + }, + // Distributive 2 + { + l: 'c1*n + c2*n', + r: '(c1+c2)*n' + }, + // Joining constants + { + l: 'c1*n + n', + r: '(c1+1)*n' + }, + // Joining constants + { + l: 'c1*n - c2*n', + r: '(c1-c2)*n' + }, + // Joining constants + { + l: 'c1*n - n', + r: '(c1-1)*n' + }, + // Joining constants + { + l: 'v/c', + r: '(1/c)*v' + }, + // variable/constant (new!) + { + l: 'v/-c', + r: '-(1/c)*v' + }, + // variable/constant (new!) + { + l: '-v*-c', + r: 'c*v' + }, + // Inversion constant and variable 1 + { + l: '-v*c', + r: '-c*v' + }, + // Inversion constant and variable 2 + { + l: 'v*-c', + r: '-c*v' + }, + // Inversion constant and variable 3 + { + l: 'v*c', + r: 'c*v' + }, + // Inversion constant and variable 4 + { + l: '-(-n1*n2)', + r: '(n1*n2)' + }, + // Unary propagation + { + l: '-(n1*n2)', + r: '(-n1*n2)' + }, + // Unary propagation + { + l: '-(-n1+n2)', + r: '(n1-n2)' + }, + // Unary propagation + { + l: '-(n1+n2)', + r: '(-n1-n2)' + }, + // Unary propagation + { + l: '(n1^n2)^n3', + r: '(n1^(n2*n3))' + }, + // Power to Power + { + l: '-(-n1/n2)', + r: '(n1/n2)' + }, + // Division and Unary + { + l: '-(n1/n2)', + r: '(-n1/n2)' + }]; // Divisao and Unary + + const rulesDistrDiv = [{ + l: '(n1/n2 + n3/n4)', + r: '((n1*n4 + n3*n2)/(n2*n4))' + }, + // Sum of fractions + { + l: '(n1/n2 + n3)', + r: '((n1 + n3*n2)/n2)' + }, + // Sum fraction with number 1 + { + l: '(n1 + n2/n3)', + r: '((n1*n3 + n2)/n3)' + }]; // Sum fraction with number 1 + + const rulesSucDiv = [{ + l: '(n1/(n2/n3))', + r: '((n1*n3)/n2)' + }, + // Division simplification + { + l: '(n1/n2/n3)', + r: '(n1/(n2*n3))' + }]; + const setRules = {}; // rules set in 4 steps. + + // All rules => infinite loop + // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv) + + setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set + setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules + setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules + setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div. + + // Division simplification + + // Second rule set. + // There is no aggregate expression with parentesis, but the only variable can be scattered. + setRules.finalRules = [simplifyCore, + // simplify.rules[0] + { + l: 'n*-n', + r: '-n^2' + }, + // Joining multiply with power 1 + { + l: 'n*n', + r: 'n^2' + }, + // Joining multiply with power 2 + simplifyConstant, + // simplify.rules[14] old 3rd index in oldRules + { + l: 'n*-n^n1', + r: '-n^(n1+1)' + }, + // Joining multiply with power 3 + { + l: 'n*n^n1', + r: 'n^(n1+1)' + }, + // Joining multiply with power 4 + { + l: 'n^n1*-n^n2', + r: '-n^(n1+n2)' + }, + // Joining multiply with power 5 + { + l: 'n^n1*n^n2', + r: 'n^(n1+n2)' + }, + // Joining multiply with power 6 + { + l: 'n^n1*-n', + r: '-n^(n1+1)' + }, + // Joining multiply with power 7 + { + l: 'n^n1*n', + r: 'n^(n1+1)' + }, + // Joining multiply with power 8 + { + l: 'n^n1/-n', + r: '-n^(n1-1)' + }, + // Joining multiply with power 8 + { + l: 'n^n1/n', + r: 'n^(n1-1)' + }, + // Joining division with power 1 + { + l: 'n/-n^n1', + r: '-n^(1-n1)' + }, + // Joining division with power 2 + { + l: 'n/n^n1', + r: 'n^(1-n1)' + }, + // Joining division with power 3 + { + l: 'n^n1/-n^n2', + r: 'n^(n1-n2)' + }, + // Joining division with power 4 + { + l: 'n^n1/n^n2', + r: 'n^(n1-n2)' + }, + // Joining division with power 5 + { + l: 'n1+(-n2*n3)', + r: 'n1-n2*n3' + }, + // Solving useless parenthesis 1 + { + l: 'v*(-c)', + r: '-c*v' + }, + // Solving useless unary 2 + { + l: 'n1+-n2', + r: 'n1-n2' + }, + // Solving +- together (new!) + { + l: 'v*c', + r: 'c*v' + }, + // inversion constant with variable + { + l: '(n1^n2)^n3', + r: '(n1^(n2*n3))' + } // Power to Power + ]; + return setRules; + } // End rulesRationalize + + // --------------------------------------------------------------------------------------- + /** + * Expand recursively a tree node for handling with expressions with exponents + * (it's not for constants, symbols or functions with exponents) + * PS: The other parameters are internal for recursion + * + * Syntax: + * + * expandPower(node) + * + * @param {Node} node Current expression node + * @param {node} parent Parent current node inside the recursion + * @param (int} Parent number of chid inside the rercursion + * + * @return {node} node expression with all powers expanded. + */ + function expandPower(node, parent, indParent) { + const tp = node.type; + const internal = arguments.length > 1; // TRUE in internal calls + + if (tp === 'OperatorNode' && node.isBinary()) { + let does = false; + let val; + if (node.op === '^') { + // First operator: Parenthesis or UnaryMinus + if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') { + // Second operator: Constant + val = parseFloat(node.args[1].value); + does = val >= 2 && (0, _number.isInteger)(val); + } + } + if (does) { + // Exponent >= 2 + // Before: + // operator A --> Subtree + // parent pow + // constant + // + if (val > 2) { + // Exponent > 2, + // AFTER: (exponent > 2) + // operator A --> Subtree + // parent * + // deep clone (operator A --> Subtree + // pow + // constant - 1 + // + const nEsqTopo = node.args[0]; + const nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]); + node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]); + } else { + // Expo = 2 - no power + // AFTER: (exponent = 2) + // operator A --> Subtree + // parent oper + // deep clone (operator A --> Subtree) + // + node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]); + } + if (internal) { + // Change parent references in internal recursive calls + if (indParent === 'content') { + parent.content = node; + } else { + parent.args[indParent] = node; + } + } + } // does + } // binary OperatorNode + + if (tp === 'ParenthesisNode') { + // Recursion + expandPower(node.content, node, 'content'); + } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') { + for (let i = 0; i < node.args.length; i++) { + expandPower(node.args[i], node, i); + } + } + if (!internal) { + // return the root node + return node; + } + } // End expandPower + + // --------------------------------------------------------------------------------------- + /** + * Auxilary function for rationalize + * Convert near canonical polynomial in one variable in a canonical polynomial + * with one term for each exponent in decreasing order + * + * Syntax: + * + * polyToCanonical(node [, coefficients]) + * + * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression + * + * The string or tree expression needs to be at below syntax, with free spaces: + * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+ + * Where 'var' is one variable with any valid name + * 'cte' are real numeric constants with any value. It can be omitted if equal than 1 + * 'expo' are integers greater than 0. It can be omitted if equal than 1. + * + * @param {array} coefficients Optional returns coefficients sorted by increased exponent + * + * + * @return {node} new node tree with one variable polynomial or string error. + */ + function polyToCanonical(node, coefficients) { + if (coefficients === undefined) { + coefficients = []; + } // coefficients. + + coefficients[0] = 0; // index is the exponent + const o = {}; + o.cte = 1; + o.oper = '+'; + + // fire: mark with * or ^ when finds * or ^ down tree, reset to "" with + and -. + // It is used to deduce the exponent: 1 for *, 0 for "". + o.fire = ''; + let maxExpo = 0; // maximum exponent + let varname = ''; // variable name + + recurPol(node, null, o); + maxExpo = coefficients.length - 1; + let first = true; + let no; + for (let i = maxExpo; i >= 0; i--) { + if (coefficients[i] === 0) continue; + let n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i])); + const op = coefficients[i] < 0 ? '-' : '+'; + if (i > 0) { + // Is not a constant without variable + let n2 = new SymbolNode(varname); + if (i > 1) { + const n3 = new ConstantNode(i); + n2 = new OperatorNode('^', 'pow', [n2, n3]); + } + if (coefficients[i] === -1 && first) { + n1 = new OperatorNode('-', 'unaryMinus', [n2]); + } else if (Math.abs(coefficients[i]) === 1) { + n1 = n2; + } else { + n1 = new OperatorNode('*', 'multiply', [n1, n2]); + } + } + if (first) { + no = n1; + } else if (op === '+') { + no = new OperatorNode('+', 'add', [no, n1]); + } else { + no = new OperatorNode('-', 'subtract', [no, n1]); + } + first = false; + } // for + + if (first) { + return new ConstantNode(0); + } else { + return no; + } + + /** + * Recursive auxilary function inside polyToCanonical for + * converting expression in canonical form + * + * Syntax: + * + * recurPol(node, noPai, obj) + * + * @param {Node} node The current subpolynomial expression + * @param {Node | Null} noPai The current parent node + * @param {object} obj Object with many internal flags + * + * @return {} No return. If error, throws an exception + */ + function recurPol(node, noPai, o) { + const tp = node.type; + if (tp === 'FunctionNode') { + // ***** FunctionName ***** + // No function call in polynomial expression + throw new Error('There is an unsolved function call'); + } else if (tp === 'OperatorNode') { + // ***** OperatorName ***** + if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid'); + if (noPai !== null) { + // -(unary),^ : children of *,+,- + if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') { + throw new Error('Invalid ' + node.op + ' placing'); + } + + // -,+,* : children of +,- + if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') { + throw new Error('Invalid ' + node.op + ' placing'); + } + + // -,+ : first child + if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) { + throw new Error('Invalid ' + node.op + ' placing'); + } + } // Has parent + + // Firers: ^,* Old: ^,&,-(unary): firers + if (node.op === '^' || node.op === '*') { + o.fire = node.op; + } + for (let i = 0; i < node.args.length; i++) { + // +,-: reset fire + if (node.fn === 'unaryMinus') o.oper = '-'; + if (node.op === '+' || node.fn === 'subtract') { + o.fire = ''; + o.cte = 1; // default if there is no constant + o.oper = i === 0 ? '+' : node.op; + } + o.noFil = i; // number of son + recurPol(node.args[i], node, o); + } // for in children + } else if (tp === 'SymbolNode') { + // ***** SymbolName ***** + if (node.name !== varname && varname !== '') { + throw new Error('There is more than one variable'); + } + varname = node.name; + if (noPai === null) { + coefficients[1] = 1; + return; + } + + // ^: Symbol is First child + if (noPai.op === '^' && o.noFil !== 0) { + throw new Error('In power the variable should be the first parameter'); + } + + // *: Symbol is Second child + if (noPai.op === '*' && o.noFil !== 1) { + throw new Error('In multiply the variable should be the second parameter'); + } + + // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var) + if (o.fire === '' || o.fire === '*') { + if (maxExpo < 1) coefficients[1] = 0; + coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1); + maxExpo = Math.max(1, maxExpo); + } + } else if (tp === 'ConstantNode') { + const valor = parseFloat(node.value); + if (noPai === null) { + coefficients[0] = valor; + return; + } + if (noPai.op === '^') { + // cte: second child of power + if (o.noFil !== 1) throw new Error('Constant cannot be powered'); + if (!(0, _number.isInteger)(valor) || valor <= 0) { + throw new Error('Non-integer exponent is not allowed'); + } + for (let i = maxExpo + 1; i < valor; i++) coefficients[i] = 0; + if (valor > maxExpo) coefficients[valor] = 0; + coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1); + maxExpo = Math.max(valor, maxExpo); + return; + } + o.cte = valor; + + // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0. + if (o.fire === '') { + coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1); + } + } else { + throw new Error('Type ' + tp + ' is not allowed'); + } + } // End of recurPol + } // End of polyToCanonical +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/resolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/resolve.js new file mode 100644 index 0000000..9fcbfac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/resolve.js @@ -0,0 +1,103 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createResolve = void 0; +var _map = require("../../utils/map.js"); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'resolve'; +const dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode']; +const createResolve = exports.createResolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + parse, + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode + } = _ref; + /** + * resolve(expr, scope) replaces variable nodes with their scoped values + * + * Syntax: + * + * math.resolve(expr, scope) + * + * Examples: + * + * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2' + * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2' + * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // "6" + * + * See also: + * + * simplify, evaluate + * + * @param {Node | Node[]} node + * The expression tree (or trees) to be simplified + * @param {Object} scope + * Scope specifying variables to be resolved + * @return {Node | Node[]} Returns `node` with variables recursively substituted. + * @throws {ReferenceError} + * If there is a cyclic dependency among the variables in `scope`, + * resolution is impossible and a ReferenceError is thrown. + */ + function _resolve(node, scope) { + let within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set(); + // note `within`: + // `within` is not documented, since it is for internal cycle + // detection only + if (!scope) { + return node; + } + if ((0, _is.isSymbolNode)(node)) { + if (within.has(node.name)) { + const variables = Array.from(within).join(', '); + throw new ReferenceError(`recursive loop of variable definitions among {${variables}}`); + } + const value = scope.get(node.name); + if ((0, _is.isNode)(value)) { + const nextWithin = new Set(within); + nextWithin.add(node.name); + return _resolve(value, scope, nextWithin); + } else if (typeof value === 'number') { + return parse(String(value)); + } else if (value !== undefined) { + return new ConstantNode(value); + } else { + return node; + } + } else if ((0, _is.isOperatorNode)(node)) { + const args = node.args.map(function (arg) { + return _resolve(arg, scope, within); + }); + return new OperatorNode(node.op, node.fn, args, node.implicit); + } else if ((0, _is.isParenthesisNode)(node)) { + return new ParenthesisNode(_resolve(node.content, scope, within)); + } else if ((0, _is.isFunctionNode)(node)) { + const args = node.args.map(function (arg) { + return _resolve(arg, scope, within); + }); + return new FunctionNode(node.name, args); + } + + // Otherwise just recursively resolve any children (might also work + // for some of the above special cases) + return node.map(child => _resolve(child, scope, within)); + } + return typed('resolve', { + Node: _resolve, + 'Node, Map | null | undefined': _resolve, + 'Node, Object': (n, scope) => _resolve(n, (0, _map.createMap)(scope)), + // For arrays and matrices, we map `self` rather than `_resolve` + // because resolve is fairly expensive anyway, and this way + // we get nice error messages if one entry in the array has wrong type. + 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))), + 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))), + 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, (0, _map.createMap)(scope))), + 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, (0, _map.createMap)(scope))), + 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope))) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify.js new file mode 100644 index 0000000..b92efb6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify.js @@ -0,0 +1,1262 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSimplify = void 0; +var _is = require("../../utils/is.js"); +var _wildcards = require("./simplify/wildcards.js"); +var _factory = require("../../utils/factory.js"); +var _util = require("./simplify/util.js"); +var _object = require("../../utils/object.js"); +var _map = require("../../utils/map.js"); +const name = 'simplify'; +const dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +const createSimplify = exports.createSimplify = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + typed, + parse, + add, + subtract, + multiply, + divide, + pow, + isZero, + equal, + resolve, + simplifyConstant, + simplifyCore, + fraction, + bignumber, + mathWithTransform, + matrix, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + const { + hasProperty, + isCommutative, + isAssociative, + mergeContext, + flatten, + unflattenr, + unflattenl, + createMakeNodeFunction, + defaultContext, + realContext, + positiveContext + } = (0, _util.createUtil)({ + FunctionNode, + OperatorNode, + SymbolNode + }); + + /** + * Simplify an expression tree. + * + * A list of rules are applied to an expression, repeating over the list until + * no further changes are made. + * It's possible to pass a custom set of rules to the function as second + * argument. A rule can be specified as an object, string, or function: + * + * const rules = [ + * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' }, + * 'n1*n3 + n2*n3 -> (n1+n2)*n3', + * function (node) { + * // ... return a new node or return the node unchanged + * return node + * } + * ] + * + * String and object rules consist of a left and right pattern. The left is + * used to match against the expression and the right determines what matches + * are replaced with. The main difference between a pattern and a normal + * expression is that variables starting with the following characters are + * interpreted as wildcards: + * + * - 'n' - Matches any node [Node] + * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode] + * - 'cl' - Matches a constant literal; same as c [ConstantNode] + * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode] + * - 'ce' - Matches a constant expression (-5 or √3) [Expressions consisting of only ConstantNodes, functions, and operators] + * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode] + * - 'vl' - Matches a variable literal (x or y) [SymbolNode] + * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or √3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode] + * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term] + * + * The default list of rules is exposed on the function as `simplify.rules` + * and can be used as a basis to built a set of custom rules. Note that since + * the `simplifyCore` function is in the default list of rules, by default + * simplify will convert any function calls in the expression that have + * operator equivalents to their operator forms. + * + * To specify a rule as a string, separate the left and right pattern by '->' + * When specifying a rule as an object, the following keys are meaningful: + * - l - the left pattern + * - r - the right pattern + * - s - in lieu of l and r, the string form that is broken at -> to give them + * - repeat - whether to repeat this rule until the expression stabilizes + * - assuming - gives a context object, as in the 'context' option to + * simplify. Every property in the context object must match the current + * context in order, or else the rule will not be applied. + * - imposeContext - gives a context object, as in the 'context' option to + * simplify. Any settings specified will override the incoming context + * for all matches of this rule. + * + * For more details on the theory, see: + * + * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) + * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification) + * + * An optional `options` argument can be passed as last argument of `simplify`. + * Currently available options (defaults in parentheses): + * - `consoleDebug` (false): whether to write the expression being simplified + * and any changes to it, along with the rule responsible, to console + * - `context` (simplify.defaultContext): an object giving properties of + * each operator, which determine what simplifications are allowed. The + * currently meaningful properties are commutative, associative, + * total (whether the operation is defined for all arguments), and + * trivial (whether the operation applied to a single argument leaves + * that argument unchanged). The default context is very permissive and + * allows almost all simplifications. Only properties differing from + * the default need to be specified; the default context is used as a + * fallback. Additional contexts `simplify.realContext` and + * `simplify.positiveContext` are supplied to cause simplify to perform + * just simplifications guaranteed to preserve all values of the expression + * assuming all variables and subexpressions are real numbers or + * positive real numbers, respectively. (Note that these are in some cases + * more restrictive than the default context; for example, the default + * context will allow `x/x` to simplify to 1, whereas + * `simplify.realContext` will not, as `0/0` is not equal to 1.) + * - `exactFractions` (true): whether to try to convert all constants to + * exact rational numbers. + * - `fractionsLimit` (10000): when `exactFractions` is true, constants will + * be expressed as fractions only when both numerator and denominator + * are smaller than `fractionsLimit`. + * + * Syntax: + * + * math.simplify(expr) + * math.simplify(expr, rules) + * math.simplify(expr, rules) + * math.simplify(expr, rules, scope) + * math.simplify(expr, rules, scope, options) + * math.simplify(expr, scope) + * math.simplify(expr, scope, options) + * + * Examples: + * + * math.simplify('2 * 1 * x ^ (2 - 1)') // Node "2 * x" + * math.simplify('2 * 3 * x', {x: 4}) // Node "24" + * const f = math.parse('2 * 1 * x ^ (2 - 1)') + * math.simplify(f) // Node "2 * x" + * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node "x * 2 / 5" + * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node "0.4 * x" + * + * See also: + * + * simplifyCore, derivative, evaluate, parse, rationalize, resolve + * + * @param {Node | string} expr + * The expression to be simplified + * @param {SimplifyRule[]} [rules] + * Optional list with custom rules + * @param {Object} [scope] Optional scope with variables + * @param {SimplifyOptions} [options] Optional configuration settings + * @return {Node} Returns the simplified form of `expr` + */ + typed.addConversion({ + from: 'Object', + to: 'Map', + convert: _map.createMap + }); + const simplify = typed('simplify', { + Node: _simplify, + 'Node, Map': (expr, scope) => _simplify(expr, false, scope), + 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options), + 'Node, Array': _simplify, + 'Node, Array, Map': _simplify, + 'Node, Array, Map, Object': _simplify + }); + typed.removeConversion({ + from: 'Object', + to: 'Map', + convert: _map.createMap + }); + simplify.defaultContext = defaultContext; + simplify.realContext = realContext; + simplify.positiveContext = positiveContext; + function removeParens(node) { + return node.transform(function (node, path, parent) { + return (0, _is.isParenthesisNode)(node) ? removeParens(node.content) : node; + }); + } + + // All constants that are allowed in rules + const SUPPORTED_CONSTANTS = { + true: true, + false: true, + e: true, + i: true, + Infinity: true, + LN2: true, + LN10: true, + LOG2E: true, + LOG10E: true, + NaN: true, + phi: true, + pi: true, + SQRT1_2: true, + SQRT2: true, + tau: true + // null: false, + // undefined: false, + // version: false, + }; + + // Array of strings, used to build the ruleSet. + // Each l (left side) and r (right side) are parsed by + // the expression parser into a node tree. + // Left hand sides are matched to subtrees within the + // expression to be parsed and replaced with the right + // hand side. + // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically]) + // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format. + // It is possible to get into an infinite loop with conflicting rules + simplify.rules = [simplifyCore, + // { l: 'n+0', r: 'n' }, // simplifyCore + // { l: 'n^0', r: '1' }, // simplifyCore + // { l: '0*n', r: '0' }, // simplifyCore + // { l: 'n/n', r: '1'}, // simplifyCore + // { l: 'n^1', r: 'n' }, // simplifyCore + // { l: '+n1', r:'n1' }, // simplifyCore + // { l: 'n--n1', r:'n+n1' }, // simplifyCore + { + l: 'log(e)', + r: '1' + }, + // temporary rules + // Note initially we tend constants to the right because like-term + // collection prefers the left, and we would rather collect nonconstants + { + s: 'n-n1 -> n+-n1', + // temporarily replace 'subtract' so we can further flatten the 'add' operator + assuming: { + subtract: { + total: true + } + } + }, { + s: 'n-n -> 0', + // partial alternative when we can't always subtract + assuming: { + subtract: { + total: false + } + } + }, { + s: '-(cl*v) -> v * (-cl)', + // make non-constant terms positive + assuming: { + multiply: { + commutative: true + }, + subtract: { + total: true + } + } + }, { + s: '-(cl*v) -> (-cl) * v', + // non-commutative version, part 1 + assuming: { + multiply: { + commutative: false + }, + subtract: { + total: true + } + } + }, { + s: '-(v*cl) -> v * (-cl)', + // non-commutative version, part 2 + assuming: { + multiply: { + commutative: false + }, + subtract: { + total: true + } + } + }, { + l: '-(n1/n2)', + r: '-n1/n2' + }, { + l: '-v', + r: 'v * (-1)' + }, + // finish making non-constant terms positive + { + l: '(n1 + n2)*(-1)', + r: 'n1*(-1) + n2*(-1)', + repeat: true + }, + // expand negations to achieve as much sign cancellation as possible + { + l: 'n/n1^n2', + r: 'n*n1^-n2' + }, + // temporarily replace 'divide' so we can further flatten the 'multiply' operator + { + l: 'n/n1', + r: 'n*n1^-1' + }, { + s: '(n1*n2)^n3 -> n1^n3 * n2^n3', + assuming: { + multiply: { + commutative: true + } + } + }, { + s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)', + assuming: { + multiply: { + commutative: false + } + } + }, + // expand nested exponentiation + { + s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)', + assuming: { + divide: { + total: true + } + } // 1/(1/n) = n needs 1/n to exist + }, + // collect like factors; into a sum, only do this for nonconstants + { + l: ' vd * ( vd * n1 + n2)', + r: 'vd^2 * n1 + vd * n2' + }, { + s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2', + assuming: { + divide: { + total: true + } + } // v*1/v = v^(1+-1) needs 1/v + }, { + s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2', + assuming: { + divide: { + total: true + } + } + }, { + s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2', + assuming: { + divide: { + total: true + } + } + }, { + l: 'n*n', + r: 'n^2' + }, { + s: 'n * n^n1 -> n^(n1+1)', + assuming: { + divide: { + total: true + } + } // n*1/n = n^(-1+1) needs 1/n + }, { + s: 'n^n1 * n^n2 -> n^(n1+n2)', + assuming: { + divide: { + total: true + } + } // ditto for n^2*1/n^2 + }, + // Unfortunately, to deal with more complicated cancellations, it + // becomes necessary to simplify constants twice per pass. It's not + // terribly expensive compared to matching rules, so this should not + // pose a performance problem. + simplifyConstant, + // First: before collecting like terms + + // collect like terms + { + s: 'n+n -> 2*n', + assuming: { + add: { + total: true + } + } // 2 = 1 + 1 needs to exist + }, { + l: 'n+-n', + r: '0' + }, { + l: 'vd*n + vd', + r: 'vd*(n+1)' + }, + // NOTE: leftmost position is special: + { + l: 'n3*n1 + n3*n2', + r: 'n3*(n1+n2)' + }, + // All sub-monomials tried there. + { + l: 'n3^(-n4)*n1 + n3 * n2', + r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)' + }, { + l: 'n3^(-n4)*n1 + n3^n5 * n2', + r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)' + }, + // noncommutative additional cases (term collection & factoring) + { + s: 'n*vd + vd -> (n+1)*vd', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'vd + n*vd -> (1+n)*vd', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3 + n2*n3 -> (n1+n2)*n3', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n^n1 * n -> n^(n1+1)', + assuming: { + divide: { + total: true + }, + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)', + assuming: { + multiply: { + commutative: false + } + } + }, { + l: 'n*cd + cd', + r: '(n+1)*cd' + }, { + s: 'cd*n + cd -> cd*(n+1)', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'cd + cd*n -> cd*(1+n)', + assuming: { + multiply: { + commutative: false + } + } + }, simplifyConstant, + // Second: before returning expressions to "standard form" + + // make factors positive (and undo 'make non-constant terms positive') + { + s: '(-n)*n1 -> -(n*n1)', + assuming: { + subtract: { + total: true + } + } + }, { + s: 'n1*(-n) -> -(n1*n)', + // in case * non-commutative + assuming: { + subtract: { + total: true + }, + multiply: { + commutative: false + } + } + }, + // final ordering of constants + { + s: 'ce+ve -> ve+ce', + assuming: { + add: { + commutative: true + } + }, + imposeContext: { + add: { + commutative: false + } + } + }, { + s: 'vd*cd -> cd*vd', + assuming: { + multiply: { + commutative: true + } + }, + imposeContext: { + multiply: { + commutative: false + } + } + }, + // undo temporary rules + // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant + { + l: 'n+-n1', + r: 'n-n1' + }, + // undo replace 'subtract' + { + l: 'n+-(n1)', + r: 'n-(n1)' + }, { + s: 'n*(n1^-1) -> n/n1', + // undo replace 'divide'; for * commutative + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + s: 'n*n1^-n2 -> n/n1^n2', + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + s: 'n^-1 -> 1/n', + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + l: 'n^1', + r: 'n' + }, + // can be produced by power cancellation + { + s: 'n*(n1/n2) -> (n*n1)/n2', + // '*' before '/' + assuming: { + multiply: { + associative: true + } + } + }, { + s: 'n-(n1+n2) -> n-n1-n2', + // '-' before '+' + assuming: { + addition: { + associative: true, + commutative: true + } + } + }, + // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' }, + // { l: '(n*n1)/(n*n2)', r: 'n1/n2' }, + + // simplifyConstant can leave an extra factor of 1, which can always + // be eliminated, since the identity always commutes + { + l: '1*n', + r: 'n', + imposeContext: { + multiply: { + commutative: true + } + } + }, { + s: 'n1/(n2/n3) -> (n1*n3)/n2', + assuming: { + multiply: { + associative: true + } + } + }, { + l: 'n1/(-n2)', + r: '-n1/n2' + }]; + + /** + * Takes any rule object as allowed by the specification in simplify + * and puts it in a standard form used by applyRule + */ + function _canonicalizeRule(ruleObject, context) { + const newRule = {}; + if (ruleObject.s) { + const lr = ruleObject.s.split('->'); + if (lr.length === 2) { + newRule.l = lr[0]; + newRule.r = lr[1]; + } else { + throw SyntaxError('Could not parse rule: ' + ruleObject.s); + } + } else { + newRule.l = ruleObject.l; + newRule.r = ruleObject.r; + } + newRule.l = removeParens(parse(newRule.l)); + newRule.r = removeParens(parse(newRule.r)); + for (const prop of ['imposeContext', 'repeat', 'assuming']) { + if (prop in ruleObject) { + newRule[prop] = ruleObject[prop]; + } + } + if (ruleObject.evaluate) { + newRule.evaluate = parse(ruleObject.evaluate); + } + if (isAssociative(newRule.l, context)) { + const nonCommutative = !isCommutative(newRule.l, context); + let leftExpandsym; + // Gen. the LHS placeholder used in this NC-context specific expansion rules + if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol(); + const makeNode = createMakeNodeFunction(newRule.l); + const expandsym = _getExpandPlaceholderSymbol(); + newRule.expanded = {}; + newRule.expanded.l = makeNode([newRule.l, expandsym]); + // Push the expandsym into the deepest possible branch. + // This helps to match the newRule against nodes returned from getSplits() later on. + flatten(newRule.expanded.l, context); + unflattenr(newRule.expanded.l, context); + newRule.expanded.r = makeNode([newRule.r, expandsym]); + + // In and for a non-commutative context, attempting with yet additional expansion rules makes + // way for more matches cases of multi-arg expressions; such that associative rules (such as + // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'. + if (nonCommutative) { + // 'Non-commutative' 1: LHS (placeholder) only + newRule.expandedNC1 = {}; + newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]); + newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]); + // 'Non-commutative' 2: farmost LHS and RHS placeholders + newRule.expandedNC2 = {}; + newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]); + newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]); + } + } + return newRule; + } + + /** + * Parse the string array of rules into nodes + * + * Example syntax for rules: + * + * Position constants to the left in a product: + * { l: 'n1 * c1', r: 'c1 * n1' } + * n1 is any Node, and c1 is a ConstantNode. + * + * Apply difference of squares formula: + * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' } + * n1, n2 mean any Node. + * + * Short hand notation: + * 'n1 * c1 -> c1 * n1' + */ + function _buildRules(rules, context) { + // Array of rules to be used to simplify expressions + const ruleSet = []; + for (let i = 0; i < rules.length; i++) { + let rule = rules[i]; + let newRule; + const ruleType = typeof rule; + switch (ruleType) { + case 'string': + rule = { + s: rule + }; + /* falls through */ + case 'object': + newRule = _canonicalizeRule(rule, context); + break; + case 'function': + newRule = rule; + break; + default: + throw TypeError('Unsupported type of rule: ' + ruleType); + } + // console.log('Adding rule: ' + rules[i]) + // console.log(newRule) + ruleSet.push(newRule); + } + return ruleSet; + } + let _lastsym = 0; + function _getExpandPlaceholderSymbol() { + return new SymbolNode('_p' + _lastsym++); + } + function _simplify(expr, rules) { + let scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (0, _map.createEmptyMap)(); + let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + const debug = options.consoleDebug; + rules = _buildRules(rules || simplify.rules, options.context); + let res = resolve(expr, scope); + res = removeParens(res); + const visited = {}; + let str = res.toString({ + parenthesis: 'all' + }); + while (!visited[str]) { + visited[str] = true; + _lastsym = 0; // counter for placeholder symbols + let laststr = str; + if (debug) console.log('Working on: ', str); + for (let i = 0; i < rules.length; i++) { + let rulestr = ''; + if (typeof rules[i] === 'function') { + res = rules[i](res, options); + if (debug) rulestr = rules[i].name; + } else { + flatten(res, options.context); + res = applyRule(res, rules[i], options.context); + if (debug) { + rulestr = `${rules[i].l.toString()} -> ${rules[i].r.toString()}`; + } + } + if (debug) { + const newstr = res.toString({ + parenthesis: 'all' + }); + if (newstr !== laststr) { + console.log('Applying', rulestr, 'produced', newstr); + laststr = newstr; + } + } + /* Use left-heavy binary tree internally, + * since custom rule functions may expect it + */ + unflattenl(res, options.context); + } + str = res.toString({ + parenthesis: 'all' + }); + } + return res; + } + function mapRule(nodes, rule, context) { + let resNodes = nodes; + if (nodes) { + for (let i = 0; i < nodes.length; ++i) { + const newNode = applyRule(nodes[i], rule, context); + if (newNode !== nodes[i]) { + if (resNodes === nodes) { + resNodes = nodes.slice(); + } + resNodes[i] = newNode; + } + } + } + return resNodes; + } + + /** + * Returns a simplfied form of node, or the original node if no simplification was possible. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object | Function} rule + * @param {Object} context -- information about assumed properties of operators + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible. + */ + function applyRule(node, rule, context) { + // console.log('Entering applyRule("', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '",', node.toString({parenthesis:'all'}),')') + + // check that the assumptions for this rule are satisfied by the current + // context: + if (rule.assuming) { + for (const symbol in rule.assuming) { + for (const property in rule.assuming[symbol]) { + if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) { + return node; + } + } + } + } + const mergedContext = mergeContext(rule.imposeContext, context); + + // Do not clone node unless we find a match + let res = node; + + // First replace our child nodes with their simplified versions + // If a child could not be simplified, applying the rule to it + // will have no effect since the node is returned unchanged + if (res instanceof OperatorNode || res instanceof FunctionNode) { + const newArgs = mapRule(res.args, rule, context); + if (newArgs !== res.args) { + res = res.clone(); + res.args = newArgs; + } + } else if (res instanceof ParenthesisNode) { + if (res.content) { + const newContent = applyRule(res.content, rule, context); + if (newContent !== res.content) { + res = new ParenthesisNode(newContent); + } + } + } else if (res instanceof ArrayNode) { + const newItems = mapRule(res.items, rule, context); + if (newItems !== res.items) { + res = new ArrayNode(newItems); + } + } else if (res instanceof AccessorNode) { + let newObj = res.object; + if (res.object) { + newObj = applyRule(res.object, rule, context); + } + let newIndex = res.index; + if (res.index) { + newIndex = applyRule(res.index, rule, context); + } + if (newObj !== res.object || newIndex !== res.index) { + res = new AccessorNode(newObj, newIndex); + } + } else if (res instanceof IndexNode) { + const newDims = mapRule(res.dimensions, rule, context); + if (newDims !== res.dimensions) { + res = new IndexNode(newDims); + } + } else if (res instanceof ObjectNode) { + let changed = false; + const newProps = {}; + for (const prop in res.properties) { + newProps[prop] = applyRule(res.properties[prop], rule, context); + if (newProps[prop] !== res.properties[prop]) { + changed = true; + } + } + if (changed) { + res = new ObjectNode(newProps); + } + } + + // Try to match a rule against this node + let repl = rule.r; + let matches = _ruleMatch(rule.l, res, mergedContext)[0]; + + // If the rule is associative operator, we can try matching it while allowing additional terms. + // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative. + if (!matches && rule.expanded) { + repl = rule.expanded.r; + matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0]; + } + // Additional, non-commutative context expansion-rules + if (!matches && rule.expandedNC1) { + repl = rule.expandedNC1.r; + matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0]; + if (!matches) { + // Existence of NC1 implies NC2 + repl = rule.expandedNC2.r; + matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0]; + } + } + if (matches) { + // const before = res.toString({parenthesis: 'all'}) + + // Create a new node by cloning the rhs of the matched rule + // we keep any implicit multiplication state if relevant + const implicit = res.implicit; + res = repl.clone(); + if (implicit && 'implicit' in repl) { + res.implicit = true; + } + + // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes + res = res.transform(function (node) { + if (node.isSymbolNode && (0, _object.hasOwnProperty)(matches.placeholders, node.name)) { + return matches.placeholders[node.name].clone(); + } else { + return node; + } + }); + + // const after = res.toString({parenthesis: 'all'}) + // console.log('Simplified ' + before + ' to ' + after) + } + if (rule.repeat && res !== node) { + res = applyRule(res, rule, context); + } + return res; + } + + /** + * Get (binary) combinations of a flattened binary node + * e.g. +(node1, node2, node3) -> [ + * +(node1, +(node2, node3)), + * +(node2, +(node1, node3)), + * +(node3, +(node1, node2))] + * + */ + function getSplits(node, context) { + const res = []; + let right, rightArgs; + const makeNode = createMakeNodeFunction(node); + if (isCommutative(node, context)) { + for (let i = 0; i < node.args.length; i++) { + rightArgs = node.args.slice(0); + rightArgs.splice(i, 1); + right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs); + res.push(makeNode([node.args[i], right])); + } + } else { + // Keep order, but try all parenthesizations + for (let i = 1; i < node.args.length; i++) { + let left = node.args[0]; + if (i > 1) { + left = makeNode(node.args.slice(0, i)); + } + rightArgs = node.args.slice(i); + right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs); + res.push(makeNode([left, right])); + } + } + return res; + } + + /** + * Returns the set union of two match-placeholders or null if there is a conflict. + */ + function mergeMatch(match1, match2) { + const res = { + placeholders: {} + }; + + // Some matches may not have placeholders; this is OK + if (!match1.placeholders && !match2.placeholders) { + return res; + } else if (!match1.placeholders) { + return match2; + } else if (!match2.placeholders) { + return match1; + } + + // Placeholders with the same key must match exactly + for (const key in match1.placeholders) { + if ((0, _object.hasOwnProperty)(match1.placeholders, key)) { + res.placeholders[key] = match1.placeholders[key]; + if ((0, _object.hasOwnProperty)(match2.placeholders, key)) { + if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) { + return null; + } + } + } + } + for (const key in match2.placeholders) { + if ((0, _object.hasOwnProperty)(match2.placeholders, key)) { + res.placeholders[key] = match2.placeholders[key]; + } + } + return res; + } + + /** + * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches. + * Each list represents matches found in one child of a node. + */ + function combineChildMatches(list1, list2) { + const res = []; + if (list1.length === 0 || list2.length === 0) { + return res; + } + let merged; + for (let i1 = 0; i1 < list1.length; i1++) { + for (let i2 = 0; i2 < list2.length; i2++) { + merged = mergeMatch(list1[i1], list2[i2]); + if (merged) { + res.push(merged); + } + } + } + return res; + } + + /** + * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches. + * Each list represents matches found in one child of a node. + * Returns a list of unique matches. + */ + function mergeChildMatches(childMatches) { + if (childMatches.length === 0) { + return childMatches; + } + const sets = childMatches.reduce(combineChildMatches); + const uniqueSets = []; + const unique = {}; + for (let i = 0; i < sets.length; i++) { + const s = JSON.stringify(sets[i]); + if (!unique[s]) { + unique[s] = true; + uniqueSets.push(sets[i]); + } + } + return uniqueSets; + } + + /** + * Determines whether node matches rule. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object} context -- provides assumed properties of operators + * @param {Boolean} isSplit -- whether we are in process of splitting an + * n-ary operator node into possible binary combinations. + * Defaults to false. + * @return {Object} Information about the match, if it exists. + */ + function _ruleMatch(rule, node, context, isSplit) { + // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')') + // console.log('rule = ' + rule) + // console.log('node = ' + node) + + // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')') + let res = [{ + placeholders: {} + }]; + if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) { + // If the rule is an OperatorNode or a FunctionNode, then node must match exactly + if (rule instanceof OperatorNode) { + if (rule.op !== node.op || rule.fn !== node.fn) { + return []; + } + } else if (rule instanceof FunctionNode) { + if (rule.name !== node.name) { + return []; + } + } + + // rule and node match. Search the children of rule and node. + if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) { + // Expect non-associative operators to match exactly, + // except in any order if operator is commutative + let childMatches = []; + for (let i = 0; i < rule.args.length; i++) { + const childMatch = _ruleMatch(rule.args[i], node.args[i], context); + if (childMatch.length === 0) { + // Child did not match, so stop searching immediately + break; + } + // The child matched, so add the information returned from the child to our result + childMatches.push(childMatch); + } + if (childMatches.length !== rule.args.length) { + if (!isCommutative(node, context) || + // exact match in order needed + rule.args.length === 1) { + // nothing to commute + return []; + } + if (rule.args.length > 2) { + /* Need to generate all permutations and try them. + * It's a bit complicated, and unlikely to come up since there + * are very few ternary or higher operators. So punt for now. + */ + throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented'); + } + /* Exactly two arguments, try them reversed */ + const leftMatch = _ruleMatch(rule.args[0], node.args[1], context); + if (leftMatch.length === 0) { + return []; + } + const rightMatch = _ruleMatch(rule.args[1], node.args[0], context); + if (rightMatch.length === 0) { + return []; + } + childMatches = [leftMatch, rightMatch]; + } + res = mergeChildMatches(childMatches); + } else if (node.args.length >= 2 && rule.args.length === 2) { + // node is flattened, rule is not + // Associative operators/functions can be split in different ways so we check if the rule + // matches for each of them and return their union. + const splits = getSplits(node, context); + let splitMatches = []; + for (let i = 0; i < splits.length; i++) { + const matchSet = _ruleMatch(rule, splits[i], context, true); // recursing at the same tree depth here + splitMatches = splitMatches.concat(matchSet); + } + return splitMatches; + } else if (rule.args.length > 2) { + throw Error('Unexpected non-binary associative function: ' + rule.toString()); + } else { + // Incorrect number of arguments in rule and node, so no match + return []; + } + } else if (rule instanceof SymbolNode) { + // If the rule is a SymbolNode, then it carries a special meaning + // according to the first one or two characters of the symbol node name. + // These meanings are expalined in the documentation for simplify() + if (rule.name.length === 0) { + throw new Error('Symbol in rule has 0 length...!?'); + } + if (SUPPORTED_CONSTANTS[rule.name]) { + // built-in constant must match exactly + if (rule.name !== node.name) { + return []; + } + } else { + // wildcards are composed of up to two alphabetic or underscore characters + switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) { + case 'n': + case '_p': + // rule matches _anything_, so assign this node to the rule.name placeholder + // Assign node to the rule.name placeholder. + // Our parent will check for matches among placeholders. + res[0].placeholders[rule.name] = node; + break; + case 'c': + case 'cl': + // rule matches a ConstantNode + if ((0, _wildcards.isConstantNode)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'v': + // rule matches anything other than a ConstantNode + if (!(0, _wildcards.isConstantNode)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'vl': + // rule matches VariableNode + if ((0, _wildcards.isVariableNode)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'cd': + // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode + if ((0, _wildcards.isNumericNode)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'vd': + // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode + if (!(0, _wildcards.isNumericNode)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'ce': + // rule matches expressions that have a constant value + if ((0, _wildcards.isConstantExpression)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 've': + // rule matches expressions that do not have a constant value + if (!(0, _wildcards.isConstantExpression)(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + default: + throw new Error('Invalid symbol in rule: ' + rule.name); + } + } + } else if (rule instanceof ConstantNode) { + // Literal constant must match exactly + if (!equal(rule.value, node.value)) { + return []; + } + } else { + // Some other node was encountered which we aren't prepared for, so no match + return []; + } + + // It's a match! + + // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match') + return res; + } + + /** + * Determines whether p and q (and all their children nodes) are identical. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q + * @return {Object} Information about the match, if it exists. + */ + function _exactMatch(p, q) { + if (p instanceof ConstantNode && q instanceof ConstantNode) { + if (!equal(p.value, q.value)) { + return false; + } + } else if (p instanceof SymbolNode && q instanceof SymbolNode) { + if (p.name !== q.name) { + return false; + } + } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) { + if (p instanceof OperatorNode) { + if (p.op !== q.op || p.fn !== q.fn) { + return false; + } + } else if (p instanceof FunctionNode) { + if (p.name !== q.name) { + return false; + } + } + if (p.args.length !== q.args.length) { + return false; + } + for (let i = 0; i < p.args.length; i++) { + if (!_exactMatch(p.args[i], q.args[i])) { + return false; + } + } + } else { + return false; + } + return true; + } + return simplify; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js new file mode 100644 index 0000000..9c445f4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js @@ -0,0 +1,269 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUtil = void 0; +var _is = require("../../../utils/is.js"); +var _factory = require("../../../utils/factory.js"); +var _object = require("../../../utils/object.js"); +const name = 'simplifyUtil'; +const dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode']; +const createUtil = exports.createUtil = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + FunctionNode, + OperatorNode, + SymbolNode + } = _ref; + // TODO commutative/associative properties rely on the arguments + // e.g. multiply is not commutative for matrices + // The properties should be calculated from an argument to simplify, or possibly something in math.config + // the other option is for typed() to specify a return type so that we can evaluate the type of arguments + + /* So that properties of an operator fit on one line: */ + const T = true; + const F = false; + const defaultName = 'defaultF'; + const defaultContext = { + /* */add: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /**/unaryPlus: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /* */subtract: { + trivial: F, + total: T, + commutative: F, + associative: F + }, + /* */multiply: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /* */divide: { + trivial: F, + total: T, + commutative: F, + associative: F + }, + /* */paren: { + trivial: T, + total: T, + commutative: T, + associative: F + }, + /* */defaultF: { + trivial: F, + total: T, + commutative: F, + associative: F + } + }; + const realContext = { + divide: { + total: F + }, + log: { + total: F + } + }; + const positiveContext = { + subtract: { + total: F + }, + abs: { + trivial: T + }, + log: { + total: T + } + }; + function hasProperty(nodeOrName, property) { + let context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext; + let name = defaultName; + if (typeof nodeOrName === 'string') { + name = nodeOrName; + } else if ((0, _is.isOperatorNode)(nodeOrName)) { + name = nodeOrName.fn.toString(); + } else if ((0, _is.isFunctionNode)(nodeOrName)) { + name = nodeOrName.name; + } else if ((0, _is.isParenthesisNode)(nodeOrName)) { + name = 'paren'; + } + if ((0, _object.hasOwnProperty)(context, name)) { + const properties = context[name]; + if ((0, _object.hasOwnProperty)(properties, property)) { + return properties[property]; + } + if ((0, _object.hasOwnProperty)(defaultContext, name)) { + return defaultContext[name][property]; + } + } + if ((0, _object.hasOwnProperty)(context, defaultName)) { + const properties = context[defaultName]; + if ((0, _object.hasOwnProperty)(properties, property)) { + return properties[property]; + } + return defaultContext[defaultName][property]; + } + /* name not found in context and context has no global default */ + /* So use default context. */ + if ((0, _object.hasOwnProperty)(defaultContext, name)) { + const properties = defaultContext[name]; + if ((0, _object.hasOwnProperty)(properties, property)) { + return properties[property]; + } + } + return defaultContext[defaultName][property]; + } + function isCommutative(node) { + let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext; + return hasProperty(node, 'commutative', context); + } + function isAssociative(node) { + let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext; + return hasProperty(node, 'associative', context); + } + + /** + * Merge the given contexts, with primary overriding secondary + * wherever they might conflict + */ + function mergeContext(primary, secondary) { + const merged = { + ...primary + }; + for (const prop in secondary) { + if ((0, _object.hasOwnProperty)(primary, prop)) { + merged[prop] = { + ...secondary[prop], + ...primary[prop] + }; + } else { + merged[prop] = secondary[prop]; + } + } + return merged; + } + + /** + * Flatten all associative operators in an expression tree. + * Assumes parentheses have already been removed. + */ + function flatten(node, context) { + if (!node.args || node.args.length === 0) { + return node; + } + node.args = allChildren(node, context); + for (let i = 0; i < node.args.length; i++) { + flatten(node.args[i], context); + } + } + + /** + * Get the children of a node as if it has been flattened. + * TODO implement for FunctionNodes + */ + function allChildren(node, context) { + let op; + const children = []; + const findChildren = function (node) { + for (let i = 0; i < node.args.length; i++) { + const child = node.args[i]; + if ((0, _is.isOperatorNode)(child) && op === child.op) { + findChildren(child); + } else { + children.push(child); + } + } + }; + if (isAssociative(node, context)) { + op = node.op; + findChildren(node); + return children; + } else { + return node.args; + } + } + + /** + * Unflatten all flattened operators to a right-heavy binary tree. + */ + function unflattenr(node, context) { + if (!node.args || node.args.length === 0) { + return; + } + const makeNode = createMakeNodeFunction(node); + const l = node.args.length; + for (let i = 0; i < l; i++) { + unflattenr(node.args[i], context); + } + if (l > 2 && isAssociative(node, context)) { + let curnode = node.args.pop(); + while (node.args.length > 0) { + curnode = makeNode([node.args.pop(), curnode]); + } + node.args = curnode.args; + } + } + + /** + * Unflatten all flattened operators to a left-heavy binary tree. + */ + function unflattenl(node, context) { + if (!node.args || node.args.length === 0) { + return; + } + const makeNode = createMakeNodeFunction(node); + const l = node.args.length; + for (let i = 0; i < l; i++) { + unflattenl(node.args[i], context); + } + if (l > 2 && isAssociative(node, context)) { + let curnode = node.args.shift(); + while (node.args.length > 0) { + curnode = makeNode([curnode, node.args.shift()]); + } + node.args = curnode.args; + } + } + function createMakeNodeFunction(node) { + if ((0, _is.isOperatorNode)(node)) { + return function (args) { + try { + return new OperatorNode(node.op, node.fn, args, node.implicit); + } catch (err) { + console.error(err); + return []; + } + }; + } else { + return function (args) { + return new FunctionNode(new SymbolNode(node.name), args); + }; + } + } + return { + createMakeNodeFunction, + hasProperty, + isCommutative, + isAssociative, + mergeContext, + flatten, + allChildren, + unflattenr, + unflattenl, + defaultContext, + realContext, + positiveContext + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js new file mode 100644 index 0000000..b18a248 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isConstantExpression = isConstantExpression; +Object.defineProperty(exports, "isConstantNode", { + enumerable: true, + get: function () { + return _is.isConstantNode; + } +}); +exports.isNumericNode = isNumericNode; +Object.defineProperty(exports, "isVariableNode", { + enumerable: true, + get: function () { + return _is.isSymbolNode; + } +}); +var _is = require("../../../utils/is.js"); +function isNumericNode(x) { + return (0, _is.isConstantNode)(x) || (0, _is.isOperatorNode)(x) && x.isUnary() && (0, _is.isConstantNode)(x.args[0]); +} +function isConstantExpression(x) { + if ((0, _is.isConstantNode)(x)) { + // Basic Constant types + return true; + } + if (((0, _is.isFunctionNode)(x) || (0, _is.isOperatorNode)(x)) && x.args.every(isConstantExpression)) { + // Can be constant depending on arguments + return true; + } + if ((0, _is.isParenthesisNode)(x) && isConstantExpression(x.content)) { + // Parenthesis are transparent + return true; + } + return false; // Probably missing some edge cases +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js new file mode 100644 index 0000000..cf061a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js @@ -0,0 +1,478 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSimplifyConstant = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _util = require("./simplify/util.js"); +var _noop = require("../../utils/noop.js"); +const name = 'simplifyConstant'; +const dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode']; +const createSimplifyConstant = exports.createSimplifyConstant = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + mathWithTransform, + matrix, + fraction, + bignumber, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode + } = _ref; + const { + isCommutative, + isAssociative, + allChildren, + createMakeNodeFunction + } = (0, _util.createUtil)({ + FunctionNode, + OperatorNode, + SymbolNode + }); + + /** + * simplifyConstant() takes a mathjs expression (either a Node representing + * a parse tree or a string which it parses to produce a node), and replaces + * any subexpression of it consisting entirely of constants with the computed + * value of that subexpression. + * + * Syntax: + * + * math.simplifyConstant(expr) + * math.simplifyConstant(expr, options) + * + * Examples: + * + * math.simplifyConstant('x + 4*3/6') // Node "x + 2" + * math.simplifyConstant('z cos(0)') // Node "z 1" + * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node "6.28 t" + * + * See also: + * + * simplify, simplifyCore, resolve, derivative + * + * @param {Node | string} node + * The expression to be simplified + * @param {Object} options + * Simplification options, as per simplify() + * @return {Node} Returns expression with constant subexpressions evaluated + */ + const simplifyConstant = typed('simplifyConstant', { + Node: node => _ensureNode(foldFraction(node, {})), + 'Node, Object': function (expr, options) { + return _ensureNode(foldFraction(expr, options)); + } + }); + function _removeFractions(thing) { + if ((0, _is.isFraction)(thing)) { + return thing.valueOf(); + } + if (thing instanceof Array) { + return thing.map(_removeFractions); + } + if ((0, _is.isMatrix)(thing)) { + return matrix(_removeFractions(thing.valueOf())); + } + return thing; + } + function _eval(fnname, args, options) { + try { + return mathWithTransform[fnname].apply(null, args); + } catch (ignore) { + // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions + args = args.map(_removeFractions); + return _toNumber(mathWithTransform[fnname].apply(null, args), options); + } + } + const _toNode = typed({ + Fraction: _fractionToNode, + number: function (n) { + if (n < 0) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); + }, + BigNumber: function (n) { + if (n < 0) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); // old parameters: (n.toString(), 'number') + }, + bigint: function (n) { + if (n < 0n) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); + }, + Complex: function (s) { + throw new Error('Cannot convert Complex number to Node'); + }, + string: function (s) { + return new ConstantNode(s); + }, + Matrix: function (m) { + return new ArrayNode(m.valueOf().map(e => _toNode(e))); + } + }); + function _ensureNode(thing) { + if ((0, _is.isNode)(thing)) { + return thing; + } + return _toNode(thing); + } + + // convert a number to a fraction only if it can be expressed exactly, + // and when both numerator and denominator are small enough + function _exactFraction(n, options) { + const exactFractions = options && options.exactFractions !== false; + if (exactFractions && isFinite(n) && fraction) { + const f = fraction(n); + const fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default + + if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) { + return f; + } + } + return n; + } + + // Convert numbers to a preferred number type in preference order: Fraction, number, Complex + // BigNumbers are left alone + const _toNumber = typed({ + 'string, Object': function (s, options) { + const numericType = (0, _number.safeNumberType)(s, config); + if (numericType === 'BigNumber') { + if (bignumber === undefined) { + (0, _noop.noBignumber)(); + } + return bignumber(s); + } else if (numericType === 'bigint') { + return BigInt(s); + } else if (numericType === 'Fraction') { + if (fraction === undefined) { + (0, _noop.noFraction)(); + } + return fraction(s); + } else { + const n = parseFloat(s); + return _exactFraction(n, options); + } + }, + 'Fraction, Object': function (s, options) { + return s; + }, + // we don't need options here + + 'BigNumber, Object': function (s, options) { + return s; + }, + // we don't need options here + + 'number, Object': function (s, options) { + return _exactFraction(s, options); + }, + 'bigint, Object': function (s, options) { + return s; + }, + 'Complex, Object': function (s, options) { + if (s.im !== 0) { + return s; + } + return _exactFraction(s.re, options); + }, + 'Matrix, Object': function (s, options) { + return matrix(_exactFraction(s.valueOf())); + }, + 'Array, Object': function (s, options) { + return s.map(_exactFraction); + } + }); + function unaryMinusNode(n) { + return new OperatorNode('-', 'unaryMinus', [n]); + } + function _fractionToNode(f) { + let n; + const vn = f.s * f.n; + if (vn < 0) { + n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]); + } else { + n = new ConstantNode(vn); + } + if (f.d === 1) { + return n; + } + return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]); + } + + /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */ + function _foldAccessor(obj, index, options) { + if (!(0, _is.isIndexNode)(index)) { + // don't know what to do with that... + return new AccessorNode(_ensureNode(obj), _ensureNode(index)); + } + if ((0, _is.isArrayNode)(obj) || (0, _is.isMatrix)(obj)) { + const remainingDims = Array.from(index.dimensions); + /* We will resolve constant indices one at a time, looking + * just in the first or second dimensions because (a) arrays + * of more than two dimensions are likely rare, and (b) pulling + * out the third or higher dimension would be pretty intricate. + * The price is that we miss simplifying [..3d array][x,y,1] + */ + while (remainingDims.length > 0) { + if ((0, _is.isConstantNode)(remainingDims[0]) && typeof remainingDims[0].value !== 'string') { + const first = _toNumber(remainingDims.shift().value, options); + if ((0, _is.isArrayNode)(obj)) { + obj = obj.items[first - 1]; + } else { + // matrix + obj = obj.valueOf()[first - 1]; + if (obj instanceof Array) { + obj = matrix(obj); + } + } + } else if (remainingDims.length > 1 && (0, _is.isConstantNode)(remainingDims[1]) && typeof remainingDims[1].value !== 'string') { + const second = _toNumber(remainingDims[1].value, options); + const tryItems = []; + const fromItems = (0, _is.isArrayNode)(obj) ? obj.items : obj.valueOf(); + for (const item of fromItems) { + if ((0, _is.isArrayNode)(item)) { + tryItems.push(item.items[second - 1]); + } else if ((0, _is.isMatrix)(obj)) { + tryItems.push(item[second - 1]); + } else { + break; + } + } + if (tryItems.length === fromItems.length) { + if ((0, _is.isArrayNode)(obj)) { + obj = new ArrayNode(tryItems); + } else { + // matrix + obj = matrix(tryItems); + } + remainingDims.splice(1, 1); + } else { + // extracting slice along 2nd dimension failed, give up + break; + } + } else { + // neither 1st or 2nd dimension is constant, give up + break; + } + } + if (remainingDims.length === index.dimensions.length) { + /* No successful constant indexing */ + return new AccessorNode(_ensureNode(obj), index); + } + if (remainingDims.length > 0) { + /* Indexed some but not all dimensions */ + index = new IndexNode(remainingDims); + return new AccessorNode(_ensureNode(obj), index); + } + /* All dimensions were constant, access completely resolved */ + return obj; + } + if ((0, _is.isObjectNode)(obj) && index.dimensions.length === 1 && (0, _is.isConstantNode)(index.dimensions[0])) { + const key = index.dimensions[0].value; + if (key in obj.properties) { + return obj.properties[key]; + } + return new ConstantNode(); // undefined + } + /* Don't know how to index this sort of obj, at least not with this index */ + return new AccessorNode(_ensureNode(obj), index); + } + + /* + * Create a binary tree from a list of Fractions and Nodes. + * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so + * `args` should be sorted to have the Fractions at the start (if the operator is commutative). + * @param args - list of Fractions and Nodes + * @param fn - evaluator for the binary operation evaluator that accepts two Fractions + * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes + * if args.length is 1, returns args[0] + * @return - Either a Node representing a binary expression or Fraction + */ + function foldOp(fn, args, makeNode, options) { + const first = args.shift(); + + // In the following reduction, sofar always has one of the three following + // forms: [NODE], [CONSTANT], or [NODE, CONSTANT] + const reduction = args.reduce((sofar, next) => { + if (!(0, _is.isNode)(next)) { + const last = sofar.pop(); + if ((0, _is.isNode)(last)) { + return [last, next]; + } + // Two constants in a row, try to fold them into one + try { + sofar.push(_eval(fn, [last, next], options)); + return sofar; + } catch (ignoreandcontinue) { + sofar.push(last); + // fall through to Node case + } + } + + // Encountered a Node, or failed folding -- + // collapse everything so far into a single tree: + sofar.push(_ensureNode(sofar.pop())); + const newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar); + return [makeNode([newtree, _ensureNode(next)])]; + }, [first]); + if (reduction.length === 1) { + return reduction[0]; + } + // Might end up with a tree and a constant at the end: + return makeNode([reduction[0], _toNode(reduction[1])]); + } + + // destroys the original node and returns a folded one + function foldFraction(node, options) { + switch (node.type) { + case 'SymbolNode': + return node; + case 'ConstantNode': + switch (typeof node.value) { + case 'number': + return _toNumber(node.value, options); + case 'bigint': + return _toNumber(node.value, options); + case 'string': + return node.value; + default: + if (!isNaN(node.value)) return _toNumber(node.value, options); + } + return node; + case 'FunctionNode': + if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) { + return node; + } + { + // Process operators as OperatorNode + const operatorFunctions = ['add', 'multiply']; + if (!operatorFunctions.includes(node.name)) { + const args = node.args.map(arg => foldFraction(arg, options)); + + // If all args are numbers + if (!args.some(_is.isNode)) { + try { + return _eval(node.name, args, options); + } catch (ignoreandcontinue) {} + } + + // Size of a matrix does not depend on entries + if (node.name === 'size' && args.length === 1 && (0, _is.isArrayNode)(args[0])) { + const sz = []; + let section = args[0]; + while ((0, _is.isArrayNode)(section)) { + sz.push(section.items.length); + section = section.items[0]; + } + return matrix(sz); + } + + // Convert all args to nodes and construct a symbolic function call + return new FunctionNode(node.name, args.map(_ensureNode)); + } else { + // treat as operator + } + } + /* falls through */ + case 'OperatorNode': + { + const fn = node.fn.toString(); + let args; + let res; + const makeNode = createMakeNodeFunction(node); + if ((0, _is.isOperatorNode)(node) && node.isUnary()) { + args = [foldFraction(node.args[0], options)]; + if (!(0, _is.isNode)(args[0])) { + res = _eval(fn, args, options); + } else { + res = makeNode(args); + } + } else if (isAssociative(node, options.context)) { + args = allChildren(node, options.context); + args = args.map(arg => foldFraction(arg, options)); + if (isCommutative(fn, options.context)) { + // commutative binary operator + const consts = []; + const vars = []; + for (let i = 0; i < args.length; i++) { + if (!(0, _is.isNode)(args[i])) { + consts.push(args[i]); + } else { + vars.push(args[i]); + } + } + if (consts.length > 1) { + res = foldOp(fn, consts, makeNode, options); + vars.unshift(res); + res = foldOp(fn, vars, makeNode, options); + } else { + // we won't change the children order since it's not neccessary + res = foldOp(fn, args, makeNode, options); + } + } else { + // non-commutative binary operator + res = foldOp(fn, args, makeNode, options); + } + } else { + // non-associative binary operator + args = node.args.map(arg => foldFraction(arg, options)); + res = foldOp(fn, args, makeNode, options); + } + return res; + } + case 'ParenthesisNode': + // remove the uneccessary parenthesis + return foldFraction(node.content, options); + case 'AccessorNode': + return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options); + case 'ArrayNode': + { + const foldItems = node.items.map(item => foldFraction(item, options)); + if (foldItems.some(_is.isNode)) { + return new ArrayNode(foldItems.map(_ensureNode)); + } + /* All literals -- return a Matrix so we can operate on it */ + return matrix(foldItems); + } + case 'IndexNode': + { + return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options))); + } + case 'ObjectNode': + { + const foldProps = {}; + for (const prop in node.properties) { + foldProps[prop] = simplifyConstant(node.properties[prop], options); + } + return new ObjectNode(foldProps); + } + case 'AssignmentNode': + /* falls through */ + case 'BlockNode': + /* falls through */ + case 'FunctionAssignmentNode': + /* falls through */ + case 'RangeNode': + /* falls through */ + case 'ConditionalNode': + /* falls through */ + default: + throw new Error(`Unimplemented node type in simplifyConstant: ${node.type}`); + } + } + return simplifyConstant; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js new file mode 100644 index 0000000..0e21b5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js @@ -0,0 +1,297 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSimplifyCore = void 0; +var _is = require("../../utils/is.js"); +var _operators = require("../../expression/operators.js"); +var _util = require("./simplify/util.js"); +var _factory = require("../../utils/factory.js"); +const name = 'simplifyCore'; +const dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +const createSimplifyCore = exports.createSimplifyCore = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + parse, + equal, + isZero, + add, + subtract, + multiply, + divide, + pow, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + const node0 = new ConstantNode(0); + const node1 = new ConstantNode(1); + const nodeT = new ConstantNode(true); + const nodeF = new ConstantNode(false); + // test if a node will always have a boolean value (true/false) + // not sure if this list is complete + function isAlwaysBoolean(node) { + return (0, _is.isOperatorNode)(node) && ['and', 'not', 'or'].includes(node.op); + } + const { + hasProperty, + isCommutative + } = (0, _util.createUtil)({ + FunctionNode, + OperatorNode, + SymbolNode + }); + /** + * simplifyCore() performs single pass simplification suitable for + * applications requiring ultimate performance. To roughly summarize, + * it handles cases along the lines of simplifyConstant() but where + * knowledge of a single argument is sufficient to determine the value. + * In contrast, simplify() extends simplifyCore() with additional passes + * to provide deeper simplification (such as gathering like terms). + * + * Specifically, simplifyCore: + * + * * Converts all function calls with operator equivalents to their + * operator forms. + * * Removes operators or function calls that are guaranteed to have no + * effect (such as unary '+'). + * * Removes double unary '-', '~', and 'not' + * * Eliminates addition/subtraction of 0 and multiplication/division/powers + * by 1 or 0. + * * Converts addition of a negation into subtraction. + * * Eliminates logical operations with constant true or false leading + * arguments. + * * Puts constants on the left of a product, if multiplication is + * considered commutative by the options (which is the default) + * + * Syntax: + * + * math.simplifyCore(expr) + * math.simplifyCore(expr, options) + * + * Examples: + * + * const f = math.parse('2 * 1 * x ^ (1 - 0)') + * math.simplifyCore(f) // Node "2 * x" + * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node "2 * x" + * + * See also: + * + * simplify, simplifyConstant, resolve, derivative + * + * @param {Node | string} node + * The expression to be simplified + * @param {Object} options + * Simplification options, as per simplify() + * @return {Node} Returns expression with basic simplifications applied + */ + function _simplifyCore(nodeToSimplify) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const context = options ? options.context : undefined; + if (hasProperty(nodeToSimplify, 'trivial', context)) { + // This node does nothing if it has only one argument, so if so, + // return that argument simplified + if ((0, _is.isFunctionNode)(nodeToSimplify) && nodeToSimplify.args.length === 1) { + return _simplifyCore(nodeToSimplify.args[0], options); + } + // For other node types, we try the generic methods + let simpChild = false; + let childCount = 0; + nodeToSimplify.forEach(c => { + ++childCount; + if (childCount === 1) { + simpChild = _simplifyCore(c, options); + } + }); + if (childCount === 1) { + return simpChild; + } + } + let node = nodeToSimplify; + if ((0, _is.isFunctionNode)(node)) { + const op = (0, _operators.getOperator)(node.name); + if (op) { + // Replace FunctionNode with a new OperatorNode + if (node.args.length > 2 && hasProperty(node, 'associative', context)) { + // unflatten into binary operations since that's what simplifyCore handles + while (node.args.length > 2) { + const last = node.args.pop(); + const seclast = node.args.pop(); + node.args.push(new OperatorNode(op, node.name, [last, seclast])); + } + } + node = new OperatorNode(op, node.name, node.args); + } else { + return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options))); + } + } + if ((0, _is.isOperatorNode)(node) && node.isUnary()) { + const a0 = _simplifyCore(node.args[0], options); + if (node.op === '~') { + // bitwise not + if ((0, _is.isOperatorNode)(a0) && a0.isUnary() && a0.op === '~') { + return a0.args[0]; + } + } + if (node.op === 'not') { + // logical not + if ((0, _is.isOperatorNode)(a0) && a0.isUnary() && a0.op === 'not') { + // Has the effect of turning the argument into a boolean + // So can only eliminate the double negation if + // the inside is already boolean + if (isAlwaysBoolean(a0.args[0])) { + return a0.args[0]; + } + } + } + let finish = true; + if (node.op === '-') { + // unary minus + if ((0, _is.isOperatorNode)(a0)) { + if (a0.isBinary() && a0.fn === 'subtract') { + node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]); + finish = false; // continue to process the new binary node + } + if (a0.isUnary() && a0.op === '-') { + return a0.args[0]; + } + } + } + if (finish) return new OperatorNode(node.op, node.fn, [a0]); + } + if ((0, _is.isOperatorNode)(node) && node.isBinary()) { + const a0 = _simplifyCore(node.args[0], options); + let a1 = _simplifyCore(node.args[1], options); + if (node.op === '+') { + if ((0, _is.isConstantNode)(a0) && isZero(a0.value)) { + return a1; + } + if ((0, _is.isConstantNode)(a1) && isZero(a1.value)) { + return a0; + } + if ((0, _is.isOperatorNode)(a1) && a1.isUnary() && a1.op === '-') { + a1 = a1.args[0]; + node = new OperatorNode('-', 'subtract', [a0, a1]); + } + } + if (node.op === '-') { + if ((0, _is.isOperatorNode)(a1) && a1.isUnary() && a1.op === '-') { + return _simplifyCore(new OperatorNode('+', 'add', [a0, a1.args[0]]), options); + } + if ((0, _is.isConstantNode)(a0) && isZero(a0.value)) { + return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1])); + } + if ((0, _is.isConstantNode)(a1) && isZero(a1.value)) { + return a0; + } + return new OperatorNode(node.op, node.fn, [a0, a1]); + } + if (node.op === '*') { + if ((0, _is.isConstantNode)(a0)) { + if (isZero(a0.value)) { + return node0; + } else if (equal(a0.value, 1)) { + return a1; + } + } + if ((0, _is.isConstantNode)(a1)) { + if (isZero(a1.value)) { + return node0; + } else if (equal(a1.value, 1)) { + return a0; + } + if (isCommutative(node, context)) { + return new OperatorNode(node.op, node.fn, [a1, a0], node.implicit); // constants on left + } + } + return new OperatorNode(node.op, node.fn, [a0, a1], node.implicit); + } + if (node.op === '/') { + if ((0, _is.isConstantNode)(a0) && isZero(a0.value)) { + return node0; + } + if ((0, _is.isConstantNode)(a1) && equal(a1.value, 1)) { + return a0; + } + return new OperatorNode(node.op, node.fn, [a0, a1]); + } + if (node.op === '^') { + if ((0, _is.isConstantNode)(a1)) { + if (isZero(a1.value)) { + return node1; + } else if (equal(a1.value, 1)) { + return a0; + } + } + } + if (node.op === 'and') { + if ((0, _is.isConstantNode)(a0)) { + if (a0.value) { + if (isAlwaysBoolean(a1)) return a1; + if ((0, _is.isConstantNode)(a1)) { + return a1.value ? nodeT : nodeF; + } + } else { + return nodeF; + } + } + if ((0, _is.isConstantNode)(a1)) { + if (a1.value) { + if (isAlwaysBoolean(a0)) return a0; + } else { + return nodeF; + } + } + } + if (node.op === 'or') { + if ((0, _is.isConstantNode)(a0)) { + if (a0.value) { + return nodeT; + } else { + if (isAlwaysBoolean(a1)) return a1; + } + } + if ((0, _is.isConstantNode)(a1)) { + if (a1.value) { + return nodeT; + } else { + if (isAlwaysBoolean(a0)) return a0; + } + } + } + return new OperatorNode(node.op, node.fn, [a0, a1]); + } + if ((0, _is.isOperatorNode)(node)) { + return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options))); + } + if ((0, _is.isArrayNode)(node)) { + return new ArrayNode(node.items.map(n => _simplifyCore(n, options))); + } + if ((0, _is.isAccessorNode)(node)) { + return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options)); + } + if ((0, _is.isIndexNode)(node)) { + return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options))); + } + if ((0, _is.isObjectNode)(node)) { + const newProps = {}; + for (const prop in node.properties) { + newProps[prop] = _simplifyCore(node.properties[prop], options); + } + return new ObjectNode(newProps); + } + // cannot simplify + return node; + } + return typed(name, { + Node: _simplifyCore, + 'Node,Object': _simplifyCore + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js new file mode 100644 index 0000000..fb5d6bb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js @@ -0,0 +1,163 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLsolve = void 0; +var _factory = require("../../../utils/factory.js"); +var _solveValidation = require("./utils/solveValidation.js"); +const name = 'lsolve'; +const dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +const createLsolve = exports.createLsolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + const solveValidation = (0, _solveValidation.createSolveValidation)({ + DenseMatrix + }); + + /** + * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution. + * + * `L * x = b` + * + * Syntax: + * + * math.lsolve(L, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = lsolve(a, b) // [[-5.5], [20]] + * + * See also: + * + * lsolveAll, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} L A N x N matrix or array (L) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix | Array} A column vector with the linear system solution (x) + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function (m, b) { + return _sparseForwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function (m, b) { + return _denseForwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function (a, b) { + const m = matrix(a); + const r = _denseForwardSubstitution(m, b); + return r.valueOf(); + } + }); + function _denseForwardSubstitution(m, b) { + // validate matrix and vector, return copy of column vector b + b = solveValidation(m, b, true); + const bdata = b._data; + const rows = m._size[0]; + const columns = m._size[1]; + + // result + const x = []; + const mdata = m._data; + + // loop columns + for (let j = 0; j < columns; j++) { + const bj = bdata[j][0] || 0; + let xj; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + const vjj = mdata[j][j]; + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + xj = divideScalar(bj, vjj); + + // loop rows + for (let i = j + 1; i < rows; i++) { + bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]; + } + } else { + // degenerate row, we can choose any value + xj = 0; + } + x[j] = [xj]; + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } + function _sparseForwardSubstitution(m, b) { + // validate matrix and vector, return copy of column vector b + b = solveValidation(m, b, true); + const bdata = b._data; + const rows = m._size[0]; + const columns = m._size[1]; + const values = m._values; + const index = m._index; + const ptr = m._ptr; + + // result + const x = []; + + // loop columns + for (let j = 0; j < columns; j++) { + const bj = bdata[j][0] || 0; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + let vjj = 0; + // matrix values & indices (column j) + const jValues = []; + const jIndices = []; + + // first and last index in the column + const firstIndex = ptr[j]; + const lastIndex = ptr[j + 1]; + + // values in column, find value at [j, j] + for (let k = firstIndex; k < lastIndex; k++) { + const i = index[k]; + + // check row (rows are not sorted!) + if (i === j) { + vjj = values[k]; + } else if (i > j) { + // store lower triangular + jValues.push(values[k]); + jIndices.push(i); + } + } + + // at this point we must have a value in vjj + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + const xj = divideScalar(bj, vjj); + for (let k = 0, l = jIndices.length; k < l; k++) { + const i = jIndices[k]; + bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, jValues[k]))]; + } + x[j] = [xj]; + } else { + // degenerate row, we can choose any value + x[j] = [0]; + } + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js new file mode 100644 index 0000000..c2e40e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js @@ -0,0 +1,192 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLsolveAll = void 0; +var _factory = require("../../../utils/factory.js"); +var _solveValidation = require("./utils/solveValidation.js"); +const name = 'lsolveAll'; +const dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +const createLsolveAll = exports.createLsolveAll = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + const solveValidation = (0, _solveValidation.createSolveValidation)({ + DenseMatrix + }); + + /** + * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. + * + * `L * x = b` + * + * Syntax: + * + * math.lsolveAll(L, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ] + * + * See also: + * + * lsolve, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} L A N x N matrix or array (L) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function (m, b) { + return _sparseForwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function (m, b) { + return _denseForwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function (a, b) { + const m = matrix(a); + const R = _denseForwardSubstitution(m, b); + return R.map(r => r.valueOf()); + } + }); + function _denseForwardSubstitution(m, b_) { + // the algorithm is derived from + // https://www.overleaf.com/read/csvgqdxggyjv + + // array of right-hand sides + const B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + const M = m._data; + const rows = m._size[0]; + const columns = m._size[1]; + + // loop columns + for (let i = 0; i < columns; i++) { + let L = B.length; + + // loop right-hand sides + for (let k = 0; k < L; k++) { + const b = B[k]; + if (!equalScalar(M[i][i], 0)) { + // non-singular row + + b[i] = divideScalar(b[i], M[i][i]); + for (let j = i + 1; j < columns; j++) { + // b[j] -= b[i] * M[j,i] + b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + const bNew = [...b]; + bNew[i] = 1; + for (let j = i + 1; j < columns; j++) { + bNew[j] = subtractScalar(bNew[j], M[j][i]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } + function _sparseForwardSubstitution(m, b_) { + // array of right-hand sides + const B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + const rows = m._size[0]; + const columns = m._size[1]; + const values = m._values; + const index = m._index; + const ptr = m._ptr; + + // loop columns + for (let i = 0; i < columns; i++) { + let L = B.length; + + // loop right-hand sides + for (let k = 0; k < L; k++) { + const b = B[k]; + + // values & indices (column i) + const iValues = []; + const iIndices = []; + + // first & last indeces in column + const firstIndex = ptr[i]; + const lastIndex = ptr[i + 1]; + + // find the value at [i, i] + let Mii = 0; + for (let j = firstIndex; j < lastIndex; j++) { + const J = index[j]; + // check row + if (J === i) { + Mii = values[j]; + } else if (J > i) { + // store lower triangular + iValues.push(values[j]); + iIndices.push(J); + } + } + if (!equalScalar(Mii, 0)) { + // non-singular row + + b[i] = divideScalar(b[i], Mii); + for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) { + const J = iIndices[j]; + b[J] = subtractScalar(b[J], multiplyScalar(b[i], iValues[j])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + const bNew = [...b]; + bNew[i] = 1; + for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) { + const J = iIndices[j]; + bNew[J] = subtractScalar(bNew[J], iValues[j]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js new file mode 100644 index 0000000..8227019 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js @@ -0,0 +1,114 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLusolve = void 0; +var _is = require("../../../utils/is.js"); +var _factory = require("../../../utils/factory.js"); +var _solveValidation = require("./utils/solveValidation.js"); +var _csIpvec = require("../sparse/csIpvec.js"); +const name = 'lusolve'; +const dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix']; +const createLusolve = exports.createLusolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + lup, + slu, + usolve, + lsolve, + DenseMatrix + } = _ref; + const solveValidation = (0, _solveValidation.createSolveValidation)({ + DenseMatrix + }); + + /** + * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector. + * + * Syntax: + * + * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b + * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A) + * + * Examples: + * + * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]] + * + * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]] + * + * const f = math.lup(m) + * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]] + * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]] + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = math.lusolve(a, b) // [[2], [5]] + * + * See also: + * + * lup, slu, lsolve, usolve + * + * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition + * @param {Matrix | Array} b Column Vector + * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix + * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix. + * + * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b + */ + return typed(name, { + 'Array, Array | Matrix': function (a, b) { + a = matrix(a); + const d = lup(a); + const x = _lusolve(d.L, d.U, d.p, null, b); + return x.valueOf(); + }, + 'DenseMatrix, Array | Matrix': function (a, b) { + const d = lup(a); + return _lusolve(d.L, d.U, d.p, null, b); + }, + 'SparseMatrix, Array | Matrix': function (a, b) { + const d = lup(a); + return _lusolve(d.L, d.U, d.p, null, b); + }, + 'SparseMatrix, Array | Matrix, number, number': function (a, b, order, threshold) { + const d = slu(a, order, threshold); + return _lusolve(d.L, d.U, d.p, d.q, b); + }, + 'Object, Array | Matrix': function (d, b) { + return _lusolve(d.L, d.U, d.p, d.q, b); + } + }); + function _toMatrix(a) { + if ((0, _is.isMatrix)(a)) { + return a; + } + if ((0, _is.isArray)(a)) { + return matrix(a); + } + throw new TypeError('Invalid Matrix LU decomposition'); + } + function _lusolve(l, u, p, q, b) { + // verify decomposition + l = _toMatrix(l); + u = _toMatrix(u); + + // apply row permutations if needed (b is a DenseMatrix) + if (p) { + b = solveValidation(l, b, true); + b._data = (0, _csIpvec.csIpvec)(p, b._data); + } + + // use forward substitution to resolve L * y = b + const y = lsolve(l, b); + // use backward substitution to resolve U * x = y + const x = usolve(u, y); + + // apply column permutations if needed (x is a DenseMatrix) + if (q) { + x._data = (0, _csIpvec.csIpvec)(q, x._data); + } + return x; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js new file mode 100644 index 0000000..e36877d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUsolve = void 0; +var _factory = require("../../../utils/factory.js"); +var _solveValidation = require("./utils/solveValidation.js"); +const name = 'usolve'; +const dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +const createUsolve = exports.createUsolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + const solveValidation = (0, _solveValidation.createSolveValidation)({ + DenseMatrix + }); + + /** + * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution. + * + * `U * x = b` + * + * Syntax: + * + * math.usolve(U, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = usolve(a, b) // [[8], [9]] + * + * See also: + * + * usolveAll, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} U A N x N matrix or array (U) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix | Array} A column vector with the linear system solution (x) + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function (m, b) { + return _sparseBackwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function (m, b) { + return _denseBackwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function (a, b) { + const m = matrix(a); + const r = _denseBackwardSubstitution(m, b); + return r.valueOf(); + } + }); + function _denseBackwardSubstitution(m, b) { + // make b into a column vector + b = solveValidation(m, b, true); + const bdata = b._data; + const rows = m._size[0]; + const columns = m._size[1]; + + // result + const x = []; + const mdata = m._data; + // loop columns backwards + for (let j = columns - 1; j >= 0; j--) { + // b[j] + const bj = bdata[j][0] || 0; + // x[j] + let xj; + if (!equalScalar(bj, 0)) { + // value at [j, j] + const vjj = mdata[j][j]; + if (equalScalar(vjj, 0)) { + // system cannot be solved + throw new Error('Linear system cannot be solved since matrix is singular'); + } + xj = divideScalar(bj, vjj); + + // loop rows + for (let i = j - 1; i >= 0; i--) { + // update copy of b + bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]; + } + } else { + // zero value at j + xj = 0; + } + // update x + x[j] = [xj]; + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } + function _sparseBackwardSubstitution(m, b) { + // make b into a column vector + b = solveValidation(m, b, true); + const bdata = b._data; + const rows = m._size[0]; + const columns = m._size[1]; + const values = m._values; + const index = m._index; + const ptr = m._ptr; + + // result + const x = []; + + // loop columns backwards + for (let j = columns - 1; j >= 0; j--) { + const bj = bdata[j][0] || 0; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + let vjj = 0; + + // upper triangular matrix values & index (column j) + const jValues = []; + const jIndices = []; + + // first & last indeces in column + const firstIndex = ptr[j]; + const lastIndex = ptr[j + 1]; + + // values in column, find value at [j, j], loop backwards + for (let k = lastIndex - 1; k >= firstIndex; k--) { + const i = index[k]; + + // check row (rows are not sorted!) + if (i === j) { + vjj = values[k]; + } else if (i < j) { + // store upper triangular + jValues.push(values[k]); + jIndices.push(i); + } + } + + // at this point we must have a value in vjj + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + const xj = divideScalar(bj, vjj); + for (let k = 0, lastIndex = jIndices.length; k < lastIndex; k++) { + const i = jIndices[k]; + bdata[i] = [subtractScalar(bdata[i][0], multiplyScalar(xj, jValues[k]))]; + } + x[j] = [xj]; + } else { + // degenerate row, we can choose any value + x[j] = [0]; + } + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js new file mode 100644 index 0000000..5b6b5de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js @@ -0,0 +1,196 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUsolveAll = void 0; +var _factory = require("../../../utils/factory.js"); +var _solveValidation = require("./utils/solveValidation.js"); +const name = 'usolveAll'; +const dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +const createUsolveAll = exports.createUsolveAll = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + const solveValidation = (0, _solveValidation.createSolveValidation)({ + DenseMatrix + }); + + /** + * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. + * + * `U * x = b` + * + * Syntax: + * + * math.usolveAll(U, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = usolveAll(a, b) // [ [[8], [9]] ] + * + * See also: + * + * usolve, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} U A N x N matrix or array (U) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function (m, b) { + return _sparseBackwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function (m, b) { + return _denseBackwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function (a, b) { + const m = matrix(a); + const R = _denseBackwardSubstitution(m, b); + return R.map(r => r.valueOf()); + } + }); + function _denseBackwardSubstitution(m, b_) { + // the algorithm is derived from + // https://www.overleaf.com/read/csvgqdxggyjv + + // array of right-hand sides + const B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + const M = m._data; + const rows = m._size[0]; + const columns = m._size[1]; + + // loop columns backwards + for (let i = columns - 1; i >= 0; i--) { + let L = B.length; + + // loop right-hand sides + for (let k = 0; k < L; k++) { + const b = B[k]; + if (!equalScalar(M[i][i], 0)) { + // non-singular row + + b[i] = divideScalar(b[i], M[i][i]); + for (let j = i - 1; j >= 0; j--) { + // b[j] -= b[i] * M[j,i] + b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + const bNew = [...b]; + bNew[i] = 1; + for (let j = i - 1; j >= 0; j--) { + bNew[j] = subtractScalar(bNew[j], M[j][i]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } + function _sparseBackwardSubstitution(m, b_) { + // array of right-hand sides + const B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + const rows = m._size[0]; + const columns = m._size[1]; + const values = m._values; + const index = m._index; + const ptr = m._ptr; + + // loop columns backwards + for (let i = columns - 1; i >= 0; i--) { + let L = B.length; + + // loop right-hand sides + for (let k = 0; k < L; k++) { + const b = B[k]; + + // values & indices (column i) + const iValues = []; + const iIndices = []; + + // first & last indeces in column + const firstIndex = ptr[i]; + const lastIndex = ptr[i + 1]; + + // find the value at [i, i] + let Mii = 0; + for (let j = lastIndex - 1; j >= firstIndex; j--) { + const J = index[j]; + // check row + if (J === i) { + Mii = values[j]; + } else if (J < i) { + // store upper triangular + iValues.push(values[j]); + iIndices.push(J); + } + } + if (!equalScalar(Mii, 0)) { + // non-singular row + + b[i] = divideScalar(b[i], Mii); + + // loop upper triangular + for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) { + const J = iIndices[j]; + b[J] = subtractScalar(b[J], multiplyScalar(b[i], iValues[j])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + const bNew = [...b]; + bNew[i] = 1; + + // loop upper triangular + for (let j = 0, lastIndex = iIndices.length; j < lastIndex; j++) { + const J = iIndices[j]; + bNew[J] = subtractScalar(bNew[J], iValues[j]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js new file mode 100644 index 0000000..c0defc6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSolveValidation = createSolveValidation; +var _is = require("../../../../utils/is.js"); +var _array = require("../../../../utils/array.js"); +var _string = require("../../../../utils/string.js"); +function createSolveValidation(_ref) { + let { + DenseMatrix + } = _ref; + /** + * Validates matrix and column vector b for backward/forward substitution algorithms. + * + * @param {Matrix} m An N x N matrix + * @param {Array | Matrix} b A column vector + * @param {Boolean} copy Return a copy of vector b + * + * @return {DenseMatrix} Dense column vector b + */ + return function solveValidation(m, b, copy) { + const mSize = m.size(); + if (mSize.length !== 2) { + throw new RangeError('Matrix must be two dimensional (size: ' + (0, _string.format)(mSize) + ')'); + } + const rows = mSize[0]; + const columns = mSize[1]; + if (rows !== columns) { + throw new RangeError('Matrix must be square (size: ' + (0, _string.format)(mSize) + ')'); + } + let data = []; + if ((0, _is.isMatrix)(b)) { + const bSize = b.size(); + const bdata = b._data; + + // 1-dim vector + if (bSize.length === 1) { + if (bSize[0] !== rows) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (let i = 0; i < rows; i++) { + data[i] = [bdata[i]]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + + // 2-dim column + if (bSize.length === 2) { + if (bSize[0] !== rows || bSize[1] !== 1) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + if ((0, _is.isDenseMatrix)(b)) { + if (copy) { + data = []; + for (let i = 0; i < rows; i++) { + data[i] = [bdata[i][0]]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + return b; + } + if ((0, _is.isSparseMatrix)(b)) { + for (let i = 0; i < rows; i++) { + data[i] = [0]; + } + const values = b._values; + const index = b._index; + const ptr = b._ptr; + for (let k1 = ptr[1], k = ptr[0]; k < k1; k++) { + const i = index[k]; + data[i][0] = values[k]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + } + throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.'); + } + if ((0, _is.isArray)(b)) { + const bsize = (0, _array.arraySize)(b); + if (bsize.length === 1) { + if (bsize[0] !== rows) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (let i = 0; i < rows; i++) { + data[i] = [b[i]]; + } + return new DenseMatrix({ + data, + size: [rows, 1] + }); + } + if (bsize.length === 2) { + if (bsize[0] !== rows || bsize[1] !== 1) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (let i = 0; i < rows; i++) { + data[i] = [b[i][0]]; + } + return new DenseMatrix({ + data, + size: [rows, 1] + }); + } + throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.'); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js new file mode 100644 index 0000000..5569cdd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js @@ -0,0 +1,587 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsAmd = void 0; +var _factory = require("../../../utils/factory.js"); +var _csFkeep = require("./csFkeep.js"); +var _csFlip = require("./csFlip.js"); +var _csTdfs = require("./csTdfs.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csAmd'; +const dependencies = ['add', 'multiply', 'transpose']; +const createCsAmd = exports.createCsAmd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + add, + multiply, + transpose + } = _ref; + /** + * Approximate minimum degree ordering. The minimum degree algorithm is a widely used + * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization + * than A. It is a gready method that selects the sparsest pivot row and column during the course + * of a right looking sparse Cholesky factorization. + * + * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR + * @param {Matrix} m Sparse Matrix + */ + return function csAmd(order, a) { + // check input parameters + if (!a || order <= 0 || order > 3) { + return null; + } + // a matrix arrays + const asize = a._size; + // rows and columns + const m = asize[0]; + const n = asize[1]; + // initialize vars + let lemax = 0; + // dense threshold + let dense = Math.max(16, 10 * Math.sqrt(n)); + dense = Math.min(n - 2, dense); + // create target matrix C + const cm = _createTargetMatrix(order, a, m, n, dense); + // drop diagonal entries + (0, _csFkeep.csFkeep)(cm, _diag, null); + // C matrix arrays + const cindex = cm._index; + const cptr = cm._ptr; + + // number of nonzero elements in C + let cnz = cptr[n]; + + // allocate result (n+1) + const P = []; + + // create workspace (8 * (n + 1)) + const W = []; + const len = 0; // first n + 1 entries + const nv = n + 1; // next n + 1 entries + const next = 2 * (n + 1); // next n + 1 entries + const head = 3 * (n + 1); // next n + 1 entries + const elen = 4 * (n + 1); // next n + 1 entries + const degree = 5 * (n + 1); // next n + 1 entries + const w = 6 * (n + 1); // next n + 1 entries + const hhead = 7 * (n + 1); // last n + 1 entries + + // use P as workspace for last + const last = P; + + // initialize quotient graph + let mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree); + + // initialize degree lists + let nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next); + + // minimum degree node + let mindeg = 0; + + // vars + let i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d; + + // while (selecting pivots) do + while (nel < n) { + // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first + // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow + // many nodes have been eliminated. + for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++); + if (W[next + k] !== -1) { + last[W[next + k]] = -1; + } + // remove k from degree list + W[head + mindeg] = W[next + k]; + // elenk = |Ek| + const elenk = W[elen + k]; + // # of nodes k represents + let nvk = W[nv + k]; + // W[nv + k] nodes of A eliminated + nel += nvk; + + // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is + // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the + // degree lists. All elements e in Ek are absorved into element k. + let dk = 0; + // flag k as in Lk + W[nv + k] = -nvk; + let p = cptr[k]; + // do in place if W[elen + k] === 0 + const pk1 = elenk === 0 ? p : cnz; + let pk2 = pk1; + for (k1 = 1; k1 <= elenk + 1; k1++) { + if (k1 > elenk) { + // search the nodes in k + e = k; + // list of nodes starts at cindex[pj] + pj = p; + // length of list of nodes in k + ln = W[len + k] - elenk; + } else { + // search the nodes in e + e = cindex[p++]; + pj = cptr[e]; + // length of list of nodes in e + ln = W[len + e]; + } + for (k2 = 1; k2 <= ln; k2++) { + i = cindex[pj++]; + // check node i dead, or seen + if ((nvi = W[nv + i]) <= 0) { + continue; + } + // W[degree + Lk] += size of node i + dk += nvi; + // negate W[nv + i] to denote i in Lk + W[nv + i] = -nvi; + // place i in Lk + cindex[pk2++] = i; + if (W[next + i] !== -1) { + last[W[next + i]] = last[i]; + } + // check we need to remove i from degree list + if (last[i] !== -1) { + W[next + last[i]] = W[next + i]; + } else { + W[head + W[degree + i]] = W[next + i]; + } + } + if (e !== k) { + // absorb e into k + cptr[e] = (0, _csFlip.csFlip)(k); + // e is now a dead element + W[w + e] = 0; + } + } + // cindex[cnz...nzmax] is free + if (elenk !== 0) { + cnz = pk2; + } + // external degree of k - |Lk\i| + W[degree + k] = dk; + // element k is in cindex[pk1..pk2-1] + cptr[k] = pk1; + W[len + k] = pk2 - pk1; + // k is now an element + W[elen + k] = -2; + + // Find set differences. The scan1 function now computes the set differences |Le \ Lk| for all elements e. At the start of the + // scan, no entry in the w array is greater than or equal to mark. + + // clear w if necessary + mark = _wclear(mark, lemax, W, w, n); + // scan 1: find |Le\Lk| + for (pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check if W[elen + i] empty, skip it + if ((eln = W[elen + i]) <= 0) { + continue; + } + // W[nv + i] was negated + nvi = -W[nv + i]; + const wnvi = mark - nvi; + // scan Ei + for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) { + e = cindex[p]; + if (W[w + e] >= mark) { + // decrement |Le\Lk| + W[w + e] -= nvi; + } else if (W[w + e] !== 0) { + // ensure e is a live element, 1st time e seen in scan 1 + W[w + e] = W[degree + e] + wnvi; + } + } + } + + // degree update + // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash + // function h(i) for all nodes in Lk. + + // scan2: degree update + for (pk = pk1; pk < pk2; pk++) { + // consider node i in Lk + i = cindex[pk]; + p1 = cptr[i]; + p2 = p1 + W[elen + i] - 1; + pn = p1; + // scan Ei + for (h = 0, d = 0, p = p1; p <= p2; p++) { + e = cindex[p]; + // check e is an unabsorbed element + if (W[w + e] !== 0) { + // dext = |Le\Lk| + const dext = W[w + e] - mark; + if (dext > 0) { + // sum up the set differences + d += dext; + // keep e in Ei + cindex[pn++] = e; + // compute the hash of node i + h += e; + } else { + // aggressive absorb. e->k + cptr[e] = (0, _csFlip.csFlip)(k); + // e is a dead element + W[w + e] = 0; + } + } + } + // W[elen + i] = |Ei| + W[elen + i] = pn - p1 + 1; + const p3 = pn; + const p4 = p1 + W[len + i]; + // prune edges in Ai + for (p = p2 + 1; p < p4; p++) { + j = cindex[p]; + // check node j dead or in Lk + const nvj = W[nv + j]; + if (nvj <= 0) { + continue; + } + // degree(i) += |j| + d += nvj; + // place j in node list of i + cindex[pn++] = j; + // compute hash for node i + h += j; + } + // check for mass elimination + if (d === 0) { + // absorb i into k + cptr[i] = (0, _csFlip.csFlip)(k); + nvi = -W[nv + i]; + // |Lk| -= |i| + dk -= nvi; + // |k| += W[nv + i] + nvk += nvi; + nel += nvi; + W[nv + i] = 0; + // node i is dead + W[elen + i] = -1; + } else { + // update degree(i) + W[degree + i] = Math.min(W[degree + i], d); + // move first node to end + cindex[pn] = cindex[p3]; + // move 1st el. to end of Ei + cindex[p3] = cindex[p1]; + // add k as 1st element in of Ei + cindex[p1] = k; + // new len of adj. list of node i + W[len + i] = pn - p1 + 1; + // finalize hash of i + h = (h < 0 ? -h : h) % n; + // place i in hash bucket + W[next + i] = W[hhead + h]; + W[hhead + h] = i; + // save hash of i in last[i] + last[i] = h; + } + } + // finalize |Lk| + W[degree + k] = dk; + lemax = Math.max(lemax, dk); + // clear w + mark = _wclear(mark + lemax, lemax, W, w, n); + + // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i. + // If two nodes have identical adjacency lists, their hash functions wil be identical. + for (pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check i is dead, skip it + if (W[nv + i] >= 0) { + continue; + } + // scan hash bucket of node i + h = last[i]; + i = W[hhead + h]; + // hash bucket will be empty + W[hhead + h] = -1; + for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) { + ln = W[len + i]; + eln = W[elen + i]; + for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) { + W[w + cindex[p]] = mark; + } + let jlast = i; + // compare i with all j + for (j = W[next + i]; j !== -1;) { + let ok = W[len + j] === ln && W[elen + j] === eln; + for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) { + // compare i and j + if (W[w + cindex[p]] !== mark) { + ok = 0; + } + } + // check i and j are identical + if (ok) { + // absorb j into i + cptr[j] = (0, _csFlip.csFlip)(i); + W[nv + i] += W[nv + j]; + W[nv + j] = 0; + // node j is dead + W[elen + j] = -1; + // delete j from hash bucket + j = W[next + j]; + W[next + jlast] = j; + } else { + // j and i are different + jlast = j; + j = W[next + j]; + } + } + } + } + + // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time. + // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared. + for (p = pk1, pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check i is dead, skip it + if ((nvi = -W[nv + i]) <= 0) { + continue; + } + // restore W[nv + i] + W[nv + i] = nvi; + // compute external degree(i) + d = W[degree + i] + dk - nvi; + d = Math.min(d, n - nel - nvi); + if (W[head + d] !== -1) { + last[W[head + d]] = i; + } + // put i back in degree list + W[next + i] = W[head + d]; + last[i] = -1; + W[head + d] = i; + // find new minimum degree + mindeg = Math.min(mindeg, d); + W[degree + i] = d; + // place i in Lk + cindex[p++] = i; + } + // # nodes absorbed into k + W[nv + k] = nvk; + // length of adj list of element k + if ((W[len + k] = p - pk1) === 0) { + // k is a root of the tree + cptr[k] = -1; + // k is now a dead element + W[w + k] = 0; + } + if (elenk !== 0) { + // free unused space in Lk + cnz = p; + } + } + + // Postordering. The elimination is complete, but no permutation has been computed. All that is left + // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if + // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation + // is computed. The tree is restored by unflipping all of ptr. + + // fix assembly tree + for (i = 0; i < n; i++) { + cptr[i] = (0, _csFlip.csFlip)(cptr[i]); + } + for (j = 0; j <= n; j++) { + W[head + j] = -1; + } + // place unordered nodes in lists + for (j = n; j >= 0; j--) { + // skip if j is an element + if (W[nv + j] > 0) { + continue; + } + // place j in list of its parent + W[next + j] = W[head + cptr[j]]; + W[head + cptr[j]] = j; + } + // place elements in lists + for (e = n; e >= 0; e--) { + // skip unless e is an element + if (W[nv + e] <= 0) { + continue; + } + if (cptr[e] !== -1) { + // place e in list of its parent + W[next + e] = W[head + cptr[e]]; + W[head + cptr[e]] = e; + } + } + // postorder the assembly tree + for (k = 0, i = 0; i <= n; i++) { + if (cptr[i] === -1) { + k = (0, _csTdfs.csTdfs)(i, k, W, head, next, P, w); + } + } + // remove last item in array + P.splice(P.length - 1, 1); + // return P + return P; + }; + + /** + * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation + * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed. + * + * Order: 0 + * A natural ordering P=null matrix is returned. + * + * Order: 1 + * Matrix must be square. This is appropriate for a Cholesky or LU factorization. + * P = M + M' + * + * Order: 2 + * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices. + * P = M' * M + * + * Order: 3 + * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries. + * P = M' * M + */ + function _createTargetMatrix(order, a, m, n, dense) { + // compute A' + const at = transpose(a); + + // check order = 1, matrix must be square + if (order === 1 && n === m) { + // C = A + A' + return add(a, at); + } + + // check order = 2, drop dense columns from M' + if (order === 2) { + // transpose arrays + const tindex = at._index; + const tptr = at._ptr; + // new column index + let p2 = 0; + // loop A' columns (rows) + for (let j = 0; j < m; j++) { + // column j of AT starts here + let p = tptr[j]; + // new column j starts here + tptr[j] = p2; + // skip dense col j + if (tptr[j + 1] - p > dense) { + continue; + } + // map rows in column j of A + for (const p1 = tptr[j + 1]; p < p1; p++) { + tindex[p2++] = tindex[p]; + } + } + // finalize AT + tptr[m] = p2; + // recreate A from new transpose matrix + a = transpose(at); + // use A' * A + return multiply(at, a); + } + + // use A' * A, square or rectangular matrix + return multiply(at, a); + } + + /** + * Initialize quotient graph. There are four kind of nodes and elements that must be represented: + * + * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode. + * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]). + * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot. + * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]). + */ + function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) { + // Initialize quotient graph + for (let k = 0; k < n; k++) { + W[len + k] = cptr[k + 1] - cptr[k]; + } + W[len + n] = 0; + // initialize workspace + for (let i = 0; i <= n; i++) { + // degree list i is empty + W[head + i] = -1; + last[i] = -1; + W[next + i] = -1; + // hash list i is empty + W[hhead + i] = -1; + // node i is just one node + W[nv + i] = 1; + // node i is alive + W[w + i] = 1; + // Ek of node i is empty + W[elen + i] = 0; + // degree of node i + W[degree + i] = W[len + i]; + } + // clear w + const mark = _wclear(0, 0, W, w, n); + // n is a dead element + W[elen + n] = -2; + // n is a root of assembly tree + cptr[n] = -1; + // n is a dead element + W[w + n] = 0; + // return mark + return mark; + } + + /** + * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with + * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the + * output permutation p. + */ + function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) { + // result + let nel = 0; + // loop columns + for (let i = 0; i < n; i++) { + // degree @ i + const d = W[degree + i]; + // check node i is empty + if (d === 0) { + // element i is dead + W[elen + i] = -2; + nel++; + // i is a root of assembly tree + cptr[i] = -1; + W[w + i] = 0; + } else if (d > dense) { + // absorb i into element n + W[nv + i] = 0; + // node i is dead + W[elen + i] = -1; + nel++; + cptr[i] = (0, _csFlip.csFlip)(n); + W[nv + n]++; + } else { + const h = W[head + d]; + if (h !== -1) { + last[h] = i; + } + // put node i in degree list d + W[next + i] = W[head + d]; + W[head + d] = i; + } + } + return nel; + } + function _wclear(mark, lemax, W, w, n) { + if (mark < 2 || mark + lemax < 0) { + for (let k = 0; k < n; k++) { + if (W[w + k] !== 0) { + W[w + k] = 1; + } + } + mark = 2; + } + // at this point, W [0..n-1] < mark holds + return mark; + } + function _diag(i, j) { + return i !== j; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js new file mode 100644 index 0000000..a9c7e1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js @@ -0,0 +1,164 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsChol = void 0; +var _factory = require("../../../utils/factory.js"); +var _csEreach = require("./csEreach.js"); +var _csSymperm = require("./csSymperm.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csChol'; +const dependencies = ['divideScalar', 'sqrt', 'subtract', 'multiply', 'im', 're', 'conj', 'equal', 'smallerEq', 'SparseMatrix']; +const createCsChol = exports.createCsChol = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + divideScalar, + sqrt, + subtract, + multiply, + im, + re, + conj, + equal, + smallerEq, + SparseMatrix + } = _ref; + const csSymperm = (0, _csSymperm.createCsSymperm)({ + conj, + SparseMatrix + }); + + /** + * Computes the Cholesky factorization of matrix A. It computes L and P so + * L * L' = P * A * P' + * + * @param {Matrix} m The A Matrix to factorize, only upper triangular part used + * @param {Object} s The symbolic analysis from cs_schol() + * + * @return {Number} The numeric Cholesky factorization of A or null + */ + return function csChol(m, s) { + // validate input + if (!m) { + return null; + } + // m arrays + const size = m._size; + // columns + const n = size[1]; + // symbolic analysis result + const parent = s.parent; + const cp = s.cp; + const pinv = s.pinv; + // L arrays + const lvalues = []; + const lindex = []; + const lptr = []; + // L + const L = new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: [n, n] + }); + // vars + const c = []; // (2 * n) + const x = []; // (n) + // compute C = P * A * P' + const cm = pinv ? csSymperm(m, pinv, 1) : m; + // C matrix arrays + const cvalues = cm._values; + const cindex = cm._index; + const cptr = cm._ptr; + // vars + let k, p; + // initialize variables + for (k = 0; k < n; k++) { + lptr[k] = c[k] = cp[k]; + } + // compute L(k,:) for L*L' = C + for (k = 0; k < n; k++) { + // nonzero pattern of L(k,:) + let top = (0, _csEreach.csEreach)(cm, k, parent, c); + // x (0:k) is now zero + x[k] = 0; + // x = full(triu(C(:,k))) + for (p = cptr[k]; p < cptr[k + 1]; p++) { + if (cindex[p] <= k) { + x[cindex[p]] = cvalues[p]; + } + } + // d = C(k,k) + let d = x[k]; + // clear x for k+1st iteration + x[k] = 0; + // solve L(0:k-1,0:k-1) * x = C(:,k) + for (; top < n; top++) { + // s[top..n-1] is pattern of L(k,:) + const i = s[top]; + // L(k,i) = x (i) / L(i,i) + const lki = divideScalar(x[i], lvalues[lptr[i]]); + // clear x for k+1st iteration + x[i] = 0; + for (p = lptr[i] + 1; p < c[i]; p++) { + // row + const r = lindex[p]; + // update x[r] + x[r] = subtract(x[r], multiply(lvalues[p], lki)); + } + // d = d - L(k,i)*L(k,i) + d = subtract(d, multiply(lki, conj(lki))); + p = c[i]++; + // store L(k,i) in column i + lindex[p] = k; + lvalues[p] = conj(lki); + } + // compute L(k,k) + if (smallerEq(re(d), 0) || !equal(im(d), 0)) { + // not pos def + return null; + } + p = c[k]++; + // store L(k,k) = sqrt(d) in column k + lindex[p] = k; + lvalues[p] = sqrt(d); + } + // finalize L + lptr[n] = cp[n]; + // P matrix + let P; + // check we need to calculate P + if (pinv) { + // P arrays + const pvalues = []; + const pindex = []; + const pptr = []; + // create P matrix + for (p = 0; p < n; p++) { + // initialize ptr (one value per column) + pptr[p] = p; + // index (apply permutation vector) + pindex.push(pinv[p]); + // value 1 + pvalues.push(1); + } + // update ptr + pptr[n] = n; + // P + P = new SparseMatrix({ + values: pvalues, + index: pindex, + ptr: pptr, + size: [n, n] + }); + } + // return L & P + return { + L, + P + }; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js new file mode 100644 index 0000000..c131993 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js @@ -0,0 +1,133 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsCounts = void 0; +var _factory = require("../../../utils/factory.js"); +var _csLeaf = require("./csLeaf.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csCounts'; +const dependencies = ['transpose']; +const createCsCounts = exports.createCsCounts = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + transpose + } = _ref; + /** + * Computes the column counts using the upper triangular part of A. + * It transposes A internally, none of the input parameters are modified. + * + * @param {Matrix} a The sparse matrix A + * + * @param {Matrix} ata Count the columns of A'A instead + * + * @return An array of size n of the column counts or null on error + */ + return function (a, parent, post, ata) { + // check inputs + if (!a || !parent || !post) { + return null; + } + // a matrix arrays + const asize = a._size; + // rows and columns + const m = asize[0]; + const n = asize[1]; + // variables + let i, j, k, J, p, p0, p1; + + // workspace size + const s = 4 * n + (ata ? n + m + 1 : 0); + // allocate workspace + const w = []; // (s) + const ancestor = 0; // first n entries + const maxfirst = n; // next n entries + const prevleaf = 2 * n; // next n entries + const first = 3 * n; // next n entries + const head = 4 * n; // next n + 1 entries (used when ata is true) + const next = 5 * n + 1; // last entries in workspace + // clear workspace w[0..s-1] + for (k = 0; k < s; k++) { + w[k] = -1; + } + + // allocate result + const colcount = []; // (n) + + // AT = A' + const at = transpose(a); + // at arrays + const tindex = at._index; + const tptr = at._ptr; + + // find w[first + j] + for (k = 0; k < n; k++) { + j = post[k]; + // colcount[j]=1 if j is a leaf + colcount[j] = w[first + j] === -1 ? 1 : 0; + for (; j !== -1 && w[first + j] === -1; j = parent[j]) { + w[first + j] = k; + } + } + + // initialize ata if needed + if (ata) { + // invert post + for (k = 0; k < n; k++) { + w[post[k]] = k; + } + // loop rows (columns in AT) + for (i = 0; i < m; i++) { + // values in column i of AT + for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) { + k = Math.min(k, w[tindex[p]]); + } + // place row i in linked list k + w[next + i] = w[head + k]; + w[head + k] = i; + } + } + + // each node in its own set + for (i = 0; i < n; i++) { + w[ancestor + i] = i; + } + for (k = 0; k < n; k++) { + // j is the kth node in postordered etree + j = post[k]; + // check j is not a root + if (parent[j] !== -1) { + colcount[parent[j]]--; + } + + // J=j for LL'=A case + for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) { + for (p = tptr[J]; p < tptr[J + 1]; p++) { + i = tindex[p]; + const r = (0, _csLeaf.csLeaf)(i, j, w, first, maxfirst, prevleaf, ancestor); + // check A(i,j) is in skeleton + if (r.jleaf >= 1) { + colcount[j]++; + } + // check account for overlap in q + if (r.jleaf === 2) { + colcount[r.q]--; + } + } + } + if (parent[j] !== -1) { + w[ancestor + j] = parent[j]; + } + } + // sum up colcount's of each child + for (j = 0; j < n; j++) { + if (parent[j] !== -1) { + colcount[parent[j]] += colcount[j]; + } + } + return colcount; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js new file mode 100644 index 0000000..2035a26 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csCumsum = csCumsum; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * It sets the p[i] equal to the sum of c[0] through c[i-1]. + * + * @param {Array} ptr The Sparse Matrix ptr array + * @param {Array} c The Sparse Matrix ptr array + * @param {Number} n The number of columns + */ +function csCumsum(ptr, c, n) { + // variables + let i; + let nz = 0; + for (i = 0; i < n; i++) { + // initialize ptr @ i + ptr[i] = nz; + // increment number of nonzeros + nz += c[i]; + // also copy p[0..n-1] back into c[0..n-1] + c[i] = ptr[i]; + } + // finalize ptr + ptr[n] = nz; + // return sum (c [0..n-1]) + return nz; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js new file mode 100644 index 0000000..437e115 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csDfs = csDfs; +var _csMarked = require("./csMarked.js"); +var _csMark = require("./csMark.js"); +var _csUnflip = require("./csUnflip.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting + * at nodes in B (see csReach()). + * + * @param {Number} j The starting node for the DFS algorithm + * @param {Matrix} g The G matrix to search, ptr array modified, then restored + * @param {Number} top Start index in stack xi[top..n-1] + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b + * + * @return {Number} New value of top + */ +function csDfs(j, g, top, xi, pinv) { + // g arrays + const index = g._index; + const ptr = g._ptr; + const size = g._size; + // columns + const n = size[1]; + // vars + let i, p, p2; + // initialize head + let head = 0; + // initialize the recursion stack + xi[0] = j; + // loop + while (head >= 0) { + // get j from the top of the recursion stack + j = xi[head]; + // apply permutation vector + const jnew = pinv ? pinv[j] : j; + // check node j is marked + if (!(0, _csMarked.csMarked)(ptr, j)) { + // mark node j as visited + (0, _csMark.csMark)(ptr, j); + // update stack (last n entries in xi) + xi[n + head] = jnew < 0 ? 0 : (0, _csUnflip.csUnflip)(ptr[jnew]); + } + // node j done if no unvisited neighbors + let done = 1; + // examine all neighbors of j, stack (last n entries in xi) + for (p = xi[n + head], p2 = jnew < 0 ? 0 : (0, _csUnflip.csUnflip)(ptr[jnew + 1]); p < p2; p++) { + // consider neighbor node i + i = index[p]; + // check we have visited node i, skip it + if ((0, _csMarked.csMarked)(ptr, i)) { + continue; + } + // pause depth-first search of node j, update stack (last n entries in xi) + xi[n + head] = p; + // start dfs at node i + xi[++head] = i; + // node j is not done + done = 0; + // break, to start dfs(i) + break; + } + // check depth-first search at node j is done + if (done) { + // remove j from the recursion stack + head--; + // and place in the output stack + xi[--top] = j; + } + } + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js new file mode 100644 index 0000000..022fcf5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csEreach = csEreach; +var _csMark = require("./csMark.js"); +var _csMarked = require("./csMarked.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Find nonzero pattern of Cholesky L(k,1:k-1) using etree and triu(A(:,k)) + * + * @param {Matrix} a The A matrix + * @param {Number} k The kth column in A + * @param {Array} parent The parent vector from the symbolic analysis result + * @param {Array} w The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * + * @return {Number} The index for the nonzero pattern + */ +function csEreach(a, k, parent, w) { + // a arrays + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + // columns + const n = asize[1]; + // initialize top + let top = n; + // vars + let p, p0, p1, len; + // mark node k as visited + (0, _csMark.csMark)(w, k); + // loop values & index for column k + for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // A(i,k) is nonzero + let i = aindex[p]; + // only use upper triangular part of A + if (i > k) { + continue; + } + // traverse up etree + for (len = 0; !(0, _csMarked.csMarked)(w, i); i = parent[i]) { + // L(k,i) is nonzero, last n entries in w + w[n + len++] = i; + // mark i as visited + (0, _csMark.csMark)(w, i); + } + while (len > 0) { + // decrement top & len + --top; + --len; + // push path onto stack, last n entries in w + w[n + top] = w[n + len]; + } + } + // unmark all nodes + for (p = top; p < n; p++) { + // use stack value, last n entries in w + (0, _csMark.csMark)(w, w[n + p]); + } + // unmark node k + (0, _csMark.csMark)(w, k); + // s[top..n-1] contains pattern of L(k,:) + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js new file mode 100644 index 0000000..d2b7bda --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csEtree = csEtree; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Computes the elimination tree of Matrix A (using triu(A)) or the + * elimination tree of A'A without forming A'A. + * + * @param {Matrix} a The A Matrix + * @param {boolean} ata A value of true the function computes the etree of A'A + */ +function csEtree(a, ata) { + // check inputs + if (!a) { + return null; + } + // a arrays + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + // rows & columns + const m = asize[0]; + const n = asize[1]; + + // allocate result + const parent = []; // (n) + + // allocate workspace + const w = []; // (n + (ata ? m : 0)) + const ancestor = 0; // first n entries in w + const prev = n; // last m entries (ata = true) + + let i, inext; + + // check we are calculating A'A + if (ata) { + // initialize workspace + for (i = 0; i < m; i++) { + w[prev + i] = -1; + } + } + // loop columns + for (let k = 0; k < n; k++) { + // node k has no parent yet + parent[k] = -1; + // nor does k have an ancestor + w[ancestor + k] = -1; + // values in column k + for (let p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // row + const r = aindex[p]; + // node + i = ata ? w[prev + r] : r; + // traverse from i to k + for (; i !== -1 && i < k; i = inext) { + // inext = ancestor of i + inext = w[ancestor + i]; + // path compression + w[ancestor + i] = k; + // check no anc., parent is k + if (inext === -1) { + parent[i] = k; + } + } + if (ata) { + w[prev + r] = k; + } + } + } + return parent; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js new file mode 100644 index 0000000..6d916d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csFkeep = csFkeep; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise + * + * @param {Matrix} a The sparse matrix + * @param {function} callback The callback function, function will be invoked with the following args: + * - The entry row + * - The entry column + * - The entry value + * - The state parameter + * @param {any} other The state + * + * @return The number of nonzero elements in the matrix + */ +function csFkeep(a, callback, other) { + // a arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + // columns + const n = asize[1]; + // nonzero items + let nz = 0; + // loop columns + for (let j = 0; j < n; j++) { + // get current location of col j + let p = aptr[j]; + // record new location of col j + aptr[j] = nz; + for (; p < aptr[j + 1]; p++) { + // check we need to keep this item + if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) { + // keep A(i,j) + aindex[nz] = aindex[p]; + // check we need to process values (pattern only) + if (avalues) { + avalues[nz] = avalues[p]; + } + // increment nonzero items + nz++; + } + } + } + // finalize A + aptr[n] = nz; + // trim arrays + aindex.splice(nz, aindex.length - nz); + // check we need to process values (pattern only) + if (avalues) { + avalues.splice(nz, avalues.length - nz); + } + // return number of nonzero items + return nz; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js new file mode 100644 index 0000000..bcc13a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csFlip = csFlip; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * This function "flips" its input about the integer -1. + * + * @param {Number} i The value to flip + */ +function csFlip(i) { + // flip the value + return -i - 2; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js new file mode 100644 index 0000000..0d63ef9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csIpvec = csIpvec; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b. + * + * @param {Array} p The permutation vector of length n. null value denotes identity + * @param {Array} b The input vector + * + * @return {Array} The output vector x = P'b + */ +function csIpvec(p, b) { + // vars + let k; + const n = b.length; + const x = []; + // check permutation vector was provided, p = null denotes identity + if (p) { + // loop vector + for (k = 0; k < n; k++) { + // apply permutation + x[p[k]] = b[k]; + } + } else { + // loop vector + for (k = 0; k < n; k++) { + // x[i] = b[i] + x[k] = b[k]; + } + } + return x; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js new file mode 100644 index 0000000..4e4d93b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csLeaf = csLeaf; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * This function determines if j is a leaf of the ith row subtree. + * Consider A(i,j), node j in ith row subtree and return lca(jprev,j) + * + * @param {Number} i The ith row subtree + * @param {Number} j The node to test + * @param {Array} w The workspace array + * @param {Number} first The index offset within the workspace for the first array + * @param {Number} maxfirst The index offset within the workspace for the maxfirst array + * @param {Number} prevleaf The index offset within the workspace for the prevleaf array + * @param {Number} ancestor The index offset within the workspace for the ancestor array + * + * @return {Object} + */ +function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) { + let s, sparent; + + // our result + let jleaf = 0; + let q; + + // check j is a leaf + if (i <= j || w[first + j] <= w[maxfirst + i]) { + return -1; + } + // update max first[j] seen so far + w[maxfirst + i] = w[first + j]; + // jprev = previous leaf of ith subtree + const jprev = w[prevleaf + i]; + w[prevleaf + i] = j; + + // check j is first or subsequent leaf + if (jprev === -1) { + // 1st leaf, q = root of ith subtree + jleaf = 1; + q = i; + } else { + // update jleaf + jleaf = 2; + // q = least common ancester (jprev,j) + for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]); + for (s = jprev; s !== q; s = sparent) { + // path compression + sparent = w[ancestor + s]; + w[ancestor + s] = q; + } + } + return { + jleaf, + q + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js new file mode 100644 index 0000000..e74ca25 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js @@ -0,0 +1,188 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsLu = void 0; +var _factory = require("../../../utils/factory.js"); +var _csSpsolve = require("./csSpsolve.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csLu'; +const dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix']; +const createCsLu = exports.createCsLu = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + abs, + divideScalar, + multiply, + subtract, + larger, + largerEq, + SparseMatrix + } = _ref; + const csSpsolve = (0, _csSpsolve.createCsSpsolve)({ + divideScalar, + multiply, + subtract + }); + + /** + * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization + * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L + * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so + * L * U = A(p, q), where p is the inverse of pinv. + * + * @param {Matrix} m The A Matrix to factorize + * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing + * column ordering q + * @param {Number} tol Partial pivoting threshold (1 for partial pivoting) + * + * @return {Number} The numeric LU factorization of A or null + */ + return function csLu(m, s, tol) { + // validate input + if (!m) { + return null; + } + // m arrays + const size = m._size; + // columns + const n = size[1]; + // symbolic analysis result + let q; + let lnz = 100; + let unz = 100; + // update symbolic analysis parameters + if (s) { + q = s.q; + lnz = s.lnz || lnz; + unz = s.unz || unz; + } + // L arrays + const lvalues = []; // (lnz) + const lindex = []; // (lnz) + const lptr = []; // (n + 1) + // L + const L = new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: [n, n] + }); + // U arrays + const uvalues = []; // (unz) + const uindex = []; // (unz) + const uptr = []; // (n + 1) + // U + const U = new SparseMatrix({ + values: uvalues, + index: uindex, + ptr: uptr, + size: [n, n] + }); + // inverse of permutation vector + const pinv = []; // (n) + // vars + let i, p; + // allocate arrays + const x = []; // (n) + const xi = []; // (2 * n) + // initialize variables + for (i = 0; i < n; i++) { + // clear workspace + x[i] = 0; + // no rows pivotal yet + pinv[i] = -1; + // no cols of L yet + lptr[i + 1] = 0; + } + // reset number of nonzero elements in L and U + lnz = 0; + unz = 0; + // compute L(:,k) and U(:,k) + for (let k = 0; k < n; k++) { + // update ptr + lptr[k] = lnz; + uptr[k] = unz; + // apply column permutations if needed + const col = q ? q[k] : k; + // solve triangular system, x = L\A(:,col) + const top = csSpsolve(L, m, col, xi, x, pinv, 1); + // find pivot + let ipiv = -1; + let a = -1; + // loop xi[] from top -> n + for (p = top; p < n; p++) { + // x[i] is nonzero + i = xi[p]; + // check row i is not yet pivotal + if (pinv[i] < 0) { + // absolute value of x[i] + const xabs = abs(x[i]); + // check absoulte value is greater than pivot value + if (larger(xabs, a)) { + // largest pivot candidate so far + a = xabs; + ipiv = i; + } + } else { + // x(i) is the entry U(pinv[i],k) + uindex[unz] = pinv[i]; + uvalues[unz++] = x[i]; + } + } + // validate we found a valid pivot + if (ipiv === -1 || a <= 0) { + return null; + } + // update actual pivot column, give preference to diagonal value + if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) { + ipiv = col; + } + // the chosen pivot + const pivot = x[ipiv]; + // last entry in U(:,k) is U(k,k) + uindex[unz] = k; + uvalues[unz++] = pivot; + // ipiv is the kth pivot row + pinv[ipiv] = k; + // first entry in L(:,k) is L(k,k) = 1 + lindex[lnz] = ipiv; + lvalues[lnz++] = 1; + // L(k+1:n,k) = x / pivot + for (p = top; p < n; p++) { + // row + i = xi[p]; + // check x(i) is an entry in L(:,k) + if (pinv[i] < 0) { + // save unpermuted row in L + lindex[lnz] = i; + // scale pivot column + lvalues[lnz++] = divideScalar(x[i], pivot); + } + // x[0..n-1] = 0 for next k + x[i] = 0; + } + } + // update ptr + lptr[n] = lnz; + uptr[n] = unz; + // fix row indices of L for final pinv + for (p = 0; p < lnz; p++) { + lindex[p] = pinv[lindex[p]]; + } + // trim arrays + lvalues.splice(lnz, lvalues.length - lnz); + lindex.splice(lnz, lindex.length - lnz); + uvalues.splice(unz, uvalues.length - unz); + uindex.splice(unz, uindex.length - unz); + // return LU factor + return { + L, + U, + pinv + }; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js new file mode 100644 index 0000000..7845048 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csMark = csMark; +var _csFlip = require("./csFlip.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Marks the node at w[j] + * + * @param {Array} w The array + * @param {Number} j The array index + */ +function csMark(w, j) { + // mark w[j] + w[j] = (0, _csFlip.csFlip)(w[j]); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js new file mode 100644 index 0000000..0c61e7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csMarked = csMarked; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Checks if the node at w[j] is marked + * + * @param {Array} w The array + * @param {Number} j The array index + */ +function csMarked(w, j) { + // check node is marked + return w[j] < 0; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js new file mode 100644 index 0000000..abd5e7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csPermute = csPermute; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Permutes a sparse matrix C = P * A * Q + * + * @param {SparseMatrix} a The Matrix A + * @param {Array} pinv The row permutation vector + * @param {Array} q The column permutation vector + * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise + * + * @return {Matrix} C = P * A * Q, null on error + */ +function csPermute(a, pinv, q, values) { + // a arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + const adt = a._datatype; + // rows & columns + const m = asize[0]; + const n = asize[1]; + // c arrays + const cvalues = values && a._values ? [] : null; + const cindex = []; // (aptr[n]) + const cptr = []; // (n + 1) + // initialize vars + let nz = 0; + // loop columns + for (let k = 0; k < n; k++) { + // column k of C is column q[k] of A + cptr[k] = nz; + // apply column permutation + const j = q ? q[k] : k; + // loop values in column j of A + for (let t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) { + // row i of A is row pinv[i] of C + const r = pinv ? pinv[aindex[t]] : aindex[t]; + // index + cindex[nz] = r; + // check we need to populate values + if (cvalues) { + cvalues[nz] = avalues[t]; + } + // increment number of nonzero elements + nz++; + } + } + // finalize the last column of C + cptr[n] = nz; + // return C matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [m, n], + datatype: adt + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js new file mode 100644 index 0000000..384e72b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csPost = csPost; +var _csTdfs = require("./csTdfs.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Post order a tree of forest + * + * @param {Array} parent The tree or forest + * @param {Number} n Number of columns + */ +function csPost(parent, n) { + // check inputs + if (!parent) { + return null; + } + // vars + let k = 0; + let j; + // allocate result + const post = []; // (n) + // workspace, head: first n entries, next: next n entries, stack: last n entries + const w = []; // (3 * n) + const head = 0; + const next = n; + const stack = 2 * n; + // initialize workspace + for (j = 0; j < n; j++) { + // empty linked lists + w[head + j] = -1; + } + // traverse nodes in reverse order + for (j = n - 1; j >= 0; j--) { + // check j is a root + if (parent[j] === -1) { + continue; + } + // add j to list of its parent + w[next + j] = w[head + parent[j]]; + w[head + parent[j]] = j; + } + // loop nodes + for (j = 0; j < n; j++) { + // skip j if it is not a root + if (parent[j] !== -1) { + continue; + } + // depth-first search + k = (0, _csTdfs.csTdfs)(j, k, w, head, next, post, stack); + } + return post; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js new file mode 100644 index 0000000..2975d6d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csReach = csReach; +var _csMarked = require("./csMarked.js"); +var _csMark = require("./csMark.js"); +var _csDfs = require("./csDfs.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1 + * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The + * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B). + * + * @param {Matrix} g The G matrix + * @param {Matrix} b The B matrix + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} pinv The inverse row permutation vector + * + * @return {Number} The index for the nonzero pattern + */ +function csReach(g, b, k, xi, pinv) { + // g arrays + const gptr = g._ptr; + const gsize = g._size; + // b arrays + const bindex = b._index; + const bptr = b._ptr; + // columns + const n = gsize[1]; + // vars + let p, p0, p1; + // initialize top + let top = n; + // loop column indeces in B + for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) { + // node i + const i = bindex[p]; + // check node i is marked + if (!(0, _csMarked.csMarked)(gptr, i)) { + // start a dfs at unmarked node i + top = (0, _csDfs.csDfs)(i, g, top, xi, pinv); + } + } + // loop columns from top -> n - 1 + for (p = top; p < n; p++) { + // restore G + (0, _csMark.csMark)(gptr, xi[p]); + } + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js new file mode 100644 index 0000000..3e45875 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsSpsolve = void 0; +var _csReach = require("./csReach.js"); +var _factory = require("../../../utils/factory.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csSpsolve'; +const dependencies = ['divideScalar', 'multiply', 'subtract']; +const createCsSpsolve = exports.createCsSpsolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + divideScalar, + multiply, + subtract + } = _ref; + /** + * The function csSpsolve() computes the solution to G * x = bk, where bk is the + * kth column of B. When lo is true, the function assumes G = L is lower triangular with the + * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U + * is upper triangular with the diagonal entry as the last entry in each column. + * + * @param {Matrix} g The G matrix + * @param {Matrix} b The B matrix + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} x The soluton to the linear system G * x = b + * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b + * @param {boolean} lo The lower (true) upper triangular (false) flag + * + * @return {Number} The index for the nonzero pattern + */ + return function csSpsolve(g, b, k, xi, x, pinv, lo) { + // g arrays + const gvalues = g._values; + const gindex = g._index; + const gptr = g._ptr; + const gsize = g._size; + // columns + const n = gsize[1]; + // b arrays + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + // vars + let p, p0, p1, q; + // xi[top..n-1] = csReach(B(:,k)) + const top = (0, _csReach.csReach)(g, b, k, xi, pinv); + // clear x + for (p = top; p < n; p++) { + x[xi[p]] = 0; + } + // scatter b + for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) { + x[bindex[p]] = bvalues[p]; + } + // loop columns + for (let px = top; px < n; px++) { + // x array index for px + const j = xi[px]; + // apply permutation vector (U x = b), j maps to column J of G + const J = pinv ? pinv[j] : j; + // check column J is empty + if (J < 0) { + continue; + } + // column value indeces in G, p0 <= p < p1 + p0 = gptr[J]; + p1 = gptr[J + 1]; + // x(j) /= G(j,j) + x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]); + // first entry L(j,j) + p = lo ? p0 + 1 : p0; + q = lo ? p1 : p1 - 1; + // loop + for (; p < q; p++) { + // row + const i = gindex[p]; + // x(i) -= G(i,j) * x(j) + x[i] = subtract(x[i], multiply(gvalues[p], x[j])); + } + } + // return top of stack + return top; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js new file mode 100644 index 0000000..a6bbaa1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js @@ -0,0 +1,186 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsSqr = void 0; +var _csPermute = require("./csPermute.js"); +var _csPost = require("./csPost.js"); +var _csEtree = require("./csEtree.js"); +var _csAmd = require("./csAmd.js"); +var _csCounts = require("./csCounts.js"); +var _factory = require("../../../utils/factory.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csSqr'; +const dependencies = ['add', 'multiply', 'transpose']; +const createCsSqr = exports.createCsSqr = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + add, + multiply, + transpose + } = _ref; + const csAmd = (0, _csAmd.createCsAmd)({ + add, + multiply, + transpose + }); + const csCounts = (0, _csCounts.createCsCounts)({ + transpose + }); + + /** + * Symbolic ordering and analysis for QR and LU decompositions. + * + * @param {Number} order The ordering strategy (see csAmd for more details) + * @param {Matrix} a The A matrix + * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or + * symbolic ordering and analysis for LU decomposition (false) + * + * @return {Object} The Symbolic ordering and analysis for matrix A + */ + return function csSqr(order, a, qr) { + // a arrays + const aptr = a._ptr; + const asize = a._size; + // columns + const n = asize[1]; + // vars + let k; + // symbolic analysis result + const s = {}; + // fill-reducing ordering + s.q = csAmd(order, a); + // validate results + if (order && !s.q) { + return null; + } + // QR symbolic analysis + if (qr) { + // apply permutations if needed + const c = order ? (0, _csPermute.csPermute)(a, null, s.q, 0) : a; + // etree of C'*C, where C=A(:,q) + s.parent = (0, _csEtree.csEtree)(c, 1); + // post order elimination tree + const post = (0, _csPost.csPost)(s.parent, n); + // col counts chol(C'*C) + s.cp = csCounts(c, s.parent, post, 1); + // check we have everything needed to calculate number of nonzero elements + if (c && s.parent && s.cp && _vcount(c, s)) { + // calculate number of nonzero elements + for (s.unz = 0, k = 0; k < n; k++) { + s.unz += s.cp[k]; + } + } + } else { + // for LU factorization only, guess nnz(L) and nnz(U) + s.unz = 4 * aptr[n] + n; + s.lnz = s.unz; + } + // return result S + return s; + }; + + /** + * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent + */ + function _vcount(a, s) { + // a arrays + const aptr = a._ptr; + const aindex = a._index; + const asize = a._size; + // rows & columns + const m = asize[0]; + const n = asize[1]; + // initialize s arrays + s.pinv = []; // (m + n) + s.leftmost = []; // (m) + // vars + const parent = s.parent; + const pinv = s.pinv; + const leftmost = s.leftmost; + // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries + const w = []; // (m + 3 * n) + const next = 0; + const head = m; + const tail = m + n; + const nque = m + 2 * n; + // vars + let i, k, p, p0, p1; + // initialize w + for (k = 0; k < n; k++) { + // queue k is empty + w[head + k] = -1; + w[tail + k] = -1; + w[nque + k] = 0; + } + // initialize row arrays + for (i = 0; i < m; i++) { + leftmost[i] = -1; + } + // loop columns backwards + for (k = n - 1; k >= 0; k--) { + // values & index for column k + for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // leftmost[i] = min(find(A(i,:))) + leftmost[aindex[p]] = k; + } + } + // scan rows in reverse order + for (i = m - 1; i >= 0; i--) { + // row i is not yet ordered + pinv[i] = -1; + k = leftmost[i]; + // check row i is empty + if (k === -1) { + continue; + } + // first row in queue k + if (w[nque + k]++ === 0) { + w[tail + k] = i; + } + // put i at head of queue k + w[next + i] = w[head + k]; + w[head + k] = i; + } + s.lnz = 0; + s.m2 = m; + // find row permutation and nnz(V) + for (k = 0; k < n; k++) { + // remove row i from queue k + i = w[head + k]; + // count V(k,k) as nonzero + s.lnz++; + // add a fictitious row + if (i < 0) { + i = s.m2++; + } + // associate row i with V(:,k) + pinv[i] = k; + // skip if V(k+1:m,k) is empty + if (--nque[k] <= 0) { + continue; + } + // nque[k] is nnz (V(k+1:m,k)) + s.lnz += w[nque + k]; + // move all rows to parent of k + const pa = parent[k]; + if (pa !== -1) { + if (w[nque + pa] === 0) { + w[tail + pa] = w[tail + k]; + } + w[next + w[tail + k]] = w[head + pa]; + w[head + pa] = w[next + i]; + w[nque + pa] += w[nque + k]; + } + } + for (i = 0; i < m; i++) { + if (pinv[i] < 0) { + pinv[i] = k++; + } + } + return true; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js new file mode 100644 index 0000000..9f435f5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js @@ -0,0 +1,100 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsSymperm = void 0; +var _csCumsum = require("./csCumsum.js"); +var _factory = require("../../../utils/factory.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +const name = 'csSymperm'; +const dependencies = ['conj', 'SparseMatrix']; +const createCsSymperm = exports.createCsSymperm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + conj, + SparseMatrix + } = _ref; + /** + * Computes the symmetric permutation of matrix A accessing only + * the upper triangular part of A. + * + * C = P * A * P' + * + * @param {Matrix} a The A matrix + * @param {Array} pinv The inverse of permutation vector + * @param {boolean} values Process matrix values (true) + * + * @return {Matrix} The C matrix, C = P * A * P' + */ + return function csSymperm(a, pinv, values) { + // A matrix arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + // columns + const n = asize[1]; + // C matrix arrays + const cvalues = values && avalues ? [] : null; + const cindex = []; // (nz) + const cptr = []; // (n + 1) + // variables + let i, i2, j, j2, p, p0, p1; + // create workspace vector + const w = []; // (n) + // count entries in each column of C + for (j = 0; j < n; j++) { + // column j of A is column j2 of C + j2 = pinv ? pinv[j] : j; + // loop values in column j + for (p0 = aptr[j], p1 = aptr[j + 1], p = p0; p < p1; p++) { + // row + i = aindex[p]; + // skip lower triangular part of A + if (i > j) { + continue; + } + // row i of A is row i2 of C + i2 = pinv ? pinv[i] : i; + // column count of C + w[Math.max(i2, j2)]++; + } + } + // compute column pointers of C + (0, _csCumsum.csCumsum)(cptr, w, n); + // loop columns + for (j = 0; j < n; j++) { + // column j of A is column j2 of C + j2 = pinv ? pinv[j] : j; + // loop values in column j + for (p0 = aptr[j], p1 = aptr[j + 1], p = p0; p < p1; p++) { + // row + i = aindex[p]; + // skip lower triangular part of A + if (i > j) { + continue; + } + // row i of A is row i2 of C + i2 = pinv ? pinv[i] : i; + // C index for column j2 + const q = w[Math.max(i2, j2)]++; + // update C index for entry q + cindex[q] = Math.min(i2, j2); + // check we need to process values + if (cvalues) { + cvalues[q] = i2 <= j2 ? avalues[p] : conj(avalues[p]); + } + } + } + // return C matrix + return new SparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [n, n] + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js new file mode 100644 index 0000000..b1fa1aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csTdfs = csTdfs; +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Depth-first search and postorder of a tree rooted at node j + * + * @param {Number} j The tree node + * @param {Number} k + * @param {Array} w The workspace array + * @param {Number} head The index offset within the workspace for the head array + * @param {Number} next The index offset within the workspace for the next array + * @param {Array} post The post ordering array + * @param {Number} stack The index offset within the workspace for the stack array + */ +function csTdfs(j, k, w, head, next, post, stack) { + // variables + let top = 0; + // place j on the stack + w[stack] = j; + // while (stack is not empty) + while (top >= 0) { + // p = top of stack + const p = w[stack + top]; + // i = youngest child of p + const i = w[head + p]; + if (i === -1) { + // p has no unordered children left + top--; + // node p is the kth postordered node + post[k++] = p; + } else { + // remove i from children of p + w[head + p] = w[next + i]; + // increment top + ++top; + // start dfs on child node i + w[stack + top] = i; + } + } + return k; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js new file mode 100644 index 0000000..31c0304 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.csUnflip = csUnflip; +var _csFlip = require("./csFlip.js"); +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Flips the value if it is negative of returns the same value otherwise. + * + * @param {Number} i The value to flip + */ +function csUnflip(i) { + // flip the value if it is negative + return i < 0 ? (0, _csFlip.csFlip)(i) : i; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js new file mode 100644 index 0000000..bf6e311 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js @@ -0,0 +1,124 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSylvester = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'sylvester'; +const dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs']; +const createSylvester = exports.createSylvester = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + schur, + matrixFromColumns, + matrix, + multiply, + range, + concat, + transpose, + index, + subset, + add, + subtract, + identity, + lusolve, + abs + } = _ref; + /** + * + * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are + * matrices of appropriate dimensions, being A and B squared. Notice that other + * equivalent definitions for the Sylvester equation exist and this function + * assumes the one presented in the original publication of the the Bartels- + * Stewart algorithm, which is implemented by this function. + * https://en.wikipedia.org/wiki/Sylvester_equation + * + * Syntax: + * + * math.sylvester(A, B, C) + * + * Examples: + * + * const A = [[-1, -2], [1, 1]] + * const B = [[2, -1], [1, -2]] + * const C = [[-3, 2], [3, 0]] + * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]] + * + * See also: + * + * schur, lyap + * + * @param {Matrix | Array} A Matrix A + * @param {Matrix | Array} B Matrix B + * @param {Matrix | Array} C Matrix C + * @return {Matrix | Array} Matrix X, solving the Sylvester equation + */ + return typed(name, { + 'Matrix, Matrix, Matrix': _sylvester, + 'Array, Matrix, Matrix': function (A, B, C) { + return _sylvester(matrix(A), B, C); + }, + 'Array, Array, Matrix': function (A, B, C) { + return _sylvester(matrix(A), matrix(B), C); + }, + 'Array, Matrix, Array': function (A, B, C) { + return _sylvester(matrix(A), B, matrix(C)); + }, + 'Matrix, Array, Matrix': function (A, B, C) { + return _sylvester(A, matrix(B), C); + }, + 'Matrix, Array, Array': function (A, B, C) { + return _sylvester(A, matrix(B), matrix(C)); + }, + 'Matrix, Matrix, Array': function (A, B, C) { + return _sylvester(A, B, matrix(C)); + }, + 'Array, Array, Array': function (A, B, C) { + return _sylvester(matrix(A), matrix(B), matrix(C)).toArray(); + } + }); + function _sylvester(A, B, C) { + const n = B.size()[0]; + const m = A.size()[0]; + const sA = schur(A); + const F = sA.T; + const U = sA.U; + const sB = schur(multiply(-1, B)); + const G = sB.T; + const V = sB.U; + const D = multiply(multiply(transpose(U), C), V); + const all = range(0, m); + const y = []; + const hc = (a, b) => concat(a, b, 1); + const vc = (a, b) => concat(a, b, 0); + for (let k = 0; k < n; k++) { + if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) { + let RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1))); + for (let j = 0; j < k; j++) { + RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1))))); + } + const gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k)))); + const gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k)))); + const gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1)))); + const gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1)))); + const LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm))); + const yAux = lusolve(LHS, RHS); + y[k] = yAux.subset(index(range(0, m), 0)); + y[k + 1] = yAux.subset(index(range(m, 2 * m), 0)); + k++; + } else { + let RHS = subset(D, index(all, k)); + for (let j = 0; j < k; j++) { + RHS = add(RHS, multiply(y[j], subset(G, index(j, k)))); + } + const gkk = subset(G, index(k, k)); + const LHS = subtract(F, multiply(gkk, identity(m))); + y[k] = lusolve(LHS, RHS); + } + } + const Y = matrix(matrixFromColumns(...y)); + const X = multiply(U, multiply(Y, transpose(V))); + return X; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js new file mode 100644 index 0000000..30434b3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js @@ -0,0 +1,66 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSymbolicEqual = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'symbolicEqual'; +const dependencies = ['parse', 'simplify', 'typed', 'OperatorNode']; +const createSymbolicEqual = exports.createSymbolicEqual = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + parse, + simplify, + typed, + OperatorNode + } = _ref; + /** + * Attempts to determine if two expressions are symbolically equal, i.e. + * one is the result of valid algebraic manipulations on the other. + * Currently, this simply checks if the difference of the two expressions + * simplifies down to 0. So there are two important caveats: + * 1. whether two expressions are symbolically equal depends on the + * manipulations allowed. Therefore, this function takes an optional + * third argument, which are the options that control the behavior + * as documented for the `simplify()` function. + * 2. it is in general intractable to find the minimal simplification of + * an arbitrarily complicated expression. So while a `true` value + * of `symbolicEqual` ensures that the two expressions can be manipulated + * to match each other, a `false` value does not absolutely rule this out. + * + * Syntax: + * + * math.symbolicEqual(expr1, expr2) + * math.symbolicEqual(expr1, expr2, options) + * + * Examples: + * + * math.symbolicEqual('x*y', 'y*x') // Returns true + * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false + * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true + * math.symbolicEqual('abs(x)','x') // Returns false + * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true + * + * See also: + * + * simplify, evaluate + * + * @param {Node|string} expr1 The first expression to compare + * @param {Node|string} expr2 The second expression to compare + * @param {Object} [options] Optional option object, passed to simplify + * @returns {boolean} + * Returns true if a valid manipulation making the expressions equal + * is found. + */ + function _symbolicEqual(e1, e2) { + let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const diff = new OperatorNode('-', 'subtract', [e1, e2]); + const simplified = simplify(diff, {}, options); + return (0, _is.isConstantNode)(simplified) && !simplified.value; + } + return typed(name, { + 'Node, Node': _symbolicEqual, + 'Node, Node, Object': _symbolicEqual + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js new file mode 100644 index 0000000..dd1a1f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAbs = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +const name = 'abs'; +const dependencies = ['typed']; +const createAbs = exports.createAbs = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the absolute value of a number. For matrices, the function is + * evaluated element wise. + * + * Syntax: + * + * math.abs(x) + * + * Examples: + * + * math.abs(3.5) // returns number 3.5 + * math.abs(-4.2) // returns number 4.2 + * + * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2] + * + * See also: + * + * sign + * + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x + * A number or matrix for which to get the absolute value + * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} + * Absolute value of `x` + */ + return typed(name, { + number: _index.absNumber, + 'Complex | BigNumber | Fraction | Unit': x => x.abs(), + bigint: x => x < 0n ? -x : x, + // deep map collection, skip zeros since abs(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self, true)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/add.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/add.js new file mode 100644 index 0000000..65269f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/add.js @@ -0,0 +1,89 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAdd = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo04xSidSid = require("../../type/matrix/utils/matAlgo04xSidSid.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'add'; +const dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat']; +const createAdd = exports.createAdd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + addScalar, + equalScalar, + DenseMatrix, + SparseMatrix, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo04xSidSid = (0, _matAlgo04xSidSid.createMatAlgo04xSidSid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + /** + * Add two or more values, `x + y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.add(x, y) + * math.add(x, y, z, ...) + * + * Examples: + * + * math.add(2, 3) // returns number 5 + * math.add(2, 3, 4) // returns number 9 + * + * const a = math.complex(2, 3) + * const b = math.complex(-4, 1) + * math.add(a, b) // returns Complex -2 + 4i + * + * math.add([1, 2, 3], 4) // returns Array [5, 6, 7] + * + * const c = math.unit('5 cm') + * const d = math.unit('2.1 mm') + * math.add(c, d) // returns Unit 52.1 mm + * + * math.add("2.3", "4") // returns number 6.3 + * + * See also: + * + * subtract, sum + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y` + */ + return typed(name, { + 'any, any': addScalar, + 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => { + let result = self(x, y); + for (let i = 0; i < rest.length; i++) { + result = self(result, rest[i]); + } + return result; + }) + }, matrixAlgorithmSuite({ + elop: addScalar, + DS: matAlgo01xDSid, + SS: matAlgo04xSidSid, + Ss: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js new file mode 100644 index 0000000..4bfc050 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAddScalar = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'addScalar'; +const dependencies = ['typed']; +const createAddScalar = exports.createAddScalar = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Add two scalar values, `x + y`. + * This function is meant for internal use: it is used by the public function + * `add` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y` + * @private + */ + return typed(name, { + 'number, number': _index.addNumber, + 'Complex, Complex': function (x, y) { + return x.add(y); + }, + 'BigNumber, BigNumber': function (x, y) { + return x.plus(y); + }, + 'bigint, bigint': function (x, y) { + return x + y; + }, + 'Fraction, Fraction': function (x, y) { + return x.add(y); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (x.value === null || x.value === undefined) { + throw new Error('Parameter x contains a unit with undefined value'); + } + if (y.value === null || y.value === undefined) { + throw new Error('Parameter y contains a unit with undefined value'); + } + if (!x.equalBase(y)) throw new Error('Units do not match'); + const res = x.clone(); + res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value); + res.fixPrefix = false; + return res; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js new file mode 100644 index 0000000..63d962b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js @@ -0,0 +1,137 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCbrt = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _index = require("../../plain/number/index.js"); +const name = 'cbrt'; +const dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction']; +const createCbrt = exports.createCbrt = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + typed, + isNegative, + unaryMinus, + matrix, + Complex, + BigNumber, + Fraction + } = _ref; + /** + * Calculate the cubic root of a value. + * + * To avoid confusion with the matrix cube root, this function does not + * apply to matrices. For a matrix, to take the cube root elementwise, + * see the examples. + * + * Syntax: + * + * math.cbrt(x) + * math.cbrt(x, allRoots) + * + * Examples: + * + * math.cbrt(27) // returns 3 + * math.cube(3) // returns 27 + * math.cbrt(-64) // returns -4 + * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m + * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5] + * + * const x = math.complex('8i') + * math.cbrt(x) // returns Complex 1.7320508075689 + i + * math.cbrt(x, true) // returns Matrix [ + * // 1.7320508075689 + i + * // -1.7320508075689 + i + * // -2i + * // ] + * + * See also: + * + * square, sqrt, cube + * + * @param {number | BigNumber | Complex | Unit} x + * Value for which to calculate the cubic root. + * @param {boolean} [allRoots] Optional, false by default. Only applicable + * when `x` is a number or complex number. If true, all complex + * roots are returned, if false (default) the principal root is + * returned. + * @return {number | BigNumber | Complex | Unit} + * Returns the cubic root of `x` + */ + return typed(name, { + number: _index.cbrtNumber, + // note: signature 'number, boolean' is also supported, + // created by typed as it knows how to convert number to Complex + + Complex: _cbrtComplex, + 'Complex, boolean': _cbrtComplex, + BigNumber: function (x) { + return x.cbrt(); + }, + Unit: _cbrtUnit + }); + + /** + * Calculate the cubic root for a complex number + * @param {Complex} x + * @param {boolean} [allRoots] If true, the function will return an array + * with all three roots. If false or undefined, + * the principal root is returned. + * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x + * @private + */ + function _cbrtComplex(x, allRoots) { + // https://www.wikiwand.com/en/Cube_root#/Complex_numbers + + const arg3 = x.arg() / 3; + const abs = x.abs(); + + // principal root: + const principal = new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3).exp()); + if (allRoots) { + const all = [principal, new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())]; + return config.matrix === 'Array' ? all : matrix(all); + } else { + return principal; + } + } + + /** + * Calculate the cubic root for a Unit + * @param {Unit} x + * @return {Unit} Returns the cubic root of x + * @private + */ + function _cbrtUnit(x) { + if (x.value && (0, _is.isComplex)(x.value)) { + let result = x.clone(); + result.value = 1.0; + result = result.pow(1.0 / 3); // Compute the units + result.value = _cbrtComplex(x.value); // Compute the value + return result; + } else { + const negate = isNegative(x.value); + if (negate) { + x.value = unaryMinus(x.value); + } + + // TODO: create a helper function for this + let third; + if ((0, _is.isBigNumber)(x.value)) { + third = new BigNumber(1).div(3); + } else if ((0, _is.isFraction)(x.value)) { + third = new Fraction(1, 3); + } else { + third = 1 / 3; + } + const result = x.pow(third); + if (negate) { + result.value = unaryMinus(result.value); + } + return result; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js new file mode 100644 index 0000000..9a6a556 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js @@ -0,0 +1,168 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCeilNumber = exports.createCeil = void 0; +var _decimal = _interopRequireDefault(require("decimal.js")); +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +const name = 'ceil'; +const dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']; +const createCeilNumber = exports.createCeilNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config', 'round'], _ref => { + let { + typed, + config, + round + } = _ref; + return typed(name, { + number: function (x) { + if ((0, _number.nearlyEqual)(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return Math.ceil(x); + } + }, + 'number, number': function (x, n) { + if ((0, _number.nearlyEqual)(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + let [number, exponent] = `${x}e`.split('e'); + const result = Math.ceil(Number(`${number}e${Number(exponent) + n}`)); + [number, exponent] = `${result}e`.split('e'); + return Number(`${number}e${Number(exponent) - n}`); + } + } + }); +}); +const createCeil = exports.createCeil = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref2 => { + let { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const ceilNumber = createCeilNumber({ + typed, + config, + round + }); + /** + * Round a value towards plus infinity + * If `x` is complex, both real and imaginary part are rounded towards plus infinity. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.ceil(x) + * math.ceil(x, n) + * + * Examples: + * + * math.ceil(3.2) // returns number 4 + * math.ceil(3.8) // returns number 4 + * math.ceil(-4.2) // returns number -4 + * math.ceil(-4.7) // returns number -4 + * + * math.ceil(3.212, 2) // returns number 3.22 + * math.ceil(3.288, 2) // returns number 3.29 + * math.ceil(-4.212, 2) // returns number -4.21 + * math.ceil(-4.782, 2) // returns number -4.78 + * + * const c = math.complex(3.24, -2.71) + * math.ceil(c) // returns Complex 4 - 2i + * math.ceil(c, 1) // returns Complex 3.3 - 2.7i + * + * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4] + * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7] + * + * See also: + * + * floor, fix, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('ceil', { + number: ceilNumber.signatures.number, + 'number,number': ceilNumber.signatures['number,number'], + Complex: function (x) { + return x.ceil(); + }, + 'Complex, number': function (x, n) { + return x.ceil(n); + }, + 'Complex, BigNumber': function (x, n) { + return x.ceil(n.toNumber()); + }, + BigNumber: function (x) { + if ((0, _nearlyEqual.nearlyEqual)(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return x.ceil(); + } + }, + 'BigNumber, BigNumber': function (x, n) { + if ((0, _nearlyEqual.nearlyEqual)(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + return x.toDecimalPlaces(n.toNumber(), _decimal.default.ROUND_CEIL); + } + }, + Fraction: function (x) { + return x.ceil(); + }, + 'Fraction, number': function (x, n) { + return x.ceil(n); + }, + 'Fraction, BigNumber': function (x, n) { + return x.ceil(n.toNumber()); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since ceil(0) = 0 + return (0, _collection.deepMap)(x, self, true); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since ceil(0) = 0 + return (0, _collection.deepMap)(x, i => self(i, n), true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js new file mode 100644 index 0000000..e28c103 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCube = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'cube'; +const dependencies = ['typed']; +const createCube = exports.createCube = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the cube of a value, `x * x * x`. + * To avoid confusion with `pow(M,3)`, this function does not apply to matrices. + * If you wish to cube every entry of a matrix, see the examples. + * + * Syntax: + * + * math.cube(x) + * + * Examples: + * + * math.cube(2) // returns number 8 + * math.pow(2, 3) // returns number 8 + * math.cube(4) // returns number 64 + * 4 * 4 * 4 // returns number 64 + * + * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64] + * + * See also: + * + * multiply, square, pow, cbrt + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x + */ + return typed(name, { + number: _index.cubeNumber, + Complex: function (x) { + return x.mul(x).mul(x); // Is faster than pow(x, 3) + }, + BigNumber: function (x) { + return x.times(x).times(x); + }, + bigint: function (x) { + return x * x * x; + }, + Fraction: function (x) { + return x.pow(3); // Is faster than mul()mul()mul() + }, + Unit: function (x) { + return x.pow(3); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js new file mode 100644 index 0000000..22829ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDivide = void 0; +var _factory = require("../../utils/factory.js"); +var _object = require("../../utils/object.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +const name = 'divide'; +const dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv']; +const createDivide = exports.createDivide = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + multiply, + equalScalar, + divideScalar, + inv + } = _ref; + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + + /** + * Divide two values, `x / y`. + * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`. + * + * Syntax: + * + * math.divide(x, y) + * + * Examples: + * + * math.divide(2, 3) // returns number 0.6666666666666666 + * + * const a = math.complex(5, 14) + * const b = math.complex(4, 1) + * math.divide(a, b) // returns Complex 2 + 3i + * + * const c = [[7, -6], [13, -4]] + * const d = [[1, 2], [4, 3]] + * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]] + * + * const e = math.unit('18 km') + * math.divide(e, 4.5) // returns Unit 4 km + * + * See also: + * + * multiply + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y` + */ + return typed('divide', (0, _object.extend)({ + // we extend the signatures of divideScalar with signatures dealing with matrices + + 'Array | Matrix, Array | Matrix': function (x, y) { + // TODO: implement matrix right division using pseudo inverse + // https://www.mathworks.nl/help/matlab/ref/mrdivide.html + // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html + // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour + return multiply(x, inv(y)); + }, + 'DenseMatrix, any': function (x, y) { + return matAlgo14xDs(x, y, divideScalar, false); + }, + 'SparseMatrix, any': function (x, y) { + return matAlgo11xS0s(x, y, divideScalar, false); + }, + 'Array, any': function (x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf(); + }, + 'any, Array | Matrix': function (x, y) { + return multiply(x, inv(y)); + } + }, divideScalar.signatures)); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js new file mode 100644 index 0000000..49fd13d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDivideScalar = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'divideScalar'; +const dependencies = ['typed', 'numeric']; +const createDivideScalar = exports.createDivideScalar = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + numeric + } = _ref; + /** + * Divide two scalar values, `x / y`. + * This function is meant for internal use: it is used by the public functions + * `divide` and `inv`. + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator + * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y` + * @private + */ + return typed(name, { + 'number, number': function (x, y) { + return x / y; + }, + 'Complex, Complex': function (x, y) { + return x.div(y); + }, + 'BigNumber, BigNumber': function (x, y) { + return x.div(y); + }, + 'bigint, bigint': function (x, y) { + return x / y; + }, + 'Fraction, Fraction': function (x, y) { + return x.div(y); + }, + 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y), + 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js new file mode 100644 index 0000000..a620bed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDotDivide = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'dotDivide'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat']; +const createDotDivide = exports.createDotDivide = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + divideScalar, + DenseMatrix, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Divide two matrices element wise. The function accepts both matrices and + * scalar values. + * + * Syntax: + * + * math.dotDivide(x, y) + * + * Examples: + * + * math.dotDivide(2, 4) // returns 0.5 + * + * a = [[9, 5], [6, 1]] + * b = [[3, 2], [5, 2]] + * + * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]] + * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]] + * + * See also: + * + * divide, multiply, dotMultiply + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: divideScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js new file mode 100644 index 0000000..f98805d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDotMultiply = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo09xS0Sf = require("../../type/matrix/utils/matAlgo09xS0Sf.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'dotMultiply'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat']; +const createDotMultiply = exports.createDotMultiply = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + multiplyScalar, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo09xS0Sf = (0, _matAlgo09xS0Sf.createMatAlgo09xS0Sf)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Multiply two matrices element wise. The function accepts both matrices and + * scalar values. + * + * Syntax: + * + * math.dotMultiply(x, y) + * + * Examples: + * + * math.dotMultiply(2, 4) // returns 8 + * + * a = [[9, 5], [6, 1]] + * b = [[3, 2], [5, 2]] + * + * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]] + * math.multiply(a, b) // returns [[52, 28], [23, 14]] + * + * See also: + * + * multiply, divide, dotDivide + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: multiplyScalar, + SS: matAlgo09xS0Sf, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js new file mode 100644 index 0000000..468a73d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDotPow = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'dotPow'; +const dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat']; +const createDotPow = exports.createDotPow = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar, + matrix, + pow, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const powScalarSignatures = {}; + for (const signature in pow.signatures) { + if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) { + if (!signature.includes('Matrix') && !signature.includes('Array')) { + powScalarSignatures[signature] = pow.signatures[signature]; + } + } + } + const powScalar = typed(powScalarSignatures); + + /** + * Calculates the power of x to y element wise. + * + * Syntax: + * + * math.dotPow(x, y) + * + * Examples: + * + * math.dotPow(2, 3) // returns number 8 + * + * const a = [[1, 2], [4, 3]] + * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]] + * math.pow(a, 2) // returns Array [[9, 8], [16, 17]] + * + * See also: + * + * pow, sqrt, multiply + * + * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base + * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent + * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: powScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js new file mode 100644 index 0000000..24670a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createExp = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'exp'; +const dependencies = ['typed']; +const createExp = exports.createExp = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the exponential of a value. + * For matrices, if you want the matrix exponential of square matrix, use + * the `expm` function; if you want to take the exponential of each element, + * see the examples. + * + * Syntax: + * + * math.exp(x) + * + * Examples: + * + * math.exp(2) // returns number 7.3890560989306495 + * math.pow(math.e, 2) // returns number 7.3890560989306495 + * math.log(math.exp(2)) // returns number 2 + * + * math.map([1, 2, 3], math.exp) + * // returns Array [ + * // 2.718281828459045, + * // 7.3890560989306495, + * // 20.085536923187668 + * // ] + * + * See also: + * + * expm1, expm, log, pow + * + * @param {number | BigNumber | Complex} x A number to exponentiate + * @return {number | BigNumber | Complex} Exponential of `x` + */ + return typed(name, { + number: _index.expNumber, + Complex: function (x) { + return x.exp(); + }, + BigNumber: function (x) { + return x.exp(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js new file mode 100644 index 0000000..4a91a7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createExpm1 = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'expm1'; +const dependencies = ['typed', 'Complex']; +const createExpm1 = exports.createExpm1 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Complex + } = _ref; + /** + * Calculate the value of subtracting 1 from the exponential value. + * This function is more accurate than `math.exp(x)-1` when `x` is near 0 + * To avoid ambiguity with the matrix exponential `expm`, this function + * does not operate on matrices; if you wish to apply it elementwise, see + * the examples. + * + * Syntax: + * + * math.expm1(x) + * + * Examples: + * + * math.expm1(2) // returns number 6.38905609893065 + * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495 + * math.expm1(1e-8) // returns number 1.0000000050000001e-8 + * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9 + * math.log(math.expm1(2) + 1) // returns number 2 + * + * math.map([1, 2, 3], math.expm1) + * // returns Array [ + * // 1.718281828459045, + * // 6.3890560989306495, + * // 19.085536923187668 + * // ] + * + * See also: + * + * exp, expm, log, pow + * + * @param {number | BigNumber | Complex} x The number to exponentiate + * @return {number | BigNumber | Complex} Exponential of `x`, minus one + */ + return typed(name, { + number: _index.expm1Number, + Complex: function (x) { + const r = Math.exp(x.re); + return new Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im)); + }, + BigNumber: function (x) { + return x.exp().minus(1); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js new file mode 100644 index 0000000..8da3856 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js @@ -0,0 +1,132 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFixNumber = exports.createFix = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +const name = 'fix'; +const dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix']; +const createFixNumber = exports.createFixNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'ceil', 'floor'], _ref => { + let { + typed, + ceil, + floor + } = _ref; + return typed(name, { + number: function (x) { + return x > 0 ? floor(x) : ceil(x); + }, + 'number, number': function (x, n) { + return x > 0 ? floor(x, n) : ceil(x, n); + } + }); +}); +const createFix = exports.createFix = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref2 => { + let { + typed, + Complex, + matrix, + ceil, + floor, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const fixNumber = createFixNumber({ + typed, + ceil, + floor + }); + /** + * Round a value towards zero. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.fix(x) + * math.fix(x,n) + * + * Examples: + * + * math.fix(3.2) // returns number 3 + * math.fix(3.8) // returns number 3 + * math.fix(-4.2) // returns number -4 + * math.fix(-4.7) // returns number -4 + * + * math.fix(3.12, 1) // returns number 3.1 + * math.fix(3.18, 1) // returns number 3.1 + * math.fix(-4.12, 1) // returns number -4.1 + * math.fix(-4.17, 1) // returns number -4.1 + * + * const c = math.complex(3.22, -2.78) + * math.fix(c) // returns Complex 3 - 2i + * math.fix(c, 1) // returns Complex 3.2 -2.7i + * + * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4] + * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7] + * + * See also: + * + * ceil, floor, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('fix', { + number: fixNumber.signatures.number, + 'number, number | BigNumber': fixNumber.signatures['number,number'], + Complex: function (x) { + return new Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im)); + }, + 'Complex, number': function (x, n) { + return new Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n)); + }, + 'Complex, BigNumber': function (x, bn) { + const n = bn.toNumber(); + return new Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n)); + }, + BigNumber: function (x) { + return x.isNegative() ? ceil(x) : floor(x); + }, + 'BigNumber, number | BigNumber': function (x, n) { + return x.isNegative() ? ceil(x, n) : floor(x, n); + }, + Fraction: function (x) { + return x.s < 0 ? x.ceil() : x.floor(); + }, + 'Fraction, number | BigNumber': function (x, n) { + return x.s < 0 ? ceil(x, n) : floor(x, n); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since fix(0) = 0 + return (0, _collection.deepMap)(x, self, true); + }), + 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since fix(0) = 0 + return (0, _collection.deepMap)(x, i => self(i, n), true); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js new file mode 100644 index 0000000..25983c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js @@ -0,0 +1,171 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFloorNumber = exports.createFloor = void 0; +var _decimal = _interopRequireDefault(require("decimal.js")); +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +const name = 'floor'; +const dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']; +const createFloorNumber = exports.createFloorNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config', 'round'], _ref => { + let { + typed, + config, + round + } = _ref; + return typed(name, { + number: function (x) { + if ((0, _number.nearlyEqual)(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return Math.floor(x); + } + }, + 'number, number': function (x, n) { + if ((0, _number.nearlyEqual)(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + let [number, exponent] = `${x}e`.split('e'); + const result = Math.floor(Number(`${number}e${Number(exponent) + n}`)); + [number, exponent] = `${result}e`.split('e'); + return Number(`${number}e${Number(exponent) - n}`); + } + } + }); +}); +const createFloor = exports.createFloor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref2 => { + let { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const floorNumber = createFloorNumber({ + typed, + config, + round + }); + /** + * Round a value towards minus infinity. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.floor(x) + * math.floor(x, n) + * + * Examples: + * + * math.floor(3.2) // returns number 3 + * math.floor(3.8) // returns number 3 + * math.floor(-4.2) // returns number -5 + * math.floor(-4.7) // returns number -5 + * + * math.floor(3.212, 2) // returns number 3.21 + * math.floor(3.288, 2) // returns number 3.28 + * math.floor(-4.212, 2) // returns number -4.22 + * math.floor(-4.782, 2) // returns number -4.79 + * + * const c = math.complex(3.24, -2.71) + * math.floor(c) // returns Complex 3 - 3i + * math.floor(c, 1) // returns Complex 3.2 -2.8i + * + * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5] + * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8] + * + * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283] + * + * // Note that floor(array, array) currently not implemented. + * + * See also: + * + * ceil, fix, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('floor', { + number: floorNumber.signatures.number, + 'number,number': floorNumber.signatures['number,number'], + Complex: function (x) { + return x.floor(); + }, + 'Complex, number': function (x, n) { + return x.floor(n); + }, + 'Complex, BigNumber': function (x, n) { + return x.floor(n.toNumber()); + }, + BigNumber: function (x) { + if ((0, _nearlyEqual.nearlyEqual)(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return x.floor(); + } + }, + 'BigNumber, BigNumber': function (x, n) { + if ((0, _nearlyEqual.nearlyEqual)(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + return x.toDecimalPlaces(n.toNumber(), _decimal.default.ROUND_FLOOR); + } + }, + Fraction: function (x) { + return x.floor(); + }, + 'Fraction, number': function (x, n) { + return x.floor(n); + }, + 'Fraction, BigNumber': function (x, n) { + return x.floor(n.toNumber()); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since floor(0) = 0 + return (0, _collection.deepMap)(x, self, true); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since ceil(0) = 0 + return (0, _collection.deepMap)(x, i => self(i, n), true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js new file mode 100644 index 0000000..0f9276d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js @@ -0,0 +1,159 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createGcd = void 0; +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _mod = require("./mod.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo04xSidSid = require("../../type/matrix/utils/matAlgo04xSidSid.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _ArgumentsError = require("../../error/ArgumentsError.js"); +const name = 'gcd'; +const dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat']; +const gcdTypes = 'number | BigNumber | Fraction | Matrix | Array'; +const gcdManyTypesSignature = `${gcdTypes}, ${gcdTypes}, ...${gcdTypes}`; +function is1d(array) { + return !array.some(element => Array.isArray(element)); +} +const createGcd = exports.createGcd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + config, + round, + equalScalar, + zeros, + BigNumber, + DenseMatrix, + concat + } = _ref; + const mod = (0, _mod.createMod)({ + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + }); + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo04xSidSid = (0, _matAlgo04xSidSid.createMatAlgo04xSidSid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Calculate the greatest common divisor for two or more values or arrays. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.gcd(a, b) + * math.gcd(a, b, c, ...) + * + * Examples: + * + * math.gcd(8, 12) // returns 4 + * math.gcd(-4, 6) // returns 2 + * math.gcd(25, 15, -10) // returns 5 + * + * math.gcd([8, -4], [12, 6]) // returns [4, 2] + * + * See also: + * + * lcm, xgcd + * + * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers + * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor + */ + return typed(name, { + 'number, number': _gcdNumber, + 'BigNumber, BigNumber': _gcdBigNumber, + 'Fraction, Fraction': (x, y) => x.gcd(y) + }, matrixAlgorithmSuite({ + SS: matAlgo04xSidSid, + DS: matAlgo01xDSid, + Ss: matAlgo10xSids + }), { + [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => { + let res = self(a, b); + for (let i = 0; i < args.length; i++) { + res = self(res, args[i]); + } + return res; + }), + Array: typed.referToSelf(self => array => { + if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) { + return self(...array[0]); + } + if (is1d(array)) { + return self(...array); + } + throw new _ArgumentsError.ArgumentsError('gcd() supports only 1d matrices!'); + }), + Matrix: typed.referToSelf(self => matrix => { + return self(matrix.toArray()); + }) + }); + + /** + * Calculate gcd for numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the greatest common denominator of a and b + * @private + */ + function _gcdNumber(a, b) { + if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + let r; + while (b !== 0) { + r = mod(a, b); + a = b; + b = r; + } + return a < 0 ? -a : a; + } + + /** + * Calculate gcd for BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @returns {BigNumber} Returns greatest common denominator of a and b + * @private + */ + function _gcdBigNumber(a, b) { + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + const zero = new BigNumber(0); + while (!b.isZero()) { + const r = mod(a, b); + a = b; + b = r; + } + return a.lt(zero) ? a.neg() : a; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js new file mode 100644 index 0000000..2bb014c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js @@ -0,0 +1,83 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createHypot = void 0; +var _factory = require("../../utils/factory.js"); +var _array = require("../../utils/array.js"); +var _is = require("../../utils/is.js"); +const name = 'hypot'; +const dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive']; +const createHypot = exports.createHypot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + addScalar, + divideScalar, + multiplyScalar, + sqrt, + smaller, + isPositive + } = _ref; + /** + * Calculate the hypotenuse of a list with values. The hypotenuse is defined as: + * + * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) + * + * For matrix input, the hypotenuse is calculated for all values in the matrix. + * + * Syntax: + * + * math.hypot(a, b, ...) + * math.hypot([a, b, c, ...]) + * + * Examples: + * + * math.hypot(3, 4) // 5 + * math.hypot(3, 4, 5) // 7.0710678118654755 + * math.hypot([3, 4, 5]) // 7.0710678118654755 + * math.hypot(-2) // 2 + * + * See also: + * + * abs, norm + * + * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix. + * Matrix and Array input is flattened and returns a + * single number for the whole matrix. + * @return {number | BigNumber} Returns the hypothenusa of the input values. + */ + return typed(name, { + '... number | BigNumber': _hypot, + Array: _hypot, + Matrix: M => _hypot((0, _array.flatten)(M.toArray())) + }); + + /** + * Calculate the hypotenuse for an Array with values + * @param {Array.} args + * @return {number | BigNumber} Returns the result + * @private + */ + function _hypot(args) { + // code based on `hypot` from es6-shim: + // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633 + let result = 0; + let largest = 0; + for (let i = 0; i < args.length; i++) { + if ((0, _is.isComplex)(args[i])) { + throw new TypeError('Unexpected type of argument to hypot'); + } + const value = abs(args[i]); + if (smaller(largest, value)) { + result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value))); + result = addScalar(result, 1); + largest = value; + } else { + result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value); + } + } + return multiplyScalar(largest, sqrt(result)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js new file mode 100644 index 0000000..d6b8ed2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createInvmod = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'invmod'; +const dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger']; +const createInvmod = exports.createInvmod = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + BigNumber, + xgcd, + equal, + smaller, + mod, + add, + isInteger + } = _ref; + /** + * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax ≣ 1 (mod b)` + * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse. + * + * Syntax: + * + * math.invmod(a, b) + * + * Examples: + * + * math.invmod(8, 12) // returns NaN + * math.invmod(7, 13) // returns 2 + * math.invmod(15151, 15122) // returns 10429 + * + * See also: + * + * gcd, xgcd + * + * @param {number | BigNumber} a An integer number + * @param {number | BigNumber} b An integer number + * @return {number | BigNumber } Returns an integer number + * where `invmod(a,b)*a ≣ 1 (mod b)` + */ + return typed(name, { + 'number, number': invmod, + 'BigNumber, BigNumber': invmod + }); + function invmod(a, b) { + if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers'); + a = mod(a, b); + if (equal(b, 0)) throw new Error('Divisor must be non zero'); + let res = xgcd(a, b); + res = res.valueOf(); + let [gcd, inv] = res; + if (!equal(gcd, BigNumber(1))) return NaN; + inv = mod(inv, b); + if (smaller(inv, BigNumber(0))) inv = add(inv, b); + return inv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js new file mode 100644 index 0000000..a3f30c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js @@ -0,0 +1,116 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLcm = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo06xS0S = require("../../type/matrix/utils/matAlgo06xS0S0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'lcm'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'concat']; +const createLcm = exports.createLcm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo06xS0S0 = (0, _matAlgo06xS0S.createMatAlgo06xS0S0)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const lcmTypes = 'number | BigNumber | Fraction | Matrix | Array'; + const lcmManySignature = {}; + lcmManySignature[`${lcmTypes}, ${lcmTypes}, ...${lcmTypes}`] = typed.referToSelf(self => (a, b, args) => { + let res = self(a, b); + for (let i = 0; i < args.length; i++) { + res = self(res, args[i]); + } + return res; + }); + + /** + * Calculate the least common multiple for two or more values or arrays. + * + * lcm is defined as: + * + * lcm(a, b) = abs(a * b) / gcd(a, b) + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.lcm(a, b) + * math.lcm(a, b, c, ...) + * + * Examples: + * + * math.lcm(4, 6) // returns 12 + * math.lcm(6, 21) // returns 42 + * math.lcm(6, 21, 5) // returns 210 + * + * math.lcm([4, 6], [6, 21]) // returns [12, 42] + * + * See also: + * + * gcd, xgcd + * + * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers + * @return {number | BigNumber | Array | Matrix} The least common multiple + */ + return typed(name, { + 'number, number': _index.lcmNumber, + 'BigNumber, BigNumber': _lcmBigNumber, + 'Fraction, Fraction': (x, y) => x.lcm(y) + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + }), lcmManySignature); + + /** + * Calculate lcm for two BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @returns {BigNumber} Returns the least common multiple of a and b + * @private + */ + function _lcmBigNumber(a, b) { + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function lcm must be integer numbers'); + } + if (a.isZero()) { + return a; + } + if (b.isZero()) { + return b; + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + // evaluate lcm here inline to reduce overhead + const prod = a.times(b); + while (!b.isZero()) { + const t = b; + b = a.mod(t); + a = t; + } + return prod.div(a).abs(); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log.js new file mode 100644 index 0000000..278834a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLog = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'log'; +const dependencies = ['config', 'typed', 'divideScalar', 'Complex']; +const createLog = exports.createLog = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + divideScalar, + Complex + } = _ref; + /** + * Calculate the logarithm of a value. + * + * To avoid confusion with the matrix logarithm, this function does not + * apply to matrices. + * + * Syntax: + * + * math.log(x) + * math.log(x, base) + * + * Examples: + * + * math.log(3.5) // returns 1.252762968495368 + * math.exp(math.log(2.4)) // returns 2.4 + * + * math.pow(10, 4) // returns 10000 + * math.log(10000, 10) // returns 4 + * math.log(10000) / math.log(10) // returns 4 + * + * math.log(1024, 2) // returns 10 + * math.pow(2, 10) // returns 1024 + * + * See also: + * + * exp, log2, log10, log1p + * + * @param {number | BigNumber | Complex} x + * Value for which to calculate the logarithm. + * @param {number | BigNumber | Complex} [base=e] + * Optional base for the logarithm. If not provided, the natural + * logarithm of `x` is calculated. + * @return {number | BigNumber | Complex} + * Returns the logarithm of `x` + */ + return typed(name, { + number: function (x) { + if (x >= 0 || config.predictable) { + return (0, _index.logNumber)(x); + } else { + // negative value -> complex value computation + return new Complex(x, 0).log(); + } + }, + Complex: function (x) { + return x.log(); + }, + BigNumber: function (x) { + if (!x.isNegative() || config.predictable) { + return x.ln(); + } else { + // downgrade to number, return Complex valued result + return new Complex(x.toNumber(), 0).log(); + } + }, + 'any, any': typed.referToSelf(self => (x, base) => { + // calculate logarithm for a specified base, log(x, base) + return divideScalar(self(x), self(base)); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js new file mode 100644 index 0000000..8125e79 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLog10 = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +const name = 'log10'; +const dependencies = ['typed', 'config', 'Complex']; +const createLog10 = exports.createLog10 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log10(x) + * + * Examples: + * + * math.log10(0.00001) // returns -5 + * math.log10(10000) // returns 4 + * math.log(10000) / math.log(10) // returns 4 + * math.pow(10, 4) // returns 10000 + * + * See also: + * + * exp, log, log1p, log2 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the 10-base logarithm of `x` + */ + return typed(name, { + number: function (x) { + if (x >= 0 || config.predictable) { + return (0, _index.log10Number)(x); + } else { + // negative value -> complex value computation + return new Complex(x, 0).log().div(Math.LN10); + } + }, + Complex: function (x) { + return new Complex(x).log().div(Math.LN10); + }, + BigNumber: function (x) { + if (!x.isNegative() || config.predictable) { + return x.log(); + } else { + // downgrade to number, return Complex valued result + return new Complex(x.toNumber(), 0).log().div(Math.LN10); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js new file mode 100644 index 0000000..e68a466 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js @@ -0,0 +1,87 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLog1p = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +const name = 'log1p'; +const dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex']; +const createLog1p = exports.createLog1p = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + divideScalar, + log, + Complex + } = _ref; + /** + * Calculate the logarithm of a `value+1`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log1p(x) + * math.log1p(x, base) + * + * Examples: + * + * math.log1p(2.5) // returns 1.252762968495368 + * math.exp(math.log1p(1.4)) // returns 2.4 + * + * math.pow(10, 4) // returns 10000 + * math.log1p(9999, 10) // returns 4 + * math.log1p(9999) / math.log(10) // returns 4 + * + * See also: + * + * exp, log, log2, log10 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm of `x+1`. + * @param {number | BigNumber | Complex} [base=e] + * Optional base for the logarithm. If not provided, the natural + * logarithm of `x+1` is calculated. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the logarithm of `x+1` + */ + return typed(name, { + number: function (x) { + if (x >= -1 || config.predictable) { + return (0, _number.log1p)(x); + } else { + // negative value -> complex value computation + return _log1pComplex(new Complex(x, 0)); + } + }, + Complex: _log1pComplex, + BigNumber: function (x) { + const y = x.plus(1); + if (!y.isNegative() || config.predictable) { + return y.ln(); + } else { + // downgrade to number, return Complex valued result + return _log1pComplex(new Complex(x.toNumber(), 0)); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)), + 'any, any': typed.referToSelf(self => (x, base) => { + // calculate logarithm for a specified base, log1p(x, base) + return divideScalar(self(x), log(base)); + }) + }); + + /** + * Calculate the natural logarithm of a complex number + 1 + * @param {Complex} x + * @returns {Complex} + * @private + */ + function _log1pComplex(x) { + const xRe1p = x.re + 1; + return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js new file mode 100644 index 0000000..f995b9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js @@ -0,0 +1,74 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLog2 = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +const name = 'log2'; +const dependencies = ['typed', 'config', 'Complex']; +const createLog2 = exports.createLog2 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log2(x) + * + * Examples: + * + * math.log2(0.03125) // returns -5 + * math.log2(16) // returns 4 + * math.log2(16) / math.log2(2) // returns 4 + * math.pow(2, 4) // returns 16 + * + * See also: + * + * exp, log, log1p, log10 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the 2-base logarithm of `x` + */ + return typed(name, { + number: function (x) { + if (x >= 0 || config.predictable) { + return (0, _index.log2Number)(x); + } else { + // negative value -> complex value computation + return _log2Complex(new Complex(x, 0)); + } + }, + Complex: _log2Complex, + BigNumber: function (x) { + if (!x.isNegative() || config.predictable) { + return x.log(2); + } else { + // downgrade to number, return Complex valued result + return _log2Complex(new Complex(x.toNumber(), 0)); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); + + /** + * Calculate log2 for a complex value + * @param {Complex} x + * @returns {Complex} + * @private + */ + function _log2Complex(x) { + const newX = Math.sqrt(x.re * x.re + x.im * x.im); + return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js new file mode 100644 index 0000000..3fdc081 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js @@ -0,0 +1,139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMod = void 0; +var _factory = require("../../utils/factory.js"); +var _floor = require("./floor.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo05xSfSf = require("../../type/matrix/utils/matAlgo05xSfSf.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'mod'; +const dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +const createMod = exports.createMod = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + const floor = (0, _floor.createFloor)({ + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + }); + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo05xSfSf = (0, _matAlgo05xSfSf.createMatAlgo05xSfSf)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Calculates the modulus, the remainder of an integer division. + * + * For matrices, the function is evaluated element wise. + * + * The modulus is defined as: + * + * x - y * floor(x / y) + * + * See https://en.wikipedia.org/wiki/Modulo_operation. + * + * Syntax: + * + * math.mod(x, y) + * + * Examples: + * + * math.mod(8, 3) // returns 2 + * math.mod(11, 2) // returns 1 + * + * function isOdd(x) { + * return math.mod(x, 2) != 0 + * } + * + * isOdd(2) // returns false + * isOdd(3) // returns true + * + * See also: + * + * divide + * + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor + * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`. + */ + return typed(name, { + 'number, number': _modNumber, + 'BigNumber, BigNumber': function (x, y) { + return y.isZero() ? x : x.sub(y.mul(floor(x.div(y)))); + }, + 'bigint, bigint': function (x, y) { + if (y === 0n) { + return x; + } + if (x < 0) { + const m = x % y; + return m === 0n ? m : m + y; + } + return x % y; + }, + 'Fraction, Fraction': function (x, y) { + return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y)))); + } + }, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); + + /** + * Calculate the modulus of two numbers + * @param {number} x + * @param {number} y + * @returns {number} res + * @private + */ + function _modNumber(x, y) { + // We don't use JavaScript's % operator here as this doesn't work + // correctly for x < 0 and x === 0 + // see https://en.wikipedia.org/wiki/Modulo_operation + + // We use mathjs floor to handle errors associated with + // precision float approximation + return y === 0 ? x : x - y * floor(x / y); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js new file mode 100644 index 0000000..fe11843 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js @@ -0,0 +1,886 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMultiply = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +const name = 'multiply'; +const dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot']; +const createMultiply = exports.createMultiply = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + addScalar, + multiplyScalar, + equalScalar, + dot + } = _ref; + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + function _validateMatrixDimensions(size1, size2) { + // check left operand dimensions + switch (size1.length) { + case 1: + // check size2 + switch (size2.length) { + case 1: + // Vector x Vector + if (size1[0] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length'); + } + break; + case 2: + // Vector x Matrix + if (size1[0] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)'); + } + break; + case 2: + // check size2 + switch (size2.length) { + case 1: + // Matrix x Vector + if (size1[1] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')'); + } + break; + case 2: + // Matrix x Matrix + if (size1[1] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)'); + } + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (N) + * @param {Matrix} b Dense Vector (N) + * + * @return {number} Scalar value + */ + function _multiplyVectorVector(a, b, n) { + // check empty vector + if (n === 0) { + throw new Error('Cannot multiply two empty vectors'); + } + return dot(a, b); + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (M) + * @param {Matrix} b Matrix (MxN) + * + * @return {Matrix} Dense Vector (N) + */ + function _multiplyVectorMatrix(a, b) { + // process storage + if (b.storage() !== 'dense') { + throw new Error('Support for SparseMatrix not implemented'); + } + return _multiplyVectorDenseMatrix(a, b); + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (M) + * @param {Matrix} b Dense Matrix (MxN) + * + * @return {Matrix} Dense Vector (N) + */ + function _multiplyVectorDenseMatrix(a, b) { + // a dense + const adata = a._data; + const asize = a._size; + const adt = a._datatype || a.getDataType(); + // b dense + const bdata = b._data; + const bsize = b._size; + const bdt = b._datatype || b.getDataType(); + // rows & columns + const alength = asize[0]; + const bcolumns = bsize[1]; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + const c = []; + + // loop matrix columns + for (let j = 0; j < bcolumns; j++) { + // sum (do not initialize it with zero) + let sum = mf(adata[0], bdata[0][j]); + // loop vector + for (let i = 1; i < alength; i++) { + // multiply & accumulate + sum = af(sum, mf(adata[i], bdata[i][j])); + } + c[j] = sum; + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a Matrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} Dense Vector (M) + */ + const _multiplyMatrixVector = typed('_multiplyMatrixVector', { + 'DenseMatrix, any': _multiplyDenseMatrixVector, + 'SparseMatrix, any': _multiplySparseMatrixVector + }); + + /** + * C = A * B + * + * @param {Matrix} a Matrix (MxN) + * @param {Matrix} b Matrix (NxC) + * + * @return {Matrix} Matrix (MxC) + */ + const _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', { + 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix, + 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix, + 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix, + 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix + }); + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} Dense Vector (M) + */ + function _multiplyDenseMatrixVector(a, b) { + // a dense + const adata = a._data; + const asize = a._size; + const adt = a._datatype || a.getDataType(); + // b dense + const bdata = b._data; + const bdt = b._datatype || b.getDataType(); + // rows & columns + const arows = asize[0]; + const acolumns = asize[1]; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + const c = []; + + // loop matrix a rows + for (let i = 0; i < arows; i++) { + // current row + const row = adata[i]; + // sum (do not initialize it with zero) + let sum = mf(row[0], bdata[0]); + // loop matrix a columns + for (let j = 1; j < acolumns; j++) { + // multiply & accumulate + sum = af(sum, mf(row[j], bdata[j])); + } + c[i] = sum; + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [arows], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b DenseMatrix (NxC) + * + * @return {Matrix} DenseMatrix (MxC) + */ + function _multiplyDenseMatrixDenseMatrix(a, b) { + // getDataType() + // a dense + const adata = a._data; + const asize = a._size; + const adt = a._datatype || a.getDataType(); + // b dense + const bdata = b._data; + const bsize = b._size; + const bdt = b._datatype || b.getDataType(); + // rows & columns + const arows = asize[0]; + const acolumns = asize[1]; + const bcolumns = bsize[1]; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + const c = []; + + // loop matrix a rows + for (let i = 0; i < arows; i++) { + // current row + const row = adata[i]; + // initialize row array + c[i] = []; + // loop matrix b columns + for (let j = 0; j < bcolumns; j++) { + // sum (avoid initializing sum to zero) + let sum = mf(row[0], bdata[0][j]); + // loop matrix a columns + for (let x = 1; x < acolumns; x++) { + // multiply & accumulate + sum = af(sum, mf(row[x], bdata[x][j])); + } + c[i][j] = sum; + } + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b SparseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplyDenseMatrixSparseMatrix(a, b) { + // a dense + const adata = a._data; + const asize = a._size; + const adt = a._datatype || a.getDataType(); + // b sparse + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + // validate b matrix + if (!bvalues) { + throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix'); + } + // rows & columns + const arows = asize[0]; + const bcolumns = bsize[1]; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + // equalScalar signature to use + let eq = equalScalar; + // zero value + let zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // result + const cvalues = []; + const cindex = []; + const cptr = []; + // c matrix + const c = b.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // loop b columns + for (let jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // indeces in column jb + const kb0 = bptr[jb]; + const kb1 = bptr[jb + 1]; + // do not process column jb if no data exists + if (kb1 > kb0) { + // last row mark processed + let last = 0; + // loop a rows + for (let i = 0; i < arows; i++) { + // column mark + const mark = i + 1; + // C[i, jb] + let cij; + // values in b column j + for (let kb = kb0; kb < kb1; kb++) { + // row + const ib = bindex[kb]; + // check value has been initialized + if (last !== mark) { + // first value in column jb + cij = mf(adata[i][ib], bvalues[kb]); + // update mark + last = mark; + } else { + // accumulate value + cij = af(cij, mf(adata[i][ib], bvalues[kb])); + } + } + // check column has been processed and value != 0 + if (last === mark && !eq(cij, zero)) { + // push row & value + cindex.push(i); + cvalues.push(cij); + } + } + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} SparseMatrix (M, 1) + */ + function _multiplySparseMatrixVector(a, b) { + // a sparse + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // validate a matrix + if (!avalues) { + throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix'); + } + // b dense + const bdata = b._data; + const bdt = b._datatype || b.getDataType(); + // rows & columns + const arows = a._size[0]; + const brows = b._size[0]; + // result + const cvalues = []; + const cindex = []; + const cptr = []; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + // equalScalar signature to use + let eq = equalScalar; + // zero value + let zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // workspace + const x = []; + // vector with marks indicating a value x[i] exists in a given column + const w = []; + + // update ptr + cptr[0] = 0; + // rows in b + for (let ib = 0; ib < brows; ib++) { + // b[ib] + const vbi = bdata[ib]; + // check b[ib] != 0, avoid loops + if (!eq(vbi, zero)) { + // A values & index in ib column + for (let ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // a row + const ia = aindex[ka]; + // check value exists in current j + if (!w[ia]) { + // ia is new entry in j + w[ia] = true; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(vbi, avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(vbi, avalues[ka])); + } + } + } + } + // copy values from x to column jb of c + for (let p1 = cindex.length, p = 0; p < p1; p++) { + // row + const ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + // update ptr + cptr[1] = cindex.length; + + // matrix to return + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, 1], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b DenseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplySparseMatrixDenseMatrix(a, b) { + // a sparse + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // validate a matrix + if (!avalues) { + throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix'); + } + // b dense + const bdata = b._data; + const bdt = b._datatype || b.getDataType(); + // rows & columns + const arows = a._size[0]; + const brows = b._size[0]; + const bcolumns = b._size[1]; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + // equalScalar signature to use + let eq = equalScalar; + // zero value + let zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // result + const cvalues = []; + const cindex = []; + const cptr = []; + // c matrix + const c = a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // workspace + const x = []; + // vector with marks indicating a value x[i] exists in a given column + const w = []; + + // loop b columns + for (let jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // mark in workspace for current column + const mark = jb + 1; + // rows in jb + for (let ib = 0; ib < brows; ib++) { + // b[ib, jb] + const vbij = bdata[ib][jb]; + // check b[ib, jb] != 0, avoid loops + if (!eq(vbij, zero)) { + // A values & index in ib column + for (let ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // a row + const ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(vbij, avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(vbij, avalues[ka])); + } + } + } + } + // copy values from x to column jb of c + for (let p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) { + // row + const ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b SparseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplySparseMatrixSparseMatrix(a, b) { + // a sparse + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // b sparse + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // rows & columns + const arows = a._size[0]; + const bcolumns = b._size[1]; + // flag indicating both matrices (a & b) contain data + const values = avalues && bvalues; + + // datatype + let dt; + // addScalar signature to use + let af = addScalar; + // multiplyScalar signature to use + let mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + const cvalues = values ? [] : undefined; + const cindex = []; + const cptr = []; + // c matrix + const c = a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // workspace + const x = values ? [] : undefined; + // vector with marks indicating a value x[i] exists in a given column + const w = []; + // variables + let ka, ka0, ka1, kb, kb0, kb1, ia, ib; + // loop b columns + for (let jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // mark in workspace for current column + const mark = jb + 1; + // B values & index in j + for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) { + // b row + ib = bindex[kb]; + // check we need to process values + if (values) { + // loop values in a[:,ib] + for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // row + ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(bvalues[kb], avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka])); + } + } + } else { + // loop values in a[:,ib] + for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // row + ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + } + } + } + } + // check we need to process matrix values (pattern matrix) + if (values) { + // copy values from x to column jb of c + for (let p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) { + // row + const ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * Multiply two or more values, `x * y`. + * For matrices, the matrix product is calculated. + * + * Syntax: + * + * math.multiply(x, y) + * math.multiply(x, y, z, ...) + * + * Examples: + * + * math.multiply(4, 5.2) // returns number 20.8 + * math.multiply(2, 3, 4) // returns number 24 + * + * const a = math.complex(2, 3) + * const b = math.complex(4, 1) + * math.multiply(a, b) // returns Complex 5 + 14i + * + * const c = [[1, 2], [4, 3]] + * const d = [[1, 2, 3], [3, -4, 7]] + * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]] + * + * const e = math.unit('2.1 km') + * math.multiply(3, e) // returns Unit 6.3 km + * + * See also: + * + * divide, prod, cross, dot + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` + */ + return typed(name, multiplyScalar, { + // we extend the signatures of multiplyScalar with signatures dealing with matrices + + 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => { + // check dimensions + _validateMatrixDimensions((0, _array.arraySize)(x), (0, _array.arraySize)(y)); + + // use dense matrix implementation + const m = selfMM(matrix(x), matrix(y)); + // return array or scalar + return (0, _is.isMatrix)(m) ? m.valueOf() : m; + }), + 'Matrix, Matrix': function (x, y) { + // dimensions + const xsize = x.size(); + const ysize = y.size(); + + // check dimensions + _validateMatrixDimensions(xsize, ysize); + + // process dimensions + if (xsize.length === 1) { + // process y dimensions + if (ysize.length === 1) { + // Vector * Vector + return _multiplyVectorVector(x, y, xsize[0]); + } + // Vector * Matrix + return _multiplyVectorMatrix(x, y); + } + // process y dimensions + if (ysize.length === 1) { + // Matrix * Vector + return _multiplyMatrixVector(x, y); + } + // Matrix * Matrix + return _multiplyMatrixMatrix(x, y); + }, + 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))), + 'Array, Matrix': typed.referToSelf(self => (x, y) => { + // use Matrix * Matrix implementation + return self(matrix(x, y.storage()), y); + }), + 'SparseMatrix, any': function (x, y) { + return matAlgo11xS0s(x, y, multiplyScalar, false); + }, + 'DenseMatrix, any': function (x, y) { + return matAlgo14xDs(x, y, multiplyScalar, false); + }, + 'any, SparseMatrix': function (x, y) { + return matAlgo11xS0s(y, x, multiplyScalar, true); + }, + 'any, DenseMatrix': function (x, y) { + return matAlgo14xDs(y, x, multiplyScalar, true); + }, + 'Array, any': function (x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf(); + }, + 'any, Array': function (x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf(); + }, + 'any, any': multiplyScalar, + 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => { + let result = self(x, y); + for (let i = 0; i < rest.length; i++) { + result = self(result, rest[i]); + } + return result; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js new file mode 100644 index 0000000..9a3c10b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMultiplyScalar = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'multiplyScalar'; +const dependencies = ['typed']; +const createMultiplyScalar = exports.createMultiplyScalar = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Multiply two scalar values, `x * y`. + * This function is meant for internal use: it is used by the public function + * `multiply` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y` + * @private + */ + return typed('multiplyScalar', { + 'number, number': _index.multiplyNumber, + 'Complex, Complex': function (x, y) { + return x.mul(y); + }, + 'BigNumber, BigNumber': function (x, y) { + return x.times(y); + }, + 'bigint, bigint': function (x, y) { + return x * y; + }, + 'Fraction, Fraction': function (x, y) { + return x.mul(y); + }, + 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x), + 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js new file mode 100644 index 0000000..997aa8d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js @@ -0,0 +1,293 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNorm = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'norm'; +const dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs']; +const createNorm = exports.createNorm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + add, + pow, + conj, + sqrt, + multiply, + equalScalar, + larger, + smaller, + matrix, + ctranspose, + eigs + } = _ref; + /** + * Calculate the norm of a number, vector or matrix. + * + * The second parameter p is optional. If not provided, it defaults to 2. + * + * Syntax: + * + * math.norm(x) + * math.norm(x, p) + * + * Examples: + * + * math.abs(-3.5) // returns 3.5 + * math.norm(-3.5) // returns 3.5 + * + * math.norm(math.complex(3, -4)) // returns 5 + * + * math.norm([1, 2, -3], Infinity) // returns 3 + * math.norm([1, 2, -3], -Infinity) // returns 1 + * + * math.norm([3, 4], 2) // returns 5 + * + * math.norm([[1, 2], [3, 4]], 1) // returns 6 + * math.norm([[1, 2], [3, 4]], 'inf') // returns 7 + * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661 + * + * See also: + * + * abs, hypot + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the norm + * @param {number | BigNumber | string} [p=2] + * Vector space. + * Supported numbers include Infinity and -Infinity. + * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) + * @return {number | BigNumber} the p-norm + */ + return typed(name, { + number: Math.abs, + Complex: function (x) { + return x.abs(); + }, + BigNumber: function (x) { + // norm(x) = abs(x) + return x.abs(); + }, + boolean: function (x) { + // norm(x) = abs(x) + return Math.abs(x); + }, + Array: function (x) { + return _norm(matrix(x), 2); + }, + Matrix: function (x) { + return _norm(x, 2); + }, + 'Array, number | BigNumber | string': function (x, p) { + return _norm(matrix(x), p); + }, + 'Matrix, number | BigNumber | string': function (x, p) { + return _norm(x, p); + } + }); + + /** + * Calculate the plus infinity norm for a vector + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _vectorNormPlusInfinity(x) { + // norm(x, Infinity) = max(abs(x)) + let pinf = 0; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + const v = abs(value); + if (larger(v, pinf)) { + pinf = v; + } + }, true); + return pinf; + } + + /** + * Calculate the minus infinity norm for a vector + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _vectorNormMinusInfinity(x) { + // norm(x, -Infinity) = min(abs(x)) + let ninf; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + const v = abs(value); + if (!ninf || smaller(v, ninf)) { + ninf = v; + } + }, true); + return ninf || 0; + } + + /** + * Calculate the norm for a vector + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _vectorNorm(x, p) { + // check p + if (p === Number.POSITIVE_INFINITY || p === 'inf') { + return _vectorNormPlusInfinity(x); + } + if (p === Number.NEGATIVE_INFINITY || p === '-inf') { + return _vectorNormMinusInfinity(x); + } + if (p === 'fro') { + return _norm(x, 2); + } + if (typeof p === 'number' && !isNaN(p)) { + // check p != 0 + if (!equalScalar(p, 0)) { + // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p + let n = 0; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + n = add(pow(abs(value), p), n); + }, true); + return pow(n, 1 / p); + } + return Number.POSITIVE_INFINITY; + } + // invalid parameter value + throw new Error('Unsupported parameter value'); + } + + /** + * Calculate the Frobenius norm for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormFrobenius(x) { + // norm(x) = sqrt(sum(diag(x'x))) + let fro = 0; + x.forEach(function (value, index) { + fro = add(fro, multiply(value, conj(value))); + }); + return abs(sqrt(fro)); + } + + /** + * Calculate the norm L1 for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormOne(x) { + // norm(x) = the largest column sum + const c = []; + // result + let maxc = 0; + // skip zeros since abs(0) == 0 + x.forEach(function (value, index) { + const j = index[1]; + const cj = add(c[j] || 0, abs(value)); + if (larger(cj, maxc)) { + maxc = cj; + } + c[j] = cj; + }, true); + return maxc; + } + + /** + * Calculate the norm L2 for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormTwo(x) { + // norm(x) = sqrt( max eigenvalue of A*.A) + const sizeX = x.size(); + if (sizeX[0] !== sizeX[1]) { + throw new RangeError('Invalid matrix dimensions'); + } + const tx = ctranspose(x); + const squaredX = multiply(tx, x); + const eigenVals = eigs(squaredX).values.toArray(); + const rho = eigenVals[eigenVals.length - 1]; + return abs(sqrt(rho)); + } + + /** + * Calculate the infinity norm for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormInfinity(x) { + // norm(x) = the largest row sum + const r = []; + // result + let maxr = 0; + // skip zeros since abs(0) == 0 + x.forEach(function (value, index) { + const i = index[0]; + const ri = add(r[i] || 0, abs(value)); + if (larger(ri, maxr)) { + maxr = ri; + } + r[i] = ri; + }, true); + return maxr; + } + + /** + * Calculate the norm for a 2D Matrix (M*N) + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _matrixNorm(x, p) { + // check p + if (p === 1) { + return _matrixNormOne(x); + } + if (p === Number.POSITIVE_INFINITY || p === 'inf') { + return _matrixNormInfinity(x); + } + if (p === 'fro') { + return _matrixNormFrobenius(x); + } + if (p === 2) { + return _matrixNormTwo(x); + } // invalid parameter value + + throw new Error('Unsupported parameter value ' + p); + } + + /** + * Calculate the norm for an array + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _norm(x, p) { + // size + const sizeX = x.size(); + + // check if it is a vector + if (sizeX.length === 1) { + return _vectorNorm(x, p); + } + // MxN matrix + if (sizeX.length === 2) { + if (sizeX[0] && sizeX[1]) { + return _matrixNorm(x, p); + } else { + throw new RangeError('Invalid matrix dimensions'); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js new file mode 100644 index 0000000..4c53f40 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js @@ -0,0 +1,172 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNthRootNumber = exports.createNthRoot = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo06xS0S = require("../../type/matrix/utils/matAlgo06xS0S0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'nthRoot'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat']; +const createNthRoot = exports.createNthRoot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + BigNumber, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo06xS0S0 = (0, _matAlgo06xS0S.createMatAlgo06xS0S0)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Calculate the nth root of a value. + * The principal nth root of a positive real number A, is the positive real + * solution of the equation + * + * x^root = A + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.nthRoot(a) + * math.nthRoot(a, root) + * + * Examples: + * + * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9) + * math.sqrt(9) // returns 3 (since 3^2 == 9) + * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64) + * + * See also: + * + * sqrt, pow + * + * @param {number | BigNumber | Array | Matrix | Complex} a + * Value for which to calculate the nth root + * @param {number | BigNumber} [root=2] The root. + * @return {number | Complex | Array | Matrix} Returns the nth root of `a` + */ + function complexErr() { + throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.'); + } + return typed(name, { + number: _index.nthRootNumber, + 'number, number': _index.nthRootNumber, + BigNumber: x => _bigNthRoot(x, new BigNumber(2)), + 'BigNumber, BigNumber': _bigNthRoot, + Complex: complexErr, + 'Complex, number': complexErr, + Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()), + DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)), + SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)), + 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // sparse + sparse + return matAlgo06xS0S0(x, y, self); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }), + 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // dense + sparse + return matAlgo01xDSid(x, y, self, false); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }), + 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // sparse - scalar + return matAlgo11xS0s(y, x, self, true); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }) + }, matrixAlgorithmSuite({ + scalar: 'number | BigNumber', + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: false + })); + + /** + * Calculate the nth root of a for BigNumbers, solve x^root == a + * https://rosettacode.org/wiki/Nth_root#JavaScript + * @param {BigNumber} a + * @param {BigNumber} root + * @private + */ + function _bigNthRoot(a, root) { + const precision = BigNumber.precision; + const Big = BigNumber.clone({ + precision: precision + 2 + }); + const zero = new BigNumber(0); + const one = new Big(1); + const inv = root.isNegative(); + if (inv) { + root = root.neg(); + } + if (root.isZero()) { + throw new Error('Root must be non-zero'); + } + if (a.isNegative() && !root.abs().mod(2).equals(1)) { + throw new Error('Root must be odd when a is negative.'); + } + + // edge cases zero and infinity + if (a.isZero()) { + return inv ? new Big(Infinity) : 0; + } + if (!a.isFinite()) { + return inv ? zero : a; + } + let x = a.abs().pow(one.div(root)); + // If a < 0, we require that root is an odd integer, + // so (-1) ^ (1/root) = -1 + x = a.isNeg() ? x.neg() : x; + return new BigNumber((inv ? one.div(x) : x).toPrecision(precision)); + } +}); +const createNthRootNumber = exports.createNthRootNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed'], _ref2 => { + let { + typed + } = _ref2; + return typed(name, { + number: _index.nthRootNumber, + 'number, number': _index.nthRootNumber + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js new file mode 100644 index 0000000..0718e93 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js @@ -0,0 +1,117 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNthRoots = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'nthRoots'; +const dependencies = ['config', 'typed', 'divideScalar', 'Complex']; +const createNthRoots = exports.createNthRoots = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + divideScalar, + Complex + } = _ref; + /** + * Each function here returns a real multiple of i as a Complex value. + * @param {number} val + * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3 + */ + // This is used to fix float artifacts for zero-valued components. + const _calculateExactResult = [function realPos(val) { + return new Complex(val, 0); + }, function imagPos(val) { + return new Complex(0, val); + }, function realNeg(val) { + return new Complex(-val, 0); + }, function imagNeg(val) { + return new Complex(0, -val); + }]; + + /** + * Calculate the nth root of a Complex Number a using De Movire's Theorem. + * @param {Complex} a + * @param {number} root + * @return {Array} array of n Complex Roots + */ + function _nthComplexRoots(a, root) { + if (root < 0) throw new Error('Root must be greater than zero'); + if (root === 0) throw new Error('Root must be non-zero'); + if (root % 1 !== 0) throw new Error('Root must be an integer'); + if (a === 0 || a.abs() === 0) return [new Complex(0, 0)]; + const aIsNumeric = typeof a === 'number'; + let offset; + // determine the offset (argument of a)/(pi/2) + if (aIsNumeric || a.re === 0 || a.im === 0) { + if (aIsNumeric) { + offset = 2 * +(a < 0); // numeric value on the real axis + } else if (a.im === 0) { + offset = 2 * +(a.re < 0); // complex value on the real axis + } else { + offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis + } + } + const arg = a.arg(); + const abs = a.abs(); + const roots = []; + const r = Math.pow(abs, 1 / root); + for (let k = 0; k < root; k++) { + const halfPiFactor = (offset + 4 * k) / root; + /** + * If (offset + 4*k)/root is an integral multiple of pi/2 + * then we can produce a more exact result. + */ + if (halfPiFactor === Math.round(halfPiFactor)) { + roots.push(_calculateExactResult[halfPiFactor % 4](r)); + continue; + } + roots.push(new Complex({ + r, + phi: (arg + 2 * Math.PI * k) / root + })); + } + return roots; + } + + /** + * Calculate the nth roots of a value. + * An nth root of a positive real number A, + * is a positive real solution of the equation "x^root = A". + * This function returns an array of complex values. + * + * Syntax: + * + * math.nthRoots(x) + * math.nthRoots(x, root) + * + * Examples: + * + * math.nthRoots(1) + * // returns [ + * // {re: 1, im: 0}, + * // {re: -1, im: 0} + * // ] + * math.nthRoots(1, 3) + * // returns [ + * // { re: 1, im: 0 }, + * // { re: -0.4999999999999998, im: 0.8660254037844387 }, + * // { re: -0.5000000000000004, im: -0.8660254037844385 } + * // ] + * + * See also: + * + * nthRoot, pow, sqrt + * + * @param {number | BigNumber | Fraction | Complex} x Number to be rounded + * @param {number} [root=2] Optional root, default value is 2 + * @return {number | BigNumber | Fraction | Complex} Returns the nth roots + */ + return typed(name, { + Complex: function (x) { + return _nthComplexRoots(x, 2); + }, + 'Complex, number': _nthComplexRoots + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js new file mode 100644 index 0000000..f04c7fd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js @@ -0,0 +1,198 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPow = void 0; +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _array = require("../../utils/array.js"); +var _index = require("../../plain/number/index.js"); +const name = 'pow'; +const dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex']; +const createPow = exports.createPow = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + identity, + multiply, + matrix, + inv, + number, + fraction, + Complex + } = _ref; + /** + * Calculates the power of x to y, `x ^ y`. + * + * Matrix exponentiation is supported for square matrices `x` and integers `y`: + * when `y` is nonnegative, `x` may be any square matrix; and when `y` is + * negative, `x` must be invertible, and then this function returns + * inv(x)^(-y). + * + * For cubic roots of negative numbers, the function returns the principal + * root by default. In order to let the function return the real root, + * math.js can be configured with `math.config({predictable: true})`. + * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`. + * + * Syntax: + * + * math.pow(x, y) + * + * Examples: + * + * math.pow(2, 3) // returns number 8 + * + * const a = math.complex(2, 3) + * math.pow(a, 2) // returns Complex -5 + 12i + * + * const b = [[1, 2], [4, 3]] + * math.pow(b, 2) // returns Array [[9, 8], [16, 17]] + * + * const c = [[1, 2], [4, 3]] + * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]] + * + * See also: + * + * multiply, sqrt, cbrt, nthRoot + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base + * @param {number | BigNumber | bigint | Complex} y The exponent + * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y` + */ + return typed(name, { + 'number, number': _pow, + 'Complex, Complex': function (x, y) { + return x.pow(y); + }, + 'BigNumber, BigNumber': function (x, y) { + if (y.isInteger() || x >= 0 || config.predictable) { + return x.pow(y); + } else { + return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0); + } + }, + 'bigint, bigint': (x, y) => x ** y, + 'Fraction, Fraction': function (x, y) { + const result = x.pow(y); + if (result != null) { + return result; + } + if (config.predictable) { + throw new Error('Result of pow is non-rational and cannot be expressed as a fraction'); + } else { + return _pow(x.valueOf(), y.valueOf()); + } + }, + 'Array, number': _powArray, + 'Array, BigNumber': function (x, y) { + return _powArray(x, y.toNumber()); + }, + 'Matrix, number': _powMatrix, + 'Matrix, BigNumber': function (x, y) { + return _powMatrix(x, y.toNumber()); + }, + 'Unit, number | BigNumber': function (x, y) { + return x.pow(y); + } + }); + + /** + * Calculates the power of x to y, x^y, for two numbers. + * @param {number} x + * @param {number} y + * @return {number | Complex} res + * @private + */ + function _pow(x, y) { + // Alternatively could define a 'realmode' config option or something, but + // 'predictable' will work for now + if (config.predictable && !(0, _number.isInteger)(y) && x < 0) { + // Check to see if y can be represented as a fraction + try { + const yFrac = fraction(y); + const yNum = number(yFrac); + if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) { + if (yFrac.d % 2 === 1) { + return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y); + } + } + } catch (ex) { + // fraction() throws an error if y is Infinity, etc. + } + + // Unable to express y as a fraction, so continue on + } + + // **for predictable mode** x^Infinity === NaN if x < -1 + // N.B. this behavour is different from `Math.pow` which gives + // (-2)^Infinity === Infinity + if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) { + return NaN; + } + if ((0, _number.isInteger)(y) || x >= 0 || config.predictable) { + return (0, _index.powNumber)(x, y); + } else { + // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow + + // x^Infinity === 0 if -1 < x < 1 + // A real number 0 is returned instead of complex(0) + if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) { + return 0; + } + return new Complex(x, 0).pow(y, 0); + } + } + + /** + * Calculate the power of a 2d array + * @param {Array} x must be a 2 dimensional, square matrix + * @param {number} y a integer value (positive if `x` is not invertible) + * @returns {Array} + * @private + */ + function _powArray(x, y) { + if (!(0, _number.isInteger)(y)) { + throw new TypeError('For A^b, b must be an integer (value is ' + y + ')'); + } + // verify that A is a 2 dimensional square matrix + const s = (0, _array.arraySize)(x); + if (s.length !== 2) { + throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)'); + } + if (s[0] !== s[1]) { + throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')'); + } + if (y < 0) { + try { + return _powArray(inv(x), -y); + } catch (error) { + if (error.message === 'Cannot calculate inverse, determinant is zero') { + throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')'); + } + throw error; + } + } + let res = identity(s[0]).valueOf(); + let px = x; + while (y >= 1) { + if ((y & 1) === 1) { + res = multiply(px, res); + } + y >>= 1; + px = multiply(px, px); + } + return res; + } + + /** + * Calculate the power of a 2d matrix + * @param {Matrix} x must be a 2 dimensional, square matrix + * @param {number} y a positive, integer value + * @returns {Matrix} + * @private + */ + function _powMatrix(x, y) { + return matrix(_powArray(x.valueOf(), y)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/round.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/round.js new file mode 100644 index 0000000..b9caf45 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/round.js @@ -0,0 +1,208 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRound = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +var _index = require("../../plain/number/index.js"); +const NO_INT = 'Number of decimals in function round must be an integer'; +const name = 'round'; +const dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix']; +const createRound = exports.createRound = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + equalScalar, + zeros, + BigNumber, + DenseMatrix + } = _ref; + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + function toExponent(epsilon) { + return Math.abs((0, _number.splitNumber)(epsilon).exponent); + } + + /** + * Round a value towards the nearest rounded value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.round(x) + * math.round(x, n) + * math.round(unit, valuelessUnit) + * math.round(unit, n, valuelessUnit) + * + * Examples: + * + * math.round(3.22) // returns number 3 + * math.round(3.82) // returns number 4 + * math.round(-4.2) // returns number -4 + * math.round(-4.7) // returns number -5 + * math.round(3.22, 1) // returns number 3.2 + * math.round(3.88, 1) // returns number 3.9 + * math.round(-4.21, 1) // returns number -4.2 + * math.round(-4.71, 1) // returns number -4.7 + * math.round(math.pi, 3) // returns number 3.142 + * math.round(123.45678, 2) // returns number 123.46 + * + * const c = math.complex(3.2, -2.7) + * math.round(c) // returns Complex 3 - 3i + * + * const unit = math.unit('3.241 cm') + * const cm = math.unit('cm') + * const mm = math.unit('mm') + * math.round(unit, 1, cm) // returns Unit 3.2 cm + * math.round(unit, 1, mm) // returns Unit 32.4 mm + * + * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5] + * + * See also: + * + * ceil, fix, floor + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @param {Unit} [valuelessUnit] A valueless unit + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed(name, { + number: function (x) { + // Handle round off errors by first rounding to relTol precision + const xEpsilon = (0, _index.roundNumber)(x, toExponent(config.relTol)); + const xSelected = (0, _number.nearlyEqual)(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return (0, _index.roundNumber)(xSelected); + }, + 'number, number': function (x, n) { + // Same as number: unless user specifies more decimals than relTol + const epsilonExponent = toExponent(config.relTol); + if (n >= epsilonExponent) { + return (0, _index.roundNumber)(x, n); + } + const xEpsilon = (0, _index.roundNumber)(x, epsilonExponent); + const xSelected = (0, _number.nearlyEqual)(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return (0, _index.roundNumber)(xSelected, n); + }, + 'number, BigNumber': function (x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + return new BigNumber(x).toDecimalPlaces(n.toNumber()); + }, + Complex: function (x) { + return x.round(); + }, + 'Complex, number': function (x, n) { + if (n % 1) { + throw new TypeError(NO_INT); + } + return x.round(n); + }, + 'Complex, BigNumber': function (x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + const _n = n.toNumber(); + return x.round(_n); + }, + BigNumber: function (x) { + // Handle round off errors by first rounding to relTol precision + const xEpsilon = new BigNumber(x).toDecimalPlaces(toExponent(config.relTol)); + const xSelected = (0, _nearlyEqual.nearlyEqual)(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return xSelected.toDecimalPlaces(0); + }, + 'BigNumber, BigNumber': function (x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + + // Same as BigNumber: unless user specifies more decimals than relTol + const epsilonExponent = toExponent(config.relTol); + if (n >= epsilonExponent) { + return x.toDecimalPlaces(n.toNumber()); + } + const xEpsilon = x.toDecimalPlaces(epsilonExponent); + const xSelected = (0, _nearlyEqual.nearlyEqual)(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return xSelected.toDecimalPlaces(n.toNumber()); + }, + Fraction: function (x) { + return x.round(); + }, + 'Fraction, number': function (x, n) { + if (n % 1) { + throw new TypeError(NO_INT); + } + return x.round(n); + }, + 'Fraction, BigNumber': function (x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + return x.round(n.toNumber()); + }, + 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) { + const valueless = x.toNumeric(unit); + return unit.multiply(self(valueless, n)); + }), + 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)), + 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), + 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => { + // deep map collection, skip zeros since round(0) = 0 + return (0, _collection.deepMap)(x, value => self(value, n, unit), true); + }), + 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)), + 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since round(0) = 0 + return (0, _collection.deepMap)(x, self, true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + return matAlgo11xS0s(x, n, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + return matAlgo14xDs(x, n, self, false); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // use matrix implementation + return matAlgo14xDs(matrix(x), n, self, false).valueOf(); + }), + 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => { + // check scalar is zero + if (equalScalar(x, 0)) { + // do not execute algorithm, result will be a zero matrix + return zeros(n.size(), n.storage()); + } + return matAlgo12xSfs(n, x, self, true); + }), + 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => { + // check scalar is zero + if (equalScalar(x, 0)) { + // do not execute algorithm, result will be a zero matrix + return zeros(n.size(), n.storage()); + } + return matAlgo14xDs(n, x, self, true); + }), + 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => { + // use matrix implementation + return matAlgo14xDs(matrix(n), x, self, true).valueOf(); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js new file mode 100644 index 0000000..4347b3d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSign = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +const name = 'sign'; +const dependencies = ['typed', 'BigNumber', 'Fraction', 'complex']; +const createSign = exports.createSign = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber, + complex, + Fraction + } = _ref; + /** + * Compute the sign of a value. The sign of a value x is: + * + * - 1 when x > 0 + * - -1 when x < 0 + * - 0 when x == 0 + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.sign(x) + * + * Examples: + * + * math.sign(3.5) // returns 1 + * math.sign(-4.2) // returns -1 + * math.sign(0) // returns 0 + * + * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1] + * + * See also: + * + * abs + * + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x + * The number for which to determine the sign + * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} + * The sign of `x` + */ + return typed(name, { + number: _index.signNumber, + Complex: function (x) { + return x.im === 0 ? complex((0, _index.signNumber)(x.re)) : x.sign(); + }, + BigNumber: function (x) { + return new BigNumber(x.cmp(0)); + }, + bigint: function (x) { + return x > 0n ? 1n : x < 0n ? -1n : 0n; + }, + Fraction: function (x) { + return new Fraction(x.s, 1); + }, + // deep map collection, skip zeros since sign(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self, true)), + Unit: typed.referToSelf(self => x => { + if (!x._isDerived() && x.units[0].unit.offset !== 0) { + throw new TypeError('sign is ambiguous for units with offset'); + } + return typed.find(self, x.valueType())(x.value); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js new file mode 100644 index 0000000..d0a159b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSqrt = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'sqrt'; +const dependencies = ['config', 'typed', 'Complex']; +const createSqrt = exports.createSqrt = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + typed, + Complex + } = _ref; + /** + * Calculate the square root of a value. + * + * For matrices, if you want the matrix square root of a square matrix, + * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to + * a matrix M, use `math.map(M, math.sqrt)`. + * + * Syntax: + * + * math.sqrt(x) + * + * Examples: + * + * math.sqrt(25) // returns 5 + * math.square(5) // returns 25 + * math.sqrt(-4) // returns Complex 2i + * + * See also: + * + * square, multiply, cube, cbrt, sqrtm + * + * @param {number | BigNumber | Complex | Unit} x + * Value for which to calculate the square root. + * @return {number | BigNumber | Complex | Unit} + * Returns the square root of `x` + */ + return typed('sqrt', { + number: _sqrtNumber, + Complex: function (x) { + return x.sqrt(); + }, + BigNumber: function (x) { + if (!x.isNegative() || config.predictable) { + return x.sqrt(); + } else { + // negative value -> downgrade to number to do complex value computation + return _sqrtNumber(x.toNumber()); + } + }, + Unit: function (x) { + // Someday will work for complex units when they are implemented + return x.pow(0.5); + } + }); + + /** + * Calculate sqrt for a number + * @param {number} x + * @returns {number | Complex} Returns the square root of x + * @private + */ + function _sqrtNumber(x) { + if (isNaN(x)) { + return NaN; + } else if (x >= 0 || config.predictable) { + return Math.sqrt(x); + } else { + return new Complex(x, 0).sqrt(); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/square.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/square.js new file mode 100644 index 0000000..279334d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/square.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSquare = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'square'; +const dependencies = ['typed']; +const createSquare = exports.createSquare = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the square of a value, `x * x`. + * To avoid confusion with multiplying a square matrix by itself, + * this function does not apply to matrices. If you wish to square + * every element of a matrix, see the examples. + * + * Syntax: + * + * math.square(x) + * + * Examples: + * + * math.square(2) // returns number 4 + * math.square(3) // returns number 9 + * math.pow(3, 2) // returns number 9 + * math.multiply(3, 3) // returns number 9 + * + * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16] + * + * See also: + * + * multiply, cube, sqrt, pow + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x + * Number for which to calculate the square + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} + * Squared value + */ + return typed(name, { + number: _index.squareNumber, + Complex: function (x) { + return x.mul(x); + }, + BigNumber: function (x) { + return x.times(x); + }, + bigint: function (x) { + return x * x; + }, + Fraction: function (x) { + return x.mul(x); + }, + Unit: function (x) { + return x.pow(2); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js new file mode 100644 index 0000000..ebd04a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSubtract = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo05xSfSf = require("../../type/matrix/utils/matAlgo05xSfSf.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'subtract'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat']; +const createSubtract = exports.createSubtract = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + subtractScalar, + unaryMinus, + DenseMatrix, + concat + } = _ref; + // TODO: split function subtract in two: subtract and subtractScalar + + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo05xSfSf = (0, _matAlgo05xSfSf.createMatAlgo05xSfSf)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Subtract two values, `x - y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.subtract(x, y) + * + * Examples: + * + * math.subtract(5.3, 2) // returns number 3.3 + * + * const a = math.complex(2, 3) + * const b = math.complex(4, 1) + * math.subtract(a, b) // returns Complex -2 + 2i + * + * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0] + * + * const c = math.unit('2.1 km') + * const d = math.unit('500m') + * math.subtract(c, d) // returns Unit 1.6 km + * + * See also: + * + * add + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x` + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y` + */ + return typed(name, { + 'any, any': subtractScalar + }, matrixAlgorithmSuite({ + elop: subtractScalar, + SS: matAlgo05xSfSf, + DS: matAlgo01xDSid, + SD: matAlgo03xDSf, + Ss: matAlgo12xSfs, + sS: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js new file mode 100644 index 0000000..6a2da88 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSubtractScalar = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'subtractScalar'; +const dependencies = ['typed']; +const createSubtractScalar = exports.createSubtractScalar = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Subtract two scalar values, `x - y`. + * This function is meant for internal use: it is used by the public function + * `subtract` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x` + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y` + * @private + */ + return typed(name, { + 'number, number': _index.subtractNumber, + 'Complex, Complex': function (x, y) { + return x.sub(y); + }, + 'BigNumber, BigNumber': function (x, y) { + return x.minus(y); + }, + 'bigint, bigint': function (x, y) { + return x - y; + }, + 'Fraction, Fraction': function (x, y) { + return x.sub(y); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (x.value === null || x.value === undefined) { + throw new Error('Parameter x contains a unit with undefined value'); + } + if (y.value === null || y.value === undefined) { + throw new Error('Parameter y contains a unit with undefined value'); + } + if (!x.equalBase(y)) throw new Error('Units do not match'); + const res = x.clone(); + res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value); + res.fixPrefix = false; + return res; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js new file mode 100644 index 0000000..34844db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnaryMinus = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +const name = 'unaryMinus'; +const dependencies = ['typed']; +const createUnaryMinus = exports.createUnaryMinus = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Inverse the sign of a value, apply a unary minus operation. + * + * For matrices, the function is evaluated element wise. Boolean values and + * strings will be converted to a number. For complex numbers, both real and + * complex value are inverted. + * + * Syntax: + * + * math.unaryMinus(x) + * + * Examples: + * + * math.unaryMinus(3.5) // returns -3.5 + * math.unaryMinus(-4.2) // returns 4.2 + * + * See also: + * + * add, subtract, unaryPlus + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted. + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign. + */ + return typed(name, { + number: _index.unaryMinusNumber, + 'Complex | BigNumber | Fraction': x => x.neg(), + bigint: x => -x, + Unit: typed.referToSelf(self => x => { + const res = x.clone(); + res.value = typed.find(self, res.valueType())(x.value); + return res; + }), + // deep map collection, skip zeros since unaryMinus(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self, true)) + + // TODO: add support for string + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js new file mode 100644 index 0000000..af6da31 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnaryPlus = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +var _index = require("../../plain/number/index.js"); +var _number = require("../../utils/number.js"); +const name = 'unaryPlus'; +const dependencies = ['typed', 'config', 'numeric']; +const createUnaryPlus = exports.createUnaryPlus = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + numeric + } = _ref; + /** + * Unary plus operation. + * Boolean values and strings will be converted to a number, numeric values will be returned as is. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.unaryPlus(x) + * + * Examples: + * + * math.unaryPlus(3.5) // returns 3.5 + * math.unaryPlus(1) // returns 1 + * + * See also: + * + * unaryMinus, add, subtract + * + * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x + * Input value + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} + * Returns the input value when numeric, converts to a number when input is non-numeric. + */ + return typed(name, { + number: _index.unaryPlusNumber, + Complex: function (x) { + return x; // complex numbers are immutable + }, + BigNumber: function (x) { + return x; // bignumbers are immutable + }, + bigint: function (x) { + return x; + }, + Fraction: function (x) { + return x; // fractions are immutable + }, + Unit: function (x) { + return x.clone(); + }, + // deep map collection, skip zeros since unaryPlus(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self, true)), + boolean: function (x) { + return numeric(x ? 1 : 0, config.number); + }, + string: function (x) { + return numeric(x, (0, _number.safeNumberType)(x, config)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js new file mode 100644 index 0000000..e79cd9f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js @@ -0,0 +1,97 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createXgcd = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'xgcd'; +const dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +const createXgcd = exports.createXgcd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Calculate the extended greatest common divisor for two values. + * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + * + * Syntax: + * + * math.xgcd(a, b) + * + * Examples: + * + * math.xgcd(8, 12) // returns [4, -1, 1] + * math.gcd(8, 12) // returns 4 + * math.xgcd(36163, 21199) // returns [1247, -7, 12] + * + * See also: + * + * gcd, lcm + * + * @param {number | BigNumber} a An integer number + * @param {number | BigNumber} b An integer number + * @return {Array} Returns an array containing 3 integers `[div, m, n]` + * where `div = gcd(a, b)` and `a*m + b*n = div` + */ + return typed(name, { + 'number, number': function (a, b) { + const res = (0, _index.xgcdNumber)(a, b); + return config.matrix === 'Array' ? res : matrix(res); + }, + 'BigNumber, BigNumber': _xgcdBigNumber + // TODO: implement support for Fraction + }); + + /** + * Calculate xgcd for two BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @return {BigNumber[]} result + * @private + */ + function _xgcdBigNumber(a, b) { + // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm + let + // used to swap two variables + t; + let + // quotient + q; + let + // remainder + r; + const zero = new BigNumber(0); + const one = new BigNumber(1); + let x = zero; + let lastx = one; + let y = one; + let lasty = zero; + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function xgcd must be integer numbers'); + } + while (!b.isZero()) { + q = a.div(b).floor(); + r = a.mod(b); + t = x; + x = lastx.minus(q.times(x)); + lastx = t; + t = y; + y = lasty.minus(q.times(y)); + lasty = t; + a = b; + b = r; + } + let res; + if (a.lt(zero)) { + res = [a.neg(), lastx.neg(), lasty.neg()]; + } else { + res = [a, !a.isZero() ? lastx : 0, lasty]; + } + return config.matrix === 'Array' ? res : matrix(res); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js new file mode 100644 index 0000000..9d419ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitAnd = void 0; +var _bitwise = require("../../utils/bignumber/bitwise.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo06xS0S = require("../../type/matrix/utils/matAlgo06xS0S0.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'bitAnd'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'concat']; +const createBitAnd = exports.createBitAnd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo06xS0S0 = (0, _matAlgo06xS0S.createMatAlgo06xS0S0)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Bitwise AND two values, `x & y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.bitAnd(x, y) + * + * Examples: + * + * math.bitAnd(53, 131) // returns number 1 + * + * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10] + * + * See also: + * + * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to and + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and + * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y` + */ + return typed(name, { + 'number, number': _index.bitAndNumber, + 'BigNumber, BigNumber': _bitwise.bitAndBigNumber, + 'bigint, bigint': (x, y) => x & y + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js new file mode 100644 index 0000000..98aa3e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitNot = void 0; +var _bitwise = require("../../utils/bignumber/bitwise.js"); +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'bitNot'; +const dependencies = ['typed']; +const createBitNot = exports.createBitNot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Bitwise NOT value, `~x`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.bitNot(x) + * + * Examples: + * + * math.bitNot(1) // returns number -2 + * + * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5] + * + * See also: + * + * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to not + * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x` + */ + return typed(name, { + number: _index.bitNotNumber, + BigNumber: _bitwise.bitNotBigNumber, + bigint: x => ~x, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js new file mode 100644 index 0000000..f269ec2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitOr = void 0; +var _bitwise = require("../../utils/bignumber/bitwise.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matAlgo04xSidSid = require("../../type/matrix/utils/matAlgo04xSidSid.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'bitOr'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +const createBitOr = exports.createBitOr = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo04xSidSid = (0, _matAlgo04xSidSid.createMatAlgo04xSidSid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Bitwise OR two values, `x | y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the lowest print base. + * + * Syntax: + * + * math.bitOr(x, y) + * + * Examples: + * + * math.bitOr(1, 2) // returns number 3 + * + * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7] + * + * See also: + * + * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to or + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or + * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y` + */ + return typed(name, { + 'number, number': _index.bitOrNumber, + 'BigNumber, BigNumber': _bitwise.bitOrBigNumber, + 'bigint, bigint': (x, y) => x | y + }, matrixAlgorithmSuite({ + SS: matAlgo04xSidSid, + DS: matAlgo01xDSid, + Ss: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js new file mode 100644 index 0000000..94f78b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBitXor = void 0; +var _bitwise = require("../../utils/bignumber/bitwise.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'bitXor'; +const dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat']; +const createBitXor = exports.createBitXor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Bitwise XOR two values, `x ^ y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.bitXor(x, y) + * + * Examples: + * + * math.bitXor(1, 2) // returns number 3 + * + * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0] + * + * See also: + * + * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor + * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y` + */ + return typed(name, { + 'number, number': _index.bitXorNumber, + 'BigNumber, BigNumber': _bitwise.bitXor, + 'bigint, bigint': (x, y) => x ^ y + }, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js new file mode 100644 index 0000000..e686e6e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLeftShift = void 0; +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matAlgo08xS0Sid = require("../../type/matrix/utils/matAlgo08xS0Sid.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _useMatrixForArrayScalar = require("./useMatrixForArrayScalar.js"); +var _index = require("../../plain/number/index.js"); +var _bitwise = require("../../utils/bignumber/bitwise.js"); +const name = 'leftShift'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +const createLeftShift = exports.createLeftShift = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo08xS0Sid = (0, _matAlgo08xS0Sid.createMatAlgo08xS0Sid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const useMatrixForArrayScalar = (0, _useMatrixForArrayScalar.createUseMatrixForArrayScalar)({ + typed, + matrix + }); + + /** + * Bitwise left logical shift of a value x by y number of bits, `x << y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.leftShift(x, y) + * + * Examples: + * + * math.leftShift(1, 2) // returns number 4 + * + * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64] + * + * See also: + * + * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted + * @param {number | BigNumber | bigint} y Amount of shifts + * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times + */ + return typed(name, { + 'number, number': _index.leftShiftNumber, + 'BigNumber, BigNumber': _bitwise.leftShiftBigNumber, + 'bigint, bigint': (x, y) => x << y, + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js new file mode 100644 index 0000000..2c2af03 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRightArithShift = void 0; +var _bitwise = require("../../utils/bignumber/bitwise.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matAlgo08xS0Sid = require("../../type/matrix/utils/matAlgo08xS0Sid.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _useMatrixForArrayScalar = require("./useMatrixForArrayScalar.js"); +var _index = require("../../plain/number/index.js"); +const name = 'rightArithShift'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +const createRightArithShift = exports.createRightArithShift = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo08xS0Sid = (0, _matAlgo08xS0Sid.createMatAlgo08xS0Sid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const useMatrixForArrayScalar = (0, _useMatrixForArrayScalar.createUseMatrixForArrayScalar)({ + typed, + matrix + }); + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.rightArithShift(x, y) + * + * Examples: + * + * math.rightArithShift(4, 2) // returns number 1 + * + * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4] + * + * See also: + * + * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted + * @param {number | BigNumber | bigint} y Amount of shifts + * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times + */ + return typed(name, { + 'number, number': _index.rightArithShiftNumber, + 'BigNumber, BigNumber': _bitwise.rightArithShiftBigNumber, + 'bigint, bigint': (x, y) => x >> y, + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js new file mode 100644 index 0000000..e35c2cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRightLogShift = void 0; +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +var _matAlgo01xDSid = require("../../type/matrix/utils/matAlgo01xDSid.js"); +var _matAlgo10xSids = require("../../type/matrix/utils/matAlgo10xSids.js"); +var _matAlgo08xS0Sid = require("../../type/matrix/utils/matAlgo08xS0Sid.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +var _useMatrixForArrayScalar = require("./useMatrixForArrayScalar.js"); +const name = 'rightLogShift'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +const createRightLogShift = exports.createRightLogShift = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + const matAlgo01xDSid = (0, _matAlgo01xDSid.createMatAlgo01xDSid)({ + typed + }); + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo08xS0Sid = (0, _matAlgo08xS0Sid.createMatAlgo08xS0Sid)({ + typed, + equalScalar + }); + const matAlgo10xSids = (0, _matAlgo10xSids.createMatAlgo10xSids)({ + typed, + DenseMatrix + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const useMatrixForArrayScalar = (0, _useMatrixForArrayScalar.createUseMatrixForArrayScalar)({ + typed, + matrix + }); + + /** + * Bitwise right logical shift of value x by y number of bits, `x >>> y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.rightLogShift(x, y) + * + * Examples: + * + * math.rightLogShift(4, 2) // returns number 1 + * + * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4] + * + * See also: + * + * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift + * + * @param {number | Array | Matrix} x Value to be shifted + * @param {number} y Amount of shifts + * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times + */ + + return typed(name, { + 'number, number': _index.rightLogShiftNumber, + // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift + + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js new file mode 100644 index 0000000..8b1a863 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUseMatrixForArrayScalar = void 0; +var _factory = require("../../utils/factory.js"); +const createUseMatrixForArrayScalar = exports.createUseMatrixForArrayScalar = /* #__PURE__ */(0, _factory.factory)('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => { + let { + typed, + matrix + } = _ref; + return { + 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()), + 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()), + 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()), + 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf()) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js new file mode 100644 index 0000000..1dc1b92 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBellNumbers = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'bellNumbers'; +const dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2']; +const createBellNumbers = exports.createBellNumbers = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + isNegative, + isInteger, + stirlingS2 + } = _ref; + /** + * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. + * bellNumbers only takes integer arguments. + * The following condition must be enforced: n >= 0 + * + * Syntax: + * + * math.bellNumbers(n) + * + * Examples: + * + * math.bellNumbers(3) // returns 5 + * math.bellNumbers(8) // returns 4140 + * + * See also: + * + * stirlingS2 + * + * @param {Number | BigNumber} n Total number of objects in the set + * @return {Number | BigNumber} B(n) + */ + return typed(name, { + 'number | BigNumber': function (n) { + if (!isInteger(n) || isNegative(n)) { + throw new TypeError('Non-negative integer value expected in function bellNumbers'); + } + + // Sum (k=0, n) S(n,k). + let result = 0; + for (let i = 0; i <= n; i++) { + result = addScalar(result, stirlingS2(n, i)); + } + return result; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js new file mode 100644 index 0000000..3f4646d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCatalan = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'catalan'; +const dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger']; +const createCatalan = exports.createCatalan = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + divideScalar, + multiplyScalar, + combinations, + isNegative, + isInteger + } = _ref; + /** + * The Catalan Numbers enumerate combinatorial structures of many different types. + * catalan only takes integer arguments. + * The following condition must be enforced: n >= 0 + * + * Syntax: + * + * math.catalan(n) + * + * Examples: + * + * math.catalan(3) // returns 5 + * math.catalan(8) // returns 1430 + * + * See also: + * + * bellNumbers + * + * @param {Number | BigNumber} n nth Catalan number + * @return {Number | BigNumber} Cn(n) + */ + return typed(name, { + 'number | BigNumber': function (n) { + if (!isInteger(n) || isNegative(n)) { + throw new TypeError('Non-negative integer value expected in function catalan'); + } + return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js new file mode 100644 index 0000000..f13ca1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createComposition = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'composition'; +const dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger']; +const createComposition = exports.createComposition = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + combinations, + isPositive, + isNegative, + isInteger, + larger + } = _ref; + /** + * The composition counts of n into k parts. + * + * composition only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.composition(n, k) + * + * Examples: + * + * math.composition(5, 3) // returns 6 + * + * See also: + * + * combinations + * + * @param {Number | BigNumber} n Total number of objects in the set + * @param {Number | BigNumber} k Number of objects in the subset + * @return {Number | BigNumber} Returns the composition counts of n into k parts. + */ + return typed(name, { + 'number | BigNumber, number | BigNumber': function (n, k) { + if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) { + throw new TypeError('Positive integer value expected in function composition'); + } else if (larger(k, n)) { + throw new TypeError('k must be less than or equal to n in function composition'); + } + return combinations(addScalar(n, -1), addScalar(k, -1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js new file mode 100644 index 0000000..7e7dfcc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createStirlingS2 = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'stirlingS2'; +const dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger']; +const createStirlingS2 = exports.createStirlingS2 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + pow, + factorial, + combinations, + isNegative, + isInteger, + number, + bignumber, + larger + } = _ref; + const smallCache = []; + const bigCache = []; + /** + * The Stirling numbers of the second kind, counts the number of ways to partition + * a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * If n = k or k = 1 <= n, then s(n,k) = 1 + * If k = 0 < n, then s(n,k) = 0 + * + * Note that if either n or k is supplied as a BigNumber, the result will be + * as well. + * + * Syntax: + * + * math.stirlingS2(n, k) + * + * Examples: + * + * math.stirlingS2(5, 3) //returns 25 + * + * See also: + * + * bellNumbers + * + * @param {Number | BigNumber} n Total number of objects in the set + * @param {Number | BigNumber} k Number of objects in the subset + * @return {Number | BigNumber} S(n,k) + */ + return typed(name, { + 'number | BigNumber, number | BigNumber': function (n, k) { + if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) { + throw new TypeError('Non-negative integer value expected in function stirlingS2'); + } else if (larger(k, n)) { + throw new TypeError('k must be less than or equal to n in function stirlingS2'); + } + const big = !((0, _is.isNumber)(n) && (0, _is.isNumber)(k)); + const cache = big ? bigCache : smallCache; + const make = big ? bignumber : number; + const nn = number(n); + const nk = number(k); + /* See if we already have the value: */ + if (cache[nn] && cache[nn].length > nk) { + return cache[nn][nk]; + } + /* Fill the cache */ + for (let m = 0; m <= nn; ++m) { + if (!cache[m]) { + cache[m] = [m === 0 ? make(1) : make(0)]; + } + if (m === 0) continue; + const row = cache[m]; + const prev = cache[m - 1]; + for (let i = row.length; i <= m && i <= nk; ++i) { + if (i === m) { + row[i] = 1; + } else { + row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]); + } + } + } + return cache[nn][nk]; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/arg.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/arg.js new file mode 100644 index 0000000..21c7f90 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/arg.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createArg = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +const name = 'arg'; +const dependencies = ['typed']; +const createArg = exports.createArg = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the argument of a complex value. + * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.arg(x) + * + * Examples: + * + * const a = math.complex(2, 2) + * math.arg(a) / math.pi // returns number 0.25 + * + * const b = math.complex('2 + 3i') + * math.arg(b) // returns number 0.982793723247329 + * math.atan2(3, 2) // returns number 0.982793723247329 + * + * See also: + * + * re, im, conj, abs + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The argument of x + */ + return typed(name, { + number: function (x) { + return Math.atan2(0, x); + }, + BigNumber: function (x) { + return x.constructor.atan2(0, x); + }, + Complex: function (x) { + return x.arg(); + }, + // TODO: implement BigNumber support for function arg + + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/conj.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/conj.js new file mode 100644 index 0000000..d1eaf03 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/conj.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConj = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +const name = 'conj'; +const dependencies = ['typed']; +const createConj = exports.createConj = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the complex conjugate of a complex value. + * If `x = a+bi`, the complex conjugate of `x` is `a - bi`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.conj(x) + * + * Examples: + * + * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i + * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i + * math.conj(math.complex('-5.2i')) // returns Complex 5.2i + * + * See also: + * + * re, im, arg, abs + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Complex | Array | Matrix} + * The complex conjugate of x + */ + return typed(name, { + 'number | BigNumber | Fraction': x => x, + Complex: x => x.conjugate(), + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/im.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/im.js new file mode 100644 index 0000000..f082801 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/im.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIm = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +const name = 'im'; +const dependencies = ['typed']; +const createIm = exports.createIm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Get the imaginary part of a complex number. + * For a complex number `a + bi`, the function returns `b`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.im(x) + * + * Examples: + * + * const a = math.complex(2, 3) + * math.re(a) // returns number 2 + * math.im(a) // returns number 3 + * + * math.re(math.complex('-5.2i')) // returns number -5.2 + * math.re(math.complex(2.4)) // returns number 0 + * + * See also: + * + * re, conj, abs, arg + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The imaginary part of x + */ + return typed(name, { + number: () => 0, + 'BigNumber | Fraction': x => x.mul(0), + Complex: x => x.im, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/re.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/re.js new file mode 100644 index 0000000..9886d65 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/complex/re.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRe = void 0; +var _factory = require("../../utils/factory.js"); +var _collection = require("../../utils/collection.js"); +const name = 're'; +const dependencies = ['typed']; +const createRe = exports.createRe = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Get the real part of a complex number. + * For a complex number `a + bi`, the function returns `a`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.re(x) + * + * Examples: + * + * const a = math.complex(2, 3) + * math.re(a) // returns number 2 + * math.im(a) // returns number 3 + * + * math.re(math.complex('-5.2i')) // returns number 0 + * math.re(math.complex(2.4)) // returns number 2.4 + * + * See also: + * + * im, conj, abs, arg + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The real part of x + */ + return typed(name, { + 'number | BigNumber | Fraction': x => x, + Complex: x => x.re, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/distance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/distance.js new file mode 100644 index 0000000..792453b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/distance.js @@ -0,0 +1,311 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDistance = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'distance'; +const dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs']; +const createDistance = exports.createDistance = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + deepEqual, + sqrt, + abs + } = _ref; + /** + * Calculates: + * The eucledian distance between two points in N-dimensional spaces. + * Distance between point and a line in 2 and 3 dimensional spaces. + * Pairwise distance between a set of 2D or 3D points + * NOTE: + * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c + * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) + * + * Syntax: + * + * math.distance([x1,y1], [x2,y2]) + * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY}) + * math.distance([x1,y1,z1], [x2,y2,z2]) + * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ}) + * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2]) + * math.distance([[x1,y1], [x2,y2], [x3,y3]]) + * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]]) + * math.distance([pointX,pointY], [a,b,c]) + * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY]) + * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY}) + * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c]) + * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c}) + * + * Examples: + * math.distance([0,0], [4,4]) // Returns 5.656854249492381 + * math.distance( + * {pointOneX: 0, pointOneY: 0}, + * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951 + * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413 + * math.distance( + * {pointOneX: 4, pointOneY: 5, pointOneZ: 8}, + * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3 + * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2 + * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1] + * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608] + * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387 + * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4 + * math.distance( + * {pointX: 0, pointY: 0}, + * {lineOnePtX: 3, lineOnePtY: 0}, + * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4 + * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857 + * math.distance( + * {pointX: 2, pointY: 3, pointZ: 1}, + * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857 + * + * @param {Array | Matrix | Object} x Co-ordinates of first point + * @param {Array | Matrix | Object} y Co-ordinates of second point + * @return {Number | BigNumber} Returns the distance from two/three points + */ + return typed(name, { + 'Array, Array, Array': function (x, y, z) { + // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2) + if (x.length === 2 && y.length === 2 && z.length === 2) { + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_2d(y)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument'); + } + if (!_2d(z)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument'); + } + if (deepEqual(y, z)) { + throw new TypeError('LinePoint1 should not be same with LinePoint2'); + } + const xCoeff = subtractScalar(z[1], y[1]); + const yCoeff = subtractScalar(y[0], z[0]); + const constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1])); + return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant); + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Object, Object, Object': function (x, y, z) { + if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) { + if (!_2d(x)) { + throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers'); + } + if (!_2d(y)) { + throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers'); + } + if (!_2d(z)) { + throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers'); + } + if (deepEqual(_objectToArray(y), _objectToArray(z))) { + throw new TypeError('LinePoint1 should not be same with LinePoint2'); + } + if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) { + const xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY); + const yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX); + const constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY)); + return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant); + } else { + throw new TypeError('Key names do not match'); + } + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Array, Array': function (x, y) { + // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const]) + if (x.length === 2 && y.length === 3) { + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]); + } else if (x.length === 3 && y.length === 6) { + // Point to Line 3D + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_parametricLine(y)) { + throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument'); + } + return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]); + } else if (x.length === y.length && x.length > 0) { + // Point to Point N-dimensions + if (!_containsOnlyNumbers(x)) { + throw new TypeError('All values of an array should be numbers or BigNumbers'); + } + if (!_containsOnlyNumbers(y)) { + throw new TypeError('All values of an array should be numbers or BigNumbers'); + } + return _euclideanDistance(x, y); + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Object, Object': function (x, y) { + if (Object.keys(x).length === 2 && Object.keys(y).length === 3) { + if (!_2d(x)) { + throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers'); + } + if (!_3d(y)) { + throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers'); + } + if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) { + return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) { + // Point to Line 3D + if (!_3d(x)) { + throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers'); + } + if (!_parametricLine(y)) { + throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers'); + } + if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) { + return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) { + // Point to Point 2D + if (!_2d(x)) { + throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers'); + } + if (!_2d(y)) { + throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers'); + } + if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) { + return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) { + // Point to Point 3D + if (!_3d(x)) { + throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers'); + } + if (!_3d(y)) { + throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers'); + } + if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) { + return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]); + } else { + throw new TypeError('Key names do not match'); + } + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + Array: function (arr) { + if (!_pairwise(arr)) { + throw new TypeError('Incorrect array format entered for pairwise distance calculation'); + } + return _distancePairwise(arr); + } + }); + function _isNumber(a) { + // distance supports numbers and bignumbers + return typeof a === 'number' || (0, _is.isBigNumber)(a); + } + function _2d(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]); + } + function _3d(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]); + } + function _containsOnlyNumbers(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (!Array.isArray(a)) { + a = _objectToArray(a); + } + return a.every(_isNumber); + } + function _parametricLine(a) { + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]); + } + function _objectToArray(o) { + const keys = Object.keys(o); + const a = []; + for (let i = 0; i < keys.length; i++) { + a.push(o[keys[i]]); + } + return a; + } + function _pairwise(a) { + // checks for valid arguments passed to _distancePairwise(Array) + if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) { + if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) { + return false; + } + } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) { + if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) { + return false; + } + } else { + return false; + } + return true; + } + function _distancePointLine2D(x, y, a, b, c) { + const num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c)); + const den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b))); + return divideScalar(num, den); + } + function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) { + let num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))]; + num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2]))); + const den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c))); + return divideScalar(num, den); + } + function _euclideanDistance(x, y) { + const vectorSize = x.length; + let result = 0; + let diff = 0; + for (let i = 0; i < vectorSize; i++) { + diff = subtractScalar(x[i], y[i]); + result = addScalar(multiplyScalar(diff, diff), result); + } + return sqrt(result); + } + function _distancePairwise(a) { + const result = []; + let pointA = []; + let pointB = []; + for (let i = 0; i < a.length - 1; i++) { + for (let j = i + 1; j < a.length; j++) { + if (a[0].length === 2) { + pointA = [a[i][0], a[i][1]]; + pointB = [a[j][0], a[j][1]]; + } else if (a[0].length === 3) { + pointA = [a[i][0], a[i][1], a[i][2]]; + pointB = [a[j][0], a[j][1], a[j][2]]; + } + result.push(_euclideanDistance(pointA, pointB)); + } + } + return result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/intersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/intersect.js new file mode 100644 index 0000000..af857e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/geometry/intersect.js @@ -0,0 +1,206 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIntersect = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'intersect'; +const dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric']; +const createIntersect = exports.createIntersect = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + abs, + add, + addScalar, + matrix, + multiply, + multiplyScalar, + divideScalar, + subtract, + smaller, + equalScalar, + flatten, + isZero, + isNumeric + } = _ref; + /** + * Calculates the point of intersection of two lines in two or three dimensions + * and of a line and a plane in three dimensions. The inputs are in the form of + * arrays or 1 dimensional matrices. The line intersection functions return null + * if the lines do not meet. + * + * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`. + * + * Syntax: + * + * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2) + * math.intersect(endPoint1, endPoint2, planeCoefficients) + * + * Examples: + * + * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5] + * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0] + * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3] + * + * @param {Array | Matrix} w Co-ordinates of first end-point of first line + * @param {Array | Matrix} x Co-ordinates of second end-point of first line + * @param {Array | Matrix} y Co-ordinates of first end-point of second line + * OR Co-efficients of the plane's equation + * @param {Array | Matrix} z Co-ordinates of second end-point of second line + * OR undefined if the calculation is for line and plane + * @return {Array} Returns the point of intersection of lines/lines-planes + */ + return typed('intersect', { + 'Array, Array, Array': _AAA, + 'Array, Array, Array, Array': _AAAA, + 'Matrix, Matrix, Matrix': function (x, y, plane) { + const arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf()); + return arr === null ? null : matrix(arr); + }, + 'Matrix, Matrix, Matrix, Matrix': function (w, x, y, z) { + // TODO: output matrix type should match input matrix type + const arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf()); + return arr === null ? null : matrix(arr); + } + }); + function _AAA(x, y, plane) { + x = _coerceArr(x); + y = _coerceArr(y); + plane = _coerceArr(plane); + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + if (!_4d(plane)) { + throw new TypeError('Array with 4 numbers expected as third argument'); + } + return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]); + } + function _AAAA(w, x, y, z) { + w = _coerceArr(w); + x = _coerceArr(x); + y = _coerceArr(y); + z = _coerceArr(z); + if (w.length === 2) { + if (!_2d(w)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument'); + } + if (!_2d(y)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument'); + } + if (!_2d(z)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument'); + } + return _intersect2d(w, x, y, z); + } else if (w.length === 3) { + if (!_3d(w)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument'); + } + if (!_3d(z)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument'); + } + return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]); + } else { + throw new TypeError('Arrays with two or thee dimensional points expected'); + } + } + + /** Coerce row and column 2-dim arrays to 1-dim array */ + function _coerceArr(arr) { + // row matrix + if (arr.length === 1) return arr[0]; + + // column matrix + if (arr.length > 1 && Array.isArray(arr[0])) { + if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr); + } + return arr; + } + function _2d(x) { + return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]); + } + function _3d(x) { + return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]); + } + function _4d(x) { + return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]); + } + function _intersect2d(p1a, p1b, p2a, p2b) { + const o1 = p1a; + const o2 = p2a; + const d1 = subtract(o1, p1b); + const d2 = subtract(o2, p2b); + const det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1])); + if (isZero(det)) return null; + if (smaller(abs(det), config.relTol)) { + return null; + } + const d20o11 = multiplyScalar(d2[0], o1[1]); + const d21o10 = multiplyScalar(d2[1], o1[0]); + const d20o21 = multiplyScalar(d2[0], o2[1]); + const d21o20 = multiplyScalar(d2[1], o2[0]); + const t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det); + return add(multiply(d1, t), o1); + } + function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) { + // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l) + const add1 = multiplyScalar(subtract(a, b), subtract(c, d)); + const add2 = multiplyScalar(subtract(e, f), subtract(g, h)); + const add3 = multiplyScalar(subtract(i, j), subtract(k, l)); + return addScalar(addScalar(add1, add2), add3); + } + function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) { + const d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3); + const d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1); + const d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1); + const d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3); + const d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1); + const numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343)); + const denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321)); + if (isZero(denominator)) return null; + const ta = divideScalar(numerator, denominator); + const tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343); + const pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1))); + const pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1))); + const paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1))); + const pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3))); + const pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3))); + const pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3))); + if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) { + return [pax, pay, paz]; + } else { + return null; + } + } + function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) { + const x1x = multiplyScalar(x1, x); + const x2x = multiplyScalar(x2, x); + const y1y = multiplyScalar(y1, y); + const y2y = multiplyScalar(y2, y); + const z1z = multiplyScalar(z1, z); + const z2z = multiplyScalar(z2, z); + const numerator = subtract(subtract(subtract(c, x1x), y1y), z1z); + const denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z); + const t = divideScalar(numerator, denominator); + const px = addScalar(x1, multiplyScalar(t, subtract(x2, x1))); + const py = addScalar(y1, multiplyScalar(t, subtract(y2, y1))); + const pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1))); + return [px, py, pz]; + // TODO: Add cases when line is parallel to the plane: + // (a) no intersection, + // (b) line contained in plane + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/and.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/and.js new file mode 100644 index 0000000..cb92ff1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/and.js @@ -0,0 +1,128 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAnd = void 0; +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); +var _matAlgo06xS0S = require("../../type/matrix/utils/matAlgo06xS0S0.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'and'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat']; +const createAnd = exports.createAnd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo06xS0S0 = (0, _matAlgo06xS0S.createMatAlgo06xS0S0)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.and(x, y) + * + * Examples: + * + * math.and(2, 4) // returns true + * + * a = [2, 0, 0] + * b = [3, 7, 0] + * c = 0 + * + * math.and(a, b) // returns [true, false, false] + * math.and(a, c) // returns [false, false, false] + * + * See also: + * + * not, or, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when both inputs are defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': _index.andNumber, + 'Complex, Complex': function (x, y) { + return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0); + }, + 'BigNumber, BigNumber': function (x, y) { + return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN(); + }, + 'bigint, bigint': _index.andNumber, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)), + 'SparseMatrix, any': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(y)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, any': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(y)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo14xDs(x, y, self, false); + }), + 'any, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(x)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo11xS0s(y, x, self, true); + }), + 'any, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(x)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo14xDs(y, x, self, true); + }), + 'Array, any': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return self(matrix(x), y).valueOf(); + }), + 'any, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return self(x, matrix(y)).valueOf(); + }) + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/not.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/not.js new file mode 100644 index 0000000..bc38d42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/not.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNot = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'not'; +const dependencies = ['typed']; +const createNot = exports.createNot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Logical `not`. Flips boolean value of a given parameter. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.not(x) + * + * Examples: + * + * math.not(2) // returns false + * math.not(0) // returns true + * math.not(true) // returns false + * + * a = [2, -7, 0] + * math.not(a) // returns [false, false, true] + * + * See also: + * + * and, or, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @return {boolean | Array | Matrix} + * Returns true when input is a zero or empty value. + */ + return typed(name, { + 'null | undefined': () => true, + number: _index.notNumber, + Complex: function (x) { + return x.re === 0 && x.im === 0; + }, + BigNumber: function (x) { + return x.isZero() || x.isNaN(); + }, + bigint: x => !x, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/or.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/or.js new file mode 100644 index 0000000..8680743 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/or.js @@ -0,0 +1,83 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createOr = void 0; +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo05xSfSf = require("../../type/matrix/utils/matAlgo05xSfSf.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'or'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +const createOr = exports.createOr = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo05xSfSf = (0, _matAlgo05xSfSf.createMatAlgo05xSfSf)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.or(x, y) + * + * Examples: + * + * math.or(2, 4) // returns true + * + * a = [2, 5, 0] + * b = [0, 22, 0] + * c = 0 + * + * math.or(a, b) // returns [true, true, false] + * math.or(b, c) // returns [false, true, false] + * + * See also: + * + * and, not, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when one of the inputs is defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': _index.orNumber, + 'Complex, Complex': function (x, y) { + return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0; + }, + 'BigNumber, BigNumber': function (x, y) { + return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN(); + }, + 'bigint, bigint': _index.orNumber, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)) + }, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/xor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/xor.js new file mode 100644 index 0000000..dccfa8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/logical/xor.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createXor = void 0; +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _index = require("../../plain/number/index.js"); +const name = 'xor'; +const dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat']; +const createXor = exports.createXor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.xor(x, y) + * + * Examples: + * + * math.xor(2, 4) // returns false + * + * a = [2, 0, 0] + * b = [2, 7, 0] + * c = 0 + * + * math.xor(a, b) // returns [false, true, false] + * math.xor(a, c) // returns [true, false, false] + * + * See also: + * + * and, not, or + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when one and only one input is defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': _index.xorNumber, + 'Complex, Complex': function (x, y) { + return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0); + }, + 'bigint, bigint': _index.xorNumber, + 'BigNumber, BigNumber': function (x, y) { + return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN()); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)) + }, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/apply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/apply.js new file mode 100644 index 0000000..4942d9f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/apply.js @@ -0,0 +1,117 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createApply = void 0; +var _factory = require("../../utils/factory.js"); +var _array = require("../../utils/array.js"); +var _is = require("../../utils/is.js"); +var _IndexError = require("../../error/IndexError.js"); +const name = 'apply'; +const dependencies = ['typed', 'isInteger']; +const createApply = exports.createApply = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isInteger + } = _ref; + /** + * Apply a function that maps an array to a scalar + * along a given axis of a matrix or array. + * Returns a new matrix or array with one less dimension than the input. + * + * Syntax: + * + * math.apply(A, dim, callback) + * + * Where: + * + * - `dim: number` is a zero-based dimension over which to concatenate the matrices. + * + * Examples: + * + * const A = [[1, 2], [3, 4]] + * const sum = math.sum + * + * math.apply(A, 0, sum) // returns [4, 6] + * math.apply(A, 1, sum) // returns [3, 7] + * + * See also: + * + * map, filter, forEach + * + * @param {Array | Matrix} array The input Matrix + * @param {number} dim The dimension along which the callback is applied + * @param {Function} callback The callback function that is applied. This Function + * should take an array or 1-d matrix as an input and + * return a number. + * @return {Array | Matrix} res The residual matrix with the function applied over some dimension. + */ + return typed(name, { + 'Array | Matrix, number | BigNumber, function': function (mat, dim, callback) { + if (!isInteger(dim)) { + throw new TypeError('Integer number expected for dimension'); + } + const size = Array.isArray(mat) ? (0, _array.arraySize)(mat) : mat.size(); + if (dim < 0 || dim >= size.length) { + throw new _IndexError.IndexError(dim, size.length); + } + if ((0, _is.isMatrix)(mat)) { + return mat.create(_apply(mat.valueOf(), dim, callback), mat.datatype()); + } else { + return _apply(mat, dim, callback); + } + } + }); +}); + +/** + * Recursively reduce a matrix + * @param {Array} mat + * @param {number} dim + * @param {Function} callback + * @returns {Array} ret + * @private + */ +function _apply(mat, dim, callback) { + let i, ret, tran; + if (dim <= 0) { + if (!Array.isArray(mat[0])) { + return callback(mat); + } else { + tran = _switch(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _apply(tran[i], dim - 1, callback); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _apply(mat[i], dim - 1, callback); + } + return ret; + } +} + +/** + * Transpose a matrix + * @param {Array} mat + * @returns {Array} ret + * @private + */ +function _switch(mat) { + const I = mat.length; + const J = mat[0].length; + let i, j; + const ret = []; + for (j = 0; j < J; j++) { + const tmp = []; + for (i = 0; i < I; i++) { + tmp.push(mat[i][j]); + } + ret.push(tmp); + } + return ret; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/column.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/column.js new file mode 100644 index 0000000..9646021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/column.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createColumn = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +const name = 'column'; +const dependencies = ['typed', 'Index', 'matrix', 'range']; +const createColumn = exports.createColumn = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Index, + matrix, + range + } = _ref; + /** + * Return a column from a Matrix. + * + * Syntax: + * + * math.column(value, index) + * + * Example: + * + * // get a column + * const d = [[1, 2], [3, 4]] + * math.column(d, 1) // returns [[2], [4]] + * + * See also: + * + * row + * + * @param {Array | Matrix } value An array or matrix + * @param {number} column The index of the column + * @return {Array | Matrix} The retrieved column + */ + return typed(name, { + 'Matrix, number': _column, + 'Array, number': function (value, column) { + return _column(matrix((0, _object.clone)(value)), column).valueOf(); + } + }); + + /** + * Retrieve a column of a matrix + * @param {Matrix } value A matrix + * @param {number} column The index of the column + * @return {Matrix} The retrieved column + */ + function _column(value, column) { + // check dimensions + if (value.size().length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + (0, _array.validateIndex)(column, value.size()[1]); + const rowRange = range(0, value.size()[0]); + const index = new Index(rowRange, column); + const result = value.subset(index); + return (0, _is.isMatrix)(result) ? result : matrix([[result]]); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/concat.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/concat.js new file mode 100644 index 0000000..785e0e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/concat.js @@ -0,0 +1,110 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConcat = void 0; +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +var _IndexError = require("../../error/IndexError.js"); +var _DimensionError = require("../../error/DimensionError.js"); +var _factory = require("../../utils/factory.js"); +const name = 'concat'; +const dependencies = ['typed', 'matrix', 'isInteger']; +const createConcat = exports.createConcat = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + isInteger + } = _ref; + /** + * Concatenate two or more matrices. + * + * Syntax: + * + * math.concat(A, B, C, ...) + * math.concat(A, B, C, ..., dim) + * + * Where: + * + * - `dim: number` is a zero-based dimension over which to concatenate the matrices. + * By default the last dimension of the matrices. + * + * Examples: + * + * const A = [[1, 2], [5, 6]] + * const B = [[3, 4], [7, 8]] + * + * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]] + * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]] + * math.concat('hello', ' ', 'world') // returns 'hello world' + * + * See also: + * + * size, squeeze, subset, transpose + * + * @param {... Array | Matrix} args Two or more matrices + * @return {Array | Matrix} Concatenated matrix + */ + return typed(name, { + // TODO: change signature to '...Array | Matrix, dim?' when supported + '...Array | Matrix | number | BigNumber': function (args) { + let i; + const len = args.length; + let dim = -1; // zero-based dimension + let prevDim; + let asMatrix = false; + const matrices = []; // contains multi dimensional arrays + + for (i = 0; i < len; i++) { + const arg = args[i]; + + // test whether we need to return a Matrix (if not we return an Array) + if ((0, _is.isMatrix)(arg)) { + asMatrix = true; + } + if ((0, _is.isNumber)(arg) || (0, _is.isBigNumber)(arg)) { + if (i !== len - 1) { + throw new Error('Dimension must be specified as last argument'); + } + + // last argument contains the dimension on which to concatenate + prevDim = dim; + dim = arg.valueOf(); // change BigNumber to number + + if (!isInteger(dim)) { + throw new TypeError('Integer number expected for dimension'); + } + if (dim < 0 || i > 0 && dim > prevDim) { + // TODO: would be more clear when throwing a DimensionError here + throw new _IndexError.IndexError(dim, prevDim + 1); + } + } else { + // this is a matrix or array + const m = (0, _object.clone)(arg).valueOf(); + const size = (0, _array.arraySize)(m); + matrices[i] = m; + prevDim = dim; + dim = size.length - 1; + + // verify whether each of the matrices has the same number of dimensions + if (i > 0 && dim !== prevDim) { + throw new _DimensionError.DimensionError(prevDim + 1, dim + 1); + } + } + } + if (matrices.length === 0) { + throw new SyntaxError('At least one matrix expected'); + } + let res = matrices.shift(); + while (matrices.length) { + res = (0, _array.concat)(res, matrices.shift(), dim); + } + return asMatrix ? matrix(res) : res; + }, + '...string': function (args) { + return args.join(''); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/count.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/count.js new file mode 100644 index 0000000..508d2cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/count.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCount = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'count'; +const dependencies = ['typed', 'size', 'prod']; +const createCount = exports.createCount = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + prod + } = _ref; + /** + * Count the number of elements of a matrix, array or string. + * + * Syntax: + * + * math.count(x) + * + * Examples: + * + * math.count('hello world') // returns 11 + * const A = [[1, 2, 3], [4, 5, 6]] + * math.count(A) // returns 6 + * math.count(math.range(1,6)) // returns 5 + * + * See also: + * + * size + * + * @param {string | Array | Matrix} x A matrix or string + * @return {number} An integer with the elements in `x`. + */ + return typed(name, { + string: function (x) { + return x.length; + }, + 'Matrix | Array': function (x) { + return prod(size(x)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/cross.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/cross.js new file mode 100644 index 0000000..9394464 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/cross.js @@ -0,0 +1,87 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCross = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'cross'; +const dependencies = ['typed', 'matrix', 'subtract', 'multiply']; +const createCross = exports.createCross = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + subtract, + multiply + } = _ref; + /** + * Calculate the cross product for two vectors in three dimensional space. + * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined + * as: + * + * cross(A, B) = [ + * a2 * b3 - a3 * b2, + * a3 * b1 - a1 * b3, + * a1 * b2 - a2 * b1 + * ] + * + * If one of the input vectors has a dimension greater than 1, the output + * vector will be a 1x3 (2-dimensional) matrix. + * + * Syntax: + * + * math.cross(x, y) + * + * Examples: + * + * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1] + * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39] + * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3] + * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]] + * + * See also: + * + * dot, multiply + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {Array | Matrix} Returns the cross product of `x` and `y` + */ + return typed(name, { + 'Matrix, Matrix': function (x, y) { + return matrix(_cross(x.toArray(), y.toArray())); + }, + 'Matrix, Array': function (x, y) { + return matrix(_cross(x.toArray(), y)); + }, + 'Array, Matrix': function (x, y) { + return matrix(_cross(x, y.toArray())); + }, + 'Array, Array': _cross + }); + + /** + * Calculate the cross product for two arrays + * @param {Array} x First vector + * @param {Array} y Second vector + * @returns {Array} Returns the cross product of x and y + * @private + */ + function _cross(x, y) { + const highestDimension = Math.max((0, _array.arraySize)(x).length, (0, _array.arraySize)(y).length); + x = (0, _array.squeeze)(x); + y = (0, _array.squeeze)(y); + const xSize = (0, _array.arraySize)(x); + const ySize = (0, _array.arraySize)(y); + if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) { + throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])'); + } + const product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))]; + if (highestDimension > 1) { + return [product]; + } else { + return product; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js new file mode 100644 index 0000000..0e85a3b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCtranspose = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'ctranspose'; +const dependencies = ['typed', 'transpose', 'conj']; +const createCtranspose = exports.createCtranspose = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + transpose, + conj + } = _ref; + /** + * Transpose and complex conjugate a matrix. All values of the matrix are + * reflected over its main diagonal and then the complex conjugate is + * taken. This is equivalent to complex conjugation for scalars and + * vectors. + * + * Syntax: + * + * math.ctranspose(x) + * + * Examples: + * + * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]] + * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]] + * + * See also: + * + * transpose, diag, inv, subset, squeeze + * + * @param {Array | Matrix} x Matrix to be ctransposed + * @return {Array | Matrix} The ctransposed matrix + */ + return typed(name, { + any: function (x) { + return conj(transpose(x)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/det.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/det.js new file mode 100644 index 0000000..81e9eb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/det.js @@ -0,0 +1,148 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDet = void 0; +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +const name = 'det'; +const dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus']; +const createDet = exports.createDet = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + subtractScalar, + multiply, + divideScalar, + isZero, + unaryMinus + } = _ref; + /** + * Calculate the determinant of a matrix. + * + * Syntax: + * + * math.det(x) + * + * Examples: + * + * math.det([[1, 2], [3, 4]]) // returns -2 + * + * const A = [ + * [-2, 2, 3], + * [-1, 1, 3], + * [2, 0, -1] + * ] + * math.det(A) // returns 6 + * + * See also: + * + * inv + * + * @param {Array | Matrix} x A matrix + * @return {number} The determinant of `x` + */ + return typed(name, { + any: function (x) { + return (0, _object.clone)(x); + }, + 'Array | Matrix': function det(x) { + let size; + if ((0, _is.isMatrix)(x)) { + size = x.size(); + } else if (Array.isArray(x)) { + x = matrix(x); + size = x.size(); + } else { + // a scalar + size = []; + } + switch (size.length) { + case 0: + // scalar + return (0, _object.clone)(x); + case 1: + // vector + if (size[0] === 1) { + return (0, _object.clone)(x.valueOf()[0]); + } + if (size[0] === 0) { + return 1; // det of an empty matrix is per definition 1 + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + case 2: + { + // two-dimensional array + const rows = size[0]; + const cols = size[1]; + if (rows === cols) { + return _det(x.clone().valueOf(), rows, cols); + } + if (cols === 0) { + return 1; // det of an empty matrix is per definition 1 + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + (0, _string.format)(size) + ')'); + } + } + }); + + /** + * Calculate the determinant of a matrix + * @param {Array[]} matrix A square, two dimensional matrix + * @param {number} rows Number of rows of the matrix (zero-based) + * @param {number} cols Number of columns of the matrix (zero-based) + * @returns {number} det + * @private + */ + function _det(matrix, rows, cols) { + if (rows === 1) { + // this is a 1 x 1 matrix + return (0, _object.clone)(matrix[0][0]); + } else if (rows === 2) { + // this is a 2 x 2 matrix + // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12 + return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1])); + } else { + // Bareiss algorithm + // this algorithm have same complexity as LUP decomposition (O(n^3)) + // but it preserve precision of floating point more relative to the LUP decomposition + let negated = false; + const rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i + for (let k = 0; k < rows; k++) { + let k_ = rowIndices[k]; + if (isZero(matrix[k_][k])) { + let _k; + for (_k = k + 1; _k < rows; _k++) { + if (!isZero(matrix[rowIndices[_k]][k])) { + k_ = rowIndices[_k]; + rowIndices[_k] = rowIndices[k]; + rowIndices[k] = k_; + negated = !negated; + break; + } + } + if (_k === rows) return matrix[k_][k]; // some zero of the type + } + const piv = matrix[k_][k]; + const piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1]; + for (let i = k + 1; i < rows; i++) { + const i_ = rowIndices[i]; + for (let j = k + 1; j < rows; j++) { + matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_); + } + } + } + const det = matrix[rowIndices[rows - 1]][rows - 1]; + return negated ? unaryMinus(det) : det; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diag.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diag.js new file mode 100644 index 0000000..c87efdd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diag.js @@ -0,0 +1,161 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDiag = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'diag'; +const dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix']; +const createDiag = exports.createDiag = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a diagonal matrix or retrieve the diagonal of a matrix + * + * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned. + * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector. + * When k is positive, the values are placed on the super diagonal. + * When k is negative, the values are placed on the sub diagonal. + * + * Syntax: + * + * math.diag(X) + * math.diag(X, format) + * math.diag(X, k) + * math.diag(X, k, format) + * + * Examples: + * + * // create a diagonal matrix + * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]] + * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]] + * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]] + * + * // retrieve the diagonal from a matrix + * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] + * math.diag(a) // returns [1, 5, 9] + * + * See also: + * + * ones, zeros, identity + * + * @param {Matrix | Array} x A two dimensional matrix or a vector + * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled + * in or retrieved. + * @param {string} [format='dense'] The matrix storage format. + * + * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix. + */ + return typed(name, { + // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments + + Array: function (x) { + return _diag(x, 0, (0, _array.arraySize)(x), null); + }, + 'Array, number': function (x, k) { + return _diag(x, k, (0, _array.arraySize)(x), null); + }, + 'Array, BigNumber': function (x, k) { + return _diag(x, k.toNumber(), (0, _array.arraySize)(x), null); + }, + 'Array, string': function (x, format) { + return _diag(x, 0, (0, _array.arraySize)(x), format); + }, + 'Array, number, string': function (x, k, format) { + return _diag(x, k, (0, _array.arraySize)(x), format); + }, + 'Array, BigNumber, string': function (x, k, format) { + return _diag(x, k.toNumber(), (0, _array.arraySize)(x), format); + }, + Matrix: function (x) { + return _diag(x, 0, x.size(), x.storage()); + }, + 'Matrix, number': function (x, k) { + return _diag(x, k, x.size(), x.storage()); + }, + 'Matrix, BigNumber': function (x, k) { + return _diag(x, k.toNumber(), x.size(), x.storage()); + }, + 'Matrix, string': function (x, format) { + return _diag(x, 0, x.size(), format); + }, + 'Matrix, number, string': function (x, k, format) { + return _diag(x, k, x.size(), format); + }, + 'Matrix, BigNumber, string': function (x, k, format) { + return _diag(x, k.toNumber(), x.size(), format); + } + }); + + /** + * Creeate diagonal matrix from a vector or vice versa + * @param {Array | Matrix} x + * @param {number} k + * @param {string} format Storage format for matrix. If null, + * an Array is returned + * @returns {Array | Matrix} + * @private + */ + function _diag(x, k, size, format) { + if (!(0, _number.isInteger)(k)) { + throw new TypeError('Second parameter in function diag must be an integer'); + } + const kSuper = k > 0 ? k : 0; + const kSub = k < 0 ? -k : 0; + + // check dimensions + switch (size.length) { + case 1: + return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper); + case 2: + return _getDiagonal(x, k, format, size, kSub, kSuper); + } + throw new RangeError('Matrix for function diag must be 2 dimensional'); + } + function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) { + // matrix size + const ms = [l + kSub, l + kSuper]; + if (format && format !== 'sparse' && format !== 'dense') { + throw new TypeError(`Unknown matrix type ${format}"`); + } + + // create diagonal matrix + const m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k); + // check we need to return a matrix + return format !== null ? m : m.valueOf(); + } + function _getDiagonal(x, k, format, s, kSub, kSuper) { + // check x is a Matrix + if ((0, _is.isMatrix)(x)) { + // get diagonal matrix + const dm = x.diagonal(k); + // check we need to return a matrix + if (format !== null) { + // check we need to change matrix format + if (format !== dm.storage()) { + return matrix(dm, format); + } + return dm; + } + return dm.valueOf(); + } + // vector size + const n = Math.min(s[0] - kSub, s[1] - kSuper); + // diagonal values + const vector = []; + // loop diagonal + for (let i = 0; i < n; i++) { + vector[i] = x[i + kSub][i + kSuper]; + } + // check we need to return a matrix + return format !== null ? matrix(vector) : vector; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diff.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diff.js new file mode 100644 index 0000000..a41ffe8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/diff.js @@ -0,0 +1,169 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDiff = void 0; +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _is = require("../../utils/is.js"); +const name = 'diff'; +const dependencies = ['typed', 'matrix', 'subtract', 'number']; +const createDiff = exports.createDiff = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + subtract, + number + } = _ref; + /** + * Create a new matrix or array of the difference between elements of the given array + * The optional dim parameter lets you specify the dimension to evaluate the difference of + * If no dimension parameter is passed it is assumed as dimension 0 + * + * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber + * Arrays must be 'rectangular' meaning arrays like [1, 2] + * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays + * + * Syntax: + * + * math.diff(arr) + * math.diff(arr, dim) + * + * Examples: + * + * const arr = [1, 2, 4, 7, 0] + * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed) + * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7] + * + * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]] + * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * + * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3 + * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed + * + * // These will all produce the same result + * math.diff([[1, 2], [3, 4]]) + * math.diff([math.matrix([1, 2]), math.matrix([3, 4])]) + * math.diff([[1, 2], math.matrix([3, 4])]) + * math.diff([math.matrix([1, 2]), [3, 4]]) + * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix + * + * See Also: + * + * sum + * subtract + * partitionSelect + * + * @param {Array | Matrix} arr An array or matrix + * @param {number | BigNumber} dim Dimension + * @return {Array | Matrix} Difference between array elements in given dimension + */ + return typed(name, { + 'Array | Matrix': function (arr) { + // No dimension specified => assume dimension 0 + if ((0, _is.isMatrix)(arr)) { + return matrix(_diff(arr.toArray())); + } else { + return _diff(arr); + } + }, + 'Array | Matrix, number': function (arr, dim) { + if (!(0, _number.isInteger)(dim)) throw new RangeError('Dimension must be a whole number'); + if ((0, _is.isMatrix)(arr)) { + return matrix(_recursive(arr.toArray(), dim)); + } else { + return _recursive(arr, dim); + } + }, + 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))), + 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim))) + }); + + /** + * Recursively find the correct dimension in the array/matrix + * Then Apply _diff to that dimension + * + * @param {Array} arr The array + * @param {number} dim Dimension + * @return {Array} resulting array + */ + function _recursive(arr, dim) { + if ((0, _is.isMatrix)(arr)) { + arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly + } + if (!Array.isArray(arr)) { + throw RangeError('Array/Matrix does not have that many dimensions'); + } + if (dim > 0) { + const result = []; + arr.forEach(element => { + result.push(_recursive(element, dim - 1)); + }); + return result; + } else if (dim === 0) { + return _diff(arr); + } else { + throw RangeError('Cannot have negative dimension'); + } + } + + /** + * Difference between elements in the array + * + * @param {Array} arr An array + * @return {Array} resulting array + */ + function _diff(arr) { + const result = []; + const size = arr.length; + for (let i = 1; i < size; i++) { + result.push(_ElementDiff(arr[i - 1], arr[i])); + } + return result; + } + + /** + * Difference between 2 objects + * + * @param {Object} obj1 First object + * @param {Object} obj2 Second object + * @return {Array} resulting array + */ + function _ElementDiff(obj1, obj2) { + // Convert matrices to arrays + if ((0, _is.isMatrix)(obj1)) obj1 = obj1.toArray(); + if ((0, _is.isMatrix)(obj2)) obj2 = obj2.toArray(); + const obj1IsArray = Array.isArray(obj1); + const obj2IsArray = Array.isArray(obj2); + if (obj1IsArray && obj2IsArray) { + return _ArrayDiff(obj1, obj2); + } + if (!obj1IsArray && !obj2IsArray) { + return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second) + } + throw TypeError('Cannot calculate difference between 1 array and 1 non-array'); + } + + /** + * Difference of elements in 2 arrays + * + * @param {Array} arr1 Array 1 + * @param {Array} arr2 Array 2 + * @return {Array} resulting array + */ + function _ArrayDiff(arr1, arr2) { + if (arr1.length !== arr2.length) { + throw RangeError('Not all sub-arrays have the same length'); + } + const result = []; + const size = arr1.length; + for (let i = 0; i < size; i++) { + result.push(_ElementDiff(arr1[i], arr2[i])); + } + return result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/dot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/dot.js new file mode 100644 index 0000000..c04627c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/dot.js @@ -0,0 +1,162 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDot = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'dot'; +const dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size']; +const createDot = exports.createDot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + addScalar, + multiplyScalar, + conj, + size + } = _ref; + /** + * Calculate the dot product of two vectors. The dot product of + * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as: + * + * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn + * + * Syntax: + * + * math.dot(x, y) + * + * Examples: + * + * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15 + * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15 + * + * See also: + * + * multiply, cross + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {number} Returns the dot product of `x` and `y` + */ + return typed(name, { + 'Array | DenseMatrix, Array | DenseMatrix': _denseDot, + 'SparseMatrix, SparseMatrix': _sparseDot + }); + function _validateDim(x, y) { + const xSize = _size(x); + const ySize = _size(y); + let xLen, yLen; + if (xSize.length === 1) { + xLen = xSize[0]; + } else if (xSize.length === 2 && xSize[1] === 1) { + xLen = xSize[0]; + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')'); + } + if (ySize.length === 1) { + yLen = ySize[0]; + } else if (ySize.length === 2 && ySize[1] === 1) { + yLen = ySize[0]; + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')'); + } + if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')'); + if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors'); + return xLen; + } + function _denseDot(a, b) { + const N = _validateDim(a, b); + const adata = (0, _is.isMatrix)(a) ? a._data : a; + const adt = (0, _is.isMatrix)(a) ? a._datatype || a.getDataType() : undefined; + const bdata = (0, _is.isMatrix)(b) ? b._data : b; + const bdt = (0, _is.isMatrix)(b) ? b._datatype || b.getDataType() : undefined; + + // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors) + const aIsColumn = _size(a).length === 2; + const bIsColumn = _size(b).length === 2; + let add = addScalar; + let mul = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + const dt = adt; + // find signatures that matches (dt, dt) + add = typed.find(addScalar, [dt, dt]); + mul = typed.find(multiplyScalar, [dt, dt]); + } + + // both vectors 1-dimensional + if (!aIsColumn && !bIsColumn) { + let c = mul(conj(adata[0]), bdata[0]); + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i]), bdata[i])); + } + return c; + } + + // a is 1-dim, b is column + if (!aIsColumn && bIsColumn) { + let c = mul(conj(adata[0]), bdata[0][0]); + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i]), bdata[i][0])); + } + return c; + } + + // a is column, b is 1-dim + if (aIsColumn && !bIsColumn) { + let c = mul(conj(adata[0][0]), bdata[0]); + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i][0]), bdata[i])); + } + return c; + } + + // both vectors are column + if (aIsColumn && bIsColumn) { + let c = mul(conj(adata[0][0]), bdata[0][0]); + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i][0]), bdata[i][0])); + } + return c; + } + } + function _sparseDot(x, y) { + _validateDim(x, y); + const xindex = x._index; + const xvalues = x._values; + const yindex = y._index; + const yvalues = y._values; + + // TODO optimize add & mul using datatype + let c = 0; + const add = addScalar; + const mul = multiplyScalar; + let i = 0; + let j = 0; + while (i < xindex.length && j < yindex.length) { + const I = xindex[i]; + const J = yindex[j]; + if (I < J) { + i++; + continue; + } + if (I > J) { + j++; + continue; + } + if (I === J) { + c = add(c, mul(xvalues[i], yvalues[j])); + i++; + j++; + } + } + return c; + } + + // TODO remove this once #1771 is fixed + function _size(x) { + return (0, _is.isMatrix)(x) ? x.size() : size(x); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs.js new file mode 100644 index 0000000..808caf2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs.js @@ -0,0 +1,335 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEigs = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _factory = require("../../utils/factory.js"); +var _string = require("../../utils/string.js"); +var _complexEigs = require("./eigs/complexEigs.js"); +var _realSymmetric = require("./eigs/realSymmetric.js"); +var _is = require("../../utils/is.js"); +const name = 'eigs'; + +// The absolute state of math.js's dependency system: +const dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'divideScalar', 'inv', 'bignumber', 'multiply', 'add', 'larger', 'column', 'flatten', 'number', 'complex', 'sqrt', 'diag', 'size', 'reshape', 'qr', 'usolve', 'usolveAll', 'im', 're', 'smaller', 'matrixFromColumns', 'dot']; +const createEigs = exports.createEigs = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + typed, + matrix, + addScalar, + subtract, + equal, + abs, + atan, + cos, + sin, + multiplyScalar, + divideScalar, + inv, + bignumber, + multiply, + add, + larger, + column, + flatten, + number, + complex, + sqrt, + diag, + size, + reshape, + qr, + usolve, + usolveAll, + im, + re, + smaller, + matrixFromColumns, + dot + } = _ref; + const doRealSymmetric = (0, _realSymmetric.createRealSymmetric)({ + config, + addScalar, + subtract, + column, + flatten, + equal, + abs, + atan, + cos, + sin, + multiplyScalar, + inv, + bignumber, + complex, + multiply, + add + }); + const doComplexEigs = (0, _complexEigs.createComplexEigs)({ + config, + addScalar, + subtract, + multiply, + multiplyScalar, + flatten, + divideScalar, + sqrt, + abs, + bignumber, + diag, + size, + reshape, + qr, + inv, + usolve, + usolveAll, + equal, + complex, + larger, + smaller, + matrixFromColumns, + dot + }); + + /** + * Compute eigenvalues and optionally eigenvectors of a square matrix. + * The eigenvalues are sorted by their absolute value, ascending, and + * returned as a vector in the `values` property of the returned project. + * An eigenvalue with algebraic multiplicity k will be listed k times, so + * that the returned `values` vector always has length equal to the size + * of the input matrix. + * + * The `eigenvectors` property of the return value provides the eigenvectors. + * It is an array of plain objects: the `value` property of each gives the + * associated eigenvalue, and the `vector` property gives the eigenvector + * itself. Note that the same `value` property will occur as many times in + * the list provided by `eigenvectors` as the geometric multiplicity of + * that value. + * + * If the algorithm fails to converge, it will throw an error – + * in that case, however, you may still find useful information + * in `err.values` and `err.vectors`. + * + * Note that the 'precision' option does not directly specify the _accuracy_ + * of the returned eigenvalues. Rather, it determines how small an entry + * of the iterative approximations to an upper triangular matrix must be + * in order to be considered zero. The actual accuracy of the returned + * eigenvalues may be greater or less than the precision, depending on the + * conditioning of the matrix and how far apart or close the actual + * eigenvalues are. Note that currently, relatively simple, "traditional" + * methods of eigenvalue computation are being used; this is not a modern, + * high-precision eigenvalue computation. That said, it should typically + * produce fairly reasonable results. + * + * Syntax: + * + * math.eigs(x, [prec]) + * math.eigs(x, {options}) + * + * Examples: + * + * const { eigs, multiply, column, transpose, matrixFromColumns } = math + * const H = [[5, 2.3], [2.3, 1]] + * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...] + * const E = ans.values + * const V = ans.eigenvectors + * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector)) + * const U = matrixFromColumns(...V.map(obj => obj.vector)) + * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible + * E[0] == UTxHxU[0][0] // returns true always + * + * // Compute only approximate eigenvalues: + * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6}) + * + * See also: + * + * inv + * + * @param {Array | Matrix} x Matrix to be diagonalized + * + * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision. + * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested. + * + */ + return typed('eigs', { + // The conversion to matrix in the first two implementations, + // just to convert back to an array right away in + // computeValuesAndVectors, is unfortunate, and should perhaps be + // streamlined. It is done because the Matrix object carries some + // type information about its entries, and so constructing the matrix + // is a roundabout way of doing type detection. + Array: function (x) { + return doEigs(matrix(x)); + }, + 'Array, number|BigNumber': function (x, prec) { + return doEigs(matrix(x), { + precision: prec + }); + }, + 'Array, Object'(x, opts) { + return doEigs(matrix(x), opts); + }, + Matrix: function (mat) { + return doEigs(mat, { + matricize: true + }); + }, + 'Matrix, number|BigNumber': function (mat, prec) { + return doEigs(mat, { + precision: prec, + matricize: true + }); + }, + 'Matrix, Object': function (mat, opts) { + const useOpts = { + matricize: true + }; + (0, _extends2.default)(useOpts, opts); + return doEigs(mat, useOpts); + } + }); + function doEigs(mat) { + var _opts$precision; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true; + const prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol; + const result = computeValuesAndVectors(mat, prec, computeVectors); + if (opts.matricize) { + result.values = matrix(result.values); + if (computeVectors) { + result.eigenvectors = result.eigenvectors.map(_ref2 => { + let { + value, + vector + } = _ref2; + return { + value, + vector: matrix(vector) + }; + }); + } + } + if (computeVectors) { + Object.defineProperty(result, 'vectors', { + enumerable: false, + // to make sure that the eigenvectors can still be + // converted to string. + get: () => { + throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors'); + } + }); + } + return result; + } + function computeValuesAndVectors(mat, prec, computeVectors) { + const arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased + // and so safe to modify in place + const asize = mat.size(); + if (asize.length !== 2 || asize[0] !== asize[1]) { + throw new RangeError(`Matrix must be square (size: ${(0, _string.format)(asize)})`); + } + const N = asize[0]; + if (isReal(arr, N, prec)) { + coerceReal(arr, N); // modifies arr by side effect + + if (isSymmetric(arr, N, prec)) { + const type = coerceTypes(mat, arr, N); // modifies arr by side effect + return doRealSymmetric(arr, N, prec, type, computeVectors); + } + } + const type = coerceTypes(mat, arr, N); // modifies arr by side effect + return doComplexEigs(arr, N, prec, type, computeVectors); + } + + /** @return {boolean} */ + function isSymmetric(arr, N, prec) { + for (let i = 0; i < N; i++) { + for (let j = i; j < N; j++) { + // TODO proper comparison of bignum and frac + if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) { + return false; + } + } + } + return true; + } + + /** @return {boolean} */ + function isReal(arr, N, prec) { + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + // TODO proper comparison of bignum and frac + if (larger(bignumber(abs(im(arr[i][j]))), prec)) { + return false; + } + } + } + return true; + } + function coerceReal(arr, N) { + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + arr[i][j] = re(arr[i][j]); + } + } + } + + /** @return {'number' | 'BigNumber' | 'Complex'} */ + function coerceTypes(mat, arr, N) { + /** @type {string} */ + const type = mat.datatype(); + if (type === 'number' || type === 'BigNumber' || type === 'Complex') { + return type; + } + let hasNumber = false; + let hasBig = false; + let hasComplex = false; + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + const el = arr[i][j]; + if ((0, _is.isNumber)(el) || (0, _is.isFraction)(el)) { + hasNumber = true; + } else if ((0, _is.isBigNumber)(el)) { + hasBig = true; + } else if ((0, _is.isComplex)(el)) { + hasComplex = true; + } else { + throw TypeError('Unsupported type in Matrix: ' + (0, _is.typeOf)(el)); + } + } + } + if (hasBig && hasComplex) { + console.warn('Complex BigNumbers not supported, this operation will lose precission.'); + } + if (hasComplex) { + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + arr[i][j] = complex(arr[i][j]); + } + } + return 'Complex'; + } + if (hasBig) { + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + arr[i][j] = bignumber(arr[i][j]); + } + } + return 'BigNumber'; + } + if (hasNumber) { + for (let i = 0; i < N; i++) { + for (let j = 0; j < N; j++) { + arr[i][j] = number(arr[i][j]); + } + } + return 'number'; + } else { + throw TypeError('Matrix contains unsupported types only.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js new file mode 100644 index 0000000..d9c7e42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js @@ -0,0 +1,701 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createComplexEigs = createComplexEigs; +var _object = require("../../../utils/object.js"); +function createComplexEigs(_ref) { + let { + addScalar, + subtract, + flatten, + multiply, + multiplyScalar, + divideScalar, + sqrt, + abs, + bignumber, + diag, + size, + reshape, + inv, + qr, + usolve, + usolveAll, + equal, + complex, + larger, + smaller, + matrixFromColumns, + dot + } = _ref; + /** + * @param {number[][]} arr the matrix to find eigenvalues of + * @param {number} N size of the matrix + * @param {number|BigNumber} prec precision, anything lower will be considered zero + * @param {'number'|'BigNumber'|'Complex'} type + * @param {boolean} findVectors should we find eigenvectors? + * + * @returns {{ values: number[], vectors: number[][] }} + */ + function complexEigs(arr, N, prec, type) { + let findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + // TODO check if any row/col are zero except the diagonal + + // make sure corresponding rows and columns have similar magnitude + // important because of numerical stability + // MODIFIES arr by side effect! + const R = balance(arr, N, prec, type, findVectors); + + // R is the row transformation matrix + // arr = A' = R A R^-1, A is the original matrix + // (if findVectors is false, R is undefined) + // (And so to return to original matrix: A = R^-1 arr R) + + // TODO if magnitudes of elements vary over many orders, + // move greatest elements to the top left corner + + // using similarity transformations, reduce the matrix + // to Hessenberg form (upper triangular plus one subdiagonal row) + // updates the transformation matrix R with new row operationsq + // MODIFIES arr by side effect! + reduceToHessenberg(arr, N, prec, type, findVectors, R); + // still true that original A = R^-1 arr R) + + // find eigenvalues + const { + values, + C + } = iterateUntilTriangular(arr, N, prec, type, findVectors); + + // values is the list of eigenvalues, C is the column + // transformation matrix that transforms arr, the hessenberg + // matrix, to upper triangular + // (So U = C^-1 arr C and the relationship between current arr + // and original A is unchanged.) + + if (findVectors) { + const eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type); + return { + values, + eigenvectors + }; + } + return { + values + }; + } + + /** + * @param {number[][]} arr + * @param {number} N + * @param {number} prec + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {number[][]} + */ + function balance(arr, N, prec, type, findVectors) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const realzero = big ? bignumber(0) : 0; + const one = big ? bignumber(1) : cplx ? complex(1) : 1; + const realone = big ? bignumber(1) : 1; + + // base of the floating-point arithmetic + const radix = big ? bignumber(10) : 2; + const radixSq = multiplyScalar(radix, radix); + + // the diagonal transformation matrix R + let Rdiag; + if (findVectors) { + Rdiag = Array(N).fill(one); + } + + // this isn't the only time we loop thru the matrix... + let last = false; + while (!last) { + // ...haha I'm joking! unless... + last = true; + for (let i = 0; i < N; i++) { + // compute the taxicab norm of i-th column and row + // TODO optimize for complex numbers + let colNorm = realzero; + let rowNorm = realzero; + for (let j = 0; j < N; j++) { + if (i === j) continue; + colNorm = addScalar(colNorm, abs(arr[j][i])); + rowNorm = addScalar(rowNorm, abs(arr[i][j])); + } + if (!equal(colNorm, 0) && !equal(rowNorm, 0)) { + // find integer power closest to balancing the matrix + // (we want to scale only by integer powers of radix, + // so that we don't lose any precision due to round-off) + + let f = realone; + let c = colNorm; + const rowDivRadix = divideScalar(rowNorm, radix); + const rowMulRadix = multiplyScalar(rowNorm, radix); + while (smaller(c, rowDivRadix)) { + c = multiplyScalar(c, radixSq); + f = multiplyScalar(f, radix); + } + while (larger(c, rowMulRadix)) { + c = divideScalar(c, radixSq); + f = divideScalar(f, radix); + } + + // check whether balancing is needed + // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm) + const condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95)); + + // apply balancing similarity transformation + if (condition) { + // we should loop once again to check whether + // another rebalancing is needed + last = false; + const g = divideScalar(1, f); + for (let j = 0; j < N; j++) { + if (i === j) { + continue; + } + arr[i][j] = multiplyScalar(arr[i][j], g); + arr[j][i] = multiplyScalar(arr[j][i], f); + } + + // keep track of transformations + if (findVectors) { + Rdiag[i] = multiplyScalar(Rdiag[i], g); + } + } + } + } + } + + // return the diagonal row transformation matrix + return findVectors ? diag(Rdiag) : null; + } + + /** + * @param {number[][]} arr + * @param {number} N + * @param {number} prec + * @param {'number'|'BigNumber'|'Complex'} type + * @param {boolean} findVectors + * @param {number[][]} R the row transformation matrix that will be modified + */ + function reduceToHessenberg(arr, N, prec, type, findVectors, R) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const zero = big ? bignumber(0) : cplx ? complex(0) : 0; + if (big) { + prec = bignumber(prec); + } + for (let i = 0; i < N - 2; i++) { + // Find the largest subdiag element in the i-th col + + let maxIndex = 0; + let max = zero; + for (let j = i + 1; j < N; j++) { + const el = arr[j][i]; + if (smaller(abs(max), abs(el))) { + max = el; + maxIndex = j; + } + } + + // This col is pivoted, no need to do anything + if (smaller(abs(max), prec)) { + continue; + } + if (maxIndex !== i + 1) { + // Interchange maxIndex-th and (i+1)-th row + const tmp1 = arr[maxIndex]; + arr[maxIndex] = arr[i + 1]; + arr[i + 1] = tmp1; + + // Interchange maxIndex-th and (i+1)-th column + for (let j = 0; j < N; j++) { + const tmp2 = arr[j][maxIndex]; + arr[j][maxIndex] = arr[j][i + 1]; + arr[j][i + 1] = tmp2; + } + + // keep track of transformations + if (findVectors) { + const tmp3 = R[maxIndex]; + R[maxIndex] = R[i + 1]; + R[i + 1] = tmp3; + } + } + + // Reduce following rows and columns + for (let j = i + 2; j < N; j++) { + const n = divideScalar(arr[j][i], max); + if (n === 0) { + continue; + } + + // from j-th row subtract n-times (i+1)th row + for (let k = 0; k < N; k++) { + arr[j][k] = subtract(arr[j][k], multiplyScalar(n, arr[i + 1][k])); + } + + // to (i+1)th column add n-times j-th column + for (let k = 0; k < N; k++) { + arr[k][i + 1] = addScalar(arr[k][i + 1], multiplyScalar(n, arr[k][j])); + } + + // keep track of transformations + if (findVectors) { + for (let k = 0; k < N; k++) { + R[j][k] = subtract(R[j][k], multiplyScalar(n, R[i + 1][k])); + } + } + } + } + return R; + } + + /** + * @returns {{values: values, C: Matrix}} + * @see Press, Wiliams: Numerical recipes in Fortran 77 + * @see https://en.wikipedia.org/wiki/QR_algorithm + */ + function iterateUntilTriangular(A, N, prec, type, findVectors) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const one = big ? bignumber(1) : cplx ? complex(1) : 1; + if (big) { + prec = bignumber(prec); + } + + // The Francis Algorithm + // The core idea of this algorithm is that doing successive + // A' = QtAQ transformations will eventually converge to block- + // upper-triangular with diagonal blocks either 1x1 or 2x2. + // The Q here is the one from the QR decomposition, A = QR. + // Since the eigenvalues of a block-upper-triangular matrix are + // the eigenvalues of its diagonal blocks and we know how to find + // eigenvalues of a 2x2 matrix, we know the eigenvalues of A. + + let arr = (0, _object.clone)(A); + + // the list of converged eigenvalues + const lambdas = []; + + // size of arr, which will get smaller as eigenvalues converge + let n = N; + + // the diagonal of the block-diagonal matrix that turns + // converged 2x2 matrices into upper triangular matrices + const Sdiag = []; + + // N×N matrix describing the overall transformation done during the QR algorithm + let Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined; + + // nxn matrix describing the QR transformations done since last convergence + let Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined; + + // last eigenvalue converged before this many steps + let lastConvergenceBefore = 0; + while (lastConvergenceBefore <= 100) { + lastConvergenceBefore += 1; + + // TODO if the convergence is slow, do something clever + + // Perform the factorization + + const k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat + // old-fashioned choice; ideally set close to an eigenvalue, or + // perhaps better yet switch to the implicit QR version that is sometimes + // specifically called the "Francis algorithm" that is alluded to + // in the following TODO. (Or perhaps we switch to an independently + // optimized third-party package for the linear algebra operations...) + + for (let i = 0; i < n; i++) { + arr[i][i] = subtract(arr[i][i], k); + } + + // TODO do an implicit QR transformation + const { + Q, + R + } = qr(arr); + arr = multiply(R, Q); + for (let i = 0; i < n; i++) { + arr[i][i] = addScalar(arr[i][i], k); + } + + // keep track of transformations + if (findVectors) { + Qpartial = multiply(Qpartial, Q); + } + + // The rightmost diagonal element converged to an eigenvalue + if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) { + lastConvergenceBefore = 0; + lambdas.push(arr[n - 1][n - 1]); + + // keep track of transformations + if (findVectors) { + Sdiag.unshift([[1]]); + inflateMatrix(Qpartial, N); + Qtotal = multiply(Qtotal, Qpartial); + if (n > 1) { + Qpartial = diag(Array(n - 1).fill(one)); + } + } + + // reduce the matrix size + n -= 1; + arr.pop(); + for (let i = 0; i < n; i++) { + arr[i].pop(); + } + + // The rightmost diagonal 2x2 block converged + } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) { + lastConvergenceBefore = 0; + const ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]); + lambdas.push(...ll); + + // keep track of transformations + if (findVectors) { + Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type)); + inflateMatrix(Qpartial, N); + Qtotal = multiply(Qtotal, Qpartial); + if (n > 2) { + Qpartial = diag(Array(n - 2).fill(one)); + } + } + + // reduce the matrix size + n -= 2; + arr.pop(); + arr.pop(); + for (let i = 0; i < n; i++) { + arr[i].pop(); + arr[i].pop(); + } + } + if (n === 0) { + break; + } + } + + // standard sorting + lambdas.sort((a, b) => +subtract(abs(a), abs(b))); + + // the algorithm didn't converge + if (lastConvergenceBefore > 100) { + const err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', ')); + err.values = lambdas; + err.vectors = []; + throw err; + } + + // combine the overall QR transformation Qtotal with the subsequent + // transformation S that turns the diagonal 2x2 blocks to upper triangular + const C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined; + return { + values: lambdas, + C + }; + } + + /** + * @param {Matrix} A hessenberg-form matrix + * @param {number} N size of A + * @param {Matrix} C column transformation matrix that turns A into upper triangular + * @param {Matrix} R similarity that turns original matrix into A + * @param {number[]} values array of eigenvalues of A + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {number[][]} eigenvalues + */ + function findEigenvectors(A, N, C, R, values, prec, type) { + const Cinv = inv(C); + const U = multiply(Cinv, A, C); + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const zero = big ? bignumber(0) : cplx ? complex(0) : 0; + const one = big ? bignumber(1) : cplx ? complex(1) : 1; + + // turn values into a kind of "multiset" + // this way it is easier to find eigenvectors + const uniqueValues = []; + const multiplicities = []; + for (const lambda of values) { + const i = indexOf(uniqueValues, lambda, equal); + if (i === -1) { + uniqueValues.push(lambda); + multiplicities.push(1); + } else { + multiplicities[i] += 1; + } + } + + // find eigenvectors by solving U − lambdaE = 0 + // TODO replace with an iterative eigenvector algorithm + // (this one might fail for imprecise eigenvalues) + + const vectors = []; + const len = uniqueValues.length; + const b = Array(N).fill(zero); + const E = diag(Array(N).fill(one)); + for (let i = 0; i < len; i++) { + const lambda = uniqueValues[i]; + const S = subtract(U, multiply(lambda, E)); // the characteristic matrix + + let solutions = usolveAll(S, b); + solutions.shift(); // ignore the null vector + + // looks like we missed something, try inverse iteration + // But if that fails, just presume that the original matrix truly + // was defective. + while (solutions.length < multiplicities[i]) { + const approxVec = inverseIterate(S, N, solutions, prec, type); + if (approxVec === null) { + break; + } // no more vectors were found + solutions.push(approxVec); + } + + // Transform back into original array coordinates + const correction = multiply(inv(R), C); + solutions = solutions.map(v => multiply(correction, v)); + vectors.push(...solutions.map(v => ({ + value: lambda, + vector: flatten(v) + }))); + } + return vectors; + } + + /** + * Compute the eigenvalues of an 2x2 matrix + * @return {[number,number]} + */ + function eigenvalues2x2(a, b, c, d) { + // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA ) + const trA = addScalar(a, d); + const detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c)); + const x = multiplyScalar(trA, 0.5); + const y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5); + return [addScalar(x, y), subtract(x, y)]; + } + + /** + * For an 2x2 matrix compute the transformation matrix S, + * so that SAS^-1 is an upper triangular matrix + * @return {[[number,number],[number,number]]} + * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf + * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html + */ + function jordanBase2x2(a, b, c, d, l1, l2, prec, type) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const zero = big ? bignumber(0) : cplx ? complex(0) : 0; + const one = big ? bignumber(1) : cplx ? complex(1) : 1; + + // matrix is already upper triangular + // return an identity matrix + if (smaller(abs(c), prec)) { + return [[one, zero], [zero, one]]; + } + + // matrix is diagonalizable + // return its eigenvectors as columns + if (larger(abs(subtract(l1, l2)), prec)) { + return [[subtract(l1, d), subtract(l2, d)], [c, c]]; + } + + // matrix is not diagonalizable + // compute diagonal elements of N = A - lambdaI + const na = subtract(a, l1); + const nd = subtract(d, l1); + + // col(N,2) = 0 implies S = ( col(N,1), e_1 ) + // col(N,2) != 0 implies S = ( col(N,2), e_2 ) + + if (smaller(abs(b), prec) && smaller(abs(nd), prec)) { + return [[na, one], [c, zero]]; + } else { + return [[b, zero], [nd, one]]; + } + } + + /** + * Enlarge the matrix from nxn to NxN, setting the new + * elements to 1 on diagonal and 0 elsewhere + */ + function inflateMatrix(arr, N) { + // add columns + for (let i = 0; i < arr.length; i++) { + arr[i].push(...Array(N - arr[i].length).fill(0)); + } + + // add rows + for (let i = arr.length; i < N; i++) { + arr.push(Array(N).fill(0)); + arr[i][i] = 1; + } + return arr; + } + + /** + * Create a block-diagonal matrix with the given square matrices on the diagonal + * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal + * @param {number} N the size of the resulting matrix + */ + function blockDiag(arr, N) { + const M = []; + for (let i = 0; i < N; i++) { + M[i] = Array(N).fill(0); + } + let I = 0; + for (const sub of arr) { + const n = sub.length; + for (let i = 0; i < n; i++) { + for (let j = 0; j < n; j++) { + M[I + i][I + j] = sub[i][j]; + } + } + I += n; + } + return M; + } + + /** + * Finds the index of an element in an array using a custom equality function + * @template T + * @param {Array} arr array in which to search + * @param {T} el the element to find + * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el` + * @returns {number} the index of `el`, or -1 when it's not in `arr` + */ + function indexOf(arr, el, fn) { + for (let i = 0; i < arr.length; i++) { + if (fn(arr[i], el)) { + return i; + } + } + return -1; + } + + /** + * Provided a near-singular upper-triangular matrix A and a list of vectors, + * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal + * to each vector in the list + * @template T + * @param {T[][]} A near-singular square matrix + * @param {number} N dimension + * @param {T[][]} orthog list of vectors + * @param {number} prec epsilon + * @param {'number'|'BigNumber'|'Complex'} type + * @return {T[] | null} eigenvector + * + * @see Numerical Recipes for Fortran 77 – 11.7 Eigenvalues or Eigenvectors by Inverse Iteration + */ + function inverseIterate(A, N, orthog, prec, type) { + const largeNum = type === 'BigNumber' ? bignumber(1000) : 1000; + let b; // the vector + + // you better choose a random vector before I count to five + let i = 0; + for (; i < 5; ++i) { + b = randomOrthogonalVector(N, orthog, type); + try { + b = usolve(A, b); + } catch (_unused) { + // That direction didn't work, likely because the original matrix + // was defective. But still make the full number of tries... + continue; + } + if (larger(norm(b), largeNum)) { + break; + } + } + if (i >= 5) { + return null; // couldn't find any orthogonal vector in the image + } + + // you better converge before I count to ten + i = 0; + while (true) { + const c = usolve(A, b); + if (smaller(norm(orthogonalComplement(b, [c])), prec)) { + break; + } + if (++i >= 10) { + return null; + } + b = normalize(c); + } + return b; + } + + /** + * Generates a random unit vector of dimension N, orthogonal to each vector in the list + * @template T + * @param {number} N dimension + * @param {T[][]} orthog list of vectors + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {T[]} random vector + */ + function randomOrthogonalVector(N, orthog, type) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + + // generate random vector with the correct type + let v = Array(N).fill(0).map(_ => 2 * Math.random() - 1); + if (big) { + v = v.map(n => bignumber(n)); + } + if (cplx) { + v = v.map(n => complex(n)); + } + + // project to orthogonal complement + v = orthogonalComplement(v, orthog); + + // normalize + return normalize(v, type); + } + + /** + * Project vector v to the orthogonal complement of an array of vectors + */ + function orthogonalComplement(v, orthog) { + const vectorShape = size(v); + for (let w of orthog) { + w = reshape(w, vectorShape); // make sure this is just a vector computation + // v := v − (w, v)/|w|^2 w + v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w)); + } + return v; + } + + /** + * Calculate the norm of a vector. + * We can't use math.norm because factory can't handle circular dependency. + * Seriously, I'm really fed up with factory. + */ + function norm(v) { + return abs(sqrt(dot(v, v))); + } + + /** + * Normalize a vector + * @template T + * @param {T[]} v + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {T[]} normalized vec + */ + function normalize(v, type) { + const big = type === 'BigNumber'; + const cplx = type === 'Complex'; + const one = big ? bignumber(1) : cplx ? complex(1) : 1; + return multiply(divideScalar(one, norm(v)), v); + } + return complexEigs; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js new file mode 100644 index 0000000..5ed0f0f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js @@ -0,0 +1,303 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRealSymmetric = createRealSymmetric; +var _object = require("../../../utils/object.js"); +function createRealSymmetric(_ref) { + let { + config, + addScalar, + subtract, + abs, + atan, + cos, + sin, + multiplyScalar, + inv, + bignumber, + multiply, + add + } = _ref; + /** + * @param {number[] | BigNumber[]} arr + * @param {number} N + * @param {number} prec + * @param {'number' | 'BigNumber'} type + */ + function main(arr, N) { + let prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol; + let type = arguments.length > 3 ? arguments[3] : undefined; + let computeVectors = arguments.length > 4 ? arguments[4] : undefined; + if (type === 'number') { + return diag(arr, prec, computeVectors); + } + if (type === 'BigNumber') { + return diagBig(arr, prec, computeVectors); + } + throw TypeError('Unsupported data type: ' + type); + } + + // diagonalization implementation for number (efficient) + function diag(x, precision, computeVectors) { + const N = x.length; + const e0 = Math.abs(precision / N); + let psi; + let Sij; + if (computeVectors) { + Sij = new Array(N); + // Sij is Identity Matrix + for (let i = 0; i < N; i++) { + Sij[i] = Array(N).fill(0); + Sij[i][i] = 1.0; + } + } + // initial error + let Vab = getAij(x); + while (Math.abs(Vab[1]) >= Math.abs(e0)) { + const i = Vab[0][0]; + const j = Vab[0][1]; + psi = getTheta(x[i][i], x[j][j], x[i][j]); + x = x1(x, psi, i, j); + if (computeVectors) Sij = Sij1(Sij, psi, i, j); + Vab = getAij(x); + } + const Ei = Array(N).fill(0); // eigenvalues + for (let i = 0; i < N; i++) { + Ei[i] = x[i][i]; + } + return sorting((0, _object.clone)(Ei), Sij, computeVectors); + } + + // diagonalization implementation for bigNumber + function diagBig(x, precision, computeVectors) { + const N = x.length; + const e0 = abs(precision / N); + let psi; + let Sij; + if (computeVectors) { + Sij = new Array(N); + // Sij is Identity Matrix + for (let i = 0; i < N; i++) { + Sij[i] = Array(N).fill(0); + Sij[i][i] = 1.0; + } + } + // initial error + let Vab = getAijBig(x); + while (abs(Vab[1]) >= abs(e0)) { + const i = Vab[0][0]; + const j = Vab[0][1]; + psi = getThetaBig(x[i][i], x[j][j], x[i][j]); + x = x1Big(x, psi, i, j); + if (computeVectors) Sij = Sij1Big(Sij, psi, i, j); + Vab = getAijBig(x); + } + const Ei = Array(N).fill(0); // eigenvalues + for (let i = 0; i < N; i++) { + Ei[i] = x[i][i]; + } + // return [clone(Ei), clone(Sij)] + return sorting((0, _object.clone)(Ei), Sij, computeVectors); + } + + // get angle + function getTheta(aii, ajj, aij) { + const denom = ajj - aii; + if (Math.abs(denom) <= config.relTol) { + return Math.PI / 4.0; + } else { + return 0.5 * Math.atan(2.0 * aij / (ajj - aii)); + } + } + + // get angle + function getThetaBig(aii, ajj, aij) { + const denom = subtract(ajj, aii); + if (abs(denom) <= config.relTol) { + return bignumber(-1).acos().div(4); + } else { + return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom)))); + } + } + + // update eigvec + function Sij1(Sij, theta, i, j) { + const N = Sij.length; + const c = Math.cos(theta); + const s = Math.sin(theta); + const Ski = Array(N).fill(0); + const Skj = Array(N).fill(0); + for (let k = 0; k < N; k++) { + Ski[k] = c * Sij[k][i] - s * Sij[k][j]; + Skj[k] = s * Sij[k][i] + c * Sij[k][j]; + } + for (let k = 0; k < N; k++) { + Sij[k][i] = Ski[k]; + Sij[k][j] = Skj[k]; + } + return Sij; + } + // update eigvec for overlap + function Sij1Big(Sij, theta, i, j) { + const N = Sij.length; + const c = cos(theta); + const s = sin(theta); + const Ski = Array(N).fill(bignumber(0)); + const Skj = Array(N).fill(bignumber(0)); + for (let k = 0; k < N; k++) { + Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j])); + Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j])); + } + for (let k = 0; k < N; k++) { + Sij[k][i] = Ski[k]; + Sij[k][j] = Skj[k]; + } + return Sij; + } + + // update matrix + function x1Big(Hij, theta, i, j) { + const N = Hij.length; + const c = bignumber(cos(theta)); + const s = bignumber(sin(theta)); + const c2 = multiplyScalar(c, c); + const s2 = multiplyScalar(s, s); + const Aki = Array(N).fill(bignumber(0)); + const Akj = Array(N).fill(bignumber(0)); + // 2cs Hij + const csHij = multiply(bignumber(2), c, s, Hij[i][j]); + // Aii + const Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j])); + const Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j])); + // 0 to i + for (let k = 0; k < N; k++) { + Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k])); + Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k])); + } + // Modify Hij + Hij[i][i] = Aii; + Hij[j][j] = Ajj; + Hij[i][j] = bignumber(0); + Hij[j][i] = bignumber(0); + // 0 to i + for (let k = 0; k < N; k++) { + if (k !== i && k !== j) { + Hij[i][k] = Aki[k]; + Hij[k][i] = Aki[k]; + Hij[j][k] = Akj[k]; + Hij[k][j] = Akj[k]; + } + } + return Hij; + } + + // update matrix + function x1(Hij, theta, i, j) { + const N = Hij.length; + const c = Math.cos(theta); + const s = Math.sin(theta); + const c2 = c * c; + const s2 = s * s; + const Aki = Array(N).fill(0); + const Akj = Array(N).fill(0); + // Aii + const Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j]; + const Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j]; + // 0 to i + for (let k = 0; k < N; k++) { + Aki[k] = c * Hij[i][k] - s * Hij[j][k]; + Akj[k] = s * Hij[i][k] + c * Hij[j][k]; + } + // Modify Hij + Hij[i][i] = Aii; + Hij[j][j] = Ajj; + Hij[i][j] = 0; + Hij[j][i] = 0; + // 0 to i + for (let k = 0; k < N; k++) { + if (k !== i && k !== j) { + Hij[i][k] = Aki[k]; + Hij[k][i] = Aki[k]; + Hij[j][k] = Akj[k]; + Hij[k][j] = Akj[k]; + } + } + return Hij; + } + + // get max off-diagonal value from Upper Diagonal + function getAij(Mij) { + const N = Mij.length; + let maxMij = 0; + let maxIJ = [0, 1]; + for (let i = 0; i < N; i++) { + for (let j = i + 1; j < N; j++) { + if (Math.abs(maxMij) < Math.abs(Mij[i][j])) { + maxMij = Math.abs(Mij[i][j]); + maxIJ = [i, j]; + } + } + } + return [maxIJ, maxMij]; + } + + // get max off-diagonal value from Upper Diagonal + function getAijBig(Mij) { + const N = Mij.length; + let maxMij = 0; + let maxIJ = [0, 1]; + for (let i = 0; i < N; i++) { + for (let j = i + 1; j < N; j++) { + if (abs(maxMij) < abs(Mij[i][j])) { + maxMij = abs(Mij[i][j]); + maxIJ = [i, j]; + } + } + } + return [maxIJ, maxMij]; + } + + // sort results + function sorting(E, S, computeVectors) { + const N = E.length; + const values = Array(N); + let vecs; + if (computeVectors) { + vecs = Array(N); + for (let k = 0; k < N; k++) { + vecs[k] = Array(N); + } + } + for (let i = 0; i < N; i++) { + let minID = 0; + let minE = E[0]; + for (let j = 0; j < E.length; j++) { + if (abs(E[j]) < abs(minE)) { + minID = j; + minE = E[minID]; + } + } + values[i] = E.splice(minID, 1)[0]; + if (computeVectors) { + for (let k = 0; k < N; k++) { + vecs[i][k] = S[k][minID]; + S[k].splice(minID, 1); + } + } + } + if (!computeVectors) return { + values + }; + const eigenvectors = vecs.map((vector, i) => ({ + value: values[i], + vector + })); + return { + values, + eigenvectors + }; + } + return main; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/expm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/expm.js new file mode 100644 index 0000000..f44e112 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/expm.js @@ -0,0 +1,160 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createExpm = void 0; +var _is = require("../../utils/is.js"); +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +const name = 'expm'; +const dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply']; +const createExpm = exports.createExpm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + add, + identity, + inv, + multiply + } = _ref; + /** + * Compute the matrix exponential, expm(A) = e^A. The matrix must be square. + * Not to be confused with exp(a), which performs element-wise + * exponentiation. + * + * The exponential is calculated using the Padé approximant with scaling and + * squaring; see "Nineteen Dubious Ways to Compute the Exponential of a + * Matrix," by Moler and Van Loan. + * + * Syntax: + * + * math.expm(x) + * + * Examples: + * + * const A = [[0,2],[0,0]] + * math.expm(A) // returns [[1,2],[0,1]] + * + * See also: + * + * exp + * + * @param {Matrix} x A square Matrix + * @return {Matrix} The exponential of x + */ + return typed(name, { + Matrix: function (A) { + // Check matrix size + const size = A.size(); + if (size.length !== 2 || size[0] !== size[1]) { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + const n = size[0]; + + // Desired accuracy of the approximant (The actual accuracy + // will be affected by round-off error) + const eps = 1e-15; + + // The Padé approximant is not so accurate when the values of A + // are "large", so scale A by powers of two. Then compute the + // exponential, and square the result repeatedly according to + // the identity e^A = (e^(A/m))^m + + // Compute infinity-norm of A, ||A||, to see how "big" it is + const infNorm = infinityNorm(A); + + // Find the optimal scaling factor and number of terms in the + // Padé approximant to reach the desired accuracy + const params = findParams(infNorm, eps); + const q = params.q; + const j = params.j; + + // The Pade approximation to e^A is: + // Rqq(A) = Dqq(A) ^ -1 * Nqq(A) + // where + // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i + // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i + + // Scale A by 1 / 2^j + const Apos = multiply(A, Math.pow(2, -j)); + + // The i=0 term is just the identity matrix + let N = identity(n); + let D = identity(n); + + // Initialization (i=0) + let factor = 1; + + // Initialization (i=1) + let AposToI = Apos; // Cloning not necessary + let alternate = -1; + for (let i = 1; i <= q; i++) { + if (i > 1) { + AposToI = multiply(AposToI, Apos); + alternate = -alternate; + } + factor = factor * (q - i + 1) / ((2 * q - i + 1) * i); + N = add(N, multiply(factor, AposToI)); + D = add(D, multiply(factor * alternate, AposToI)); + } + let R = multiply(inv(D), N); + + // Square j times + for (let i = 0; i < j; i++) { + R = multiply(R, R); + } + return (0, _is.isSparseMatrix)(A) ? A.createSparseMatrix(R) : R; + } + }); + function infinityNorm(A) { + const n = A.size()[0]; + let infNorm = 0; + for (let i = 0; i < n; i++) { + let rowSum = 0; + for (let j = 0; j < n; j++) { + rowSum += abs(A.get([i, j])); + } + infNorm = Math.max(rowSum, infNorm); + } + return infNorm; + } + + /** + * Find the best parameters for the Pade approximant given + * the matrix norm and desired accuracy. Returns the first acceptable + * combination in order of increasing computational load. + */ + function findParams(infNorm, eps) { + const maxSearchSize = 30; + for (let k = 0; k < maxSearchSize; k++) { + for (let q = 0; q <= k; q++) { + const j = k - q; + if (errorEstimate(infNorm, q, j) < eps) { + return { + q, + j + }; + } + } + } + throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)'); + } + + /** + * Returns the estimated error of the Pade approximant for the given + * parameters. + */ + function errorEstimate(infNorm, q, j) { + let qfac = 1; + for (let i = 2; i <= q; i++) { + qfac *= i; + } + let twoqfac = qfac; + for (let i = q + 1; i <= 2 * q; i++) { + twoqfac *= i; + } + const twoqp1fac = twoqfac * (2 * q + 1); + return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/fft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/fft.js new file mode 100644 index 0000000..ddab998 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/fft.js @@ -0,0 +1,134 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFft = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'fft'; +const dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2']; +const createFft = exports.createFft = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + addScalar, + multiplyScalar, + divideScalar, + exp, + tau, + i: I, + dotDivide, + conj, + pow, + ceil, + log2 + } = _ref; + /** + * Calculate N-dimensional Fourier transform + * + * Syntax: + * + * math.fft(arr) + * + * Examples: + * + * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]] + * + * + * See Also: + * + * ifft + * + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + return typed(name, { + Array: _ndFft, + Matrix: function (matrix) { + return matrix.create(_ndFft(matrix.valueOf()), matrix.datatype()); + } + }); + + /** + * Perform an N-dimensional Fourier transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _ndFft(arr) { + const size = (0, _array.arraySize)(arr); + if (size.length === 1) return _fft(arr, size[0]); + // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0 + return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0); + } + + /** + * Perform an 1-dimensional Fourier transform + * + * @param {Array} arr The array + * @param {number} dim dimension of the array to perform on + * @return {Array} resulting array + */ + function _1dFft(arr, dim) { + const size = (0, _array.arraySize)(arr); + if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1)); + if (size.length === 1) return _fft(arr); + function _transpose(arr) { + // Swap first 2 dimensions + const size = (0, _array.arraySize)(arr); + return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j])); + } + return _transpose(_1dFft(_transpose(arr), 1)); + } + /** + * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _czt(arr) { + const n = arr.length; + const w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n)); + const chirp = []; + for (let i = 1 - n; i < n; i++) { + chirp.push(pow(w, divideScalar(pow(i, 2), 2))); + } + const N2 = pow(2, ceil(log2(n + n - 1))); + const xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)]; + const ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)]; + const fftXp = _fft(xp); + const fftIchirp = _fft(ichirp); + const fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i])); + const ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2); + const ret = []; + for (let i = n - 1; i < n + n - 1; i++) { + ret.push(multiplyScalar(ifftProduct[i], chirp[i])); + } + return ret; + } + /** + * Perform an 1-dimensional Fourier transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _fft(arr) { + const len = arr.length; + if (len === 1) return [arr[0]]; + if (len % 2 === 0) { + const ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)]; + for (let k = 0; k < len / 2; k++) { + const p = ret[k]; + const q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len)))); + ret[k] = addScalar(p, q); + ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q)); + } + return ret; + } else { + // use chirp-z transform for non-power-of-2 FFT + return _czt(arr); + } + // throw new Error('Can only calculate FFT of power-of-two size') + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/filter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/filter.js new file mode 100644 index 0000000..e6d5021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/filter.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFilter = void 0; +var _optimizeCallback = require("../../utils/optimizeCallback.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'filter'; +const dependencies = ['typed']; +const createFilter = exports.createFilter = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Filter the items in an array or one dimensional matrix. + * + * Syntax: + * + * math.filter(x, test) + * + * Examples: + * + * function isPositive (x) { + * return x > 0 + * } + * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3] + * + * math.filter(["23", "foo", "100", "55", "bar"], /[0-9]+/) // returns ["23", "100", "55"] + * + * See also: + * + * forEach, map, sort + * + * @param {Matrix | Array} x A one dimensional matrix or array to filter + * @param {Function | RegExp} test + * A function or regular expression to test items. + * All entries for which `test` returns true are returned. + * When `test` is a function, it is invoked with three parameters: + * the value of the element, the index of the element, and the + * matrix/array being traversed. The function must return a boolean. + * @return {Matrix | Array} Returns the filtered matrix. + */ + return typed('filter', { + 'Array, function': _filterCallback, + 'Matrix, function': function (x, test) { + return x.create(_filterCallback(x.valueOf(), test), x.datatype()); + }, + 'Array, RegExp': _array.filterRegExp, + 'Matrix, RegExp': function (x, test) { + return x.create((0, _array.filterRegExp)(x.valueOf(), test), x.datatype()); + } + }); +}); + +/** + * Filter values in a callback given a callback function + * @param {Array} x + * @param {Function} callback + * @return {Array} Returns the filtered array + * @private + */ +function _filterCallback(x, callback) { + const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, x, 'filter'); + return (0, _array.filter)(x, function (value, index, array) { + // invoke the callback function with the right number of arguments + return fastCallback(value, [index], array); + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/flatten.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/flatten.js new file mode 100644 index 0000000..8c5fc76 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/flatten.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFlatten = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'flatten'; +const dependencies = ['typed']; +const createFlatten = exports.createFlatten = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Flatten a multidimensional matrix into a single dimensional matrix. + * A new matrix is returned, the original matrix is left untouched. + * + * Syntax: + * + * math.flatten(x) + * + * Examples: + * + * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4] + * + * See also: + * + * concat, resize, size, squeeze + * + * @param {Matrix | Array} x Matrix to be flattened + * @return {Matrix | Array} Returns the flattened matrix + */ + return typed(name, { + Array: function (x) { + return (0, _array.flatten)(x); + }, + Matrix: function (x) { + // Return the same matrix type as x (Dense or Sparse Matrix) + // Return the same data type as x + return x.create((0, _array.flatten)(x.toArray()), x.datatype()); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/forEach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/forEach.js new file mode 100644 index 0000000..5f6b40f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/forEach.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createForEach = void 0; +var _optimizeCallback = require("../../utils/optimizeCallback.js"); +var _factory = require("../../utils/factory.js"); +var _array = require("../../utils/array.js"); +const name = 'forEach'; +const dependencies = ['typed']; +const createForEach = exports.createForEach = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Iterate over all elements of a matrix/array, and executes the given callback function. + * + * Syntax: + * + * math.forEach(x, callback) + * + * Examples: + * + * math.forEach([1, 2, 3], function(value) { + * console.log(value) + * }) + * // outputs 1, 2, 3 + * + * See also: + * + * filter, map, sort + * + * @param {Matrix | Array} x The matrix to iterate on. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix/array being traversed. + */ + return typed(name, { + 'Array, function': _forEach, + 'Matrix, function': function (x, callback) { + x.forEach(callback); + } + }); +}); + +/** + * forEach for a multidimensional array + * @param {Array} array + * @param {Function} callback + * @private + */ +function _forEach(array, callback) { + (0, _array.recurse)(array, [], array, (0, _optimizeCallback.optimizeCallback)(callback, array, name)); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js new file mode 100644 index 0000000..0c14716 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createGetMatrixDataType = void 0; +var _factory = require("../../utils/factory.js"); +var _array = require("../../utils/array.js"); +var _is = require("../../utils/is.js"); +const name = 'getMatrixDataType'; +const dependencies = ['typed']; +const createGetMatrixDataType = exports.createGetMatrixDataType = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Find the data type of all elements in a matrix or array, + * for example 'number' if all items are a number and 'Complex' if all values + * are complex numbers. + * If a matrix contains more than one data type, it will return 'mixed'. + * + * Syntax: + * + * math.getMatrixDataType(x) + * + * Examples: + * + * const x = [ [1, 2, 3], [4, 5, 6] ] + * const mixedX = [ [1, true], [2, 3] ] + * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ] + * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ] + * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ] + * const sparse = math.sparse(x) + * const dense = math.matrix(x) + * math.getMatrixDataType(x) // returns 'number' + * math.getMatrixDataType(sparse) // returns 'number' + * math.getMatrixDataType(dense) // returns 'number' + * math.getMatrixDataType(mixedX) // returns 'mixed' + * math.getMatrixDataType(fractionX) // returns 'Fraction' + * math.getMatrixDataType(unitX) // returns 'Unit' + * math.getMatrixDataType(bigNumberX) // return 'BigNumber' + * + * See also: + * SparseMatrix, DenseMatrix + * + * @param {...Matrix | Array} x The Matrix with values. + * + * @return {string} A string representation of the matrix type + */ + return typed(name, { + Array: function (x) { + return (0, _array.getArrayDataType)(x, _is.typeOf); + }, + Matrix: function (x) { + return x.getDataType(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/identity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/identity.js new file mode 100644 index 0000000..c0f3d71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/identity.js @@ -0,0 +1,142 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIdentity = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'identity'; +const dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix']; +const createIdentity = exports.createIdentity = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + BigNumber, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a 2-dimensional identity matrix with size m x n or n x n. + * The matrix has ones on the diagonal and zeros elsewhere. + * + * Syntax: + * + * math.identity(n) + * math.identity(n, format) + * math.identity(m, n) + * math.identity(m, n, format) + * math.identity([m, n]) + * math.identity([m, n], format) + * + * Examples: + * + * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]] + * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]] + * + * See also: + * + * diag, ones, zeros, size, range + * + * @param {...number | Matrix | Array} size The size for the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Matrix | Array | number} A matrix with ones on the diagonal. + */ + return typed(name, { + '': function () { + return config.matrix === 'Matrix' ? matrix([]) : []; + }, + string: function (format) { + return matrix(format); + }, + 'number | BigNumber': function (rows) { + return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber, string': function (rows, format) { + return _identity(rows, rows, format); + }, + 'number | BigNumber, number | BigNumber': function (rows, cols) { + return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber, number | BigNumber, string': function (rows, cols, format) { + return _identity(rows, cols, format); + }, + Array: function (size) { + return _identityVector(size); + }, + 'Array, string': function (size, format) { + return _identityVector(size, format); + }, + Matrix: function (size) { + return _identityVector(size.valueOf(), size.storage()); + }, + 'Matrix, string': function (size, format) { + return _identityVector(size.valueOf(), format); + } + }); + function _identityVector(size, format) { + switch (size.length) { + case 0: + return format ? matrix(format) : []; + case 1: + return _identity(size[0], size[0], format); + case 2: + return _identity(size[0], size[1], format); + default: + throw new Error('Vector containing two values expected'); + } + } + + /** + * Create an identity matrix + * @param {number | BigNumber} rows + * @param {number | BigNumber} cols + * @param {string} [format] + * @returns {Matrix} + * @private + */ + function _identity(rows, cols, format) { + // BigNumber constructor with the right precision + const Big = (0, _is.isBigNumber)(rows) || (0, _is.isBigNumber)(cols) ? BigNumber : null; + if ((0, _is.isBigNumber)(rows)) rows = rows.toNumber(); + if ((0, _is.isBigNumber)(cols)) cols = cols.toNumber(); + if (!(0, _number.isInteger)(rows) || rows < 1) { + throw new Error('Parameters in function identity must be positive integers'); + } + if (!(0, _number.isInteger)(cols) || cols < 1) { + throw new Error('Parameters in function identity must be positive integers'); + } + const one = Big ? new BigNumber(1) : 1; + const defaultValue = Big ? new Big(0) : 0; + const size = [rows, cols]; + + // check we need to return a matrix + if (format) { + // create diagonal matrix (use optimized implementation for storage format) + if (format === 'sparse') { + return SparseMatrix.diagonal(size, one, 0, defaultValue); + } + if (format === 'dense') { + return DenseMatrix.diagonal(size, one, 0, defaultValue); + } + throw new TypeError(`Unknown matrix type "${format}"`); + } + + // create and resize array + const res = (0, _array.resize)([], size, defaultValue); + // fill in ones on the diagonal + const minimum = rows < cols ? rows : cols; + // fill diagonal + for (let d = 0; d < minimum; d++) { + res[d][d] = one; + } + return res; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ifft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ifft.js new file mode 100644 index 0000000..22bc6e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ifft.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIfft = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'ifft'; +const dependencies = ['typed', 'fft', 'dotDivide', 'conj']; +const createIfft = exports.createIfft = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + fft, + dotDivide, + conj + } = _ref; + /** + * Calculate N-dimensional inverse Fourier transform + * + * Syntax: + * + * math.ifft(arr) + * + * Examples: + * + * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]] + * + * See Also: + * + * fft + * + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + return typed(name, { + 'Array | Matrix': function (arr) { + const size = (0, _is.isMatrix)(arr) ? arr.size() : (0, _array.arraySize)(arr); + return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/inv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/inv.js new file mode 100644 index 0000000..58947fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/inv.js @@ -0,0 +1,190 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createInv = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _string = require("../../utils/string.js"); +const name = 'inv'; +const dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs']; +const createInv = exports.createInv = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divideScalar, + addScalar, + multiply, + unaryMinus, + det, + identity, + abs + } = _ref; + /** + * Calculate the inverse of a square matrix. + * + * Syntax: + * + * math.inv(x) + * + * Examples: + * + * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]] + * math.inv(4) // returns 0.25 + * 1 / 4 // returns 0.25 + * + * See also: + * + * det, transpose + * + * @param {number | Complex | Array | Matrix} x Matrix to be inversed + * @return {number | Complex | Array | Matrix} The inverse of `x`. + */ + return typed(name, { + 'Array | Matrix': function (x) { + const size = (0, _is.isMatrix)(x) ? x.size() : (0, _array.arraySize)(x); + switch (size.length) { + case 1: + // vector + if (size[0] === 1) { + if ((0, _is.isMatrix)(x)) { + return matrix([divideScalar(1, x.valueOf()[0])]); + } else { + return [divideScalar(1, x[0])]; + } + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + case 2: + // two dimensional array + { + const rows = size[0]; + const cols = size[1]; + if (rows === cols) { + if ((0, _is.isMatrix)(x)) { + return matrix(_inv(x.valueOf(), rows, cols), x.storage()); + } else { + // return an Array + return _inv(x, rows, cols); + } + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + (0, _string.format)(size) + ')'); + } + }, + any: function (x) { + // scalar + return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers + } + }); + + /** + * Calculate the inverse of a square matrix + * @param {Array[]} mat A square matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns, must equal rows + * @return {Array[]} inv Inverse matrix + * @private + */ + function _inv(mat, rows, cols) { + let r, s, f, value, temp; + if (rows === 1) { + // this is a 1 x 1 matrix + value = mat[0][0]; + if (value === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + return [[divideScalar(1, value)]]; + } else if (rows === 2) { + // this is a 2 x 2 matrix + const d = det(mat); + if (d === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]]; + } else { + // this is a matrix of 3 x 3 or larger + // calculate inverse using gauss-jordan elimination + // https://en.wikipedia.org/wiki/Gaussian_elimination + // http://mathworld.wolfram.com/MatrixInverse.html + // http://math.uww.edu/~mcfarlat/inverse.htm + + // make a copy of the matrix (only the arrays, not of the elements) + const A = mat.concat(); + for (r = 0; r < rows; r++) { + A[r] = A[r].concat(); + } + + // create an identity matrix which in the end will contain the + // matrix inverse + const B = identity(rows).valueOf(); + + // loop over all columns, and perform row reductions + for (let c = 0; c < cols; c++) { + // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c] + let ABig = abs(A[c][c]); + let rBig = c; + r = c + 1; + while (r < rows) { + if (abs(A[r][c]) > ABig) { + ABig = abs(A[r][c]); + rBig = r; + } + r++; + } + if (ABig === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + r = rBig; + if (r !== c) { + temp = A[c]; + A[c] = A[r]; + A[r] = temp; + temp = B[c]; + B[c] = B[r]; + B[r] = temp; + } + + // eliminate non-zero values on the other rows at column c + const Ac = A[c]; + const Bc = B[c]; + for (r = 0; r < rows; r++) { + const Ar = A[r]; + const Br = B[r]; + if (r !== c) { + // eliminate value at column c and row r + if (Ar[c] !== 0) { + f = divideScalar(unaryMinus(Ar[c]), Ac[c]); + + // add (f * row c) to row r to eliminate the value + // at column c + for (s = c; s < cols; s++) { + Ar[s] = addScalar(Ar[s], multiply(f, Ac[s])); + } + for (s = 0; s < cols; s++) { + Br[s] = addScalar(Br[s], multiply(f, Bc[s])); + } + } + } else { + // normalize value at Acc to 1, + // divide each value on row r with the value at Acc + f = Ac[c]; + for (s = c; s < cols; s++) { + Ar[s] = divideScalar(Ar[s], f); + } + for (s = 0; s < cols; s++) { + Br[s] = divideScalar(Br[s], f); + } + } + } + } + return B; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/kron.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/kron.js new file mode 100644 index 0000000..bb3f845 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/kron.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createKron = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'kron'; +const dependencies = ['typed', 'matrix', 'multiplyScalar']; +const createKron = exports.createKron = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + multiplyScalar + } = _ref; + /** + * Calculates the Kronecker product of 2 matrices or vectors. + * + * NOTE: If a one dimensional vector / matrix is given, it will be + * wrapped so its two dimensions. + * See the examples. + * + * Syntax: + * + * math.kron(x, y) + * + * Examples: + * + * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]]) + * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ] + * + * math.kron([1,1], [2,3,4]) + * // returns [ [ 2, 3, 4, 2, 3, 4 ] ] + * + * See also: + * + * multiply, dot, cross + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {Array | Matrix} Returns the Kronecker product of `x` and `y` + */ + return typed(name, { + 'Matrix, Matrix': function (x, y) { + return matrix(_kron(x.toArray(), y.toArray())); + }, + 'Matrix, Array': function (x, y) { + return matrix(_kron(x.toArray(), y)); + }, + 'Array, Matrix': function (x, y) { + return matrix(_kron(x, y.toArray())); + }, + 'Array, Array': _kron + }); + + /** + * Calculate the Kronecker product of two matrices / vectors + * @param {Array} a First vector + * @param {Array} b Second vector + * @returns {Array} Returns the Kronecker product of x and y + * @private + */ + function _kron(a, b) { + // Deal with the dimensions of the matricies. + if ((0, _array.arraySize)(a).length === 1) { + // Wrap it in a 2D Matrix + a = [a]; + } + if ((0, _array.arraySize)(b).length === 1) { + // Wrap it in a 2D Matrix + b = [b]; + } + if ((0, _array.arraySize)(a).length > 2 || (0, _array.arraySize)(b).length > 2) { + throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')'); + } + const t = []; + let r = []; + return a.map(function (a) { + return b.map(function (b) { + r = []; + t.push(r); + return a.map(function (y) { + return b.map(function (x) { + return r.push(multiplyScalar(y, x)); + }); + }); + }); + }) && t; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/map.js new file mode 100644 index 0000000..9f41dca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/map.js @@ -0,0 +1,148 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMap = void 0; +var _optimizeCallback = require("../../utils/optimizeCallback.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'map'; +const dependencies = ['typed']; +const createMap = exports.createMap = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Create a new matrix or array with the results of a callback function executed on + * each entry of a given matrix/array. + * + * For each entry of the input, + * + * the callback is invoked with 2N + 1 arguments: + * the N values of the entry, the index at which that entry occurs, and the N full + * broadcasted matrix/array being traversed where N is the number of matrices being traversed. + * Note that because the matrix/array might be + * multidimensional, the "index" argument is always an array of numbers giving + * the index in each dimension. This is true even for vectors: the "index" + * argument is an array of length 1, rather than simply a number. + * + * Syntax: + * + * math.map(x, callback) + * math.map(x, y, ..., callback) + * + * Examples: + * + * math.map([1, 2, 3], function(value) { + * return value * value + * }) // returns [1, 4, 9] + * math.map([1, 2], [3, 4], function(a, b) { + * return a + b + * }) // returns [4, 6] + * + * // The callback is normally called with three arguments: + * // callback(value, index, Array) + * // If you want to call with only one argument, use: + * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3'] + * // It can also be called with 2N + 1 arguments: for N arrays + * // callback(value1, value2, index, BroadcastedArray1, BroadcastedArray2) + * + * See also: + * + * filter, forEach, sort + * + * @param {Matrix | Array} x The input to iterate on. + * @param {Function} callback + * The function to call (as described above) on each entry of the input + * @return {Matrix | array} + * Transformed map of x; always has the same type and shape as x + */ + return typed(name, { + 'Array, function': _mapArray, + 'Matrix, function': function (x, callback) { + return x.map(callback); + }, + 'Array|Matrix, Array|Matrix, ...Array|Matrix|function': (A, B, rest) => _mapMultiple([A, B, ...rest.slice(0, rest.length - 1)], rest[rest.length - 1]) + }); + + /** + * Maps over multiple arrays or matrices. + * + * @param {Array} Arrays - An array of arrays or matrices to map over. + * @param {function} multiCallback - The callback function to apply to each element. + * @throws {Error} If the last argument is not a callback function. + * @returns {Array|Matrix} A new array or matrix with each element being the result of the callback function. + * + * @example + * _mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9] + */ + function _mapMultiple(Arrays, multiCallback) { + if (typeof multiCallback !== 'function') { + throw new Error('Last argument must be a callback function'); + } + const firstArrayIsMatrix = Arrays[0].isMatrix; + const newSize = (0, _array.broadcastSizes)(...Arrays.map(M => M.isMatrix ? M.size() : (0, _array.arraySize)(M))); + const _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : _array.get; + const broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create((0, _array.broadcastTo)(M.toArray(), newSize), M.datatype()) : Arrays[0].create((0, _array.broadcastTo)(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? (0, _array.broadcastTo)(M.toArray(), newSize) : (0, _array.broadcastTo)(M, newSize)); + let callback; + if (typed.isTypedFunction(multiCallback)) { + const firstIndex = newSize.map(() => 0); + const firstValues = broadcastedArrays.map(array => _get(array, firstIndex)); + const callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays); + callback = _getLimitedCallback(callbackCase); + } else { + const numberOfArrays = Arrays.length; + const callbackCase = _getCallbackCase(multiCallback, numberOfArrays); + callback = _getLimitedCallback(callbackCase); + } + const broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))], idx); + if (firstArrayIsMatrix) { + return broadcastedArrays[0].map(broadcastedArraysCallback); + } else { + return _mapArray(broadcastedArrays[0], broadcastedArraysCallback); + } + function _getLimitedCallback(callbackCase) { + switch (callbackCase) { + case 0: + return x => multiCallback(...x); + case 1: + return (x, idx) => multiCallback(...x, idx); + case 2: + return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays); + } + } + function _getCallbackCase(callback, numberOfArrays) { + if (callback.length > numberOfArrays + 1) { + return 2; + } + if (callback.length === numberOfArrays + 1) { + return 1; + } + return 0; + } + function _getTypedCallbackCase(callback, values, idx, arrays) { + if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) { + return 2; + } + if (typed.resolve(callback, [...values, idx]) !== null) { + return 1; + } + if (typed.resolve(callback, values) !== null) { + return 0; + } + // this should never happen + return 0; + } + } + /** + * Map for a multi dimensional array + * @param {Array} array + * @param {Function} callback + * @return {Array} + * @private + */ + function _mapArray(array, callback) { + return (0, _array.recurse)(array, [], array, (0, _optimizeCallback.optimizeCallback)(callback, array, name)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js new file mode 100644 index 0000000..f0fad5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js @@ -0,0 +1,94 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrixFromColumns = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'matrixFromColumns'; +const dependencies = ['typed', 'matrix', 'flatten', 'size']; +const createMatrixFromColumns = exports.createMatrixFromColumns = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + flatten, + size + } = _ref; + /** + * Create a dense matrix from vectors as individual columns. + * If you pass row vectors, they will be transposed (but not conjugated!) + * + * Syntax: + * + * math.matrixFromColumns(...arr) + * math.matrixFromColumns(col1, col2) + * math.matrixFromColumns(col1, col2, col3) + * + * Examples: + * + * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]]) + * math.matrixFromColumns(...vectors) + * + * See also: + * + * matrix, matrixFromRows, matrixFromFunction, zeros + * + * @param {... Array | Matrix} cols Multiple columns + * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned + */ + return typed(name, { + '...Array': function (arr) { + return _createArray(arr); + }, + '...Matrix': function (arr) { + return matrix(_createArray(arr.map(m => m.toArray()))); + } + + // TODO implement this properly for SparseMatrix + }); + function _createArray(arr) { + if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.'); + const N = checkVectorTypeAndReturnLength(arr[0]); + + // create an array with empty rows + const result = []; + for (let i = 0; i < N; i++) { + result[i] = []; + } + + // loop columns + for (const col of arr) { + const colLength = checkVectorTypeAndReturnLength(col); + if (colLength !== N) { + throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (colLength | 0)); + } + const f = flatten(col); + + // push a value to each row + for (let i = 0; i < N; i++) { + result[i].push(f[i]); + } + } + return result; + } + function checkVectorTypeAndReturnLength(vec) { + const s = size(vec); + if (s.length === 1) { + // 1D vector + return s[0]; + } else if (s.length === 2) { + // 2D vector + if (s[0] === 1) { + // row vector + return s[1]; + } else if (s[1] === 1) { + // col vector + return s[0]; + } else { + throw new TypeError('At least one of the arguments is not a vector.'); + } + } else { + throw new TypeError('Only one- or two-dimensional vectors are supported.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js new file mode 100644 index 0000000..3075c97 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js @@ -0,0 +1,80 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrixFromFunction = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'matrixFromFunction'; +const dependencies = ['typed', 'matrix', 'isZero']; +const createMatrixFromFunction = exports.createMatrixFromFunction = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + isZero + } = _ref; + /** + * Create a matrix by evaluating a generating function at each index. + * The simplest overload returns a multi-dimensional array as long as `size` is an array. + * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix. + * + * Syntax: + * + * math.matrixFromFunction(size, fn) + * math.matrixFromFunction(size, fn, format) + * math.matrixFromFunction(size, fn, format, datatype) + * math.matrixFromFunction(size, format, fn) + * math.matrixFromFunction(size, format, datatype, fn) + * + * Examples: + * + * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix + * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix + * math.matrixFromFunction([5], i => math.random()) // a random vector + * + * See also: + * + * matrix, zeros + * + * @param {Array | Matrix} size The size of the matrix to be created + * @param {function} fn Callback function invoked for every entry in the matrix + * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'` + * @param {string} [datatype] Type of the values + * @return {Array | Matrix} Returns the created matrix + */ + return typed(name, { + 'Array | Matrix, function, string, string': function (size, fn, format, datatype) { + return _create(size, fn, format, datatype); + }, + 'Array | Matrix, function, string': function (size, fn, format) { + return _create(size, fn, format); + }, + 'Matrix, function': function (size, fn) { + return _create(size, fn, 'dense'); + }, + 'Array, function': function (size, fn) { + return _create(size, fn, 'dense').toArray(); + }, + 'Array | Matrix, string, function': function (size, format, fn) { + return _create(size, fn, format); + }, + 'Array | Matrix, string, string, function': function (size, format, datatype, fn) { + return _create(size, fn, format, datatype); + } + }); + function _create(size, fn, format, datatype) { + let m; + if (datatype !== undefined) { + m = matrix(format, datatype); + } else { + m = matrix(format); + } + m.resize(size); + m.forEach(function (_, index) { + const val = fn(index); + if (isZero(val)) return; + m.set(index, val); + }); + return m; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js new file mode 100644 index 0000000..1b606ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrixFromRows = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'matrixFromRows'; +const dependencies = ['typed', 'matrix', 'flatten', 'size']; +const createMatrixFromRows = exports.createMatrixFromRows = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + flatten, + size + } = _ref; + /** + * Create a dense matrix from vectors as individual rows. + * If you pass column vectors, they will be transposed (but not conjugated!) + * + * Syntax: + * + * math.matrixFromRows(...arr) + * math.matrixFromRows(row1, row2) + * math.matrixFromRows(row1, row2, row3) + * + * Examples: + * + * math.matrixFromRows([1, 2, 3], [[4],[5],[6]]) + * math.matrixFromRows(...vectors) + * + * See also: + * + * matrix, matrixFromColumns, matrixFromFunction, zeros + * + * @param {... Array | Matrix} rows Multiple rows + * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned + */ + return typed(name, { + '...Array': function (arr) { + return _createArray(arr); + }, + '...Matrix': function (arr) { + return matrix(_createArray(arr.map(m => m.toArray()))); + } + + // TODO implement this properly for SparseMatrix + }); + function _createArray(arr) { + if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.'); + const N = checkVectorTypeAndReturnLength(arr[0]); + const result = []; + for (const row of arr) { + const rowLength = checkVectorTypeAndReturnLength(row); + if (rowLength !== N) { + throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (rowLength | 0)); + } + result.push(flatten(row)); + } + return result; + } + function checkVectorTypeAndReturnLength(vec) { + const s = size(vec); + if (s.length === 1) { + // 1D vector + return s[0]; + } else if (s.length === 2) { + // 2D vector + if (s[0] === 1) { + // row vector + return s[1]; + } else if (s[1] === 1) { + // col vector + return s[0]; + } else { + throw new TypeError('At least one of the arguments is not a vector.'); + } + } else { + throw new TypeError('Only one- or two-dimensional vectors are supported.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ones.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ones.js new file mode 100644 index 0000000..05298dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/ones.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createOnes = void 0; +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'ones'; +const dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +const createOnes = exports.createOnes = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Create a matrix filled with ones. The created matrix can have one or + * multiple dimensions. + * + * Syntax: + * + * math.ones(m) + * math.ones(m, format) + * math.ones(m, n) + * math.ones(m, n, format) + * math.ones([m, n]) + * math.ones([m, n], format) + * math.ones([m, n, p, ...]) + * math.ones([m, n, p, ...], format) + * + * Examples: + * + * math.ones() // returns [] + * math.ones(3) // returns [1, 1, 1] + * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]] + * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]] + * + * See also: + * + * zeros, identity, size, range + * + * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Array | Matrix | number} A matrix filled with ones + */ + return typed('ones', { + '': function () { + return config.matrix === 'Array' ? _ones([]) : _ones([], 'default'); + }, + // math.ones(m, n, p, ..., format) + // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this + '...number | BigNumber | string': function (size) { + const last = size[size.length - 1]; + if (typeof last === 'string') { + const format = size.pop(); + return _ones(size, format); + } else if (config.matrix === 'Array') { + return _ones(size); + } else { + return _ones(size, 'default'); + } + }, + Array: _ones, + Matrix: function (size) { + const format = size.storage(); + return _ones(size.valueOf(), format); + }, + 'Array | Matrix, string': function (size, format) { + return _ones(size.valueOf(), format); + } + }); + + /** + * Create an Array or Matrix with ones + * @param {Array} size + * @param {string} [format='default'] + * @return {Array | Matrix} + * @private + */ + function _ones(size, format) { + const hasBigNumbers = _normalize(size); + const defaultValue = hasBigNumbers ? new BigNumber(1) : 1; + _validate(size); + if (format) { + // return a matrix + const m = matrix(format); + if (size.length > 0) { + return m.resize(size, defaultValue); + } + return m; + } else { + // return an Array + const arr = []; + if (size.length > 0) { + return (0, _array.resize)(arr, size, defaultValue); + } + return arr; + } + } + + // replace BigNumbers with numbers, returns true if size contained BigNumbers + function _normalize(size) { + let hasBigNumbers = false; + size.forEach(function (value, index, arr) { + if ((0, _is.isBigNumber)(value)) { + hasBigNumbers = true; + arr[index] = value.toNumber(); + } + }); + return hasBigNumbers; + } + + // validate arguments + function _validate(size) { + size.forEach(function (value) { + if (typeof value !== 'number' || !(0, _number.isInteger)(value) || value < 0) { + throw new Error('Parameters in function ones must be positive integers'); + } + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js new file mode 100644 index 0000000..5122e7b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js @@ -0,0 +1,149 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPartitionSelect = void 0; +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'partitionSelect'; +const dependencies = ['typed', 'isNumeric', 'isNaN', 'compare']; +const createPartitionSelect = exports.createPartitionSelect = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isNumeric, + isNaN, + compare + } = _ref; + const asc = compare; + const desc = (a, b) => -compare(a, b); + + /** + * Partition-based selection of an array or 1D matrix. + * Will find the kth smallest value, and mutates the input array. + * Uses Quickselect. + * + * Syntax: + * + * math.partitionSelect(x, k) + * math.partitionSelect(x, k, compare) + * + * Examples: + * + * math.partitionSelect([5, 10, 1], 2) // returns 10 + * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B' + * + * function sortByLength (a, b) { + * return a.length - b.length + * } + * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon' + * + * // the input array is mutated + * arr = [5, 2, 1] + * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5] + * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1] + * + * See also: + * + * sort + * + * @param {Matrix | Array} x A one dimensional matrix or array to sort + * @param {Number} k The kth smallest value to be retrieved zero-based index + * @param {Function | 'asc' | 'desc'} [compare='asc'] + * An optional comparator function. The function is called as + * `compare(a, b)`, and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. + * @return {*} Returns the kth lowest value. + */ + return typed(name, { + 'Array | Matrix, number': function (x, k) { + return _partitionSelect(x, k, asc); + }, + 'Array | Matrix, number, string': function (x, k, compare) { + if (compare === 'asc') { + return _partitionSelect(x, k, asc); + } else if (compare === 'desc') { + return _partitionSelect(x, k, desc); + } else { + throw new Error('Compare string must be "asc" or "desc"'); + } + }, + 'Array | Matrix, number, function': _partitionSelect + }); + function _partitionSelect(x, k, compare) { + if (!(0, _number.isInteger)(k) || k < 0) { + throw new Error('k must be a non-negative integer'); + } + if ((0, _is.isMatrix)(x)) { + const size = x.size(); + if (size.length > 1) { + throw new Error('Only one dimensional matrices supported'); + } + return quickSelect(x.valueOf(), k, compare); + } + if (Array.isArray(x)) { + return quickSelect(x, k, compare); + } + } + + /** + * Quickselect algorithm. + * Code adapted from: + * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html + * + * @param {Array} arr + * @param {Number} k + * @param {Function} compare + * @private + */ + function quickSelect(arr, k, compare) { + if (k >= arr.length) { + throw new Error('k out of bounds'); + } + + // check for NaN values since these can cause an infinite while loop + for (let i = 0; i < arr.length; i++) { + if (isNumeric(arr[i]) && isNaN(arr[i])) { + return arr[i]; // return NaN + } + } + let from = 0; + let to = arr.length - 1; + + // if from == to we reached the kth element + while (from < to) { + let r = from; + let w = to; + const pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]; + + // stop if the reader and writer meets + while (r < w) { + // arr[r] >= pivot + if (compare(arr[r], pivot) >= 0) { + // put the large values at the end + const tmp = arr[w]; + arr[w] = arr[r]; + arr[r] = tmp; + --w; + } else { + // the value is smaller than the pivot, skip + ++r; + } + } + + // if we stepped up (r++) we need to step one down (arr[r] > pivot) + if (compare(arr[r], pivot) > 0) { + --r; + } + + // the r pointer is on the end of the first k elements + if (k <= r) { + to = r; + } else { + from = r + 1; + } + } + return arr[k]; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/pinv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/pinv.js new file mode 100644 index 0000000..6b03499 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/pinv.js @@ -0,0 +1,185 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPinv = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +const name = 'pinv'; +const dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex']; +const createPinv = exports.createPinv = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + inv, + deepEqual, + equal, + dotDivide, + dot, + ctranspose, + divideScalar, + multiply, + add, + Complex + } = _ref; + /** + * Calculate the Moore–Penrose inverse of a matrix. + * + * Syntax: + * + * math.pinv(x) + * + * Examples: + * + * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]] + * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]] + * math.pinv(4) // returns 0.25 + * + * See also: + * + * inv + * + * @param {number | Complex | Array | Matrix} x Matrix to be inversed + * @return {number | Complex | Array | Matrix} The inverse of `x`. + */ + return typed(name, { + 'Array | Matrix': function (x) { + const size = (0, _is.isMatrix)(x) ? x.size() : (0, _array.arraySize)(x); + switch (size.length) { + case 1: + // vector + if (_isZeros(x)) return ctranspose(x); // null vector + if (size[0] === 1) { + return inv(x); // invertible matrix + } else { + return dotDivide(ctranspose(x), dot(x, x)); + } + case 2: + // two dimensional array + { + if (_isZeros(x)) return ctranspose(x); // zero matrixx + const rows = size[0]; + const cols = size[1]; + if (rows === cols) { + try { + return inv(x); // invertible matrix + } catch (err) { + if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) { + // Expected + } else { + throw err; + } + } + } + if ((0, _is.isMatrix)(x)) { + return matrix(_pinv(x.valueOf(), rows, cols), x.storage()); + } else { + // return an Array + return _pinv(x, rows, cols); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + (0, _string.format)(size) + ')'); + } + }, + any: function (x) { + // scalar + if (equal(x, 0)) return (0, _object.clone)(x); // zero + return divideScalar(1, x); + } + }); + + /** + * Calculate the Moore–Penrose inverse of a matrix + * @param {Array[]} mat A matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {Array[]} pinv Pseudoinverse matrix + * @private + */ + function _pinv(mat, rows, cols) { + const { + C, + F + } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision) + const Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C)); + const Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F)))); + return multiply(Fpinv, Cpinv); + } + + /** + * Calculate the reduced row echelon form of a matrix + * + * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form + * + * @param {Array[]} mat A matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {Array[]} Reduced row echelon form + * @private + */ + function _rref(mat, rows, cols) { + const M = (0, _object.clone)(mat); + let lead = 0; + for (let r = 0; r < rows; r++) { + if (cols <= lead) { + return M; + } + let i = r; + while (_isZero(M[i][lead])) { + i++; + if (rows === i) { + i = r; + lead++; + if (cols === lead) { + return M; + } + } + } + [M[i], M[r]] = [M[r], M[i]]; + let val = M[r][lead]; + for (let j = 0; j < cols; j++) { + M[r][j] = dotDivide(M[r][j], val); + } + for (let i = 0; i < rows; i++) { + if (i === r) continue; + val = M[i][lead]; + for (let j = 0; j < cols; j++) { + M[i][j] = add(M[i][j], multiply(-1, multiply(val, M[r][j]))); + } + } + lead++; + } + return M; + } + + /** + * Calculate the rank factorization of a matrix + * + * @param {Array[]} mat A matrix (M) + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {{C: Array, F: Array}} rank factorization where M = C F + * @private + */ + function _rankFact(mat, rows, cols) { + const rref = _rref(mat, rows, cols); + const C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j])))); + const F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i]))); + return { + C, + F + }; + } + function _isZero(x) { + return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1))); + } + function _isZeros(arr) { + return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1))); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/range.js new file mode 100644 index 0000000..9492353 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/range.js @@ -0,0 +1,188 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRange = void 0; +var _factory = require("../../utils/factory.js"); +var _noop = require("../../utils/noop.js"); +const name = 'range'; +const dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']; +const createRange = exports.createRange = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + } = _ref; + /** + * Create an array from a range. + * By default, the range end is excluded. This can be customized by providing + * an extra parameter `includeEnd`. + * + * Syntax: + * + * math.range(str [, includeEnd]) // Create a range from a string, + * // where the string contains the + * // start, optional step, and end, + * // separated by a colon. + * math.range(start, end [, includeEnd]) // Create a range with start and + * // end and a step size of 1. + * math.range(start, end, step [, includeEnd]) // Create a range with start, step, + * // and end. + * + * Where: + * + * - `str: string` + * A string 'start:end' or 'start:step:end' + * - `start: {number | BigNumber | Unit}` + * Start of the range + * - `end: number | BigNumber | Unit` + * End of the range, excluded by default, included when parameter includeEnd=true + * - `step: number | BigNumber | Unit` + * Step size. Default value is 1. + * - `includeEnd: boolean` + * Option to specify whether to include the end or not. False by default. + * + * Examples: + * + * math.range(2, 6) // [2, 3, 4, 5] + * math.range(2, -3, -1) // [2, 1, 0, -1, -2] + * math.range('2:1:6') // [2, 3, 4, 5] + * math.range(2, 6, true) // [2, 3, 4, 5, 6] + * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m] + * + * See also: + * + * ones, zeros, size, subset + * + * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`. + * @return {Array | Matrix} range + */ + return typed(name, { + // TODO: simplify signatures when typed-function supports default values and optional arguments + + // TODO: a number or boolean should not be converted to string here + string: _strRange, + 'string, boolean': _strRange, + 'number, number': function (start, end) { + return _out(_range(start, end, 1, false)); + }, + 'number, number, number': function (start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'number, number, boolean': function (start, end, includeEnd) { + return _out(_range(start, end, 1, includeEnd)); + }, + 'number, number, number, boolean': function (start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + }, + 'BigNumber, BigNumber': function (start, end) { + const BigNumber = start.constructor; + return _out(_range(start, end, new BigNumber(1), false)); + }, + 'BigNumber, BigNumber, BigNumber': function (start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'BigNumber, BigNumber, boolean': function (start, end, includeEnd) { + const BigNumber = start.constructor; + return _out(_range(start, end, new BigNumber(1), includeEnd)); + }, + 'BigNumber, BigNumber, BigNumber, boolean': function (start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + }, + 'Unit, Unit, Unit': function (start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'Unit, Unit, Unit, boolean': function (start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + } + }); + function _out(arr) { + if (config.matrix === 'Matrix') { + return matrix ? matrix(arr) : (0, _noop.noMatrix)(); + } + return arr; + } + function _strRange(str, includeEnd) { + const r = _parse(str); + if (!r) { + throw new SyntaxError('String "' + str + '" is no valid range'); + } + if (config.number === 'BigNumber') { + if (bignumber === undefined) { + (0, _noop.noBignumber)(); + } + return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd); + } else { + return _out(_range(r.start, r.end, r.step, includeEnd)); + } + } + + /** + * Create a range with numbers or BigNumbers + * @param {number | BigNumber | Unit} start + * @param {number | BigNumber | Unit} end + * @param {number | BigNumber | Unit} step + * @param {boolean} includeEnd + * @returns {Array} range + * @private + */ + function _range(start, end, step, includeEnd) { + const array = []; + const ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger; + let x = start; + while (ongoing(x, end)) { + array.push(x); + x = add(x, step); + } + return array; + } + + /** + * Parse a string into a range, + * The string contains the start, optional step, and end, separated by a colon. + * If the string does not contain a valid range, null is returned. + * For example str='0:2:11'. + * @param {string} str + * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step + * @private + */ + function _parse(str) { + const args = str.split(':'); + + // number + const nums = args.map(function (arg) { + // use Number and not parseFloat as Number returns NaN on invalid garbage in the string + return Number(arg); + }); + const invalid = nums.some(function (num) { + return isNaN(num); + }); + if (invalid) { + return null; + } + switch (nums.length) { + case 2: + return { + start: nums[0], + end: nums[1], + step: 1 + }; + case 3: + return { + start: nums[0], + end: nums[2], + step: nums[1] + }; + default: + return null; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/reshape.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/reshape.js new file mode 100644 index 0000000..d8cd4e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/reshape.js @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createReshape = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'reshape'; +const dependencies = ['typed', 'isInteger', 'matrix']; +const createReshape = exports.createReshape = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isInteger + } = _ref; + /** + * Reshape a multi dimensional array to fit the specified dimensions + * + * Syntax: + * + * math.reshape(x, sizes) + * + * Examples: + * + * math.reshape([1, 2, 3, 4, 5, 6], [2, 3]) + * // returns Array [[1, 2, 3], [4, 5, 6]] + * + * math.reshape([[1, 2], [3, 4]], [1, 4]) + * // returns Array [[1, 2, 3, 4]] + * + * math.reshape([[1, 2], [3, 4]], [4]) + * // returns Array [1, 2, 3, 4] + * + * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8]) + * math.reshape(x, [2, 2, 2]) + * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] + * + * math.reshape([1, 2, 3, 4], [-1, 2]) + * // returns Matrix [[1, 2], [3, 4]] + * + * See also: + * + * size, squeeze, resize + * + * @param {Array | Matrix | *} x Matrix to be reshaped + * @param {number[]} sizes One dimensional array with integral sizes for + * each dimension. One -1 is allowed as wildcard, + * which calculates this dimension automatically. + * + * @return {* | Array | Matrix} A reshaped clone of matrix `x` + * + * @throws {TypeError} If `sizes` does not contain solely integers + * @throws {DimensionError} If the product of the new dimension sizes does + * not equal that of the old ones + */ + return typed(name, { + 'Matrix, Array': function (x, sizes) { + return x.reshape(sizes, true); + }, + 'Array, Array': function (x, sizes) { + sizes.forEach(function (size) { + if (!isInteger(size)) { + throw new TypeError('Invalid size for dimension: ' + size); + } + }); + return (0, _array.reshape)(x, sizes); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/resize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/resize.js new file mode 100644 index 0000000..6b54e85 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/resize.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createResize = void 0; +var _is = require("../../utils/is.js"); +var _DimensionError = require("../../error/DimensionError.js"); +var _ArgumentsError = require("../../error/ArgumentsError.js"); +var _number = require("../../utils/number.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'resize'; +const dependencies = ['config', 'matrix']; +const createResize = exports.createResize = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + config, + matrix + } = _ref; + /** + * Resize a matrix + * + * Syntax: + * + * math.resize(x, size) + * math.resize(x, size, defaultValue) + * + * Examples: + * + * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3] + * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0] + * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]] + * math.resize("hello", [8], "!") // returns string 'hello!!!' + * + * See also: + * + * size, squeeze, subset, reshape + * + * @param {Array | Matrix | *} x Matrix to be resized + * @param {Array | Matrix} size One dimensional array with numbers + * @param {number | string} [defaultValue=0] Zero by default, except in + * case of a string, in that case + * defaultValue = ' ' + * @return {* | Array | Matrix} A resized clone of matrix `x` + */ + // TODO: rework resize to a typed-function + return function resize(x, size, defaultValue) { + if (arguments.length !== 2 && arguments.length !== 3) { + throw new _ArgumentsError.ArgumentsError('resize', arguments.length, 2, 3); + } + if ((0, _is.isMatrix)(size)) { + size = size.valueOf(); // get Array + } + if ((0, _is.isBigNumber)(size[0])) { + // convert bignumbers to numbers + size = size.map(function (value) { + return !(0, _is.isBigNumber)(value) ? value : value.toNumber(); + }); + } + + // check x is a Matrix + if ((0, _is.isMatrix)(x)) { + // use optimized matrix implementation, return copy + return x.resize(size, defaultValue, true); + } + if (typeof x === 'string') { + // resize string + return _resizeString(x, size, defaultValue); + } + + // check result should be a matrix + const asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array'; + if (size.length === 0) { + // output a scalar + while (Array.isArray(x)) { + x = x[0]; + } + return (0, _object.clone)(x); + } else { + // output an array/matrix + if (!Array.isArray(x)) { + x = [x]; + } + x = (0, _object.clone)(x); + const res = (0, _array.resize)(x, size, defaultValue); + return asMatrix ? matrix(res) : res; + } + }; + + /** + * Resize a string + * @param {string} str + * @param {number[]} size + * @param {string} [defaultChar=' '] + * @private + */ + function _resizeString(str, size, defaultChar) { + if (defaultChar !== undefined) { + if (typeof defaultChar !== 'string' || defaultChar.length !== 1) { + throw new TypeError('Single character expected as defaultValue'); + } + } else { + defaultChar = ' '; + } + if (size.length !== 1) { + throw new _DimensionError.DimensionError(size.length, 1); + } + const len = size[0]; + if (typeof len !== 'number' || !(0, _number.isInteger)(len)) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + (0, _string.format)(size) + ')'); + } + if (str.length > len) { + return str.substring(0, len); + } else if (str.length < len) { + let res = str; + for (let i = 0, ii = len - str.length; i < ii; i++) { + res += defaultChar; + } + return res; + } else { + return str; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotate.js new file mode 100644 index 0000000..5a65c61 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotate.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRotate = void 0; +var _factory = require("../../utils/factory.js"); +var _array = require("../../utils/array.js"); +const name = 'rotate'; +const dependencies = ['typed', 'multiply', 'rotationMatrix']; +const createRotate = exports.createRotate = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + multiply, + rotationMatrix + } = _ref; + /** + * Rotate a vector of size 1x2 counter-clockwise by a given angle + * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis + * + * Syntax: + * + * math.rotate(w, theta) + * math.rotate(w, theta, v) + * + * Examples: + * + * math.rotate([11, 12], math.pi / 2) // returns [-12, 11] + * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11] + * + * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0] + * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0] + * + * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)] + * + * See also: + * + * matrix, rotationMatrix + * + * @param {Array | Matrix} w Vector to rotate + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @return {Array | Matrix} Multiplication of the rotation matrix and w + */ + return typed(name, { + 'Array , number | BigNumber | Complex | Unit': function (w, theta) { + _validateSize(w, 2); + const matrixRes = multiply(rotationMatrix(theta), w); + return matrixRes.toArray(); + }, + 'Matrix , number | BigNumber | Complex | Unit': function (w, theta) { + _validateSize(w, 2); + return multiply(rotationMatrix(theta), w); + }, + 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function (w, theta, v) { + _validateSize(w, 3); + const matrixRes = multiply(rotationMatrix(theta, v), w); + return matrixRes; + }, + 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function (w, theta, v) { + _validateSize(w, 3); + return multiply(rotationMatrix(theta, v), w); + } + }); + function _validateSize(v, expectedSize) { + const actualSize = Array.isArray(v) ? (0, _array.arraySize)(v) : v.size(); + if (actualSize.length > 2) { + throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`); + } + if (actualSize.length === 2 && actualSize[1] !== 1) { + throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`); + } + if (actualSize[0] !== expectedSize) { + throw new RangeError(`Vector must be of dimensions 1x${expectedSize}`); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js new file mode 100644 index 0000000..3129f42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js @@ -0,0 +1,166 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRotationMatrix = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'rotationMatrix'; +const dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin']; +const createRotationMatrix = exports.createRotationMatrix = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + multiplyScalar, + addScalar, + unaryMinus, + norm, + BigNumber, + matrix, + DenseMatrix, + SparseMatrix, + cos, + sin + } = _ref; + /** + * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians). + * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3). + * + * Syntax: + * + * math.rotationMatrix(theta) + * math.rotationMatrix(theta, format) + * math.rotationMatrix(theta, [v]) + * math.rotationMatrix(theta, [v], format) + * + * Examples: + * + * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]] + * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]] + * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]] + * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]] + * + * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]] + * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]) + * + * + * See also: + * + * matrix, cos, sin + * + * + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @param {string} [format] Result Matrix storage format + * @return {Array | Matrix} Rotation matrix + */ + + return typed(name, { + '': function () { + return config.matrix === 'Matrix' ? matrix([]) : []; + }, + string: function (format) { + return matrix(format); + }, + 'number | BigNumber | Complex | Unit': function (theta) { + return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber | Complex | Unit, string': function (theta, format) { + return _rotationMatrix2x2(theta, format); + }, + 'number | BigNumber | Complex | Unit, Array': function (theta, v) { + const matrixV = matrix(v); + _validateVector(matrixV); + return _rotationMatrix3x3(theta, matrixV, undefined); + }, + 'number | BigNumber | Complex | Unit, Matrix': function (theta, v) { + _validateVector(v); + const storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined); + return _rotationMatrix3x3(theta, v, storageType); + }, + 'number | BigNumber | Complex | Unit, Array, string': function (theta, v, format) { + const matrixV = matrix(v); + _validateVector(matrixV); + return _rotationMatrix3x3(theta, matrixV, format); + }, + 'number | BigNumber | Complex | Unit, Matrix, string': function (theta, v, format) { + _validateVector(v); + return _rotationMatrix3x3(theta, v, format); + } + }); + + /** + * Returns 2x2 matrix of 2D rotation of angle theta + * + * @param {number | BigNumber | Complex | Unit} theta The rotation angle + * @param {string} format The result Matrix storage format + * @returns {Matrix} + * @private + */ + function _rotationMatrix2x2(theta, format) { + const Big = (0, _is.isBigNumber)(theta); + const minusOne = Big ? new BigNumber(-1) : -1; + const cosTheta = cos(theta); + const sinTheta = sin(theta); + const data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]]; + return _convertToFormat(data, format); + } + function _validateVector(v) { + const size = v.size(); + if (size.length < 1 || size[0] !== 3) { + throw new RangeError('Vector must be of dimensions 1x3'); + } + } + function _mul(array) { + return array.reduce((p, curr) => multiplyScalar(p, curr)); + } + function _convertToFormat(data, format) { + if (format) { + if (format === 'sparse') { + return new SparseMatrix(data); + } + if (format === 'dense') { + return new DenseMatrix(data); + } + throw new TypeError(`Unknown matrix type "${format}"`); + } + return data; + } + + /** + * Returns a 3x3 matrix of rotation of angle theta around vector v + * + * @param {number | BigNumber | Complex | Unit} theta The rotation angle + * @param {Matrix} v The rotation axis vector + * @param {string} format The storage format of the resulting matrix + * @returns {Matrix} + * @private + */ + function _rotationMatrix3x3(theta, v, format) { + const normV = norm(v); + if (normV === 0) { + throw new RangeError('Rotation around zero vector'); + } + const Big = (0, _is.isBigNumber)(theta) ? BigNumber : null; + const one = Big ? new Big(1) : 1; + const minusOne = Big ? new Big(-1) : -1; + const vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV; + const vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV; + const vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV; + const c = cos(theta); + const oneMinusC = addScalar(one, unaryMinus(c)); + const s = sin(theta); + const r11 = addScalar(c, _mul([vx, vx, oneMinusC])); + const r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s])); + const r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s])); + const r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s])); + const r22 = addScalar(c, _mul([vy, vy, oneMinusC])); + const r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s])); + const r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s])); + const r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s])); + const r33 = addScalar(c, _mul([vz, vz, oneMinusC])); + const data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]]; + return _convertToFormat(data, format); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/row.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/row.js new file mode 100644 index 0000000..4c8b272 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/row.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRow = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +const name = 'row'; +const dependencies = ['typed', 'Index', 'matrix', 'range']; +const createRow = exports.createRow = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Index, + matrix, + range + } = _ref; + /** + * Return a row from a Matrix. + * + * Syntax: + * + * math.row(value, index) + * + * Example: + * + * // get a row + * const d = [[1, 2], [3, 4]] + * math.row(d, 1) // returns [[3, 4]] + * + * See also: + * + * column + * + * @param {Array | Matrix } value An array or matrix + * @param {number} row The index of the row + * @return {Array | Matrix} The retrieved row + */ + return typed(name, { + 'Matrix, number': _row, + 'Array, number': function (value, row) { + return _row(matrix((0, _object.clone)(value)), row).valueOf(); + } + }); + + /** + * Retrieve a row of a matrix + * @param {Matrix } value A matrix + * @param {number} row The index of the row + * @return {Matrix} The retrieved row + */ + function _row(value, row) { + // check dimensions + if (value.size().length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + (0, _array.validateIndex)(row, value.size()[0]); + const columnRange = range(0, value.size()[1]); + const index = new Index(row, columnRange); + const result = value.subset(index); + return (0, _is.isMatrix)(result) ? result : matrix([[result]]); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/size.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/size.js new file mode 100644 index 0000000..f40b9a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/size.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSize = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _noop = require("../../utils/noop.js"); +const name = 'size'; +const dependencies = ['typed', 'config', '?matrix']; +const createSize = exports.createSize = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix + } = _ref; + /** + * Calculate the size of a matrix or scalar. + * + * Syntax: + * + * math.size(x) + * + * Examples: + * + * math.size(2.3) // returns [] + * math.size('hello world') // returns [11] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.size(A) // returns [2, 3] + * math.size(math.range(1,6).toArray()) // returns [5] + * + * See also: + * + * count, resize, squeeze, subset + * + * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix + * @return {Array | Matrix} A vector with size of `x`. + */ + return typed(name, { + Matrix: function (x) { + return x.create(x.size(), 'number'); + }, + Array: _array.arraySize, + string: function (x) { + return config.matrix === 'Array' ? [x.length] : matrix([x.length], 'dense', 'number'); + }, + 'number | Complex | BigNumber | Unit | boolean | null': function (x) { + // scalar + return config.matrix === 'Array' ? [] : matrix ? matrix([], 'dense', 'number') : (0, _noop.noMatrix)(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sort.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sort.js new file mode 100644 index 0000000..6be9626 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sort.js @@ -0,0 +1,119 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSort = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'sort'; +const dependencies = ['typed', 'matrix', 'compare', 'compareNatural']; +const createSort = exports.createSort = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + compare, + compareNatural + } = _ref; + const compareAsc = compare; + const compareDesc = (a, b) => -compare(a, b); + + /** + * Sort the items in a matrix. + * + * Syntax: + * + * math.sort(x) + * math.sort(x, compare) + * + * Examples: + * + * math.sort([5, 10, 1]) // returns [1, 5, 10] + * math.sort(['C', 'B', 'A', 'D'], math.compareNatural) + * // returns ['A', 'B', 'C', 'D'] + * + * function sortByLength (a, b) { + * return a.length - b.length + * } + * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength) + * // returns ['Tom', 'Sara', 'Langdon'] + * + * See also: + * + * filter, forEach, map, compare, compareNatural + * + * @param {Matrix | Array} x A one dimensional matrix or array to sort + * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc'] + * An optional _comparator function or name. The function is called as + * `compare(a, b)`, and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. + * @return {Matrix | Array} Returns the sorted matrix. + */ + return typed(name, { + Array: function (x) { + _arrayIsVector(x); + return x.sort(compareAsc); + }, + Matrix: function (x) { + _matrixIsVector(x); + return matrix(x.toArray().sort(compareAsc), x.storage()); + }, + 'Array, function': function (x, _comparator) { + _arrayIsVector(x); + return x.sort(_comparator); + }, + 'Matrix, function': function (x, _comparator) { + _matrixIsVector(x); + return matrix(x.toArray().sort(_comparator), x.storage()); + }, + 'Array, string': function (x, order) { + _arrayIsVector(x); + return x.sort(_comparator(order)); + }, + 'Matrix, string': function (x, order) { + _matrixIsVector(x); + return matrix(x.toArray().sort(_comparator(order)), x.storage()); + } + }); + + /** + * Get the comparator for given order ('asc', 'desc', 'natural') + * @param {'asc' | 'desc' | 'natural'} order + * @return {Function} Returns a _comparator function + */ + function _comparator(order) { + if (order === 'asc') { + return compareAsc; + } else if (order === 'desc') { + return compareDesc; + } else if (order === 'natural') { + return compareNatural; + } else { + throw new Error('String "asc", "desc", or "natural" expected'); + } + } + + /** + * Validate whether an array is one dimensional + * Throws an error when this is not the case + * @param {Array} array + * @private + */ + function _arrayIsVector(array) { + if ((0, _array.arraySize)(array).length !== 1) { + throw new Error('One dimensional array expected'); + } + } + + /** + * Validate whether a matrix is one dimensional + * Throws an error when this is not the case + * @param {Matrix} matrix + * @private + */ + function _matrixIsVector(matrix) { + if (matrix.size().length !== 1) { + throw new Error('One dimensional matrix expected'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js new file mode 100644 index 0000000..3c8f271 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSqrtm = void 0; +var _is = require("../../utils/is.js"); +var _string = require("../../utils/string.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'sqrtm'; +const dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity']; +const createSqrtm = exports.createSqrtm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + add, + multiply, + map, + sqrt, + subtract, + inv, + size, + max, + identity + } = _ref; + const _maxIterations = 1e3; + const _tolerance = 1e-6; + + /** + * Calculate the principal square root matrix using the Denman–Beavers iterative method + * + * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman–Beavers_iteration + * + * @param {Array | Matrix} A The square matrix `A` + * @return {Array | Matrix} The principal square root of matrix `A` + * @private + */ + function _denmanBeavers(A) { + let error; + let iterations = 0; + let Y = A; + let Z = identity(size(A)); + do { + const Yk = Y; + Y = multiply(0.5, add(Yk, inv(Z))); + Z = multiply(0.5, add(Z, inv(Yk))); + error = max(abs(subtract(Y, Yk))); + if (error > _tolerance && ++iterations > _maxIterations) { + throw new Error('computing square root of matrix: iterative method could not converge'); + } + } while (error > _tolerance); + return Y; + } + + /** + * Calculate the principal square root of a square matrix. + * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`. + * + * https://en.wikipedia.org/wiki/Square_root_of_a_matrix + * + * Syntax: + * + * math.sqrtm(A) + * + * Examples: + * + * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]] + * + * See also: + * + * sqrt, pow + * + * @param {Array | Matrix} A The square matrix `A` + * @return {Array | Matrix} The principal square root of matrix `A` + */ + return typed(name, { + 'Array | Matrix': function (A) { + const size = (0, _is.isMatrix)(A) ? A.size() : (0, _array.arraySize)(A); + switch (size.length) { + case 1: + // Single element Array | Matrix + if (size[0] === 1) { + return map(A, sqrt); + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + case 2: + { + // Two-dimensional Array | Matrix + const rows = size[0]; + const cols = size[1]; + if (rows === cols) { + return _denmanBeavers(A); + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + (0, _string.format)(size) + ')'); + } + } + default: + // Multi dimensional array + throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + (0, _string.format)(size) + ')'); + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js new file mode 100644 index 0000000..78ba0f9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSqueeze = void 0; +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'squeeze'; +const dependencies = ['typed']; +const createSqueeze = exports.createSqueeze = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. + * + * Syntax: + * + * math.squeeze(x) + * + * Examples: + * + * math.squeeze([3]) // returns 3 + * math.squeeze([[3]]) // returns 3 + * + * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1) + * math.squeeze(A) // returns [0, 0, 0] (size 3) + * + * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3) + * math.squeeze(B) // returns [0, 0, 0] (size 3) + * + * // only inner and outer dimensions are removed + * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3) + * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3) + * + * See also: + * + * subset + * + * @param {Matrix | Array} x Matrix to be squeezed + * @return {Matrix | Array} Squeezed matrix + */ + return typed(name, { + Array: function (x) { + return (0, _array.squeeze)((0, _object.clone)(x)); + }, + Matrix: function (x) { + const res = (0, _array.squeeze)(x.toArray()); + // FIXME: return the same type of matrix as the input + return Array.isArray(res) ? x.create(res, x.datatype()) : res; + }, + any: function (x) { + // scalar + return (0, _object.clone)(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/subset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/subset.js new file mode 100644 index 0000000..dd448ee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/subset.js @@ -0,0 +1,279 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSubset = void 0; +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +var _customs = require("../../utils/customs.js"); +var _DimensionError = require("../../error/DimensionError.js"); +var _factory = require("../../utils/factory.js"); +const name = 'subset'; +const dependencies = ['typed', 'matrix', 'zeros', 'add']; +const createSubset = exports.createSubset = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + zeros, + add + } = _ref; + /** + * Get or set a subset of a matrix or string. + * + * Syntax: + * math.subset(value, index) // retrieve a subset + * math.subset(value, index, replacement [, defaultValue]) // replace a subset + * + * Examples: + * + * // get a subset + * const d = [[1, 2], [3, 4]] + * math.subset(d, math.index(1, 0)) // returns 3 + * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]] + * math.subset(d, math.index([false, true], 0)) // returns [[3]] + * + * // replace a subset + * const e = [] + * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]] + * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]] + * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]] + * + * // get submatrix using ranges + * const M = [ + * [1,2,3], + * [4,5,6], + * [7,8,9] + * ] + * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]] + * + * See also: + * + * size, resize, squeeze, index + * + * @param {Array | Matrix | string} matrix An array, matrix, or string + * @param {Index} index + * For each dimension of the target, specifies an index or a list of + * indices to fetch or set. `subset` uses the cartesian product of + * the indices specified in each dimension. + * @param {*} [replacement] An array, matrix, or scalar. + * If provided, the subset is replaced with replacement. + * If not provided, the subset is returned + * @param {*} [defaultValue=undefined] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * math.matrix elements will be left undefined. + * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix. + */ + + return typed(name, { + // get subset + 'Matrix, Index': function (value, index) { + if ((0, _array.isEmptyIndex)(index)) { + return matrix(); + } + (0, _array.validateIndexSourceSize)(value, index); + return value.subset(index); + }, + 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) { + return function (value, index) { + const subsetResult = subsetRef(matrix(value), index); + return index.isScalar() ? subsetResult : subsetResult.valueOf(); + }; + }), + 'Object, Index': _getObjectProperty, + 'string, Index': _getSubstring, + // set subset + 'Matrix, Index, any, any': function (value, index, replacement, defaultValue) { + if ((0, _array.isEmptyIndex)(index)) { + return value; + } + (0, _array.validateIndexSourceSize)(value, index); + return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue); + }, + 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement, defaultValue) { + const subsetResult = subsetRef(matrix(value), index, replacement, defaultValue); + return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult; + }; + }), + 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement) { + return subsetRef(matrix(value), index, replacement, undefined).valueOf(); + }; + }), + 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement) { + return subsetRef(value, index, replacement, undefined); + }; + }), + 'string, Index, string': _setSubstring, + 'string, Index, string, string': _setSubstring, + 'Object, Index, any': _setObjectProperty + }); + + /** + * Broadcasts a replacment value to be the same size as index + * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast + * @param {*} index Index value + * @returns broadcasted replacement that matches the size of index + */ + + function _broadcastReplacement(replacement, index) { + if (typeof replacement === 'string') { + throw new Error('can\'t boradcast a string'); + } + if (index._isScalar) { + return replacement; + } + const indexSize = index.size(); + if (indexSize.every(d => d > 0)) { + try { + return add(replacement, zeros(indexSize)); + } catch (error) { + return replacement; + } + } else { + return replacement; + } + } +}); + +/** + * Retrieve a subset of a string + * @param {string} str string from which to get a substring + * @param {Index} index An index or list of indices (character positions) + * @returns {string} substring + * @private + */ +function _getSubstring(str, index) { + if (!(0, _is.isIndex)(index)) { + // TODO: better error message + throw new TypeError('Index expected'); + } + if ((0, _array.isEmptyIndex)(index)) { + return ''; + } + (0, _array.validateIndexSourceSize)(Array.from(str), index); + if (index.size().length !== 1) { + throw new _DimensionError.DimensionError(index.size().length, 1); + } + + // validate whether the range is out of range + const strLen = str.length; + (0, _array.validateIndex)(index.min()[0], strLen); + (0, _array.validateIndex)(index.max()[0], strLen); + const range = index.dimension(0); + let substr = ''; + range.forEach(function (v) { + substr += str.charAt(v); + }); + return substr; +} + +/** + * Replace a substring in a string + * @param {string} str string to be replaced + * @param {Index} index An index or list of indices (character positions) + * @param {string} replacement Replacement string + * @param {string} [defaultValue] Default value to be used when resizing + * the string. is ' ' by default + * @returns {string} result + * @private + */ +function _setSubstring(str, index, replacement, defaultValue) { + if (!index || index.isIndex !== true) { + // TODO: better error message + throw new TypeError('Index expected'); + } + if ((0, _array.isEmptyIndex)(index)) { + return str; + } + (0, _array.validateIndexSourceSize)(Array.from(str), index); + if (index.size().length !== 1) { + throw new _DimensionError.DimensionError(index.size().length, 1); + } + if (defaultValue !== undefined) { + if (typeof defaultValue !== 'string' || defaultValue.length !== 1) { + throw new TypeError('Single character expected as defaultValue'); + } + } else { + defaultValue = ' '; + } + const range = index.dimension(0); + const len = range.size()[0]; + if (len !== replacement.length) { + throw new _DimensionError.DimensionError(range.size()[0], replacement.length); + } + + // validate whether the range is out of range + const strLen = str.length; + (0, _array.validateIndex)(index.min()[0]); + (0, _array.validateIndex)(index.max()[0]); + + // copy the string into an array with characters + const chars = []; + for (let i = 0; i < strLen; i++) { + chars[i] = str.charAt(i); + } + range.forEach(function (v, i) { + chars[v] = replacement.charAt(i[0]); + }); + + // initialize undefined characters with a space + if (chars.length > strLen) { + for (let i = strLen - 1, len = chars.length; i < len; i++) { + if (!chars[i]) { + chars[i] = defaultValue; + } + } + } + return chars.join(''); +} + +/** + * Retrieve a property from an object + * @param {Object} object + * @param {Index} index + * @return {*} Returns the value of the property + * @private + */ +function _getObjectProperty(object, index) { + if ((0, _array.isEmptyIndex)(index)) { + return undefined; + } + if (index.size().length !== 1) { + throw new _DimensionError.DimensionError(index.size(), 1); + } + const key = index.dimension(0); + if (typeof key !== 'string') { + throw new TypeError('String expected as index to retrieve an object property'); + } + return (0, _customs.getSafeProperty)(object, key); +} + +/** + * Set a property on an object + * @param {Object} object + * @param {Index} index + * @param {*} replacement + * @return {*} Returns the updated object + * @private + */ +function _setObjectProperty(object, index, replacement) { + if ((0, _array.isEmptyIndex)(index)) { + return object; + } + if (index.size().length !== 1) { + throw new _DimensionError.DimensionError(index.size(), 1); + } + const key = index.dimension(0); + if (typeof key !== 'string') { + throw new TypeError('String expected as index to retrieve an object property'); + } + + // clone the object, and apply the property to the clone + const updated = (0, _object.clone)(object); + (0, _customs.setSafeProperty)(updated, key, replacement); + return updated; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/trace.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/trace.js new file mode 100644 index 0000000..d947434 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/trace.js @@ -0,0 +1,134 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTrace = void 0; +var _object = require("../../utils/object.js"); +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +const name = 'trace'; +const dependencies = ['typed', 'matrix', 'add']; +const createTrace = exports.createTrace = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + add + } = _ref; + /** + * Calculate the trace of a matrix: the sum of the elements on the main + * diagonal of a square matrix. + * + * Syntax: + * + * math.trace(x) + * + * Examples: + * + * math.trace([[1, 2], [3, 4]]) // returns 5 + * + * const A = [ + * [1, 2, 3], + * [-1, 2, 3], + * [2, 0, 3] + * ] + * math.trace(A) // returns 6 + * + * See also: + * + * diag + * + * @param {Array | Matrix} x A matrix + * + * @return {number} The trace of `x` + */ + return typed('trace', { + Array: function _arrayTrace(x) { + // use dense matrix implementation + return _denseTrace(matrix(x)); + }, + SparseMatrix: _sparseTrace, + DenseMatrix: _denseTrace, + any: _object.clone + }); + function _denseTrace(m) { + // matrix size & data + const size = m._size; + const data = m._data; + + // process dimensions + switch (size.length) { + case 1: + // vector + if (size[0] === 1) { + // return data[0] + return (0, _object.clone)(data[0]); + } + throw new RangeError('Matrix must be square (size: ' + (0, _string.format)(size) + ')'); + case 2: + { + // two dimensional + const rows = size[0]; + const cols = size[1]; + if (rows === cols) { + // calulate sum + let sum = 0; + // loop diagonal + for (let i = 0; i < rows; i++) { + sum = add(sum, data[i][i]); + } + // return trace + return sum; + } else { + throw new RangeError('Matrix must be square (size: ' + (0, _string.format)(size) + ')'); + } + } + default: + // multi dimensional + throw new RangeError('Matrix must be two dimensional (size: ' + (0, _string.format)(size) + ')'); + } + } + function _sparseTrace(m) { + // matrix arrays + const values = m._values; + const index = m._index; + const ptr = m._ptr; + const size = m._size; + // check dimensions + const rows = size[0]; + const columns = size[1]; + // matrix must be square + if (rows === columns) { + // calulate sum + let sum = 0; + // check we have data (avoid looping columns) + if (values.length > 0) { + // loop columns + for (let j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = ptr[j]; + const k1 = ptr[j + 1]; + // loop k within [k0, k1[ + for (let k = k0; k < k1; k++) { + // row index + const i = index[k]; + // check row + if (i === j) { + // accumulate value + sum = add(sum, values[k]); + // exit loop + break; + } + if (i > j) { + // exit loop, no value on the diagonal for column j + break; + } + } + } + } + // return trace + return sum; + } + throw new RangeError('Matrix must be square (size: ' + (0, _string.format)(size) + ')'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/transpose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/transpose.js new file mode 100644 index 0000000..f7e158d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/transpose.js @@ -0,0 +1,166 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTranspose = void 0; +var _object = require("../../utils/object.js"); +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +const name = 'transpose'; +const dependencies = ['typed', 'matrix']; +const createTranspose = exports.createTranspose = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix + } = _ref; + /** + * Transpose a matrix. All values of the matrix are reflected over its + * main diagonal. Only applicable to two dimensional matrices containing + * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional + * vectors and scalars return the input unchanged. + * + * Syntax: + * + * math.transpose(x) + * + * Examples: + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]] + * + * See also: + * + * diag, inv, subset, squeeze + * + * @param {Array | Matrix} x Matrix to be transposed + * @return {Array | Matrix} The transposed matrix + */ + return typed(name, { + Array: x => transposeMatrix(matrix(x)).valueOf(), + Matrix: transposeMatrix, + any: _object.clone // scalars + }); + function transposeMatrix(x) { + // matrix size + const size = x.size(); + + // result + let c; + + // process dimensions + switch (size.length) { + case 1: + // vector + c = x.clone(); + break; + case 2: + { + // rows and columns + const rows = size[0]; + const columns = size[1]; + + // check columns + if (columns === 0) { + // throw exception + throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + (0, _string.format)(size) + ')'); + } + + // process storage format + switch (x.storage()) { + case 'dense': + c = _denseTranspose(x, rows, columns); + break; + case 'sparse': + c = _sparseTranspose(x, rows, columns); + break; + } + } + break; + default: + // multi dimensional + throw new RangeError('Matrix must be a vector or two dimensional (size: ' + (0, _string.format)(size) + ')'); + } + return c; + } + function _denseTranspose(m, rows, columns) { + // matrix array + const data = m._data; + // transposed matrix data + const transposed = []; + let transposedRow; + // loop columns + for (let j = 0; j < columns; j++) { + // initialize row + transposedRow = transposed[j] = []; + // loop rows + for (let i = 0; i < rows; i++) { + // set data + transposedRow[i] = (0, _object.clone)(data[i][j]); + } + } + // return matrix + return m.createDenseMatrix({ + data: transposed, + size: [columns, rows], + datatype: m._datatype + }); + } + function _sparseTranspose(m, rows, columns) { + // matrix arrays + const values = m._values; + const index = m._index; + const ptr = m._ptr; + // result matrices + const cvalues = values ? [] : undefined; + const cindex = []; + const cptr = []; + // row counts + const w = []; + for (let x = 0; x < rows; x++) { + w[x] = 0; + } + // vars + let p, l, j; + // loop values in matrix + for (p = 0, l = index.length; p < l; p++) { + // number of values in row + w[index[p]]++; + } + // cumulative sum + let sum = 0; + // initialize cptr with the cummulative sum of row counts + for (let i = 0; i < rows; i++) { + // update cptr + cptr.push(sum); + // update sum + sum += w[i]; + // update w + w[i] = cptr[i]; + } + // update cptr + cptr.push(sum); + // loop columns + for (j = 0; j < columns; j++) { + // values & index in column + for (let k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) { + // C values & index + const q = w[index[k]]++; + // C[j, i] = A[i, j] + cindex[q] = j; + // check we need to process values (pattern matrix) + if (values) { + cvalues[q] = (0, _object.clone)(values[k]); + } + } + } + // return matrix + return m.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [columns, rows], + datatype: m._datatype + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/zeros.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/zeros.js new file mode 100644 index 0000000..0d072a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/matrix/zeros.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createZeros = void 0; +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'zeros'; +const dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +const createZeros = exports.createZeros = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Create a matrix filled with zeros. The created matrix can have one or + * multiple dimensions. + * + * Syntax: + * + * math.zeros(m) + * math.zeros(m, format) + * math.zeros(m, n) + * math.zeros(m, n, format) + * math.zeros([m, n]) + * math.zeros([m, n], format) + * + * Examples: + * + * math.zeros() // returns [] + * math.zeros(3) // returns [0, 0, 0] + * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]] + * math.zeros(3, 'dense') // returns [0, 0, 0] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]] + * + * See also: + * + * ones, identity, size, range + * + * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Array | Matrix} A matrix filled with zeros + */ + return typed(name, { + '': function () { + return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default'); + }, + // math.zeros(m, n, p, ..., format) + // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this + '...number | BigNumber | string': function (size) { + const last = size[size.length - 1]; + if (typeof last === 'string') { + const format = size.pop(); + return _zeros(size, format); + } else if (config.matrix === 'Array') { + return _zeros(size); + } else { + return _zeros(size, 'default'); + } + }, + Array: _zeros, + Matrix: function (size) { + const format = size.storage(); + return _zeros(size.valueOf(), format); + }, + 'Array | Matrix, string': function (size, format) { + return _zeros(size.valueOf(), format); + } + }); + + /** + * Create an Array or Matrix with zeros + * @param {Array} size + * @param {string} [format='default'] + * @return {Array | Matrix} + * @private + */ + function _zeros(size, format) { + const hasBigNumbers = _normalize(size); + const defaultValue = hasBigNumbers ? new BigNumber(0) : 0; + _validate(size); + if (format) { + // return a matrix + const m = matrix(format); + if (size.length > 0) { + return m.resize(size, defaultValue); + } + return m; + } else { + // return an Array + const arr = []; + if (size.length > 0) { + return (0, _array.resize)(arr, size, defaultValue); + } + return arr; + } + } + + // replace BigNumbers with numbers, returns true if size contained BigNumbers + function _normalize(size) { + let hasBigNumbers = false; + size.forEach(function (value, index, arr) { + if ((0, _is.isBigNumber)(value)) { + hasBigNumbers = true; + arr[index] = value.toNumber(); + } + }); + return hasBigNumbers; + } + + // validate arguments + function _validate(size) { + size.forEach(function (value) { + if (typeof value !== 'number' || !(0, _number.isInteger)(value) || value < 0) { + throw new Error('Parameters in function zeros must be positive integers'); + } + }); + } +}); + +// TODO: zeros contains almost the same code as ones. Reuse this? \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js new file mode 100644 index 0000000..f55aaad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js @@ -0,0 +1,289 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSolveODE = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'solveODE'; +const dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus']; +const createSolveODE = exports.createSolveODE = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + subtract, + multiply, + divide, + max, + map, + abs, + isPositive, + isNegative, + larger, + smaller, + matrix, + bignumber, + unaryMinus + } = _ref; + /** + * Numerical Integration of Ordinary Differential Equations + * + * Two variable step methods are provided: + * - "RK23": Bogacki–Shampine method + * - "RK45": Dormand-Prince method RK5(4)7M (default) + * + * The arguments are expected as follows. + * + * - `func` should be the forcing function `f(t, y)` + * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]` + * - `y0` the initial state values, should be a scalar or a flat array + * - `options` should be an object with the following information: + * - `method` ('RK45'): ['RK23', 'RK45'] + * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value + * - `firstStep`: Initial step size + * - `minStep`: minimum step size of the method + * - `maxStep`: maximum step size of the method + * - `minDelta` (0.2): minimum ratio of change for the step + * - `maxDelta` (5): maximum ratio of change for the step + * - `maxIter` (1e4): maximum number of iterations + * + * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`: + * - `t` an array of size `[n]` + * - `y` the states array can be in two ways + * - **if `y0` is a scalar:** returns an array-like of size `[n]` + * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]` + * + * Syntax: + * + * math.solveODE(func, tspan, y0) + * math.solveODE(func, tspan, y0, options) + * + * Examples: + * + * function func(t, y) {return y} + * const tspan = [0, 4] + * const y0 = 1 + * math.solveODE(func, tspan, y0) + * math.solveODE(func, tspan, [1, 2]) + * math.solveODE(func, tspan, y0, { method:"RK23", maxStep:0.1 }) + * + * See also: + * + * derivative, simplifyCore + * + * @param {function} func The forcing function f(t,y) + * @param {Array | Matrix} tspan The time span + * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value + * @param {Object} [options] Optional configuration options + * @return {Object} Return an object with t and y values as arrays + */ + + function _rk(butcherTableau) { + // generates an adaptive runge kutta method from it's butcher tableau + + return function (f, tspan, y0, options) { + // adaptive runge kutta methods + const wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(_is.isUnit))); + if (wrongTSpan) { + throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]'); + } + const t0 = tspan[0]; // initial time + const tf = tspan[1]; // final time + const isForwards = larger(tf, t0); + const firstStep = options.firstStep; + if (firstStep !== undefined && !isPositive(firstStep)) { + throw new Error('"firstStep" must be positive'); + } + const maxStep = options.maxStep; + if (maxStep !== undefined && !isPositive(maxStep)) { + throw new Error('"maxStep" must be positive'); + } + const minStep = options.minStep; + if (minStep && isNegative(minStep)) { + throw new Error('"minStep" must be positive or zero'); + } + const timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined); + if (!(timeVars.every(isNumOrBig) || timeVars.every(_is.isUnit))) { + throw new Error('Inconsistent type of "t" dependant variables'); + } + const steps = 1; // divide time in this number of steps + const tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option) + const minDelta = options.minDelta ? options.minDelta : 0.2; + const maxDelta = options.maxDelta ? options.maxDelta : 5; + const maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong + const hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(_is.isBigNumber); + const [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp]; + let h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size + const t = [t0]; // start the time array + const y = [y0]; // start the solution array + + const deltaB = subtract(b, bp); // b - bp + + let n = 0; + let iter = 0; + const ongoing = _createOngoing(isForwards); + const trimStep = _createTrimStep(isForwards); + // iterate unitil it reaches either the final time or maximum iterations + while (ongoing(t[n], tf)) { + const k = []; + + // trim the time step so that it doesn't overshoot + h = trimStep(t[n], tf, h); + + // calculate the first value of k + k.push(f(t[n], y[n])); + + // calculate the rest of the values of k + for (let i = 1; i < c.length; ++i) { + k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k)))); + } + + // estimate the error by comparing solutions of different orders + const TE = max(abs(map(multiply(deltaB, k), X => (0, _is.isUnit)(X) ? X.value : X))); + if (TE < tol && tol / TE > 1 / 4) { + // push solution if within tol + t.push(add(t[n], h)); + y.push(add(y[n], multiply(h, b, k))); + n++; + } + + // estimate the delta value that will affect the step size + let delta = 0.84 * (tol / TE) ** (1 / 5); + if (smaller(delta, minDelta)) { + delta = minDelta; + } else if (larger(delta, maxDelta)) { + delta = maxDelta; + } + delta = hasBigNumbers ? bignumber(delta) : delta; + h = multiply(h, delta); + if (maxStep && larger(abs(h), maxStep)) { + h = isForwards ? maxStep : unaryMinus(maxStep); + } else if (minStep && smaller(abs(h), minStep)) { + h = isForwards ? minStep : unaryMinus(minStep); + } + iter++; + if (iter > maxIter) { + throw new Error('Maximum number of iterations reached, try changing options'); + } + } + return { + t, + y + }; + }; + } + function _rk23(f, tspan, y0, options) { + // Bogacki–Shampine method + + // Define the butcher table + const a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]]; + const c = [null, 1 / 2, 3 / 4, 1]; + const b = [2 / 9, 1 / 3, 4 / 9, 0]; + const bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8]; + const butcherTableau = { + a, + c, + b, + bp + }; + + // Solve an adaptive step size rk method + return _rk(butcherTableau)(f, tspan, y0, options); + } + function _rk45(f, tspan, y0, options) { + // Dormand Prince method + + // Define the butcher tableau + const a = [[], [1 / 5], [3 / 40, 9 / 40], [44 / 45, -56 / 15, 32 / 9], [19372 / 6561, -25360 / 2187, 64448 / 6561, -212 / 729], [9017 / 3168, -355 / 33, 46732 / 5247, 49 / 176, -5103 / 18656], [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84]]; + const c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1]; + const b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0]; + const bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40]; + const butcherTableau = { + a, + c, + b, + bp + }; + + // Solve an adaptive step size rk method + return _rk(butcherTableau)(f, tspan, y0, options); + } + function _solveODE(f, tspan, y0, opt) { + const method = opt.method ? opt.method : 'RK45'; + const methods = { + RK23: _rk23, + RK45: _rk45 + }; + if (method.toUpperCase() in methods) { + const methodOptions = { + ...opt + }; // clone the options object + delete methodOptions.method; // delete the method as it won't be needed + return methods[method.toUpperCase()](f, tspan, y0, methodOptions); + } else { + // throw an error indicating there is no such method + const methodsWithQuotes = Object.keys(methods).map(x => `"${x}"`); + // generates a string of methods like: "BDF", "RK23" and "RK45" + const availableMethodsString = `${methodsWithQuotes.slice(0, -1).join(', ')} and ${methodsWithQuotes.slice(-1)}`; + throw new Error(`Unavailable method "${method}". Available methods are ${availableMethodsString}`); + } + } + function _createOngoing(isForwards) { + // returns the correct function to test if it's still iterating + return isForwards ? smaller : larger; + } + function _createTrimStep(isForwards) { + const outOfBounds = isForwards ? larger : smaller; + return function (t, tf, h) { + const next = add(t, h); + return outOfBounds(next, tf) ? subtract(tf, t) : h; + }; + } + function isNumOrBig(x) { + // checks if it's a number or bignumber + return (0, _is.isBigNumber)(x) || (0, _is.isNumber)(x); + } + function _matrixSolveODE(f, T, y0, options) { + // receives matrices and returns matrices + const sol = _solveODE(f, T.toArray(), y0.toArray(), options); + return { + t: matrix(sol.t), + y: matrix(sol.y) + }; + } + return typed('solveODE', { + 'function, Array, Array, Object': _solveODE, + 'function, Matrix, Matrix, Object': _matrixSolveODE, + 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}), + 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}), + 'function, Array, number | BigNumber | Unit': (f, T, y0) => { + const sol = _solveODE(f, T, [y0], {}); + return { + t: sol.t, + y: sol.y.map(Y => Y[0]) + }; + }, + 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => { + const sol = _solveODE(f, T.toArray(), [y0], {}); + return { + t: matrix(sol.t), + y: matrix(sol.y.map(Y => Y[0])) + }; + }, + 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => { + const sol = _solveODE(f, T, [y0], options); + return { + t: sol.t, + y: sol.y.map(Y => Y[0]) + }; + }, + 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => { + const sol = _solveODE(f, T.toArray(), [y0], options); + return { + t: matrix(sol.t), + y: matrix(sol.y.map(Y => Y[0])) + }; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinations.js new file mode 100644 index 0000000..bab7bcc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinations.js @@ -0,0 +1,75 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCombinations = void 0; +var _factory = require("../../utils/factory.js"); +var _combinations = require("../../plain/number/combinations.js"); +const name = 'combinations'; +const dependencies = ['typed']; +const createCombinations = exports.createCombinations = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the number of ways of picking `k` unordered outcomes from `n` + * possibilities. + * + * Combinations only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.combinations(n, k) + * + * Examples: + * + * math.combinations(7, 5) // returns 21 + * + * See also: + * + * combinationsWithRep, permutations, factorial + * + * @param {number | BigNumber} n Total number of objects in the set + * @param {number | BigNumber} k Number of objects in the subset + * @return {number | BigNumber} Number of possible combinations. + */ + return typed(name, { + 'number, number': _combinations.combinationsNumber, + 'BigNumber, BigNumber': function (n, k) { + const BigNumber = n.constructor; + let result, i; + const nMinusk = n.minus(k); + const one = new BigNumber(1); + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (k.gt(n)) { + throw new TypeError('k must be less than n in function combinations'); + } + result = one; + if (k.lt(nMinusk)) { + for (i = one; i.lte(nMinusk); i = i.plus(one)) { + result = result.times(k.plus(i)).dividedBy(i); + } + } else { + for (i = one; i.lte(k); i = i.plus(one)) { + result = result.times(nMinusk.plus(i)).dividedBy(i); + } + } + return result; + } + + // TODO: implement support for collection in combinations + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js new file mode 100644 index 0000000..1890792 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCombinationsWithRep = void 0; +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _product = require("../../utils/product.js"); +const name = 'combinationsWithRep'; +const dependencies = ['typed']; +const createCombinationsWithRep = exports.createCombinationsWithRep = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the number of ways of picking `k` unordered outcomes from `n` + * possibilities, allowing individual outcomes to be repeated more than once. + * + * CombinationsWithRep only takes integer arguments. + * The following condition must be enforced: k <= n + k -1. + * + * Syntax: + * + * math.combinationsWithRep(n, k) + * + * Examples: + * + * math.combinationsWithRep(7, 5) // returns 462 + * + * See also: + * + * combinations, permutations, factorial + * + * @param {number | BigNumber} n Total number of objects in the set + * @param {number | BigNumber} k Number of objects in the subset + * @return {number | BigNumber} Number of possible combinations with replacement. + */ + return typed(name, { + 'number, number': function (n, k) { + if (!(0, _number.isInteger)(n) || n < 0) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (!(0, _number.isInteger)(k) || k < 0) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (n < 1) { + throw new TypeError('k must be less than or equal to n + k - 1'); + } + if (k < n - 1) { + const prodrange = (0, _product.product)(n, n + k - 1); + return prodrange / (0, _product.product)(1, k); + } + const prodrange = (0, _product.product)(k + 1, n + k - 1); + return prodrange / (0, _product.product)(1, n - 1); + }, + 'BigNumber, BigNumber': function (n, k) { + const BigNumber = n.constructor; + let result, i; + const one = new BigNumber(1); + const nMinusOne = n.minus(one); + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (n.lt(one)) { + throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep'); + } + result = one; + if (k.lt(nMinusOne)) { + for (i = one; i.lte(nMinusOne); i = i.plus(one)) { + result = result.times(k.plus(i)).dividedBy(i); + } + } else { + for (i = one; i.lte(k); i = i.plus(one)) { + result = result.times(nMinusOne.plus(i)).dividedBy(i); + } + } + return result; + } + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/factorial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/factorial.js new file mode 100644 index 0000000..2932e26 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/factorial.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFactorial = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'factorial'; +const dependencies = ['typed', 'gamma']; +const createFactorial = exports.createFactorial = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + gamma + } = _ref; + /** + * Compute the factorial of a value + * + * Factorial only supports an integer value as argument. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.factorial(n) + * + * Examples: + * + * math.factorial(5) // returns 120 + * math.factorial(3) // returns 6 + * + * See also: + * + * combinations, combinationsWithRep, gamma, permutations + * + * @param {number | BigNumber | Array | Matrix} n An integer number + * @return {number | BigNumber | Array | Matrix} The factorial of `n` + */ + return typed(name, { + number: function (n) { + if (n < 0) { + throw new Error('Value must be non-negative'); + } + return gamma(n + 1); + }, + BigNumber: function (n) { + if (n.isNegative()) { + throw new Error('Value must be non-negative'); + } + return gamma(n.plus(1)); + }, + 'Array | Matrix': typed.referToSelf(self => n => (0, _collection.deepMap)(n, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/gamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/gamma.js new file mode 100644 index 0000000..d9494a6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/gamma.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createGamma = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'gamma'; +const dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex']; +const createGamma = exports.createGamma = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + multiplyScalar, + pow, + BigNumber, + Complex + } = _ref; + /** + * Compute the gamma function of a value using Lanczos approximation for + * small values, and an extended Stirling approximation for large values. + * + * To avoid confusion with the matrix Gamma function, this function does + * not apply to matrices. + * + * Syntax: + * + * math.gamma(n) + * + * Examples: + * + * math.gamma(5) // returns 24 + * math.gamma(-0.5) // returns -3.5449077018110335 + * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i + * + * See also: + * + * combinations, factorial, permutations + * + * @param {number | BigNumber | Complex} n A real or complex number + * @return {number | BigNumber | Complex} The gamma of `n` + */ + + function gammaComplex(n) { + if (n.im === 0) { + return (0, _index.gammaNumber)(n.re); + } + + // Lanczos approximation doesn't work well with real part lower than 0.5 + // So reflection formula is required + if (n.re < 0.5) { + // Euler's reflection formula + // gamma(1-z) * gamma(z) = PI / sin(PI * z) + // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined] + // thanks to imperfect sin implementation sin(PI * n) != 0 + // we can safely use it anyway + const t = new Complex(1 - n.re, -n.im); + const r = new Complex(Math.PI * n.re, Math.PI * n.im); + return new Complex(Math.PI).div(r.sin()).div(gammaComplex(t)); + } + + // Lanczos approximation + // z -= 1 + n = new Complex(n.re - 1, n.im); + + // x = gammaPval[0] + let x = new Complex(_index.gammaP[0], 0); + // for (i, gammaPval) in enumerate(gammaP): + for (let i = 1; i < _index.gammaP.length; ++i) { + // x += gammaPval / (z + i) + const gammaPval = new Complex(_index.gammaP[i], 0); + x = x.add(gammaPval.div(n.add(i))); + } + // t = z + gammaG + 0.5 + const t = new Complex(n.re + _index.gammaG + 0.5, n.im); + + // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x + const twoPiSqrt = Math.sqrt(2 * Math.PI); + const tpow = t.pow(n.add(0.5)); + const expt = t.neg().exp(); + + // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)] + return x.mul(twoPiSqrt).mul(tpow).mul(expt); + } + return typed(name, { + number: _index.gammaNumber, + Complex: gammaComplex, + BigNumber: function (n) { + if (n.isInteger()) { + return n.isNegative() || n.isZero() ? new BigNumber(Infinity) : bigFactorial(n.minus(1)); + } + if (!n.isFinite()) { + return new BigNumber(n.isNegative() ? NaN : Infinity); + } + throw new Error('Integer BigNumber expected'); + } + }); + + /** + * Calculate factorial for a BigNumber + * @param {BigNumber} n + * @returns {BigNumber} Returns the factorial of n + */ + function bigFactorial(n) { + if (n < 8) { + return new BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]); + } + const precision = config.precision + (Math.log(n.toNumber()) | 0); + const Big = BigNumber.clone({ + precision + }); + if (n % 2 === 1) { + return n.times(bigFactorial(new BigNumber(n - 1))); + } + let p = n; + let prod = new Big(n); + let sum = n.toNumber(); + while (p > 2) { + p -= 2; + sum += p; + prod = prod.times(sum); + } + return new BigNumber(prod.toPrecision(BigNumber.precision)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js new file mode 100644 index 0000000..41cf6d6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js @@ -0,0 +1,83 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createKldivergence = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'kldivergence'; +const dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric']; +const createKldivergence = exports.createKldivergence = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + divide, + sum, + multiply, + map, + dotDivide, + log, + isNumeric + } = _ref; + /** + * Calculate the Kullback-Leibler (KL) divergence between two distributions + * + * Syntax: + * + * math.kldivergence(x, y) + * + * Examples: + * + * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153 + * + * + * @param {Array | Matrix} q First vector + * @param {Array | Matrix} p Second vector + * @return {number} Returns distance between q and p + */ + return typed(name, { + 'Array, Array': function (q, p) { + return _kldiv(matrix(q), matrix(p)); + }, + 'Matrix, Array': function (q, p) { + return _kldiv(q, matrix(p)); + }, + 'Array, Matrix': function (q, p) { + return _kldiv(matrix(q), p); + }, + 'Matrix, Matrix': function (q, p) { + return _kldiv(q, p); + } + }); + function _kldiv(q, p) { + const plength = p.size().length; + const qlength = q.size().length; + if (plength > 1) { + throw new Error('first object must be one dimensional'); + } + if (qlength > 1) { + throw new Error('second object must be one dimensional'); + } + if (plength !== qlength) { + throw new Error('Length of two vectors must be equal'); + } + + // Before calculation, apply normalization + const sumq = sum(q); + if (sumq === 0) { + throw new Error('Sum of elements in first object must be non zero'); + } + const sump = sum(p); + if (sump === 0) { + throw new Error('Sum of elements in second object must be non zero'); + } + const qnorm = divide(q, sum(q)); + const pnorm = divide(p, sum(p)); + const result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x)))); + if (isNumeric(result)) { + return result; + } else { + return Number.NaN; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/lgamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/lgamma.js new file mode 100644 index 0000000..b0664a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/lgamma.js @@ -0,0 +1,143 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLgamma = void 0; +var _index = require("../../plain/number/index.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +/* eslint-disable no-loss-of-precision */ + +// References +// ---------- +// [1] Hare, "Computing the Principal Branch of log-Gamma", Journal of Algorithms, 1997. +// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments + +const name = 'lgamma'; +const dependencies = ['Complex', 'typed']; +const createLgamma = exports.createLgamma = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Complex, + typed + } = _ref; + // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get + // sufficient accuracy. + // + // These two values are copied from Scipy implementation: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37 + const SMALL_RE = 7; + const SMALL_IM = 7; + + /** + * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1]. + * + * If you cannot access the paper, can also get these values from the formula in [2]. + * + * 1 / 12 = 0.00833333333333333333333333333333 + * 1 / 360 = 0.00277777777777777777777777777778 + * ... + * 3617 / 133400 = 0.02955065359477124183006535947712 + */ + const coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2]; + + /** + * Logarithm of the gamma function for real, positive numbers and complex numbers, + * using Lanczos approximation for numbers and Stirling series for complex numbers. + * + * Syntax: + * + * math.lgamma(n) + * + * Examples: + * + * math.lgamma(5) // returns 3.178053830347945 + * math.lgamma(0) // returns Infinity + * math.lgamma(-0.5) // returns NaN + * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i + * + * See also: + * + * gamma + * + * @param {number | Complex} n A real or complex number + * @return {number | Complex} The log gamma of `n` + */ + return typed(name, { + number: _index.lgammaNumber, + Complex: lgammaComplex, + BigNumber: function () { + throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber"); + } + }); + function lgammaComplex(n) { + const TWOPI = 6.2831853071795864769252842; // 2*pi + const LOGPI = 1.1447298858494001741434262; // log(pi) + + const REFLECTION = 0.1; + if (n.isNaN()) { + return new Complex(NaN, NaN); + } else if (n.im === 0) { + return new Complex((0, _index.lgammaNumber)(n.re), 0); + } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) { + return lgammaStirling(n); + } else if (n.re <= REFLECTION) { + // Reflection formula. see Proposition 3.1 in [1] + const tmp = (0, _number.copysign)(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25); + const a = n.mul(Math.PI).sin().log(); + const b = lgammaComplex(new Complex(1 - n.re, -n.im)); + return new Complex(LOGPI, tmp).sub(a).sub(b); + } else if (n.im >= 0) { + return lgammaRecurrence(n); + } else { + return lgammaRecurrence(n.conjugate()).conjugate(); + } + } + function lgammaStirling(z) { + // formula ref in [2] + // computation ref: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101 + + // left part + + // x (log(x) - 1) + 1/2 (log(2PI) - log(x)) + // => (x - 0.5) * log(x) - x + log(2PI) / 2 + const leftPart = z.sub(0.5).mul(z.log()).sub(z).add(_index.lnSqrt2PI); + + // right part + + const rz = new Complex(1, 0).div(z); + const rzz = rz.div(z); + let a = coeffs[0]; + let b = coeffs[1]; + const r = 2 * rzz.re; + const s = rzz.re * rzz.re + rzz.im * rzz.im; + for (let i = 2; i < 8; i++) { + const tmp = b; + b = -s * a + coeffs[i]; + a = r * a + tmp; + } + const rightPart = rz.mul(rzz.mul(a).add(b)); + + // plus left and right + + return leftPart.add(rightPart); + } + function lgammaRecurrence(z) { + // computation ref: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78 + + let signflips = 0; + let sb = 0; + let shiftprod = z; + z = z.add(1); + while (z.re <= SMALL_RE) { + shiftprod = shiftprod.mul(z); + const nsb = shiftprod.im < 0 ? 1 : 0; + if (nsb !== 0 && sb === 0) signflips++; + sb = nsb; + z = z.add(1); + } + return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/multinomial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/multinomial.js new file mode 100644 index 0000000..6ef829b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/multinomial.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMultinomial = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'multinomial'; +const dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive']; +const createMultinomial = exports.createMultinomial = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + divide, + multiply, + factorial, + isInteger, + isPositive + } = _ref; + /** + * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. + * + * multinomial takes one array of integers as an argument. + * The following condition must be enforced: every ai <= 0 + * + * Syntax: + * + * math.multinomial(a) // a is an array type + * + * Examples: + * + * math.multinomial([1,2,1]) // returns 12 + * + * See also: + * + * combinations, factorial + * + * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset + * @return {Number | BigNumber} Multinomial coefficient. + */ + return typed(name, { + 'Array | Matrix': function (a) { + let sum = 0; + let denom = 1; + (0, _collection.deepForEach)(a, function (ai) { + if (!isInteger(ai) || !isPositive(ai)) { + throw new TypeError('Positive integer value expected in function multinomial'); + } + sum = add(sum, ai); + denom = multiply(denom, factorial(ai)); + }); + return divide(factorial(sum), denom); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/permutations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/permutations.js new file mode 100644 index 0000000..f1694dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/permutations.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPermutations = void 0; +var _number = require("../../utils/number.js"); +var _product = require("../../utils/product.js"); +var _factory = require("../../utils/factory.js"); +const name = 'permutations'; +const dependencies = ['typed', 'factorial']; +const createPermutations = exports.createPermutations = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + factorial + } = _ref; + /** + * Compute the number of ways of obtaining an ordered subset of `k` elements + * from a set of `n` elements. + * + * Permutations only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.permutations(n) + * math.permutations(n, k) + * + * Examples: + * + * math.permutations(5) // 120 + * math.permutations(5, 3) // 60 + * + * See also: + * + * combinations, combinationsWithRep, factorial + * + * @param {number | BigNumber} n The number of objects in total + * @param {number | BigNumber} [k] The number of objects in the subset + * @return {number | BigNumber} The number of permutations + */ + return typed(name, { + 'number | BigNumber': factorial, + 'number, number': function (n, k) { + if (!(0, _number.isInteger)(n) || n < 0) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (!(0, _number.isInteger)(k) || k < 0) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (k > n) { + throw new TypeError('second argument k must be less than or equal to first argument n'); + } + // Permute n objects, k at a time + return (0, _product.product)(n - k + 1, n); + }, + 'BigNumber, BigNumber': function (n, k) { + let result, i; + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (k.gt(n)) { + throw new TypeError('second argument k must be less than or equal to first argument n'); + } + const one = n.mul(0).add(1); + result = one; + for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) { + result = result.times(i); + } + return result; + } + + // TODO: implement support for collection in permutations + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js new file mode 100644 index 0000000..2607481 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js @@ -0,0 +1,156 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPickRandom = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _seededRNG = require("./util/seededRNG.js"); +const name = 'pickRandom'; +const dependencies = ['typed', 'config', '?on']; +const createPickRandom = exports.createPickRandom = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + let rng = (0, _seededRNG.createRng)(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = (0, _seededRNG.createRng)(curr.randomSeed); + } + }); + } + + /** + * Random pick one or more values from a one dimensional array. + * Array elements are picked using a random function with uniform or weighted distribution. + * + * Syntax: + * + * math.pickRandom(array) + * math.pickRandom(array, number) + * math.pickRandom(array, weights) + * math.pickRandom(array, number, weights) + * math.pickRandom(array, weights, number) + * math.pickRandom(array, { weights, number, elementWise }) + * + * Examples: + * + * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array + * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array + * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array + * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution + * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution + * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution + * + * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false }) + * // returns one of the items in the array + * + * See also: + * + * random, randomInt + * + * @param {Array | Matrix} array A one dimensional array + * @param {Int} number An int or float + * @param {Array | Matrix} weights An array of ints or floats + * @return {number | Array} Returns a single random value from array when number is undefined. + * Returns an array with the configured number of elements when number is defined. + */ + return typed(name, { + 'Array | Matrix': function (possibles) { + return _pickRandom(possibles, {}); + }, + 'Array | Matrix, Object': function (possibles, options) { + return _pickRandom(possibles, options); + }, + 'Array | Matrix, number': function (possibles, number) { + return _pickRandom(possibles, { + number + }); + }, + 'Array | Matrix, Array | Matrix': function (possibles, weights) { + return _pickRandom(possibles, { + weights + }); + }, + 'Array | Matrix, Array | Matrix, number': function (possibles, weights, number) { + return _pickRandom(possibles, { + number, + weights + }); + }, + 'Array | Matrix, number, Array | Matrix': function (possibles, number, weights) { + return _pickRandom(possibles, { + number, + weights + }); + } + }); + + /** + * @param {Array | Matrix} possibles + * @param {{ + * number?: number, + * weights?: Array | Matrix, + * elementWise: boolean + * }} options + * @returns {number | Array} + * @private + */ + function _pickRandom(possibles, _ref2) { + let { + number, + weights, + elementWise = true + } = _ref2; + const single = typeof number === 'undefined'; + if (single) { + number = 1; + } + const createMatrix = (0, _is.isMatrix)(possibles) ? possibles.create : (0, _is.isMatrix)(weights) ? weights.create : null; + possibles = possibles.valueOf(); // get Array + if (weights) { + weights = weights.valueOf(); // get Array + } + if (elementWise === true) { + possibles = (0, _array.flatten)(possibles); + weights = (0, _array.flatten)(weights); + } + let totalWeights = 0; + if (typeof weights !== 'undefined') { + if (weights.length !== possibles.length) { + throw new Error('Weights must have the same length as possibles'); + } + for (let i = 0, len = weights.length; i < len; i++) { + if (!(0, _is.isNumber)(weights[i]) || weights[i] < 0) { + throw new Error('Weights must be an array of positive numbers'); + } + totalWeights += weights[i]; + } + } + const length = possibles.length; + const result = []; + let pick; + while (result.length < number) { + if (typeof weights === 'undefined') { + pick = possibles[Math.floor(rng() * length)]; + } else { + let randKey = rng() * totalWeights; + for (let i = 0, len = possibles.length; i < len; i++) { + randKey -= weights[i]; + if (randKey < 0) { + pick = possibles[i]; + break; + } + } + } + result.push(pick); + } + return single ? result[0] : createMatrix ? createMatrix(result) : result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/random.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/random.js new file mode 100644 index 0000000..e1824a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/random.js @@ -0,0 +1,102 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRandomNumber = exports.createRandom = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +var _seededRNG = require("./util/seededRNG.js"); +var _randomMatrix2 = require("./util/randomMatrix.js"); +const name = 'random'; +const dependencies = ['typed', 'config', '?on']; +const createRandom = exports.createRandom = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + let rng = (0, _seededRNG.createRng)(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = (0, _seededRNG.createRng)(curr.randomSeed); + } + }); + } + + /** + * Return a random number larger or equal to `min` and smaller than `max` + * using a uniform distribution. + * + * Syntax: + * + * math.random() // generate a random number between 0 and 1 + * math.random(max) // generate a random number between 0 and max + * math.random(min, max) // generate a random number between min and max + * math.random(size) // generate a matrix with random numbers between 0 and 1 + * math.random(size, max) // generate a matrix with random numbers between 0 and max + * math.random(size, min, max) // generate a matrix with random numbers between min and max + * + * Examples: + * + * math.random() // returns a random number between 0 and 1 + * math.random(100) // returns a random number between 0 and 100 + * math.random(30, 40) // returns a random number between 30 and 40 + * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1 + * + * See also: + * + * randomInt, pickRandom + * + * @param {Array | Matrix} [size] If provided, an array or matrix with given + * size and filled with random values is returned + * @param {number} [min] Minimum boundary for the random value, included + * @param {number} [max] Maximum boundary for the random value, excluded + * @return {number | Array | Matrix} A random number + */ + return typed(name, { + '': () => _random(0, 1), + number: max => _random(0, max), + 'number, number': (min, max) => _random(min, max), + 'Array | Matrix': size => _randomMatrix(size, 0, 1), + 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max), + 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max) + }); + function _randomMatrix(size, min, max) { + const res = (0, _randomMatrix2.randomMatrix)(size.valueOf(), () => _random(min, max)); + return (0, _is.isMatrix)(size) ? size.create(res, 'number') : res; + } + function _random(min, max) { + return min + rng() * (max - min); + } +}); + +// number only implementation of random, no matrix support +// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that? +const createRandomNumber = exports.createRandomNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config', '?on'], _ref2 => { + let { + typed, + config, + on, + matrix + } = _ref2; + // seeded pseudo random number generator1 + let rng = (0, _seededRNG.createRng)(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = (0, _seededRNG.createRng)(curr.randomSeed); + } + }); + } + return typed(name, { + '': () => _random(0, 1), + number: max => _random(0, max), + 'number, number': (min, max) => _random(min, max) + }); + function _random(min, max) { + return min + rng() * (max - min); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/randomInt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/randomInt.js new file mode 100644 index 0000000..3bd8f3b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/randomInt.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRandomInt = void 0; +var _factory = require("../../utils/factory.js"); +var _randomMatrix = require("./util/randomMatrix.js"); +var _seededRNG = require("./util/seededRNG.js"); +var _is = require("../../utils/is.js"); +const name = 'randomInt'; +const dependencies = ['typed', 'config', '?on']; +const createRandomInt = exports.createRandomInt = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + let rng = (0, _seededRNG.createRng)(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = (0, _seededRNG.createRng)(curr.randomSeed); + } + }); + } + + /** + * Return a random integer number larger or equal to `min` and smaller than `max` + * using a uniform distribution. + * + * Syntax: + * + * math.randomInt() // generate a random integer between 0 and 1 + * math.randomInt(max) // generate a random integer between 0 and max + * math.randomInt(min, max) // generate a random integer between min and max + * math.randomInt(size) // generate a matrix with random integer between 0 and 1 + * math.randomInt(size, max) // generate a matrix with random integer between 0 and max + * math.randomInt(size, min, max) // generate a matrix with random integer between min and max + * + * Examples: + * + * math.randomInt(100) // returns a random integer between 0 and 100 + * math.randomInt(30, 40) // returns a random integer between 30 and 40 + * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1 + * + * See also: + * + * random, pickRandom + * + * @param {Array | Matrix} [size] If provided, an array or matrix with given + * size and filled with random values is returned + * @param {number} [min] Minimum boundary for the random value, included + * @param {number} [max] Maximum boundary for the random value, excluded + * @return {number | Array | Matrix} A random integer value + */ + return typed(name, { + '': () => _randomInt(0, 1), + number: max => _randomInt(0, max), + 'number, number': (min, max) => _randomInt(min, max), + 'Array | Matrix': size => _randomIntMatrix(size, 0, 1), + 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max), + 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max) + }); + function _randomIntMatrix(size, min, max) { + const res = (0, _randomMatrix.randomMatrix)(size.valueOf(), () => _randomInt(min, max)); + return (0, _is.isMatrix)(size) ? size.create(res, 'number') : res; + } + function _randomInt(min, max) { + return Math.floor(min + rng() * (max - min)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js new file mode 100644 index 0000000..76ee766 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.randomMatrix = randomMatrix; +/** + * This is a util function for generating a random matrix recursively. + * @param {number[]} size + * @param {function} random + * @returns {Array} + */ +function randomMatrix(size, random) { + const data = []; + size = size.slice(0); + if (size.length > 1) { + for (let i = 0, length = size.shift(); i < length; i++) { + data.push(randomMatrix(size, random)); + } + } else { + for (let i = 0, length = size.shift(); i < length; i++) { + data.push(random()); + } + } + return data; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js new file mode 100644 index 0000000..2d6889d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js @@ -0,0 +1,26 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRng = createRng; +var _seedrandom = _interopRequireDefault(require("seedrandom")); +const singletonRandom = /* #__PURE__ */(0, _seedrandom.default)(Date.now()); +function createRng(randomSeed) { + let random; + + // create a new random generator with given seed + function setSeed(seed) { + random = seed === null ? singletonRandom : (0, _seedrandom.default)(String(seed)); + } + + // initialize a seeded pseudo random number generator with config's random seed + setSeed(randomSeed); + + // wrapper function so the rng can be updated via generator + function rng() { + return random(); + } + return rng; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compare.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compare.js new file mode 100644 index 0000000..4aa2284 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compare.js @@ -0,0 +1,120 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCompareNumber = exports.createCompare = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matAlgo05xSfSf = require("../../type/matrix/utils/matAlgo05xSfSf.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'compare'; +const dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat']; +const createCompare = exports.createCompare = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + equalScalar, + matrix, + BigNumber, + Fraction, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo05xSfSf = (0, _matAlgo05xSfSf.createMatAlgo05xSfSf)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * + * x and y are considered equal when the relative difference between x and y + * is smaller than the configured absTol and relTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.compare(x, y) + * + * Examples: + * + * math.compare(6, 1) // returns 1 + * math.compare(2, 3) // returns -1 + * math.compare(7, 7) // returns 0 + * math.compare('10', '2') // returns 1 + * math.compare('1000', '1e3') // returns 0 + * + * const a = math.unit('5 cm') + * const b = math.unit('40 mm') + * math.compare(a, b) // returns 1 + * + * math.compare(2, [1, 2, 3]) // returns [1, 0, -1] + * + * See also: + * + * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText + * + * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare + * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, createCompareNumber({ + typed, + config + }), { + 'boolean, boolean': function (x, y) { + return x === y ? 0 : x > y ? 1 : -1; + }, + 'BigNumber, BigNumber': function (x, y) { + return (0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y)); + }, + 'bigint, bigint': function (x, y) { + return x === y ? 0n : x > y ? 1n : -1n; + }, + 'Fraction, Fraction': function (x, y) { + return new Fraction(x.compare(y)); + }, + 'Complex, Complex': function () { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createCompareNumber = exports.createCompareNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return (0, _number.nearlyEqual)(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js new file mode 100644 index 0000000..f85ca13 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js @@ -0,0 +1,281 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCompareNatural = void 0; +var _javascriptNaturalSort = _interopRequireDefault(require("javascript-natural-sort")); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'compareNatural'; +const dependencies = ['typed', 'compare']; +const createCompareNatural = exports.createCompareNatural = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + compare + } = _ref; + const compareBooleans = compare.signatures['boolean,boolean']; + + /** + * Compare two values of any type in a deterministic, natural way. + * + * For numeric values, the function works the same as `math.compare`. + * For types of values that can't be compared mathematically, + * the function compares in a natural way. + * + * For numeric values, x and y are considered equal when the relative + * difference between x and y is smaller than the configured relTol and absTol. + * The function cannot be used to compare values smaller than + * approximately 2.22e-16. + * + * For Complex numbers, first the real parts are compared. If equal, + * the imaginary parts are compared. + * + * Strings are compared with a natural sorting algorithm, which + * orders strings in a "logic" way following some heuristics. + * This differs from the function `compare`, which converts the string + * into a numeric value and compares that. The function `compareText` + * on the other hand compares text lexically. + * + * Arrays and Matrices are compared value by value until there is an + * unequal pair of values encountered. Objects are compared by sorted + * keys until the keys or their values are unequal. + * + * Syntax: + * + * math.compareNatural(x, y) + * + * Examples: + * + * math.compareNatural(6, 1) // returns 1 + * math.compareNatural(2, 3) // returns -1 + * math.compareNatural(7, 7) // returns 0 + * + * math.compareNatural('10', '2') // returns 1 + * math.compareText('10', '2') // returns -1 + * math.compare('10', '2') // returns 1 + * + * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1 + * math.compareText('Answer: 10', 'Answer: 2') // returns -1 + * math.compare('Answer: 10', 'Answer: 2') + * // Error: Cannot convert "Answer: 10" to a number + * + * const a = math.unit('5 cm') + * const b = math.unit('40 mm') + * math.compareNatural(a, b) // returns 1 + * + * const c = math.complex('2 + 3i') + * const d = math.complex('2 + 4i') + * math.compareNatural(c, d) // returns -1 + * + * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1 + * math.compareNatural([1, 2, 3], [1, 2]) // returns 1 + * math.compareNatural([1, 5], [1, 2, 3]) // returns 1 + * math.compareNatural([1, 2], [1, 2]) // returns 0 + * + * math.compareNatural({a: 2}, {a: 4}) // returns -1 + * + * See also: + * + * compare, compareText + * + * @param {*} x First value to compare + * @param {*} y Second value to compare + * @return {number} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, { + 'any, any': _compareNatural + }); // just to check # args + + function _compareNatural(x, y) { + const typeX = (0, _is.typeOf)(x); + const typeY = (0, _is.typeOf)(y); + let c; + + // numeric types + if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) { + c = compare(x, y); + if (c.toString() !== '0') { + // c can be number, BigNumber, or Fraction + return c > 0 ? 1 : -1; // return a number + } else { + return (0, _javascriptNaturalSort.default)(typeX, typeY); + } + } + + // matrix types + const matTypes = ['Array', 'DenseMatrix', 'SparseMatrix']; + if (matTypes.includes(typeX) || matTypes.includes(typeY)) { + c = compareMatricesAndArrays(_compareNatural, x, y); + if (c !== 0) { + return c; + } else { + return (0, _javascriptNaturalSort.default)(typeX, typeY); + } + } + + // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex' + if (typeX !== typeY) { + return (0, _javascriptNaturalSort.default)(typeX, typeY); + } + if (typeX === 'Complex') { + return compareComplexNumbers(x, y); + } + if (typeX === 'Unit') { + if (x.equalBase(y)) { + return _compareNatural(x.value, y.value); + } + + // compare by units + return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits()); + } + if (typeX === 'boolean') { + return compareBooleans(x, y); + } + if (typeX === 'string') { + return (0, _javascriptNaturalSort.default)(x, y); + } + if (typeX === 'Object') { + return compareObjects(_compareNatural, x, y); + } + if (typeX === 'null') { + return 0; + } + if (typeX === 'undefined') { + return 0; + } + + // this should not occur... + throw new TypeError('Unsupported type of value "' + typeX + '"'); + } + + /** + * Compare mixed matrix/array types, by converting to same-shaped array. + * This comparator is non-deterministic regarding input types. + * @param {Array | SparseMatrix | DenseMatrix | *} x + * @param {Array | SparseMatrix | DenseMatrix | *} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareMatricesAndArrays(compareNatural, x, y) { + if ((0, _is.isSparseMatrix)(x) && (0, _is.isSparseMatrix)(y)) { + return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values); + } + if ((0, _is.isSparseMatrix)(x)) { + // note: convert to array is expensive + return compareMatricesAndArrays(compareNatural, x.toArray(), y); + } + if ((0, _is.isSparseMatrix)(y)) { + // note: convert to array is expensive + return compareMatricesAndArrays(compareNatural, x, y.toArray()); + } + + // convert DenseArray into Array + if ((0, _is.isDenseMatrix)(x)) { + return compareMatricesAndArrays(compareNatural, x.toJSON().data, y); + } + if ((0, _is.isDenseMatrix)(y)) { + return compareMatricesAndArrays(compareNatural, x, y.toJSON().data); + } + + // convert scalars to array + if (!Array.isArray(x)) { + return compareMatricesAndArrays(compareNatural, [x], y); + } + if (!Array.isArray(y)) { + return compareMatricesAndArrays(compareNatural, x, [y]); + } + return compareArrays(compareNatural, x, y); + } + + /** + * Compare two Arrays + * + * - First, compares value by value + * - Next, if all corresponding values are equal, + * look at the length: longest array will be considered largest + * + * @param {Array} x + * @param {Array} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareArrays(compareNatural, x, y) { + // compare each value + for (let i = 0, ii = Math.min(x.length, y.length); i < ii; i++) { + const v = compareNatural(x[i], y[i]); + if (v !== 0) { + return v; + } + } + + // compare the size of the arrays + if (x.length > y.length) { + return 1; + } + if (x.length < y.length) { + return -1; + } + + // both Arrays have equal size and content + return 0; + } + + /** + * Compare two objects + * + * - First, compare sorted property names + * - Next, compare the property values + * + * @param {Object} x + * @param {Object} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareObjects(compareNatural, x, y) { + const keysX = Object.keys(x); + const keysY = Object.keys(y); + + // compare keys + keysX.sort(_javascriptNaturalSort.default); + keysY.sort(_javascriptNaturalSort.default); + const c = compareArrays(compareNatural, keysX, keysY); + if (c !== 0) { + return c; + } + + // compare values + for (let i = 0; i < keysX.length; i++) { + const v = compareNatural(x[keysX[i]], y[keysY[i]]); + if (v !== 0) { + return v; + } + } + return 0; + } +}); + +/** + * Compare two complex numbers, `x` and `y`: + * + * - First, compare the real values of `x` and `y` + * - If equal, compare the imaginary values of `x` and `y` + * + * @params {Complex} x + * @params {Complex} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ +function compareComplexNumbers(x, y) { + if (x.re > y.re) { + return 1; + } + if (x.re < y.re) { + return -1; + } + if (x.im > y.im) { + return 1; + } + if (x.im < y.im) { + return -1; + } + return 0; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareText.js new file mode 100644 index 0000000..588df7e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareText.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCompareTextNumber = exports.createCompareText = void 0; +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'compareText'; +const dependencies = ['typed', 'matrix', 'concat']; +_string.compareText.signature = 'any, any'; +const createCompareText = exports.createCompareText = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + concat + } = _ref; + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Compare two strings lexically. Comparison is case sensitive. + * Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.compareText(x, y) + * + * Examples: + * + * math.compareText('B', 'A') // returns 1 + * math.compareText('2', '10') // returns 1 + * math.compare('2', '10') // returns -1 + * math.compareNatural('2', '10') // returns -1 + * + * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1] + * + * See also: + * + * equal, equalText, compare, compareNatural + * + * @param {string | Array | DenseMatrix} x First string to compare + * @param {string | Array | DenseMatrix} y Second string to compare + * @return {number | Array | DenseMatrix} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, _string.compareText, matrixAlgorithmSuite({ + elop: _string.compareText, + Ds: true + })); +}); +const createCompareTextNumber = exports.createCompareTextNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed'], _ref2 => { + let { + typed + } = _ref2; + return typed(name, _string.compareText); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js new file mode 100644 index 0000000..e9d8d57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCompareUnits = void 0; +var _factory = require("../../utils/factory.js"); +const createCompareUnits = exports.createCompareUnits = /* #__PURE__ */(0, _factory.factory)('compareUnits', ['typed'], _ref => { + let { + typed + } = _ref; + return { + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (!x.equalBase(y)) { + throw new Error('Cannot compare units with different base'); + } + return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value); + }) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js new file mode 100644 index 0000000..2fbdc0d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js @@ -0,0 +1,80 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDeepEqual = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'deepEqual'; +const dependencies = ['typed', 'equal']; +const createDeepEqual = exports.createDeepEqual = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equal + } = _ref; + /** + * Test element wise whether two matrices are equal. + * The function accepts both matrices and scalar values. + * + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.deepEqual(x, y) + * + * Examples: + * + * math.deepEqual(2, 4) // returns false + * + * a = [2, 5, 1] + * b = [2, 7, 1] + * + * math.deepEqual(a, b) // returns false + * math.equal(a, b) // returns [true, false, true] + * + * See also: + * + * equal, unequal + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} + * Returns true when the input matrices have the same size and each of their elements is equal. + */ + return typed(name, { + 'any, any': function (x, y) { + return _deepEqual(x.valueOf(), y.valueOf()); + } + }); + + /** + * Test whether two arrays have the same size and all elements are equal + * @param {Array | *} x + * @param {Array | *} y + * @return {boolean} Returns true if both arrays are deep equal + */ + function _deepEqual(x, y) { + if (Array.isArray(x)) { + if (Array.isArray(y)) { + const len = x.length; + if (len !== y.length) { + return false; + } + for (let i = 0; i < len; i++) { + if (!_deepEqual(x[i], y[i])) { + return false; + } + } + return true; + } else { + return false; + } + } else { + if (Array.isArray(y)) { + return false; + } else { + return equal(x, y); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equal.js new file mode 100644 index 0000000..e4e64b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equal.js @@ -0,0 +1,116 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEqualNumber = exports.createEqual = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'equal'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +const createEqual = exports.createEqual = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is + * smaller than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. + * + * Values `null` and `undefined` are compared strictly, thus `null` is only + * equal to `null` and nothing else, and `undefined` is only equal to + * `undefined` and nothing else. Strings are compared by their numerical value. + * + * Syntax: + * + * math.equal(x, y) + * + * Examples: + * + * math.equal(2 + 2, 3) // returns false + * math.equal(2 + 2, 4) // returns true + * + * const a = math.unit('50 cm') + * const b = math.unit('5 m') + * math.equal(a, b) // returns true + * + * const c = [2, 5, 1] + * const d = [2, 7, 1] + * + * math.equal(c, d) // returns [true, false, true] + * math.deepEqual(c, d) // returns false + * + * math.equal("1000", "1e3") // returns true + * math.equal(0, null) // returns false + * + * See also: + * + * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText + * + * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false + */ + return typed(name, createEqualNumber({ + typed, + equalScalar + }), matrixAlgorithmSuite({ + elop: equalScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createEqualNumber = exports.createEqualNumber = (0, _factory.factory)(name, ['typed', 'equalScalar'], _ref2 => { + let { + typed, + equalScalar + } = _ref2; + return typed(name, { + 'any, any': function (x, y) { + // strict equality for null and undefined? + if (x === null) { + return y === null; + } + if (y === null) { + return x === null; + } + if (x === undefined) { + return y === undefined; + } + if (y === undefined) { + return x === undefined; + } + return equalScalar(x, y); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js new file mode 100644 index 0000000..134f0ee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEqualScalarNumber = exports.createEqualScalar = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _complex = require("../../utils/complex.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'equalScalar'; +const dependencies = ['typed', 'config']; +const createEqualScalar = exports.createEqualScalar = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config + } = _ref; + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Test whether two scalar values are nearly equal. + * + * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare + * @return {boolean} Returns true when the compared values are equal, else returns false + * @private + */ + return typed(name, { + 'boolean, boolean': function (x, y) { + return x === y; + }, + 'number, number': function (x, y) { + return (0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'BigNumber, BigNumber': function (x, y) { + return x.eq(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': function (x, y) { + return x === y; + }, + 'Fraction, Fraction': function (x, y) { + return x.equals(y); + }, + 'Complex, Complex': function (x, y) { + return (0, _complex.complexEquals)(x, y, config.relTol, config.absTol); + } + }, compareUnits); +}); +const createEqualScalarNumber = exports.createEqualScalarNumber = (0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return (0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalText.js new file mode 100644 index 0000000..c7a65d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/equalText.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEqualText = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'equalText'; +const dependencies = ['typed', 'compareText', 'isZero']; +const createEqualText = exports.createEqualText = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + compareText, + isZero + } = _ref; + /** + * Check equality of two strings. Comparison is case sensitive. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.equalText(x, y) + * + * Examples: + * + * math.equalText('Hello', 'Hello') // returns true + * math.equalText('a', 'A') // returns false + * math.equal('2e3', '2000') // returns true + * math.equalText('2e3', '2000') // returns false + * + * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false] + * + * See also: + * + * equal, compareText, compare, compareNatural + * + * @param {string | Array | DenseMatrix} x First string to compare + * @param {string | Array | DenseMatrix} y Second string to compare + * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not. + */ + return typed(name, { + 'any, any': function (x, y) { + return isZero(compareText(x, y)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/larger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/larger.js new file mode 100644 index 0000000..c96baaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/larger.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLargerNumber = exports.createLarger = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'larger'; +const dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +const createLarger = exports.createLarger = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Test whether value x is larger than y. + * + * The function returns true when x is larger than y and the relative + * difference between x and y is larger than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.larger(x, y) + * + * Examples: + * + * math.larger(2, 3) // returns false + * math.larger(5, 2 + 2) // returns true + * + * const a = math.unit('5 cm') + * const b = math.unit('2 inch') + * math.larger(a, b) // returns false + * + * See also: + * + * equal, unequal, smaller, smallerEq, largerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false + */ + return typed(name, createLargerNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x > y, + 'BigNumber, BigNumber': function (x, y) { + return x.gt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x > y, + 'Fraction, Fraction': (x, y) => x.compare(y) === 1, + 'Complex, Complex': function () { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createLargerNumber = exports.createLargerNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return x > y && !(0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/largerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/largerEq.js new file mode 100644 index 0000000..9f4cd47 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/largerEq.js @@ -0,0 +1,103 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLargerEqNumber = exports.createLargerEq = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'largerEq'; +const dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +const createLargerEq = exports.createLargerEq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Test whether value x is larger or equal to y. + * + * The function returns true when x is larger than y or the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.largerEq(x, y) + * + * Examples: + * + * math.larger(2, 1 + 1) // returns false + * math.largerEq(2, 1 + 1) // returns true + * + * See also: + * + * equal, unequal, smaller, smallerEq, larger, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false + */ + return typed(name, createLargerEqNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x >= y, + 'BigNumber, BigNumber': function (x, y) { + return x.gte(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': function (x, y) { + return x >= y; + }, + 'Fraction, Fraction': (x, y) => x.compare(y) !== -1, + 'Complex, Complex': function () { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createLargerEqNumber = exports.createLargerEqNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return x >= y || (0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smaller.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smaller.js new file mode 100644 index 0000000..a9f7cfd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smaller.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSmallerNumber = exports.createSmaller = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'smaller'; +const dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +const createSmaller = exports.createSmaller = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Test whether value x is smaller than y. + * + * The function returns true when x is smaller than y and the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.smaller(x, y) + * + * Examples: + * + * math.smaller(2, 3) // returns true + * math.smaller(5, 2 * 2) // returns false + * + * const a = math.unit('5 cm') + * const b = math.unit('2 inch') + * math.smaller(a, b) // returns true + * + * See also: + * + * equal, unequal, smallerEq, smaller, smallerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false + */ + return typed(name, createSmallerNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x < y, + 'BigNumber, BigNumber': function (x, y) { + return x.lt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x < y, + 'Fraction, Fraction': (x, y) => x.compare(y) === -1, + 'Complex, Complex': function (x, y) { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createSmallerNumber = exports.createSmallerNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return x < y && !(0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js new file mode 100644 index 0000000..e32ab5f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSmallerEqNumber = exports.createSmallerEq = void 0; +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +var _compareUnits = require("./compareUnits.js"); +const name = 'smallerEq'; +const dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +const createSmallerEq = exports.createSmallerEq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + const compareUnits = (0, _compareUnits.createCompareUnits)({ + typed + }); + + /** + * Test whether value x is smaller or equal to y. + * + * The function returns true when x is smaller than y or the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.smallerEq(x, y) + * + * Examples: + * + * math.smaller(1 + 2, 3) // returns false + * math.smallerEq(1 + 2, 3) // returns true + * + * See also: + * + * equal, unequal, smaller, larger, largerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false + */ + return typed(name, createSmallerEqNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x <= y, + 'BigNumber, BigNumber': function (x, y) { + return x.lte(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x <= y, + 'Fraction, Fraction': (x, y) => x.compare(y) !== 1, + 'Complex, Complex': function () { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +const createSmallerEqNumber = exports.createSmallerEqNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config'], _ref2 => { + let { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function (x, y) { + return x <= y || (0, _number.nearlyEqual)(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/unequal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/unequal.js new file mode 100644 index 0000000..b2842b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/relational/unequal.js @@ -0,0 +1,119 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnequalNumber = exports.createUnequal = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'unequal'; +const dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat']; +const createUnequal = exports.createUnequal = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + equalScalar, + matrix, + DenseMatrix, + concat + } = _ref; + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ + typed, + DenseMatrix + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Test whether two values are unequal. + * + * The function tests whether the relative difference between x and y is + * larger than the configured relTol and absTol. The function cannot be used to compare + * values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. + * Strings are compared by their numerical value. + * + * Values `null` and `undefined` are compared strictly, thus `null` is unequal + * with everything except `null`, and `undefined` is unequal with everything + * except `undefined`. + * + * Syntax: + * + * math.unequal(x, y) + * + * Examples: + * + * math.unequal(2 + 2, 3) // returns true + * math.unequal(2 + 2, 4) // returns false + * + * const a = math.unit('50 cm') + * const b = math.unit('5 m') + * math.unequal(a, b) // returns false + * + * const c = [2, 5, 1] + * const d = [2, 7, 1] + * + * math.unequal(c, d) // returns [false, true, false] + * math.deepEqual(c, d) // returns false + * + * math.unequal(0, null) // returns true + * See also: + * + * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare + * + * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare + * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false + */ + return typed(name, createUnequalNumber({ + typed, + equalScalar + }), matrixAlgorithmSuite({ + elop: _unequal, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); + function _unequal(x, y) { + return !equalScalar(x, y); + } +}); +const createUnequalNumber = exports.createUnequalNumber = (0, _factory.factory)(name, ['typed', 'equalScalar'], _ref2 => { + let { + typed, + equalScalar + } = _ref2; + return typed(name, { + 'any, any': function (x, y) { + // strict equality for null and undefined? + if (x === null) { + return y !== null; + } + if (y === null) { + return x !== null; + } + if (x === undefined) { + return y !== undefined; + } + if (y === undefined) { + return x !== undefined; + } + return !equalScalar(x, y); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setCartesian.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setCartesian.js new file mode 100644 index 0000000..665cfb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setCartesian.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetCartesian = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setCartesian'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +const createSetCartesian = exports.createSetCartesian = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the cartesian product of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays + * and the values will be sorted in ascending order before the operation. + * + * Syntax: + * + * math.setCartesian(set1, set2) + * + * Examples: + * + * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]] + * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]] + * + * See also: + * + * setUnion, setIntersect, setDifference, setPowerset + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The cartesian product of two (multi)sets + */ + return typed(name, { + '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 + const b1 = (0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural); + const b2 = (0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural); + result = []; + for (let i = 0; i < b1.length; i++) { + for (let j = 0; j < b2.length; j++) { + result.push([b1[i], b2[j]]); + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return result; + } + // return a matrix otherwise + return new DenseMatrix(result); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDifference.js new file mode 100644 index 0000000..e6c609b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDifference.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetDifference = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setDifference'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +const createSetDifference = exports.createSetDifference = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the difference of two (multi)sets: every element of set1, that is not the element of set2. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setDifference(set1, set2) + * + * Examples: + * + * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2] + * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2] + * + * See also: + * + * setUnion, setIntersect, setSymDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The difference of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function (a1, a2) { + let result; + if (subset(size(a1), new Index(0)) === 0) { + // empty-anything=empty + result = []; + } else if (subset(size(a2), new Index(0)) === 0) { + // anything-empty=anything + return (0, _array.flatten)(a1.toArray()); + } else { + const b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + const b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + result = []; + let inb2; + for (let i = 0; i < b1.length; i++) { + inb2 = false; + for (let j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + inb2 = true; + break; + } + } + if (!inb2) { + result.push(b1[i]); + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return (0, _array.generalize)(result); + } + // return a matrix otherwise + return new DenseMatrix((0, _array.generalize)(result)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDistinct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDistinct.js new file mode 100644 index 0000000..4a90e86 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setDistinct.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetDistinct = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setDistinct'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +const createSetDistinct = exports.createSetDistinct = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Collect the distinct elements of a multiset. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setDistinct(set) + * + * Examples: + * + * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3] + * + * See also: + * + * setMultiplicity + * + * @param {Array | Matrix} a A multiset + * @return {Array | Matrix} A set containing the distinc elements of the multiset + */ + return typed(name, { + 'Array | Matrix': function (a) { + let result; + if (subset(size(a), new Index(0)) === 0) { + // if empty, return empty + result = []; + } else { + const b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + result = []; + result.push(b[0]); + for (let i = 1; i < b.length; i++) { + if (compareNatural(b[i], b[i - 1]) !== 0) { + result.push(b[i]); + } + } + } + // return an array, if the input was an array + if (Array.isArray(a)) { + return result; + } + // return a matrix otherwise + return new DenseMatrix(result); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIntersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIntersect.js new file mode 100644 index 0000000..d85c5ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIntersect.js @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetIntersect = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setIntersect'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +const createSetIntersect = exports.createSetIntersect = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the intersection of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setIntersect(set1, set2) + * + * Examples: + * + * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4] + * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4] + * + * See also: + * + * setUnion, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The intersection of two (multi)sets + */ + return typed(name, { + '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 + result = []; + } else { + const b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + const b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + result = []; + for (let i = 0; i < b1.length; i++) { + for (let j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + result.push(b1[i]); + break; + } + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return (0, _array.generalize)(result); + } + // return a matrix otherwise + return new DenseMatrix((0, _array.generalize)(result)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js new file mode 100644 index 0000000..b5f9a78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetIsSubset = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setIsSubset'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +const createSetIsSubset = exports.createSetIsSubset = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.) + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setIsSubset(set1, set2) + * + * Examples: + * + * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false + * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function (a1, a2) { + if (subset(size(a1), new Index(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 + return false; + } + const b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + const b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + let inb2; + for (let i = 0; i < b1.length; i++) { + inb2 = false; + for (let j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + inb2 = true; + break; + } + } + if (inb2 === false) { + return false; + } + } + return true; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js new file mode 100644 index 0000000..34cb1b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetMultiplicity = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setMultiplicity'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +const createSetMultiplicity = exports.createSetMultiplicity = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Count the multiplicity of an element in a multiset. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setMultiplicity(element, set) + * + * Examples: + * + * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1 + * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2 + * + * See also: + * + * setDistinct, setSize + * + * @param {number | BigNumber | Fraction | Complex} e An element in the multiset + * @param {Array | Matrix} a A multiset + * @return {number} The number of how many times the multiset contains the element + */ + return typed(name, { + 'number | BigNumber | Fraction | Complex, Array | Matrix': function (e, a) { + if (subset(size(a), new Index(0)) === 0) { + // if empty, return 0 + return 0; + } + const b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()); + let count = 0; + for (let i = 0; i < b.length; i++) { + if (compareNatural(b[i], e) === 0) { + count++; + } + } + return count; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setPowerset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setPowerset.js new file mode 100644 index 0000000..9edb068 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setPowerset.js @@ -0,0 +1,81 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetPowerset = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setPowerset'; +const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +const createSetPowerset = exports.createSetPowerset = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.) + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setPowerset(set) + * + * Examples: + * + * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]] + * + * See also: + * + * setCartesian + * + * @param {Array | Matrix} a A (multi)set + * @return {Array} The powerset of the (multi)set + */ + return typed(name, { + 'Array | Matrix': function (a) { + if (subset(size(a), new Index(0)) === 0) { + // if empty, return empty + return []; + } + const b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + const result = []; + let number = 0; + while (number.toString(2).length <= b.length) { + result.push(_subset(b, number.toString(2).split('').reverse())); + number++; + } + // can not return a matrix, because of the different size of the subarrays + return _sort(result); + } + }); + + // create subset + function _subset(array, bitarray) { + const result = []; + for (let i = 0; i < bitarray.length; i++) { + if (bitarray[i] === '1') { + result.push(array[i]); + } + } + return result; + } + + // sort subsests by length + function _sort(array) { + let temp = []; + for (let i = array.length - 1; i > 0; i--) { + for (let j = 0; j < i; j++) { + if (array[j].length > array[j + 1].length) { + temp = array[j]; + array[j] = array[j + 1]; + array[j + 1] = temp; + } + } + } + return array; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSize.js new file mode 100644 index 0000000..a650f69 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSize.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetSize = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setSize'; +const dependencies = ['typed', 'compareNatural']; +const createSetSize = exports.createSetSize = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + compareNatural + } = _ref; + /** + * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setSize(set) + * math.setSize(set, unique) + * + * Examples: + * + * math.setSize([1, 2, 2, 4]) // returns 4 + * math.setSize([1, 2, 2, 4], true) // returns 3 + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a A multiset + * @param {boolean} [unique] If true, only the unique values are counted. False by default + * @return {number} The number of elements of the (multi)set + */ + return typed(name, { + 'Array | Matrix': function (a) { + return Array.isArray(a) ? (0, _array.flatten)(a).length : (0, _array.flatten)(a.toArray()).length; + }, + 'Array | Matrix, boolean': function (a, unique) { + if (unique === false || a.length === 0) { + return Array.isArray(a) ? (0, _array.flatten)(a).length : (0, _array.flatten)(a.toArray()).length; + } else { + const b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + let count = 1; + for (let i = 1; i < b.length; i++) { + if (compareNatural(b[i], b[i - 1]) !== 0) { + count++; + } + } + return count; + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js new file mode 100644 index 0000000..5f2e994 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetSymDifference = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setSymDifference'; +const dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index']; +const createSetSymDifference = exports.createSetSymDifference = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + concat, + subset, + setDifference, + Index + } = _ref; + /** + * Create the symmetric difference of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setSymDifference(set1, set2) + * + * Examples: + * + * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6] + * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6] + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The symmetric difference of two (multi)sets + */ + return typed(name, { + '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 + return (0, _array.flatten)(a2); + } else if (subset(size(a2), new Index(0)) === 0) { + return (0, _array.flatten)(a1); + } + const b1 = (0, _array.flatten)(a1); + const b2 = (0, _array.flatten)(a2); + return concat(setDifference(b1, b2), setDifference(b2, b1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setUnion.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setUnion.js new file mode 100644 index 0000000..e573f57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/set/setUnion.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSetUnion = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'setUnion'; +const dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index']; +const createSetUnion = exports.createSetUnion = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + size, + concat, + subset, + setIntersect, + setSymDifference, + Index + } = _ref; + /** + * Create the union of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setUnion(set1, set2) + * + * Examples: + * + * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6] + * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6] + * + * See also: + * + * setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The union of two (multi)sets + */ + return typed(name, { + '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 + return (0, _array.flatten)(a2); + } else if (subset(size(a2), new Index(0)) === 0) { + return (0, _array.flatten)(a1); + } + const b1 = (0, _array.flatten)(a1); + const b2 = (0, _array.flatten)(a2); + return concat(setSymDifference(b1, b2), setIntersect(b1, b2)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/freqz.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/freqz.js new file mode 100644 index 0000000..ac8412b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/freqz.js @@ -0,0 +1,121 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFreqz = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'freqz'; +const dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix']; +const createFreqz = exports.createFreqz = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + multiply, + Complex, + divide, + matrix + } = _ref; + /** + * Calculates the frequency response of a filter given its numerator and denominator coefficients. + * + * Syntax: + * math.freqz(b, a) + * math.freqz(b, a, w) + * + * Examples: + * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] } + * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] } + * + * See also: + * zpk2tf + * + * @param {Array.} b The numerator coefficients of the filter. + * @param {Array.} a The denominator coefficients of the filter. + * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points) + * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed. + * + * + */ + return typed(name, { + 'Array, Array': function (b, a) { + const w = createBins(512); + return _freqz(b, a, w); + }, + 'Array, Array, Array': function (b, a, w) { + return _freqz(b, a, w); + }, + 'Array, Array, number': function (b, a, w) { + if (w < 0) { + throw new Error('w must be a positive number'); + } + const w2 = createBins(w); + return _freqz(b, a, w2); + }, + 'Matrix, Matrix': function (b, a) { + // console.log('here') + const _w = createBins(512); + const { + w, + h + } = _freqz(b.valueOf(), a.valueOf(), _w); + return { + w: matrix(w), + h: matrix(h) + }; + }, + 'Matrix, Matrix, Matrix': function (b, a, w) { + const { + h + } = _freqz(b.valueOf(), a.valueOf(), w.valueOf()); + return { + h: matrix(h), + w: matrix(w) + }; + }, + 'Matrix, Matrix, number': function (b, a, w) { + if (w < 0) { + throw new Error('w must be a positive number'); + } + const _w = createBins(w); + const { + h + } = _freqz(b.valueOf(), a.valueOf(), _w); + return { + h: matrix(h), + w: matrix(_w) + }; + } + }); + function _freqz(b, a, w) { + const num = []; + const den = []; + for (let i = 0; i < w.length; i++) { + let sumNum = Complex(0, 0); + let sumDen = Complex(0, 0); + for (let j = 0; j < b.length; j++) { + sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i])))); + } + for (let j = 0; j < a.length; j++) { + sumDen = add(sumDen, multiply(a[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i])))); + } + num.push(sumNum); + den.push(sumDen); + } + const h = []; + for (let i = 0; i < num.length; i++) { + h.push(divide(num[i], den[i])); + } + return { + h, + w + }; + } + function createBins(n) { + const bins = []; + for (let i = 0; i < n; i++) { + bins.push(i / n * Math.PI); + } + return bins; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js new file mode 100644 index 0000000..2c0ab88 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createZpk2tf = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'zpk2tf'; +const dependencies = ['typed', 'add', 'multiply', 'Complex', 'number']; +const createZpk2tf = exports.createZpk2tf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + multiply, + Complex, + number + } = _ref; + /** + * Compute the transfer function of a zero-pole-gain model. + * + * Syntax: + * math.zpk2tf(z, p, k) + * + * Examples: + * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]] + * + * See also: + * freqz + * + * @param {Array} z Array of zeros values + * @param {Array} p Array of poles values + * @param {number} k Gain value + * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials + * + */ + return typed(name, { + 'Array,Array,number': function (z, p, k) { + return _zpk2tf(z, p, k); + }, + 'Array,Array': function (z, p) { + return _zpk2tf(z, p, 1); + }, + 'Matrix,Matrix,number': function (z, p, k) { + return _zpk2tf(z.valueOf(), p.valueOf(), k); + }, + 'Matrix,Matrix': function (z, p) { + return _zpk2tf(z.valueOf(), p.valueOf(), 1); + } + }); + function _zpk2tf(z, p, k) { + // if z is bignumber, convert it to number + if (z.some(el => el.type === 'BigNumber')) { + z = z.map(el => number(el)); + } + // if p is bignumber, convert it to number + if (p.some(el => el.type === 'BigNumber')) { + p = p.map(el => number(el)); + } + let num = [Complex(1, 0)]; + let den = [Complex(1, 0)]; + for (let i = 0; i < z.length; i++) { + let zero = z[i]; + if (typeof zero === 'number') zero = Complex(zero, 0); + num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]); + } + for (let i = 0; i < p.length; i++) { + let pole = p[i]; + if (typeof pole === 'number') pole = Complex(pole, 0); + den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]); + } + for (let i = 0; i < num.length; i++) { + num[i] = multiply(num[i], k); + } + return [num, den]; + } + function _multiply(a, b) { + const c = []; + for (let i = 0; i < a.length + b.length - 1; i++) { + c[i] = Complex(0, 0); + for (let j = 0; j < a.length; j++) { + if (i - j >= 0 && i - j < b.length) { + c[i] = add(c[i], multiply(a[j], b[i - j])); + } + } + } + return c; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/erf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/erf.js new file mode 100644 index 0000000..ae57167 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/erf.js @@ -0,0 +1,161 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createErf = void 0; +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +/* eslint-disable no-loss-of-precision */ + +const name = 'erf'; +const dependencies = ['typed']; +const createErf = exports.createErf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Compute the erf function of a value using a rational Chebyshev + * approximations for different intervals of x. + * + * This is a translation of W. J. Cody's Fortran implementation from 1987 + * ( https://www.netlib.org/specfun/erf ). See the AMS publication + * "Rational Chebyshev Approximations for the Error Function" by W. J. Cody + * for an explanation of this process. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.erf(x) + * + * Examples: + * + * math.erf(0.2) // returns 0.22270258921047847 + * math.erf(-0.5) // returns -0.5204998778130465 + * math.erf(4) // returns 0.9999999845827421 + * + * See also: + * zeta + * + * @param {number | Array | Matrix} x A real number + * @return {number | Array | Matrix} The erf of `x` + */ + return typed('name', { + number: function (x) { + const y = Math.abs(x); + if (y >= MAX_NUM) { + return (0, _number.sign)(x); + } + if (y <= THRESH) { + return (0, _number.sign)(x) * erf1(y); + } + if (y <= 4.0) { + return (0, _number.sign)(x) * (1 - erfc2(y)); + } + return (0, _number.sign)(x) * (1 - erfc3(y)); + }, + 'Array | Matrix': typed.referToSelf(self => n => (0, _collection.deepMap)(n, self)) + + // TODO: For complex numbers, use the approximation for the Faddeeva function + // from "More Efficient Computation of the Complex Error Function" (AMS) + }); + + /** + * Approximates the error function erf() for x <= 0.46875 using this function: + * n + * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j)) + * j=0 + */ + function erf1(y) { + const ysq = y * y; + let xnum = P[0][4] * ysq; + let xden = ysq; + let i; + for (i = 0; i < 3; i += 1) { + xnum = (xnum + P[0][i]) * ysq; + xden = (xden + Q[0][i]) * ysq; + } + return y * (xnum + P[0][3]) / (xden + Q[0][3]); + } + + /** + * Approximates the complement of the error function erfc() for + * 0.46875 <= x <= 4.0 using this function: + * n + * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j) + * j=0 + */ + function erfc2(y) { + let xnum = P[1][8] * y; + let xden = y; + let i; + for (i = 0; i < 7; i += 1) { + xnum = (xnum + P[1][i]) * y; + xden = (xden + Q[1][i]) * y; + } + const result = (xnum + P[1][7]) / (xden + Q[1][7]); + const ysq = parseInt(y * 16) / 16; + const del = (y - ysq) * (y + ysq); + return Math.exp(-ysq * ysq) * Math.exp(-del) * result; + } + + /** + * Approximates the complement of the error function erfc() for x > 4.0 using + * this function: + * + * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) + + * n + * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ] + * j=0 + */ + function erfc3(y) { + let ysq = 1 / (y * y); + let xnum = P[2][5] * ysq; + let xden = ysq; + let i; + for (i = 0; i < 4; i += 1) { + xnum = (xnum + P[2][i]) * ysq; + xden = (xden + Q[2][i]) * ysq; + } + let result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]); + result = (SQRPI - result) / y; + ysq = parseInt(y * 16) / 16; + const del = (y - ysq) * (y + ysq); + return Math.exp(-ysq * ysq) * Math.exp(-del) * result; + } +}); + +/** + * Upper bound for the first approximation interval, 0 <= x <= THRESH + * @constant + */ +const THRESH = 0.46875; + +/** + * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi) + * @constant + */ +const SQRPI = 5.6418958354775628695e-1; + +/** + * Coefficients for each term of the numerator sum (p_j) for each approximation + * interval (see W. J. Cody's paper for more details) + * @constant + */ +const P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]]; + +/** + * Coefficients for each term of the denominator sum (q_j) for each approximation + * interval (see W. J. Cody's paper for more details) + * @constant + */ +const Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]]; + +/** + * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is + * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will + * return 1 + */ +const MAX_NUM = Math.pow(2, 53); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/zeta.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/zeta.js new file mode 100644 index 0000000..2dad474 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/special/zeta.js @@ -0,0 +1,154 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createZeta = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'zeta'; +const dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi']; +const createZeta = exports.createZeta = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + multiply, + pow, + divide, + factorial, + equal, + smallerEq, + isNegative, + gamma, + sin, + subtract, + add, + Complex, + BigNumber, + pi + } = _ref; + /** + * Compute the Riemann Zeta function of a value using an infinite series for + * all of the complex plane using Riemann's Functional equation. + * + * Based off the paper by Xavier Gourdon and Pascal Sebah + * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf ) + * + * Implementation and slight modification by Anik Patel + * + * Note: the implementation is accurate up to about 6 digits. + * + * Syntax: + * + * math.zeta(n) + * + * Examples: + * + * math.zeta(5) // returns 1.0369277551433895 + * math.zeta(-0.5) // returns -0.2078862249773449 + * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i + * + * See also: + * erf + * + * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function + * @return {number | Complex | BigNumber} The Riemann Zeta of `s` + */ + return typed(name, { + number: s => zetaNumeric(s, value => value, () => 20), + BigNumber: s => zetaNumeric(s, value => new BigNumber(value), () => { + // relTol is for example 1e-12. Extract the positive exponent 12 from that + return Math.abs(Math.log10(config.relTol)); + }), + Complex: zetaComplex + }); + + /** + * @param {number | BigNumber} s + * @param {(value: number) => number | BigNumber} createValue + * @param {(value: number | BigNumber | Complex) => number} determineDigits + * @returns {number | BigNumber} + */ + function zetaNumeric(s, createValue, determineDigits) { + if (equal(s, 0)) { + return createValue(-0.5); + } + if (equal(s, 1)) { + return createValue(NaN); + } + if (!isFinite(s)) { + return isNegative(s) ? createValue(NaN) : createValue(1); + } + return zeta(s, createValue, determineDigits, s => s); + } + + /** + * @param {Complex} s + * @returns {Complex} + */ + function zetaComplex(s) { + if (s.re === 0 && s.im === 0) { + return new Complex(-0.5); + } + if (s.re === 1) { + return new Complex(NaN, NaN); + } + if (s.re === Infinity && s.im === 0) { + return new Complex(1); + } + if (s.im === Infinity || s.re === -Infinity) { + return new Complex(NaN, NaN); + } + return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re); + } + + /** + * @param {number | BigNumber | Complex} s + * @param {(value: number) => number | BigNumber | Complex} createValue + * @param {(value: number | BigNumber | Complex) => number} determineDigits + * @param {(value: number | BigNumber | Complex) => number} getRe + * @returns {*|number} + */ + function zeta(s, createValue, determineDigits, getRe) { + const n = determineDigits(s); + if (getRe(s) > -(n - 1) / 2) { + return f(s, createValue(n), createValue); + } else { + // Function Equation for reflection to x < 1 + let c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1))); + c = multiply(c, sin(multiply(divide(createValue(pi), 2), s))); + c = multiply(c, gamma(subtract(1, s))); + return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe)); + } + } + + /** + * Calculate a portion of the sum + * @param {number | BigNumber} k a positive integer + * @param {number | BigNumber} n a positive integer + * @return {number} the portion of the sum + **/ + function d(k, n) { + let S = k; + for (let j = k; smallerEq(j, n); j = add(j, 1)) { + const factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j)))); + S = add(S, factor); + } + return multiply(n, S); + } + + /** + * Calculate the positive Riemann Zeta function + * @param {number} s a real or complex number with s.re > 1 + * @param {number} n a positive integer + * @param {(number) => number | BigNumber | Complex} createValue + * @return {number} Riemann Zeta of s + **/ + function f(s, n, createValue) { + const c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s))))); + let S = createValue(0); + for (let k = createValue(1); smallerEq(k, n); k = add(k, 1)) { + S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s))); + } + return multiply(c, S); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/corr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/corr.js new file mode 100644 index 0000000..aecef66 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/corr.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCorr = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'corr'; +const dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide']; +const createCorr = exports.createCorr = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + sqrt, + sum, + add, + subtract, + multiply, + pow, + divide + } = _ref; + /** + * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated. + * + * Syntax: + * + * math.corr(A, B) + * + * Examples: + * + * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1 + * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644 + * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1] + * + * See also: + * + * median, mean, min, max, sum, prod, std, variance + * + * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient + * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient + * @return {*} The correlation coefficient + */ + return typed(name, { + 'Array, Array': function (A, B) { + return _corr(A, B); + }, + 'Matrix, Matrix': function (A, B) { + const res = _corr(A.toArray(), B.toArray()); + return Array.isArray(res) ? matrix(res) : res; + } + }); + /** + * Calculate the correlation coefficient between two arrays or matrices. + * @param {Array | Matrix} A + * @param {Array | Matrix} B + * @return {*} correlation coefficient + * @private + */ + function _corr(A, B) { + const correlations = []; + if (Array.isArray(A[0]) && Array.isArray(B[0])) { + if (A.length !== B.length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.'); + } + for (let i = 0; i < A.length; i++) { + if (A[i].length !== B[i].length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.'); + } + correlations.push(correlation(A[i], B[i])); + } + return correlations; + } else { + if (A.length !== B.length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.'); + } + return correlation(A, B); + } + } + function correlation(A, B) { + const n = A.length; + const sumX = sum(A); + const sumY = sum(B); + const sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0); + const sumXSquare = sum(A.map(x => pow(x, 2))); + const sumYSquare = sum(B.map(y => pow(y, 2))); + const numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY)); + const denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2)))); + return divide(numerator, denominator); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js new file mode 100644 index 0000000..70151d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCumSum = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _switch2 = require("../../utils/switch.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +var _array = require("../../utils/array.js"); +var _IndexError = require("../../error/IndexError.js"); +const name = 'cumsum'; +const dependencies = ['typed', 'add', 'unaryPlus']; +const createCumSum = exports.createCumSum = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + unaryPlus + } = _ref; + /** + * Compute the cumulative sum of a matrix or a list with values. + * In case of a (multi dimensional) array or matrix, the cumulative sums + * along a specified dimension (defaulting to the first) will be calculated. + * + * Syntax: + * + * math.cumsum(a, b, c, ...) + * math.cumsum(A) + * + * Examples: + * + * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10] + * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10] + * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]] + * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]] + * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]] + * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]] + * + * See also: + * + * mean, median, min, max, prod, std, variance, sum + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The cumulative sum of all values + */ + return typed(name, { + // sum([a, b, c, d, ...]) + Array: _cumsum, + Matrix: function (matrix) { + return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype())); + }, + // sum([a, b, c, d, ...], dim) + 'Array, number | BigNumber': _ncumSumDim, + 'Matrix, number | BigNumber': function (matrix, dim) { + return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype()); + }, + // cumsum(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('All values expected to be scalar in function cumsum'); + } + return _cumsum(args); + } + }); + + /** + * Recursively calculate the cumulative sum of an n-dimensional array + * @param {Array} array + * @return {number} cumsum + * @private + */ + function _cumsum(array) { + try { + return _cumsummap(array); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, name); + } + } + function _cumsummap(array) { + if (array.length === 0) { + return []; + } + const sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be + for (let i = 1; i < array.length; ++i) { + // Must use add below and not addScalar for the case of summing a + // 2+-dimensional array along the 0th dimension (the row vectors, + // or higher-d analogues, are literally added to each other). + sums.push(add(sums[i - 1], array[i])); + } + return sums; + } + function _ncumSumDim(array, dim) { + const size = (0, _array.arraySize)(array); + if (dim < 0 || dim >= size.length) { + // TODO: would be more clear when throwing a DimensionError here + throw new _IndexError.IndexError(dim, size.length); + } + try { + return _cumsumDimensional(array, dim); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, name); + } + } + + /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */ + function _cumsumDimensional(mat, dim) { + let i, ret, tran; + if (dim <= 0) { + const initialValue = mat[0][0]; + if (!Array.isArray(initialValue)) { + return _cumsummap(mat); + } else { + tran = (0, _switch2._switch)(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _cumsumDimensional(tran[i], dim - 1); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _cumsumDimensional(mat[i], dim - 1); + } + return ret; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mad.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mad.js new file mode 100644 index 0000000..2a7e1b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mad.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMad = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'mad'; +const dependencies = ['typed', 'abs', 'map', 'median', 'subtract']; +const createMad = exports.createMad = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + abs, + map, + median, + subtract + } = _ref; + /** + * Compute the median absolute deviation of a matrix or a list with values. + * The median absolute deviation is defined as the median of the absolute + * deviations from the median. + * + * Syntax: + * + * math.mad(a, b, c, ...) + * math.mad(A) + * + * Examples: + * + * math.mad(10, 20, 30) // returns 10 + * math.mad([1, 2, 3]) // returns 1 + * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5 + * + * See also: + * + * median, mean, std, abs + * + * @param {Array | Matrix} array + * A single matrix or multiple scalar values. + * @return {*} The median absolute deviation. + */ + return typed(name, { + // mad([a, b, c, d, ...]) + 'Array | Matrix': _mad, + // mad(a, b, c, d, ...) + '...': function (args) { + return _mad(args); + } + }); + function _mad(array) { + array = (0, _array.flatten)(array.valueOf()); + if (array.length === 0) { + throw new Error('Cannot calculate median absolute deviation (mad) of an empty array'); + } + try { + const med = median(array); + return median(map(array, function (value) { + return abs(subtract(value, med)); + })); + } catch (err) { + if (err instanceof TypeError && err.message.includes('median')) { + throw new TypeError(err.message.replace('median', 'mad')); + } else { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'mad'); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/max.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/max.js new file mode 100644 index 0000000..f977dff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/max.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMax = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'max'; +const dependencies = ['typed', 'config', 'numeric', 'larger']; +const createMax = exports.createMax = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + numeric, + larger + } = _ref; + /** + * Compute the maximum value of a matrix or a list with values. + * In case of a multidimensional array, the maximum of the flattened array + * will be calculated. When `dim` is provided, the maximum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.max(a, b, c, ...) + * math.max(A) + * math.max(A, dimension) + * + * Examples: + * + * math.max(2, 1, 4, 3) // returns 4 + * math.max([2, 1, 4, 3]) // returns 4 + * + * // maximum over a specified dimension (zero-based) + * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7] + * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7] + * + * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 + * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5 + * + * See also: + * + * mean, median, min, prod, std, sum, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The maximum value + */ + return typed(name, { + // max([a, b, c, d, ...]) + 'Array | Matrix': _max, + // max([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + return (0, _collection.reduce)(array, dim.valueOf(), _largest); + }, + // max(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('Scalar values expected in function max'); + } + return _max(args); + } + }); + + /** + * Return the largest of two values + * @param {*} x + * @param {*} y + * @returns {*} Returns x when x is largest, or y when y is largest + * @private + */ + function _largest(x, y) { + try { + return larger(x, y) ? x : y; + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'max', y); + } + } + + /** + * Recursively calculate the maximum value in an n-dimensional array + * @param {Array} array + * @return {number} max + * @private + */ + function _max(array) { + let res; + (0, _collection.deepForEach)(array, function (value) { + try { + if (isNaN(value) && typeof value === 'number') { + res = NaN; + } else if (res === undefined || larger(value, res)) { + res = value; + } + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'max', value); + } + }); + if (res === undefined) { + throw new Error('Cannot calculate max of an empty array'); + } + + // make sure returning numeric value: parse a string into a numeric value + if (typeof res === 'string') { + res = numeric(res, (0, _number.safeNumberType)(res, config)); + } + return res; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mean.js new file mode 100644 index 0000000..3bc247f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mean.js @@ -0,0 +1,100 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMean = void 0; +var _collection = require("../../utils/collection.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'mean'; +const dependencies = ['typed', 'add', 'divide']; +const createMean = exports.createMean = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + divide + } = _ref; + /** + * Compute the mean value of matrix or a list with values. + * In case of a multidimensional array, the mean of the flattened array + * will be calculated. When `dim` is provided, the maximum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.mean(a, b, c, ...) + * math.mean(A) + * math.mean(A, dimension) + * + * Examples: + * + * math.mean(2, 1, 4, 3) // returns 2.5 + * math.mean([1, 2.7, 3.2, 4]) // returns 2.725 + * + * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5] + * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4] + * + * See also: + * + * median, min, max, sum, prod, std, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The mean of all values + */ + return typed(name, { + // mean([a, b, c, d, ...]) + 'Array | Matrix': _mean, + // mean([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': _nmeanDim, + // mean(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('Scalar values expected in function mean'); + } + return _mean(args); + } + }); + + /** + * Calculate the mean value in an n-dimensional array, returning a + * n-1 dimensional array + * @param {Array} array + * @param {number} dim + * @return {number} mean + * @private + */ + function _nmeanDim(array, dim) { + try { + const sum = (0, _collection.reduce)(array, dim, add); + const s = Array.isArray(array) ? (0, _array.arraySize)(array) : array.size(); + return divide(sum, s[dim]); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'mean'); + } + } + + /** + * Recursively calculate the mean value in an n-dimensional array + * @param {Array} array + * @return {number} mean + * @private + */ + function _mean(array) { + let sum; + let num = 0; + (0, _collection.deepForEach)(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + num++; + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'mean', value); + } + }); + if (num === 0) { + throw new Error('Cannot calculate the mean of an empty array'); + } + return divide(sum, num); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/median.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/median.js new file mode 100644 index 0000000..6110dd5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/median.js @@ -0,0 +1,114 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMedian = void 0; +var _collection = require("../../utils/collection.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'median'; +const dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect']; +const createMedian = exports.createMedian = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + divide, + compare, + partitionSelect + } = _ref; + /** + * Recursively calculate the median of an n-dimensional array + * @param {Array} array + * @return {Number} median + * @private + */ + function _median(array) { + try { + array = (0, _array.flatten)(array.valueOf()); + const num = array.length; + if (num === 0) { + throw new Error('Cannot calculate median of an empty array'); + } + if (num % 2 === 0) { + // even: return the average of the two middle values + const mid = num / 2 - 1; + const right = partitionSelect(array, mid + 1); + + // array now partitioned at mid + 1, take max of left part + let left = array[mid]; + for (let i = 0; i < mid; ++i) { + if (compare(array[i], left) > 0) { + left = array[i]; + } + } + return middle2(left, right); + } else { + // odd: return the middle value + const m = partitionSelect(array, (num - 1) / 2); + return middle(m); + } + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'median'); + } + } + + // helper function to type check the middle value of the array + const middle = typed({ + 'number | BigNumber | Complex | Unit': function (value) { + return value; + } + }); + + // helper function to type check the two middle value of the array + const middle2 = typed({ + 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function (left, right) { + return divide(add(left, right), 2); + } + }); + + /** + * Compute the median of a matrix or a list with values. The values are + * sorted and the middle value is returned. In case of an even number of + * values, the average of the two middle values is returned. + * Supported types of values are: Number, BigNumber, Unit + * + * In case of a (multi dimensional) array or matrix, the median of all + * elements will be calculated. + * + * Syntax: + * + * math.median(a, b, c, ...) + * math.median(A) + * + * Examples: + * + * math.median(5, 2, 7) // returns 5 + * math.median([3, -1, 5, 7]) // returns 4 + * + * See also: + * + * mean, min, max, sum, prod, std, variance, quantileSeq + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The median + */ + return typed(name, { + // median([a, b, c, d, ...]) + 'Array | Matrix': _median, + // median([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + // TODO: implement median(A, dim) + throw new Error('median(A, dim) is not yet supported'); + // return reduce(arguments[0], arguments[1], ...) + }, + // median(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('Scalar values expected in function median'); + } + return _median(args); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/min.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/min.js new file mode 100644 index 0000000..903f906 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/min.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMin = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'min'; +const dependencies = ['typed', 'config', 'numeric', 'smaller']; +const createMin = exports.createMin = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + numeric, + smaller + } = _ref; + /** + * Compute the minimum value of a matrix or a list of values. + * In case of a multidimensional array, the minimum of the flattened array + * will be calculated. When `dim` is provided, the minimum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.min(a, b, c, ...) + * math.min(A) + * math.min(A, dimension) + * + * Examples: + * + * math.min(2, 1, 4, 3) // returns 1 + * math.min([2, 1, 4, 3]) // returns 1 + * + * // minimum over a specified dimension (zero-based) + * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3] + * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1] + * + * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 + * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5 + * + * See also: + * + * mean, median, max, prod, std, sum, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The minimum value + */ + return typed(name, { + // min([a, b, c, d, ...]) + 'Array | Matrix': _min, + // min([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + return (0, _collection.reduce)(array, dim.valueOf(), _smallest); + }, + // min(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('Scalar values expected in function min'); + } + return _min(args); + } + }); + + /** + * Return the smallest of two values + * @param {*} x + * @param {*} y + * @returns {*} Returns x when x is smallest, or y when y is smallest + * @private + */ + function _smallest(x, y) { + try { + return smaller(x, y) ? x : y; + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'min', y); + } + } + + /** + * Recursively calculate the minimum value in an n-dimensional array + * @param {Array} array + * @return {number} min + * @private + */ + function _min(array) { + let min; + (0, _collection.deepForEach)(array, function (value) { + try { + if (isNaN(value) && typeof value === 'number') { + min = NaN; + } else if (min === undefined || smaller(value, min)) { + min = value; + } + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'min', value); + } + }); + if (min === undefined) { + throw new Error('Cannot calculate min of an empty array'); + } + + // make sure returning numeric value: parse a string into a numeric value + if (typeof min === 'string') { + min = numeric(min, (0, _number.safeNumberType)(min, config)); + } + return min; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mode.js new file mode 100644 index 0000000..74bde64 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/mode.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMode = void 0; +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +const name = 'mode'; +const dependencies = ['typed', 'isNaN', 'isNumeric']; +const createMode = exports.createMode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isNaN, + isNumeric + } = _ref; + /** + * Computes the mode of a set of numbers or a list with values(numbers or characters). + * If there are multiple modes, it returns a list of those values. + * + * Syntax: + * + * math.mode(a, b, c, ...) + * math.mode(A) + * + * Examples: + * + * math.mode(2, 1, 4, 3, 1) // returns [1] + * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7] + * math.mode(1, 4, 6, 1, 6) // returns [1, 6] + * math.mode('a','a','b','c') // returns ["a"] + * math.mode(1, 1.5, 'abc') // returns [1, 1.5, "abc"] + * + * See also: + * + * median, + * mean + * + * @param {... *} args A single matrix + * @return {*} The mode of all values + */ + return typed(name, { + 'Array | Matrix': _mode, + '...': function (args) { + return _mode(args); + } + }); + + /** + * Calculates the mode in an 1-dimensional array + * @param {Array} values + * @return {Array} mode + * @private + */ + function _mode(values) { + values = (0, _array.flatten)(values.valueOf()); + const num = values.length; + if (num === 0) { + throw new Error('Cannot calculate mode of an empty array'); + } + const count = {}; + let mode = []; + let max = 0; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + if (isNumeric(value) && isNaN(value)) { + throw new Error('Cannot calculate mode of an array containing NaN values'); + } + if (!(value in count)) { + count[value] = 0; + } + count[value]++; + if (count[value] === max) { + mode.push(value); + } else if (count[value] > max) { + max = count[value]; + mode = [value]; + } + } + return mode; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/prod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/prod.js new file mode 100644 index 0000000..4506444 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/prod.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createProd = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'prod'; +const dependencies = ['typed', 'config', 'multiplyScalar', 'numeric']; +const createProd = exports.createProd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + multiplyScalar, + numeric + } = _ref; + /** + * Compute the product of a matrix or a list with values. + * In case of a multidimensional array or matrix, the sum of all + * elements will be calculated. + * + * Syntax: + * + * math.prod(a, b, c, ...) + * math.prod(A) + * + * Examples: + * + * math.multiply(2, 3) // returns 6 + * math.prod(2, 3) // returns 6 + * math.prod(2, 3, 4) // returns 24 + * math.prod([2, 3, 4]) // returns 24 + * math.prod([[2, 5], [4, 3]]) // returns 120 + * + * See also: + * + * mean, median, min, max, sum, std, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The product of all values + */ + return typed(name, { + // prod([a, b, c, d, ...]) + 'Array | Matrix': _prod, + // prod([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + // TODO: implement prod(A, dim) + throw new Error('prod(A, dim) is not yet supported'); + // return reduce(arguments[0], arguments[1], math.prod) + }, + // prod(a, b, c, d, ...) + '...': function (args) { + return _prod(args); + } + }); + + /** + * Recursively calculate the product of an n-dimensional array + * @param {Array} array + * @return {number} prod + * @private + */ + function _prod(array) { + let prod; + (0, _collection.deepForEach)(array, function (value) { + try { + prod = prod === undefined ? value : multiplyScalar(prod, value); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'prod', value); + } + }); + + // make sure returning numeric value: parse a string into a numeric value + if (typeof prod === 'string') { + prod = numeric(prod, (0, _number.safeNumberType)(prod, config)); + } + if (prod === undefined) { + throw new Error('Cannot calculate prod of an empty array'); + } + return prod; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js new file mode 100644 index 0000000..d2baf20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js @@ -0,0 +1,172 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createQuantileSeq = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _apply = require("../matrix/apply.js"); +const name = 'quantileSeq'; +const dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']; +const createQuantileSeq = exports.createQuantileSeq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + } = _ref; + const apply = (0, _apply.createApply)({ + typed, + isInteger + }); + + /** + * Compute the prob order quantile of a matrix or a list with values. + * The sequence is sorted and the middle value is returned. + * Supported types of sequence values are: Number, BigNumber, Unit + * Supported types of probability are: Number, BigNumber + * + * In case of a multidimensional array or matrix, the prob order quantile + * of all elements will be calculated. + * + * Syntax: + * + * math.quantileSeq(A, prob[, sorted]) + * math.quantileSeq(A, [prob1, prob2, ...][, sorted]) + * math.quantileSeq(A, N[, sorted]) + * + * Examples: + * + * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4 + * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5] + * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5] + * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4 + * + * See also: + * + * median, mean, min, max, sum, prod, std, variance + * + * @param {Array, Matrix} data A single matrix or Array + * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is + * the amount of evenly distributed steps of + * probabilities; only one of these options can + * be provided + * @param {Boolean} sorted=false is data sorted in ascending order + * @return {Number, BigNumber, Unit, Array} Quantile(s) + */ + return typed(name, { + 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false), + 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber), + 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber, + 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber), + 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false), + 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection), + 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection, + 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection) + }); + function _quantileSeqDim(data, prob, sorted, dim, fn) { + return apply(data, dim, x => fn(x, prob, sorted)); + } + function _quantileSeqProbNumber(data, probOrN, sorted) { + let probArr; + const dataArr = data.valueOf(); + if (smaller(probOrN, 0)) { + throw new Error('N/prob must be non-negative'); + } + if (smallerEq(probOrN, 1)) { + // quantileSeq([a, b, c, d, ...], prob[,sorted]) + return (0, _is.isNumber)(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted)); + } + if (larger(probOrN, 1)) { + // quantileSeq([a, b, c, d, ...], N[,sorted]) + if (!isInteger(probOrN)) { + throw new Error('N must be a positive integer'); + } + + // largest possible Array length is 2^32-1 + // 2^32 < 10^15, thus safe conversion guaranteed + if (larger(probOrN, 4294967295)) { + throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array'); + } + const nPlusOne = add(probOrN, 1); + probArr = []; + for (let i = 0; smaller(i, probOrN); i++) { + const prob = divide(i + 1, nPlusOne); + probArr.push(_quantileSeq(dataArr, prob, sorted)); + } + return (0, _is.isNumber)(probOrN) ? probArr : bignumber(probArr); + } + } + + /** + * Calculate the prob order quantile of an n-dimensional array. + * + * @param {Array, Matrix} array + * @param {Array, Matrix} prob + * @param {Boolean} sorted + * @return {Number, BigNumber, Unit} prob order quantile + * @private + */ + + function _quantileSeqProbCollection(data, probOrN, sorted) { + const dataArr = data.valueOf(); + // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted]) + const probOrNArr = probOrN.valueOf(); + const probArr = []; + for (let i = 0; i < probOrNArr.length; ++i) { + probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted)); + } + return probArr; + } + + /** + * Calculate the prob order quantile of an n-dimensional array. + * + * @param {Array} array + * @param {Number, BigNumber} prob + * @param {Boolean} sorted + * @return {Number, BigNumber, Unit} prob order quantile + * @private + */ + function _quantileSeq(array, prob, sorted) { + const flat = (0, _array.flatten)(array); + const len = flat.length; + if (len === 0) { + throw new Error('Cannot calculate quantile of an empty sequence'); + } + const index = (0, _is.isNumber)(prob) ? prob * (len - 1) : prob.times(len - 1); + const integerPart = (0, _is.isNumber)(prob) ? Math.floor(index) : index.floor().toNumber(); + const fracPart = (0, _is.isNumber)(prob) ? index % 1 : index.minus(integerPart); + if (isInteger(index)) { + return sorted ? flat[index] : partitionSelect(flat, (0, _is.isNumber)(prob) ? index : index.valueOf()); + } + let left; + let right; + if (sorted) { + left = flat[integerPart]; + right = flat[integerPart + 1]; + } else { + right = partitionSelect(flat, integerPart + 1); + + // max of partition is kth largest + left = flat[integerPart]; + for (let i = 0; i < integerPart; ++i) { + if (compare(flat[i], left) > 0) { + left = flat[i]; + } + } + } + // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1] + return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/std.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/std.js new file mode 100644 index 0000000..9cc1bba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/std.js @@ -0,0 +1,103 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createStd = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'std'; +const dependencies = ['typed', 'map', 'sqrt', 'variance']; +const createStd = exports.createStd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + map, + sqrt, + variance + } = _ref; + /** + * Compute the standard deviation of a matrix or a list with values. + * The standard deviations is defined as the square root of the variance: + * `std(A) = sqrt(variance(A))`. + * In case of a (multi dimensional) array or matrix, the standard deviation + * over all elements will be calculated by default, unless an axis is specified + * in which case the standard deviation will be computed along that axis. + * + * Additionally, it is possible to compute the standard deviation along the rows + * or columns of a matrix by specifying the dimension as the second argument. + * + * Optionally, the type of normalization can be specified as the final + * parameter. The parameter `normalization` can be one of the following values: + * + * - 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * + * + * Syntax: + * + * math.std(a, b, c, ...) + * math.std(A) + * math.std(A, normalization) + * math.std(A, dimension) + * math.std(A, dimension, normalization) + * + * Examples: + * + * math.std(2, 4, 6) // returns 2 + * math.std([2, 4, 6, 8]) // returns 2.581988897471611 + * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979 + * math.std([2, 4, 6, 8], 'biased') // returns 2 + * + * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707 + * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378] + * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2] + * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951] + * + * See also: + * + * mean, median, max, min, prod, sum, variance + * + * @param {Array | Matrix} array + * A single matrix or or multiple scalar values + * @param {string} [normalization='unbiased'] + * Determines how to normalize the variance. + * Choose 'unbiased' (default), 'uncorrected', or 'biased'. + * @param dimension {number | BigNumber} + * Determines the axis to compute the standard deviation for a matrix + * @return {*} The standard deviation + */ + return typed(name, { + // std([a, b, c, d, ...]) + 'Array | Matrix': _std, + // std([a, b, c, d, ...], normalization) + 'Array | Matrix, string': _std, + // std([a, b, c, c, ...], dim) + 'Array | Matrix, number | BigNumber': _std, + // std([a, b, c, c, ...], dim, normalization) + 'Array | Matrix, number | BigNumber, string': _std, + // std(a, b, c, d, ...) + '...': function (args) { + return _std(args); + } + }); + function _std(array, normalization) { + if (array.length === 0) { + throw new SyntaxError('Function std requires one or more parameters (0 provided)'); + } + try { + const v = variance.apply(null, arguments); + if ((0, _is.isCollection)(v)) { + return map(v, sqrt); + } else { + return sqrt(v); + } + } catch (err) { + if (err instanceof TypeError && err.message.includes(' variance')) { + throw new TypeError(err.message.replace(' variance', ' std')); + } else { + throw err; + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/sum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/sum.js new file mode 100644 index 0000000..533593d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/sum.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSum = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const name = 'sum'; +const dependencies = ['typed', 'config', 'add', 'numeric']; +const createSum = exports.createSum = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + add, + numeric + } = _ref; + /** + * Compute the sum of a matrix or a list with values. + * In case of a multidimensional array or matrix, the sum of all + * elements will be calculated. + * + * Syntax: + * + * math.sum(a, b, c, ...) + * math.sum(A) + * math.sum(A, dimension) + * + * Examples: + * + * math.sum(2, 1, 4, 3) // returns 10 + * math.sum([2, 1, 4, 3]) // returns 10 + * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22 + * + * See also: + * + * mean, median, min, max, prod, std, variance, cumsum + * + * @param {... *} args A single matrix or multiple scalar values + * @return {*} The sum of all values + */ + return typed(name, { + // sum([a, b, c, d, ...]) + 'Array | Matrix': _sum, + // sum([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': _nsumDim, + // sum(a, b, c, d, ...) + '...': function (args) { + if ((0, _collection.containsCollections)(args)) { + throw new TypeError('Scalar values expected in function sum'); + } + return _sum(args); + } + }); + + /** + * Recursively calculate the sum of an n-dimensional array + * @param {Array | Matrix} array + * @return {number} sum + * @private + */ + function _sum(array) { + let sum; + (0, _collection.deepForEach)(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'sum', value); + } + }); + + // make sure returning numeric value: parse a string into a numeric value + if (sum === undefined) { + sum = numeric(0, config.number); + } + if (typeof sum === 'string') { + sum = numeric(sum, (0, _number.safeNumberType)(sum, config)); + } + return sum; + } + function _nsumDim(array, dim) { + try { + const sum = (0, _collection.reduce)(array, dim, add); + return sum; + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'sum'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js new file mode 100644 index 0000000..e411eb8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.improveErrorMessage = improveErrorMessage; +var _is = require("../../../utils/is.js"); +/** + * Improve error messages for statistics functions. Errors are typically + * thrown in an internally used function like larger, causing the error + * not to mention the function (like max) which is actually used by the user. + * + * @param {Error} err + * @param {String} fnName + * @param {*} [value] + * @return {Error} + */ +function improveErrorMessage(err, fnName, value) { + // TODO: add information with the index (also needs transform in expression parser) + let details; + if (String(err).includes('Unexpected type')) { + details = arguments.length > 2 ? ' (type: ' + (0, _is.typeOf)(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')'; + return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details); + } + if (String(err).includes('complex numbers')) { + details = arguments.length > 2 ? ' (type: ' + (0, _is.typeOf)(value) + ', value: ' + JSON.stringify(value) + ')' : ''; + return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details); + } + return err; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/variance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/variance.js new file mode 100644 index 0000000..0cd8e09 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/statistics/variance.js @@ -0,0 +1,159 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createVariance = void 0; +var _collection = require("../../utils/collection.js"); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _improveErrorMessage = require("./utils/improveErrorMessage.js"); +const DEFAULT_NORMALIZATION = 'unbiased'; +const name = 'variance'; +const dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']; +const createVariance = exports.createVariance = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + } = _ref; + /** + * Compute the variance of a matrix or a list with values. + * In case of a multidimensional array or matrix, the variance over all + * elements will be calculated. + * + * Additionally, it is possible to compute the variance along the rows + * or columns of a matrix by specifying the dimension as the second argument. + * + * Optionally, the type of normalization can be specified as the final + * parameter. The parameter `normalization` can be one of the following values: + * + * - 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * + * + * Note that older browser may not like the variable name `var`. In that + * case, the function can be called as `math['var'](...)` instead of + * `math.var(...)`. + * + * Syntax: + * + * math.variance(a, b, c, ...) + * math.variance(A) + * math.variance(A, normalization) + * math.variance(A, dimension) + * math.variance(A, dimension, normalization) + * + * Examples: + * + * math.variance(2, 4, 6) // returns 4 + * math.variance([2, 4, 6, 8]) // returns 6.666666666666667 + * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5 + * math.variance([2, 4, 6, 8], 'biased') // returns 4 + * + * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5 + * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5] + * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4] + * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2] + * + * See also: + * + * mean, median, max, min, prod, std, sum + * + * @param {Array | Matrix} array + * A single matrix or or multiple scalar values + * @param {string} [normalization='unbiased'] + * Determines how to normalize the variance. + * Choose 'unbiased' (default), 'uncorrected', or 'biased'. + * @param dimension {number | BigNumber} + * Determines the axis to compute the variance for a matrix + * @return {*} The variance + */ + return typed(name, { + // variance([a, b, c, d, ...]) + 'Array | Matrix': function (array) { + return _var(array, DEFAULT_NORMALIZATION); + }, + // variance([a, b, c, d, ...], normalization) + 'Array | Matrix, string': _var, + // variance([a, b, c, c, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + return _varDim(array, dim, DEFAULT_NORMALIZATION); + }, + // variance([a, b, c, c, ...], dim, normalization) + 'Array | Matrix, number | BigNumber, string': _varDim, + // variance(a, b, c, d, ...) + '...': function (args) { + return _var(args, DEFAULT_NORMALIZATION); + } + }); + + /** + * Recursively calculate the variance of an n-dimensional array + * @param {Array} array + * @param {string} normalization + * Determines how to normalize the variance: + * - 'unbiased' The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * @return {number | BigNumber} variance + * @private + */ + function _var(array, normalization) { + let sum; + let num = 0; + if (array.length === 0) { + throw new SyntaxError('Function variance requires one or more parameters (0 provided)'); + } + + // calculate the mean and number of elements + (0, _collection.deepForEach)(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + num++; + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'variance', value); + } + }); + if (num === 0) throw new Error('Cannot calculate variance of an empty array'); + const mean = divide(sum, num); + + // calculate the variance + sum = undefined; + (0, _collection.deepForEach)(array, function (value) { + const diff = subtract(value, mean); + sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff)); + }); + if (isNaN(sum)) { + return sum; + } + switch (normalization) { + case 'uncorrected': + return divide(sum, num); + case 'biased': + return divide(sum, num + 1); + case 'unbiased': + { + const zero = (0, _is.isBigNumber)(sum) ? sum.mul(0) : 0; + return num === 1 ? zero : divide(sum, num - 1); + } + default: + throw new Error('Unknown normalization "' + normalization + '". ' + 'Choose "unbiased" (default), "uncorrected", or "biased".'); + } + } + function _varDim(array, dim, normalization) { + try { + if (array.length === 0) { + throw new SyntaxError('Function variance requires one or more parameters (0 provided)'); + } + return apply(array, dim, x => _var(x, normalization)); + } catch (err) { + throw (0, _improveErrorMessage.improveErrorMessage)(err, 'variance'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/bin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/bin.js new file mode 100644 index 0000000..15fb683 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/bin.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBin = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'bin'; +const dependencies = ['typed', 'format']; + +/** + * Format a number as binary. + * + * Syntax: + * + * math.bin(value) + * + * Examples: + * + * //the following outputs "0b10" + * math.bin(2) + * + * See also: + * + * oct + * hex + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ +const createBin = exports.createBin = (0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function (n) { + return format(n, { + notation: 'bin' + }); + }, + 'number | BigNumber, number | BigNumber': function (n, wordSize) { + return format(n, { + notation: 'bin', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/format.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/format.js new file mode 100644 index 0000000..8c5db61 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/format.js @@ -0,0 +1,137 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFormat = void 0; +var _string = require("../../utils/string.js"); +var _factory = require("../../utils/factory.js"); +const name = 'format'; +const dependencies = ['typed']; +const createFormat = exports.createFormat = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Format a value of any type into a string. + * + * Syntax: + * + * math.format(value) + * math.format(value, options) + * math.format(value, precision) + * math.format(value, callback) + * + * Where: + * + * - `value: *` + * The value to be formatted + * - `options: Object` + * An object with formatting options. Available options: + * - `notation: string` + * Number notation. Choose from: + * - `'fixed'` + * Always use regular number notation. + * For example `'123.40'` and `'14000000'` + * - `'exponential'` + * Always use exponential notation. + * For example `'1.234e+2'` and `'1.4e+7'` + * - `'engineering'` + * Always use engineering notation: always have exponential notation, + * and select the exponent to be a multiple of `3`. + * For example `'123.4e+0'` and `'14.0e+6'` + * - `'auto'` (default) + * Regular number notation for numbers having an absolute value between + * `lower` and `upper` bounds, and uses exponential notation elsewhere. + * Lower bound is included, upper bound is excluded. + * For example `'123.4'` and `'1.4e7'`. + * - `'bin'`, `'oct'`, or `'hex'` + * Format the number using binary, octal, or hexadecimal notation. + * For example `'0b1101'` and `'0x10fe'`. + * - `wordSize: number | BigNumber` + * The word size in bits to use for formatting in binary, octal, or + * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'` + * values for `notation` option. When this option is defined the value + * is formatted as a signed twos complement integer of the given word + * size and the size suffix is appended to the output. + * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`. + * Default value is undefined. + * - `precision: number | BigNumber` + * Limit the number of digits of the formatted value. + * For regular numbers, must be a number between `0` and `16`. + * For bignumbers, the maximum depends on the configured precision, + * see function `config()`. + * In case of notations `'exponential'`, `'engineering'`, and `'auto'`, + * `precision` defines the total number of significant digits returned. + * In case of notation `'fixed'`, `precision` defines the number of + * significant digits after the decimal point. + * `precision` is undefined by default. + * - `lowerExp: number` + * Exponent determining the lower boundary for formatting a value with + * an exponent when `notation='auto'`. Default value is `-3`. + * - `upperExp: number` + * Exponent determining the upper boundary for formatting a value with + * an exponent when `notation='auto'`. Default value is `5`. + * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`. + * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'` + * is configured, and will output `'0.(3)'` when `'decimal'` is configured. + * - `truncate: number`. Specifies the maximum allowed length of the + * returned string. If it had been longer, the excess characters + * are deleted and replaced with `'...'`. + * - `callback: function` + * A custom formatting function, invoked for all numeric elements in `value`, + * for example all elements of a matrix, or the real and imaginary + * parts of a complex number. This callback can be used to override the + * built-in numeric notation with any type of formatting. Function `callback` + * is called with `value` as parameter and must return a string. + * + * When `value` is an Object: + * + * - When the object contains a property `format` being a function, this function + * is invoked as `value.format(options)` and the result is returned. + * - When the object has its own `toString` method, this method is invoked + * and the result is returned. + * - In other cases the function will loop over all object properties and + * return JSON object notation like '{"a": 2, "b": 3}'. + * + * When value is a function: + * + * - When the function has a property `syntax`, it returns this + * syntax description. + * - In other cases, a string `'function'` is returned. + * + * Examples: + * + * math.format(6.4) // returns '6.4' + * math.format(1240000) // returns '1.24e+6' + * math.format(1/3) // returns '0.3333333333333333' + * math.format(1/3, 3) // returns '0.333' + * math.format(21385, 2) // returns '21000' + * math.format(12e8, {notation: 'fixed'}) // returns '1200000000' + * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000' + * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1' + * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3' + * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3' + * + * function formatCurrency(value) { + * // return currency notation with two digits: + * return '$' + value.toFixed(2) + * + * // you could also use math.format inside the callback: + * // return '$' + math.format(value, {notation: 'fixed', precision: 2}) + * } + * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]' + * + * See also: + * + * print + * + * @param {*} value Value to be stringified + * @param {Object | Function | number} [options] Formatting options + * @return {string} The formatted value + */ + return typed(name, { + any: _string.format, + 'any, Object | function | number | BigNumber': _string.format + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/hex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/hex.js new file mode 100644 index 0000000..bfad623 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/hex.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createHex = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'hex'; +const dependencies = ['typed', 'format']; + +/** + * Format a number as hexadecimal. + * + * Syntax: + * + * math.hex(value) + * + * Examples: + * + * math.hex(240) // returns "0xF0" + * + * See also: + * + * oct + * bin + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ +const createHex = exports.createHex = (0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function (n) { + return format(n, { + notation: 'hex' + }); + }, + 'number | BigNumber, number | BigNumber': function (n, wordSize) { + return format(n, { + notation: 'hex', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/oct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/oct.js new file mode 100644 index 0000000..1330914 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/oct.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createOct = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'oct'; +const dependencies = ['typed', 'format']; + +/** + * Format a number as octal. + * + * Syntax: + * + * math.oct(value) + * + * Examples: + * + * //the following outputs "0o70" + * math.oct(56) + * + * See also: + * + * bin + * hex + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ + +const createOct = exports.createOct = (0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function (n) { + return format(n, { + notation: 'oct' + }); + }, + 'number | BigNumber, number | BigNumber': function (n, wordSize) { + return format(n, { + notation: 'oct', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/print.js new file mode 100644 index 0000000..6afddad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/string/print.js @@ -0,0 +1,96 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createPrint = void 0; +var _string = require("../../utils/string.js"); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _print2 = require("../../utils/print.js"); +const name = 'print'; +const dependencies = ['typed']; +const createPrint = exports.createPrint = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Interpolate values into a string template. + * + * Syntax: + * + * math.print(template, values) + * math.print(template, values, precision) + * math.print(template, values, options) + * + * Example usage: + * + * // the following outputs: 'Lucy is 5 years old' + * math.print('Lucy is $age years old', {age: 5}) + * + * // the following outputs: 'The value of pi is 3.141592654' + * math.print('The value of pi is $pi', {pi: math.pi}, 10) + * + * // the following outputs: 'hello Mary! The date is 2013-03-23' + * math.print('Hello $user.name! The date is $date', { + * user: { + * name: 'Mary', + * }, + * date: new Date(2013, 2, 23).toISOString().substring(0, 10) + * }) + * + * // the following outputs: 'My favorite fruits are apples and bananas !' + * math.print('My favorite fruits are $0 and $1 !', [ + * 'apples', + * 'bananas' + * ]) + * + * See also: + * + * format + * + * @param {string} template A string containing variable placeholders. + * @param {Object | Array | Matrix} values An object or array containing variables + * which will be filled in in the template. + * @param {number | Object} [options] Formatting options, + * or the number of digits to format numbers. + * See function math.format for a description + * of all options. + * @return {string} Interpolated string + */ + return typed(name, { + // note: Matrix will be converted automatically to an Array + 'string, Object | Array': _print, + 'string, Object | Array, number | Object': _print + }); +}); + +/** + * Interpolate values into a string template. + * @param {string} template + * @param {Object} values + * @param {number | Object} [options] + * @returns {string} Interpolated string + * @private + */ +function _print(template, values, options) { + return template.replace(_print2.printTemplate, function (original, key) { + const keys = key.split('.'); + let value = values[keys.shift()]; + if (value !== undefined && value.isMatrix) { + value = value.toArray(); + } + while (keys.length && value !== undefined) { + const k = keys.shift(); + value = k ? value[k] : value + '.'; + } + if (value !== undefined) { + if (!(0, _is.isString)(value)) { + return (0, _string.format)(value, options); + } else { + return value; + } + } + return original; + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js new file mode 100644 index 0000000..1d028c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcos = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'acos'; +const dependencies = ['typed', 'config', 'Complex']; +const createAcos = exports.createAcos = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the inverse cosine of a value. + * + * To avoid confusion with the matrix arccosine, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acos(x) + * + * Examples: + * + * math.acos(0.5) // returns number 1.0471975511965979 + * math.acos(math.cos(1.5)) // returns number 1.5 + * + * math.acos(2) // returns Complex 0 + 1.3169578969248166 i + * + * See also: + * + * cos, atan, asin + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc cosine of x + */ + return typed(name, { + number: function (x) { + if (x >= -1 && x <= 1 || config.predictable) { + return Math.acos(x); + } else { + return new Complex(x, 0).acos(); + } + }, + Complex: function (x) { + return x.acos(); + }, + BigNumber: function (x) { + return x.acos(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js new file mode 100644 index 0000000..38a2212 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcosh = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'acosh'; +const dependencies = ['typed', 'config', 'Complex']; +const createAcosh = exports.createAcosh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the hyperbolic arccos of a value, + * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.acosh(x) + * + * Examples: + * + * math.acosh(1.5) // returns 0.9624236501192069 + * + * See also: + * + * cosh, asinh, atanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccosine of x + */ + return typed(name, { + number: function (x) { + if (x >= 1 || config.predictable) { + return (0, _index.acoshNumber)(x); + } + if (x <= -1) { + return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI); + } + return new Complex(x, 0).acosh(); + }, + Complex: function (x) { + return x.acosh(); + }, + BigNumber: function (x) { + return x.acosh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js new file mode 100644 index 0000000..6557853 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcot = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'acot'; +const dependencies = ['typed', 'BigNumber']; +const createAcot = exports.createAcot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`. + * + * To avoid confusion with the matrix arccotanget, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acot(x) + * + * Examples: + * + * math.acot(0.5) // returns number 1.1071487177940904 + * math.acot(2) // returns number 0.4636476090008061 + * math.acot(math.cot(1.5)) // returns number 1.5 + * + * See also: + * + * cot, atan + * + * @param {number | BigNumber| Complex} x Function input + * @return {number | BigNumber| Complex} The arc cotangent of x + */ + return typed(name, { + number: _index.acotNumber, + Complex: function (x) { + return x.acot(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).atan(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js new file mode 100644 index 0000000..2a366f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcoth = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'acoth'; +const dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +const createAcoth = exports.createAcoth = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex, + BigNumber + } = _ref; + /** + * Calculate the inverse hyperbolic tangent of a value, + * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`. + * + * To avoid confusion with the matrix inverse hyperbolic tangent, this + * function does not apply to matrices. + * + * Syntax: + * + * math.acoth(x) + * + * Examples: + * + * math.acoth(0.5) // returns 0.8047189562170503 + * + * See also: + * + * acsch, asech + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x + */ + return typed(name, { + number: function (x) { + if (x >= 1 || x <= -1 || config.predictable) { + return (0, _index.acothNumber)(x); + } + return new Complex(x, 0).acoth(); + }, + Complex: function (x) { + return x.acoth(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).atanh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js new file mode 100644 index 0000000..43a4caf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcsc = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'acsc'; +const dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +const createAcsc = exports.createAcsc = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex, + BigNumber + } = _ref; + /** + * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`. + * + * To avoid confusion with the matrix arccosecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acsc(x) + * + * Examples: + * + * math.acsc(2) // returns 0.5235987755982989 + * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i + * math.acsc(math.csc(1.5)) // returns number ~1.5 + * + * See also: + * + * csc, asin, asec + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc cosecant of x + */ + return typed(name, { + number: function (x) { + if (x <= -1 || x >= 1 || config.predictable) { + return (0, _index.acscNumber)(x); + } + return new Complex(x, 0).acsc(); + }, + Complex: function (x) { + return x.acsc(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).asin(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js new file mode 100644 index 0000000..e107e5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAcsch = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'acsch'; +const dependencies = ['typed', 'BigNumber']; +const createAcsch = exports.createAcsch = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Calculate the inverse hyperbolic cosecant of a value, + * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`. + * + * To avoid confusion with the matrix inverse hyperbolic cosecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.acsch(x) + * + * Examples: + * + * math.acsch(0.5) // returns 1.4436354751788103 + * + * See also: + * + * asech, acoth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x + */ + return typed(name, { + number: _index.acschNumber, + Complex: function (x) { + return x.acsch(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).asinh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js new file mode 100644 index 0000000..0c12783 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAsec = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'asec'; +const dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +const createAsec = exports.createAsec = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex, + BigNumber + } = _ref; + /** + * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`. + * + * To avoid confusion with the matrix arcsecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.asec(x) + * + * Examples: + * + * math.asec(2) // returns 1.0471975511965979 + * math.asec(math.sec(1.5)) // returns 1.5 + * + * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i + * + * See also: + * + * acos, acot, acsc + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc secant of x + */ + return typed(name, { + number: function (x) { + if (x <= -1 || x >= 1 || config.predictable) { + return (0, _index.asecNumber)(x); + } + return new Complex(x, 0).asec(); + }, + Complex: function (x) { + return x.asec(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).acos(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js new file mode 100644 index 0000000..de716ce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAsech = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'asech'; +const dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +const createAsech = exports.createAsech = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex, + BigNumber + } = _ref; + /** + * Calculate the hyperbolic arcsecant of a value, + * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`. + * + * To avoid confusion with the matrix hyperbolic arcsecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.asech(x) + * + * Examples: + * + * math.asech(0.5) // returns 1.3169578969248166 + * + * See also: + * + * acsch, acoth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x + */ + return typed(name, { + number: function (x) { + if (x <= 1 && x >= -1 || config.predictable) { + const xInv = 1 / x; + if (xInv > 0 || config.predictable) { + return (0, _index.asechNumber)(x); + } + const ret = Math.sqrt(xInv * xInv - 1); + return new Complex(Math.log(ret - xInv), Math.PI); + } + return new Complex(x, 0).asech(); + }, + Complex: function (x) { + return x.asech(); + }, + BigNumber: function (x) { + return new BigNumber(1).div(x).acosh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js new file mode 100644 index 0000000..123b3e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAsin = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'asin'; +const dependencies = ['typed', 'config', 'Complex']; +const createAsin = exports.createAsin = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the inverse sine of a value. + * + * To avoid confusion with the matric arcsine, this function does not apply + * to matrices. + * + * Syntax: + * + * math.asin(x) + * + * Examples: + * + * math.asin(0.5) // returns number 0.5235987755982989 + * math.asin(math.sin(1.5)) // returns number ~1.5 + * + * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i + * + * See also: + * + * sin, atan, acos + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc sine of x + */ + return typed(name, { + number: function (x) { + if (x >= -1 && x <= 1 || config.predictable) { + return Math.asin(x); + } else { + return new Complex(x, 0).asin(); + } + }, + Complex: function (x) { + return x.asin(); + }, + BigNumber: function (x) { + return x.asin(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js new file mode 100644 index 0000000..e0df5cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAsinh = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'asinh'; +const dependencies = ['typed']; +const createAsinh = exports.createAsinh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the hyperbolic arcsine of a value, + * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`. + * + * To avoid confusion with the matrix hyperbolic arcsine, this function + * does not apply to matrices. + * + * Syntax: + * + * math.asinh(x) + * + * Examples: + * + * math.asinh(0.5) // returns 0.48121182505960347 + * + * See also: + * + * acosh, atanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arcsine of x + */ + return typed('asinh', { + number: _index.asinhNumber, + Complex: function (x) { + return x.asinh(); + }, + BigNumber: function (x) { + return x.asinh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js new file mode 100644 index 0000000..d1ef90d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAtan = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'atan'; +const dependencies = ['typed']; +const createAtan = exports.createAtan = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the inverse tangent of a value. + * + * To avoid confusion with matrix arctangent, this function does not apply + * to matrices. + * + * Syntax: + * + * math.atan(x) + * + * Examples: + * + * math.atan(0.5) // returns number 0.4636476090008061 + * math.atan(2) // returns number 1.1071487177940904 + * math.atan(math.tan(1.5)) // returns number 1.5 + * + * See also: + * + * tan, asin, acos + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc tangent of x + */ + return typed('atan', { + number: function (x) { + return Math.atan(x); + }, + Complex: function (x) { + return x.atan(); + }, + BigNumber: function (x) { + return x.atan(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js new file mode 100644 index 0000000..213382d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js @@ -0,0 +1,95 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAtan2 = void 0; +var _factory = require("../../utils/factory.js"); +var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js"); +var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); +var _matAlgo09xS0Sf = require("../../type/matrix/utils/matAlgo09xS0Sf.js"); +var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js"); +var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'atan2'; +const dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat']; +const createAtan2 = exports.createAtan2 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + equalScalar, + BigNumber, + DenseMatrix, + concat + } = _ref; + const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ + typed, + equalScalar + }); + const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ + typed + }); + const matAlgo09xS0Sf = (0, _matAlgo09xS0Sf.createMatAlgo09xS0Sf)({ + typed, + equalScalar + }); + const matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({ + typed, + equalScalar + }); + const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ + typed, + DenseMatrix + }); + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Calculate the inverse tangent function with two arguments, y/x. + * By providing two arguments, the right quadrant of the computed angle can be + * determined. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.atan2(y, x) + * + * Examples: + * + * math.atan2(2, 2) / math.pi // returns number 0.25 + * + * const angle = math.unit(60, 'deg') // returns Unit 60 deg + * const x = math.cos(angle) + * const y = math.sin(angle) + * + * math.atan(2) // returns number 1.1071487177940904 + * + * See also: + * + * tan, atan, sin, cos + * + * @param {number | Array | Matrix} y Second dimension + * @param {number | Array | Matrix} x First dimension + * @return {number | Array | Matrix} Four-quadrant inverse tangent + */ + return typed(name, { + 'number, number': Math.atan2, + // Complex numbers doesn't seem to have a reasonable implementation of + // atan2(). Even Matlab removed the support, after they only calculated + // the atan only on base of the real part of the numbers and ignored + // the imaginary. + + 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x) + }, matrixAlgorithmSuite({ + scalar: 'number | BigNumber', + SS: matAlgo09xS0Sf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js new file mode 100644 index 0000000..4f58486 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createAtanh = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'atanh'; +const dependencies = ['typed', 'config', 'Complex']; +const createAtanh = exports.createAtanh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config, + Complex + } = _ref; + /** + * Calculate the hyperbolic arctangent of a value, + * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`. + * + * To avoid confusion with the matrix hyperbolic arctangent, this function + * does not apply to matrices. + * + * Syntax: + * + * math.atanh(x) + * + * Examples: + * + * math.atanh(0.5) // returns 0.5493061443340549 + * + * See also: + * + * acosh, asinh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arctangent of x + */ + return typed(name, { + number: function (x) { + if (x <= 1 && x >= -1 || config.predictable) { + return (0, _index.atanhNumber)(x); + } + return new Complex(x, 0).atanh(); + }, + Complex: function (x) { + return x.atanh(); + }, + BigNumber: function (x) { + return x.atanh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js new file mode 100644 index 0000000..a6eb83c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCos = void 0; +var _factory = require("../../utils/factory.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'cos'; +const dependencies = ['typed']; +const createCos = exports.createCos = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the cosine of a value. + * + * To avoid confusion with the matrix cosine, this function does not + * apply to matrices. + * + * Syntax: + * + * math.cos(x) + * + * Examples: + * + * math.cos(2) // returns number -0.4161468365471422 + * math.cos(math.pi / 4) // returns number 0.7071067811865475 + * math.cos(math.unit(180, 'deg')) // returns number -1 + * math.cos(math.unit(60, 'deg')) // returns number 0.5 + * + * const angle = 0.2 + * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1 + * + * See also: + * + * cos, tan + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Cosine of x + */ + return typed(name, { + number: Math.cos, + 'Complex | BigNumber': x => x.cos() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js new file mode 100644 index 0000000..1185bea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCosh = void 0; +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +const name = 'cosh'; +const dependencies = ['typed']; +const createCosh = exports.createCosh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the hyperbolic cosine of a value, + * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`. + * + * To avoid confusion with the matrix hyperbolic cosine, this function does + * not apply to matrices. + * + * Syntax: + * + * math.cosh(x) + * + * Examples: + * + * math.cosh(0.5) // returns number 1.1276259652063807 + * + * See also: + * + * sinh, tanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cosine of x + */ + return typed(name, { + number: _number.cosh, + 'Complex | BigNumber': x => x.cosh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js new file mode 100644 index 0000000..3db5309 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCot = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'cot'; +const dependencies = ['typed', 'BigNumber']; +const createCot = exports.createCot = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`. + * + * To avoid confusion with the matrix cotangent, this function does not + * apply to matrices. + * + * Syntax: + * + * math.cot(x) + * + * Examples: + * + * math.cot(2) // returns number -0.45765755436028577 + * 1 / math.tan(2) // returns number -0.45765755436028577 + * + * See also: + * + * tan, sec, csc + * + * @param {number | Complex | Unit | Array | Matrix} x Function input + * @return {number | Complex | Array | Matrix} Cotangent of x + */ + return typed(name, { + number: _index.cotNumber, + Complex: x => x.cot(), + BigNumber: x => new BigNumber(1).div(x.tan()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js new file mode 100644 index 0000000..6471792 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCoth = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'coth'; +const dependencies = ['typed', 'BigNumber']; +const createCoth = exports.createCoth = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Calculate the hyperbolic cotangent of a value, + * defined as `coth(x) = 1 / tanh(x)`. + * + * To avoid confusion with the matrix hyperbolic cotangent, this function + * does not apply to matrices. + * + * Syntax: + * + * math.coth(x) + * + * Examples: + * + * // coth(x) = 1 / tanh(x) + * math.coth(2) // returns 1.0373147207275482 + * 1 / math.tanh(2) // returns 1.0373147207275482 + * + * See also: + * + * sinh, tanh, cosh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cotangent of x + */ + return typed(name, { + number: _index.cothNumber, + Complex: x => x.coth(), + BigNumber: x => new BigNumber(1).div(x.tanh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js new file mode 100644 index 0000000..738de7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsc = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'csc'; +const dependencies = ['typed', 'BigNumber']; +const createCsc = exports.createCsc = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`. + * + * To avoid confusion with the matrix cosecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.csc(x) + * + * Examples: + * + * math.csc(2) // returns number 1.099750170294617 + * 1 / math.sin(2) // returns number 1.099750170294617 + * + * See also: + * + * sin, sec, cot + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Cosecant of x + */ + return typed(name, { + number: _index.cscNumber, + Complex: x => x.csc(), + BigNumber: x => new BigNumber(1).div(x.sin()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js new file mode 100644 index 0000000..e538e34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCsch = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'csch'; +const dependencies = ['typed', 'BigNumber']; +const createCsch = exports.createCsch = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Calculate the hyperbolic cosecant of a value, + * defined as `csch(x) = 1 / sinh(x)`. + * + * To avoid confusion with the matrix hyperbolic cosecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.csch(x) + * + * Examples: + * + * // csch(x) = 1/ sinh(x) + * math.csch(0.5) // returns 1.9190347513349437 + * 1 / math.sinh(0.5) // returns 1.9190347513349437 + * + * See also: + * + * sinh, sech, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cosecant of x + */ + return typed(name, { + number: _index.cschNumber, + Complex: x => x.csch(), + BigNumber: x => new BigNumber(1).div(x.sinh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js new file mode 100644 index 0000000..a6a4daa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSec = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'sec'; +const dependencies = ['typed', 'BigNumber']; +const createSec = exports.createSec = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`. + * + * To avoid confusion with the matrix secant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.sec(x) + * + * Examples: + * + * math.sec(2) // returns number -2.4029979617223822 + * 1 / math.cos(2) // returns number -2.4029979617223822 + * + * See also: + * + * cos, csc, cot + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Secant of x + */ + return typed(name, { + number: _index.secNumber, + Complex: x => x.sec(), + BigNumber: x => new BigNumber(1).div(x.cos()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js new file mode 100644 index 0000000..91d464a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSech = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'sech'; +const dependencies = ['typed', 'BigNumber']; +const createSech = exports.createSech = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Calculate the hyperbolic secant of a value, + * defined as `sech(x) = 1 / cosh(x)`. + * + * To avoid confusion with the matrix hyperbolic secant, this function does + * not apply to matrices. + * + * Syntax: + * + * math.sech(x) + * + * Examples: + * + * // sech(x) = 1/ cosh(x) + * math.sech(0.5) // returns 0.886818883970074 + * 1 / math.cosh(0.5) // returns 0.886818883970074 + * + * See also: + * + * cosh, csch, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic secant of x + */ + return typed(name, { + number: _index.sechNumber, + Complex: x => x.sech(), + BigNumber: x => new BigNumber(1).div(x.cosh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js new file mode 100644 index 0000000..aad6735 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSin = void 0; +var _factory = require("../../utils/factory.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'sin'; +const dependencies = ['typed']; +const createSin = exports.createSin = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the sine of a value. + * + * To avoid confusion with the matrix sine, this function does not apply + * to matrices. + * + * Syntax: + * + * math.sin(x) + * + * Examples: + * + * math.sin(2) // returns number 0.9092974268256813 + * math.sin(math.pi / 4) // returns number 0.7071067811865475 + * math.sin(math.unit(90, 'deg')) // returns number 1 + * math.sin(math.unit(30, 'deg')) // returns number 0.5 + * + * const angle = 0.2 + * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1 + * + * See also: + * + * cos, tan + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Sine of x + */ + return typed(name, { + number: Math.sin, + 'Complex | BigNumber': x => x.sin() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js new file mode 100644 index 0000000..871d8f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSinh = void 0; +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'sinh'; +const dependencies = ['typed']; +const createSinh = exports.createSinh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the hyperbolic sine of a value, + * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`. + * + * To avoid confusion with the matrix hyperbolic sine, this function does + * not apply to matrices. + * + * Syntax: + * + * math.sinh(x) + * + * Examples: + * + * math.sinh(0.5) // returns number 0.5210953054937474 + * + * See also: + * + * cosh, tanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic sine of x + */ + return typed(name, { + number: _index.sinhNumber, + 'Complex | BigNumber': x => x.sinh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js new file mode 100644 index 0000000..f9ae346 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTan = void 0; +var _factory = require("../../utils/factory.js"); +var _trigUnit = require("./trigUnit.js"); +const name = 'tan'; +const dependencies = ['typed']; +const createTan = exports.createTan = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + const trigUnit = (0, _trigUnit.createTrigUnit)({ + typed + }); + + /** + * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`. + * + * To avoid confusion with the matrix tangent, this function does not apply + * to matrices. + * + * Syntax: + * + * math.tan(x) + * + * Examples: + * + * math.tan(0.5) // returns number 0.5463024898437905 + * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905 + * math.tan(math.pi / 4) // returns number 1 + * math.tan(math.unit(45, 'deg')) // returns number 1 + * + * See also: + * + * atan, sin, cos + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Tangent of x + */ + return typed(name, { + number: Math.tan, + 'Complex | BigNumber': x => x.tan() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js new file mode 100644 index 0000000..02e32f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTanh = void 0; +var _factory = require("../../utils/factory.js"); +var _number = require("../../utils/number.js"); +const name = 'tanh'; +const dependencies = ['typed']; +const createTanh = exports.createTanh = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Calculate the hyperbolic tangent of a value, + * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`. + * + * To avoid confusion with matrix hyperbolic tangent, this function does + * not apply to matrices. + * + * Syntax: + * + * math.tanh(x) + * + * Examples: + * + * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x) + * math.tanh(0.5) // returns 0.46211715726000974 + * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974 + * 1 / math.coth(0.5) // returns 0.46211715726000974 + * + * See also: + * + * sinh, cosh, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic tangent of x + */ + return typed('tanh', { + number: _number.tanh, + 'Complex | BigNumber': x => x.tanh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js new file mode 100644 index 0000000..ae62dc5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTrigUnit = void 0; +var _factory = require("../../utils/factory.js"); +const createTrigUnit = exports.createTrigUnit = /* #__PURE__ */(0, _factory.factory)('trigUnit', ['typed'], _ref => { + let { + typed + } = _ref; + return { + Unit: typed.referToSelf(self => x => { + if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { + throw new TypeError('Unit in function cot is no angle'); + } + return typed.find(self, x.valueType())(x.value); + }) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/unit/to.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/unit/to.js new file mode 100644 index 0000000..d660324 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/unit/to.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTo = void 0; +var _factory = require("../../utils/factory.js"); +var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); +const name = 'to'; +const dependencies = ['typed', 'matrix', 'concat']; +const createTo = exports.createTo = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix, + concat + } = _ref; + const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ + typed, + matrix, + concat + }); + + /** + * Change the unit of a value. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.to(x, unit) + * + * Examples: + * + * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm + * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm + * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits + * + * See also: + * + * unit + * + * @param {Unit | Array | Matrix} x The unit to be converted. + * @param {Unit | Array | Matrix} unit New unit. Can be a string like "cm" + * or a unit without value. + * @return {Unit | Array | Matrix} value with changed, fixed unit. + */ + return typed(name, { + 'Unit, Unit | string': (x, unit) => x.to(unit) + }, matrixAlgorithmSuite({ + Ds: true + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/clone.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/clone.js new file mode 100644 index 0000000..4bc2548 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/clone.js @@ -0,0 +1,36 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createClone = void 0; +var _object = require("../../utils/object.js"); +var _factory = require("../../utils/factory.js"); +const name = 'clone'; +const dependencies = ['typed']; +const createClone = exports.createClone = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Clone an object. Will make a deep copy of the data. + * + * Syntax: + * + * math.clone(x) + * + * Examples: + * + * math.clone(3.5) // returns number 3.5 + * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i + * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg + * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]] + * math.clone("hello world") // returns string "hello world" + * + * @param {*} x Object to be cloned + * @return {*} A clone of object x + */ + return typed(name, { + any: _object.clone + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js new file mode 100644 index 0000000..223171a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createHasNumericValue = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'hasNumericValue'; +const dependencies = ['typed', 'isNumeric']; +const createHasNumericValue = exports.createHasNumericValue = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + isNumeric + } = _ref; + /** + * Test whether a value is an numeric value. + * + * In case of a string, true is returned if the string contains a numeric value. + * + * Syntax: + * + * math.hasNumericValue(x) + * + * Examples: + * + * math.hasNumericValue(2) // returns true + * math.hasNumericValue('2') // returns true + * math.isNumeric('2') // returns false + * math.hasNumericValue(0) // returns true + * math.hasNumericValue(math.bignumber('500')) // returns true + * math.hasNumericValue(math.bigint('42')) // returns true + * math.hasNumericValue(42n) // returns true + * math.hasNumericValue(math.fraction(4)) // returns true + * math.hasNumericValue(math.complex('2-4i')) // returns false + * math.hasNumericValue(false) // returns true + * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true] + * + * See also: + * + * isZero, isPositive, isNegative, isInteger, isNumeric + * + * @param {*} x Value to be tested + * @return {boolean} Returns true when `x` is a `number`, `BigNumber`, + * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types. + * Throws an error in case of unknown types. + */ + return typed(name, { + boolean: () => true, + string: function (x) { + return x.trim().length > 0 && !isNaN(Number(x)); + }, + any: function (x) { + return isNumeric(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isInteger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isInteger.js new file mode 100644 index 0000000..a1c82a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isInteger.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsInteger = void 0; +var _collection = require("../../utils/collection.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'isInteger'; +const dependencies = ['typed']; +const createIsInteger = exports.createIsInteger = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Test whether a value is an integer number. + * The function supports `number`, `BigNumber`, and `Fraction`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isInteger(x) + * + * Examples: + * + * math.isInteger(2) // returns true + * math.isInteger(0) // returns true + * math.isInteger(0.5) // returns false + * math.isInteger(math.bignumber(500)) // returns true + * math.isInteger(math.fraction(4)) // returns true + * math.isInteger('3') // returns true + * math.isInteger([3, 0.5, -2]) // returns [true, false, true] + * math.isInteger(math.complex('2-4i')) // throws an error + * + * See also: + * + * isNumeric, isPositive, isNegative, isZero + * + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` contains a numeric, integer value. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: _number.isInteger, + // TODO: what to do with isInteger(add(0.1, 0.2)) ? + + BigNumber: function (x) { + return x.isInt(); + }, + bigint: function (x) { + return true; + }, + Fraction: function (x) { + return x.d === 1 && isFinite(x.n); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNaN.js new file mode 100644 index 0000000..5c6678a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNaN.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsNaN = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +const name = 'isNaN'; +const dependencies = ['typed']; +const createIsNaN = exports.createIsNaN = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Test whether a value is NaN (not a number). + * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNaN(x) + * + * Examples: + * + * math.isNaN(3) // returns false + * math.isNaN(NaN) // returns true + * math.isNaN(0) // returns false + * math.isNaN(math.bignumber(NaN)) // returns true + * math.isNaN(math.bignumber(0)) // returns false + * math.isNaN(math.fraction(-2, 5)) // returns false + * math.isNaN('-2') // returns false + * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true] + * + * See also: + * + * isNumeric, isNegative, isPositive, isZero, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is NaN. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: _index.isNaNNumber, + BigNumber: function (x) { + return x.isNaN(); + }, + bigint: function (x) { + return false; + }, + Fraction: function (x) { + return false; + }, + Complex: function (x) { + return x.isNaN(); + }, + Unit: function (x) { + return Number.isNaN(x.value); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNegative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNegative.js new file mode 100644 index 0000000..d647d3e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNegative.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsNegative = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +const name = 'isNegative'; +const dependencies = ['typed', 'config']; +const createIsNegative = exports.createIsNegative = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config + } = _ref; + /** + * Test whether a value is negative: smaller than zero. + * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNegative(x) + * + * Examples: + * + * math.isNegative(3) // returns false + * math.isNegative(-2) // returns true + * math.isNegative(0) // returns false + * math.isNegative(-0) // returns false + * math.isNegative(math.bignumber(2)) // returns false + * math.isNegative(math.fraction(-2, 5)) // returns true + * math.isNegative('-2') // returns true + * math.isNegative([2, 0, -3]) // returns [false, false, true] + * + * See also: + * + * isNumeric, isPositive, isZero, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: x => (0, _number.nearlyEqual)(x, 0, config.relTol, config.absTol) ? false : (0, _index.isNegativeNumber)(x), + BigNumber: x => (0, _nearlyEqual.nearlyEqual)(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(), + bigint: x => x < 0n, + Fraction: x => x.s < 0, + // It's enough to decide on the sign + + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js new file mode 100644 index 0000000..49c2bea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsNumeric = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'isNumeric'; +const dependencies = ['typed']; +const createIsNumeric = exports.createIsNumeric = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Test whether a value is an numeric value. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNumeric(x) + * + * Examples: + * + * math.isNumeric(2) // returns true + * math.isNumeric('2') // returns false + * math.hasNumericValue('2') // returns true + * math.isNumeric(0) // returns true + * math.isNumeric(math.bignumber('42')) // returns true + * math.isNumeric(math.bigint('42')) // returns true + * math.isNumeric(math.fraction(4)) // returns true + * math.isNumeric(math.complex('2-4i')) // returns false + * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true] + * + * See also: + * + * isZero, isPositive, isNegative, isInteger, hasNumericValue + * + * @param {*} x Value to be tested + * @return {boolean} Returns true when `x` is a `number`, `BigNumber`, + * `Fraction`, or `boolean`. Returns false for other types. + * Throws an error in case of unknown types. + */ + return typed(name, { + 'number | BigNumber | bigint | Fraction | boolean': () => true, + 'Complex | Unit | string | null | undefined | Node': () => false, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPositive.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPositive.js new file mode 100644 index 0000000..a980c60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPositive.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsPositive = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +var _index = require("../../plain/number/index.js"); +var _nearlyEqual = require("../../utils/bignumber/nearlyEqual.js"); +var _number = require("../../utils/number.js"); +const name = 'isPositive'; +const dependencies = ['typed', 'config']; +const createIsPositive = exports.createIsPositive = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + config + } = _ref; + /** + * Test whether a value is positive: larger than zero. + * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isPositive(x) + * + * Examples: + * + * math.isPositive(3) // returns true + * math.isPositive(-2) // returns false + * math.isPositive(0) // returns false + * math.isPositive(-0) // returns false + * math.isPositive(0.5) // returns true + * math.isPositive(math.bignumber(2)) // returns true + * math.isPositive(math.fraction(-2, 5)) // returns false + * math.isPositive(math.fraction(1, 3)) // returns true + * math.isPositive('2') // returns true + * math.isPositive([2, 0, -3]) // returns [true, false, false] + * + * See also: + * + * isNumeric, isZero, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: x => (0, _number.nearlyEqual)(x, 0, config.relTol, config.absTol) ? false : (0, _index.isPositiveNumber)(x), + BigNumber: x => (0, _nearlyEqual.nearlyEqual)(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(), + bigint: x => x > 0n, + Fraction: x => x.s > 0 && x.n > 0, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPrime.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPrime.js new file mode 100644 index 0000000..0f48389 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isPrime.js @@ -0,0 +1,136 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsPrime = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'isPrime'; +const dependencies = ['typed']; +const createIsPrime = exports.createIsPrime = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Test whether a value is prime: has no divisors other than itself and one. + * The function supports type `number`, `bignumber`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isPrime(x) + * + * Examples: + * + * math.isPrime(3) // returns true + * math.isPrime(-2) // returns false + * math.isPrime(0) // returns false + * math.isPrime(-0) // returns false + * math.isPrime(0.5) // returns false + * math.isPrime('2') // returns true + * math.isPrime([2, 17, 100]) // returns [true, true, false] + * + * See also: + * + * isNumeric, isZero, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: function (x) { + if (x <= 3) { + return x > 1; + } + if (x % 2 === 0 || x % 3 === 0) { + return false; + } + for (let i = 5; i * i <= x; i += 6) { + if (x % i === 0 || x % (i + 2) === 0) { + return false; + } + } + return true; + }, + bigint: function (x) { + if (x <= 3n) { + return x > 1n; + } + if (x % 2n === 0n || x % 3n === 0n) { + return false; + } + for (let i = 5n; i * i <= x; i += 6n) { + if (x % i === 0n || x % (i + 2n) === 0n) { + return false; + } + } + return true; + }, + BigNumber: function (n) { + if (n.lte(3)) return n.gt(1); + if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false; + if (n.lt(Math.pow(2, 32))) { + const x = n.toNumber(); + for (let i = 5; i * i <= x; i += 6) { + if (x % i === 0 || x % (i + 2) === 0) { + return false; + } + } + return true; + } + function modPow(base, exponent, modulus) { + // exponent can be huge, use non-recursive variant + let accumulator = 1; + while (!exponent.eq(0)) { + if (exponent.mod(2).eq(0)) { + exponent = exponent.div(2); + base = base.mul(base).mod(modulus); + } else { + exponent = exponent.sub(1); + accumulator = base.mul(accumulator).mod(modulus); + } + } + return accumulator; + } + + // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants + const Decimal = n.constructor.clone({ + precision: n.toFixed(0).length * 2 + }); + n = new Decimal(n); + let r = 0; + let d = n.sub(1); + while (d.mod(2).eq(0)) { + d = d.div(2); + r += 1; + } + let bases = null; + // https://en.wikipedia.org/wiki/Miller–Rabin_primality_test#Testing_against_small_sets_of_bases + if (n.lt('3317044064679887385961981')) { + bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n); + } else { + const max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2))); + bases = []; + for (let i = 2; i <= max; i += 1) { + bases.push(max); + } + } + for (let i = 0; i < bases.length; i += 1) { + const a = bases[i]; + const adn = modPow(n.sub(n).add(a), d, n); + if (!adn.eq(1)) { + for (let i = 0, x = adn; !x.eq(n.sub(1)); i += 1, x = x.mul(x).mod(n)) { + if (i === r - 1) { + return false; + } + } + } + } + return true; + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isZero.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isZero.js new file mode 100644 index 0000000..500b9c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/isZero.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIsZero = void 0; +var _collection = require("../../utils/collection.js"); +var _factory = require("../../utils/factory.js"); +const name = 'isZero'; +const dependencies = ['typed', 'equalScalar']; +const createIsZero = exports.createIsZero = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Test whether a value is zero. + * The function can check for zero for types `number`, `BigNumber`, `Fraction`, + * `Complex`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isZero(x) + * + * Examples: + * + * math.isZero(0) // returns true + * math.isZero(2) // returns false + * math.isZero(0.5) // returns false + * math.isZero(math.bignumber(0)) // returns true + * math.isZero(math.fraction(0)) // returns true + * math.isZero(math.fraction(1,3)) // returns false + * math.isZero(math.complex('2 - 4i')) // returns false + * math.isZero(math.complex('0i')) // returns true + * math.isZero('0') // returns true + * math.isZero('2') // returns false + * math.isZero([2, 0, -3]) // returns [false, true, false] + * + * See also: + * + * isNumeric, isPositive, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0), + bigint: x => x === 0n, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/numeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/numeric.js new file mode 100644 index 0000000..5ba80a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/numeric.js @@ -0,0 +1,81 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNumeric = void 0; +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _noop = require("../../utils/noop.js"); +const name = 'numeric'; +const dependencies = ['number', '?bignumber', '?fraction']; +const createNumeric = exports.createNumeric = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + number, + bignumber, + fraction + } = _ref; + const validInputTypes = { + string: true, + number: true, + BigNumber: true, + Fraction: true + }; + + // Load the conversion functions for each output type + const validOutputTypes = { + number: x => number(x), + BigNumber: bignumber ? x => bignumber(x) : _noop.noBignumber, + bigint: x => BigInt(x), + Fraction: fraction ? x => fraction(x) : _noop.noFraction + }; + + /** + * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction. + * + * Syntax: + * + * math.numeric(x) + * + * Examples: + * + * math.numeric('4') // returns 4 + * math.numeric('4', 'number') // returns 4 + * math.numeric('4', 'bigint') // returns 4n + * math.numeric('4', 'BigNumber') // returns BigNumber 4 + * math.numeric('4', 'Fraction') // returns Fraction 4 + * math.numeric(4, 'Fraction') // returns Fraction 4 + * math.numeric(math.fraction(2, 5), 'number') // returns 0.4 + * + * See also: + * + * number, fraction, bignumber, bigint, string, format + * + * @param {string | number | BigNumber | bigint | Fraction } value + * A numeric value or a string containing a numeric value + * @param {string} outputType + * Desired numeric output type. + * Available values: 'number', 'BigNumber', or 'Fraction' + * @return {number | BigNumber | bigint | Fraction} + * Returns an instance of the numeric in the requested type + */ + return function numeric(value) { + let outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number'; + let check = arguments.length > 2 ? arguments[2] : undefined; + if (check !== undefined) { + throw new SyntaxError('numeric() takes one or two arguments'); + } + const inputType = (0, _is.typeOf)(value); + if (!(inputType in validInputTypes)) { + throw new TypeError('Cannot convert ' + value + ' of type "' + inputType + '"; valid input types are ' + Object.keys(validInputTypes).join(', ')); + } + if (!(outputType in validOutputTypes)) { + throw new TypeError('Cannot convert ' + value + ' to type "' + outputType + '"; valid output types are ' + Object.keys(validOutputTypes).join(', ')); + } + if (outputType === inputType) { + return value; + } else { + return validOutputTypes[outputType](value); + } + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/typeOf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/typeOf.js new file mode 100644 index 0000000..701477e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/function/utils/typeOf.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTypeOf = void 0; +var _factory = require("../../utils/factory.js"); +var _is = require("../../utils/is.js"); +const name = 'typeOf'; +const dependencies = ['typed']; +const createTypeOf = exports.createTypeOf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Determine the type of an entity. + * + * Syntax: + * + * math.typeOf(x) + * + * Examples: + * + * // This list is intended to include all relevant types, for testing + * // purposes: + * math.typeOf(3.5) // returns 'number' + * math.typeOf(42n) // returns 'bigint' + * math.typeOf(math.complex('2-4i')) // returns 'Complex' + * math.typeOf(math.unit('45 deg')) // returns 'Unit' + * math.typeOf('hello world') // returns 'string' + * math.typeOf(null) // returns 'null' + * math.typeOf(true) // returns 'boolean' + * math.typeOf([1, 2, 3]) // returns 'Array' + * math.typeOf(new Date()) // returns 'Date' + * math.typeOf(function () {}) // returns 'function' + * math.typeOf({a: 2, b: 3}) // returns 'Object' + * math.typeOf(/a regexp/) // returns 'RegExp' + * math.typeOf(undefined) // returns 'undefined' + * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber' + * math.typeOf(math.chain(2)) // returns 'Chain' + * math.typeOf(math.fraction(1, 3)) // returns 'Fraction' + * math.typeOf(math.help('sqrt')) // returns 'Help' + * math.typeOf(math.index(1, 3)) // returns 'Index' + * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix' + * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix' + * math.typeOf(new math.Range(0, 10)) // returns 'Range' + * math.typeOf(math.evaluate('a=2\na')) // returns 'ResultSet' + * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode' + * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode' + * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode' + * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode' + * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode' + * math.typeOf(math.parse('2.3')) // returns 'ConstantNode' + * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode' + * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode' + * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode' + * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode' + * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode' + * math.typeOf(math.parse('1:10')) // returns 'RangeNode' + * math.typeOf(math.parse('a + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/index.js new file mode 100644 index 0000000..4b3a856 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/index.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _mainAny = require("./entry/mainAny.js"); +Object.keys(_mainAny).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _mainAny[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _mainAny[key]; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/replacer.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/replacer.js new file mode 100644 index 0000000..811a8b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/replacer.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createReplacer = void 0; +var _factory = require("../utils/factory.js"); +const name = 'replacer'; +const dependencies = []; +const createReplacer = exports.createReplacer = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * Stringify data types into their JSON representation. + * Most data types can be serialized using their `.toJSON` method, + * but not all, for example the number `Infinity`. For these cases you have + * to use the replacer. Example usage: + * + * JSON.stringify([2, Infinity], math.replacer) + * + * @param {string} key + * @param {*} value + * @returns {*} Returns the replaced object + */ + return function replacer(key, value) { + // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON + if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) { + return { + mathjs: 'number', + value: String(value) + }; + } + if (typeof value === 'bigint') { + return { + mathjs: 'bigint', + value: String(value) + }; + } + return value; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/reviver.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/reviver.js new file mode 100644 index 0000000..3e49405 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/json/reviver.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createReviver = void 0; +var _factory = require("../utils/factory.js"); +const name = 'reviver'; +const dependencies = ['classes']; +const createReviver = exports.createReviver = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + classes + } = _ref; + /** + * Instantiate mathjs data types from their JSON representation + * @param {string} key + * @param {*} value + * @returns {*} Returns the revived object + */ + return function reviver(key, value) { + const constructor = classes[value && value.mathjs]; + if (constructor && typeof constructor.fromJSON === 'function') { + return constructor.fromJSON(value); + } + return value; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/number.js new file mode 100644 index 0000000..8272a21 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/number.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _mainNumber = require("./entry/mainNumber.js"); +Object.keys(_mainNumber).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _mainNumber[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _mainNumber[key]; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/package.json b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js new file mode 100644 index 0000000..cd66883 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.absBigNumber = absBigNumber; +exports.addBigNumber = addBigNumber; +exports.divideBigNumber = divideBigNumber; +exports.multiplyBigNumber = multiplyBigNumber; +exports.subtractBigNumber = subtractBigNumber; +const signature1 = 'BigNumber'; +const signature2 = 'BigNumber, BigNumber'; +function absBigNumber(a) { + return a.abs(); +} +absBigNumber.signature = signature1; +function addBigNumber(a, b) { + return a.add(b); +} +addBigNumber.signature = signature2; +function subtractBigNumber(a, b) { + return a.sub(b); +} +subtractBigNumber.signature = signature2; +function multiplyBigNumber(a, b) { + return a.mul(b); +} +multiplyBigNumber.signature = signature2; +function divideBigNumber(a, b) { + return a.div(b); +} +divideBigNumber.signature = signature2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/index.js new file mode 100644 index 0000000..7b60254 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/bignumber/index.js @@ -0,0 +1,29 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + bignumber: true +}; +exports.bignumber = bignumber; +var _decimal = _interopRequireDefault(require("decimal.js")); +var _arithmetic = require("./arithmetic.js"); +Object.keys(_arithmetic).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _arithmetic[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _arithmetic[key]; + } + }); +}); +// TODO: this is ugly. Instead, be able to pass your own isBigNumber function to typed? +const BigNumber = _decimal.default.clone(); +BigNumber.prototype.isBigNumber = true; +function bignumber(x) { + return new BigNumber(x); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js new file mode 100644 index 0000000..1322dbf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js @@ -0,0 +1,334 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.absNumber = absNumber; +exports.addNumber = addNumber; +exports.cbrtNumber = cbrtNumber; +exports.cubeNumber = cubeNumber; +exports.divideNumber = divideNumber; +exports.expNumber = expNumber; +exports.expm1Number = expm1Number; +exports.gcdNumber = gcdNumber; +exports.lcmNumber = lcmNumber; +exports.log10Number = log10Number; +exports.log1pNumber = log1pNumber; +exports.log2Number = log2Number; +exports.logNumber = logNumber; +exports.modNumber = modNumber; +exports.multiplyNumber = multiplyNumber; +exports.normNumber = normNumber; +exports.nthRootNumber = nthRootNumber; +exports.powNumber = powNumber; +exports.roundNumber = roundNumber; +exports.signNumber = signNumber; +exports.sqrtNumber = sqrtNumber; +exports.squareNumber = squareNumber; +exports.subtractNumber = subtractNumber; +exports.unaryMinusNumber = unaryMinusNumber; +exports.unaryPlusNumber = unaryPlusNumber; +exports.xgcdNumber = xgcdNumber; +var _number = require("../../utils/number.js"); +const n1 = 'number'; +const n2 = 'number, number'; +function absNumber(a) { + return Math.abs(a); +} +absNumber.signature = n1; +function addNumber(a, b) { + return a + b; +} +addNumber.signature = n2; +function subtractNumber(a, b) { + return a - b; +} +subtractNumber.signature = n2; +function multiplyNumber(a, b) { + return a * b; +} +multiplyNumber.signature = n2; +function divideNumber(a, b) { + return a / b; +} +divideNumber.signature = n2; +function unaryMinusNumber(x) { + return -x; +} +unaryMinusNumber.signature = n1; +function unaryPlusNumber(x) { + return x; +} +unaryPlusNumber.signature = n1; +function cbrtNumber(x) { + return (0, _number.cbrt)(x); +} +cbrtNumber.signature = n1; +function cubeNumber(x) { + return x * x * x; +} +cubeNumber.signature = n1; +function expNumber(x) { + return Math.exp(x); +} +expNumber.signature = n1; +function expm1Number(x) { + return (0, _number.expm1)(x); +} +expm1Number.signature = n1; + +/** + * Calculate gcd for numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the greatest common denominator of a and b + */ +function gcdNumber(a, b) { + if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + let r; + while (b !== 0) { + r = a % b; + a = b; + b = r; + } + return a < 0 ? -a : a; +} +gcdNumber.signature = n2; + +/** + * Calculate lcm for two numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the least common multiple of a and b + */ +function lcmNumber(a, b) { + if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) { + throw new Error('Parameters in function lcm must be integer numbers'); + } + if (a === 0 || b === 0) { + return 0; + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + // evaluate lcm here inline to reduce overhead + let t; + const prod = a * b; + while (b !== 0) { + t = b; + b = a % t; + a = t; + } + return Math.abs(prod / a); +} +lcmNumber.signature = n2; + +/** + * Calculate the logarithm of a value, optionally to a given base. + * @param {number} x + * @param {number | null | undefined} base + * @return {number} + */ +function logNumber(x, y) { + if (y) { + return Math.log(x) / Math.log(y); + } + return Math.log(x); +} + +/** + * Calculate the 10-base logarithm of a number + * @param {number} x + * @return {number} + */ +function log10Number(x) { + return (0, _number.log10)(x); +} +log10Number.signature = n1; + +/** + * Calculate the 2-base logarithm of a number + * @param {number} x + * @return {number} + */ +function log2Number(x) { + return (0, _number.log2)(x); +} +log2Number.signature = n1; + +/** + * Calculate the natural logarithm of a `number+1` + * @param {number} x + * @returns {number} + */ +function log1pNumber(x) { + return (0, _number.log1p)(x); +} +log1pNumber.signature = n1; + +/** + * Calculate the modulus of two numbers + * @param {number} x + * @param {number} y + * @returns {number} res + * @private + */ +function modNumber(x, y) { + // We don't use JavaScript's % operator here as this doesn't work + // correctly for x < 0 and x === 0 + // see https://en.wikipedia.org/wiki/Modulo_operation + return y === 0 ? x : x - y * Math.floor(x / y); +} +modNumber.signature = n2; + +/** + * Calculate the nth root of a, solve x^root == a + * http://rosettacode.org/wiki/Nth_root#JavaScript + * @param {number} a + * @param {number} [2] root + * @private + */ +function nthRootNumber(a) { + let root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; + const inv = root < 0; + if (inv) { + root = -root; + } + if (root === 0) { + throw new Error('Root must be non-zero'); + } + if (a < 0 && Math.abs(root) % 2 !== 1) { + throw new Error('Root must be odd when a is negative.'); + } + + // edge cases zero and infinity + if (a === 0) { + return inv ? Infinity : 0; + } + if (!isFinite(a)) { + return inv ? 0 : a; + } + let x = Math.pow(Math.abs(a), 1 / root); + // If a < 0, we require that root is an odd integer, + // so (-1) ^ (1/root) = -1 + x = a < 0 ? -x : x; + return inv ? 1 / x : x; + + // Very nice algorithm, but fails with nthRoot(-2, 3). + // Newton's method has some well-known problems at times: + // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis + /* + let x = 1 // Initial guess + let xPrev = 1 + let i = 0 + const iMax = 10000 + do { + const delta = (a / Math.pow(x, root - 1) - x) / root + xPrev = x + x = x + delta + i++ + } + while (xPrev !== x && i < iMax) + if (xPrev !== x) { + throw new Error('Function nthRoot failed to converge') + } + return inv ? 1 / x : x + */ +} +function signNumber(x) { + return (0, _number.sign)(x); +} +signNumber.signature = n1; +function sqrtNumber(x) { + return Math.sqrt(x); +} +sqrtNumber.signature = n1; +function squareNumber(x) { + return x * x; +} +squareNumber.signature = n1; + +/** + * Calculate xgcd for two numbers + * @param {number} a + * @param {number} b + * @return {number} result + * @private + */ +function xgcdNumber(a, b) { + // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm + let t; // used to swap two variables + let q; // quotient + let r; // remainder + let x = 0; + let lastx = 1; + let y = 1; + let lasty = 0; + if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) { + throw new Error('Parameters in function xgcd must be integer numbers'); + } + while (b) { + q = Math.floor(a / b); + r = a - q * b; + t = x; + x = lastx - q * x; + lastx = t; + t = y; + y = lasty - q * y; + lasty = t; + a = b; + b = r; + } + let res; + if (a < 0) { + res = [-a, -lastx, -lasty]; + } else { + res = [a, a ? lastx : 0, lasty]; + } + return res; +} +xgcdNumber.signature = n2; + +/** + * Calculates the power of x to y, x^y, for two numbers. + * @param {number} x + * @param {number} y + * @return {number} res + */ +function powNumber(x, y) { + // x^Infinity === 0 if -1 < x < 1 + // A real number 0 is returned instead of complex(0) + if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) { + return 0; + } + return Math.pow(x, y); +} +powNumber.signature = n2; + +/** + * round a number to the given number of decimals, or to zero if decimals is + * not provided + * @param {number} value + * @param {number} decimals number of decimals, between 0 and 15 (0 by default) + * @return {number} roundedValue + */ +function roundNumber(value) { + let decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + if (!(0, _number.isInteger)(decimals) || decimals < 0 || decimals > 15) { + throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive'); + } + return parseFloat((0, _number.toFixed)(value, decimals)); +} + +/** + * Calculate the norm of a number, the absolute value. + * @param {number} x + * @return {number} + */ +function normNumber(x) { + return Math.abs(x); +} +normNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/bitwise.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/bitwise.js new file mode 100644 index 0000000..36e24cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/bitwise.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndNumber = bitAndNumber; +exports.bitNotNumber = bitNotNumber; +exports.bitOrNumber = bitOrNumber; +exports.bitXorNumber = bitXorNumber; +exports.leftShiftNumber = leftShiftNumber; +exports.rightArithShiftNumber = rightArithShiftNumber; +exports.rightLogShiftNumber = rightLogShiftNumber; +var _number = require("../../utils/number.js"); +const n1 = 'number'; +const n2 = 'number, number'; +function bitAndNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function bitAnd'); + } + return x & y; +} +bitAndNumber.signature = n2; +function bitNotNumber(x) { + if (!(0, _number.isInteger)(x)) { + throw new Error('Integer expected in function bitNot'); + } + return ~x; +} +bitNotNumber.signature = n1; +function bitOrNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function bitOr'); + } + return x | y; +} +bitOrNumber.signature = n2; +function bitXorNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function bitXor'); + } + return x ^ y; +} +bitXorNumber.signature = n2; +function leftShiftNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function leftShift'); + } + return x << y; +} +leftShiftNumber.signature = n2; +function rightArithShiftNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function rightArithShift'); + } + return x >> y; +} +rightArithShiftNumber.signature = n2; +function rightLogShiftNumber(x, y) { + if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) { + throw new Error('Integers expected in function rightLogShift'); + } + return x >>> y; +} +rightLogShiftNumber.signature = n2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/combinations.js new file mode 100644 index 0000000..5a66705 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/combinations.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.combinationsNumber = combinationsNumber; +var _number = require("../../utils/number.js"); +var _product = require("../../utils/product.js"); +function combinationsNumber(n, k) { + if (!(0, _number.isInteger)(n) || n < 0) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (!(0, _number.isInteger)(k) || k < 0) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (k > n) { + throw new TypeError('k must be less than or equal to n'); + } + const nMinusk = n - k; + let answer = 1; + const firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1; + let nextdivisor = 2; + const lastdivisor = k < nMinusk ? k : nMinusk; + // balance multiplications and divisions to try to keep intermediate values + // in exact-integer range as long as possible + for (let nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) { + answer *= nextnumerator; + while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) { + answer /= nextdivisor; + ++nextdivisor; + } + } + // for big n, k, floating point may have caused weirdness in remainder + if (nextdivisor <= lastdivisor) { + answer /= (0, _product.product)(nextdivisor, lastdivisor); + } + return answer; +} +combinationsNumber.signature = 'number, number'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/constants.js new file mode 100644 index 0000000..e177333 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/constants.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tau = exports.pi = exports.phi = exports.e = void 0; +const pi = exports.pi = Math.PI; +const tau = exports.tau = 2 * Math.PI; +const e = exports.e = Math.E; +const phi = exports.phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/index.js new file mode 100644 index 0000000..118255a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/index.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _arithmetic = require("./arithmetic.js"); +Object.keys(_arithmetic).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _arithmetic[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _arithmetic[key]; + } + }); +}); +var _bitwise = require("./bitwise.js"); +Object.keys(_bitwise).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _bitwise[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _bitwise[key]; + } + }); +}); +var _combinations = require("./combinations.js"); +Object.keys(_combinations).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _combinations[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _combinations[key]; + } + }); +}); +var _constants = require("./constants.js"); +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constants[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _constants[key]; + } + }); +}); +var _logical = require("./logical.js"); +Object.keys(_logical).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _logical[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _logical[key]; + } + }); +}); +var _relational = require("./relational.js"); +Object.keys(_relational).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _relational[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _relational[key]; + } + }); +}); +var _probability = require("./probability.js"); +Object.keys(_probability).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _probability[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _probability[key]; + } + }); +}); +var _trigonometry = require("./trigonometry.js"); +Object.keys(_trigonometry).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _trigonometry[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _trigonometry[key]; + } + }); +}); +var _utils = require("./utils.js"); +Object.keys(_utils).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _utils[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _utils[key]; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/logical.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/logical.js new file mode 100644 index 0000000..b1eb72a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/logical.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.andNumber = andNumber; +exports.notNumber = notNumber; +exports.orNumber = orNumber; +exports.xorNumber = xorNumber; +const n1 = 'number'; +const n2 = 'number, number'; +function notNumber(x) { + return !x; +} +notNumber.signature = n1; +function orNumber(x, y) { + return !!(x || y); +} +orNumber.signature = n2; +function xorNumber(x, y) { + return !!x !== !!y; +} +xorNumber.signature = n2; +function andNumber(x, y) { + return !!(x && y); +} +andNumber.signature = n2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/probability.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/probability.js new file mode 100644 index 0000000..72c7f7e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/probability.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.gammaG = void 0; +exports.gammaNumber = gammaNumber; +exports.lgammaN = exports.lgammaG = exports.gammaP = void 0; +exports.lgammaNumber = lgammaNumber; +exports.lnSqrt2PI = exports.lgammaSeries = void 0; +var _number = require("../../utils/number.js"); +var _product = require("../../utils/product.js"); +/* eslint-disable no-loss-of-precision */ + +function gammaNumber(n) { + let x; + if ((0, _number.isInteger)(n)) { + if (n <= 0) { + return isFinite(n) ? Infinity : NaN; + } + if (n > 171) { + return Infinity; // Will overflow + } + return (0, _product.product)(1, n - 1); + } + if (n < 0.5) { + return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n)); + } + if (n >= 171.35) { + return Infinity; // will overflow + } + if (n > 85.0) { + // Extended Stirling Approx + const twoN = n * n; + const threeN = twoN * n; + const fourN = threeN * n; + const fiveN = fourN * n; + return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n)); + } + --n; + x = gammaP[0]; + for (let i = 1; i < gammaP.length; ++i) { + x += gammaP[i] / (n + i); + } + const t = n + gammaG + 0.5; + return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x; +} +gammaNumber.signature = 'number'; + +// TODO: comment on the variables g and p + +const gammaG = exports.gammaG = 4.7421875; +const gammaP = exports.gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5]; + +// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code + +// log(2 * pi) / 2 +const lnSqrt2PI = exports.lnSqrt2PI = 0.91893853320467274178; +const lgammaG = exports.lgammaG = 5; // Lanczos parameter "g" +const lgammaN = exports.lgammaN = 7; // Range of coefficients "n" + +const lgammaSeries = exports.lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5]; +function lgammaNumber(n) { + if (n < 0) return NaN; + if (n === 0) return Infinity; + if (!isFinite(n)) return n; + if (n < 0.5) { + // Use Euler's reflection formula: + // gamma(z) = PI / (sin(PI * z) * gamma(1 - z)) + return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n); + } + + // Compute the logarithm of the Gamma function using the Lanczos method + + n = n - 1; + const base = n + lgammaG + 0.5; // Base of the Lanczos exponential + let sum = lgammaSeries[0]; + + // We start with the terms that have the smallest coefficients and largest denominator + for (let i = lgammaN - 1; i >= 1; i--) { + sum += lgammaSeries[i] / (n + i); + } + return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum); +} +lgammaNumber.signature = 'number'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/relational.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/relational.js new file mode 100644 index 0000000..9a390c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/relational.js @@ -0,0 +1 @@ +"use strict"; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js new file mode 100644 index 0000000..70c1860 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js @@ -0,0 +1,142 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.acosNumber = acosNumber; +exports.acoshNumber = acoshNumber; +exports.acotNumber = acotNumber; +exports.acothNumber = acothNumber; +exports.acscNumber = acscNumber; +exports.acschNumber = acschNumber; +exports.asecNumber = asecNumber; +exports.asechNumber = asechNumber; +exports.asinNumber = asinNumber; +exports.asinhNumber = asinhNumber; +exports.atan2Number = atan2Number; +exports.atanNumber = atanNumber; +exports.atanhNumber = atanhNumber; +exports.cosNumber = cosNumber; +exports.coshNumber = coshNumber; +exports.cotNumber = cotNumber; +exports.cothNumber = cothNumber; +exports.cscNumber = cscNumber; +exports.cschNumber = cschNumber; +exports.secNumber = secNumber; +exports.sechNumber = sechNumber; +exports.sinNumber = sinNumber; +exports.sinhNumber = sinhNumber; +exports.tanNumber = tanNumber; +exports.tanhNumber = tanhNumber; +var _number = require("../../utils/number.js"); +const n1 = 'number'; +const n2 = 'number, number'; +function acosNumber(x) { + return Math.acos(x); +} +acosNumber.signature = n1; +function acoshNumber(x) { + return (0, _number.acosh)(x); +} +acoshNumber.signature = n1; +function acotNumber(x) { + return Math.atan(1 / x); +} +acotNumber.signature = n1; +function acothNumber(x) { + return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0; +} +acothNumber.signature = n1; +function acscNumber(x) { + return Math.asin(1 / x); +} +acscNumber.signature = n1; +function acschNumber(x) { + const xInv = 1 / x; + return Math.log(xInv + Math.sqrt(xInv * xInv + 1)); +} +acschNumber.signature = n1; +function asecNumber(x) { + return Math.acos(1 / x); +} +asecNumber.signature = n1; +function asechNumber(x) { + const xInv = 1 / x; + const ret = Math.sqrt(xInv * xInv - 1); + return Math.log(ret + xInv); +} +asechNumber.signature = n1; +function asinNumber(x) { + return Math.asin(x); +} +asinNumber.signature = n1; +function asinhNumber(x) { + return (0, _number.asinh)(x); +} +asinhNumber.signature = n1; +function atanNumber(x) { + return Math.atan(x); +} +atanNumber.signature = n1; +function atan2Number(y, x) { + return Math.atan2(y, x); +} +atan2Number.signature = n2; +function atanhNumber(x) { + return (0, _number.atanh)(x); +} +atanhNumber.signature = n1; +function cosNumber(x) { + return Math.cos(x); +} +cosNumber.signature = n1; +function coshNumber(x) { + return (0, _number.cosh)(x); +} +coshNumber.signature = n1; +function cotNumber(x) { + return 1 / Math.tan(x); +} +cotNumber.signature = n1; +function cothNumber(x) { + const e = Math.exp(2 * x); + return (e + 1) / (e - 1); +} +cothNumber.signature = n1; +function cscNumber(x) { + return 1 / Math.sin(x); +} +cscNumber.signature = n1; +function cschNumber(x) { + // consider values close to zero (+/-) + if (x === 0) { + return Number.POSITIVE_INFINITY; + } else { + return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * (0, _number.sign)(x); + } +} +cschNumber.signature = n1; +function secNumber(x) { + return 1 / Math.cos(x); +} +secNumber.signature = n1; +function sechNumber(x) { + return 2 / (Math.exp(x) + Math.exp(-x)); +} +sechNumber.signature = n1; +function sinNumber(x) { + return Math.sin(x); +} +sinNumber.signature = n1; +function sinhNumber(x) { + return (0, _number.sinh)(x); +} +sinhNumber.signature = n1; +function tanNumber(x) { + return Math.tan(x); +} +tanNumber.signature = n1; +function tanhNumber(x) { + return (0, _number.tanh)(x); +} +tanhNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/utils.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/utils.js new file mode 100644 index 0000000..225a74d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/plain/number/utils.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIntegerNumber = isIntegerNumber; +exports.isNaNNumber = isNaNNumber; +exports.isNegativeNumber = isNegativeNumber; +exports.isPositiveNumber = isPositiveNumber; +exports.isZeroNumber = isZeroNumber; +var _number = require("../../utils/number.js"); +const n1 = 'number'; +function isIntegerNumber(x) { + return (0, _number.isInteger)(x); +} +isIntegerNumber.signature = n1; +function isNegativeNumber(x) { + return x < 0; +} +isNegativeNumber.signature = n1; +function isPositiveNumber(x) { + return x > 0; +} +isPositiveNumber.signature = n1; +function isZeroNumber(x) { + return x === 0; +} +isZeroNumber.signature = n1; +function isNaNNumber(x) { + return Number.isNaN(x); +} +isNaNNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bigint.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bigint.js new file mode 100644 index 0000000..7dbbc1f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bigint.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBigint = void 0; +var _factory = require("../utils/factory.js"); +var _collection = require("../utils/collection.js"); +const name = 'bigint'; +const dependencies = ['typed']; +const createBigint = exports.createBigint = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Create a bigint or convert a string, boolean, or unit to a bigint. + * When value is a matrix, all elements will be converted to bigint. + * + * Syntax: + * + * math.bigint(value) + * + * Examples: + * + * math.bigint(2) // returns 2n + * math.bigint('123') // returns 123n + * math.bigint(true) // returns 1n + * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n] + * + * See also: + * + * number, bignumber, boolean, complex, index, matrix, string, unit + * + * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted + * @return {bigint | Array | Matrix} The created bigint + */ + const bigint = typed('bigint', { + '': function () { + return 0n; + }, + bigint: function (x) { + return x; + }, + number: function (x) { + return BigInt(x.toFixed()); + }, + BigNumber: function (x) { + return BigInt(x.round().toString()); + }, + Fraction: function (x) { + return BigInt(x.valueOf().toFixed()); + }, + 'string | boolean': function (x) { + return BigInt(x); + }, + null: function (x) { + return 0n; + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); + + // reviver function to parse a JSON object like: + // + // {"mathjs":"bigint","value":"123"} + // + // into a bigint 123n + bigint.fromJSON = function (json) { + return BigInt(json.value); + }; + return bigint; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js new file mode 100644 index 0000000..2681d08 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js @@ -0,0 +1,64 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBigNumberClass = void 0; +var _decimal = _interopRequireDefault(require("decimal.js")); +var _factory = require("../../utils/factory.js"); +const name = 'BigNumber'; +const dependencies = ['?on', 'config']; +const createBigNumberClass = exports.createBigNumberClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + on, + config + } = _ref; + const BigNumber = _decimal.default.clone({ + precision: config.precision, + modulo: _decimal.default.EUCLID + }); + BigNumber.prototype = Object.create(BigNumber.prototype); + + /** + * Attach type information + */ + BigNumber.prototype.type = 'BigNumber'; + BigNumber.prototype.isBigNumber = true; + + /** + * Get a JSON representation of a BigNumber containing + * type information + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "BigNumber", "value": "0.2"}` + */ + BigNumber.prototype.toJSON = function () { + return { + mathjs: 'BigNumber', + value: this.toString() + }; + }; + + /** + * Instantiate a BigNumber from a JSON object + * @param {Object} json a JSON object structured as: + * `{"mathjs": "BigNumber", "value": "0.2"}` + * @return {BigNumber} + */ + BigNumber.fromJSON = function (json) { + return new BigNumber(json.value); + }; + if (on) { + // listen for changed in the configuration, automatically apply changed precision + on('config', function (curr, prev) { + if (curr.precision !== prev.precision) { + BigNumber.config({ + precision: curr.precision + }); + } + }); + } + return BigNumber; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js new file mode 100644 index 0000000..823859a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBignumber = void 0; +var _factory = require("../../../utils/factory.js"); +var _collection = require("../../../utils/collection.js"); +const name = 'bignumber'; +const dependencies = ['typed', 'BigNumber']; +const createBignumber = exports.createBignumber = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + BigNumber + } = _ref; + /** + * Create a BigNumber, which can store numbers with arbitrary precision. + * When a matrix is provided, all elements will be converted to BigNumber. + * + * Syntax: + * + * math.bignumber(x) + * + * Examples: + * + * 0.1 + 0.2 // returns number 0.30000000000000004 + * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3 + * + * + * 7.2e500 // returns number Infinity + * math.bignumber('7.2e500') // returns BigNumber 7.2e500 + * + * See also: + * + * number, bigint, boolean, complex, index, matrix, string, unit + * + * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number, + * 0 by default. + * @returns {BigNumber} The created bignumber + */ + return typed('bignumber', { + '': function () { + return new BigNumber(0); + }, + number: function (x) { + // convert to string to prevent errors in case of >15 digits + return new BigNumber(x + ''); + }, + string: function (x) { + const wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/); + if (wordSizeSuffixMatch) { + // x has a word size suffix + const size = wordSizeSuffixMatch[2]; + const n = BigNumber(wordSizeSuffixMatch[1]); + const twoPowSize = new BigNumber(2).pow(Number(size)); + if (n.gt(twoPowSize.sub(1))) { + throw new SyntaxError(`String "${x}" is out of range`); + } + const twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1); + if (n.gte(twoPowSizeSubOne)) { + return n.sub(twoPowSize); + } else { + return n; + } + } + return new BigNumber(x); + }, + BigNumber: function (x) { + // we assume a BigNumber is immutable + return x; + }, + bigint: function (x) { + return new BigNumber(x.toString()); + }, + Unit: typed.referToSelf(self => x => { + const clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + Fraction: function (x) { + return new BigNumber(x.n).div(x.d).times(x.s); + }, + null: function (x) { + return new BigNumber(0); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/boolean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/boolean.js new file mode 100644 index 0000000..07301c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/boolean.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBoolean = void 0; +var _factory = require("../utils/factory.js"); +var _collection = require("../utils/collection.js"); +const name = 'boolean'; +const dependencies = ['typed']; +const createBoolean = exports.createBoolean = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Create a boolean or convert a string or number to a boolean. + * In case of a number, `true` is returned for non-zero numbers, and `false` in + * case of zero. + * Strings can be `'true'` or `'false'`, or can contain a number. + * When value is a matrix, all elements will be converted to boolean. + * + * Syntax: + * + * math.boolean(x) + * + * Examples: + * + * math.boolean(0) // returns false + * math.boolean(1) // returns true + * math.boolean(-3) // returns true + * math.boolean('true') // returns true + * math.boolean('false') // returns false + * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true] + * + * See also: + * + * bignumber, complex, index, matrix, string, unit + * + * @param {string | number | boolean | Array | Matrix | null} value A value of any type + * @return {boolean | Array | Matrix} The boolean value + */ + return typed(name, { + '': function () { + return false; + }, + boolean: function (x) { + return x; + }, + number: function (x) { + return !!x; + }, + null: function (x) { + return false; + }, + BigNumber: function (x) { + return !x.isZero(); + }, + string: function (x) { + // try case insensitive + const lcase = x.toLowerCase(); + if (lcase === 'true') { + return true; + } else if (lcase === 'false') { + return false; + } + + // test whether value is a valid number + const num = Number(x); + if (x !== '' && !isNaN(num)) { + return !!num; + } + throw new Error('Cannot convert "' + x + '" to a boolean'); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/Chain.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/Chain.js new file mode 100644 index 0000000..b592898 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/Chain.js @@ -0,0 +1,216 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createChainClass = void 0; +var _is = require("../../utils/is.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +var _factory = require("../../utils/factory.js"); +const name = 'Chain'; +const dependencies = ['?on', 'math', 'typed']; +const createChainClass = exports.createChainClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + on, + math, + typed + } = _ref; + /** + * @constructor Chain + * Wrap any value in a chain, allowing to perform chained operations on + * the value. + * + * All methods available in the math.js library can be called upon the chain, + * and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing chain.done(), which will return + * the final value. + * + * The Chain has a number of special functions: + * - done() Finalize the chained operation and return the + * chain's value. + * - valueOf() The same as done() + * - toString() Returns a string representation of the chain's value. + * + * @param {*} [value] + */ + function Chain(value) { + if (!(this instanceof Chain)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if ((0, _is.isChain)(value)) { + this.value = value.value; + } else { + this.value = value; + } + } + + /** + * Attach type information + */ + Chain.prototype.type = 'Chain'; + Chain.prototype.isChain = true; + + /** + * Close the chain. Returns the final value. + * Does the same as method valueOf() + * @returns {*} value + */ + Chain.prototype.done = function () { + return this.value; + }; + + /** + * Close the chain. Returns the final value. + * Does the same as method done() + * @returns {*} value + */ + Chain.prototype.valueOf = function () { + return this.value; + }; + + /** + * Get a string representation of the value in the chain + * @returns {string} + */ + Chain.prototype.toString = function () { + return (0, _string.format)(this.value); + }; + + /** + * Get a JSON representation of the chain + * @returns {Object} + */ + Chain.prototype.toJSON = function () { + return { + mathjs: 'Chain', + value: this.value + }; + }; + + /** + * Instantiate a Chain from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "Chain", value: ...}`, + * where mathjs is optional + * @returns {Chain} + */ + Chain.fromJSON = function (json) { + return new Chain(json.value); + }; + + /** + * Create a proxy method for the chain + * @param {string} name + * @param {Function} fn The function to be proxied + * If fn is no function, it is silently ignored. + * @private + */ + function createProxy(name, fn) { + if (typeof fn === 'function') { + Chain.prototype[name] = chainify(fn); + } + } + + /** + * Create a proxy method for the chain + * @param {string} name + * @param {function} resolver The function resolving with the + * function to be proxied + * @private + */ + function createLazyProxy(name, resolver) { + (0, _object.lazy)(Chain.prototype, name, function outerResolver() { + const fn = resolver(); + if (typeof fn === 'function') { + return chainify(fn); + } + return undefined; // if not a function, ignore + }); + } + + /** + * Make a function chainable + * @param {function} fn + * @return {Function} chain function + * @private + */ + function chainify(fn) { + return function () { + // Here, `this` will be the context of a Chain instance + if (arguments.length === 0) { + return new Chain(fn(this.value)); + } + const args = [this.value]; + for (let i = 0; i < arguments.length; i++) { + args[i + 1] = arguments[i]; + } + if (typed.isTypedFunction(fn)) { + const sigObject = typed.resolve(fn, args); + // We want to detect if a rest parameter has matched across the + // value in the chain and the current arguments of this call. + // That is the case if and only if the matching signature has + // exactly one parameter (which then must be a rest parameter + // as it is matching at least two actual arguments). + if (sigObject.params.length === 1) { + throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.'); + } + return new Chain(sigObject.implementation.apply(fn, args)); + } + return new Chain(fn.apply(fn, args)); + }; + } + + /** + * Create a proxy for a single method, or an object with multiple methods. + * Example usage: + * + * Chain.createProxy('add', function add (x, y) {...}) + * Chain.createProxy({ + * add: function add (x, y) {...}, + * subtract: function subtract (x, y) {...} + * } + * + * @param {string | Object} arg0 A name (string), or an object with + * functions + * @param {*} [arg1] A function, when arg0 is a name + */ + Chain.createProxy = function (arg0, arg1) { + if (typeof arg0 === 'string') { + // createProxy(name, value) + createProxy(arg0, arg1); + } else { + // createProxy(values) + for (const name in arg0) { + if ((0, _object.hasOwnProperty)(arg0, name) && excludedNames[name] === undefined) { + createLazyProxy(name, () => arg0[name]); + } + } + } + }; + const excludedNames = { + expression: true, + docs: true, + type: true, + classes: true, + json: true, + error: true, + isChain: true // conflicts with the property isChain of a Chain instance + }; + + // create proxy for everything that is in math.js + Chain.createProxy(math); + + // register on the import event, automatically add a proxy for every imported function. + if (on) { + on('import', function (name, resolver, path) { + if (!path) { + // an imported function (not a data type or something special) + createLazyProxy(name, resolver); + } + }); + } + return Chain; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/function/chain.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/function/chain.js new file mode 100644 index 0000000..7911b64 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/chain/function/chain.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createChain = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'chain'; +const dependencies = ['typed', 'Chain']; +const createChain = exports.createChain = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Chain + } = _ref; + /** + * Wrap any value in a chain, allowing to perform chained operations on + * the value. + * + * All methods available in the math.js library can be called upon the chain, + * and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing `chain.done()`, which returns + * the final value. + * + * The chain has a number of special functions: + * + * - `done()` Finalize the chain and return the chain's value. + * - `valueOf()` The same as `done()` + * - `toString()` Executes `math.format()` onto the chain's value, returning + * a string representation of the value. + * + * Syntax: + * + * math.chain(value) + * + * Examples: + * + * math.chain(3) + * .add(4) + * .subtract(2) + * .done() // 5 + * + * math.chain( [[1, 2], [3, 4]] ) + * .subset(math.index(0, 0), 8) + * .multiply(3) + * .done() // [[24, 6], [9, 12]] + * + * @param {*} [value] A value of any type on which to start a chained operation. + * @return {math.Chain} The created chain + */ + return typed(name, { + '': function () { + return new Chain(); + }, + any: function (value) { + return new Chain(value); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/Complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/Complex.js new file mode 100644 index 0000000..d0eecba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/Complex.js @@ -0,0 +1,201 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createComplexClass = void 0; +var _complex = _interopRequireDefault(require("complex.js")); +var _number = require("../../utils/number.js"); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +const name = 'Complex'; +const dependencies = []; +const createComplexClass = exports.createComplexClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * Attach type information + */ + Object.defineProperty(_complex.default, 'name', { + value: 'Complex' + }); + _complex.default.prototype.constructor = _complex.default; + _complex.default.prototype.type = 'Complex'; + _complex.default.prototype.isComplex = true; + + /** + * Get a JSON representation of the complex number + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Complex", "re": 2, "im": 3}` + */ + _complex.default.prototype.toJSON = function () { + return { + mathjs: 'Complex', + re: this.re, + im: this.im + }; + }; + + /* + * Return the value of the complex number in polar notation + * The angle phi will be set in the interval of [-pi, pi]. + * @return {{r: number, phi: number}} Returns and object with properties r and phi. + */ + _complex.default.prototype.toPolar = function () { + return { + r: this.abs(), + phi: this.arg() + }; + }; + + /** + * Get a string representation of the complex number, + * with optional formatting options. + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @return {string} str + */ + _complex.default.prototype.format = function (options) { + let str = ''; + let im = this.im; + let re = this.re; + const strRe = (0, _number.format)(this.re, options); + const strIm = (0, _number.format)(this.im, options); + + // round either re or im when smaller than the configured precision + const precision = (0, _is.isNumber)(options) ? options : options ? options.precision : null; + if (precision !== null) { + const epsilon = Math.pow(10, -precision); + if (Math.abs(re / im) < epsilon) { + re = 0; + } + if (Math.abs(im / re) < epsilon) { + im = 0; + } + } + if (im === 0) { + // real value + str = strRe; + } else if (re === 0) { + // purely complex value + if (im === 1) { + str = 'i'; + } else if (im === -1) { + str = '-i'; + } else { + str = strIm + 'i'; + } + } else { + // complex value + if (im < 0) { + if (im === -1) { + str = strRe + ' - i'; + } else { + str = strRe + ' - ' + strIm.substring(1) + 'i'; + } + } else { + if (im === 1) { + str = strRe + ' + i'; + } else { + str = strRe + ' + ' + strIm + 'i'; + } + } + } + return str; + }; + + /** + * Create a complex number from polar coordinates + * + * Usage: + * + * Complex.fromPolar(r: number, phi: number) : Complex + * Complex.fromPolar({r: number, phi: number}) : Complex + * + * @param {*} args... + * @return {Complex} + */ + _complex.default.fromPolar = function (args) { + switch (arguments.length) { + case 1: + { + const arg = arguments[0]; + if (typeof arg === 'object') { + return (0, _complex.default)(arg); + } else { + throw new TypeError('Input has to be an object with r and phi keys.'); + } + } + case 2: + { + const r = arguments[0]; + let phi = arguments[1]; + if ((0, _is.isNumber)(r)) { + if ((0, _is.isUnit)(phi) && phi.hasBase('ANGLE')) { + // convert unit to a number in radians + phi = phi.toNumber('rad'); + } + if ((0, _is.isNumber)(phi)) { + return new _complex.default({ + r, + phi + }); + } + throw new TypeError('Phi is not a number nor an angle unit.'); + } else { + throw new TypeError('Radius r is not a number.'); + } + } + default: + throw new SyntaxError('Wrong number of arguments in function fromPolar'); + } + }; + _complex.default.prototype.valueOf = _complex.default.prototype.toString; + + /** + * Create a Complex number from a JSON object + * @param {Object} json A JSON Object structured as + * {"mathjs": "Complex", "re": 2, "im": 3} + * All properties are optional, default values + * for `re` and `im` are 0. + * @return {Complex} Returns a new Complex number + */ + _complex.default.fromJSON = function (json) { + return new _complex.default(json); + }; + + /** + * Compare two complex numbers, `a` and `b`: + * + * - Returns 1 when the real part of `a` is larger than the real part of `b` + * - Returns -1 when the real part of `a` is smaller than the real part of `b` + * - Returns 1 when the real parts are equal + * and the imaginary part of `a` is larger than the imaginary part of `b` + * - Returns -1 when the real parts are equal + * and the imaginary part of `a` is smaller than the imaginary part of `b` + * - Returns 0 when both real and imaginary parts are equal. + * + * @params {Complex} a + * @params {Complex} b + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + _complex.default.compare = function (a, b) { + if (a.re > b.re) { + return 1; + } + if (a.re < b.re) { + return -1; + } + if (a.im > b.im) { + return 1; + } + if (a.im < b.im) { + return -1; + } + return 0; + }; + return _complex.default; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/function/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/function/complex.js new file mode 100644 index 0000000..a48a0c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/complex/function/complex.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createComplex = void 0; +var _factory = require("../../../utils/factory.js"); +var _collection = require("../../../utils/collection.js"); +const name = 'complex'; +const dependencies = ['typed', 'Complex']; +const createComplex = exports.createComplex = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Complex + } = _ref; + /** + * Create a complex value or convert a value to a complex value. + * + * Syntax: + * + * math.complex() // creates a complex value with zero + * // as real and imaginary part. + * math.complex(re : number, im : string) // creates a complex value with provided + * // values for real and imaginary part. + * math.complex(re : number) // creates a complex value with provided + * // real value and zero imaginary part. + * math.complex(complex : Complex) // clones the provided complex value. + * math.complex(arg : string) // parses a string into a complex value. + * math.complex(array : Array) // converts the elements of the array + * // or matrix element wise into a + * // complex value. + * math.complex({re: number, im: number}) // creates a complex value with provided + * // values for real an imaginary part. + * math.complex({r: number, phi: number}) // creates a complex value with provided + * // polar coordinates + * + * Examples: + * + * const a = math.complex(3, -4) // a = Complex 3 - 4i + * a.re = 5 // a = Complex 5 - 4i + * const i = a.im // Number -4 + * const b = math.complex('2 + 6i') // Complex 2 + 6i + * const c = math.complex() // Complex 0 + 0i + * const d = math.add(a, b) // Complex 5 + 2i + * + * See also: + * + * bignumber, boolean, index, matrix, number, string, unit + * + * @param {* | Array | Matrix} [args] + * Arguments specifying the real and imaginary part of the complex number + * @return {Complex | Array | Matrix} Returns a complex value + */ + return typed('complex', { + '': function () { + return Complex.ZERO; + }, + number: function (x) { + return new Complex(x, 0); + }, + 'number, number': function (re, im) { + return new Complex(re, im); + }, + // TODO: this signature should be redundant + 'BigNumber, BigNumber': function (re, im) { + return new Complex(re.toNumber(), im.toNumber()); + }, + Fraction: function (x) { + return new Complex(x.valueOf(), 0); + }, + Complex: function (x) { + return x.clone(); + }, + string: function (x) { + return Complex(x); // for example '2 + 3i' + }, + null: function (x) { + return Complex(0); + }, + Object: function (x) { + if ('re' in x && 'im' in x) { + return new Complex(x.re, x.im); + } + if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) { + return new Complex(x); + } + throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)'); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js new file mode 100644 index 0000000..88e31c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js @@ -0,0 +1,48 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFractionClass = void 0; +var _fraction = _interopRequireDefault(require("fraction.js")); +var _factory = require("../../utils/factory.js"); +const name = 'Fraction'; +const dependencies = []; +const createFractionClass = exports.createFractionClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * Attach type information + */ + Object.defineProperty(_fraction.default, 'name', { + value: 'Fraction' + }); + _fraction.default.prototype.constructor = _fraction.default; + _fraction.default.prototype.type = 'Fraction'; + _fraction.default.prototype.isFraction = true; + + /** + * Get a JSON representation of a Fraction containing type information + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Fraction", "n": 3, "d": 8}` + */ + _fraction.default.prototype.toJSON = function () { + return { + mathjs: 'Fraction', + n: this.s * this.n, + d: this.d + }; + }; + + /** + * Instantiate a Fraction from a JSON object + * @param {Object} json a JSON object structured as: + * `{"mathjs": "Fraction", "n": 3, "d": 8}` + * @return {BigNumber} + */ + _fraction.default.fromJSON = function (json) { + return new _fraction.default(json); + }; + return _fraction.default; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js new file mode 100644 index 0000000..86e3ce9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFraction = void 0; +var _factory = require("../../../utils/factory.js"); +var _collection = require("../../../utils/collection.js"); +const name = 'fraction'; +const dependencies = ['typed', 'Fraction']; +const createFraction = exports.createFraction = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Fraction + } = _ref; + /** + * Create a fraction or convert a value to a fraction. + * + * With one numeric argument, produces the closest rational approximation to the + * input. + * With two arguments, the first is the numerator and the second is the denominator, + * and creates the corresponding fraction. Both numerator and denominator must be + * integers. + * With one object argument, looks for the integer numerator as the value of property + * 'n' and the integer denominator as the value of property 'd'. + * With a matrix argument, creates a matrix of the same shape with entries + * converted into fractions. + * + * Syntax: + * math.fraction(value) + * math.fraction(numerator, denominator) + * math.fraction({n: numerator, d: denominator}) + * math.fraction(matrix: Array | Matrix) + * + * Examples: + * + * math.fraction(6.283) // returns Fraction 6283/1000 + * math.fraction(1, 3) // returns Fraction 1/3 + * math.fraction('2/3') // returns Fraction 2/3 + * math.fraction({n: 2, d: 3}) // returns Fraction 2/3 + * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4] + * math.fraction(4, 5.1) // throws Error: Parameters must be integer + * + * See also: + * + * bignumber, number, string, unit + * + * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args] + * Arguments specifying the value, or numerator and denominator of + * the fraction + * @return {Fraction | Array | Matrix} Returns a fraction + */ + return typed('fraction', { + number: function (x) { + if (!isFinite(x) || isNaN(x)) { + throw new Error(x + ' cannot be represented as a fraction'); + } + return new Fraction(x); + }, + string: function (x) { + return new Fraction(x); + }, + 'number, number': function (numerator, denominator) { + return new Fraction(numerator, denominator); + }, + null: function (x) { + return new Fraction(0); + }, + BigNumber: function (x) { + return new Fraction(x.toString()); + }, + bigint: function (x) { + return new Fraction(x.toString()); + }, + Fraction: function (x) { + return x; // fractions are immutable + }, + Unit: typed.referToSelf(self => x => { + const clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + Object: function (x) { + return new Fraction(x); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js new file mode 100644 index 0000000..9cb7d4c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js @@ -0,0 +1,974 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createDenseMatrixClass = void 0; +var _is = require("../../utils/is.js"); +var _array = require("../../utils/array.js"); +var _string = require("../../utils/string.js"); +var _number = require("../../utils/number.js"); +var _object = require("../../utils/object.js"); +var _DimensionError = require("../../error/DimensionError.js"); +var _factory = require("../../utils/factory.js"); +var _optimizeCallback = require("../../utils/optimizeCallback.js"); +// deno-lint-ignore-file no-this-alias + +const name = 'DenseMatrix'; +const dependencies = ['Matrix']; +const createDenseMatrixClass = exports.createDenseMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + Matrix + } = _ref; + /** + * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type. + * @class DenseMatrix + * @enum {{ value, index: number[] }} + */ + function DenseMatrix(data, datatype) { + if (!(this instanceof DenseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !(0, _is.isString)(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if ((0, _is.isMatrix)(data)) { + // check data is a DenseMatrix + if (data.type === 'DenseMatrix') { + // clone data & size + this._data = (0, _object.clone)(data._data); + this._size = (0, _object.clone)(data._size); + this._datatype = datatype || data._datatype; + } else { + // build data from existing matrix + this._data = data.toArray(); + this._size = data.size(); + this._datatype = datatype || data._datatype; + } + } else if (data && (0, _is.isArray)(data.data) && (0, _is.isArray)(data.size)) { + // initialize fields from JSON representation + this._data = data.data; + this._size = data.size; + // verify the dimensions of the array + (0, _array.validate)(this._data, this._size); + this._datatype = datatype || data.datatype; + } else if ((0, _is.isArray)(data)) { + // replace nested Matrices with Arrays + this._data = preprocess(data); + // get the dimensions of the array + this._size = (0, _array.arraySize)(this._data); + // verify the dimensions of the array, TODO: compute size while processing array + (0, _array.validate)(this._data, this._size); + // data type unknown + this._datatype = datatype; + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + (0, _is.typeOf)(data) + ')'); + } else { + // nothing provided + this._data = []; + this._size = [0]; + this._datatype = datatype; + } + } + DenseMatrix.prototype = new Matrix(); + + /** + * Create a new DenseMatrix + */ + DenseMatrix.prototype.createDenseMatrix = function (data, datatype) { + return new DenseMatrix(data, datatype); + }; + + /** + * Attach type information + */ + Object.defineProperty(DenseMatrix, 'name', { + value: 'DenseMatrix' + }); + DenseMatrix.prototype.constructor = DenseMatrix; + DenseMatrix.prototype.type = 'DenseMatrix'; + DenseMatrix.prototype.isDenseMatrix = true; + + /** + * Get the matrix type + * + * Usage: + * const matrixType = matrix.getDataType() // retrieves the matrix type + * + * @memberOf DenseMatrix + * @return {string} type information; if multiple types are found from the Matrix, it will return "mixed" + */ + DenseMatrix.prototype.getDataType = function () { + return (0, _array.getArrayDataType)(this._data, _is.typeOf); + }; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @memberof DenseMatrix + * @return {string} The storage format. + */ + DenseMatrix.prototype.storage = function () { + return 'dense'; + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @memberof DenseMatrix + * @return {string} The datatype. + */ + DenseMatrix.prototype.datatype = function () { + return this._datatype; + }; + + /** + * Create a new DenseMatrix + * @memberof DenseMatrix + * @param {Array} data + * @param {string} [datatype] + */ + DenseMatrix.prototype.create = function (data, datatype) { + return new DenseMatrix(data, datatype); + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @memberof DenseMatrix + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + DenseMatrix.prototype.subset = function (index, replacement, defaultValue) { + switch (arguments.length) { + case 1: + return _get(this, index); + + // intentional fall through + case 2: + case 3: + return _set(this, index, replacement, defaultValue); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + + /** + * Get a single element from the matrix. + * @memberof DenseMatrix + * @param {number[]} index Zero-based index + * @return {*} value + */ + DenseMatrix.prototype.get = function (index) { + return (0, _array.get)(this._data, index); + }; + + /** + * Replace a single element in the matrix. + * @memberof DenseMatrix + * @param {number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {DenseMatrix} self + */ + DenseMatrix.prototype.set = function (index, value, defaultValue) { + if (!(0, _is.isArray)(index)) { + throw new TypeError('Array expected'); + } + if (index.length < this._size.length) { + throw new _DimensionError.DimensionError(index.length, this._size.length, '<'); + } + let i, ii, indexI; + + // enlarge matrix when needed + const size = index.map(function (i) { + return i + 1; + }); + _fit(this, size, defaultValue); + + // traverse over the dimensions + let data = this._data; + for (i = 0, ii = index.length - 1; i < ii; i++) { + indexI = index[i]; + (0, _array.validateIndex)(indexI, data.length); + data = data[indexI]; + } + + // set new value + indexI = index[index.length - 1]; + (0, _array.validateIndex)(indexI, data.length); + data[indexI] = value; + return this; + }; + + /** + * Get a submatrix of this matrix + * @memberof DenseMatrix + * @param {DenseMatrix} matrix + * @param {Index} index Zero-based index + * @private + */ + function _get(matrix, index) { + if (!(0, _is.isIndex)(index)) { + throw new TypeError('Invalid index'); + } + const isScalar = index.isScalar(); + if (isScalar) { + // return a scalar + return matrix.get(index.min()); + } else { + // validate dimensions + const size = index.size(); + if (size.length !== matrix._size.length) { + throw new _DimensionError.DimensionError(size.length, matrix._size.length); + } + + // validate if any of the ranges in the index is out of range + const min = index.min(); + const max = index.max(); + for (let i = 0, ii = matrix._size.length; i < ii; i++) { + (0, _array.validateIndex)(min[i], matrix._size[i]); + (0, _array.validateIndex)(max[i], matrix._size[i]); + } + + // retrieve submatrix + // TODO: more efficient when creating an empty matrix and setting _data and _size manually + return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype); + } + } + + /** + * Recursively get a submatrix of a multi dimensional matrix. + * Index is not checked for correct number or length of dimensions. + * @memberof DenseMatrix + * @param {Array} data + * @param {Index} index + * @param {number} dims Total number of dimensions + * @param {number} dim Current dimension + * @return {Array} submatrix + * @private + */ + function _getSubmatrix(data, index, dims, dim) { + const last = dim === dims - 1; + const range = index.dimension(dim); + if (last) { + return range.map(function (i) { + (0, _array.validateIndex)(i, data.length); + return data[i]; + }).valueOf(); + } else { + return range.map(function (i) { + (0, _array.validateIndex)(i, data.length); + const child = data[i]; + return _getSubmatrix(child, index, dims, dim + 1); + }).valueOf(); + } + } + + /** + * Replace a submatrix in this matrix + * Indexes are zero-based. + * @memberof DenseMatrix + * @param {DenseMatrix} matrix + * @param {Index} index + * @param {DenseMatrix | Array | *} submatrix + * @param {*} defaultValue Default value, filled in on new entries when + * the matrix is resized. + * @return {DenseMatrix} matrix + * @private + */ + function _set(matrix, index, submatrix, defaultValue) { + if (!index || index.isIndex !== true) { + throw new TypeError('Invalid index'); + } + + // get index size and check whether the index contains a single value + const iSize = index.size(); + const isScalar = index.isScalar(); + + // calculate the size of the submatrix, and convert it into an Array if needed + let sSize; + if ((0, _is.isMatrix)(submatrix)) { + sSize = submatrix.size(); + submatrix = submatrix.valueOf(); + } else { + sSize = (0, _array.arraySize)(submatrix); + } + if (isScalar) { + // set a scalar + + // check whether submatrix is a scalar + if (sSize.length !== 0) { + throw new TypeError('Scalar expected'); + } + matrix.set(index.min(), submatrix, defaultValue); + } else { + // set a submatrix + + // broadcast submatrix + if (!(0, _object.deepStrictEqual)(sSize, iSize)) { + try { + if (sSize.length === 0) { + submatrix = (0, _array.broadcastTo)([submatrix], iSize); + } else { + submatrix = (0, _array.broadcastTo)(submatrix, iSize); + } + sSize = (0, _array.arraySize)(submatrix); + } catch (_unused) {} + } + + // validate dimensions + if (iSize.length < matrix._size.length) { + throw new _DimensionError.DimensionError(iSize.length, matrix._size.length, '<'); + } + if (sSize.length < iSize.length) { + // calculate number of missing outer dimensions + let i = 0; + let outer = 0; + while (iSize[i] === 1 && sSize[i] === 1) { + i++; + } + while (iSize[i] === 1) { + outer++; + i++; + } + + // unsqueeze both outer and inner dimensions + submatrix = (0, _array.unsqueeze)(submatrix, iSize.length, outer, sSize); + } + + // check whether the size of the submatrix matches the index size + if (!(0, _object.deepStrictEqual)(iSize, sSize)) { + throw new _DimensionError.DimensionError(iSize, sSize, '>'); + } + + // enlarge matrix when needed + const size = index.max().map(function (i) { + return i + 1; + }); + _fit(matrix, size, defaultValue); + + // insert the sub matrix + const dims = iSize.length; + const dim = 0; + _setSubmatrix(matrix._data, index, submatrix, dims, dim); + } + return matrix; + } + + /** + * Replace a submatrix of a multi dimensional matrix. + * @memberof DenseMatrix + * @param {Array} data + * @param {Index} index + * @param {Array} submatrix + * @param {number} dims Total number of dimensions + * @param {number} dim + * @private + */ + function _setSubmatrix(data, index, submatrix, dims, dim) { + const last = dim === dims - 1; + const range = index.dimension(dim); + if (last) { + range.forEach(function (dataIndex, subIndex) { + (0, _array.validateIndex)(dataIndex); + data[dataIndex] = submatrix[subIndex[0]]; + }); + } else { + range.forEach(function (dataIndex, subIndex) { + (0, _array.validateIndex)(dataIndex); + _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1); + }); + } + } + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @memberof DenseMatrix + * @param {number[] || Matrix} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + DenseMatrix.prototype.resize = function (size, defaultValue, copy) { + // validate arguments + if (!(0, _is.isCollection)(size)) { + throw new TypeError('Array or Matrix expected'); + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + const sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 ? value[0] : value; + }); + + // matrix to resize + const m = copy ? this.clone() : this; + // resize matrix + return _resize(m, sizeArray, defaultValue); + }; + function _resize(matrix, size, defaultValue) { + // check size + if (size.length === 0) { + // first value in matrix + let v = matrix._data; + // go deep + while ((0, _is.isArray)(v)) { + v = v[0]; + } + return v; + } + // resize matrix + matrix._size = size.slice(0); // copy the array + matrix._data = (0, _array.resize)(matrix._data, matrix._size, defaultValue); + // return matrix + return matrix; + } + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * NOTE: This might be better suited to copy by default, instead of modifying + * in place. For now, it operates in place to remain consistent with + * resize(). + * + * @memberof DenseMatrix + * @param {number[]} size The new size the matrix should have. + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + DenseMatrix.prototype.reshape = function (size, copy) { + const m = copy ? this.clone() : this; + m._data = (0, _array.reshape)(m._data, size); + const currentLength = m._size.reduce((length, size) => length * size); + m._size = (0, _array.processSizesWildcard)(size, currentLength); + return m; + }; + + /** + * Enlarge the matrix when it is smaller than given size. + * If the matrix is larger or equal sized, nothing is done. + * @memberof DenseMatrix + * @param {DenseMatrix} matrix The matrix to be resized + * @param {number[]} size + * @param {*} defaultValue Default value, filled in on new entries. + * @private + */ + function _fit(matrix, size, defaultValue) { + const + // copy the array + newSize = matrix._size.slice(0); + let changed = false; + + // add dimensions when needed + while (newSize.length < size.length) { + newSize.push(0); + changed = true; + } + + // enlarge size when needed + for (let i = 0, ii = size.length; i < ii; i++) { + if (size[i] > newSize[i]) { + newSize[i] = size[i]; + changed = true; + } + } + if (changed) { + // resize only when size is changed + _resize(matrix, newSize, defaultValue); + } + } + + /** + * Create a clone of the matrix + * @memberof DenseMatrix + * @return {DenseMatrix} clone + */ + DenseMatrix.prototype.clone = function () { + const m = new DenseMatrix({ + data: (0, _object.clone)(this._data), + size: (0, _object.clone)(this._size), + datatype: this._datatype + }); + return m; + }; + + /** + * Retrieve the size of the matrix. + * @memberof DenseMatrix + * @returns {number[]} size + */ + DenseMatrix.prototype.size = function () { + return this._size.slice(0); // return a clone of _size + }; + + /** + * Applies a callback function to a reference to each element of the matrix + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: an array, an integer index to that + * array, and the Matrix being traversed. + */ + DenseMatrix.prototype._forEach = function (callback) { + // matrix instance + const me = this; + const s = me.size(); + + // if there is only one dimension, just loop through it + if (s.length === 1) { + for (let i = 0; i < s[0]; i++) { + callback(me._data, i, [i]); + } + return; + } + + // keep track of the current index permutation + const index = Array(s.length).fill(0); + + // store a reference of each dimension of the matrix for faster access + const data = Array(s.length - 1); + const last = data.length - 1; + data[0] = me._data[0]; + for (let i = 0; i < last; i++) { + data[i + 1] = data[i][0]; + } + index[last] = -1; + while (true) { + let i; + for (i = last; i >= 0; i--) { + // march index to the next permutation + index[i]++; + if (index[i] === s[i]) { + index[i] = 0; + continue; + } + + // update references to matrix dimensions + data[i] = i === 0 ? me._data[index[i]] : data[i - 1][index[i]]; + for (let j = i; j < last; j++) { + data[j + 1] = data[j][0]; + } + + // loop through the last dimension and map each value + for (let j = 0; j < s[data.length]; j++) { + index[data.length] = j; + callback(data[last], j, index.slice(0)); + } + break; + } + if (i === -1) { + break; + } + } + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * + * @return {DenseMatrix} matrix + */ + DenseMatrix.prototype.map = function (callback) { + const me = this; + const result = new DenseMatrix(me); + const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me._data, 'map'); + result._forEach(function (arr, i, index) { + arr[i] = fastCallback(arr[i], index, me); + }); + return result; + }; + + /** + * Execute a callback function on each entry of the matrix. + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + */ + DenseMatrix.prototype.forEach = function (callback) { + const me = this; + const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me._data, 'map'); + me._forEach(function (arr, i, index) { + fastCallback(arr[i], index, me); + }); + }; + + /** + * Iterate over the matrix elements + * @return {Iterable<{ value, index: number[] }>} + */ + DenseMatrix.prototype[Symbol.iterator] = function* () { + const recurse = function* (value, index) { + if ((0, _is.isArray)(value)) { + for (let i = 0; i < value.length; i++) { + yield* recurse(value[i], index.concat(i)); + } + } else { + yield { + value, + index + }; + } + }; + yield* recurse(this._data, []); + }; + + /** + * Returns an array containing the rows of a 2D matrix + * @returns {Array} + */ + DenseMatrix.prototype.rows = function () { + const result = []; + const s = this.size(); + if (s.length !== 2) { + throw new TypeError('Rows can only be returned for a 2D matrix.'); + } + const data = this._data; + for (const row of data) { + result.push(new DenseMatrix([row], this._datatype)); + } + return result; + }; + + /** + * Returns an array containing the columns of a 2D matrix + * @returns {Array} + */ + DenseMatrix.prototype.columns = function () { + const result = []; + const s = this.size(); + if (s.length !== 2) { + throw new TypeError('Rows can only be returned for a 2D matrix.'); + } + const data = this._data; + for (let i = 0; i < s[1]; i++) { + const col = data.map(row => [row[i]]); + result.push(new DenseMatrix(col, this._datatype)); + } + return result; + }; + + /** + * Create an Array with a copy of the data of the DenseMatrix + * @memberof DenseMatrix + * @returns {Array} array + */ + DenseMatrix.prototype.toArray = function () { + return (0, _object.clone)(this._data); + }; + + /** + * Get the primitive value of the DenseMatrix: a multidimensional array + * @memberof DenseMatrix + * @returns {Array} array + */ + DenseMatrix.prototype.valueOf = function () { + return this._data; + }; + + /** + * Get a string representation of the matrix, with optional formatting options. + * @memberof DenseMatrix + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + DenseMatrix.prototype.format = function (options) { + return (0, _string.format)(this._data, options); + }; + + /** + * Get a string representation of the matrix + * @memberof DenseMatrix + * @returns {string} str + */ + DenseMatrix.prototype.toString = function () { + return (0, _string.format)(this._data); + }; + + /** + * Get a JSON representation of the matrix + * @memberof DenseMatrix + * @returns {Object} + */ + DenseMatrix.prototype.toJSON = function () { + return { + mathjs: 'DenseMatrix', + data: this._data, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Get the kth Matrix diagonal. + * + * @memberof DenseMatrix + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved. + * + * @returns {Matrix} The matrix with the diagonal values. + */ + DenseMatrix.prototype.diagonal = function (k) { + // validate k if any + if (k) { + // convert BigNumber to a number + if ((0, _is.isBigNumber)(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + const kSuper = k > 0 ? k : 0; + const kSub = k < 0 ? -k : 0; + + // rows & columns + const rows = this._size[0]; + const columns = this._size[1]; + + // number diagonal values + const n = Math.min(rows - kSub, columns - kSuper); + + // x is a matrix get diagonal from matrix + const data = []; + + // loop rows + for (let i = 0; i < n; i++) { + data[i] = this._data[i + kSub][i + kSuper]; + } + + // create DenseMatrix + return new DenseMatrix({ + data, + size: [n], + datatype: this._datatype + }); + }; + + /** + * Create a diagonal matrix. + * + * @memberof DenseMatrix + * @param {Array} size The matrix size. + * @param {number | Matrix | Array } value The values for the diagonal. + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in. + * @param {number} [defaultValue] The default value for non-diagonal + * @param {string} [datatype] The datatype for the diagonal + * + * @returns {DenseMatrix} + */ + DenseMatrix.diagonal = function (size, value, k, defaultValue) { + if (!(0, _is.isArray)(size)) { + throw new TypeError('Array expected, size parameter'); + } + if (size.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // map size & validate + size = size.map(function (s) { + // check it is a big number + if ((0, _is.isBigNumber)(s)) { + // convert it + s = s.toNumber(); + } + // validate arguments + if (!(0, _is.isNumber)(s) || !(0, _number.isInteger)(s) || s < 1) { + throw new Error('Size values must be positive integers'); + } + return s; + }); + + // validate k if any + if (k) { + // convert BigNumber to a number + if ((0, _is.isBigNumber)(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + const kSuper = k > 0 ? k : 0; + const kSub = k < 0 ? -k : 0; + + // rows and columns + const rows = size[0]; + const columns = size[1]; + + // number of non-zero items + const n = Math.min(rows - kSub, columns - kSuper); + + // value extraction function + let _value; + + // check value + if ((0, _is.isArray)(value)) { + // validate array + if (value.length !== n) { + // number of values in array must be n + throw new Error('Invalid value array length'); + } + // define function + _value = function (i) { + // return value @ i + return value[i]; + }; + } else if ((0, _is.isMatrix)(value)) { + // matrix size + const ms = value.size(); + // validate matrix + if (ms.length !== 1 || ms[0] !== n) { + // number of values in array must be n + throw new Error('Invalid matrix length'); + } + // define function + _value = function (i) { + // return value @ i + return value.get([i]); + }; + } else { + // define function + _value = function () { + // return value + return value; + }; + } + + // discover default value if needed + if (!defaultValue) { + // check first value in array + defaultValue = (0, _is.isBigNumber)(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero + : 0; + } + + // empty array + let data = []; + + // check we need to resize array + if (size.length > 0) { + // resize array + data = (0, _array.resize)(data, size, defaultValue); + // fill diagonal + for (let d = 0; d < n; d++) { + data[d + kSub][d + kSuper] = _value(d); + } + } + + // create DenseMatrix + return new DenseMatrix({ + data, + size: [rows, columns] + }); + }; + + /** + * Generate a matrix from a JSON object + * @memberof DenseMatrix + * @param {Object} json An object structured like + * `{"mathjs": "DenseMatrix", data: [], size: []}`, + * where mathjs is optional + * @returns {DenseMatrix} + */ + DenseMatrix.fromJSON = function (json) { + return new DenseMatrix(json); + }; + + /** + * Swap rows i and j in Matrix. + * + * @memberof DenseMatrix + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + DenseMatrix.prototype.swapRows = function (i, j) { + // check index + if (!(0, _is.isNumber)(i) || !(0, _number.isInteger)(i) || !(0, _is.isNumber)(j) || !(0, _number.isInteger)(j)) { + throw new Error('Row index must be positive integers'); + } + // check dimensions + if (this._size.length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + // validate index + (0, _array.validateIndex)(i, this._size[0]); + (0, _array.validateIndex)(j, this._size[0]); + + // swap rows + DenseMatrix._swapRows(i, j, this._data); + // return current instance + return this; + }; + + /** + * Swap rows i and j in Dense Matrix data structure. + * + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * @param {Array} data Matrix data + */ + DenseMatrix._swapRows = function (i, j, data) { + // swap values i <-> j + const vi = data[i]; + data[i] = data[j]; + data[j] = vi; + }; + + /** + * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and + * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays + * @memberof DenseMatrix + * @param {Array | Matrix} data + * @return {Array} data + */ + function preprocess(data) { + if ((0, _is.isMatrix)(data)) { + return preprocess(data.valueOf()); + } + if ((0, _is.isArray)(data)) { + return data.map(preprocess); + } + return data; + } + return DenseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js new file mode 100644 index 0000000..cd83f22 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js @@ -0,0 +1,357 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createFibonacciHeapClass = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'FibonacciHeap'; +const dependencies = ['smaller', 'larger']; +const createFibonacciHeapClass = exports.createFibonacciHeapClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + smaller, + larger + } = _ref; + const oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0); + + /** + * Fibonacci Heap implementation, used interally for Matrix math. + * @class FibonacciHeap + * @constructor FibonacciHeap + */ + function FibonacciHeap() { + if (!(this instanceof FibonacciHeap)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + + // initialize fields + this._minimum = null; + this._size = 0; + } + + /** + * Attach type information + */ + FibonacciHeap.prototype.type = 'FibonacciHeap'; + FibonacciHeap.prototype.isFibonacciHeap = true; + + /** + * Inserts a new data element into the heap. No heap consolidation is + * performed at this time, the new node is simply inserted into the root + * list of this heap. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.insert = function (key, value) { + // create node + const node = { + key, + value, + degree: 0 + }; + // check we have a node in the minimum + if (this._minimum) { + // minimum node + const minimum = this._minimum; + // update left & right of node + node.left = minimum; + node.right = minimum.right; + minimum.right = node; + node.right.left = node; + // update minimum node in heap if needed + if (smaller(key, minimum.key)) { + // node has a smaller key, use it as minimum + this._minimum = node; + } + } else { + // set left & right + node.left = node; + node.right = node; + // this is the first node + this._minimum = node; + } + // increment number of nodes in heap + this._size++; + // return node + return node; + }; + + /** + * Returns the number of nodes in heap. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.size = function () { + return this._size; + }; + + /** + * Removes all elements from this heap. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.clear = function () { + this._minimum = null; + this._size = 0; + }; + + /** + * Returns true if the heap is empty, otherwise false. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.isEmpty = function () { + return this._size === 0; + }; + + /** + * Extracts the node with minimum key from heap. Amortized running + * time: O(log n). + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.extractMinimum = function () { + // node to remove + const node = this._minimum; + // check we have a minimum + if (node === null) { + return node; + } + // current minimum + let minimum = this._minimum; + // get number of children + let numberOfChildren = node.degree; + // pointer to the first child + let x = node.child; + // for each child of node do... + while (numberOfChildren > 0) { + // store node in right side + const tempRight = x.right; + // remove x from child list + x.left.right = x.right; + x.right.left = x.left; + // add x to root list of heap + x.left = minimum; + x.right = minimum.right; + minimum.right = x; + x.right.left = x; + // set Parent[x] to null + x.parent = null; + x = tempRight; + numberOfChildren--; + } + // remove node from root list of heap + node.left.right = node.right; + node.right.left = node.left; + // update minimum + if (node === node.right) { + // empty + minimum = null; + } else { + // update minimum + minimum = node.right; + // we need to update the pointer to the root with minimum key + minimum = _findMinimumNode(minimum, this._size); + } + // decrement size of heap + this._size--; + // update minimum + this._minimum = minimum; + // return node + return node; + }; + + /** + * Removes a node from the heap given the reference to the node. The trees + * in the heap will be consolidated, if necessary. This operation may fail + * to remove the correct element if there are nodes with key value -Infinity. + * Running time: O(log n) amortized. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.remove = function (node) { + // decrease key value + this._minimum = _decreaseKey(this._minimum, node, -1); + // remove the smallest + this.extractMinimum(); + }; + + /** + * Decreases the key value for a heap node, given the new value to take on. + * The structure of the heap may be changed and will not be consolidated. + * Running time: O(1) amortized. + * @memberof FibonacciHeap + */ + function _decreaseKey(minimum, node, key) { + // set node key + node.key = key; + // get parent node + const parent = node.parent; + if (parent && smaller(node.key, parent.key)) { + // remove node from parent + _cut(minimum, node, parent); + // remove all nodes from parent to the root parent + _cascadingCut(minimum, parent); + } + // update minimum node if needed + if (smaller(node.key, minimum.key)) { + minimum = node; + } + // return minimum + return minimum; + } + + /** + * The reverse of the link operation: removes node from the child list of parent. + * This method assumes that min is non-null. Running time: O(1). + * @memberof FibonacciHeap + */ + function _cut(minimum, node, parent) { + // remove node from parent children and decrement Degree[parent] + node.left.right = node.right; + node.right.left = node.left; + parent.degree--; + // reset y.child if necessary + if (parent.child === node) { + parent.child = node.right; + } + // remove child if degree is 0 + if (parent.degree === 0) { + parent.child = null; + } + // add node to root list of heap + node.left = minimum; + node.right = minimum.right; + minimum.right = node; + node.right.left = node; + // set parent[node] to null + node.parent = null; + // set mark[node] to false + node.mark = false; + } + + /** + * Performs a cascading cut operation. This cuts node from its parent and then + * does the same for its parent, and so on up the tree. + * Running time: O(log n); O(1) excluding the recursion. + * @memberof FibonacciHeap + */ + function _cascadingCut(minimum, node) { + // store parent node + const parent = node.parent; + // if there's a parent... + if (!parent) { + return; + } + // if node is unmarked, set it marked + if (!node.mark) { + node.mark = true; + } else { + // it's marked, cut it from parent + _cut(minimum, node, parent); + // cut its parent as well + _cascadingCut(parent); + } + } + + /** + * Make the first node a child of the second one. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + const _linkNodes = function (node, parent) { + // remove node from root list of heap + node.left.right = node.right; + node.right.left = node.left; + // make node a Child of parent + node.parent = parent; + if (!parent.child) { + parent.child = node; + node.right = node; + node.left = node; + } else { + node.left = parent.child; + node.right = parent.child.right; + parent.child.right = node; + node.right.left = node; + } + // increase degree[parent] + parent.degree++; + // set mark[node] false + node.mark = false; + }; + function _findMinimumNode(minimum, size) { + // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree + const arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1; + // create list with initial capacity + const array = new Array(arraySize); + // find the number of root nodes. + let numRoots = 0; + let x = minimum; + if (x) { + numRoots++; + x = x.right; + while (x !== minimum) { + numRoots++; + x = x.right; + } + } + // vars + let y; + // For each node in root list do... + while (numRoots > 0) { + // access this node's degree.. + let d = x.degree; + // get next node + const next = x.right; + // check if there is a node already in array with the same degree + while (true) { + // get node with the same degree is any + y = array[d]; + if (!y) { + break; + } + // make one node with the same degree a child of the other, do this based on the key value. + if (larger(x.key, y.key)) { + const temp = y; + y = x; + x = temp; + } + // make y a child of x + _linkNodes(y, x); + // we have handled this degree, go to next one. + array[d] = null; + d++; + } + // save this node for later when we might encounter another of the same degree. + array[d] = x; + // move forward through list. + x = next; + numRoots--; + } + // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[]. + minimum = null; + // loop nodes in array + for (let i = 0; i < arraySize; i++) { + // get current node + y = array[i]; + if (!y) { + continue; + } + // check if we have a linked list + if (minimum) { + // First remove node from root list. + y.left.right = y.right; + y.right.left = y.left; + // now add to root list, again. + y.left = minimum; + y.right = minimum.right; + minimum.right = y; + y.right.left = y; + // check if this is a new min. + if (smaller(y.key, minimum.key)) { + minimum = y; + } + } else { + minimum = y; + } + } + return minimum; + } + return FibonacciHeap; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js new file mode 100644 index 0000000..9a43e05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js @@ -0,0 +1,227 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createImmutableDenseMatrixClass = void 0; +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _factory = require("../../utils/factory.js"); +const name = 'ImmutableDenseMatrix'; +const dependencies = ['smaller', 'DenseMatrix']; +const createImmutableDenseMatrixClass = exports.createImmutableDenseMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + smaller, + DenseMatrix + } = _ref; + function ImmutableDenseMatrix(data, datatype) { + if (!(this instanceof ImmutableDenseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !(0, _is.isString)(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if ((0, _is.isMatrix)(data) || (0, _is.isArray)(data)) { + // use DenseMatrix implementation + const matrix = new DenseMatrix(data, datatype); + // internal structures + this._data = matrix._data; + this._size = matrix._size; + this._datatype = matrix._datatype; + this._min = null; + this._max = null; + } else if (data && (0, _is.isArray)(data.data) && (0, _is.isArray)(data.size)) { + // initialize fields from JSON representation + this._data = data.data; + this._size = data.size; + this._datatype = data.datatype; + this._min = typeof data.min !== 'undefined' ? data.min : null; + this._max = typeof data.max !== 'undefined' ? data.max : null; + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + (0, _is.typeOf)(data) + ')'); + } else { + // nothing provided + this._data = []; + this._size = [0]; + this._datatype = datatype; + this._min = null; + this._max = null; + } + } + ImmutableDenseMatrix.prototype = new DenseMatrix(); + + /** + * Attach type information + */ + ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix'; + ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @param {Index} index + * @param {Array | ImmutableDenseMatrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + ImmutableDenseMatrix.prototype.subset = function (index) { + switch (arguments.length) { + case 1: + { + // use base implementation + const m = DenseMatrix.prototype.subset.call(this, index); + // check result is a matrix + if ((0, _is.isMatrix)(m)) { + // return immutable matrix + return new ImmutableDenseMatrix({ + data: m._data, + size: m._size, + datatype: m._datatype + }); + } + return m; + } + // intentional fall through + case 2: + case 3: + throw new Error('Cannot invoke set subset on an Immutable Matrix instance'); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + + /** + * Replace a single element in the matrix. + * @param {Number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {ImmutableDenseMatrix} self + */ + ImmutableDenseMatrix.prototype.set = function () { + throw new Error('Cannot invoke set on an Immutable Matrix instance'); + }; + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @param {Number[]} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + ImmutableDenseMatrix.prototype.resize = function () { + throw new Error('Cannot invoke resize on an Immutable Matrix instance'); + }; + + /** + * Disallows reshaping in favor of immutability. + * + * @throws {Error} Operation not allowed + */ + ImmutableDenseMatrix.prototype.reshape = function () { + throw new Error('Cannot invoke reshape on an Immutable Matrix instance'); + }; + + /** + * Create a clone of the matrix + * @return {ImmutableDenseMatrix} clone + */ + ImmutableDenseMatrix.prototype.clone = function () { + return new ImmutableDenseMatrix({ + data: (0, _object.clone)(this._data), + size: (0, _object.clone)(this._size), + datatype: this._datatype + }); + }; + + /** + * Get a JSON representation of the matrix + * @returns {Object} + */ + ImmutableDenseMatrix.prototype.toJSON = function () { + return { + mathjs: 'ImmutableDenseMatrix', + data: this._data, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Generate a matrix from a JSON object + * @param {Object} json An object structured like + * `{"mathjs": "ImmutableDenseMatrix", data: [], size: []}`, + * where mathjs is optional + * @returns {ImmutableDenseMatrix} + */ + ImmutableDenseMatrix.fromJSON = function (json) { + return new ImmutableDenseMatrix(json); + }; + + /** + * Swap rows i and j in Matrix. + * + * @param {Number} i Matrix row index 1 + * @param {Number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + ImmutableDenseMatrix.prototype.swapRows = function () { + throw new Error('Cannot invoke swapRows on an Immutable Matrix instance'); + }; + + /** + * Calculate the minimum value in the set + * @return {Number | undefined} min + */ + ImmutableDenseMatrix.prototype.min = function () { + // check min has been calculated before + if (this._min === null) { + // minimum + let m = null; + // compute min + this.forEach(function (v) { + if (m === null || smaller(v, m)) { + m = v; + } + }); + this._min = m !== null ? m : undefined; + } + return this._min; + }; + + /** + * Calculate the maximum value in the set + * @return {Number | undefined} max + */ + ImmutableDenseMatrix.prototype.max = function () { + // check max has been calculated before + if (this._max === null) { + // maximum + let m = null; + // compute max + this.forEach(function (v) { + if (m === null || smaller(m, v)) { + m = v; + } + }); + this._max = m !== null ? m : undefined; + } + return this._max; + }; + return ImmutableDenseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js new file mode 100644 index 0000000..2c0344d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js @@ -0,0 +1,248 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrixClass = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'Matrix'; +const dependencies = []; +const createMatrixClass = exports.createMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * @constructor Matrix + * + * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional + * array. A matrix can be constructed as: + * + * let matrix = math.matrix(data) + * + * Matrix contains the functions to resize, get and set values, get the size, + * clone the matrix and to convert the matrix to a vector, array, or scalar. + * Furthermore, one can iterate over the matrix using map and forEach. + * The internal Array of the Matrix can be accessed using the function valueOf. + * + * Example usage: + * + * let matrix = math.matrix([[1, 2], [3, 4]]) + * matix.size() // [2, 2] + * matrix.resize([3, 2], 5) + * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]] + * matrix.subset([1,2]) // 3 (indexes are zero-based) + * + */ + function Matrix() { + if (!(this instanceof Matrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + } + + /** + * Attach type information + */ + Matrix.prototype.type = 'Matrix'; + Matrix.prototype.isMatrix = true; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @return {string} The storage format. + */ + Matrix.prototype.storage = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke storage on a Matrix interface'); + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @return {string} The datatype. + */ + Matrix.prototype.datatype = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke datatype on a Matrix interface'); + }; + + /** + * Create a new Matrix With the type of the current matrix instance + * @param {Array | Object} data + * @param {string} [datatype] + */ + Matrix.prototype.create = function (data, datatype) { + throw new Error('Cannot invoke create on a Matrix interface'); + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + Matrix.prototype.subset = function (index, replacement, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke subset on a Matrix interface'); + }; + + /** + * Get a single element from the matrix. + * @param {number[]} index Zero-based index + * @return {*} value + */ + Matrix.prototype.get = function (index) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke get on a Matrix interface'); + }; + + /** + * Replace a single element in the matrix. + * @param {number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {Matrix} self + */ + Matrix.prototype.set = function (index, value, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke set on a Matrix interface'); + }; + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @param {number[]} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + Matrix.prototype.resize = function (size, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke resize on a Matrix interface'); + }; + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * @param {number[]} size The new size the matrix should have. + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + Matrix.prototype.reshape = function (size, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke reshape on a Matrix interface'); + }; + + /** + * Create a clone of the matrix + * @return {Matrix} clone + */ + Matrix.prototype.clone = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke clone on a Matrix interface'); + }; + + /** + * Retrieve the size of the matrix. + * @returns {number[]} size + */ + Matrix.prototype.size = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke size on a Matrix interface'); + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {Matrix} matrix + */ + Matrix.prototype.map = function (callback, skipZeros) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke map on a Matrix interface'); + }; + + /** + * Execute a callback function on each entry of the matrix. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + */ + Matrix.prototype.forEach = function (callback) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke forEach on a Matrix interface'); + }; + + /** + * Iterate over the matrix elements + * @return {Iterable<{ value, index: number[] }>} + */ + Matrix.prototype[Symbol.iterator] = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot iterate a Matrix interface'); + }; + + /** + * Create an Array with a copy of the data of the Matrix + * @returns {Array} array + */ + Matrix.prototype.toArray = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke toArray on a Matrix interface'); + }; + + /** + * Get the primitive value of the Matrix: a multidimensional array + * @returns {Array} array + */ + Matrix.prototype.valueOf = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke valueOf on a Matrix interface'); + }; + + /** + * Get a string representation of the matrix, with optional formatting options. + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + Matrix.prototype.format = function (options) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke format on a Matrix interface'); + }; + + /** + * Get a string representation of the matrix + * @returns {string} str + */ + Matrix.prototype.toString = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke toString on a Matrix interface'); + }; + return Matrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js new file mode 100644 index 0000000..98f3d78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js @@ -0,0 +1,304 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIndexClass = void 0; +var _is = require("../../utils/is.js"); +var _object = require("../../utils/object.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'Index'; +const dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType']; +const createIndexClass = exports.createIndexClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + ImmutableDenseMatrix, + getMatrixDataType + } = _ref; + /** + * Create an index. An Index can store ranges and sets for multiple dimensions. + * Matrix.get, Matrix.set, and math.subset accept an Index as input. + * + * Usage: + * const index = new Index(range1, range2, matrix1, array1, ...) + * + * Where each parameter can be any of: + * A number + * A string (containing a name of an object property) + * An instance of Range + * An Array with the Set values + * An Array with Booleans + * A Matrix with the Set values + * A Matrix with Booleans + * + * The parameters start, end, and step must be integer numbers. + * + * @class Index + * @Constructor Index + * @param {...*} ranges + */ + function Index(ranges) { + if (!(this instanceof Index)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this._dimensions = []; + this._sourceSize = []; + this._isScalar = true; + for (let i = 0, ii = arguments.length; i < ii; i++) { + const arg = arguments[i]; + const argIsArray = (0, _is.isArray)(arg); + const argIsMatrix = (0, _is.isMatrix)(arg); + let sourceSize = null; + if ((0, _is.isRange)(arg)) { + this._dimensions.push(arg); + this._isScalar = false; + } else if (argIsArray || argIsMatrix) { + // create matrix + let m; + if (getMatrixDataType(arg) === 'boolean') { + if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf()); + if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf()); + sourceSize = arg.valueOf().length; + } else { + m = _createImmutableMatrix(arg.valueOf()); + } + this._dimensions.push(m); + // size + const size = m.size(); + // scalar + if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) { + this._isScalar = false; + } + } else if (typeof arg === 'number') { + this._dimensions.push(_createImmutableMatrix([arg])); + } else if (typeof arg === 'string') { + // object property (arguments.count should be 1) + this._dimensions.push(arg); + } else { + throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range'); + } + this._sourceSize.push(sourceSize); + // TODO: implement support for wildcard '*' + } + } + + /** + * Attach type information + */ + Index.prototype.type = 'Index'; + Index.prototype.isIndex = true; + function _createImmutableMatrix(arg) { + // loop array elements + for (let i = 0, l = arg.length; i < l; i++) { + if (typeof arg[i] !== 'number' || !(0, _number.isInteger)(arg[i])) { + throw new TypeError('Index parameters must be positive integer numbers'); + } + } + // create matrix + return new ImmutableDenseMatrix(arg); + } + + /** + * Create a clone of the index + * @memberof Index + * @return {Index} clone + */ + Index.prototype.clone = function () { + const index = new Index(); + index._dimensions = (0, _object.clone)(this._dimensions); + index._isScalar = this._isScalar; + index._sourceSize = this._sourceSize; + return index; + }; + + /** + * Create an index from an array with ranges/numbers + * @memberof Index + * @param {Array.} ranges + * @return {Index} index + * @private + */ + Index.create = function (ranges) { + const index = new Index(); + Index.apply(index, ranges); + return index; + }; + + /** + * Retrieve the size of the index, the number of elements for each dimension. + * @memberof Index + * @returns {number[]} size + */ + Index.prototype.size = function () { + const size = []; + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + const d = this._dimensions[i]; + size[i] = typeof d === 'string' ? 1 : d.size()[0]; + } + return size; + }; + + /** + * Get the maximum value for each of the indexes ranges. + * @memberof Index + * @returns {number[]} max + */ + Index.prototype.max = function () { + const values = []; + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + const range = this._dimensions[i]; + values[i] = typeof range === 'string' ? range : range.max(); + } + return values; + }; + + /** + * Get the minimum value for each of the indexes ranges. + * @memberof Index + * @returns {number[]} min + */ + Index.prototype.min = function () { + const values = []; + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + const range = this._dimensions[i]; + values[i] = typeof range === 'string' ? range : range.min(); + } + return values; + }; + + /** + * Loop over each of the ranges of the index + * @memberof Index + * @param {Function} callback Called for each range with a Range as first + * argument, the dimension as second, and the + * index object as third. + */ + Index.prototype.forEach = function (callback) { + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + callback(this._dimensions[i], i, this); + } + }; + + /** + * Retrieve the dimension for the given index + * @memberof Index + * @param {Number} dim Number of the dimension + * @returns {Range | null} range + */ + Index.prototype.dimension = function (dim) { + return this._dimensions[dim] || null; + }; + + /** + * Test whether this index contains an object property + * @returns {boolean} Returns true if the index is an object property + */ + Index.prototype.isObjectProperty = function () { + return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string'; + }; + + /** + * Returns the object property name when the Index holds a single object property, + * else returns null + * @returns {string | null} + */ + Index.prototype.getObjectProperty = function () { + return this.isObjectProperty() ? this._dimensions[0] : null; + }; + + /** + * Test whether this index contains only a single value. + * + * This is the case when the index is created with only scalar values as ranges, + * not for ranges resolving into a single value. + * @memberof Index + * @return {boolean} isScalar + */ + Index.prototype.isScalar = function () { + return this._isScalar; + }; + + /** + * Expand the Index into an array. + * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]] + * @memberof Index + * @returns {Array} array + */ + Index.prototype.toArray = function () { + const array = []; + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + const dimension = this._dimensions[i]; + array.push(typeof dimension === 'string' ? dimension : dimension.toArray()); + } + return array; + }; + + /** + * Get the primitive value of the Index, a two dimensional array. + * Equivalent to Index.toArray(). + * @memberof Index + * @returns {Array} array + */ + Index.prototype.valueOf = Index.prototype.toArray; + + /** + * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]' + * @memberof Index + * @returns {String} str + */ + Index.prototype.toString = function () { + const strings = []; + for (let i = 0, ii = this._dimensions.length; i < ii; i++) { + const dimension = this._dimensions[i]; + if (typeof dimension === 'string') { + strings.push(JSON.stringify(dimension)); + } else { + strings.push(dimension.toString()); + } + } + return '[' + strings.join(', ') + ']'; + }; + + /** + * Get a JSON representation of the Index + * @memberof Index + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Index", "ranges": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}` + */ + Index.prototype.toJSON = function () { + return { + mathjs: 'Index', + dimensions: this._dimensions + }; + }; + + /** + * Instantiate an Index from a JSON object + * @memberof Index + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Index", "dimensions": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}` + * @return {Index} + */ + Index.fromJSON = function (json) { + return Index.create(json.dimensions); + }; + return Index; +}, { + isClass: true +}); + +/** + * Receives an array of booleans and returns an array of Numbers for Index + * @param {Array} booleanArrayIndex An array of booleans + * @return {Array} A set of numbers ready for index + */ +function _booleansArrayToNumbersForIndex(booleanArrayIndex) { + // gets an array of booleans and returns an array of numbers + const indexOfNumbers = []; + booleanArrayIndex.forEach((bool, idx) => { + if (bool) { + indexOfNumbers.push(idx); + } + }); + return indexOfNumbers; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Range.js new file mode 100644 index 0000000..ed0d58e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Range.js @@ -0,0 +1,310 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRangeClass = void 0; +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +var _factory = require("../../utils/factory.js"); +const name = 'Range'; +const dependencies = []; +const createRangeClass = exports.createRangeClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * Create a range. A range has a start, step, and end, and contains functions + * to iterate over the range. + * + * A range can be constructed as: + * + * const range = new Range(start, end) + * const range = new Range(start, end, step) + * + * To get the result of the range: + * range.forEach(function (x) { + * console.log(x) + * }) + * range.map(function (x) { + * return math.sin(x) + * }) + * range.toArray() + * + * Example usage: + * + * const c = new Range(2, 6) // 2:1:5 + * c.toArray() // [2, 3, 4, 5] + * const d = new Range(2, -3, -1) // 2:-1:-2 + * d.toArray() // [2, 1, 0, -1, -2] + * + * @class Range + * @constructor Range + * @param {number} start included lower bound + * @param {number} end excluded upper bound + * @param {number} [step] step size, default value is 1 + */ + function Range(start, end, step) { + if (!(this instanceof Range)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + const hasStart = start !== null && start !== undefined; + const hasEnd = end !== null && end !== undefined; + const hasStep = step !== null && step !== undefined; + if (hasStart) { + if ((0, _is.isBigNumber)(start)) { + start = start.toNumber(); + } else if (typeof start !== 'number') { + throw new TypeError('Parameter start must be a number'); + } + } + if (hasEnd) { + if ((0, _is.isBigNumber)(end)) { + end = end.toNumber(); + } else if (typeof end !== 'number') { + throw new TypeError('Parameter end must be a number'); + } + } + if (hasStep) { + if ((0, _is.isBigNumber)(step)) { + step = step.toNumber(); + } else if (typeof step !== 'number') { + throw new TypeError('Parameter step must be a number'); + } + } + this.start = hasStart ? parseFloat(start) : 0; + this.end = hasEnd ? parseFloat(end) : 0; + this.step = hasStep ? parseFloat(step) : 1; + } + + /** + * Attach type information + */ + Range.prototype.type = 'Range'; + Range.prototype.isRange = true; + + /** + * Parse a string into a range, + * The string contains the start, optional step, and end, separated by a colon. + * If the string does not contain a valid range, null is returned. + * For example str='0:2:11'. + * @memberof Range + * @param {string} str + * @return {Range | null} range + */ + Range.parse = function (str) { + if (typeof str !== 'string') { + return null; + } + const args = str.split(':'); + const nums = args.map(function (arg) { + return parseFloat(arg); + }); + const invalid = nums.some(function (num) { + return isNaN(num); + }); + if (invalid) { + return null; + } + switch (nums.length) { + case 2: + return new Range(nums[0], nums[1]); + case 3: + return new Range(nums[0], nums[2], nums[1]); + default: + return null; + } + }; + + /** + * Create a clone of the range + * @return {Range} clone + */ + Range.prototype.clone = function () { + return new Range(this.start, this.end, this.step); + }; + + /** + * Retrieve the size of the range. + * Returns an array containing one number, the number of elements in the range. + * @memberof Range + * @returns {number[]} size + */ + Range.prototype.size = function () { + let len = 0; + const start = this.start; + const step = this.step; + const end = this.end; + const diff = end - start; + if ((0, _number.sign)(step) === (0, _number.sign)(diff)) { + len = Math.ceil(diff / step); + } else if (diff === 0) { + len = 0; + } + if (isNaN(len)) { + len = 0; + } + return [len]; + }; + + /** + * Calculate the minimum value in the range + * @memberof Range + * @return {number | undefined} min + */ + Range.prototype.min = function () { + const size = this.size()[0]; + if (size > 0) { + if (this.step > 0) { + // positive step + return this.start; + } else { + // negative step + return this.start + (size - 1) * this.step; + } + } else { + return undefined; + } + }; + + /** + * Calculate the maximum value in the range + * @memberof Range + * @return {number | undefined} max + */ + Range.prototype.max = function () { + const size = this.size()[0]; + if (size > 0) { + if (this.step > 0) { + // positive step + return this.start + (size - 1) * this.step; + } else { + // negative step + return this.start; + } + } else { + return undefined; + } + }; + + /** + * Execute a callback function for each value in the range. + * @memberof Range + * @param {function} callback The callback method is invoked with three + * parameters: the value of the element, the index + * of the element, and the Range being traversed. + */ + Range.prototype.forEach = function (callback) { + let x = this.start; + const step = this.step; + const end = this.end; + let i = 0; + if (step > 0) { + while (x < end) { + callback(x, [i], this); + x += step; + i++; + } + } else if (step < 0) { + while (x > end) { + callback(x, [i], this); + x += step; + i++; + } + } + }; + + /** + * Execute a callback function for each value in the Range, and return the + * results as an array + * @memberof Range + * @param {function} callback The callback method is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @returns {Array} array + */ + Range.prototype.map = function (callback) { + const array = []; + this.forEach(function (value, index, obj) { + array[index[0]] = callback(value, index, obj); + }); + return array; + }; + + /** + * Create an Array with a copy of the Ranges data + * @memberof Range + * @returns {Array} array + */ + Range.prototype.toArray = function () { + const array = []; + this.forEach(function (value, index) { + array[index[0]] = value; + }); + return array; + }; + + /** + * Get the primitive value of the Range, a one dimensional array + * @memberof Range + * @returns {Array} array + */ + Range.prototype.valueOf = function () { + // TODO: implement a caching mechanism for range.valueOf() + return this.toArray(); + }; + + /** + * Get a string representation of the range, with optional formatting options. + * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11' + * @memberof Range + * @param {Object | number | function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + Range.prototype.format = function (options) { + let str = (0, _number.format)(this.start, options); + if (this.step !== 1) { + str += ':' + (0, _number.format)(this.step, options); + } + str += ':' + (0, _number.format)(this.end, options); + return str; + }; + + /** + * Get a string representation of the range. + * @memberof Range + * @returns {string} + */ + Range.prototype.toString = function () { + return this.format(); + }; + + /** + * Get a JSON representation of the range + * @memberof Range + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` + */ + Range.prototype.toJSON = function () { + return { + mathjs: 'Range', + start: this.start, + end: this.end, + step: this.step + }; + }; + + /** + * Instantiate a Range from a JSON object + * @memberof Range + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` + * @return {Range} + */ + Range.fromJSON = function (json) { + return new Range(json.start, json.end, json.step); + }; + return Range; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Spa.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Spa.js new file mode 100644 index 0000000..b38bea2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/Spa.js @@ -0,0 +1,142 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSpaClass = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'Spa'; +const dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap']; +const createSpaClass = exports.createSpaClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + addScalar, + equalScalar, + FibonacciHeap + } = _ref; + /** + * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array + * of the vector elements and an ordered list of non-zero elements. + */ + function Spa() { + if (!(this instanceof Spa)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + + // allocate vector, TODO use typed arrays + this._values = []; + this._heap = new FibonacciHeap(); + } + + /** + * Attach type information + */ + Spa.prototype.type = 'Spa'; + Spa.prototype.isSpa = true; + + /** + * Set the value for index i. + * + * @param {number} i The index + * @param {number | BigNumber | Complex} The value at index i + */ + Spa.prototype.set = function (i, v) { + // check we have a value @ i + if (!this._values[i]) { + // insert in heap + const node = this._heap.insert(i, v); + // set the value @ i + this._values[i] = node; + } else { + // update the value @ i + this._values[i].value = v; + } + }; + Spa.prototype.get = function (i) { + const node = this._values[i]; + if (node) { + return node.value; + } + return 0; + }; + Spa.prototype.accumulate = function (i, v) { + // node @ i + let node = this._values[i]; + if (!node) { + // insert in heap + node = this._heap.insert(i, v); + // initialize value + this._values[i] = node; + } else { + // accumulate value + node.value = addScalar(node.value, v); + } + }; + Spa.prototype.forEach = function (from, to, callback) { + // references + const heap = this._heap; + const values = this._values; + // nodes + const nodes = []; + // node with minimum key, save it + let node = heap.extractMinimum(); + if (node) { + nodes.push(node); + } + // extract nodes from heap (ordered) + while (node && node.key <= to) { + // check it is in range + if (node.key >= from) { + // check value is not zero + if (!equalScalar(node.value, 0)) { + // invoke callback + callback(node.key, node.value, this); + } + } + // extract next node, save it + node = heap.extractMinimum(); + if (node) { + nodes.push(node); + } + } + // reinsert all nodes in heap + for (let i = 0; i < nodes.length; i++) { + // current node + const n = nodes[i]; + // insert node in heap + node = heap.insert(n.key, n.value); + // update values + values[node.key] = node; + } + }; + Spa.prototype.swap = function (i, j) { + // node @ i and j + let nodei = this._values[i]; + let nodej = this._values[j]; + // check we need to insert indeces + if (!nodei && nodej) { + // insert in heap + nodei = this._heap.insert(i, nodej.value); + // remove from heap + this._heap.remove(nodej); + // set values + this._values[i] = nodei; + this._values[j] = undefined; + } else if (nodei && !nodej) { + // insert in heap + nodej = this._heap.insert(j, nodei.value); + // remove from heap + this._heap.remove(nodei); + // set values + this._values[j] = nodej; + this._values[i] = undefined; + } else if (nodei && nodej) { + // swap values + const v = nodei.value; + nodei.value = nodej.value; + nodej.value = v; + } + }; + return Spa; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js new file mode 100644 index 0000000..328b46c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js @@ -0,0 +1,1492 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSparseMatrixClass = void 0; +var _is = require("../../utils/is.js"); +var _number = require("../../utils/number.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +var _array = require("../../utils/array.js"); +var _factory = require("../../utils/factory.js"); +var _DimensionError = require("../../error/DimensionError.js"); +var _optimizeCallback = require("../../utils/optimizeCallback.js"); +const name = 'SparseMatrix'; +const dependencies = ['typed', 'equalScalar', 'Matrix']; +const createSparseMatrixClass = exports.createSparseMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar, + Matrix + } = _ref; + /** + * Sparse Matrix implementation. This type implements + * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS)) + * format for two-dimensional sparse matrices. + * @class SparseMatrix + */ + function SparseMatrix(data, datatype) { + if (!(this instanceof SparseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !(0, _is.isString)(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if ((0, _is.isMatrix)(data)) { + // create from matrix + _createFromMatrix(this, data, datatype); + } else if (data && (0, _is.isArray)(data.index) && (0, _is.isArray)(data.ptr) && (0, _is.isArray)(data.size)) { + // initialize fields + this._values = data.values; + this._index = data.index; + this._ptr = data.ptr; + this._size = data.size; + this._datatype = datatype || data.datatype; + } else if ((0, _is.isArray)(data)) { + // create from array + _createFromArray(this, data, datatype); + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + (0, _is.typeOf)(data) + ')'); + } else { + // nothing provided + this._values = []; + this._index = []; + this._ptr = [0]; + this._size = [0, 0]; + this._datatype = datatype; + } + } + function _createFromMatrix(matrix, source, datatype) { + // check matrix type + if (source.type === 'SparseMatrix') { + // clone arrays + matrix._values = source._values ? (0, _object.clone)(source._values) : undefined; + matrix._index = (0, _object.clone)(source._index); + matrix._ptr = (0, _object.clone)(source._ptr); + matrix._size = (0, _object.clone)(source._size); + matrix._datatype = datatype || source._datatype; + } else { + // build from matrix data + _createFromArray(matrix, source.valueOf(), datatype || source._datatype); + } + } + function _createFromArray(matrix, data, datatype) { + // initialize fields + matrix._values = []; + matrix._index = []; + matrix._ptr = []; + matrix._datatype = datatype; + // discover rows & columns, do not use math.size() to avoid looping array twice + const rows = data.length; + let columns = 0; + + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + if ((0, _is.isString)(datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, datatype); + } + + // check we have rows (empty array) + if (rows > 0) { + // column index + let j = 0; + do { + // store pointer to values index + matrix._ptr.push(matrix._index.length); + // loop rows + for (let i = 0; i < rows; i++) { + // current row + const row = data[i]; + // check row is an array + if ((0, _is.isArray)(row)) { + // update columns if needed (only on first column) + if (j === 0 && columns < row.length) { + columns = row.length; + } + // check row has column + if (j < row.length) { + // value + const v = row[j]; + // check value != 0 + if (!eq(v, zero)) { + // store value + matrix._values.push(v); + // index + matrix._index.push(i); + } + } + } else { + // update columns if needed (only on first column) + if (j === 0 && columns < 1) { + columns = 1; + } + // check value != 0 (row is a scalar) + if (!eq(row, zero)) { + // store value + matrix._values.push(row); + // index + matrix._index.push(i); + } + } + } + // increment index + j++; + } while (j < columns); + } + // store number of values in ptr + matrix._ptr.push(matrix._index.length); + // size + matrix._size = [rows, columns]; + } + SparseMatrix.prototype = new Matrix(); + + /** + * Create a new SparseMatrix + */ + SparseMatrix.prototype.createSparseMatrix = function (data, datatype) { + return new SparseMatrix(data, datatype); + }; + + /** + * Attach type information + */ + Object.defineProperty(SparseMatrix, 'name', { + value: 'SparseMatrix' + }); + SparseMatrix.prototype.constructor = SparseMatrix; + SparseMatrix.prototype.type = 'SparseMatrix'; + SparseMatrix.prototype.isSparseMatrix = true; + + /** + * Get the matrix type + * + * Usage: + * const matrixType = matrix.getDataType() // retrieves the matrix type + * + * @memberOf SparseMatrix + * @return {string} type information; if multiple types are found from the Matrix, it will return "mixed" + */ + SparseMatrix.prototype.getDataType = function () { + return (0, _array.getArrayDataType)(this._values, _is.typeOf); + }; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @memberof SparseMatrix + * @return {string} The storage format. + */ + SparseMatrix.prototype.storage = function () { + return 'sparse'; + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @memberof SparseMatrix + * @return {string} The datatype. + */ + SparseMatrix.prototype.datatype = function () { + return this._datatype; + }; + + /** + * Create a new SparseMatrix + * @memberof SparseMatrix + * @param {Array} data + * @param {string} [datatype] + */ + SparseMatrix.prototype.create = function (data, datatype) { + return new SparseMatrix(data, datatype); + }; + + /** + * Get the matrix density. + * + * Usage: + * const density = matrix.density() // retrieve matrix density + * + * @memberof SparseMatrix + * @return {number} The matrix density. + */ + SparseMatrix.prototype.density = function () { + // rows & columns + const rows = this._size[0]; + const columns = this._size[1]; + // calculate density + return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0; + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @memberof SparseMatrix + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + SparseMatrix.prototype.subset = function (index, replacement, defaultValue) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke subset on a Pattern only matrix'); + } + + // check arguments + switch (arguments.length) { + case 1: + return _getsubset(this, index); + + // intentional fall through + case 2: + case 3: + return _setsubset(this, index, replacement, defaultValue); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + function _getsubset(matrix, idx) { + // check idx + if (!(0, _is.isIndex)(idx)) { + throw new TypeError('Invalid index'); + } + const isScalar = idx.isScalar(); + if (isScalar) { + // return a scalar + return matrix.get(idx.min()); + } + // validate dimensions + const size = idx.size(); + if (size.length !== matrix._size.length) { + throw new _DimensionError.DimensionError(size.length, matrix._size.length); + } + + // vars + let i, ii, k, kk; + + // validate if any of the ranges in the index is out of range + const min = idx.min(); + const max = idx.max(); + for (i = 0, ii = matrix._size.length; i < ii; i++) { + (0, _array.validateIndex)(min[i], matrix._size[i]); + (0, _array.validateIndex)(max[i], matrix._size[i]); + } + + // matrix arrays + const mvalues = matrix._values; + const mindex = matrix._index; + const mptr = matrix._ptr; + + // rows & columns dimensions for result matrix + const rows = idx.dimension(0); + const columns = idx.dimension(1); + + // workspace & permutation vector + const w = []; + const pv = []; + + // loop rows in resulting matrix + rows.forEach(function (i, r) { + // update permutation vector + pv[i] = r[0]; + // mark i in workspace + w[i] = true; + }); + + // result matrix arrays + const values = mvalues ? [] : undefined; + const index = []; + const ptr = []; + + // loop columns in result matrix + columns.forEach(function (j) { + // update ptr + ptr.push(index.length); + // loop values in column j + for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) { + // row + i = mindex[k]; + // check row is in result matrix + if (w[i] === true) { + // push index + index.push(pv[i]); + // check we need to process values + if (values) { + values.push(mvalues[k]); + } + } + } + }); + // update ptr + ptr.push(index.length); + + // return matrix + return new SparseMatrix({ + values, + index, + ptr, + size, + datatype: matrix._datatype + }); + } + function _setsubset(matrix, index, submatrix, defaultValue) { + // check index + if (!index || index.isIndex !== true) { + throw new TypeError('Invalid index'); + } + + // get index size and check whether the index contains a single value + const iSize = index.size(); + const isScalar = index.isScalar(); + + // calculate the size of the submatrix, and convert it into an Array if needed + let sSize; + if ((0, _is.isMatrix)(submatrix)) { + // submatrix size + sSize = submatrix.size(); + // use array representation + submatrix = submatrix.toArray(); + } else { + // get submatrix size (array, scalar) + sSize = (0, _array.arraySize)(submatrix); + } + + // check index is a scalar + if (isScalar) { + // verify submatrix is a scalar + if (sSize.length !== 0) { + throw new TypeError('Scalar expected'); + } + // set value + matrix.set(index.min(), submatrix, defaultValue); + } else { + // validate dimensions, index size must be one or two dimensions + if (iSize.length !== 1 && iSize.length !== 2) { + throw new _DimensionError.DimensionError(iSize.length, matrix._size.length, '<'); + } + + // check submatrix and index have the same dimensions + if (sSize.length < iSize.length) { + // calculate number of missing outer dimensions + let i = 0; + let outer = 0; + while (iSize[i] === 1 && sSize[i] === 1) { + i++; + } + while (iSize[i] === 1) { + outer++; + i++; + } + // unsqueeze both outer and inner dimensions + submatrix = (0, _array.unsqueeze)(submatrix, iSize.length, outer, sSize); + } + + // check whether the size of the submatrix matches the index size + if (!(0, _object.deepStrictEqual)(iSize, sSize)) { + throw new _DimensionError.DimensionError(iSize, sSize, '>'); + } + + // insert the sub matrix + if (iSize.length === 1) { + // if the replacement index only has 1 dimension, go trough each one and set its value + const range = index.dimension(0); + range.forEach(function (dataIndex, subIndex) { + (0, _array.validateIndex)(dataIndex); + matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue); + }); + } else { + // if the replacement index has 2 dimensions, go through each one and set the value in the correct index + const firstDimensionRange = index.dimension(0); + const secondDimensionRange = index.dimension(1); + firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) { + (0, _array.validateIndex)(firstDataIndex); + secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) { + (0, _array.validateIndex)(secondDataIndex); + matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue); + }); + }); + } + } + return matrix; + } + + /** + * Get a single element from the matrix. + * @memberof SparseMatrix + * @param {number[]} index Zero-based index + * @return {*} value + */ + SparseMatrix.prototype.get = function (index) { + if (!(0, _is.isArray)(index)) { + throw new TypeError('Array expected'); + } + if (index.length !== this._size.length) { + throw new _DimensionError.DimensionError(index.length, this._size.length); + } + + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke get on a Pattern only matrix'); + } + + // row and column + const i = index[0]; + const j = index[1]; + + // check i, j are valid + (0, _array.validateIndex)(i, this._size[0]); + (0, _array.validateIndex)(j, this._size[1]); + + // find value index + const k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index); + // check k is prior to next column k and it is in the correct row + if (k < this._ptr[j + 1] && this._index[k] === i) { + return this._values[k]; + } + return 0; + }; + + /** + * Replace a single element in the matrix. + * @memberof SparseMatrix + * @param {number[]} index Zero-based index + * @param {*} v + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be set to zero. + * @return {SparseMatrix} self + */ + SparseMatrix.prototype.set = function (index, v, defaultValue) { + if (!(0, _is.isArray)(index)) { + throw new TypeError('Array expected'); + } + if (index.length !== this._size.length) { + throw new _DimensionError.DimensionError(index.length, this._size.length); + } + + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke set on a Pattern only matrix'); + } + + // row and column + const i = index[0]; + const j = index[1]; + + // rows & columns + let rows = this._size[0]; + let columns = this._size[1]; + + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + if ((0, _is.isString)(this._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, this._datatype); + } + + // check we need to resize matrix + if (i > rows - 1 || j > columns - 1) { + // resize matrix + _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue); + // update rows & columns + rows = this._size[0]; + columns = this._size[1]; + } + + // check i, j are valid + (0, _array.validateIndex)(i, rows); + (0, _array.validateIndex)(j, columns); + + // find value index + const k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index); + // check k is prior to next column k and it is in the correct row + if (k < this._ptr[j + 1] && this._index[k] === i) { + // check value != 0 + if (!eq(v, zero)) { + // update value + this._values[k] = v; + } else { + // remove value from matrix + _remove(k, j, this._values, this._index, this._ptr); + } + } else { + if (!eq(v, zero)) { + // insert value @ (i, j) + _insert(k, i, j, v, this._values, this._index, this._ptr); + } + } + return this; + }; + function _getValueIndex(i, top, bottom, index) { + // check row is on the bottom side + if (bottom - top === 0) { + return bottom; + } + // loop rows [top, bottom[ + for (let r = top; r < bottom; r++) { + // check we found value index + if (index[r] === i) { + return r; + } + } + // we did not find row + return top; + } + function _remove(k, j, values, index, ptr) { + // remove value @ k + values.splice(k, 1); + index.splice(k, 1); + // update pointers + for (let x = j + 1; x < ptr.length; x++) { + ptr[x]--; + } + } + function _insert(k, i, j, v, values, index, ptr) { + // insert value + values.splice(k, 0, v); + // update row for k + index.splice(k, 0, i); + // update column pointers + for (let x = j + 1; x < ptr.length; x++) { + ptr[x]++; + } + } + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @memberof SparseMatrix + * @param {number[] | Matrix} size The new size the matrix should have. + * Since sparse matrices are always two-dimensional, + * size must be two numbers in either an array or a matrix + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + SparseMatrix.prototype.resize = function (size, defaultValue, copy) { + // validate arguments + if (!(0, _is.isCollection)(size)) { + throw new TypeError('Array or Matrix expected'); + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + const sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 ? value[0] : value; + }); + if (sizeArray.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // check sizes + sizeArray.forEach(function (value) { + if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || value < 0) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + (0, _string.format)(sizeArray) + ')'); + } + }); + + // matrix to resize + const m = copy ? this.clone() : this; + // resize matrix + return _resize(m, sizeArray[0], sizeArray[1], defaultValue); + }; + function _resize(matrix, rows, columns, defaultValue) { + // value to insert at the time of growing matrix + let value = defaultValue || 0; + + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + if ((0, _is.isString)(matrix._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, matrix._datatype); + // convert value to the same datatype + value = typed.convert(value, matrix._datatype); + } + + // should we insert the value? + const ins = !eq(value, zero); + + // old columns and rows + const r = matrix._size[0]; + let c = matrix._size[1]; + let i, j, k; + + // check we need to increase columns + if (columns > c) { + // loop new columns + for (j = c; j < columns; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._values.length; + // check we need to insert matrix._values + if (ins) { + // loop rows + for (i = 0; i < r; i++) { + // add new matrix._values + matrix._values.push(value); + // update matrix._index + matrix._index.push(i); + } + } + } + // store number of matrix._values in matrix._ptr + matrix._ptr[columns] = matrix._values.length; + } else if (columns < c) { + // truncate matrix._ptr + matrix._ptr.splice(columns + 1, c - columns); + // truncate matrix._values and matrix._index + matrix._values.splice(matrix._ptr[columns], matrix._values.length); + matrix._index.splice(matrix._ptr[columns], matrix._index.length); + } + // update columns + c = columns; + + // check we need to increase rows + if (rows > r) { + // check we have to insert values + if (ins) { + // inserts + let n = 0; + // loop columns + for (j = 0; j < c; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._ptr[j] + n; + // where to insert matrix._values + k = matrix._ptr[j + 1] + n; + // pointer + let p = 0; + // loop new rows, initialize pointer + for (i = r; i < rows; i++, p++) { + // add value + matrix._values.splice(k + p, 0, value); + // update matrix._index + matrix._index.splice(k + p, 0, i); + // increment inserts + n++; + } + } + // store number of matrix._values in matrix._ptr + matrix._ptr[c] = matrix._values.length; + } + } else if (rows < r) { + // deletes + let d = 0; + // loop columns + for (j = 0; j < c; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._ptr[j] - d; + // where matrix._values start for next column + const k0 = matrix._ptr[j]; + const k1 = matrix._ptr[j + 1] - d; + // loop matrix._index + for (k = k0; k < k1; k++) { + // row + i = matrix._index[k]; + // check we need to delete value and matrix._index + if (i > rows - 1) { + // remove value + matrix._values.splice(k, 1); + // remove item from matrix._index + matrix._index.splice(k, 1); + // increase deletes + d++; + } + } + } + // update matrix._ptr for current column + matrix._ptr[j] = matrix._values.length; + } + // update matrix._size + matrix._size[0] = rows; + matrix._size[1] = columns; + // return matrix + return matrix; + } + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * NOTE: This might be better suited to copy by default, instead of modifying + * in place. For now, it operates in place to remain consistent with + * resize(). + * + * @memberof SparseMatrix + * @param {number[]} sizes The new size the matrix should have. + * Since sparse matrices are always two-dimensional, + * size must be two numbers in either an array or a matrix + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + SparseMatrix.prototype.reshape = function (sizes, copy) { + // validate arguments + if (!(0, _is.isArray)(sizes)) { + throw new TypeError('Array expected'); + } + if (sizes.length !== 2) { + throw new Error('Sparse matrices can only be reshaped in two dimensions'); + } + + // check sizes + sizes.forEach(function (value) { + if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || value <= -2 || value === 0) { + throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + (0, _string.format)(sizes) + ')'); + } + }); + const currentLength = this._size[0] * this._size[1]; + sizes = (0, _array.processSizesWildcard)(sizes, currentLength); + const newLength = sizes[0] * sizes[1]; + + // m * n must not change + if (currentLength !== newLength) { + throw new Error('Reshaping sparse matrix will result in the wrong number of elements'); + } + + // matrix to reshape + const m = copy ? this.clone() : this; + + // return unchanged if the same shape + if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) { + return m; + } + + // Convert to COO format (generate a column index) + const colIndex = []; + for (let i = 0; i < m._ptr.length; i++) { + for (let j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) { + colIndex.push(i); + } + } + + // Clone the values array + const values = m._values.slice(); + + // Clone the row index array + const rowIndex = m._index.slice(); + + // Transform the (row, column) indices + for (let i = 0; i < m._index.length; i++) { + const r1 = rowIndex[i]; + const c1 = colIndex[i]; + const flat = r1 * m._size[1] + c1; + colIndex[i] = flat % sizes[1]; + rowIndex[i] = Math.floor(flat / sizes[1]); + } + + // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored + // in column-major order, so we have to reorder the value array now. One option is to use a multisort, + // sorting several arrays based on some other array. + + // OR, we could easily just: + + // 1. Remove all values from the matrix + m._values.length = 0; + m._index.length = 0; + m._ptr.length = sizes[1] + 1; + m._size = sizes.slice(); + for (let i = 0; i < m._ptr.length; i++) { + m._ptr[i] = 0; + } + + // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set) + // This step is probably the most time-consuming + for (let h = 0; h < values.length; h++) { + const i = rowIndex[h]; + const j = colIndex[h]; + const v = values[h]; + const k = _getValueIndex(i, m._ptr[j], m._ptr[j + 1], m._index); + _insert(k, i, j, v, m._values, m._index, m._ptr); + } + + // The value indices are inserted out of order, but apparently that's... still OK? + + return m; + }; + + /** + * Create a clone of the matrix + * @memberof SparseMatrix + * @return {SparseMatrix} clone + */ + SparseMatrix.prototype.clone = function () { + const m = new SparseMatrix({ + values: this._values ? (0, _object.clone)(this._values) : undefined, + index: (0, _object.clone)(this._index), + ptr: (0, _object.clone)(this._ptr), + size: (0, _object.clone)(this._size), + datatype: this._datatype + }); + return m; + }; + + /** + * Retrieve the size of the matrix. + * @memberof SparseMatrix + * @returns {number[]} size + */ + SparseMatrix.prototype.size = function () { + return this._size.slice(0); // copy the Array + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @memberof SparseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {SparseMatrix} matrix + */ + SparseMatrix.prototype.map = function (callback, skipZeros) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke map on a Pattern only matrix'); + } + // matrix instance + const me = this; + // rows and columns + const rows = this._size[0]; + const columns = this._size[1]; + const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me, 'map'); + // invoke callback + const invoke = function (v, i, j) { + // invoke callback + return fastCallback(v, [i, j], me); + }; + // invoke _map + return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros); + }; + + /** + * Create a new matrix with the results of the callback function executed on the interval + * [minRow..maxRow, minColumn..maxColumn]. + */ + function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) { + // result arrays + const values = []; + const index = []; + const ptr = []; + + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + if ((0, _is.isString)(matrix._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, matrix._datatype); + } + + // invoke callback + const invoke = function (v, x, y) { + // invoke callback + const value = callback(v, x, y); + // check value != 0 + if (!eq(value, zero)) { + // store value + values.push(value); + // index + index.push(x); + } + }; + // loop columns + for (let j = minColumn; j <= maxColumn; j++) { + // store pointer to values index + ptr.push(values.length); + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = matrix._ptr[j]; + const k1 = matrix._ptr[j + 1]; + if (skipZeros) { + // loop k within [k0, k1[ + for (let k = k0; k < k1; k++) { + // row index + const i = matrix._index[k]; + // check i is in range + if (i >= minRow && i <= maxRow) { + // value @ k + invoke(matrix._values[k], i - minRow, j - minColumn); + } + } + } else { + // create a cache holding all defined values + const values = {}; + for (let k = k0; k < k1; k++) { + const i = matrix._index[k]; + values[i] = matrix._values[k]; + } + + // loop over all rows (indexes can be unordered so we can't use that), + // and either read the value or zero + for (let i = minRow; i <= maxRow; i++) { + const value = i in values ? values[i] : 0; + invoke(value, i - minRow, j - minColumn); + } + } + } + + // store number of values in ptr + ptr.push(values.length); + // return sparse matrix + return new SparseMatrix({ + values, + index, + ptr, + size: [maxRow - minRow + 1, maxColumn - minColumn + 1] + }); + } + + /** + * Execute a callback function on each entry of the matrix. + * @memberof SparseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * If false, the indices are guaranteed to be in order, + * if true, the indices can be unordered. + */ + SparseMatrix.prototype.forEach = function (callback, skipZeros) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke forEach on a Pattern only matrix'); + } + // matrix instance + const me = this; + // rows and columns + const rows = this._size[0]; + const columns = this._size[1]; + const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me, 'forEach'); + // loop columns + for (let j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = this._ptr[j]; + const k1 = this._ptr[j + 1]; + if (skipZeros) { + // loop k within [k0, k1[ + for (let k = k0; k < k1; k++) { + // row index + const i = this._index[k]; + + // value @ k + fastCallback(this._values[k], [i, j], me); + } + } else { + // create a cache holding all defined values + const values = {}; + for (let k = k0; k < k1; k++) { + const i = this._index[k]; + values[i] = this._values[k]; + } + + // loop over all rows (indexes can be unordered so we can't use that), + // and either read the value or zero + for (let i = 0; i < rows; i++) { + const value = i in values ? values[i] : 0; + fastCallback(value, [i, j], me); + } + } + } + }; + + /** + * Iterate over the matrix elements, skipping zeros + * @return {Iterable<{ value, index: number[] }>} + */ + SparseMatrix.prototype[Symbol.iterator] = function* () { + if (!this._values) { + throw new Error('Cannot iterate a Pattern only matrix'); + } + const columns = this._size[1]; + for (let j = 0; j < columns; j++) { + const k0 = this._ptr[j]; + const k1 = this._ptr[j + 1]; + for (let k = k0; k < k1; k++) { + // row index + const i = this._index[k]; + yield { + value: this._values[k], + index: [i, j] + }; + } + } + }; + + /** + * Create an Array with a copy of the data of the SparseMatrix + * @memberof SparseMatrix + * @returns {Array} array + */ + SparseMatrix.prototype.toArray = function () { + return _toArray(this._values, this._index, this._ptr, this._size, true); + }; + + /** + * Get the primitive value of the SparseMatrix: a two dimensions array + * @memberof SparseMatrix + * @returns {Array} array + */ + SparseMatrix.prototype.valueOf = function () { + return _toArray(this._values, this._index, this._ptr, this._size, false); + }; + function _toArray(values, index, ptr, size, copy) { + // rows and columns + const rows = size[0]; + const columns = size[1]; + // result + const a = []; + // vars + let i, j; + // initialize array + for (i = 0; i < rows; i++) { + a[i] = []; + for (j = 0; j < columns; j++) { + a[i][j] = 0; + } + } + + // loop columns + for (j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = ptr[j]; + const k1 = ptr[j + 1]; + // loop k within [k0, k1[ + for (let k = k0; k < k1; k++) { + // row index + i = index[k]; + // set value (use one for pattern matrix) + a[i][j] = values ? copy ? (0, _object.clone)(values[k]) : values[k] : 1; + } + } + return a; + } + + /** + * Get a string representation of the matrix, with optional formatting options. + * @memberof SparseMatrix + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + SparseMatrix.prototype.format = function (options) { + // rows and columns + const rows = this._size[0]; + const columns = this._size[1]; + // density + const density = this.density(); + // rows & columns + let str = 'Sparse Matrix [' + (0, _string.format)(rows, options) + ' x ' + (0, _string.format)(columns, options) + '] density: ' + (0, _string.format)(density, options) + '\n'; + // loop columns + for (let j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = this._ptr[j]; + const k1 = this._ptr[j + 1]; + // loop k within [k0, k1[ + for (let k = k0; k < k1; k++) { + // row index + const i = this._index[k]; + // append value + str += '\n (' + (0, _string.format)(i, options) + ', ' + (0, _string.format)(j, options) + ') ==> ' + (this._values ? (0, _string.format)(this._values[k], options) : 'X'); + } + } + return str; + }; + + /** + * Get a string representation of the matrix + * @memberof SparseMatrix + * @returns {string} str + */ + SparseMatrix.prototype.toString = function () { + return (0, _string.format)(this.toArray()); + }; + + /** + * Get a JSON representation of the matrix + * @memberof SparseMatrix + * @returns {Object} + */ + SparseMatrix.prototype.toJSON = function () { + return { + mathjs: 'SparseMatrix', + values: this._values, + index: this._index, + ptr: this._ptr, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Get the kth Matrix diagonal. + * + * @memberof SparseMatrix + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved. + * + * @returns {Matrix} The matrix vector with the diagonal values. + */ + SparseMatrix.prototype.diagonal = function (k) { + // validate k if any + if (k) { + // convert BigNumber to a number + if ((0, _is.isBigNumber)(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + const kSuper = k > 0 ? k : 0; + const kSub = k < 0 ? -k : 0; + + // rows & columns + const rows = this._size[0]; + const columns = this._size[1]; + + // number diagonal values + const n = Math.min(rows - kSub, columns - kSuper); + + // diagonal arrays + const values = []; + const index = []; + const ptr = []; + // initial ptr value + ptr[0] = 0; + // loop columns + for (let j = kSuper; j < columns && values.length < n; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = this._ptr[j]; + const k1 = this._ptr[j + 1]; + // loop x within [k0, k1[ + for (let x = k0; x < k1; x++) { + // row index + const i = this._index[x]; + // check row + if (i === j - kSuper + kSub) { + // value on this column + values.push(this._values[x]); + // store row + index[values.length - 1] = i - kSub; + // exit loop + break; + } + } + } + // close ptr + ptr.push(values.length); + // return matrix + return new SparseMatrix({ + values, + index, + ptr, + size: [n, 1] + }); + }; + + /** + * Generate a matrix from a JSON object + * @memberof SparseMatrix + * @param {Object} json An object structured like + * `{"mathjs": "SparseMatrix", "values": [], "index": [], "ptr": [], "size": []}`, + * where mathjs is optional + * @returns {SparseMatrix} + */ + SparseMatrix.fromJSON = function (json) { + return new SparseMatrix(json); + }; + + /** + * Create a diagonal matrix. + * + * @memberof SparseMatrix + * @param {Array} size The matrix size. + * @param {number | Array | Matrix } value The values for the diagonal. + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in. + * @param {number} [defaultValue] The default value for non-diagonal + * @param {string} [datatype] The Matrix datatype, values must be of this datatype. + * + * @returns {SparseMatrix} + */ + SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) { + if (!(0, _is.isArray)(size)) { + throw new TypeError('Array expected, size parameter'); + } + if (size.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // map size & validate + size = size.map(function (s) { + // check it is a big number + if ((0, _is.isBigNumber)(s)) { + // convert it + s = s.toNumber(); + } + // validate arguments + if (!(0, _is.isNumber)(s) || !(0, _number.isInteger)(s) || s < 1) { + throw new Error('Size values must be positive integers'); + } + return s; + }); + + // validate k if any + if (k) { + // convert BigNumber to a number + if ((0, _is.isBigNumber)(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + if ((0, _is.isString)(datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, datatype); + } + const kSuper = k > 0 ? k : 0; + const kSub = k < 0 ? -k : 0; + + // rows and columns + const rows = size[0]; + const columns = size[1]; + + // number of non-zero items + const n = Math.min(rows - kSub, columns - kSuper); + + // value extraction function + let _value; + + // check value + if ((0, _is.isArray)(value)) { + // validate array + if (value.length !== n) { + // number of values in array must be n + throw new Error('Invalid value array length'); + } + // define function + _value = function (i) { + // return value @ i + return value[i]; + }; + } else if ((0, _is.isMatrix)(value)) { + // matrix size + const ms = value.size(); + // validate matrix + if (ms.length !== 1 || ms[0] !== n) { + // number of values in array must be n + throw new Error('Invalid matrix length'); + } + // define function + _value = function (i) { + // return value @ i + return value.get([i]); + }; + } else { + // define function + _value = function () { + // return value + return value; + }; + } + + // create arrays + const values = []; + const index = []; + const ptr = []; + + // loop items + for (let j = 0; j < columns; j++) { + // number of rows with value + ptr.push(values.length); + // diagonal index + const i = j - kSuper; + // check we need to set diagonal value + if (i >= 0 && i < n) { + // get value @ i + const v = _value(i); + // check for zero + if (!eq(v, zero)) { + // column + index.push(i + kSub); + // add value + values.push(v); + } + } + } + // last value should be number of values + ptr.push(values.length); + // create SparseMatrix + return new SparseMatrix({ + values, + index, + ptr, + size: [rows, columns] + }); + }; + + /** + * Swap rows i and j in Matrix. + * + * @memberof SparseMatrix + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + SparseMatrix.prototype.swapRows = function (i, j) { + // check index + if (!(0, _is.isNumber)(i) || !(0, _number.isInteger)(i) || !(0, _is.isNumber)(j) || !(0, _number.isInteger)(j)) { + throw new Error('Row index must be positive integers'); + } + // check dimensions + if (this._size.length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + // validate index + (0, _array.validateIndex)(i, this._size[0]); + (0, _array.validateIndex)(j, this._size[0]); + + // swap rows + SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr); + // return current instance + return this; + }; + + /** + * Loop rows with data in column j. + * + * @param {number} j Column + * @param {Array} values Matrix values + * @param {Array} index Matrix row indeces + * @param {Array} ptr Matrix column pointers + * @param {Function} callback Callback function invoked for every row in column j + */ + SparseMatrix._forEachRow = function (j, values, index, ptr, callback) { + // indeces for column j + const k0 = ptr[j]; + const k1 = ptr[j + 1]; + + // loop + for (let k = k0; k < k1; k++) { + // invoke callback + callback(index[k], values[k]); + } + }; + + /** + * Swap rows x and y in Sparse Matrix data structures. + * + * @param {number} x Matrix row index 1 + * @param {number} y Matrix row index 2 + * @param {number} columns Number of columns in matrix + * @param {Array} values Matrix values + * @param {Array} index Matrix row indeces + * @param {Array} ptr Matrix column pointers + */ + SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) { + // loop columns + for (let j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + const k0 = ptr[j]; + const k1 = ptr[j + 1]; + // find value index @ x + const kx = _getValueIndex(x, k0, k1, index); + // find value index @ x + const ky = _getValueIndex(y, k0, k1, index); + // check both rows exist in matrix + if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) { + // swap values (check for pattern matrix) + if (values) { + const v = values[kx]; + values[kx] = values[ky]; + values[ky] = v; + } + // next column + continue; + } + // check x row exist & no y row + if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) { + // value @ x (check for pattern matrix) + const vx = values ? values[kx] : undefined; + // insert value @ y + index.splice(ky, 0, y); + if (values) { + values.splice(ky, 0, vx); + } + // remove value @ x (adjust array index if needed) + index.splice(ky <= kx ? kx + 1 : kx, 1); + if (values) { + values.splice(ky <= kx ? kx + 1 : kx, 1); + } + // next column + continue; + } + // check y row exist & no x row + if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) { + // value @ y (check for pattern matrix) + const vy = values ? values[ky] : undefined; + // insert value @ x + index.splice(kx, 0, x); + if (values) { + values.splice(kx, 0, vy); + } + // remove value @ y (adjust array index if needed) + index.splice(kx <= ky ? ky + 1 : ky, 1); + if (values) { + values.splice(kx <= ky ? ky + 1 : ky, 1); + } + } + } + }; + return SparseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/index.js new file mode 100644 index 0000000..fcc8cb0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/index.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createIndex = void 0; +var _is = require("../../../utils/is.js"); +var _factory = require("../../../utils/factory.js"); +const name = 'index'; +const dependencies = ['typed', 'Index']; +const createIndex = exports.createIndex = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Index + } = _ref; + /** + * Create an index. An Index can store ranges having start, step, and end + * for multiple dimensions. + * Matrix.get, Matrix.set, and math.subset accept an Index as input. + * + * Syntax: + * + * math.index(range1, range2, ...) + * + * Where each range can be any of: + * + * - A number + * - A string for getting/setting an object property + * - An instance of `Range` + * - A one-dimensional Array or a Matrix with numbers or booleans + * + * Indexes must be zero-based, integer numbers. + * + * Examples: + * + * const b = [1, 2, 3, 4, 5] + * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4] + * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4] + * + * const a = math.matrix([[1, 2], [3, 4]]) + * a.subset(math.index(0, 1)) // returns 2 + * a.subset(math.index(0, [false, true])) // returns 2 + * + * See also: + * + * bignumber, boolean, complex, matrix, number, string, unit + * + * @param {...*} ranges Zero or more ranges or numbers. + * @return {Index} Returns the created index + */ + return typed(name, { + '...number | string | BigNumber | Range | Array | Matrix': function (args) { + const ranges = args.map(function (arg) { + if ((0, _is.isBigNumber)(arg)) { + return arg.toNumber(); // convert BigNumber to Number + } else if ((0, _is.isArray)(arg) || (0, _is.isMatrix)(arg)) { + return arg.map(function (elem) { + // convert BigNumber to Number + return (0, _is.isBigNumber)(elem) ? elem.toNumber() : elem; + }); + } else { + return arg; + } + }); + const res = new Index(); + Index.apply(res, ranges); + return res; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js new file mode 100644 index 0000000..0766331 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrix = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'matrix'; +const dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix']; +const createMatrix = exports.createMatrix = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Matrix, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a Matrix. The function creates a new `math.Matrix` object from + * an `Array`. A Matrix has utility functions to manipulate the data in the + * matrix, like getting the size and getting or setting values in the matrix. + * Supported storage formats are 'dense' and 'sparse'. + * + * Syntax: + * + * math.matrix() // creates an empty matrix using default storage format (dense). + * math.matrix(data) // creates a matrix with initial data using default storage format (dense). + * math.matrix('dense') // creates an empty matrix using the given storage format. + * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format. + * math.matrix(data, 'sparse') // creates a sparse matrix with initial data. + * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type. + * + * Examples: + * + * let m = math.matrix([[1, 2], [3, 4]]) + * m.size() // Array [2, 2] + * m.resize([3, 2], 5) + * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]] + * m.get([1, 0]) // number 3 + * + * See also: + * + * bignumber, boolean, complex, index, number, string, unit, sparse + * + * @param {Array | Matrix} [data] A multi dimensional array + * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'` + * @param {string} [datatype] Type of the values + * + * @return {Matrix} The created matrix + */ + return typed(name, { + '': function () { + return _create([]); + }, + string: function (format) { + return _create([], format); + }, + 'string, string': function (format, datatype) { + return _create([], format, datatype); + }, + Array: function (data) { + return _create(data); + }, + Matrix: function (data) { + return _create(data, data.storage()); + }, + 'Array | Matrix, string': _create, + 'Array | Matrix, string, string': _create + }); + + /** + * Create a new Matrix with given storage format + * @param {Array} data + * @param {string} [format] + * @param {string} [datatype] + * @returns {Matrix} Returns a new Matrix + * @private + */ + function _create(data, format, datatype) { + // get storage format constructor + if (format === 'dense' || format === 'default' || format === undefined) { + return new DenseMatrix(data, datatype); + } + if (format === 'sparse') { + return new SparseMatrix(data, datatype); + } + throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js new file mode 100644 index 0000000..38d7ff5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSparse = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'sparse'; +const dependencies = ['typed', 'SparseMatrix']; +const createSparse = exports.createSparse = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + SparseMatrix + } = _ref; + /** + * Create a Sparse Matrix. The function creates a new `math.Matrix` object from + * an `Array`. A Matrix has utility functions to manipulate the data in the + * matrix, like getting the size and getting or setting values in the matrix. + * Note that a Sparse Matrix is always 2-dimensional, so for example if + * you create one from a plain array of _n_ numbers, you get an _n_ by 1 + * Sparse "column vector". + * + * Syntax: + * + * math.sparse() // creates an empty sparse matrix. + * math.sparse(data) // creates a sparse matrix with initial data. + * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype. + * + * Examples: + * + * let m = math.sparse([[1, 2], [3, 4]]) + * m.size() // Array [2, 2] + * m.resize([3, 2], 5) + * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]] + * m.get([1, 0]) // number 3 + * let v = math.sparse([0, 0, 1]) + * v.size() // Array [3, 1] + * v.get([2, 0]) // number 1 + * + * See also: + * + * bignumber, boolean, complex, index, number, string, unit, matrix + * + * @param {Array | Matrix} [data] A two dimensional array + * + * @return {Matrix} The created matrix + */ + return typed(name, { + '': function () { + return new SparseMatrix([]); + }, + string: function (datatype) { + return new SparseMatrix([], datatype); + }, + 'Array | Matrix': function (data) { + return new SparseMatrix(data); + }, + 'Array | Matrix, string': function (data, datatype) { + return new SparseMatrix(data, datatype); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js new file mode 100644 index 0000000..deb786e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.broadcast = broadcast; +var _array = require("../../../utils/array.js"); +var _object = require("../../../utils/object.js"); +/** +* Broadcasts two matrices, and return both in an array +* It checks if it's possible with broadcasting rules +* +* @param {Matrix} A First Matrix +* @param {Matrix} B Second Matrix +* +* @return {Matrix[]} [ broadcastedA, broadcastedB ] +*/ + +function broadcast(A, B) { + if ((0, _object.deepStrictEqual)(A.size(), B.size())) { + // If matrices have the same size return them + return [A, B]; + } + + // calculate the broadcasted sizes + const newSize = (0, _array.broadcastSizes)(A.size(), B.size()); + + // return the array with the two broadcasted matrices + return [A, B].map(M => _broadcastTo(M, newSize)); +} + +/** + * Broadcasts a matrix to the given size. + * + * @param {Matrix} M - The matrix to be broadcasted. + * @param {number[]} size - The desired size of the broadcasted matrix. + * @returns {Matrix} The broadcasted matrix. + * @throws {Error} If the size parameter is not an array of numbers. + */ +function _broadcastTo(M, size) { + if ((0, _object.deepStrictEqual)(M.size(), size)) { + return M; + } + return M.create((0, _array.broadcastTo)(M.valueOf(), size), M.datatype()); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js new file mode 100644 index 0000000..0df668b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js @@ -0,0 +1,118 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo01xDSid = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo01xDSid'; +const dependencies = ['typed']; +const createMatAlgo01xDSid = exports.createMatAlgo01xDSid = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij). + * Callback function invoked NNZ times (number of nonzero items in SparseMatrix). + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ Dij ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (S) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + const adata = denseMatrix._data; + const asize = denseMatrix._size; + const adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + const bvalues = sparseMatrix._values; + const bindex = sparseMatrix._index; + const bptr = sparseMatrix._ptr; + const bsize = sparseMatrix._size; + const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // process data types + const dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined; + // callback function + const cf = dt ? typed.find(callback, [dt, dt]) : callback; + + // vars + let i, j; + + // result (DenseMatrix) + const cdata = []; + // initialize c + for (i = 0; i < rows; i++) { + cdata[i] = []; + } + + // workspace + const x = []; + // marks indicating we have a value in x for a given column + const w = []; + + // loop columns in b + for (j = 0; j < columns; j++) { + // column mark + const mark = j + 1; + // values in column j + for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // update workspace + x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + // mark i as updated + w[i] = mark; + } + // loop rows + for (i = 0; i < rows; i++) { + // check row is in workspace + if (w[i] === mark) { + // c[i][j] was already calculated + cdata[i][j] = x[i]; + } else { + // item does not exist in S + cdata[i][j] = adata[i][j]; + } + } + } + + // return dense matrix + return denseMatrix.createDenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js new file mode 100644 index 0000000..9f6657e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js @@ -0,0 +1,122 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo02xDS0 = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo02xDS0'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo02xDS0 = exports.createMatAlgo02xDS0 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij). + * Callback function invoked NNZ times (number of nonzero items in SparseMatrix). + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (S) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + const adata = denseMatrix._data; + const asize = denseMatrix._size; + const adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + const bvalues = sparseMatrix._values; + const bindex = sparseMatrix._index; + const bptr = sparseMatrix._ptr; + const bsize = sparseMatrix._size; + const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result (SparseMatrix) + const cvalues = []; + const cindex = []; + const cptr = []; + + // loop columns in b + for (let j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // values in column j + for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + const i = bindex[k]; + // update C(i,j) + const cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + // check for nonzero + if (!eq(cij, zero)) { + // push i & v + cindex.push(i); + cvalues.push(cij); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return sparseMatrix.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js new file mode 100644 index 0000000..03de89f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js @@ -0,0 +1,128 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo03xDSf = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo03xDSf'; +const dependencies = ['typed']; +const createMatAlgo03xDSf = exports.createMatAlgo03xDSf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij). + * Callback function invoked M*N times. + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ f(Dij, 0) ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (C) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + const adata = denseMatrix._data; + const asize = denseMatrix._size; + const adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + const bvalues = sparseMatrix._values; + const bindex = sparseMatrix._index; + const bptr = sparseMatrix._ptr; + const bsize = sparseMatrix._size; + const bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result (DenseMatrix) + const cdata = []; + + // initialize dense matrix + for (let z = 0; z < rows; z++) { + // initialize row + cdata[z] = []; + } + + // workspace + const x = []; + // marks indicating we have a value in x for a given column + const w = []; + + // loop columns in b + for (let j = 0; j < columns; j++) { + // column mark + const mark = j + 1; + // values in column j + for (let k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + const i = bindex[k]; + // update workspace + x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + w[i] = mark; + } + // process workspace + for (let y = 0; y < rows; y++) { + // check we have a calculated value for current row + if (w[y] === mark) { + // use calculated value + cdata[y][j] = x[y]; + } else { + // calculate value + cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero); + } + } + } + + // return dense matrix + return denseMatrix.createDenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js new file mode 100644 index 0000000..dde74fe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js @@ -0,0 +1,185 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo04xSidSid = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo04xSidSid'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo04xSidSid = exports.createMatAlgo04xSidSid = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0 + * └ B(i,j) ; A(i,j) === 0 + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo04xSidSid(a, b, callback) { + // sparse matrix arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = avalues && bvalues ? [] : undefined; + const cindex = []; + const cptr = []; + + // workspace + const xa = avalues && bvalues ? [] : undefined; + const xb = avalues && bvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + const wa = []; + const wb = []; + + // vars + let i, j, k, k0, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + const mark = j + 1; + // loop A(:,j) + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // update c + cindex.push(i); + // update workspace + wa[i] = mark; + // check we need to process values + if (xa) { + xa[i] = avalues[k]; + } + } + // loop B(:,j) + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // check row exists in A + if (wa[i] === mark) { + // update record in xa @ i + if (xa) { + // invoke callback + const v = cf(xa[i], bvalues[k]); + // check for zero + if (!eq(v, zero)) { + // update workspace + xa[i] = v; + } else { + // remove mark (index will be removed later) + wa[i] = null; + } + } + } else { + // update c + cindex.push(i); + // update workspace + wb[i] = mark; + // check we need to process values + if (xb) { + xb[i] = bvalues[k]; + } + } + } + // check we need to process values (non pattern matrix) + if (xa && xb) { + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // check workspace has value @ i + if (wa[i] === mark) { + // push value (Aij != 0 || (Aij != 0 && Bij != 0)) + cvalues[k] = xa[i]; + // increment pointer + k++; + } else if (wb[i] === mark) { + // push value (bij != 0) + cvalues[k] = xb[i]; + // increment pointer + k++; + } else { + // remove index @ k + cindex.splice(k, 1); + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js new file mode 100644 index 0000000..9b0427c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js @@ -0,0 +1,177 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo05xSfSf = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo05xSfSf'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo05xSfSf = exports.createMatAlgo05xSfSf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo05xSfSf(a, b, callback) { + // sparse matrix arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = avalues && bvalues ? [] : undefined; + const cindex = []; + const cptr = []; + + // workspaces + const xa = cvalues ? [] : undefined; + const xb = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + const wa = []; + const wb = []; + + // vars + let i, j, k, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + const mark = j + 1; + // loop values A(:,j) + for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) { + // row + i = aindex[k]; + // push index + cindex.push(i); + // update workspace + wa[i] = mark; + // check we need to process values + if (xa) { + xa[i] = avalues[k]; + } + } + // loop values B(:,j) + for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) { + // row + i = bindex[k]; + // check row existed in A + if (wa[i] !== mark) { + // push index + cindex.push(i); + } + // update workspace + wb[i] = mark; + // check we need to process values + if (xb) { + xb[i] = bvalues[k]; + } + } + // check we need to process values (non pattern matrix) + if (cvalues) { + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // marks + const wai = wa[i]; + const wbi = wb[i]; + // check Aij or Bij are nonzero + if (wai === mark || wbi === mark) { + // matrix values @ i,j + const va = wai === mark ? xa[i] : zero; + const vb = wbi === mark ? xb[i] : zero; + // Cij + const vc = cf(va, vb); + // check for zero + if (!eq(vc, zero)) { + // push value + cvalues.push(vc); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js new file mode 100644 index 0000000..664af19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js @@ -0,0 +1,159 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo06xS0S0 = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +var _collection = require("../../../utils/collection.js"); +const name = 'matAlgo06xS0S0'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo06xS0S0 = exports.createMatAlgo06xS0S0 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices. + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo06xS0S0(a, b, callback) { + // sparse matrix arrays + const avalues = a._values; + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bvalues = b._values; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = avalues && bvalues ? [] : undefined; + const cindex = []; + const cptr = []; + + // workspaces + const x = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + const w = []; + // marks indicating value in a given row has been updated + const u = []; + + // loop columns + for (let j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + const mark = j + 1; + // scatter the values of A(:,j) into workspace + (0, _collection.scatter)(a, j, w, x, u, mark, cindex, cf); + // scatter the values of B(:,j) into workspace + (0, _collection.scatter)(b, j, w, x, u, mark, cindex, cf); + // check we need to process values (non pattern matrix) + if (x) { + // initialize first index in j + let k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + const i = cindex[k]; + // check function was invoked on current row (Aij !=0 && Bij != 0) + if (u[i] === mark) { + // value @ i + const v = x[i]; + // check for zero value + if (!eq(v, zero)) { + // push value + cvalues.push(v); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } else { + // initialize first index in j + let p = cptr[j]; + // loop index in j + while (p < cindex.length) { + // row + const r = cindex[p]; + // check function was invoked on current row (Aij !=0 && Bij != 0) + if (u[r] !== mark) { + // remove value @ i, do not increment pointer + cindex.splice(p, 1); + } else { + // increment pointer + p++; + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js new file mode 100644 index 0000000..a23e374 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js @@ -0,0 +1,125 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo07xSSf = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo07xSSf'; +const dependencies = ['typed', 'DenseMatrix']; +const createMatAlgo07xSSf = exports.createMatAlgo07xSSf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij). + * Callback function invoked MxN times. + * + * C(i,j) = f(Aij, Bij) + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo07xSSf(a, b, callback) { + // sparse matrix arrays + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // vars + let i, j; + + // result arrays + const cdata = []; + // initialize c + for (i = 0; i < rows; i++) { + cdata[i] = []; + } + + // workspaces + const xa = []; + const xb = []; + // marks indicating we have a value in x for a given column + const wa = []; + const wb = []; + + // loop columns + for (j = 0; j < columns; j++) { + // columns mark + const mark = j + 1; + // scatter the values of A(:,j) into workspace + _scatter(a, j, wa, xa, mark); + // scatter the values of B(:,j) into workspace + _scatter(b, j, wb, xb, mark); + // loop rows + for (i = 0; i < rows; i++) { + // matrix values @ i,j + const va = wa[i] === mark ? xa[i] : zero; + const vb = wb[i] === mark ? xb[i] : zero; + // invoke callback + cdata[i][j] = cf(va, vb); + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; + function _scatter(m, j, w, x, mark) { + // a arrays + const values = m._values; + const index = m._index; + const ptr = m._ptr; + // loop values in column j + for (let k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) { + // row + const i = index[k]; + // update workspace + w[i] = mark; + x[i] = values[k]; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js new file mode 100644 index 0000000..82bfddb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js @@ -0,0 +1,160 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo08xS0Sid = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo08xS0Sid'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo08xS0Sid = exports.createMatAlgo08xS0Sid = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0 + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo08xS0Sid(a, b, callback) { + // sparse matrix arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!avalues || !bvalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrices'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = []; + const cindex = []; + const cptr = []; + + // workspace + const x = []; + // marks indicating we have a value in x for a given column + const w = []; + + // vars + let k, k0, k1, i; + + // loop columns + for (let j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + const mark = j + 1; + // loop values in a + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // mark workspace + w[i] = mark; + // set value + x[i] = avalues[k]; + // add index + cindex.push(i); + } + // loop values in b + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // check value exists in workspace + if (w[i] === mark) { + // evaluate callback + x[i] = cf(x[i], bvalues[k]); + } + } + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // value @ i + const v = x[i]; + // check for zero value + if (!eq(v, zero)) { + // push value + cvalues.push(v); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js new file mode 100644 index 0000000..cc28ebd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js @@ -0,0 +1,148 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo09xS0Sf = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo09xS0Sf'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo09xS0Sf = exports.createMatAlgo09xS0Sf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij). + * Callback function invoked NZA times, number of nonzero elements in A. + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo09xS0Sf(a, b, callback) { + // sparse matrix arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + const asize = a._size; + const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + const bvalues = b._values; + const bindex = b._index; + const bptr = b._ptr; + const bsize = b._size; + const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = avalues && bvalues ? [] : undefined; + const cindex = []; + const cptr = []; + + // workspaces + const x = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + const w = []; + + // vars + let i, j, k, k0, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // column mark + const mark = j + 1; + // check we need to process values + if (x) { + // loop B(:,j) + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // update workspace + w[i] = mark; + x[i] = bvalues[k]; + } + } + // loop A(:,j) + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check we need to process values + if (x) { + // b value @ i,j + const vb = w[i] === mark ? x[i] : zero; + // invoke f + const vc = cf(avalues[k], vb); + // check zero value + if (!eq(vc, zero)) { + // push index + cindex.push(i); + // push value + cvalues.push(vc); + } + } else { + // push index + cindex.push(i); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js new file mode 100644 index 0000000..24031a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo10xSids = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'matAlgo10xSids'; +const dependencies = ['typed', 'DenseMatrix']; +const createMatAlgo10xSids = exports.createMatAlgo10xSids = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked NZ times (number of nonzero items in S). + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ b ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo10xSids(s, b, callback, inverse) { + // sparse matrix arrays + const avalues = s._values; + const aindex = s._index; + const aptr = s._ptr; + const asize = s._size; + const adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cdata = []; + + // workspaces + const x = []; + // marks indicating we have a value in x for a given column + const w = []; + + // loop columns + for (let j = 0; j < columns; j++) { + // columns mark + const mark = j + 1; + // values in j + for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + const r = aindex[k]; + // update workspace + x[r] = avalues[k]; + w[r] = mark; + } + // loop rows + for (let i = 0; i < rows; i++) { + // initialize C on first column + if (j === 0) { + // create row array + cdata[i] = []; + } + // check sparse matrix has a value @ i,j + if (w[i] === mark) { + // invoke callback, update C + cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b); + } else { + // dense matrix value @ i, j + cdata[i][j] = b; + } + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js new file mode 100644 index 0000000..8aae4e8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js @@ -0,0 +1,109 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo11xS0s = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'matAlgo11xS0s'; +const dependencies = ['typed', 'equalScalar']; +const createMatAlgo11xS0s = exports.createMatAlgo11xS0s = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked NZ times (number of nonzero items in S). + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} SparseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo11xS0s(s, b, callback, inverse) { + // sparse matrix arrays + const avalues = s._values; + const aindex = s._index; + const aptr = s._ptr; + const asize = s._size; + const adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // equal signature to use + let eq = equalScalar; + // zero value + let zero = 0; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cvalues = []; + const cindex = []; + const cptr = []; + + // loop columns + for (let j = 0; j < columns; j++) { + // initialize ptr + cptr[j] = cindex.length; + // values in j + for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + const i = aindex[k]; + // invoke callback + const v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b); + // check value is zero + if (!eq(v, zero)) { + // push index & value + cindex.push(i); + cvalues.push(v); + } + } + } + // update ptr + cptr[columns] = cindex.length; + + // return sparse matrix + return s.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js new file mode 100644 index 0000000..7090a8c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo12xSfs = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'matAlgo12xSfs'; +const dependencies = ['typed', 'DenseMatrix']; +const createMatAlgo12xSfs = exports.createMatAlgo12xSfs = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked MxN times. + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ f(0, b) ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo12xSfs(s, b, callback, inverse) { + // sparse matrix arrays + const avalues = s._values; + const aindex = s._index; + const aptr = s._ptr; + const asize = s._size; + const adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + const rows = asize[0]; + const columns = asize[1]; + + // datatype + let dt; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + const cdata = []; + + // workspaces + const x = []; + // marks indicating we have a value in x for a given column + const w = []; + + // loop columns + for (let j = 0; j < columns; j++) { + // columns mark + const mark = j + 1; + // values in j + for (let k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + const r = aindex[k]; + // update workspace + x[r] = avalues[k]; + w[r] = mark; + } + // loop rows + for (let i = 0; i < rows; i++) { + // initialize C on first column + if (j === 0) { + // create row array + cdata[i] = []; + } + // check sparse matrix has a value @ i,j + if (w[i] === mark) { + // invoke callback, update C + cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b); + } else { + // dense matrix value @ i, j + cdata[i][j] = inverse ? cf(b, 0) : cf(0, b); + } + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js new file mode 100644 index 0000000..3c4ce7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js @@ -0,0 +1,100 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo13xDD = void 0; +var _factory = require("../../../utils/factory.js"); +var _DimensionError = require("../../../error/DimensionError.js"); +const name = 'matAlgo13xDD'; +const dependencies = ['typed']; +const createMatAlgo13xDD = exports.createMatAlgo13xDD = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z). + * Callback function invoked MxN times. + * + * C(i,j,...z) = f(Aij..z, Bij..z) + * + * @param {Matrix} a The DenseMatrix instance (A) + * @param {Matrix} b The DenseMatrix instance (B) + * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658 + */ + return function matAlgo13xDD(a, b, callback) { + // a arrays + const adata = a._data; + const asize = a._size; + const adt = a._datatype; + // b arrays + const bdata = b._data; + const bsize = b._size; + const bdt = b._datatype; + // c arrays + const csize = []; + + // validate dimensions + if (asize.length !== bsize.length) { + throw new _DimensionError.DimensionError(asize.length, bsize.length); + } + + // validate each one of the dimension sizes + for (let s = 0; s < asize.length; s++) { + // must match + if (asize[s] !== bsize[s]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + // update dimension in c + csize[s] = asize[s]; + } + + // datatype + let dt; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt) { + // datatype + dt = adt; + // callback + cf = typed.find(callback, [dt, dt]); + } + + // populate cdata, iterate through dimensions + const cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : []; + + // c matrix + return a.createDenseMatrix({ + data: cdata, + size: csize, + datatype: dt + }); + }; + + // recursive function + function _iterate(f, level, s, n, av, bv) { + // initialize array for this level + const cv = []; + // check we reach the last level + if (level === s.length - 1) { + // loop arrays in last level + for (let i = 0; i < n; i++) { + // invoke callback and store value + cv[i] = f(av[i], bv[i]); + } + } else { + // iterate current level + for (let j = 0; j < n; j++) { + // iterate next level + cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]); + } + } + return cv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js new file mode 100644 index 0000000..89033d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatAlgo14xDs = void 0; +var _factory = require("../../../utils/factory.js"); +var _object = require("../../../utils/object.js"); +const name = 'matAlgo14xDs'; +const dependencies = ['typed']; +const createMatAlgo14xDs = exports.createMatAlgo14xDs = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b). + * Callback function invoked MxN times. + * + * C(i,j,...z) = f(Aij..z, b) + * + * @param {Matrix} a The DenseMatrix instance (A) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij..z,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042 + */ + return function matAlgo14xDs(a, b, callback, inverse) { + // a arrays + const adata = a._data; + const asize = a._size; + const adt = a._datatype; + + // datatype + let dt; + // callback signature to use + let cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // populate cdata, iterate through dimensions + const cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : []; + + // c matrix + return a.createDenseMatrix({ + data: cdata, + size: (0, _object.clone)(asize), + datatype: dt + }); + }; + + // recursive function + function _iterate(f, level, s, n, av, bv, inverse) { + // initialize array for this level + const cv = []; + // check we reach the last level + if (level === s.length - 1) { + // loop arrays in last level + for (let i = 0; i < n; i++) { + // invoke callback and store value + cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv); + } + } else { + // iterate current level + for (let j = 0; j < n; j++) { + // iterate next level + cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse); + } + } + return cv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js new file mode 100644 index 0000000..70cabe6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js @@ -0,0 +1,158 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createMatrixAlgorithmSuite = void 0; +var _factory = require("../../../utils/factory.js"); +var _object = require("../../../utils/object.js"); +var _matAlgo13xDD = require("./matAlgo13xDD.js"); +var _matAlgo14xDs = require("./matAlgo14xDs.js"); +var _broadcast = require("./broadcast.js"); +const name = 'matrixAlgorithmSuite'; +const dependencies = ['typed', 'matrix']; +const createMatrixAlgorithmSuite = exports.createMatrixAlgorithmSuite = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + matrix + } = _ref; + const matAlgo13xDD = (0, _matAlgo13xDD.createMatAlgo13xDD)({ + typed + }); + const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ + typed + }); + + /** + * Return a signatures object with the usual boilerplate of + * matrix algorithms, based on a plain options object with the + * following properties: + * elop: function -- the elementwise operation to use, defaults to self + * SS: function -- the algorithm to apply for two sparse matrices + * DS: function -- the algorithm to apply for a dense and a sparse matrix + * SD: function -- algo for a sparse and a dense; defaults to SD flipped + * Ss: function -- the algorithm to apply for a sparse matrix and scalar + * sS: function -- algo for scalar and sparse; defaults to Ss flipped + * scalar: string -- typed-function type for scalars, defaults to 'any' + * + * If Ss is not specified, no matrix-scalar signatures are generated. + * + * @param {object} options + * @return {Object} signatures + */ + return function matrixAlgorithmSuite(options) { + const elop = options.elop; + const SD = options.SD || options.DS; + let matrixSignatures; + if (elop) { + // First the dense ones + matrixSignatures = { + 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...(0, _broadcast.broadcast)(x, y), elop), + 'Array, Array': (x, y) => matAlgo13xDD(...(0, _broadcast.broadcast)(matrix(x), matrix(y)), elop).valueOf(), + 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...(0, _broadcast.broadcast)(matrix(x), y), elop), + 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...(0, _broadcast.broadcast)(x, matrix(y)), elop) + }; + // Now incorporate sparse matrices + if (options.SS) { + matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...(0, _broadcast.broadcast)(x, y), elop, false); + } + if (options.DS) { + matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...(0, _broadcast.broadcast)(x, y), elop, false); + matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...(0, _broadcast.broadcast)(matrix(x), y), elop, false); + } + if (SD) { + matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...(0, _broadcast.broadcast)(y, x), elop, true); + matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...(0, _broadcast.broadcast)(matrix(y), x), elop, true); + } + } else { + // No elop, use this + // First the dense ones + matrixSignatures = { + 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...(0, _broadcast.broadcast)(x, y), self); + }), + 'Array, Array': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...(0, _broadcast.broadcast)(matrix(x), matrix(y)), self).valueOf(); + }), + 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...(0, _broadcast.broadcast)(matrix(x), y), self); + }), + 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...(0, _broadcast.broadcast)(x, matrix(y)), self); + }) + }; + // Now incorporate sparse matrices + if (options.SS) { + matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.SS(...(0, _broadcast.broadcast)(x, y), self, false); + }); + } + if (options.DS) { + matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.DS(...(0, _broadcast.broadcast)(x, y), self, false); + }); + matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.DS(...(0, _broadcast.broadcast)(matrix(x), y), self, false); + }); + } + if (SD) { + matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => { + return SD(...(0, _broadcast.broadcast)(y, x), self, true); + }); + matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => { + return SD(...(0, _broadcast.broadcast)(matrix(y), x), self, true); + }); + } + } + + // Now add the scalars + const scalar = options.scalar || 'any'; + const Ds = options.Ds || options.Ss; + if (Ds) { + if (elop) { + matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false); + matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true); + matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf(); + matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf(); + } else { + matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }); + matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(y, x, self, true); + }); + matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(matrix(x), y, self, false).valueOf(); + }); + matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }); + } + } + const sS = options.sS !== undefined ? options.sS : options.Ss; + if (elop) { + if (options.Ss) { + matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false); + } + if (sS) { + matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true); + } + } else { + if (options.Ss) { + matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => { + return options.Ss(x, y, self, false); + }); + } + if (sS) { + matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return sS(y, x, self, true); + }); + } + } + // Also pull in the scalar signatures if the operator is a typed function + if (elop && elop.signatures) { + (0, _object.extend)(matrixSignatures, elop.signatures); + } + return matrixSignatures; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/number.js new file mode 100644 index 0000000..d50d677 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/number.js @@ -0,0 +1,156 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createNumber = void 0; +var _factory = require("../utils/factory.js"); +var _collection = require("../utils/collection.js"); +const name = 'number'; +const dependencies = ['typed']; + +/** + * Separates the radix, integer part, and fractional part of a non decimal number string + * @param {string} input string to parse + * @returns {object} the parts of the string or null if not a valid input + */ +function getNonDecimalNumberParts(input) { + const nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/); + if (nonDecimalWithRadixMatch) { + const radix = { + '0b': 2, + '0o': 8, + '0x': 16 + }[nonDecimalWithRadixMatch[1]]; + const integerPart = nonDecimalWithRadixMatch[2]; + const fractionalPart = nonDecimalWithRadixMatch[3]; + return { + input, + radix, + integerPart, + fractionalPart + }; + } else { + return null; + } +} + +/** + * Makes a number from a radix, and integer part, and a fractional part + * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts) + * @returns {number} the number + */ +function makeNumberFromNonDecimalParts(parts) { + const n = parseInt(parts.integerPart, parts.radix); + let f = 0; + for (let i = 0; i < parts.fractionalPart.length; i++) { + const digitValue = parseInt(parts.fractionalPart[i], parts.radix); + f += digitValue / Math.pow(parts.radix, i + 1); + } + const result = n + f; + if (isNaN(result)) { + throw new SyntaxError('String "' + parts.input + '" is not a valid number'); + } + return result; +} +const createNumber = exports.createNumber = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Create a number or convert a string, boolean, or unit to a number. + * When value is a matrix, all elements will be converted to number. + * + * Syntax: + * + * math.number(value) + * math.number(unit, valuelessUnit) + * + * Examples: + * + * math.number(2) // returns number 2 + * math.number('7.2') // returns number 7.2 + * math.number(true) // returns number 1 + * math.number([true, false, true, true]) // returns [1, 0, 1, 1] + * math.number(math.unit('52cm'), 'm') // returns 0.52 + * + * See also: + * + * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit + * + * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted + * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number + * @return {number | Array | Matrix} The created number + */ + const number = typed('number', { + '': function () { + return 0; + }, + number: function (x) { + return x; + }, + string: function (x) { + if (x === 'NaN') return NaN; + const nonDecimalNumberParts = getNonDecimalNumberParts(x); + if (nonDecimalNumberParts) { + return makeNumberFromNonDecimalParts(nonDecimalNumberParts); + } + let size = 0; + const wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/); + if (wordSizeSuffixMatch) { + // x includes a size suffix like 0xffffi32, so we extract + // the suffix and remove it from x + size = Number(wordSizeSuffixMatch[2]); + x = wordSizeSuffixMatch[1]; + } + let num = Number(x); + if (isNaN(num)) { + throw new SyntaxError('String "' + x + '" is not a valid number'); + } + if (wordSizeSuffixMatch) { + // x is a signed bin, oct, or hex literal + // num is the value of string x if x is interpreted as unsigned + if (num > 2 ** size - 1) { + // literal is too large for size suffix + throw new SyntaxError(`String "${x}" is out of range`); + } + // check if the bit at index size - 1 is set and if so do the twos complement + if (num >= 2 ** (size - 1)) { + num = num - 2 ** size; + } + } + return num; + }, + BigNumber: function (x) { + return x.toNumber(); + }, + bigint: function (x) { + return Number(x); + }, + Fraction: function (x) { + return x.valueOf(); + }, + Unit: typed.referToSelf(self => x => { + const clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + null: function (x) { + return 0; + }, + 'Unit, string | Unit': function (unit, valuelessUnit) { + return unit.toNumber(valuelessUnit); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); + + // reviver function to parse a JSON object like: + // + // {"mathjs":"number","value":"2.3"} + // + // into a number 2.3 + number.fromJSON = function (json) { + return parseFloat(json.value); + }; + return number; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js new file mode 100644 index 0000000..1321fb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js @@ -0,0 +1,74 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createResultSet = void 0; +var _factory = require("../../utils/factory.js"); +const name = 'ResultSet'; +const dependencies = []; +const createResultSet = exports.createResultSet = /* #__PURE__ */(0, _factory.factory)(name, dependencies, () => { + /** + * A ResultSet contains a list or results + * @class ResultSet + * @param {Array} entries + * @constructor ResultSet + */ + function ResultSet(entries) { + if (!(this instanceof ResultSet)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.entries = entries || []; + } + + /** + * Attach type information + */ + ResultSet.prototype.type = 'ResultSet'; + ResultSet.prototype.isResultSet = true; + + /** + * Returns the array with results hold by this ResultSet + * @memberof ResultSet + * @returns {Array} entries + */ + ResultSet.prototype.valueOf = function () { + return this.entries; + }; + + /** + * Returns the stringified results of the ResultSet + * @memberof ResultSet + * @returns {string} string + */ + ResultSet.prototype.toString = function () { + return '[' + this.entries.join(', ') + ']'; + }; + + /** + * Get a JSON representation of the ResultSet + * @memberof ResultSet + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "ResultSet", "entries": [...]}` + */ + ResultSet.prototype.toJSON = function () { + return { + mathjs: 'ResultSet', + entries: this.entries + }; + }; + + /** + * Instantiate a ResultSet from a JSON object + * @memberof ResultSet + * @param {Object} json A JSON object structured as: + * `{"mathjs": "ResultSet", "entries": [...]}` + * @return {ResultSet} + */ + ResultSet.fromJSON = function (json) { + return new ResultSet(json.entries); + }; + return ResultSet; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/string.js new file mode 100644 index 0000000..8ea43a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/string.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createString = void 0; +var _factory = require("../utils/factory.js"); +var _collection = require("../utils/collection.js"); +var _number = require("../utils/number.js"); +const name = 'string'; +const dependencies = ['typed']; +const createString = exports.createString = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Create a string or convert any object into a string. + * Elements of Arrays and Matrices are processed element wise. + * + * Syntax: + * + * math.string(value) + * + * Examples: + * + * math.string(4.2) // returns string '4.2' + * math.string(math.complex(3, 2) // returns string '3 + 2i' + * + * const u = math.unit(5, 'km') + * math.string(u.to('m')) // returns string '5000 m' + * + * math.string([true, false]) // returns ['true', 'false'] + * + * See also: + * + * bignumber, boolean, complex, index, matrix, number, unit + * + * @param {* | Array | Matrix | null} [value] A value to convert to a string + * @return {string | Array | Matrix} The created string + */ + return typed(name, { + '': function () { + return ''; + }, + number: _number.format, + null: function (x) { + return 'null'; + }, + boolean: function (x) { + return x + ''; + }, + string: function (x) { + return x; + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)), + any: function (x) { + return String(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/Unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/Unit.js new file mode 100644 index 0000000..fddc5dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/Unit.js @@ -0,0 +1,3888 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnitClass = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _is = require("../../utils/is.js"); +var _factory = require("../../utils/factory.js"); +var _function = require("../../utils/function.js"); +var _string = require("../../utils/string.js"); +var _object = require("../../utils/object.js"); +var _constants = require("../../utils/bignumber/constants.js"); +const name = 'Unit'; +const dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction']; +const createUnitClass = exports.createUnitClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + on, + config, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + pow, + abs, + fix, + round, + equal, + isNumeric, + format, + number, + Complex, + BigNumber, + Fraction + } = _ref; + const toNumber = number; + /** + * A unit can be constructed in the following ways: + * + * const a = new Unit(value, valuelessUnit) + * const b = new Unit(null, valuelessUnit) + * const c = Unit.parse(str) + * + * Example usage: + * + * const a = new Unit(5, 'cm') // 50 mm + * const b = Unit.parse('23 kg') // 23 kg + * const c = math.in(a, new Unit(null, 'm') // 0.05 m + * const d = new Unit(9.81, "m/s^2") // 9.81 m/s^2 + * + * @class Unit + * @constructor Unit + * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2 + * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like "cm" + */ + function Unit(value, valuelessUnit) { + if (!(this instanceof Unit)) { + throw new Error('Constructor must be called with the new operator'); + } + if (!(value === null || value === undefined || isNumeric(value) || (0, _is.isComplex)(value))) { + throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined'); + } + this.fixPrefix = false; // if true, function format will not search for the + // best prefix but leave it as initially provided. + // fixPrefix is set true by the method Unit.to + + // The justification behind this is that if the constructor is explicitly called, + // the caller wishes the units to be returned exactly as supplied. + this.skipAutomaticSimplification = true; + if (valuelessUnit === undefined) { + this.units = []; + this.dimensions = BASE_DIMENSIONS.map(x => 0); + } else if (typeof valuelessUnit === 'string') { + const u = Unit.parse(valuelessUnit); + this.units = u.units; + this.dimensions = u.dimensions; + } else if ((0, _is.isUnit)(valuelessUnit) && valuelessUnit.value === null) { + // clone from valuelessUnit + this.fixPrefix = valuelessUnit.fixPrefix; + this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification; + this.dimensions = valuelessUnit.dimensions.slice(0); + this.units = valuelessUnit.units.map(u => (0, _extends2.default)({}, u)); + } else { + throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit'); + } + this.value = this._normalize(value); + } + + /** + * Attach type information + */ + Object.defineProperty(Unit, 'name', { + value: 'Unit' + }); + Unit.prototype.constructor = Unit; + Unit.prototype.type = 'Unit'; + Unit.prototype.isUnit = true; + + // private variables and functions for the Unit parser + let text, index, c; + function skipWhitespace() { + while (c === ' ' || c === '\t') { + next(); + } + } + function isDigitDot(c) { + return c >= '0' && c <= '9' || c === '.'; + } + function isDigit(c) { + return c >= '0' && c <= '9'; + } + function next() { + index++; + c = text.charAt(index); + } + function revert(oldIndex) { + index = oldIndex; + c = text.charAt(index); + } + function parseNumber() { + let number = ''; + const oldIndex = index; + if (c === '+') { + next(); + } else if (c === '-') { + number += c; + next(); + } + if (!isDigitDot(c)) { + // a + or - must be followed by a digit + revert(oldIndex); + return null; + } + + // get number, can have a single dot + if (c === '.') { + number += c; + next(); + if (!isDigit(c)) { + // this is no legal number, it is just a dot + revert(oldIndex); + return null; + } + } else { + while (isDigit(c)) { + number += c; + next(); + } + if (c === '.') { + number += c; + next(); + } + } + while (isDigit(c)) { + number += c; + next(); + } + + // check for exponential notation like "2.3e-4" or "1.23e50" + if (c === 'E' || c === 'e') { + // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as "4exabytes" + + let tentativeNumber = ''; + const tentativeIndex = index; + tentativeNumber += c; + next(); + if (c === '+' || c === '-') { + tentativeNumber += c; + next(); + } + + // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation) + if (!isDigit(c)) { + // The e or E must belong to something else, so return the number without the e or E. + revert(tentativeIndex); + return number; + } + + // We can now safely say that this is scientific notation. + number = number + tentativeNumber; + while (isDigit(c)) { + number += c; + next(); + } + } + return number; + } + function parseUnit() { + let unitName = ''; + + // Alphanumeric characters only; matches [a-zA-Z0-9] + while (isDigit(c) || Unit.isValidAlpha(c)) { + unitName += c; + next(); + } + + // Must begin with [a-zA-Z] + const firstC = unitName.charAt(0); + if (Unit.isValidAlpha(firstC)) { + return unitName; + } else { + return null; + } + } + function parseCharacter(toFind) { + if (c === toFind) { + next(); + return toFind; + } else { + return null; + } + } + + /** + * Parse a string into a unit. The value of the unit is parsed as number, + * BigNumber, or Fraction depending on the math.js config setting `number`. + * + * Throws an exception if the provided string does not contain a valid unit or + * cannot be parsed. + * @memberof Unit + * @param {string} str A string like "5.2 inch", "4e2 cm/s^2" + * @return {Unit} unit + */ + Unit.parse = function (str, options) { + options = options || {}; + text = str; + index = -1; + c = ''; + if (typeof text !== 'string') { + throw new TypeError('Invalid argument in Unit.parse, string expected'); + } + const unit = new Unit(); + unit.units = []; + let powerMultiplierCurrent = 1; + let expectingUnit = false; + + // A unit should follow this pattern: + // [number] ...[ [*/] unit[^number] ] + // unit[^number] ... [ [*/] unit[^number] ] + + // Rules: + // number is any floating point number. + // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number! + // The string may optionally begin with a number. + // Each unit may optionally be followed by ^number. + // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable: + // 2m^2kg/s^2 + // it is not good form. If a unit starts with e, then it could be confused as a floating point number: + // 4erg + + next(); + skipWhitespace(); + + // Optional number at the start of the string + const valueStr = parseNumber(); + let value = null; + if (valueStr) { + if (config.number === 'BigNumber') { + value = new BigNumber(valueStr); + } else if (config.number === 'Fraction') { + try { + // not all numbers can be turned in Fractions, for example very small numbers not + value = new Fraction(valueStr); + } catch (err) { + value = parseFloat(valueStr); + } + } else { + // number + value = parseFloat(valueStr); + } + skipWhitespace(); // Whitespace is not required here + + // handle multiplication or division right after the value, like '1/s' + if (parseCharacter('*')) { + powerMultiplierCurrent = 1; + expectingUnit = true; + } else if (parseCharacter('/')) { + powerMultiplierCurrent = -1; + expectingUnit = true; + } + } + + // Stack to keep track of powerMultipliers applied to each parentheses group + const powerMultiplierStack = []; + + // Running product of all elements in powerMultiplierStack + let powerMultiplierStackProduct = 1; + while (true) { + skipWhitespace(); + + // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack + // A '(' will always appear directly before a unit. + while (c === '(') { + powerMultiplierStack.push(powerMultiplierCurrent); + powerMultiplierStackProduct *= powerMultiplierCurrent; + powerMultiplierCurrent = 1; + next(); + skipWhitespace(); + } + + // Is there something here? + let uStr; + if (c) { + const oldC = c; + uStr = parseUnit(); + if (uStr === null) { + throw new SyntaxError('Unexpected "' + oldC + '" in "' + text + '" at index ' + index.toString()); + } + } else { + // End of input. + break; + } + + // Verify the unit exists and get the prefix (if any) + const res = _findUnit(uStr); + if (res === null) { + // Unit not found. + throw new SyntaxError('Unit "' + uStr + '" not found.'); + } + let power = powerMultiplierCurrent * powerMultiplierStackProduct; + // Is there a "^ number"? + skipWhitespace(); + if (parseCharacter('^')) { + skipWhitespace(); + const p = parseNumber(); + if (p === null) { + // No valid number found for the power! + throw new SyntaxError('In "' + str + '", "^" must be followed by a floating-point number'); + } + power *= p; + } + + // Add the unit to the list + unit.units.push({ + unit: res.unit, + prefix: res.prefix, + power + }); + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power; + } + + // Check for and consume closing parentheses, popping from the stack. + // A ')' will always follow a unit. + skipWhitespace(); + while (c === ')') { + if (powerMultiplierStack.length === 0) { + throw new SyntaxError('Unmatched ")" in "' + text + '" at index ' + index.toString()); + } + powerMultiplierStackProduct /= powerMultiplierStack.pop(); + next(); + skipWhitespace(); + } + + // "*" and "/" should mean we are expecting something to come next. + // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator. + expectingUnit = false; + if (parseCharacter('*')) { + // explicit multiplication + powerMultiplierCurrent = 1; + expectingUnit = true; + } else if (parseCharacter('/')) { + // division + powerMultiplierCurrent = -1; + expectingUnit = true; + } else { + // implicit multiplication + powerMultiplierCurrent = 1; + } + + // Replace the unit into the auto unit system + if (res.unit.base) { + const baseDim = res.unit.base.key; + UNIT_SYSTEMS.auto[baseDim] = { + unit: res.unit, + prefix: res.prefix + }; + } + } + + // Has the string been entirely consumed? + skipWhitespace(); + if (c) { + throw new SyntaxError('Could not parse: "' + str + '"'); + } + + // Is there a trailing slash? + if (expectingUnit) { + throw new SyntaxError('Trailing characters: "' + str + '"'); + } + + // Is the parentheses stack empty? + if (powerMultiplierStack.length !== 0) { + throw new SyntaxError('Unmatched "(" in "' + text + '"'); + } + + // Are there any units at all? + if (unit.units.length === 0 && !options.allowNoUnits) { + throw new SyntaxError('"' + str + '" contains no units'); + } + unit.value = value !== undefined ? unit._normalize(value) : null; + return unit; + }; + + /** + * create a copy of this unit + * @memberof Unit + * @return {Unit} Returns a cloned version of the unit + */ + Unit.prototype.clone = function () { + const unit = new Unit(); + unit.fixPrefix = this.fixPrefix; + unit.skipAutomaticSimplification = this.skipAutomaticSimplification; + unit.value = (0, _object.clone)(this.value); + unit.dimensions = this.dimensions.slice(0); + unit.units = []; + for (let i = 0; i < this.units.length; i++) { + unit.units[i] = {}; + for (const p in this.units[i]) { + if ((0, _object.hasOwnProperty)(this.units[i], p)) { + unit.units[i][p] = this.units[i][p]; + } + } + } + return unit; + }; + + /** + * Return the type of the value of this unit + * + * @memberof Unit + * @return {string} type of the value of the unit + */ + Unit.prototype.valueType = function () { + return (0, _is.typeOf)(this.value); + }; + + /** + * Return whether the unit is derived (such as m/s, or cm^2, but not N) + * @memberof Unit + * @return {boolean} True if the unit is derived + * @private + */ + Unit.prototype._isDerived = function () { + if (this.units.length === 0) { + return false; + } + return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15; + }; + + /** + * Normalize a value, based on its currently set unit(s) + * @memberof Unit + * @param {number | BigNumber | Fraction | boolean} value + * @return {number | BigNumber | Fraction | boolean} normalized value + * @private + */ + Unit.prototype._normalize = function (value) { + if (value === null || value === undefined || this.units.length === 0) { + return value; + } + let res = value; + const convert = Unit._getNumberConverter((0, _is.typeOf)(value)); // convert to Fraction or BigNumber if needed + + for (let i = 0; i < this.units.length; i++) { + const unitValue = convert(this.units[i].unit.value); + const unitPrefixValue = convert(this.units[i].prefix.value); + const unitPower = convert(this.units[i].power); + res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower)); + } + return res; + }; + + /** + * Denormalize a value, based on its currently set unit(s) + * @memberof Unit + * @param {number} value + * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit) + * @return {number} denormalized value + * @private + */ + Unit.prototype._denormalize = function (value, prefixValue) { + if (value === null || value === undefined || this.units.length === 0) { + return value; + } + let res = value; + const convert = Unit._getNumberConverter((0, _is.typeOf)(value)); // convert to Fraction or BigNumber if needed + + for (let i = 0; i < this.units.length; i++) { + const unitValue = convert(this.units[i].unit.value); + const unitPrefixValue = convert(this.units[i].prefix.value); + const unitPower = convert(this.units[i].power); + res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower)); + } + return res; + }; + + /** + * Find a unit from a string + * @memberof Unit + * @param {string} str A string like 'cm' or 'inch' + * @returns {Object | null} result When found, an object with fields unit and + * prefix is returned. Else, null is returned. + * @private + */ + const _findUnit = (0, _function.memoize)(str => { + // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit. + if ((0, _object.hasOwnProperty)(UNITS, str)) { + const unit = UNITS[str]; + const prefix = unit.prefixes['']; + return { + unit, + prefix + }; + } + for (const name in UNITS) { + if ((0, _object.hasOwnProperty)(UNITS, name)) { + if ((0, _string.endsWith)(str, name)) { + const unit = UNITS[name]; + const prefixLen = str.length - name.length; + const prefixName = str.substring(0, prefixLen); + const prefix = (0, _object.hasOwnProperty)(unit.prefixes, prefixName) ? unit.prefixes[prefixName] : undefined; + if (prefix !== undefined) { + // store unit, prefix, and value + return { + unit, + prefix + }; + } + } + } + } + return null; + }, { + hasher: args => args[0], + limit: 100 + }); + + /** + * Test if the given expression is a unit. + * The unit can have a prefix but cannot have a value. + * @memberof Unit + * @param {string} name A string to be tested whether it is a value less unit. + * The unit can have prefix, like "cm" + * @return {boolean} true if the given string is a unit + */ + Unit.isValuelessUnit = function (name) { + return _findUnit(name) !== null; + }; + + /** + * check if this unit has given base unit + * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived. + * @memberof Unit + * @param {BASE_UNIT | string | undefined} base + */ + Unit.prototype.hasBase = function (base) { + if (typeof base === 'string') { + base = BASE_UNITS[base]; + } + if (!base) { + return false; + } + + // All dimensions must be the same + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) { + return false; + } + } + return true; + }; + + /** + * Check if this unit has a base or bases equal to another base or bases + * For derived units, the exponent on each base also must match + * @memberof Unit + * @param {Unit} other + * @return {boolean} true if equal base + */ + Unit.prototype.equalBase = function (other) { + // All dimensions must be the same + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) { + return false; + } + } + return true; + }; + + /** + * Check if this unit equals another unit + * @memberof Unit + * @param {Unit} other + * @return {boolean} true if both units are equal + */ + Unit.prototype.equals = function (other) { + return this.equalBase(other) && equal(this.value, other.value); + }; + + /** + * Multiply this unit with another one or with a scalar + * @memberof Unit + * @param {Unit} other + * @return {Unit} product of this unit and the other unit + */ + Unit.prototype.multiply = function (_other) { + const res = this.clone(); + const other = (0, _is.isUnit)(_other) ? _other : new Unit(_other); + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0); + } + + // Append other's units list onto res + for (let i = 0; i < other.units.length; i++) { + // Make a shallow copy of every unit + const inverted = { + ...other.units[i] + }; + res.units.push(inverted); + } + + // If at least one operand has a value, then the result should also have a value + if (this.value !== null || other.value !== null) { + const valThis = this.value === null ? this._normalize(1) : this.value; + const valOther = other.value === null ? other._normalize(1) : other.value; + res.value = multiplyScalar(valThis, valOther); + } else { + res.value = null; + } + if ((0, _is.isUnit)(_other)) { + res.skipAutomaticSimplification = false; + } + return getNumericIfUnitless(res); + }; + + /** + * Divide a number by this unit + * + * @memberof Unit + * @param {numeric} numerator + * @param {unit} result of dividing numerator by this unit + */ + Unit.prototype.divideInto = function (numerator) { + return new Unit(numerator).divide(this); + }; + + /** + * Divide this unit by another one + * @memberof Unit + * @param {Unit | numeric} other + * @return {Unit} result of dividing this unit by the other unit + */ + Unit.prototype.divide = function (_other) { + const res = this.clone(); + const other = (0, _is.isUnit)(_other) ? _other : new Unit(_other); + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0); + } + + // Invert and append other's units list onto res + for (let i = 0; i < other.units.length; i++) { + // Make a shallow copy of every unit + const inverted = { + ...other.units[i], + power: -other.units[i].power + }; + res.units.push(inverted); + } + + // If at least one operand has a value, the result should have a value + if (this.value !== null || other.value !== null) { + const valThis = this.value === null ? this._normalize(1) : this.value; + const valOther = other.value === null ? other._normalize(1) : other.value; + res.value = divideScalar(valThis, valOther); + } else { + res.value = null; + } + if ((0, _is.isUnit)(_other)) { + res.skipAutomaticSimplification = false; + } + return getNumericIfUnitless(res); + }; + + /** + * Calculate the power of a unit + * @memberof Unit + * @param {number | Fraction | BigNumber} p + * @returns {Unit} The result: this^p + */ + Unit.prototype.pow = function (p) { + const res = this.clone(); + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) * p; + } + + // Adjust the power of each unit in the list + for (let i = 0; i < res.units.length; i++) { + res.units[i].power *= p; + } + if (res.value !== null) { + res.value = pow(res.value, p); + + // only allow numeric output, we don't want to return a Complex number + // if (!isNumeric(res.value)) { + // res.value = NaN + // } + // Update: Complex supported now + } else { + res.value = null; + } + res.skipAutomaticSimplification = false; + return getNumericIfUnitless(res); + }; + + /** + * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise + * @param {Unit} unit + * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise + */ + function getNumericIfUnitless(unit) { + if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) { + return unit.value; + } else { + return unit; + } + } + + /** + * Calculate the absolute value of a unit + * @memberof Unit + * @param {number | Fraction | BigNumber} x + * @returns {Unit} The result: |x|, absolute value of x + */ + Unit.prototype.abs = function () { + const ret = this.clone(); + if (ret.value !== null) { + if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) { + ret.value = abs(ret.value); + } else { + // To give the correct, but unexpected, results for units with an offset. + // For example, abs(-283.15 degC) = -263.15 degC !!! + // We must take the offset into consideration here + const convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed + const unitValue = convert(ret.units[0].unit.value); + const nominalOffset = convert(ret.units[0].unit.offset); + const unitOffset = multiplyScalar(unitValue, nominalOffset); + ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset); + } + } + for (const i in ret.units) { + if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') { + ret.units[i].unit = UNITS.W; + } + } + return ret; + }; + + /** + * Convert the unit to a specific unit name. + * @memberof Unit + * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like "cm" + * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit. + */ + Unit.prototype.to = function (valuelessUnit) { + const value = this.value === null ? this._normalize(1) : this.value; + let other; + if (typeof valuelessUnit === 'string') { + other = Unit.parse(valuelessUnit); + } else if ((0, _is.isUnit)(valuelessUnit)) { + other = valuelessUnit.clone(); + } else { + throw new Error('String or Unit expected as parameter'); + } + if (!this.equalBase(other)) { + throw new Error(`Units do not match ('${other.toString()}' != '${this.toString()}')`); + } + if (other.value !== null) { + throw new Error('Cannot convert to a unit with a value'); + } + if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) { + other.value = (0, _object.clone)(value); + } else { + /* Need to adjust value by difference in offset to convert */ + const convert = Unit._getNumberConverter((0, _is.typeOf)(value)); // convert to Fraction or BigNumber if needed + + const thisUnitValue = this.units[0].unit.value; + const thisNominalOffset = this.units[0].unit.offset; + const thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset); + const otherUnitValue = other.units[0].unit.value; + const otherNominalOffset = other.units[0].unit.offset; + const otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset); + other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset))); + } + other.fixPrefix = true; + other.skipAutomaticSimplification = true; + return other; + }; + + /** + * Return the value of the unit when represented with given valueless unit + * @memberof Unit + * @param {string | Unit} valuelessUnit For example 'cm' or 'inch' + * @return {number} Returns the unit value as number. + */ + // TODO: deprecate Unit.toNumber? It's always better to use toNumeric + Unit.prototype.toNumber = function (valuelessUnit) { + return toNumber(this.toNumeric(valuelessUnit)); + }; + + /** + * Return the value of the unit in the original numeric type + * @memberof Unit + * @param {string | Unit} valuelessUnit For example 'cm' or 'inch' + * @return {number | BigNumber | Fraction} Returns the unit value + */ + Unit.prototype.toNumeric = function (valuelessUnit) { + let other; + if (valuelessUnit) { + // Allow getting the numeric value without converting to a different unit + other = this.to(valuelessUnit); + } else { + other = this.clone(); + } + if (other._isDerived() || other.units.length === 0) { + return other._denormalize(other.value); + } else { + return other._denormalize(other.value, other.units[0].prefix.value); + } + }; + + /** + * Get a string representation of the unit. + * @memberof Unit + * @return {string} + */ + Unit.prototype.toString = function () { + return this.format(); + }; + + /** + * Get a JSON representation of the unit + * @memberof Unit + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` + */ + Unit.prototype.toJSON = function () { + return { + mathjs: 'Unit', + value: this._denormalize(this.value), + unit: this.units.length > 0 ? this.formatUnits() : null, + fixPrefix: this.fixPrefix + }; + }; + + /** + * Instantiate a Unit from a JSON object + * @memberof Unit + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` + * @return {Unit} + */ + Unit.fromJSON = function (json) { + var _json$unit; + const unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined); + unit.fixPrefix = json.fixPrefix || false; + return unit; + }; + + /** + * Returns the string representation of the unit. + * @memberof Unit + * @return {string} + */ + Unit.prototype.valueOf = Unit.prototype.toString; + + /** + * Simplify this Unit's unit list and return a new Unit with the simplified list. + * The returned Unit will contain a list of the "best" units for formatting. + */ + Unit.prototype.simplify = function () { + const ret = this.clone(); + const proposedUnitList = []; + + // Search for a matching base + let matchingBase; + for (const key in currentUnitSystem) { + if ((0, _object.hasOwnProperty)(currentUnitSystem, key)) { + if (ret.hasBase(BASE_UNITS[key])) { + matchingBase = key; + break; + } + } + } + if (matchingBase === 'NONE') { + ret.units = []; + } else { + let matchingUnit; + if (matchingBase) { + // Does the unit system have a matching unit? + if ((0, _object.hasOwnProperty)(currentUnitSystem, matchingBase)) { + matchingUnit = currentUnitSystem[matchingBase]; + } + } + if (matchingUnit) { + ret.units = [{ + unit: matchingUnit.unit, + prefix: matchingUnit.prefix, + power: 1.0 + }]; + } else { + // Multiple units or units with powers are formatted like this: + // 5 (kg m^2) / (s^3 mol) + // Build an representation from the base units of the current unit system + let missingBaseDim = false; + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + const baseDim = BASE_DIMENSIONS[i]; + if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { + if ((0, _object.hasOwnProperty)(currentUnitSystem, baseDim)) { + proposedUnitList.push({ + unit: currentUnitSystem[baseDim].unit, + prefix: currentUnitSystem[baseDim].prefix, + power: ret.dimensions[i] || 0 + }); + } else { + missingBaseDim = true; + } + } + } + + // Is the proposed unit list "simpler" than the existing one? + if (proposedUnitList.length < ret.units.length && !missingBaseDim) { + // Replace this unit list with the proposed list + ret.units = proposedUnitList; + } + } + } + return ret; + }; + + /** + * Returns a new Unit in the SI system with the same value as this one + */ + Unit.prototype.toSI = function () { + const ret = this.clone(); + const proposedUnitList = []; + + // Multiple units or units with powers are formatted like this: + // 5 (kg m^2) / (s^3 mol) + // Build an representation from the base units of the SI unit system + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + const baseDim = BASE_DIMENSIONS[i]; + if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { + if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS.si, baseDim)) { + proposedUnitList.push({ + unit: UNIT_SYSTEMS.si[baseDim].unit, + prefix: UNIT_SYSTEMS.si[baseDim].prefix, + power: ret.dimensions[i] || 0 + }); + } else { + throw new Error('Cannot express custom unit ' + baseDim + ' in SI units'); + } + } + } + + // Replace this unit list with the proposed list + ret.units = proposedUnitList; + ret.fixPrefix = true; + ret.skipAutomaticSimplification = true; + if (this.value !== null) { + ret.value = null; + return this.to(ret); + } + return ret; + }; + + /** + * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified. + * @memberof Unit + * @return {string} + */ + Unit.prototype.formatUnits = function () { + let strNum = ''; + let strDen = ''; + let nNum = 0; + let nDen = 0; + for (let i = 0; i < this.units.length; i++) { + if (this.units[i].power > 0) { + nNum++; + strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name; + if (Math.abs(this.units[i].power - 1.0) > 1e-15) { + strNum += '^' + this.units[i].power; + } + } else if (this.units[i].power < 0) { + nDen++; + } + } + if (nDen > 0) { + for (let i = 0; i < this.units.length; i++) { + if (this.units[i].power < 0) { + if (nNum > 0) { + strDen += ' ' + this.units[i].prefix.name + this.units[i].unit.name; + if (Math.abs(this.units[i].power + 1.0) > 1e-15) { + strDen += '^' + -this.units[i].power; + } + } else { + strDen += ' ' + this.units[i].prefix.name + this.units[i].unit.name; + strDen += '^' + this.units[i].power; + } + } + } + } + // Remove leading " " + strNum = strNum.substr(1); + strDen = strDen.substr(1); + + // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting + if (nNum > 1 && nDen > 0) { + strNum = '(' + strNum + ')'; + } + if (nDen > 1 && nNum > 0) { + strDen = '(' + strDen + ')'; + } + let str = strNum; + if (nNum > 0 && nDen > 0) { + str += ' / '; + } + str += strDen; + return str; + }; + + /** + * Get a string representation of the Unit, with optional formatting options. + * @memberof Unit + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @return {string} + */ + Unit.prototype.format = function (options) { + // Simplfy the unit list, unless it is valueless or was created directly in the + // constructor or as the result of to or toSI + const simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify(); + + // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one. + let isImaginary = false; + if (typeof simp.value !== 'undefined' && simp.value !== null && (0, _is.isComplex)(simp.value)) { + // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute + isImaginary = Math.abs(simp.value.re) < 1e-14; + } + for (const i in simp.units) { + if ((0, _object.hasOwnProperty)(simp.units, i)) { + if (simp.units[i].unit) { + if (simp.units[i].unit.name === 'VA' && isImaginary) { + simp.units[i].unit = UNITS.VAR; + } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) { + simp.units[i].unit = UNITS.VA; + } + } + } + } + + // Now apply the best prefix + // Units must have only one unit and not have the fixPrefix flag set + if (simp.units.length === 1 && !simp.fixPrefix) { + // Units must have integer powers, otherwise the prefix will change the + // outputted value by not-an-integer-power-of-ten + if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) { + // Apply the best prefix + simp.units[0].prefix = simp._bestPrefix(); + } + } + const value = simp._denormalize(simp.value); + let str = simp.value !== null ? format(value, options || {}) : ''; + const unitStr = simp.formatUnits(); + if (simp.value && (0, _is.isComplex)(simp.value)) { + str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing + } + if (unitStr.length > 0 && str.length > 0) { + str += ' '; + } + str += unitStr; + return str; + }; + + /** + * Calculate the best prefix using current value. + * @memberof Unit + * @returns {Object} prefix + * @private + */ + Unit.prototype._bestPrefix = function () { + if (this.units.length !== 1) { + throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!'); + } + if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) { + throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!'); + } + + // find the best prefix value (resulting in the value of which + // the absolute value of the log10 is closest to zero, + // though with a little offset of 1.2 for nicer values: you get a + // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ... + + // Note: the units value can be any numeric type, but to find the best + // prefix it's enough to work with limited precision of a regular number + // Update: using mathjs abs since we also allow complex numbers + const absValue = this.value !== null ? abs(this.value) : 0; + const absUnitValue = abs(this.units[0].unit.value); + let bestPrefix = this.units[0].prefix; + if (absValue === 0) { + return bestPrefix; + } + const power = this.units[0].power; + let bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2; + if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix + bestDiff = Math.abs(bestDiff); + const prefixes = this.units[0].unit.prefixes; + for (const p in prefixes) { + if ((0, _object.hasOwnProperty)(prefixes, p)) { + const prefix = prefixes[p]; + if (prefix.scientific) { + const diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2); + if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) { + // choose the prefix with the smallest diff, or if equal, choose the one + // with the shortest name (can happen with SHORTLONG for example) + bestPrefix = prefix; + bestDiff = diff; + } + } + } + } + return bestPrefix; + }; + + /** + * Returns an array of units whose sum is equal to this unit + * @memberof Unit + * @param {Array} [parts] An array of strings or valueless units. + * + * Example: + * + * const u = new Unit(1, 'm') + * u.splitUnit(['feet', 'inch']) + * [ 3 feet, 3.3700787401575 inch ] + * + * @return {Array} An array of units. + */ + Unit.prototype.splitUnit = function (parts) { + let x = this.clone(); + const ret = []; + for (let i = 0; i < parts.length; i++) { + // Convert x to the requested unit + x = x.to(parts[i]); + if (i === parts.length - 1) break; + + // Get the numeric value of this unit + const xNumeric = x.toNumeric(); + + // Check to see if xNumeric is nearly equal to an integer, + // since fix can incorrectly round down if there is round-off error + const xRounded = round(xNumeric); + let xFixed; + const isNearlyEqual = equal(xRounded, xNumeric); + if (isNearlyEqual) { + xFixed = xRounded; + } else { + xFixed = fix(x.toNumeric()); + } + const y = new Unit(xFixed, parts[i].toString()); + ret.push(y); + x = subtractScalar(x, y); + } + + // This little bit fixes a bug where the remainder should be 0 but is a little bit off. + // But instead of comparing x, the remainder, with zero--we will compare the sum of + // all the parts so far with the original value. If they are nearly equal, + // we set the remainder to 0. + let testSum = 0; + for (let i = 0; i < ret.length; i++) { + testSum = addScalar(testSum, ret[i].value); + } + if (equal(testSum, this.value)) { + x.value = 0; + } + ret.push(x); + return ret; + }; + const PREFIXES = { + NONE: { + '': { + name: '', + value: 1, + scientific: true + } + }, + SHORT: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e1, + scientific: false + }, + h: { + name: 'h', + value: 1e2, + scientific: false + }, + k: { + name: 'k', + value: 1e3, + scientific: true + }, + M: { + name: 'M', + value: 1e6, + scientific: true + }, + G: { + name: 'G', + value: 1e9, + scientific: true + }, + T: { + name: 'T', + value: 1e12, + scientific: true + }, + P: { + name: 'P', + value: 1e15, + scientific: true + }, + E: { + name: 'E', + value: 1e18, + scientific: true + }, + Z: { + name: 'Z', + value: 1e21, + scientific: true + }, + Y: { + name: 'Y', + value: 1e24, + scientific: true + }, + R: { + name: 'R', + value: 1e27, + scientific: true + }, + Q: { + name: 'Q', + value: 1e30, + scientific: true + }, + d: { + name: 'd', + value: 1e-1, + scientific: false + }, + c: { + name: 'c', + value: 1e-2, + scientific: false + }, + m: { + name: 'm', + value: 1e-3, + scientific: true + }, + u: { + name: 'u', + value: 1e-6, + scientific: true + }, + n: { + name: 'n', + value: 1e-9, + scientific: true + }, + p: { + name: 'p', + value: 1e-12, + scientific: true + }, + f: { + name: 'f', + value: 1e-15, + scientific: true + }, + a: { + name: 'a', + value: 1e-18, + scientific: true + }, + z: { + name: 'z', + value: 1e-21, + scientific: true + }, + y: { + name: 'y', + value: 1e-24, + scientific: true + }, + r: { + name: 'r', + value: 1e-27, + scientific: true + }, + q: { + name: 'q', + value: 1e-30, + scientific: true + } + }, + LONG: { + '': { + name: '', + value: 1, + scientific: true + }, + deca: { + name: 'deca', + value: 1e1, + scientific: false + }, + hecto: { + name: 'hecto', + value: 1e2, + scientific: false + }, + kilo: { + name: 'kilo', + value: 1e3, + scientific: true + }, + mega: { + name: 'mega', + value: 1e6, + scientific: true + }, + giga: { + name: 'giga', + value: 1e9, + scientific: true + }, + tera: { + name: 'tera', + value: 1e12, + scientific: true + }, + peta: { + name: 'peta', + value: 1e15, + scientific: true + }, + exa: { + name: 'exa', + value: 1e18, + scientific: true + }, + zetta: { + name: 'zetta', + value: 1e21, + scientific: true + }, + yotta: { + name: 'yotta', + value: 1e24, + scientific: true + }, + ronna: { + name: 'ronna', + value: 1e27, + scientific: true + }, + quetta: { + name: 'quetta', + value: 1e30, + scientific: true + }, + deci: { + name: 'deci', + value: 1e-1, + scientific: false + }, + centi: { + name: 'centi', + value: 1e-2, + scientific: false + }, + milli: { + name: 'milli', + value: 1e-3, + scientific: true + }, + micro: { + name: 'micro', + value: 1e-6, + scientific: true + }, + nano: { + name: 'nano', + value: 1e-9, + scientific: true + }, + pico: { + name: 'pico', + value: 1e-12, + scientific: true + }, + femto: { + name: 'femto', + value: 1e-15, + scientific: true + }, + atto: { + name: 'atto', + value: 1e-18, + scientific: true + }, + zepto: { + name: 'zepto', + value: 1e-21, + scientific: true + }, + yocto: { + name: 'yocto', + value: 1e-24, + scientific: true + }, + ronto: { + name: 'ronto', + value: 1e-27, + scientific: true + }, + quecto: { + name: 'quecto', + value: 1e-30, + scientific: true + } + }, + SQUARED: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e2, + scientific: false + }, + h: { + name: 'h', + value: 1e4, + scientific: false + }, + k: { + name: 'k', + value: 1e6, + scientific: true + }, + M: { + name: 'M', + value: 1e12, + scientific: true + }, + G: { + name: 'G', + value: 1e18, + scientific: true + }, + T: { + name: 'T', + value: 1e24, + scientific: true + }, + P: { + name: 'P', + value: 1e30, + scientific: true + }, + E: { + name: 'E', + value: 1e36, + scientific: true + }, + Z: { + name: 'Z', + value: 1e42, + scientific: true + }, + Y: { + name: 'Y', + value: 1e48, + scientific: true + }, + R: { + name: 'R', + value: 1e54, + scientific: true + }, + Q: { + name: 'Q', + value: 1e60, + scientific: true + }, + d: { + name: 'd', + value: 1e-2, + scientific: false + }, + c: { + name: 'c', + value: 1e-4, + scientific: false + }, + m: { + name: 'm', + value: 1e-6, + scientific: true + }, + u: { + name: 'u', + value: 1e-12, + scientific: true + }, + n: { + name: 'n', + value: 1e-18, + scientific: true + }, + p: { + name: 'p', + value: 1e-24, + scientific: true + }, + f: { + name: 'f', + value: 1e-30, + scientific: true + }, + a: { + name: 'a', + value: 1e-36, + scientific: true + }, + z: { + name: 'z', + value: 1e-42, + scientific: true + }, + y: { + name: 'y', + value: 1e-48, + scientific: true + }, + r: { + name: 'r', + value: 1e-54, + scientific: true + }, + q: { + name: 'q', + value: 1e-60, + scientific: true + } + }, + CUBIC: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e3, + scientific: false + }, + h: { + name: 'h', + value: 1e6, + scientific: false + }, + k: { + name: 'k', + value: 1e9, + scientific: true + }, + M: { + name: 'M', + value: 1e18, + scientific: true + }, + G: { + name: 'G', + value: 1e27, + scientific: true + }, + T: { + name: 'T', + value: 1e36, + scientific: true + }, + P: { + name: 'P', + value: 1e45, + scientific: true + }, + E: { + name: 'E', + value: 1e54, + scientific: true + }, + Z: { + name: 'Z', + value: 1e63, + scientific: true + }, + Y: { + name: 'Y', + value: 1e72, + scientific: true + }, + R: { + name: 'R', + value: 1e81, + scientific: true + }, + Q: { + name: 'Q', + value: 1e90, + scientific: true + }, + d: { + name: 'd', + value: 1e-3, + scientific: false + }, + c: { + name: 'c', + value: 1e-6, + scientific: false + }, + m: { + name: 'm', + value: 1e-9, + scientific: true + }, + u: { + name: 'u', + value: 1e-18, + scientific: true + }, + n: { + name: 'n', + value: 1e-27, + scientific: true + }, + p: { + name: 'p', + value: 1e-36, + scientific: true + }, + f: { + name: 'f', + value: 1e-45, + scientific: true + }, + a: { + name: 'a', + value: 1e-54, + scientific: true + }, + z: { + name: 'z', + value: 1e-63, + scientific: true + }, + y: { + name: 'y', + value: 1e-72, + scientific: true + }, + r: { + name: 'r', + value: 1e-81, + scientific: true + }, + q: { + name: 'q', + value: 1e-90, + scientific: true + } + }, + BINARY_SHORT_SI: { + '': { + name: '', + value: 1, + scientific: true + }, + k: { + name: 'k', + value: 1e3, + scientific: true + }, + M: { + name: 'M', + value: 1e6, + scientific: true + }, + G: { + name: 'G', + value: 1e9, + scientific: true + }, + T: { + name: 'T', + value: 1e12, + scientific: true + }, + P: { + name: 'P', + value: 1e15, + scientific: true + }, + E: { + name: 'E', + value: 1e18, + scientific: true + }, + Z: { + name: 'Z', + value: 1e21, + scientific: true + }, + Y: { + name: 'Y', + value: 1e24, + scientific: true + } + }, + BINARY_SHORT_IEC: { + '': { + name: '', + value: 1, + scientific: true + }, + Ki: { + name: 'Ki', + value: 1024, + scientific: true + }, + Mi: { + name: 'Mi', + value: Math.pow(1024, 2), + scientific: true + }, + Gi: { + name: 'Gi', + value: Math.pow(1024, 3), + scientific: true + }, + Ti: { + name: 'Ti', + value: Math.pow(1024, 4), + scientific: true + }, + Pi: { + name: 'Pi', + value: Math.pow(1024, 5), + scientific: true + }, + Ei: { + name: 'Ei', + value: Math.pow(1024, 6), + scientific: true + }, + Zi: { + name: 'Zi', + value: Math.pow(1024, 7), + scientific: true + }, + Yi: { + name: 'Yi', + value: Math.pow(1024, 8), + scientific: true + } + }, + BINARY_LONG_SI: { + '': { + name: '', + value: 1, + scientific: true + }, + kilo: { + name: 'kilo', + value: 1e3, + scientific: true + }, + mega: { + name: 'mega', + value: 1e6, + scientific: true + }, + giga: { + name: 'giga', + value: 1e9, + scientific: true + }, + tera: { + name: 'tera', + value: 1e12, + scientific: true + }, + peta: { + name: 'peta', + value: 1e15, + scientific: true + }, + exa: { + name: 'exa', + value: 1e18, + scientific: true + }, + zetta: { + name: 'zetta', + value: 1e21, + scientific: true + }, + yotta: { + name: 'yotta', + value: 1e24, + scientific: true + } + }, + BINARY_LONG_IEC: { + '': { + name: '', + value: 1, + scientific: true + }, + kibi: { + name: 'kibi', + value: 1024, + scientific: true + }, + mebi: { + name: 'mebi', + value: Math.pow(1024, 2), + scientific: true + }, + gibi: { + name: 'gibi', + value: Math.pow(1024, 3), + scientific: true + }, + tebi: { + name: 'tebi', + value: Math.pow(1024, 4), + scientific: true + }, + pebi: { + name: 'pebi', + value: Math.pow(1024, 5), + scientific: true + }, + exi: { + name: 'exi', + value: Math.pow(1024, 6), + scientific: true + }, + zebi: { + name: 'zebi', + value: Math.pow(1024, 7), + scientific: true + }, + yobi: { + name: 'yobi', + value: Math.pow(1024, 8), + scientific: true + } + }, + BTU: { + '': { + name: '', + value: 1, + scientific: true + }, + MM: { + name: 'MM', + value: 1e6, + scientific: true + } + } + }; + PREFIXES.SHORTLONG = (0, _extends2.default)({}, PREFIXES.SHORT, PREFIXES.LONG); + PREFIXES.BINARY_SHORT = (0, _extends2.default)({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC); + PREFIXES.BINARY_LONG = (0, _extends2.default)({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC); + + /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning: + * Index Dimension + * ----- --------- + * 0 Length + * 1 Mass + * 2 Time + * 3 Current + * 4 Temperature + * 5 Luminous intensity + * 6 Amount of substance + * 7 Angle + * 8 Bit (digital) + * For example, the unit "298.15 K" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit "1 cal / (gm °C)" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0]. + * + */ + + const BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT']; + const BASE_UNITS = { + NONE: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0] + }, + MASS: { + dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0] + }, + LENGTH: { + dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0] + }, + TIME: { + dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0] + }, + CURRENT: { + dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0] + }, + TEMPERATURE: { + dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0] + }, + LUMINOUS_INTENSITY: { + dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0] + }, + AMOUNT_OF_SUBSTANCE: { + dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0] + }, + FORCE: { + dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0] + }, + SURFACE: { + dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0] + }, + VOLUME: { + dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0] + }, + ENERGY: { + dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0] + }, + POWER: { + dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0] + }, + PRESSURE: { + dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0] + }, + ELECTRIC_CHARGE: { + dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0] + }, + ELECTRIC_CAPACITANCE: { + dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0] + }, + ELECTRIC_POTENTIAL: { + dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0] + }, + ELECTRIC_RESISTANCE: { + dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0] + }, + ELECTRIC_INDUCTANCE: { + dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0] + }, + ELECTRIC_CONDUCTANCE: { + dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0] + }, + MAGNETIC_FLUX: { + dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0] + }, + MAGNETIC_FLUX_DENSITY: { + dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0] + }, + FREQUENCY: { + dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0] + }, + ANGLE: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0] + }, + BIT: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1] + } + }; + for (const key in BASE_UNITS) { + if ((0, _object.hasOwnProperty)(BASE_UNITS, key)) { + BASE_UNITS[key].key = key; + } + } + const BASE_UNIT_NONE = {}; + const UNIT_NONE = { + name: '', + base: BASE_UNIT_NONE, + value: 1, + offset: 0, + dimensions: BASE_DIMENSIONS.map(x => 0) + }; + const UNITS = { + // length + meter: { + name: 'meter', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + inch: { + name: 'inch', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0254, + offset: 0 + }, + foot: { + name: 'foot', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.3048, + offset: 0 + }, + yard: { + name: 'yard', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.9144, + offset: 0 + }, + mile: { + name: 'mile', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1609.344, + offset: 0 + }, + link: { + name: 'link', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.201168, + offset: 0 + }, + rod: { + name: 'rod', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 5.0292, + offset: 0 + }, + chain: { + name: 'chain', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 20.1168, + offset: 0 + }, + angstrom: { + name: 'angstrom', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1e-10, + offset: 0 + }, + m: { + name: 'm', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + in: { + name: 'in', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0254, + offset: 0 + }, + ft: { + name: 'ft', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.3048, + offset: 0 + }, + yd: { + name: 'yd', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.9144, + offset: 0 + }, + mi: { + name: 'mi', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1609.344, + offset: 0 + }, + li: { + name: 'li', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.201168, + offset: 0 + }, + rd: { + name: 'rd', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 5.029210, + offset: 0 + }, + ch: { + name: 'ch', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 20.1168, + offset: 0 + }, + mil: { + name: 'mil', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0000254, + offset: 0 + }, + // 1/1000 inch + + // Surface + m2: { + name: 'm2', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.SQUARED, + value: 1, + offset: 0 + }, + sqin: { + name: 'sqin', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.00064516, + offset: 0 + }, + // 645.16 mm2 + sqft: { + name: 'sqft', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.09290304, + offset: 0 + }, + // 0.09290304 m2 + sqyd: { + name: 'sqyd', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.83612736, + offset: 0 + }, + // 0.83612736 m2 + sqmi: { + name: 'sqmi', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 2589988.110336, + offset: 0 + }, + // 2.589988110336 km2 + sqrd: { + name: 'sqrd', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 25.29295, + offset: 0 + }, + // 25.29295 m2 + sqch: { + name: 'sqch', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 404.6873, + offset: 0 + }, + // 404.6873 m2 + sqmil: { + name: 'sqmil', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 6.4516e-10, + offset: 0 + }, + // 6.4516 * 10^-10 m2 + acre: { + name: 'acre', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 4046.86, + offset: 0 + }, + // 4046.86 m2 + hectare: { + name: 'hectare', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 10000, + offset: 0 + }, + // 10000 m2 + + // Volume + m3: { + name: 'm3', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.CUBIC, + value: 1, + offset: 0 + }, + L: { + name: 'L', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + // litre + l: { + name: 'l', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + // litre + litre: { + name: 'litre', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.LONG, + value: 0.001, + offset: 0 + }, + cuin: { + name: 'cuin', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 1.6387064e-5, + offset: 0 + }, + // 1.6387064e-5 m3 + cuft: { + name: 'cuft', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.028316846592, + offset: 0 + }, + // 28.316 846 592 L + cuyd: { + name: 'cuyd', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.764554857984, + offset: 0 + }, + // 764.554 857 984 L + teaspoon: { + name: 'teaspoon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000005, + offset: 0 + }, + // 5 mL + tablespoon: { + name: 'tablespoon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000015, + offset: 0 + }, + // 15 mL + // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup + drop: { + name: 'drop', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 5e-8, + offset: 0 + }, + // 0.05 mL = 5e-8 m3 + gtt: { + name: 'gtt', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 5e-8, + offset: 0 + }, + // 0.05 mL = 5e-8 m3 + + // Liquid volume + minim: { + name: 'minim', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000000061611519921875, + offset: 0 + }, + // 1/61440 gallons + fluiddram: { + name: 'fluiddram', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0000036966911953125, + offset: 0 + }, + // 1/1024 gallons + fluidounce: { + name: 'fluidounce', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0000295735295625, + offset: 0 + }, + // 1/128 gallons + gill: { + name: 'gill', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.00011829411825, + offset: 0 + }, + // 1/32 gallons + cc: { + name: 'cc', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 1e-6, + offset: 0 + }, + // 1e-6 L + cup: { + name: 'cup', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0002365882365, + offset: 0 + }, + // 1/16 gallons + pint: { + name: 'pint', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000473176473, + offset: 0 + }, + // 1/8 gallons + quart: { + name: 'quart', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000946352946, + offset: 0 + }, + // 1/4 gallons + gallon: { + name: 'gallon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.003785411784, + offset: 0 + }, + // 3.785411784 L + beerbarrel: { + name: 'beerbarrel', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.117347765304, + offset: 0 + }, + // 31 gallons + oilbarrel: { + name: 'oilbarrel', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.158987294928, + offset: 0 + }, + // 42 gallons + hogshead: { + name: 'hogshead', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.238480942392, + offset: 0 + }, + // 63 gallons + + // Mass + g: { + name: 'g', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + gram: { + name: 'gram', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.LONG, + value: 0.001, + offset: 0 + }, + ton: { + name: 'ton', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 907.18474, + offset: 0 + }, + t: { + name: 't', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 1000, + offset: 0 + }, + tonne: { + name: 'tonne', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.LONG, + value: 1000, + offset: 0 + }, + grain: { + name: 'grain', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 64.79891e-6, + offset: 0 + }, + dram: { + name: 'dram', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 1.7718451953125e-3, + offset: 0 + }, + ounce: { + name: 'ounce', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 28.349523125e-3, + offset: 0 + }, + poundmass: { + name: 'poundmass', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 453.59237e-3, + offset: 0 + }, + hundredweight: { + name: 'hundredweight', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 45.359237, + offset: 0 + }, + stick: { + name: 'stick', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 115e-3, + offset: 0 + }, + stone: { + name: 'stone', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 6.35029318, + offset: 0 + }, + gr: { + name: 'gr', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 64.79891e-6, + offset: 0 + }, + dr: { + name: 'dr', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 1.7718451953125e-3, + offset: 0 + }, + oz: { + name: 'oz', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 28.349523125e-3, + offset: 0 + }, + lbm: { + name: 'lbm', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 453.59237e-3, + offset: 0 + }, + cwt: { + name: 'cwt', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 45.359237, + offset: 0 + }, + // Time + s: { + name: 's', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + min: { + name: 'min', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 60, + offset: 0 + }, + h: { + name: 'h', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3600, + offset: 0 + }, + second: { + name: 'second', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + sec: { + name: 'sec', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + minute: { + name: 'minute', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 60, + offset: 0 + }, + hour: { + name: 'hour', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3600, + offset: 0 + }, + day: { + name: 'day', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 86400, + offset: 0 + }, + week: { + name: 'week', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 7 * 86400, + offset: 0 + }, + month: { + name: 'month', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 2629800, + // 1/12th of Julian year + offset: 0 + }, + year: { + name: 'year', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 31557600, + // Julian year + offset: 0 + }, + decade: { + name: 'decade', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 315576000, + // Julian decade + offset: 0 + }, + century: { + name: 'century', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3155760000, + // Julian century + offset: 0 + }, + millennium: { + name: 'millennium', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 31557600000, + // Julian millennium + offset: 0 + }, + // Frequency + hertz: { + name: 'Hertz', + base: BASE_UNITS.FREQUENCY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0, + reciprocal: true + }, + Hz: { + name: 'Hz', + base: BASE_UNITS.FREQUENCY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0, + reciprocal: true + }, + // Angle + rad: { + name: 'rad', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + radian: { + name: 'radian', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888 + deg: { + name: 'deg', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + degree: { + name: 'degree', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399 + grad: { + name: 'grad', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + gradian: { + name: 'gradian', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793 + cycle: { + name: 'cycle', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795 + arcsec: { + name: 'arcsec', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477 + arcmin: { + name: 'arcmin', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // Electric current + A: { + name: 'A', + base: BASE_UNITS.CURRENT, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + ampere: { + name: 'ampere', + base: BASE_UNITS.CURRENT, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // Temperature + // K(C) = °C + 273.15 + // K(F) = (°F + 459.67) * (5 / 9) + // K(R) = °R * (5 / 9) + K: { + name: 'K', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + degC: { + name: 'degC', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 273.15 + }, + degF: { + name: 'degF', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: new Fraction(5, 9), + offset: 459.67 + }, + degR: { + name: 'degR', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: new Fraction(5, 9), + offset: 0 + }, + kelvin: { + name: 'kelvin', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + celsius: { + name: 'celsius', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 273.15 + }, + fahrenheit: { + name: 'fahrenheit', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: new Fraction(5, 9), + offset: 459.67 + }, + rankine: { + name: 'rankine', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: new Fraction(5, 9), + offset: 0 + }, + // amount of substance + mol: { + name: 'mol', + base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + mole: { + name: 'mole', + base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // luminous intensity + cd: { + name: 'cd', + base: BASE_UNITS.LUMINOUS_INTENSITY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + candela: { + name: 'candela', + base: BASE_UNITS.LUMINOUS_INTENSITY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // TODO: units STERADIAN + // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0}, + // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0}, + + // Force + N: { + name: 'N', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + newton: { + name: 'newton', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + dyn: { + name: 'dyn', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.SHORT, + value: 0.00001, + offset: 0 + }, + dyne: { + name: 'dyne', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 0.00001, + offset: 0 + }, + lbf: { + name: 'lbf', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 4.4482216152605, + offset: 0 + }, + poundforce: { + name: 'poundforce', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 4.4482216152605, + offset: 0 + }, + kip: { + name: 'kip', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 4448.2216, + offset: 0 + }, + kilogramforce: { + name: 'kilogramforce', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 9.80665, + offset: 0 + }, + // Energy + J: { + name: 'J', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + joule: { + name: 'joule', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + erg: { + name: 'erg', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORTLONG, + // Both kiloerg and kerg are acceptable + value: 1e-7, + offset: 0 + }, + Wh: { + name: 'Wh', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 3600, + offset: 0 + }, + BTU: { + name: 'BTU', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.BTU, + value: 1055.05585262, + offset: 0 + }, + eV: { + name: 'eV', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 1.602176565e-19, + offset: 0 + }, + electronvolt: { + name: 'electronvolt', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.LONG, + value: 1.602176565e-19, + offset: 0 + }, + // Power + W: { + name: 'W', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + watt: { + name: 'watt', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + hp: { + name: 'hp', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.NONE, + value: 745.6998715386, + offset: 0 + }, + // Electrical power units + VAR: { + name: 'VAR', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: Complex.I, + offset: 0 + }, + VA: { + name: 'VA', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Pressure + Pa: { + name: 'Pa', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + psi: { + name: 'psi', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 6894.75729276459, + offset: 0 + }, + atm: { + name: 'atm', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 101325, + offset: 0 + }, + bar: { + name: 'bar', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.SHORTLONG, + value: 100000, + offset: 0 + }, + torr: { + name: 'torr', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 133.322, + offset: 0 + }, + mmHg: { + name: 'mmHg', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 133.322, + offset: 0 + }, + mmH2O: { + name: 'mmH2O', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 9.80665, + offset: 0 + }, + cmH2O: { + name: 'cmH2O', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 98.0665, + offset: 0 + }, + // Electric charge + coulomb: { + name: 'coulomb', + base: BASE_UNITS.ELECTRIC_CHARGE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + C: { + name: 'C', + base: BASE_UNITS.ELECTRIC_CHARGE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric capacitance + farad: { + name: 'farad', + base: BASE_UNITS.ELECTRIC_CAPACITANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + F: { + name: 'F', + base: BASE_UNITS.ELECTRIC_CAPACITANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric potential + volt: { + name: 'volt', + base: BASE_UNITS.ELECTRIC_POTENTIAL, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + V: { + name: 'V', + base: BASE_UNITS.ELECTRIC_POTENTIAL, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric resistance + ohm: { + name: 'ohm', + base: BASE_UNITS.ELECTRIC_RESISTANCE, + prefixes: PREFIXES.SHORTLONG, + // Both Mohm and megaohm are acceptable + value: 1, + offset: 0 + }, + /* + * Unicode breaks in browsers if charset is not specified + Ω: { + name: 'Ω', + base: BASE_UNITS.ELECTRIC_RESISTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + */ + // Electric inductance + henry: { + name: 'henry', + base: BASE_UNITS.ELECTRIC_INDUCTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + H: { + name: 'H', + base: BASE_UNITS.ELECTRIC_INDUCTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric conductance + siemens: { + name: 'siemens', + base: BASE_UNITS.ELECTRIC_CONDUCTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + S: { + name: 'S', + base: BASE_UNITS.ELECTRIC_CONDUCTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Magnetic flux + weber: { + name: 'weber', + base: BASE_UNITS.MAGNETIC_FLUX, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + Wb: { + name: 'Wb', + base: BASE_UNITS.MAGNETIC_FLUX, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Magnetic flux density + tesla: { + name: 'tesla', + base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + T: { + name: 'T', + base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Binary + b: { + name: 'b', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_SHORT, + value: 1, + offset: 0 + }, + bits: { + name: 'bits', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_LONG, + value: 1, + offset: 0 + }, + B: { + name: 'B', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_SHORT, + value: 8, + offset: 0 + }, + bytes: { + name: 'bytes', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_LONG, + value: 8, + offset: 0 + } + }; + + // aliases (formerly plurals) + // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units + const ALIASES = { + meters: 'meter', + inches: 'inch', + feet: 'foot', + yards: 'yard', + miles: 'mile', + links: 'link', + rods: 'rod', + chains: 'chain', + angstroms: 'angstrom', + lt: 'l', + litres: 'litre', + liter: 'litre', + liters: 'litre', + teaspoons: 'teaspoon', + tablespoons: 'tablespoon', + minims: 'minim', + fldr: 'fluiddram', + fluiddrams: 'fluiddram', + floz: 'fluidounce', + fluidounces: 'fluidounce', + gi: 'gill', + gills: 'gill', + cp: 'cup', + cups: 'cup', + pt: 'pint', + pints: 'pint', + qt: 'quart', + quarts: 'quart', + gal: 'gallon', + gallons: 'gallon', + bbl: 'beerbarrel', + beerbarrels: 'beerbarrel', + obl: 'oilbarrel', + oilbarrels: 'oilbarrel', + hogsheads: 'hogshead', + gtts: 'gtt', + grams: 'gram', + tons: 'ton', + tonnes: 'tonne', + grains: 'grain', + drams: 'dram', + ounces: 'ounce', + poundmasses: 'poundmass', + hundredweights: 'hundredweight', + sticks: 'stick', + lb: 'lbm', + lbs: 'lbm', + kips: 'kip', + kgf: 'kilogramforce', + acres: 'acre', + hectares: 'hectare', + sqfeet: 'sqft', + sqyard: 'sqyd', + sqmile: 'sqmi', + sqmiles: 'sqmi', + mmhg: 'mmHg', + mmh2o: 'mmH2O', + cmh2o: 'cmH2O', + seconds: 'second', + secs: 'second', + minutes: 'minute', + mins: 'minute', + hours: 'hour', + hr: 'hour', + hrs: 'hour', + days: 'day', + weeks: 'week', + months: 'month', + years: 'year', + decades: 'decade', + centuries: 'century', + millennia: 'millennium', + hertz: 'hertz', + radians: 'radian', + degrees: 'degree', + gradians: 'gradian', + cycles: 'cycle', + arcsecond: 'arcsec', + arcseconds: 'arcsec', + arcminute: 'arcmin', + arcminutes: 'arcmin', + BTUs: 'BTU', + watts: 'watt', + joules: 'joule', + amperes: 'ampere', + amps: 'ampere', + amp: 'ampere', + coulombs: 'coulomb', + volts: 'volt', + ohms: 'ohm', + farads: 'farad', + webers: 'weber', + teslas: 'tesla', + electronvolts: 'electronvolt', + moles: 'mole', + bit: 'bits', + byte: 'bytes' + }; + + /** + * Calculate the values for the angle units. + * Value is calculated as number or BigNumber depending on the configuration + * @param {{number: 'number' | 'BigNumber'}} config + */ + function calculateAngleValues(config) { + if (config.number === 'BigNumber') { + const pi = (0, _constants.createBigNumberPi)(BigNumber); + UNITS.rad.value = new BigNumber(1); + UNITS.deg.value = pi.div(180); // 2 * pi / 360 + UNITS.grad.value = pi.div(200); // 2 * pi / 400 + UNITS.cycle.value = pi.times(2); // 2 * pi + UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600 + UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60 + } else { + // number + UNITS.rad.value = 1; + UNITS.deg.value = Math.PI / 180; // 2 * pi / 360 + UNITS.grad.value = Math.PI / 200; // 2 * pi / 400 + UNITS.cycle.value = Math.PI * 2; // 2 * pi + UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600 + UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60 + } + + // copy to the full names of the angles + UNITS.radian.value = UNITS.rad.value; + UNITS.degree.value = UNITS.deg.value; + UNITS.gradian.value = UNITS.grad.value; + } + + // apply the angle values now + calculateAngleValues(config); + if (on) { + // recalculate the values on change of configuration + on('config', function (curr, prev) { + if (curr.number !== prev.number) { + calculateAngleValues(curr); + } + }); + } + + /** + * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system. + * A user perhaps could issue a command to select a preferred unit system, or use the default (see below). + * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies. + */ + const UNIT_SYSTEMS = { + si: { + // Base units + NONE: { + unit: UNIT_NONE, + prefix: PREFIXES.NONE[''] + }, + LENGTH: { + unit: UNITS.m, + prefix: PREFIXES.SHORT[''] + }, + MASS: { + unit: UNITS.g, + prefix: PREFIXES.SHORT.k + }, + TIME: { + unit: UNITS.s, + prefix: PREFIXES.SHORT[''] + }, + CURRENT: { + unit: UNITS.A, + prefix: PREFIXES.SHORT[''] + }, + TEMPERATURE: { + unit: UNITS.K, + prefix: PREFIXES.SHORT[''] + }, + LUMINOUS_INTENSITY: { + unit: UNITS.cd, + prefix: PREFIXES.SHORT[''] + }, + AMOUNT_OF_SUBSTANCE: { + unit: UNITS.mol, + prefix: PREFIXES.SHORT[''] + }, + ANGLE: { + unit: UNITS.rad, + prefix: PREFIXES.SHORT[''] + }, + BIT: { + unit: UNITS.bits, + prefix: PREFIXES.SHORT[''] + }, + // Derived units + FORCE: { + unit: UNITS.N, + prefix: PREFIXES.SHORT[''] + }, + ENERGY: { + unit: UNITS.J, + prefix: PREFIXES.SHORT[''] + }, + POWER: { + unit: UNITS.W, + prefix: PREFIXES.SHORT[''] + }, + PRESSURE: { + unit: UNITS.Pa, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CHARGE: { + unit: UNITS.C, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CAPACITANCE: { + unit: UNITS.F, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_POTENTIAL: { + unit: UNITS.V, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_RESISTANCE: { + unit: UNITS.ohm, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_INDUCTANCE: { + unit: UNITS.H, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CONDUCTANCE: { + unit: UNITS.S, + prefix: PREFIXES.SHORT[''] + }, + MAGNETIC_FLUX: { + unit: UNITS.Wb, + prefix: PREFIXES.SHORT[''] + }, + MAGNETIC_FLUX_DENSITY: { + unit: UNITS.T, + prefix: PREFIXES.SHORT[''] + }, + FREQUENCY: { + unit: UNITS.Hz, + prefix: PREFIXES.SHORT[''] + } + } + }; + + // Clone to create the other unit systems + UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + UNIT_SYSTEMS.cgs.LENGTH = { + unit: UNITS.m, + prefix: PREFIXES.SHORT.c + }; + UNIT_SYSTEMS.cgs.MASS = { + unit: UNITS.g, + prefix: PREFIXES.SHORT[''] + }; + UNIT_SYSTEMS.cgs.FORCE = { + unit: UNITS.dyn, + prefix: PREFIXES.SHORT[''] + }; + UNIT_SYSTEMS.cgs.ENERGY = { + unit: UNITS.erg, + prefix: PREFIXES.NONE[''] + }; + // there are wholly 4 unique cgs systems for electricity and magnetism, + // so let's not worry about it unless somebody complains + + UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + UNIT_SYSTEMS.us.LENGTH = { + unit: UNITS.ft, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.MASS = { + unit: UNITS.lbm, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.TEMPERATURE = { + unit: UNITS.degF, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.FORCE = { + unit: UNITS.lbf, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.ENERGY = { + unit: UNITS.BTU, + prefix: PREFIXES.BTU[''] + }; + UNIT_SYSTEMS.us.POWER = { + unit: UNITS.hp, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.PRESSURE = { + unit: UNITS.psi, + prefix: PREFIXES.NONE[''] + }; + + // Add additional unit systems here. + + // Choose a unit system to seed the auto unit system. + UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + + // Set the current unit system + let currentUnitSystem = UNIT_SYSTEMS.auto; + + /** + * Set a unit system for formatting derived units. + * @memberof Unit + * @param {string} [name] The name of the unit system. + */ + Unit.setUnitSystem = function (name) { + if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS, name)) { + currentUnitSystem = UNIT_SYSTEMS[name]; + } else { + throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', ')); + } + }; + + /** + * Return the current unit system. + * @memberof Unit + * @return {string} The current unit system. + */ + Unit.getUnitSystem = function () { + for (const key in UNIT_SYSTEMS) { + if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS, key)) { + if (UNIT_SYSTEMS[key] === currentUnitSystem) { + return key; + } + } + } + }; + + /** + * Converters to convert from number to an other numeric type like BigNumber + * or Fraction + */ + Unit.typeConverters = { + BigNumber: function (x) { + if (x !== null && x !== void 0 && x.isFraction) return new BigNumber(x.n).div(x.d).times(x.s); + return new BigNumber(x + ''); // stringify to prevent constructor error + }, + Fraction: function (x) { + return new Fraction(x); + }, + Complex: function (x) { + return x; + }, + number: function (x) { + if (x !== null && x !== void 0 && x.isFraction) return number(x); + return x; + } + }; + + /** + * Retrieve the right converter function corresponding with this unit's + * value + * + * @memberof Unit + * @return {Function} + */ + Unit.prototype._numberConverter = function () { + const convert = Unit.typeConverters[this.valueType()]; + if (convert) { + return convert; + } + throw new TypeError('Unsupported Unit value type "' + this.valueType() + '"'); + }; + + /** + * Retrieve the right convertor function corresponding with the type + * of provided exampleValue. + * + * @param {string} type A string 'number', 'BigNumber', or 'Fraction' + * In case of an unknown type, + * @return {Function} + */ + Unit._getNumberConverter = function (type) { + if (!Unit.typeConverters[type]) { + throw new TypeError('Unsupported type "' + type + '"'); + } + return Unit.typeConverters[type]; + }; + + // Add dimensions to each built-in unit + for (const key in UNITS) { + if ((0, _object.hasOwnProperty)(UNITS, key)) { + const unit = UNITS[key]; + unit.dimensions = unit.base.dimensions; + } + } + + // Create aliases + for (const name in ALIASES) { + if ((0, _object.hasOwnProperty)(ALIASES, name)) { + const unit = UNITS[ALIASES[name]]; + const alias = {}; + for (const key in unit) { + if ((0, _object.hasOwnProperty)(unit, key)) { + alias[key] = unit[key]; + } + } + alias.name = name; + UNITS[name] = alias; + } + } + + /** + * Checks if a character is a valid latin letter (upper or lower case). + * Note that this function can be overridden, for example to allow support of other alphabets. + * @memberof Unit + * @param {string} c Tested character + * @return {boolean} true if the character is a latin letter + */ + Unit.isValidAlpha = function isValidAlpha(c) { + return /^[a-zA-Z]$/.test(c); + }; + function assertUnitNameIsValid(name) { + for (let i = 0; i < name.length; i++) { + c = name.charAt(i); + if (i === 0 && !Unit.isValidAlpha(c)) { + throw new Error('Invalid unit name (must begin with alpha character): "' + name + '"'); + } + if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) { + throw new Error('Invalid unit name (only alphanumeric characters are allowed): "' + name + '"'); + } + } + } + + /** + * Wrapper around createUnitSingle. + * Example: + * createUnit( { + * foo: { + * prefixes: 'long', + * baseName: 'essence-of-foo' + * }, + * bar: '40 foo', + * baz: { + * definition: '1 bar/hour', + * prefixes: 'long' + * } + * }, + * { + * override: true + * }) + * @memberof Unit + * @param {object} obj Object map. Each key becomes a unit which is defined by its value. + * @param {object} options + * @return {Unit} the last created unit + */ + Unit.createUnit = function (obj, options) { + if (typeof obj !== 'object') { + throw new TypeError("createUnit expects first parameter to be of type 'Object'"); + } + + // Remove all units and aliases we are overriding + if (options && options.override) { + for (const key in obj) { + if ((0, _object.hasOwnProperty)(obj, key)) { + Unit.deleteUnit(key); + } + if (obj[key].aliases) { + for (let i = 0; i < obj[key].aliases.length; i++) { + Unit.deleteUnit(obj[key].aliases[i]); + } + } + } + } + + // TODO: traverse multiple times until all units have been added + let lastUnit; + for (const key in obj) { + if ((0, _object.hasOwnProperty)(obj, key)) { + lastUnit = Unit.createUnitSingle(key, obj[key]); + } + } + return lastUnit; + }; + + /** + * Create a user-defined unit and register it with the Unit type. + * Example: + * createUnitSingle('knot', '0.514444444 m/s') + * + * @memberof Unit + * @param {string} name The name of the new unit. Must be unique. Example: 'knot' + * @param {string | Unit | object} definition Definition of the unit in terms + * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string, + * or an Object. If an Object, may have the following properties: + * - definition {string | Unit} The definition of this unit. + * - prefixes {string} "none", "short", "long", "binary_short", or "binary_long". + * The default is "none". + * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts'] + * - offset {Numeric} An offset to apply when converting from the unit. For + * example, the offset for celsius is 273.15 and the offset for farhenheit + * is 459.67. Default is 0. + * - baseName {string} If the unit's dimension does not match that of any other + * base unit, the name of the newly create base unit. Otherwise, this property + * has no effect. + * + * @return {Unit} + */ + Unit.createUnitSingle = function (name, obj) { + if (typeof obj === 'undefined' || obj === null) { + obj = {}; + } + if (typeof name !== 'string') { + throw new TypeError("createUnitSingle expects first parameter to be of type 'string'"); + } + + // Check collisions with existing units + if ((0, _object.hasOwnProperty)(UNITS, name)) { + throw new Error('Cannot create unit "' + name + '": a unit with that name already exists'); + } + + // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator. + + assertUnitNameIsValid(name); + let defUnit = null; // The Unit from which the new unit will be created. + let aliases = []; + let offset = 0; + let definition; + let prefixes; + let baseName; + if (obj && obj.type === 'Unit') { + defUnit = obj.clone(); + } else if (typeof obj === 'string') { + if (obj !== '') { + definition = obj; + } + } else if (typeof obj === 'object') { + definition = obj.definition; + prefixes = obj.prefixes; + offset = obj.offset; + baseName = obj.baseName; + if (obj.aliases) { + aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array + } + } else { + throw new TypeError('Cannot create unit "' + name + '" from "' + obj.toString() + '": expecting "string" or "Unit" or "Object"'); + } + if (aliases) { + for (let i = 0; i < aliases.length; i++) { + if ((0, _object.hasOwnProperty)(UNITS, aliases[i])) { + throw new Error('Cannot create alias "' + aliases[i] + '": a unit with that name already exists'); + } + } + } + if (definition && typeof definition === 'string' && !defUnit) { + try { + defUnit = Unit.parse(definition, { + allowNoUnits: true + }); + } catch (ex) { + ex.message = 'Could not create unit "' + name + '" from "' + definition + '": ' + ex.message; + throw ex; + } + } else if (definition && definition.type === 'Unit') { + defUnit = definition.clone(); + } + aliases = aliases || []; + offset = offset || 0; + if (prefixes && prefixes.toUpperCase) { + prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE; + } else { + prefixes = PREFIXES.NONE; + } + + // If defUnit is null, it is because the user did not + // specify a defintion. So create a new base dimension. + let newUnit = {}; + if (!defUnit) { + // Add a new base dimension + baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo + if (BASE_DIMENSIONS.indexOf(baseName) >= 0) { + throw new Error('Cannot create new base unit "' + name + '": a base unit with that name already exists (and cannot be overridden)'); + } + BASE_DIMENSIONS.push(baseName); + + // Push 0 onto existing base units + for (const b in BASE_UNITS) { + if ((0, _object.hasOwnProperty)(BASE_UNITS, b)) { + BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0; + } + } + + // Add the new base unit + const newBaseUnit = { + dimensions: [] + }; + for (let i = 0; i < BASE_DIMENSIONS.length; i++) { + newBaseUnit.dimensions[i] = 0; + } + newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1; + newBaseUnit.key = baseName; + BASE_UNITS[baseName] = newBaseUnit; + newUnit = { + name, + value: 1, + dimensions: BASE_UNITS[baseName].dimensions.slice(0), + prefixes, + offset, + base: BASE_UNITS[baseName] + }; + currentUnitSystem[baseName] = { + unit: newUnit, + prefix: PREFIXES.NONE[''] + }; + } else { + newUnit = { + name, + value: defUnit.value, + dimensions: defUnit.dimensions.slice(0), + prefixes, + offset + }; + + // Create a new base if no matching base exists + let anyMatch = false; + for (const i in BASE_UNITS) { + if ((0, _object.hasOwnProperty)(BASE_UNITS, i)) { + let match = true; + for (let j = 0; j < BASE_DIMENSIONS.length; j++) { + if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[i].dimensions[j] || 0)) > 1e-12) { + match = false; + break; + } + } + if (match) { + anyMatch = true; + newUnit.base = BASE_UNITS[i]; + break; + } + } + } + if (!anyMatch) { + baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo + // Add the new base unit + const newBaseUnit = { + dimensions: defUnit.dimensions.slice(0) + }; + newBaseUnit.key = baseName; + BASE_UNITS[baseName] = newBaseUnit; + currentUnitSystem[baseName] = { + unit: newUnit, + prefix: PREFIXES.NONE[''] + }; + newUnit.base = BASE_UNITS[baseName]; + } + } + Unit.UNITS[name] = newUnit; + for (let i = 0; i < aliases.length; i++) { + const aliasName = aliases[i]; + const alias = {}; + for (const key in newUnit) { + if ((0, _object.hasOwnProperty)(newUnit, key)) { + alias[key] = newUnit[key]; + } + } + alias.name = aliasName; + Unit.UNITS[aliasName] = alias; + } + + // delete the memoization cache because we created a new unit + delete _findUnit.cache; + return new Unit(null, name); + }; + Unit.deleteUnit = function (name) { + delete Unit.UNITS[name]; + + // delete the memoization cache because we deleted a unit + delete _findUnit.cache; + }; + + // expose arrays with prefixes, dimensions, units, systems + Unit.PREFIXES = PREFIXES; + Unit.BASE_DIMENSIONS = BASE_DIMENSIONS; + Unit.BASE_UNITS = BASE_UNITS; + Unit.UNIT_SYSTEMS = UNIT_SYSTEMS; + Unit.UNITS = UNITS; + return Unit; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js new file mode 100644 index 0000000..1038a3b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCreateUnit = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'createUnit'; +const dependencies = ['typed', 'Unit']; +const createCreateUnit = exports.createCreateUnit = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Unit + } = _ref; + /** + * Create a user-defined unit and register it with the Unit type. + * + * Syntax: + * + * math.createUnit({ + * baseUnit1: { + * aliases: [string, ...] + * prefixes: object + * }, + * unit2: { + * definition: string, + * aliases: [string, ...] + * prefixes: object, + * offset: number + * }, + * unit3: string // Shortcut + * }) + * + * // Another shortcut: + * math.createUnit(string, unit : string, [object]) + * + * Examples: + * + * math.createUnit('foo') + * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']}) + * math.createUnit('mph', '1 mile/hour') + * math.createUnit('km', math.unit(1000, 'm')) + * + * @param {string} name The name of the new unit. Must be unique. Example: 'knot' + * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'. + * @param {Object} options (optional) An object containing any of the following properties: + * - `prefixes {string}` "none", "short", "long", "binary_short", or "binary_long". The default is "none". + * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts'] + * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0. + * + * See also: + * + * unit + * + * @return {Unit} The new unit + */ + return typed(name, { + // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options. + 'Object, Object': function (obj, options) { + return Unit.createUnit(obj, options); + }, + // Same as above but without the options. + Object: function (obj) { + return Unit.createUnit(obj, {}); + }, + // Shortcut method for creating one unit. + 'string, Unit | string | Object, Object': function (name, def, options) { + const obj = {}; + obj[name] = def; + return Unit.createUnit(obj, options); + }, + // Same as above but without the options. + 'string, Unit | string | Object': function (name, def) { + const obj = {}; + obj[name] = def; + return Unit.createUnit(obj, {}); + }, + // Without a definition, creates a base unit. + string: function (name) { + const obj = {}; + obj[name] = {}; + return Unit.createUnit(obj, {}); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js new file mode 100644 index 0000000..b2d0226 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSplitUnit = void 0; +var _factory = require("../../../utils/factory.js"); +const name = 'splitUnit'; +const dependencies = ['typed']; +const createSplitUnit = exports.createSplitUnit = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed + } = _ref; + /** + * Split a unit in an array of units whose sum is equal to the original unit. + * + * Syntax: + * + * math.splitUnit(unit: Unit, parts: Array.) + * + * Example: + * + * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch']) + * // [ 3 feet, 3.3700787401575 inch ] + * + * See also: + * + * unit + * + * @param {Array} [parts] An array of strings or valueless units. + * @return {Array} An array of units. + */ + return typed(name, { + 'Unit, Array': function (unit, parts) { + return unit.splitUnit(parts); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/unit.js new file mode 100644 index 0000000..cdd12a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/function/unit.js @@ -0,0 +1,66 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createUnitFunction = void 0; +var _factory = require("../../../utils/factory.js"); +var _collection = require("../../../utils/collection.js"); +const name = 'unit'; +const dependencies = ['typed', 'Unit']; + +// This function is named createUnitFunction to prevent a naming conflict with createUnit +const createUnitFunction = exports.createUnitFunction = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { + let { + typed, + Unit + } = _ref; + /** + * Create a unit. Depending on the passed arguments, the function + * will create and return a new math.Unit object. + * When a matrix is provided, all elements will be converted to units. + * + * Syntax: + * + * math.unit(unit : string) + * math.unit(value : number, valuelessUnit : Unit) + * math.unit(value : number, valuelessUnit : string) + * + * Examples: + * + * const kph = math.unit('km/h') // returns Unit km/h (valueless) + * const v = math.unit(25, kph) // returns Unit 25 km/h + * const a = math.unit(5, 'cm') // returns Unit 50 mm + * const b = math.unit('23 kg') // returns Unit 23 kg + * a.to('m') // returns Unit 0.05 m + * + * See also: + * + * bignumber, boolean, complex, index, matrix, number, string, createUnit + * + * @param {* | Array | Matrix} args A number and unit. + * @return {Unit | Array | Matrix} The created unit + */ + + return typed(name, { + Unit: function (x) { + return x.clone(); + }, + string: function (x) { + if (Unit.isValuelessUnit(x)) { + return new Unit(null, x); // a pure unit + } + return Unit.parse(x, { + allowNoUnits: true + }); // a unit with value, like '5cm' + }, + 'number | BigNumber | Fraction | Complex, string | Unit': function (value, unit) { + return new Unit(value, unit); + }, + 'number | BigNumber | Fraction': function (value) { + // dimensionless + return new Unit(value); + }, + 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js new file mode 100644 index 0000000..a38991b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js @@ -0,0 +1,106 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createWienDisplacement = exports.createWeakMixingAngle = exports.createVacuumImpedance = exports.createThomsonCrossSection = exports.createStefanBoltzmann = exports.createSpeedOfLight = exports.createSecondRadiation = exports.createSackurTetrode = exports.createRydberg = exports.createReducedPlanckConstant = exports.createQuantumOfCirculation = exports.createProtonMass = exports.createPlanckTime = exports.createPlanckTemperature = exports.createPlanckMass = exports.createPlanckLength = exports.createPlanckConstant = exports.createPlanckCharge = exports.createNuclearMagneton = exports.createNeutronMass = exports.createMolarVolume = exports.createMolarPlanckConstant = exports.createMolarMassC12 = exports.createMolarMass = exports.createMagneticFluxQuantum = exports.createMagneticConstant = exports.createLoschmidt = exports.createKlitzing = exports.createJosephson = exports.createInverseConductanceQuantum = exports.createHartreeEnergy = exports.createGravity = exports.createGravitationConstant = exports.createGasConstant = exports.createFirstRadiation = exports.createFineStructure = exports.createFermiCoupling = exports.createFaraday = exports.createElementaryCharge = exports.createElectronMass = exports.createElectricConstant = exports.createEfimovFactor = exports.createDeuteronMass = exports.createCoulomb = exports.createConductanceQuantum = exports.createClassicalElectronRadius = exports.createBoltzmann = exports.createBohrRadius = exports.createBohrMagneton = exports.createAvogadro = exports.createAtomicMass = void 0; +var _factory = require("../../utils/factory.js"); +// Source: https://en.wikipedia.org/wiki/Physical_constant + +// Universal constants +const createSpeedOfLight = exports.createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1'); +const createGravitationConstant = exports.createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2'); +const createPlanckConstant = exports.createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s'); +const createReducedPlanckConstant = exports.createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s'); + +// Electromagnetic constants +const createMagneticConstant = exports.createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2'); +const createElectricConstant = exports.createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1'); +const createVacuumImpedance = exports.createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm'); +const createCoulomb = exports.createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2'); +const createElementaryCharge = exports.createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C'); +const createBohrMagneton = exports.createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1'); +const createConductanceQuantum = exports.createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S'); +const createInverseConductanceQuantum = exports.createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm'); +const createMagneticFluxQuantum = exports.createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb'); +const createNuclearMagneton = exports.createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1'); +const createKlitzing = exports.createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm'); +const createJosephson = exports.createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed + +// Atomic and nuclear constants +const createBohrRadius = exports.createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm'); +const createClassicalElectronRadius = exports.createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm'); +const createElectronMass = exports.createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg'); +const createFermiCoupling = exports.createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2'); +const createFineStructure = exports.createFineStructure = numberFactory('fineStructure', 7.2973525693e-3); +const createHartreeEnergy = exports.createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J'); +const createProtonMass = exports.createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg'); +const createDeuteronMass = exports.createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg'); +const createNeutronMass = exports.createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg'); +const createQuantumOfCirculation = exports.createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1'); +const createRydberg = exports.createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1'); +const createThomsonCrossSection = exports.createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2'); +const createWeakMixingAngle = exports.createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290); +const createEfimovFactor = exports.createEfimovFactor = numberFactory('efimovFactor', 22.7); + +// Physico-chemical constants +const createAtomicMass = exports.createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg'); +const createAvogadro = exports.createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1'); +const createBoltzmann = exports.createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1'); +const createFaraday = exports.createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1'); +const createFirstRadiation = exports.createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2'); +// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1 +const createLoschmidt = exports.createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3'); +const createGasConstant = exports.createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1'); +const createMolarPlanckConstant = exports.createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1'); +const createMolarVolume = exports.createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1'); +const createSackurTetrode = exports.createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358); +const createSecondRadiation = exports.createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K'); +const createStefanBoltzmann = exports.createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4'); +const createWienDisplacement = exports.createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K'); + +// Adopted values +const createMolarMass = exports.createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1'); +const createMolarMassC12 = exports.createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1'); +const createGravity = exports.createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2'); +// atm is defined in Unit.js + +// Natural units +const createPlanckLength = exports.createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm'); +const createPlanckMass = exports.createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg'); +const createPlanckTime = exports.createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's'); +const createPlanckCharge = exports.createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C'); +const createPlanckTemperature = exports.createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K'); + +// helper function to create a factory function which creates a physical constant, +// a Unit with either a number value or a BigNumber value depending on the configuration +function unitFactory(name, valueStr, unitStr) { + const dependencies = ['config', 'Unit', 'BigNumber']; + return (0, _factory.factory)(name, dependencies, _ref => { + let { + config, + Unit, + BigNumber + } = _ref; + // Note that we can parse into number or BigNumber. + // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values + // Therefore we dont use Unit.parse() + const value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr); + const unit = new Unit(value, unitStr); + unit.fixPrefix = true; + return unit; + }); +} + +// helper function to create a factory function which creates a numeric constant, +// either a number or BigNumber depending on the configuration +function numberFactory(name, value) { + const dependencies = ['config', 'BigNumber']; + return (0, _factory.factory)(name, dependencies, _ref2 => { + let { + config, + BigNumber + } = _ref2; + return config.number === 'BigNumber' ? new BigNumber(value) : value; + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/array.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/array.js new file mode 100644 index 0000000..5c57bb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/array.js @@ -0,0 +1,872 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.arraySize = arraySize; +exports.broadcastArrays = broadcastArrays; +exports.broadcastSizes = broadcastSizes; +exports.broadcastTo = broadcastTo; +exports.checkBroadcastingRules = checkBroadcastingRules; +exports.clone = clone; +exports.concat = concat; +exports.filter = filter; +exports.filterRegExp = filterRegExp; +exports.flatten = flatten; +exports.forEach = forEach; +exports.generalize = generalize; +exports.get = get; +exports.getArrayDataType = getArrayDataType; +exports.identify = identify; +exports.initial = initial; +exports.isEmptyIndex = isEmptyIndex; +exports.join = join; +exports.last = last; +exports.map = map; +exports.processSizesWildcard = processSizesWildcard; +exports.recurse = recurse; +exports.reshape = reshape; +exports.resize = resize; +exports.squeeze = squeeze; +exports.stretch = stretch; +exports.unsqueeze = unsqueeze; +exports.validate = validate; +exports.validateIndex = validateIndex; +exports.validateIndexSourceSize = validateIndexSourceSize; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _number = require("./number.js"); +var _is = require("./is.js"); +var _string = require("./string.js"); +var _DimensionError = require("../error/DimensionError.js"); +var _IndexError = require("../error/IndexError.js"); +var _object = require("./object.js"); +/** + * Calculate the size of a multi dimensional array. + * This function checks the size of the first entry, it does not validate + * whether all dimensions match. (use function `validate` for that) + * @param {Array} x + * @Return {Number[]} size + */ +function arraySize(x) { + const s = []; + while (Array.isArray(x)) { + s.push(x.length); + x = x[0]; + } + return s; +} + +/** + * Recursively validate whether each element in a multi dimensional array + * has a size corresponding to the provided size array. + * @param {Array} array Array to be validated + * @param {number[]} size Array with the size of each dimension + * @param {number} dim Current dimension + * @throws DimensionError + * @private + */ +function _validate(array, size, dim) { + let i; + const len = array.length; + if (len !== size[dim]) { + throw new _DimensionError.DimensionError(len, size[dim]); + } + if (dim < size.length - 1) { + // recursively validate each child array + const dimNext = dim + 1; + for (i = 0; i < len; i++) { + const child = array[i]; + if (!Array.isArray(child)) { + throw new _DimensionError.DimensionError(size.length - 1, size.length, '<'); + } + _validate(array[i], size, dimNext); + } + } else { + // last dimension. none of the childs may be an array + for (i = 0; i < len; i++) { + if (Array.isArray(array[i])) { + throw new _DimensionError.DimensionError(size.length + 1, size.length, '>'); + } + } + } +} + +/** + * Validate whether each element in a multi dimensional array has + * a size corresponding to the provided size array. + * @param {Array} array Array to be validated + * @param {number[]} size Array with the size of each dimension + * @throws DimensionError + */ +function validate(array, size) { + const isScalar = size.length === 0; + if (isScalar) { + // scalar + if (Array.isArray(array)) { + throw new _DimensionError.DimensionError(array.length, 0); + } + } else { + // array + _validate(array, size, 0); + } +} + +/** + * Validate whether the source of the index matches the size of the Array + * @param {Array | Matrix} array Array to be validated + * @param {Index} index Index with the source information to validate + * @throws DimensionError + */ +function validateIndexSourceSize(value, index) { + const valueSize = value.isMatrix ? value._size : arraySize(value); + const sourceSize = index._sourceSize; + // checks if the source size is not null and matches the valueSize + sourceSize.forEach((sourceDim, i) => { + if (sourceDim !== null && sourceDim !== valueSize[i]) { + throw new _DimensionError.DimensionError(sourceDim, valueSize[i]); + } + }); +} + +/** + * Test whether index is an integer number with index >= 0 and index < length + * when length is provided + * @param {number} index Zero-based index + * @param {number} [length] Length of the array + */ +function validateIndex(index, length) { + if (index !== undefined) { + if (!(0, _is.isNumber)(index) || !(0, _number.isInteger)(index)) { + throw new TypeError('Index must be an integer (value: ' + index + ')'); + } + if (index < 0 || typeof length === 'number' && index >= length) { + throw new _IndexError.IndexError(index, length); + } + } +} + +/** + * Test if and index has empty values + * @param {number} index Zero-based index + */ +function isEmptyIndex(index) { + for (let i = 0; i < index._dimensions.length; ++i) { + const dimension = index._dimensions[i]; + if (dimension._data && (0, _is.isArray)(dimension._data)) { + if (dimension._size[0] === 0) { + return true; + } + } else if (dimension.isRange) { + if (dimension.start === dimension.end) { + return true; + } + } else if ((0, _is.isString)(dimension)) { + if (dimension.length === 0) { + return true; + } + } + } + return false; +} + +/** + * Resize a multi dimensional array. The resized array is returned. + * @param {Array | number} array Array to be resized + * @param {number[]} size Array with the size of each dimension + * @param {*} [defaultValue=0] Value to be filled in in new entries, + * zero by default. Specify for example `null`, + * to clearly see entries that are not explicitly + * set. + * @return {Array} array The resized array + */ +function resize(array, size, defaultValue) { + // check the type of the arguments + if (!Array.isArray(size)) { + throw new TypeError('Array expected'); + } + if (size.length === 0) { + throw new Error('Resizing to scalar is not supported'); + } + + // check whether size contains positive integers + size.forEach(function (value) { + if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || value < 0) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + (0, _string.format)(size) + ')'); + } + }); + + // convert number to an array + if ((0, _is.isNumber)(array) || (0, _is.isBigNumber)(array)) { + array = [array]; + } + + // recursively resize the array + const _defaultValue = defaultValue !== undefined ? defaultValue : 0; + _resize(array, size, 0, _defaultValue); + return array; +} + +/** + * Recursively resize a multi dimensional array + * @param {Array} array Array to be resized + * @param {number[]} size Array with the size of each dimension + * @param {number} dim Current dimension + * @param {*} [defaultValue] Value to be filled in in new entries, + * undefined by default. + * @private + */ +function _resize(array, size, dim, defaultValue) { + let i; + let elem; + const oldLen = array.length; + const newLen = size[dim]; + const minLen = Math.min(oldLen, newLen); + + // apply new length + array.length = newLen; + if (dim < size.length - 1) { + // non-last dimension + const dimNext = dim + 1; + + // resize existing child arrays + for (i = 0; i < minLen; i++) { + // resize child array + elem = array[i]; + if (!Array.isArray(elem)) { + elem = [elem]; // add a dimension + array[i] = elem; + } + _resize(elem, size, dimNext, defaultValue); + } + + // create new child arrays + for (i = minLen; i < newLen; i++) { + // get child array + elem = []; + array[i] = elem; + + // resize new child array + _resize(elem, size, dimNext, defaultValue); + } + } else { + // last dimension + + // remove dimensions of existing values + for (i = 0; i < minLen; i++) { + while (Array.isArray(array[i])) { + array[i] = array[i][0]; + } + } + + // fill new elements with the default value + for (i = minLen; i < newLen; i++) { + array[i] = defaultValue; + } + } +} + +/** + * Re-shape a multi dimensional array to fit the specified dimensions + * @param {Array} array Array to be reshaped + * @param {number[]} sizes List of sizes for each dimension + * @returns {Array} Array whose data has been formatted to fit the + * specified dimensions + * + * @throws {DimensionError} If the product of the new dimension sizes does + * not equal that of the old ones + */ +function reshape(array, sizes) { + const flatArray = flatten(array); + const currentLength = flatArray.length; + if (!Array.isArray(array) || !Array.isArray(sizes)) { + throw new TypeError('Array expected'); + } + if (sizes.length === 0) { + throw new _DimensionError.DimensionError(0, currentLength, '!='); + } + sizes = processSizesWildcard(sizes, currentLength); + const newLength = product(sizes); + if (currentLength !== newLength) { + throw new _DimensionError.DimensionError(newLength, currentLength, '!='); + } + try { + return _reshape(flatArray, sizes); + } catch (e) { + if (e instanceof _DimensionError.DimensionError) { + throw new _DimensionError.DimensionError(newLength, currentLength, '!='); + } + throw e; + } +} + +/** + * Replaces the wildcard -1 in the sizes array. + * @param {number[]} sizes List of sizes for each dimension. At most on wildcard. + * @param {number} currentLength Number of elements in the array. + * @throws {Error} If more than one wildcard or unable to replace it. + * @returns {number[]} The sizes array with wildcard replaced. + */ +function processSizesWildcard(sizes, currentLength) { + const newLength = product(sizes); + const processedSizes = sizes.slice(); + const WILDCARD = -1; + const wildCardIndex = sizes.indexOf(WILDCARD); + const isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0; + if (isMoreThanOneWildcard) { + throw new Error('More than one wildcard in sizes'); + } + const hasWildcard = wildCardIndex >= 0; + const canReplaceWildcard = currentLength % newLength === 0; + if (hasWildcard) { + if (canReplaceWildcard) { + processedSizes[wildCardIndex] = -currentLength / newLength; + } else { + throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength); + } + } + return processedSizes; +} + +/** + * Computes the product of all array elements. + * @param {number[]} array Array of factors + * @returns {number} Product of all elements + */ +function product(array) { + return array.reduce((prev, curr) => prev * curr, 1); +} + +/** + * Iteratively re-shape a multi dimensional array to fit the specified dimensions + * @param {Array} array Array to be reshaped + * @param {number[]} sizes List of sizes for each dimension + * @returns {Array} Array whose data has been formatted to fit the + * specified dimensions + */ + +function _reshape(array, sizes) { + // testing if there are enough elements for the requested shape + let tmpArray = array; + let tmpArray2; + // for each dimensions starting by the last one and ignoring the first one + for (let sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) { + const size = sizes[sizeIndex]; + tmpArray2 = []; + + // aggregate the elements of the current tmpArray in elements of the requested size + const length = tmpArray.length / size; + for (let i = 0; i < length; i++) { + tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size)); + } + // set it as the new tmpArray for the next loop turn or for return + tmpArray = tmpArray2; + } + return tmpArray; +} + +/** + * Squeeze a multi dimensional array + * @param {Array} array + * @param {Array} [size] + * @returns {Array} returns the array itself + */ +function squeeze(array, size) { + const s = size || arraySize(array); + + // squeeze outer dimensions + while (Array.isArray(array) && array.length === 1) { + array = array[0]; + s.shift(); + } + + // find the first dimension to be squeezed + let dims = s.length; + while (s[dims - 1] === 1) { + dims--; + } + + // squeeze inner dimensions + if (dims < s.length) { + array = _squeeze(array, dims, 0); + s.length = dims; + } + return array; +} + +/** + * Recursively squeeze a multi dimensional array + * @param {Array} array + * @param {number} dims Required number of dimensions + * @param {number} dim Current dimension + * @returns {Array | *} Returns the squeezed array + * @private + */ +function _squeeze(array, dims, dim) { + let i, ii; + if (dim < dims) { + const next = dim + 1; + for (i = 0, ii = array.length; i < ii; i++) { + array[i] = _squeeze(array[i], dims, next); + } + } else { + while (Array.isArray(array)) { + array = array[0]; + } + } + return array; +} + +/** + * Unsqueeze a multi dimensional array: add dimensions when missing + * + * Paramter `size` will be mutated to match the new, unqueezed matrix size. + * + * @param {Array} array + * @param {number} dims Desired number of dimensions of the array + * @param {number} [outer] Number of outer dimensions to be added + * @param {Array} [size] Current size of array. + * @returns {Array} returns the array itself + * @private + */ +function unsqueeze(array, dims, outer, size) { + const s = size || arraySize(array); + + // unsqueeze outer dimensions + if (outer) { + for (let i = 0; i < outer; i++) { + array = [array]; + s.unshift(1); + } + } + + // unsqueeze inner dimensions + array = _unsqueeze(array, dims, 0); + while (s.length < dims) { + s.push(1); + } + return array; +} + +/** + * Recursively unsqueeze a multi dimensional array + * @param {Array} array + * @param {number} dims Required number of dimensions + * @param {number} dim Current dimension + * @returns {Array | *} Returns the squeezed array + * @private + */ +function _unsqueeze(array, dims, dim) { + let i, ii; + if (Array.isArray(array)) { + const next = dim + 1; + for (i = 0, ii = array.length; i < ii; i++) { + array[i] = _unsqueeze(array[i], dims, next); + } + } else { + for (let d = dim; d < dims; d++) { + array = [array]; + } + } + return array; +} +/** + * Flatten a multi dimensional array, put all elements in a one dimensional + * array + * @param {Array} array A multi dimensional array + * @return {Array} The flattened array (1 dimensional) + */ +function flatten(array) { + if (!Array.isArray(array)) { + // if not an array, return as is + return array; + } + const flat = []; + array.forEach(function callback(value) { + if (Array.isArray(value)) { + value.forEach(callback); // traverse through sub-arrays recursively + } else { + flat.push(value); + } + }); + return flat; +} + +/** + * A safe map + * @param {Array} array + * @param {function} callback + */ +function map(array, callback) { + return Array.prototype.map.call(array, callback); +} + +/** + * A safe forEach + * @param {Array} array + * @param {function} callback + */ +function forEach(array, callback) { + Array.prototype.forEach.call(array, callback); +} + +/** + * A safe filter + * @param {Array} array + * @param {function} callback + */ +function filter(array, callback) { + if (arraySize(array).length !== 1) { + throw new Error('Only one dimensional matrices supported'); + } + return Array.prototype.filter.call(array, callback); +} + +/** + * Filter values in a callback given a regular expression + * @param {Array} array + * @param {RegExp} regexp + * @return {Array} Returns the filtered array + * @private + */ +function filterRegExp(array, regexp) { + if (arraySize(array).length !== 1) { + throw new Error('Only one dimensional matrices supported'); + } + return Array.prototype.filter.call(array, entry => regexp.test(entry)); +} + +/** + * A safe join + * @param {Array} array + * @param {string} separator + */ +function join(array, separator) { + return Array.prototype.join.call(array, separator); +} + +/** + * Assign a numeric identifier to every element of a sorted array + * @param {Array} a An array + * @return {Array} An array of objects containing the original value and its identifier + */ +function identify(a) { + if (!Array.isArray(a)) { + throw new TypeError('Array input expected'); + } + if (a.length === 0) { + return a; + } + const b = []; + let count = 0; + b[0] = { + value: a[0], + identifier: 0 + }; + for (let i = 1; i < a.length; i++) { + if (a[i] === a[i - 1]) { + count++; + } else { + count = 0; + } + b.push({ + value: a[i], + identifier: count + }); + } + return b; +} + +/** + * Remove the numeric identifier from the elements + * @param {array} a An array + * @return {array} An array of values without identifiers + */ +function generalize(a) { + if (!Array.isArray(a)) { + throw new TypeError('Array input expected'); + } + if (a.length === 0) { + return a; + } + const b = []; + for (let i = 0; i < a.length; i++) { + b.push(a[i].value); + } + return b; +} + +/** + * Check the datatype of a given object + * This is a low level implementation that should only be used by + * parent Matrix classes such as SparseMatrix or DenseMatrix + * This method does not validate Array Matrix shape + * @param {Array} array + * @param {function} typeOf Callback function to use to determine the type of a value + * @return {string} + */ +function getArrayDataType(array, typeOf) { + let type; // to hold type info + let length = 0; // to hold length value to ensure it has consistent sizes + + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const isArray = Array.isArray(item); + + // Saving the target matrix row size + if (i === 0 && isArray) { + length = item.length; + } + + // If the current item is an array but the length does not equal the targetVectorSize + if (isArray && item.length !== length) { + return undefined; + } + const itemType = isArray ? getArrayDataType(item, typeOf) // recurse into a nested array + : typeOf(item); + if (type === undefined) { + type = itemType; // first item + } else if (type !== itemType) { + return 'mixed'; + } else { + // we're good, everything has the same type so far + } + } + return type; +} + +/** + * Return the last item from an array + * @param {array} + * @returns {*} + */ +function last(array) { + return array[array.length - 1]; +} + +/** + * Get all but the last element of array. + * @param {array} + * @returns {*} + */ +function initial(array) { + return array.slice(0, array.length - 1); +} + +/** + * Recursively concatenate two matrices. + * The contents of the matrices is not cloned. + * @param {Array} a Multi dimensional array + * @param {Array} b Multi dimensional array + * @param {number} concatDim The dimension on which to concatenate (zero-based) + * @param {number} dim The current dim (zero-based) + * @return {Array} c The concatenated matrix + * @private + */ +function concatRecursive(a, b, concatDim, dim) { + if (dim < concatDim) { + // recurse into next dimension + if (a.length !== b.length) { + throw new _DimensionError.DimensionError(a.length, b.length); + } + const c = []; + for (let i = 0; i < a.length; i++) { + c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1); + } + return c; + } else { + // concatenate this dimension + return a.concat(b); + } +} + +/** + * Concatenates many arrays in the specified direction + * @param {...Array} arrays All the arrays to concatenate + * @param {number} concatDim The dimension on which to concatenate (zero-based) + * @returns +*/ +function concat() { + const arrays = Array.prototype.slice.call(arguments, 0, -1); + const concatDim = Array.prototype.slice.call(arguments, -1); + if (arrays.length === 1) { + return arrays[0]; + } + if (arrays.length > 1) { + return arrays.slice(1).reduce(function (A, B) { + return concatRecursive(A, B, concatDim, 0); + }, arrays[0]); + } else { + throw new Error('Wrong number of arguments in function concat'); + } +} + +/** + * Receives two or more sizes and get's the broadcasted size for both. + * @param {...number[]} sizes Sizes to broadcast together + * @returns + */ +function broadcastSizes() { + for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) { + sizes[_key] = arguments[_key]; + } + const dimensions = sizes.map(s => s.length); + const N = Math.max(...dimensions); + const sizeMax = new Array(N).fill(null); + // check for every size + for (let i = 0; i < sizes.length; i++) { + const size = sizes[i]; + const dim = dimensions[i]; + for (let j = 0; j < dim; j++) { + const n = N - dim + j; + if (size[j] > sizeMax[n]) { + sizeMax[n] = size[j]; + } + } + } + for (let i = 0; i < sizes.length; i++) { + checkBroadcastingRules(sizes[i], sizeMax); + } + return sizeMax; +} + +/** + * Checks if it's possible to broadcast a size to another size + * @param {number[]} size The size of the array to check + * @param {number[]} toSize The size of the array to validate if it can be broadcasted to + */ +function checkBroadcastingRules(size, toSize) { + const N = toSize.length; + const dim = size.length; + for (let j = 0; j < dim; j++) { + const n = N - dim + j; + if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) { + throw new Error(`shape missmatch: missmatch is found in arg with shape (${size}) not possible to broadcast dimension ${dim} with size ${size[j]} to size ${toSize[n]}`); + } + } +} + +/** + * Broadcasts a single array to a certain size + * @param {array} array Array to be broadcasted + * @param {number[]} toSize Size to broadcast the array + * @returns The broadcasted array + */ +function broadcastTo(array, toSize) { + let Asize = arraySize(array); + if ((0, _object.deepStrictEqual)(Asize, toSize)) { + return array; + } + checkBroadcastingRules(Asize, toSize); + const broadcastedSize = broadcastSizes(Asize, toSize); + const N = broadcastedSize.length; + const paddedSize = [...Array(N - Asize.length).fill(1), ...Asize]; + let A = clone(array); + // reshape A if needed to make it ready for concat + if (Asize.length < N) { + A = reshape(A, paddedSize); + Asize = arraySize(A); + } + + // stretches the array on each dimension to make it the same size as index + for (let dim = 0; dim < N; dim++) { + if (Asize[dim] < broadcastedSize[dim]) { + A = stretch(A, broadcastedSize[dim], dim); + Asize = arraySize(A); + } + } + return A; +} + +/** + * Broadcasts arrays and returns the broadcasted arrays in an array + * @param {...Array | any} arrays + * @returns + */ +function broadcastArrays() { + for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + arrays[_key2] = arguments[_key2]; + } + if (arrays.length === 0) { + throw new Error('Insuficient number of argumnets in function broadcastArrays'); + } + if (arrays.length === 1) { + return arrays[0]; + } + const sizes = arrays.map(function (array) { + return arraySize(array); + }); + const broadcastedSize = broadcastSizes(...sizes); + const broadcastedArrays = []; + arrays.forEach(function (array) { + broadcastedArrays.push(broadcastTo(array, broadcastedSize)); + }); + return broadcastedArrays; +} + +/** + * stretches a matrix up to a certain size in a certain dimension + * @param {Array} arrayToStretch + * @param {number[]} sizeToStretch + * @param {number} dimToStretch + * @returns + */ +function stretch(arrayToStretch, sizeToStretch, dimToStretch) { + return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch); +} + +/** +* Retrieves a single element from an array given an index. +* +* @param {Array} array - The array from which to retrieve the value. +* @param {Array} idx - An array of indices specifying the position of the desired element in each dimension. +* @returns {*} - The value at the specified position in the array. +* +* @example +* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]; +* const index = [1, 0, 1]; +* console.log(getValue(arr, index)); // 6 +*/ +function get(array, index) { + if (!Array.isArray(array)) { + throw new Error('Array expected'); + } + const size = arraySize(array); + if (index.length !== size.length) { + throw new _DimensionError.DimensionError(index.length, size.length); + } + for (let x = 0; x < index.length; x++) { + validateIndex(index[x], size[x]); + } + return index.reduce((acc, curr) => acc[curr], array); +} + +/** + * Recursive function to map a multi-dimensional array. + * + * @param {*} value - The current value being processed in the array. + * @param {Array} index - The index of the current value being processed in the array. + * @param {Array} array - The array being processed. + * @param {Function} callback - Function that produces the element of the new Array, taking three arguments: the value of the element, the index of the element, and the Array being processed. + * @returns {*} The new array with each element being the result of the callback function. + */ +function recurse(value, index, array, callback) { + if (Array.isArray(value)) { + return value.map(function (child, i) { + // we create a copy of the index array and append the new index value + return recurse(child, index.concat(i), array, callback); + }); + } else { + // invoke the callback function with the right number of arguments + return callback(value, index, array); + } +} + +/** + * Deep clones a multidimensional array + * @param {Array} array + * @returns cloned array + */ +function clone(array) { + return (0, _extends2.default)([], array); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js new file mode 100644 index 0000000..6cd4440 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js @@ -0,0 +1,411 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.bitAndBigNumber = bitAndBigNumber; +exports.bitNotBigNumber = bitNotBigNumber; +exports.bitOrBigNumber = bitOrBigNumber; +exports.bitXor = bitXor; +exports.bitwise = bitwise; +exports.leftShiftBigNumber = leftShiftBigNumber; +exports.rightArithShiftBigNumber = rightArithShiftBigNumber; +/** + * Bitwise and for Bignumbers + * + * Special Cases: + * N & n = N + * n & 0 = 0 + * n & -1 = n + * n & n = n + * I & I = I + * -I & -I = -I + * I & -I = 0 + * I & n = n + * I & -n = I + * -I & n = 0 + * -I & -n = -I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` & `y`, is fully precise + * @private + */ +function bitAndBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitAnd'); + } + const BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.eq(-1) || x.eq(y)) { + return x; + } + if (y.isZero() || x.eq(-1)) { + return y; + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !y.isFinite()) { + if (x.isNegative() === y.isNegative()) { + return x; + } + return new BigNumber(0); + } + if (!x.isFinite()) { + if (y.isNegative()) { + return x; + } + if (x.isNegative()) { + return new BigNumber(0); + } + return y; + } + if (!y.isFinite()) { + if (x.isNegative()) { + return y; + } + if (y.isNegative()) { + return new BigNumber(0); + } + return x; + } + } + return bitwise(x, y, function (a, b) { + return a & b; + }); +} + +/** + * Bitwise not + * @param {BigNumber} x + * @return {BigNumber} Result of ~`x`, fully precise + * + */ +function bitNotBigNumber(x) { + if (x.isFinite() && !x.isInteger()) { + throw new Error('Integer expected in function bitNot'); + } + const BigNumber = x.constructor; + const prevPrec = BigNumber.precision; + BigNumber.config({ + precision: 1E9 + }); + const result = x.plus(new BigNumber(1)); + result.s = -result.s || null; + BigNumber.config({ + precision: prevPrec + }); + return result; +} + +/** + * Bitwise OR for BigNumbers + * + * Special Cases: + * N | n = N + * n | 0 = n + * n | -1 = -1 + * n | n = n + * I | I = I + * -I | -I = -I + * I | -n = -1 + * I | -I = -1 + * I | n = I + * -I | n = -I + * -I | -n = -n + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` | `y`, fully precise + */ +function bitOrBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitOr'); + } + const BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + const negOne = new BigNumber(-1); + if (x.isZero() || y.eq(negOne) || x.eq(y)) { + return y; + } + if (y.isZero() || x.eq(negOne)) { + return x; + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) { + return negOne; + } + if (x.isNegative() && y.isNegative()) { + return x.isFinite() ? x : y; + } + return x.isFinite() ? y : x; + } + return bitwise(x, y, function (a, b) { + return a | b; + }); +} + +/** + * Applies bitwise function to numbers + * @param {BigNumber} x + * @param {BigNumber} y + * @param {function (a, b)} func + * @return {BigNumber} + */ +function bitwise(x, y, func) { + const BigNumber = x.constructor; + let xBits, yBits; + const xSign = +(x.s < 0); + const ySign = +(y.s < 0); + if (xSign) { + xBits = decCoefficientToBinaryString(bitNotBigNumber(x)); + for (let i = 0; i < xBits.length; ++i) { + xBits[i] ^= 1; + } + } else { + xBits = decCoefficientToBinaryString(x); + } + if (ySign) { + yBits = decCoefficientToBinaryString(bitNotBigNumber(y)); + for (let i = 0; i < yBits.length; ++i) { + yBits[i] ^= 1; + } + } else { + yBits = decCoefficientToBinaryString(y); + } + let minBits, maxBits, minSign; + if (xBits.length <= yBits.length) { + minBits = xBits; + maxBits = yBits; + minSign = xSign; + } else { + minBits = yBits; + maxBits = xBits; + minSign = ySign; + } + let shortLen = minBits.length; + let longLen = maxBits.length; + const expFuncVal = func(xSign, ySign) ^ 1; + let outVal = new BigNumber(expFuncVal ^ 1); + let twoPower = new BigNumber(1); + const two = new BigNumber(2); + const prevPrec = BigNumber.precision; + BigNumber.config({ + precision: 1E9 + }); + while (shortLen > 0) { + if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) { + outVal = outVal.plus(twoPower); + } + twoPower = twoPower.times(two); + } + while (longLen > 0) { + if (func(minSign, maxBits[--longLen]) === expFuncVal) { + outVal = outVal.plus(twoPower); + } + twoPower = twoPower.times(two); + } + BigNumber.config({ + precision: prevPrec + }); + if (expFuncVal === 0) { + outVal.s = -outVal.s; + } + return outVal; +} + +/* Extracted from decimal.js, and edited to specialize. */ +function decCoefficientToBinaryString(x) { + // Convert to string + const a = x.d; // array with digits + let r = a[0] + ''; + for (let i = 1; i < a.length; ++i) { + let s = a[i] + ''; + for (let z = 7 - s.length; z--;) { + s = '0' + s; + } + r += s; + } + let j = r.length; + while (r.charAt(j) === '0') { + j--; + } + let xe = x.e; + let str = r.slice(0, j + 1 || 1); + const strL = str.length; + if (xe > 0) { + if (++xe > strL) { + // Append zeros. + xe -= strL; + while (xe--) { + str += '0'; + } + } else if (xe < strL) { + str = str.slice(0, xe) + '.' + str.slice(xe); + } + } + + // Convert from base 10 (decimal) to base 2 + const arr = [0]; + for (let i = 0; i < str.length;) { + let arrL = arr.length; + while (arrL--) { + arr[arrL] *= 10; + } + arr[0] += parseInt(str.charAt(i++)); // convert to int + for (let j = 0; j < arr.length; ++j) { + if (arr[j] > 1) { + if (arr[j + 1] === null || arr[j + 1] === undefined) { + arr[j + 1] = 0; + } + arr[j + 1] += arr[j] >> 1; + arr[j] &= 1; + } + } + } + return arr.reverse(); +} + +/** + * Bitwise XOR for BigNumbers + * + * Special Cases: + * N ^ n = N + * n ^ 0 = n + * n ^ n = 0 + * n ^ -1 = ~n + * I ^ n = I + * I ^ -n = -I + * I ^ -I = -1 + * -I ^ n = -I + * -I ^ -n = I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` ^ `y`, fully precise + * + */ +function bitXor(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitXor'); + } + const BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + if (x.isZero()) { + return y; + } + if (y.isZero()) { + return x; + } + if (x.eq(y)) { + return new BigNumber(0); + } + const negOne = new BigNumber(-1); + if (x.eq(negOne)) { + return bitNotBigNumber(y); + } + if (y.eq(negOne)) { + return bitNotBigNumber(x); + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !y.isFinite()) { + return negOne; + } + return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity); + } + return bitwise(x, y, function (a, b) { + return a ^ b; + }); +} + +/** + * Bitwise left shift + * + * Special Cases: + * n << -n = N + * n << N = N + * N << n = N + * n << 0 = n + * 0 << n = 0 + * I << I = N + * I << n = I + * n << I = I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` << `y` + * + */ +function leftShiftBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function leftShift'); + } + const BigNumber = x.constructor; + if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.isZero()) { + return x; + } + if (!x.isFinite() && !y.isFinite()) { + return new BigNumber(NaN); + } + + // Math.pow(2, y) is fully precise for y < 55, and fast + if (y.lt(55)) { + return x.times(Math.pow(2, y.toNumber()) + ''); + } + return x.times(new BigNumber(2).pow(y)); +} + +/* + * Special Cases: + * n >> -n = N + * n >> N = N + * N >> n = N + * I >> I = N + * n >> 0 = n + * I >> n = I + * -I >> n = -I + * -I >> I = -I + * n >> I = I + * -n >> I = -1 + * 0 >> n = 0 + * + * @param {BigNumber} value + * @param {BigNumber} value + * @return {BigNumber} Result of `x` >> `y` + * + */ +function rightArithShiftBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function rightArithShift'); + } + const BigNumber = x.constructor; + if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.isZero()) { + return x; + } + if (!y.isFinite()) { + if (x.isNegative()) { + return new BigNumber(-1); + } + if (!x.isFinite()) { + return new BigNumber(NaN); + } + return new BigNumber(0); + } + + // Math.pow(2, y) is fully precise for y < 55, and fast + if (y.lt(55)) { + return x.div(Math.pow(2, y.toNumber()) + '').floor(); + } + return x.div(new BigNumber(2).pow(y)).floor(); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js new file mode 100644 index 0000000..5a3bccd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createBigNumberTau = exports.createBigNumberPi = exports.createBigNumberPhi = exports.createBigNumberE = void 0; +var _function = require("../function.js"); +/** + * Calculate BigNumber e + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns e + */ +const createBigNumberE = exports.createBigNumberE = (0, _function.memoize)(function (BigNumber) { + return new BigNumber(1).exp(); +}, { + hasher +}); + +/** + * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2 + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns phi + */ +const createBigNumberPhi = exports.createBigNumberPhi = (0, _function.memoize)(function (BigNumber) { + return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2); +}, { + hasher +}); + +/** + * Calculate BigNumber pi. + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns pi + */ +const createBigNumberPi = exports.createBigNumberPi = (0, _function.memoize)(function (BigNumber) { + return BigNumber.acos(-1); +}, { + hasher +}); + +/** + * Calculate BigNumber tau, tau = 2 * pi + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns tau + */ +const createBigNumberTau = exports.createBigNumberTau = (0, _function.memoize)(function (BigNumber) { + return createBigNumberPi(BigNumber).times(2); +}, { + hasher +}); + +/** + * Create a hash for a BigNumber constructor function. The created has is + * the configured precision + * @param {Array} args Supposed to contain a single entry with + * a BigNumber constructor + * @return {number} precision + * @private + */ +function hasher(args) { + return args[0].precision; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js new file mode 100644 index 0000000..c72212a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js @@ -0,0 +1,251 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.format = format; +exports.toEngineering = toEngineering; +exports.toExponential = toExponential; +exports.toFixed = toFixed; +var _is = require("../is.js"); +var _number = require("../number.js"); +/** + * Formats a BigNumber in a given base + * @param {BigNumber} n + * @param {number} base + * @param {number} size + * @returns {string} + */ +function formatBigNumberToBase(n, base, size) { + const BigNumberCtor = n.constructor; + const big2 = new BigNumberCtor(2); + let suffix = ''; + if (size) { + if (size < 1) { + throw new Error('size must be in greater than 0'); + } + if (!(0, _number.isInteger)(size)) { + throw new Error('size must be an integer'); + } + if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) { + throw new Error(`Value must be in range [-2^${size - 1}, 2^${size - 1}-1]`); + } + if (!n.isInteger()) { + throw new Error('Value must be an integer'); + } + if (n.lessThan(0)) { + n = n.add(big2.pow(size)); + } + suffix = `i${size}`; + } + switch (base) { + case 2: + return `${n.toBinary()}${suffix}`; + case 8: + return `${n.toOctal()}${suffix}`; + case 16: + return `${n.toHexadecimal()}${suffix}`; + default: + throw new Error(`Base ${base} not supported `); + } +} + +/** + * Convert a BigNumber to a formatted string representation. + * + * Syntax: + * + * format(value) + * format(value, options) + * format(value, precision) + * format(value, fn) + * + * Where: + * + * {number} value The value to be formatted + * {Object} options An object with formatting options. Available options: + * {string} notation + * Number notation. Choose from: + * 'fixed' Always use regular number notation. + * For example '123.40' and '14000000' + * 'exponential' Always use exponential notation. + * For example '1.234e+2' and '1.4e+7' + * 'auto' (default) Regular number notation for numbers + * having an absolute value between + * `lower` and `upper` bounds, and uses + * exponential notation elsewhere. + * Lower bound is included, upper bound + * is excluded. + * For example '123.4' and '1.4e7'. + * 'bin', 'oct, or + * 'hex' Format the number using binary, octal, + * or hexadecimal notation. + * For example '0b1101' and '0x10fe'. + * {number} wordSize The word size in bits to use for formatting + * in binary, octal, or hexadecimal notation. + * To be used only with 'bin', 'oct', or 'hex' + * values for 'notation' option. When this option + * is defined the value is formatted as a signed + * twos complement integer of the given word size + * and the size suffix is appended to the output. + * For example + * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'. + * Default value is undefined. + * {number} precision A number between 0 and 16 to round + * the digits of the number. + * In case of notations 'exponential', + * 'engineering', and 'auto', + * `precision` defines the total + * number of significant digits returned. + * In case of notation 'fixed', + * `precision` defines the number of + * significant digits after the decimal + * point. + * `precision` is undefined by default. + * {number} lowerExp Exponent determining the lower boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `-3`. + * {number} upperExp Exponent determining the upper boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `5`. + * {Function} fn A custom formatting function. Can be used to override the + * built-in notations. Function `fn` is called with `value` as + * parameter and must return a string. Is useful for example to + * format all values inside a matrix in a particular way. + * + * Examples: + * + * format(6.4) // '6.4' + * format(1240000) // '1.24e6' + * format(1/3) // '0.3333333333333333' + * format(1/3, 3) // '0.333' + * format(21385, 2) // '21000' + * format(12e8, {notation: 'fixed'}) // returns '1200000000' + * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000' + * format(52.8, {notation: 'exponential'}) // returns '5.28e+1' + * format(12400, {notation: 'engineering'}) // returns '12.400e+3' + * + * @param {BigNumber} value + * @param {Object | Function | number | BigNumber} [options] + * @return {string} str The formatted value + */ +function format(value, options) { + if (typeof options === 'function') { + // handle format(value, fn) + return options(value); + } + + // handle special cases + if (!value.isFinite()) { + return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity'; + } + const { + notation, + precision, + wordSize + } = (0, _number.normalizeFormatOptions)(options); + + // handle the various notations + switch (notation) { + case 'fixed': + return toFixed(value, precision); + case 'exponential': + return toExponential(value, precision); + case 'engineering': + return toEngineering(value, precision); + case 'bin': + return formatBigNumberToBase(value, 2, wordSize); + case 'oct': + return formatBigNumberToBase(value, 8, wordSize); + case 'hex': + return formatBigNumberToBase(value, 16, wordSize); + case 'auto': + { + // determine lower and upper bound for exponential notation. + // TODO: implement support for upper and lower to be BigNumbers themselves + const lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3); + const upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5); + + // handle special case zero + if (value.isZero()) return '0'; + + // determine whether or not to output exponential notation + let str; + const rounded = value.toSignificantDigits(precision); + const exp = rounded.e; + if (exp >= lowerExp && exp < upperExp) { + // normal number notation + str = rounded.toFixed(); + } else { + // exponential notation + str = toExponential(value, precision); + } + + // remove trailing zeros after the decimal point + return str.replace(/((\.\d*?)(0+))($|e)/, function () { + const digits = arguments[2]; + const e = arguments[4]; + return digits !== '.' ? digits + e : e; + }); + } + default: + throw new Error('Unknown notation "' + notation + '". ' + 'Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.'); + } +} + +/** + * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3' + * @param {BigNumber} value + * @param {number} [precision] Optional number of significant figures to return. + */ +function toEngineering(value, precision) { + // find nearest lower multiple of 3 for exponent + const e = value.e; + const newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3; + + // find difference in exponents, and calculate the value without exponent + const valueWithoutExp = value.mul(Math.pow(10, -newExp)); + let valueStr = valueWithoutExp.toPrecision(precision); + if (valueStr.includes('e')) { + const BigNumber = value.constructor; + valueStr = new BigNumber(valueStr).toFixed(); + } + return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString(); +} + +/** + * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3' + * @param {BigNumber} value + * @param {number} [precision] Number of digits in formatted output. + * If not provided, the maximum available digits + * is used. + * @returns {string} str + */ +function toExponential(value, precision) { + if (precision !== undefined) { + return value.toExponential(precision - 1); // Note the offset of one + } else { + return value.toExponential(); + } +} + +/** + * Format a number with fixed notation. + * @param {BigNumber} value + * @param {number} [precision=undefined] Optional number of decimals after the + * decimal point. Undefined by default. + */ +function toFixed(value, precision) { + return value.toFixed(precision); +} +function _toNumberOrDefault(value, defaultValue) { + if ((0, _is.isNumber)(value)) { + return value; + } else if ((0, _is.isBigNumber)(value)) { + return value.toNumber(); + } else { + return defaultValue; + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js new file mode 100644 index 0000000..8872358 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nearlyEqual = nearlyEqual; +/** + * Compares two BigNumbers. + * @param {BigNumber} a - First value to compare + * @param {BigNumber} b - Second value to compare + * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0. + * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0. + * @returns {boolean} whether the two numbers are nearly equal + * @throws {Error} If `relTol` is less than or equal to 0. + * @throws {Error} If `absTol` is less than 0. + * + * @example + * nearlyEqual(1.000000001, 1.0, 1e-9); // true + * nearlyEqual(1.000000002, 1.0, 0); // false + * nearlyEqual(1.0, 1.009, undefined, 0.02); // true + * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true + */ +function nearlyEqual(a, b) { + let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9; + let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (relTol <= 0) { + throw new Error('Relative tolerance must be greater than 0'); + } + if (absTol < 0) { + throw new Error('Absolute tolerance must be at least 0'); + } + // NaN + if (a.isNaN() || b.isNaN()) { + return false; + } + if (!a.isFinite() || !b.isFinite()) { + return a.eq(b); + } + // use "==" operator, handles infinities + if (a.eq(b)) { + return true; + } + // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol) + return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol)); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/collection.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/collection.js new file mode 100644 index 0000000..2056a37 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/collection.js @@ -0,0 +1,186 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.containsCollections = containsCollections; +exports.deepForEach = deepForEach; +exports.deepMap = deepMap; +exports.reduce = reduce; +exports.scatter = scatter; +var _is = require("./is.js"); +var _IndexError = require("../error/IndexError.js"); +var _array = require("./array.js"); +var _switch2 = require("./switch.js"); +/** + * Test whether an array contains collections + * @param {Array} array + * @returns {boolean} Returns true when the array contains one or multiple + * collections (Arrays or Matrices). Returns false otherwise. + */ +function containsCollections(array) { + for (let i = 0; i < array.length; i++) { + if ((0, _is.isCollection)(array[i])) { + return true; + } + } + return false; +} + +/** + * Recursively loop over all elements in a given multi dimensional array + * and invoke the callback on each of the elements. + * @param {Array | Matrix} array + * @param {Function} callback The callback method is invoked with one + * parameter: the current element in the array + */ +function deepForEach(array, callback) { + if ((0, _is.isMatrix)(array)) { + array = array.valueOf(); + } + for (let i = 0, ii = array.length; i < ii; i++) { + const value = array[i]; + if (Array.isArray(value)) { + deepForEach(value, callback); + } else { + callback(value); + } + } +} + +/** + * Execute the callback function element wise for each element in array and any + * nested array + * Returns an array with the results + * @param {Array | Matrix} array + * @param {Function} callback The callback is called with two parameters: + * value1 and value2, which contain the current + * element of both arrays. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {Array | Matrix} res + */ +function deepMap(array, callback, skipZeros) { + if (array && typeof array.map === 'function') { + // TODO: replace array.map with a for loop to improve performance + return array.map(function (x) { + return deepMap(x, callback, skipZeros); + }); + } else { + return callback(array); + } +} + +/** + * Reduce a given matrix or array to a new matrix or + * array with one less dimension, applying the given + * callback in the selected dimension. + * @param {Array | Matrix} mat + * @param {number} dim + * @param {Function} callback + * @return {Array | Matrix} res + */ +function reduce(mat, dim, callback) { + const size = Array.isArray(mat) ? (0, _array.arraySize)(mat) : mat.size(); + if (dim < 0 || dim >= size.length) { + // TODO: would be more clear when throwing a DimensionError here + throw new _IndexError.IndexError(dim, size.length); + } + if ((0, _is.isMatrix)(mat)) { + return mat.create(_reduce(mat.valueOf(), dim, callback), mat.datatype()); + } else { + return _reduce(mat, dim, callback); + } +} + +/** + * Recursively reduce a matrix + * @param {Array} mat + * @param {number} dim + * @param {Function} callback + * @returns {Array} ret + * @private + */ +function _reduce(mat, dim, callback) { + let i, ret, val, tran; + if (dim <= 0) { + if (!Array.isArray(mat[0])) { + val = mat[0]; + for (i = 1; i < mat.length; i++) { + val = callback(val, mat[i]); + } + return val; + } else { + tran = (0, _switch2._switch)(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _reduce(tran[i], dim - 1, callback); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _reduce(mat[i], dim - 1, callback); + } + return ret; + } +} + +// TODO: document function scatter +function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) { + // a arrays + const avalues = a._values; + const aindex = a._index; + const aptr = a._ptr; + + // vars + let k, k0, k1, i; + + // check we need to process values (pattern matrix) + if (x) { + // values in j + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check value exists in current j + if (w[i] !== mark) { + // i is new entry in j + w[i] = mark; + // add i to pattern of C + cindex.push(i); + // x(i) = A, check we need to call function this time + if (update) { + // copy value to workspace calling callback function + x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]); + // function was called on current row + u[i] = mark; + } else { + // copy value to workspace + x[i] = avalues[k]; + } + } else { + // i exists in C already + x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]); + // function was called on current row + u[i] = mark; + } + } + } else { + // values in j + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check value exists in current j + if (w[i] !== mark) { + // i is new entry in j + w[i] = mark; + // add i to pattern of C + cindex.push(i); + } else { + // indicate function was called on current row + u[i] = mark; + } + } + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/complex.js new file mode 100644 index 0000000..6302cf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/complex.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.complexEquals = complexEquals; +var _number = require("./number.js"); +/** + * Test whether two complex values are equal provided a given relTol and absTol. + * Does not use or change the global Complex.EPSILON setting + * @param {Complex} x - The first complex number for comparison. + * @param {Complex} y - The second complex number for comparison. + * @param {number} relTol - The relative tolerance for comparison. + * @param {number} absTol - The absolute tolerance for comparison. + * @returns {boolean} - Returns true if the two complex numbers are equal within the given tolerances, otherwise returns false. + */ +function complexEquals(x, y, relTol, absTol) { + return (0, _number.nearlyEqual)(x.re, y.re, relTol, absTol) && (0, _number.nearlyEqual)(x.im, y.im, relTol, absTol); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/customs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/customs.js new file mode 100644 index 0000000..1d03b5e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/customs.js @@ -0,0 +1,151 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getSafeMethod = getSafeMethod; +exports.getSafeProperty = getSafeProperty; +exports.isPlainObject = isPlainObject; +exports.isSafeMethod = isSafeMethod; +exports.isSafeProperty = isSafeProperty; +exports.setSafeProperty = setSafeProperty; +var _object = require("./object.js"); +/** + * Get a property of a plain object + * Throws an error in case the object is not a plain object or the + * property is not defined on the object itself + * @param {Object} object + * @param {string} prop + * @return {*} Returns the property value when safe + */ +function getSafeProperty(object, prop) { + // only allow getting safe properties of a plain object + if (isSafeProperty(object, prop)) { + return object[prop]; + } + if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) { + throw new Error('Cannot access method "' + prop + '" as a property'); + } + throw new Error('No access to property "' + prop + '"'); +} + +/** + * Set a property on a plain object. + * Throws an error in case the object is not a plain object or the + * property would override an inherited property like .constructor or .toString + * @param {Object} object + * @param {string} prop + * @param {*} value + * @return {*} Returns the value + */ +// TODO: merge this function into access.js? +function setSafeProperty(object, prop, value) { + // only allow setting safe properties of a plain object + if (isSafeProperty(object, prop)) { + object[prop] = value; + return value; + } + throw new Error('No access to property "' + prop + '"'); +} + +/** + * Test whether a property is safe to use on an object or Array. + * For example .toString and .constructor are not safe + * @param {Object | Array} object + * @param {string} prop + * @return {boolean} Returns true when safe + */ +function isSafeProperty(object, prop) { + if (!isPlainObject(object) && !Array.isArray(object)) { + return false; + } + // SAFE: whitelisted + // e.g length + if ((0, _object.hasOwnProperty)(safeNativeProperties, prop)) { + return true; + } + // UNSAFE: inherited from Object prototype + // e.g constructor + if (prop in Object.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Object.prototype is a root object + return false; + } + // UNSAFE: inherited from Function prototype + // e.g call, apply + if (prop in Function.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Function.prototype is a root object + return false; + } + return true; +} + +/** + * Validate whether a method is safe. + * Throws an error when that's not the case. + * @param {Object} object + * @param {string} method + * @return {function} Returns the method when valid + */ +function getSafeMethod(object, method) { + if (!isSafeMethod(object, method)) { + throw new Error('No access to method "' + method + '"'); + } + return object[method]; +} + +/** + * Check whether a method is safe. + * Throws an error when that's not the case (for example for `constructor`). + * @param {Object} object + * @param {string} method + * @return {boolean} Returns true when safe, false otherwise + */ +function isSafeMethod(object, method) { + if (object === null || object === undefined || typeof object[method] !== 'function') { + return false; + } + // UNSAFE: ghosted + // e.g overridden toString + // Note that IE10 doesn't support __proto__ and we can't do this check there. + if ((0, _object.hasOwnProperty)(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) { + return false; + } + // SAFE: whitelisted + // e.g toString + if ((0, _object.hasOwnProperty)(safeNativeMethods, method)) { + return true; + } + // UNSAFE: inherited from Object prototype + // e.g constructor + if (method in Object.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Object.prototype is a root object + return false; + } + // UNSAFE: inherited from Function prototype + // e.g call, apply + if (method in Function.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Function.prototype is a root object + return false; + } + return true; +} +function isPlainObject(object) { + return typeof object === 'object' && object && object.constructor === Object; +} +const safeNativeProperties = { + length: true, + name: true +}; +const safeNativeMethods = { + toString: true, + valueOf: true, + toLocaleString: true +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/emitter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/emitter.js new file mode 100644 index 0000000..17d650d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/emitter.js @@ -0,0 +1,24 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mixin = mixin; +var _tinyEmitter = _interopRequireDefault(require("tiny-emitter")); +/** + * Extend given object with emitter functions `on`, `off`, `once`, `emit` + * @param {Object} obj + * @return {Object} obj + */ +function mixin(obj) { + // create event emitter + const emitter = new _tinyEmitter.default(); + + // bind methods to obj (we don't want to expose the emitter.e Array...) + obj.on = emitter.on.bind(emitter); + obj.off = emitter.off.bind(emitter); + obj.once = emitter.once.bind(emitter); + obj.emit = emitter.emit.bind(emitter); + return obj; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/factory.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/factory.js new file mode 100644 index 0000000..620046b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/factory.js @@ -0,0 +1,137 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assertDependencies = assertDependencies; +exports.create = create; +exports.factory = factory; +exports.isFactory = isFactory; +exports.isOptionalDependency = isOptionalDependency; +exports.sortFactories = sortFactories; +exports.stripOptionalNotation = stripOptionalNotation; +var _object = require("./object.js"); +/** + * Create a factory function, which can be used to inject dependencies. + * + * The created functions are memoized, a consecutive call of the factory + * with the exact same inputs will return the same function instance. + * The memoized cache is exposed on `factory.cache` and can be cleared + * if needed. + * + * Example: + * + * const name = 'log' + * const dependencies = ['config', 'typed', 'divideScalar', 'Complex'] + * + * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => { + * // ... create the function log here and return it + * } + * + * @param {string} name Name of the function to be created + * @param {string[]} dependencies The names of all required dependencies + * @param {function} create Callback function called with an object with all dependencies + * @param {Object} [meta] Optional object with meta information that will be attached + * to the created factory function as property `meta`. + * @returns {function} + */ +function factory(name, dependencies, create, meta) { + function assertAndCreate(scope) { + // we only pass the requested dependencies to the factory function + // to prevent functions to rely on dependencies that are not explicitly + // requested. + const deps = (0, _object.pickShallow)(scope, dependencies.map(stripOptionalNotation)); + assertDependencies(name, dependencies, scope); + return create(deps); + } + assertAndCreate.isFactory = true; + assertAndCreate.fn = name; + assertAndCreate.dependencies = dependencies.slice().sort(); + if (meta) { + assertAndCreate.meta = meta; + } + return assertAndCreate; +} + +/** + * Sort all factories such that when loading in order, the dependencies are resolved. + * + * @param {Array} factories + * @returns {Array} Returns a new array with the sorted factories. + */ +function sortFactories(factories) { + const factoriesByName = {}; + factories.forEach(factory => { + factoriesByName[factory.fn] = factory; + }); + function containsDependency(factory, dependency) { + // TODO: detect circular references + if (isFactory(factory)) { + if (factory.dependencies.includes(dependency.fn || dependency.name)) { + return true; + } + if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) { + return true; + } + } + return false; + } + const sorted = []; + function addFactory(factory) { + let index = 0; + while (index < sorted.length && !containsDependency(sorted[index], factory)) { + index++; + } + sorted.splice(index, 0, factory); + } + + // sort regular factory functions + factories.filter(isFactory).forEach(addFactory); + + // sort legacy factory functions AFTER the regular factory functions + factories.filter(factory => !isFactory(factory)).forEach(addFactory); + return sorted; +} + +// TODO: comment or cleanup if unused in the end +function create(factories) { + let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + sortFactories(factories).forEach(factory => factory(scope)); + return scope; +} + +/** + * Test whether an object is a factory. This is the case when it has + * properties name, dependencies, and a function create. + * @param {*} obj + * @returns {boolean} + */ +function isFactory(obj) { + return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies); +} + +/** + * Assert that all dependencies of a list with dependencies are available in the provided scope. + * + * Will throw an exception when there are dependencies missing. + * + * @param {string} name Name for the function to be created. Used to generate a useful error message + * @param {string[]} dependencies + * @param {Object} scope + */ +function assertDependencies(name, dependencies, scope) { + const allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals + .every(dependency => scope[dependency] !== undefined); + if (!allDefined) { + const missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined); + + // TODO: create a custom error class for this, a MathjsError or something like that + throw new Error(`Cannot create function "${name}", ` + `some dependencies are missing: ${missingDependencies.map(d => `"${d}"`).join(', ')}.`); + } +} +function isOptionalDependency(dependency) { + return dependency && dependency[0] === '?'; +} +function stripOptionalNotation(dependency) { + return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/function.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/function.js new file mode 100644 index 0000000..36e5053 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/function.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.memoize = memoize; +exports.memoizeCompare = memoizeCompare; +var _lruQueue = require("./lruQueue.js"); +// function utils + +/** + * Memoize a given function by caching the computed result. + * The cache of a memoized function can be cleared by deleting the `cache` + * property of the function. + * + * @param {function} fn The function to be memoized. + * Must be a pure function. + * @param {Object} [options] + * @param {function(args: Array): string} [options.hasher] + * A custom hash builder. Is JSON.stringify by default. + * @param {number | undefined} [options.limit] + * Maximum number of values that may be cached. Undefined indicates + * unlimited (default) + * @return {function} Returns the memoized function + */ +function memoize(fn) { + let { + hasher, + limit + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + limit = limit == null ? Number.POSITIVE_INFINITY : limit; + hasher = hasher == null ? JSON.stringify : hasher; + return function memoize() { + if (typeof memoize.cache !== 'object') { + memoize.cache = { + values: new Map(), + lru: (0, _lruQueue.lruQueue)(limit || Number.POSITIVE_INFINITY) + }; + } + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + const hash = hasher(args); + if (memoize.cache.values.has(hash)) { + memoize.cache.lru.hit(hash); + return memoize.cache.values.get(hash); + } + const newVal = fn.apply(fn, args); + memoize.cache.values.set(hash, newVal); + memoize.cache.values.delete(memoize.cache.lru.hit(hash)); + return newVal; + }; +} + +/** + * Memoize a given function by caching all results and the arguments, + * and comparing against the arguments of previous results before + * executing again. + * This is less performant than `memoize` which calculates a hash, + * which is very fast to compare. Use `memoizeCompare` only when it is + * not possible to create a unique serializable hash from the function + * arguments. + * The isEqual function must compare two sets of arguments + * and return true when equal (can be a deep equality check for example). + * @param {function} fn + * @param {function(a: *, b: *) : boolean} isEqual + * @returns {function} + */ +function memoizeCompare(fn, isEqual) { + const memoize = function memoize() { + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + for (let c = 0; c < memoize.cache.length; c++) { + const cached = memoize.cache[c]; + if (isEqual(args, cached.args)) { + // TODO: move this cache entry to the top so recently used entries move up? + return cached.res; + } + } + const res = fn.apply(fn, args); + memoize.cache.unshift({ + args, + res + }); + return res; + }; + memoize.cache = []; + return memoize; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/is.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/is.js new file mode 100644 index 0000000..e23b2b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/is.js @@ -0,0 +1,245 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isAccessorNode = isAccessorNode; +exports.isArray = void 0; +exports.isArrayNode = isArrayNode; +exports.isAssignmentNode = isAssignmentNode; +exports.isBigInt = isBigInt; +exports.isBigNumber = isBigNumber; +exports.isBlockNode = isBlockNode; +exports.isBoolean = isBoolean; +exports.isChain = isChain; +exports.isCollection = isCollection; +exports.isComplex = isComplex; +exports.isConditionalNode = isConditionalNode; +exports.isConstantNode = isConstantNode; +exports.isDate = isDate; +exports.isDenseMatrix = isDenseMatrix; +exports.isFraction = isFraction; +exports.isFunction = isFunction; +exports.isFunctionAssignmentNode = isFunctionAssignmentNode; +exports.isFunctionNode = isFunctionNode; +exports.isHelp = isHelp; +exports.isIndex = isIndex; +exports.isIndexNode = isIndexNode; +exports.isMap = isMap; +exports.isMatrix = isMatrix; +exports.isNode = isNode; +exports.isNull = isNull; +exports.isNumber = isNumber; +exports.isObject = isObject; +exports.isObjectNode = isObjectNode; +exports.isObjectWrappingMap = isObjectWrappingMap; +exports.isOperatorNode = isOperatorNode; +exports.isParenthesisNode = isParenthesisNode; +exports.isPartitionedMap = isPartitionedMap; +exports.isRange = isRange; +exports.isRangeNode = isRangeNode; +exports.isRegExp = isRegExp; +exports.isRelationalNode = isRelationalNode; +exports.isResultSet = isResultSet; +exports.isSparseMatrix = isSparseMatrix; +exports.isString = isString; +exports.isSymbolNode = isSymbolNode; +exports.isUndefined = isUndefined; +exports.isUnit = isUnit; +exports.rule2Node = rule2Node; +exports.typeOf = typeOf; +var _map = require("./map.js"); +// type checks for all known types +// +// note that: +// +// - check by duck-typing on a property like `isUnit`, instead of checking instanceof. +// instanceof cannot be used because that would not allow to pass data from +// one instance of math.js to another since each has it's own instance of Unit. +// - check the `isUnit` property via the constructor, so there will be no +// matches for "fake" instances like plain objects with a property `isUnit`. +// That is important for security reasons. +// - It must not be possible to override the type checks used internally, +// for security reasons, so these functions are not exposed in the expression +// parser. + +function isNumber(x) { + return typeof x === 'number'; +} +function isBigNumber(x) { + if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') { + return false; + } + if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) { + return true; + } + if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) { + return true; + } + return false; +} +function isBigInt(x) { + return typeof x === 'bigint'; +} +function isComplex(x) { + return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false; +} +function isFraction(x) { + return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false; +} +function isUnit(x) { + return x && x.constructor.prototype.isUnit === true || false; +} +function isString(x) { + return typeof x === 'string'; +} +const isArray = exports.isArray = Array.isArray; +function isMatrix(x) { + return x && x.constructor.prototype.isMatrix === true || false; +} + +/** + * Test whether a value is a collection: an Array or Matrix + * @param {*} x + * @returns {boolean} isCollection + */ +function isCollection(x) { + return Array.isArray(x) || isMatrix(x); +} +function isDenseMatrix(x) { + return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false; +} +function isSparseMatrix(x) { + return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false; +} +function isRange(x) { + return x && x.constructor.prototype.isRange === true || false; +} +function isIndex(x) { + return x && x.constructor.prototype.isIndex === true || false; +} +function isBoolean(x) { + return typeof x === 'boolean'; +} +function isResultSet(x) { + return x && x.constructor.prototype.isResultSet === true || false; +} +function isHelp(x) { + return x && x.constructor.prototype.isHelp === true || false; +} +function isFunction(x) { + return typeof x === 'function'; +} +function isDate(x) { + return x instanceof Date; +} +function isRegExp(x) { + return x instanceof RegExp; +} +function isObject(x) { + return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x)); +} + +/** + * Returns `true` if the passed object appears to be a Map (i.e. duck typing). + * + * Methods looked for are `get`, `set`, `keys` and `has`. + * + * @param {Map | object} object + * @returns + */ +function isMap(object) { + // We can use the fast instanceof, or a slower duck typing check. + // The duck typing method needs to cover enough methods to not be confused with DenseMatrix. + if (!object) { + return false; + } + return object instanceof Map || object instanceof _map.ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function'; +} +function isPartitionedMap(object) { + return isMap(object) && isMap(object.a) && isMap(object.b); +} +function isObjectWrappingMap(object) { + return isMap(object) && isObject(object.wrappedObject); +} +function isNull(x) { + return x === null; +} +function isUndefined(x) { + return x === undefined; +} +function isAccessorNode(x) { + return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false; +} +function isArrayNode(x) { + return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false; +} +function isAssignmentNode(x) { + return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false; +} +function isBlockNode(x) { + return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false; +} +function isConditionalNode(x) { + return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false; +} +function isConstantNode(x) { + return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false; +} + +/* Very specialized: returns true for those nodes which in the numerator of + a fraction means that the division in that fraction has precedence over implicit + multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but + 6!/8 x parses as 6! / (8x). It is located here because it is shared between + parse.js and OperatorNode.js (for parsing and printing, respectively). + + This should *not* be exported from mathjs, unlike most of the tests here. + Its name does not start with 'is' to prevent utils/snapshot.js from thinking + it should be exported. +*/ +function rule2Node(node) { + return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op); +} +function isFunctionAssignmentNode(x) { + return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false; +} +function isFunctionNode(x) { + return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false; +} +function isIndexNode(x) { + return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false; +} +function isNode(x) { + return x && x.isNode === true && x.constructor.prototype.isNode === true || false; +} +function isObjectNode(x) { + return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false; +} +function isOperatorNode(x) { + return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false; +} +function isParenthesisNode(x) { + return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false; +} +function isRangeNode(x) { + return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false; +} +function isRelationalNode(x) { + return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false; +} +function isSymbolNode(x) { + return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false; +} +function isChain(x) { + return x && x.constructor.prototype.isChain === true || false; +} +function typeOf(x) { + const t = typeof x; + if (t === 'object') { + if (x === null) return 'null'; + if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal + if (x.constructor && x.constructor.name) return x.constructor.name; + return 'Object'; // just in case + } + return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ... +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/latex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/latex.js new file mode 100644 index 0000000..adee391 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/latex.js @@ -0,0 +1,497 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.defaultTemplate = void 0; +exports.escapeLatex = escapeLatex; +exports.latexSymbols = exports.latexOperators = exports.latexFunctions = void 0; +exports.toSymbol = toSymbol; +var _escapeLatex = _interopRequireDefault(require("escape-latex")); +var _object = require("./object.js"); +/* eslint no-template-curly-in-string: "off" */ + +const latexSymbols = exports.latexSymbols = { + // GREEK LETTERS + Alpha: 'A', + alpha: '\\alpha', + Beta: 'B', + beta: '\\beta', + Gamma: '\\Gamma', + gamma: '\\gamma', + Delta: '\\Delta', + delta: '\\delta', + Epsilon: 'E', + epsilon: '\\epsilon', + varepsilon: '\\varepsilon', + Zeta: 'Z', + zeta: '\\zeta', + Eta: 'H', + eta: '\\eta', + Theta: '\\Theta', + theta: '\\theta', + vartheta: '\\vartheta', + Iota: 'I', + iota: '\\iota', + Kappa: 'K', + kappa: '\\kappa', + varkappa: '\\varkappa', + Lambda: '\\Lambda', + lambda: '\\lambda', + Mu: 'M', + mu: '\\mu', + Nu: 'N', + nu: '\\nu', + Xi: '\\Xi', + xi: '\\xi', + Omicron: 'O', + omicron: 'o', + Pi: '\\Pi', + pi: '\\pi', + varpi: '\\varpi', + Rho: 'P', + rho: '\\rho', + varrho: '\\varrho', + Sigma: '\\Sigma', + sigma: '\\sigma', + varsigma: '\\varsigma', + Tau: 'T', + tau: '\\tau', + Upsilon: '\\Upsilon', + upsilon: '\\upsilon', + Phi: '\\Phi', + phi: '\\phi', + varphi: '\\varphi', + Chi: 'X', + chi: '\\chi', + Psi: '\\Psi', + psi: '\\psi', + Omega: '\\Omega', + omega: '\\omega', + // logic + true: '\\mathrm{True}', + false: '\\mathrm{False}', + // other + i: 'i', + // TODO use \i ?? + inf: '\\infty', + Inf: '\\infty', + infinity: '\\infty', + Infinity: '\\infty', + oo: '\\infty', + lim: '\\lim', + undefined: '\\mathbf{?}' +}; +const latexOperators = exports.latexOperators = { + transpose: '^\\top', + ctranspose: '^H', + factorial: '!', + pow: '^', + dotPow: '.^\\wedge', + // TODO find ideal solution + unaryPlus: '+', + unaryMinus: '-', + bitNot: '\\~', + // TODO find ideal solution + not: '\\neg', + multiply: '\\cdot', + divide: '\\frac', + // TODO how to handle that properly? + dotMultiply: '.\\cdot', + // TODO find ideal solution + dotDivide: '.:', + // TODO find ideal solution + mod: '\\mod', + add: '+', + subtract: '-', + to: '\\rightarrow', + leftShift: '<<', + rightArithShift: '>>', + rightLogShift: '>>>', + equal: '=', + unequal: '\\neq', + smaller: '<', + larger: '>', + smallerEq: '\\leq', + largerEq: '\\geq', + bitAnd: '\\&', + bitXor: '\\underline{|}', + bitOr: '|', + and: '\\wedge', + xor: '\\veebar', + or: '\\vee' +}; +const latexFunctions = exports.latexFunctions = { + // arithmetic + abs: { + 1: '\\left|${args[0]}\\right|' + }, + add: { + 2: `\\left(\${args[0]}${latexOperators.add}\${args[1]}\\right)` + }, + cbrt: { + 1: '\\sqrt[3]{${args[0]}}' + }, + ceil: { + 1: '\\left\\lceil${args[0]}\\right\\rceil' + }, + cube: { + 1: '\\left(${args[0]}\\right)^3' + }, + divide: { + 2: '\\frac{${args[0]}}{${args[1]}}' + }, + dotDivide: { + 2: `\\left(\${args[0]}${latexOperators.dotDivide}\${args[1]}\\right)` + }, + dotMultiply: { + 2: `\\left(\${args[0]}${latexOperators.dotMultiply}\${args[1]}\\right)` + }, + dotPow: { + 2: `\\left(\${args[0]}${latexOperators.dotPow}\${args[1]}\\right)` + }, + exp: { + 1: '\\exp\\left(${args[0]}\\right)' + }, + expm1: `\\left(e${latexOperators.pow}{\${args[0]}}-1\\right)`, + fix: { + 1: '\\mathrm{${name}}\\left(${args[0]}\\right)' + }, + floor: { + 1: '\\left\\lfloor${args[0]}\\right\\rfloor' + }, + gcd: '\\gcd\\left(${args}\\right)', + hypot: '\\hypot\\left(${args}\\right)', + log: { + 1: '\\ln\\left(${args[0]}\\right)', + 2: '\\log_{${args[1]}}\\left(${args[0]}\\right)' + }, + log10: { + 1: '\\log_{10}\\left(${args[0]}\\right)' + }, + log1p: { + 1: '\\ln\\left(${args[0]}+1\\right)', + 2: '\\log_{${args[1]}}\\left(${args[0]}+1\\right)' + }, + log2: '\\log_{2}\\left(${args[0]}\\right)', + mod: { + 2: `\\left(\${args[0]}${latexOperators.mod}\${args[1]}\\right)` + }, + multiply: { + 2: `\\left(\${args[0]}${latexOperators.multiply}\${args[1]}\\right)` + }, + norm: { + 1: '\\left\\|${args[0]}\\right\\|', + 2: undefined // use default template + }, + nthRoot: { + 2: '\\sqrt[${args[1]}]{${args[0]}}' + }, + nthRoots: { + 2: '\\{y : $y^{args[1]} = {${args[0]}}\\}' + }, + pow: { + 2: `\\left(\${args[0]}\\right)${latexOperators.pow}{\${args[1]}}` + }, + round: { + 1: '\\left\\lfloor${args[0]}\\right\\rceil', + 2: undefined // use default template + }, + sign: { + 1: '\\mathrm{${name}}\\left(${args[0]}\\right)' + }, + sqrt: { + 1: '\\sqrt{${args[0]}}' + }, + square: { + 1: '\\left(${args[0]}\\right)^2' + }, + subtract: { + 2: `\\left(\${args[0]}${latexOperators.subtract}\${args[1]}\\right)` + }, + unaryMinus: { + 1: `${latexOperators.unaryMinus}\\left(\${args[0]}\\right)` + }, + unaryPlus: { + 1: `${latexOperators.unaryPlus}\\left(\${args[0]}\\right)` + }, + // bitwise + bitAnd: { + 2: `\\left(\${args[0]}${latexOperators.bitAnd}\${args[1]}\\right)` + }, + bitNot: { + 1: latexOperators.bitNot + '\\left(${args[0]}\\right)' + }, + bitOr: { + 2: `\\left(\${args[0]}${latexOperators.bitOr}\${args[1]}\\right)` + }, + bitXor: { + 2: `\\left(\${args[0]}${latexOperators.bitXor}\${args[1]}\\right)` + }, + leftShift: { + 2: `\\left(\${args[0]}${latexOperators.leftShift}\${args[1]}\\right)` + }, + rightArithShift: { + 2: `\\left(\${args[0]}${latexOperators.rightArithShift}\${args[1]}\\right)` + }, + rightLogShift: { + 2: `\\left(\${args[0]}${latexOperators.rightLogShift}\${args[1]}\\right)` + }, + // combinatorics + bellNumbers: { + 1: '\\mathrm{B}_{${args[0]}}' + }, + catalan: { + 1: '\\mathrm{C}_{${args[0]}}' + }, + stirlingS2: { + 2: '\\mathrm{S}\\left(${args}\\right)' + }, + // complex + arg: { + 1: '\\arg\\left(${args[0]}\\right)' + }, + conj: { + 1: '\\left(${args[0]}\\right)^*' + }, + im: { + 1: '\\Im\\left\\lbrace${args[0]}\\right\\rbrace' + }, + re: { + 1: '\\Re\\left\\lbrace${args[0]}\\right\\rbrace' + }, + // logical + and: { + 2: `\\left(\${args[0]}${latexOperators.and}\${args[1]}\\right)` + }, + not: { + 1: latexOperators.not + '\\left(${args[0]}\\right)' + }, + or: { + 2: `\\left(\${args[0]}${latexOperators.or}\${args[1]}\\right)` + }, + xor: { + 2: `\\left(\${args[0]}${latexOperators.xor}\${args[1]}\\right)` + }, + // matrix + cross: { + 2: '\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)' + }, + ctranspose: { + 1: `\\left(\${args[0]}\\right)${latexOperators.ctranspose}` + }, + det: { + 1: '\\det\\left(${args[0]}\\right)' + }, + dot: { + 2: '\\left(${args[0]}\\cdot${args[1]}\\right)' + }, + expm: { + 1: '\\exp\\left(${args[0]}\\right)' + }, + inv: { + 1: '\\left(${args[0]}\\right)^{-1}' + }, + pinv: { + 1: '\\left(${args[0]}\\right)^{+}' + }, + sqrtm: { + 1: `{\${args[0]}}${latexOperators.pow}{\\frac{1}{2}}` + }, + trace: { + 1: '\\mathrm{tr}\\left(${args[0]}\\right)' + }, + transpose: { + 1: `\\left(\${args[0]}\\right)${latexOperators.transpose}` + }, + // probability + combinations: { + 2: '\\binom{${args[0]}}{${args[1]}}' + }, + combinationsWithRep: { + 2: '\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)' + }, + factorial: { + 1: `\\left(\${args[0]}\\right)${latexOperators.factorial}` + }, + gamma: { + 1: '\\Gamma\\left(${args[0]}\\right)' + }, + lgamma: { + 1: '\\ln\\Gamma\\left(${args[0]}\\right)' + }, + // relational + equal: { + 2: `\\left(\${args[0]}${latexOperators.equal}\${args[1]}\\right)` + }, + larger: { + 2: `\\left(\${args[0]}${latexOperators.larger}\${args[1]}\\right)` + }, + largerEq: { + 2: `\\left(\${args[0]}${latexOperators.largerEq}\${args[1]}\\right)` + }, + smaller: { + 2: `\\left(\${args[0]}${latexOperators.smaller}\${args[1]}\\right)` + }, + smallerEq: { + 2: `\\left(\${args[0]}${latexOperators.smallerEq}\${args[1]}\\right)` + }, + unequal: { + 2: `\\left(\${args[0]}${latexOperators.unequal}\${args[1]}\\right)` + }, + // special + erf: { + 1: 'erf\\left(${args[0]}\\right)' + }, + // statistics + max: '\\max\\left(${args}\\right)', + min: '\\min\\left(${args}\\right)', + variance: '\\mathrm{Var}\\left(${args}\\right)', + // trigonometry + acos: { + 1: '\\cos^{-1}\\left(${args[0]}\\right)' + }, + acosh: { + 1: '\\cosh^{-1}\\left(${args[0]}\\right)' + }, + acot: { + 1: '\\cot^{-1}\\left(${args[0]}\\right)' + }, + acoth: { + 1: '\\coth^{-1}\\left(${args[0]}\\right)' + }, + acsc: { + 1: '\\csc^{-1}\\left(${args[0]}\\right)' + }, + acsch: { + 1: '\\mathrm{csch}^{-1}\\left(${args[0]}\\right)' + }, + asec: { + 1: '\\sec^{-1}\\left(${args[0]}\\right)' + }, + asech: { + 1: '\\mathrm{sech}^{-1}\\left(${args[0]}\\right)' + }, + asin: { + 1: '\\sin^{-1}\\left(${args[0]}\\right)' + }, + asinh: { + 1: '\\sinh^{-1}\\left(${args[0]}\\right)' + }, + atan: { + 1: '\\tan^{-1}\\left(${args[0]}\\right)' + }, + atan2: { + 2: '\\mathrm{atan2}\\left(${args}\\right)' + }, + atanh: { + 1: '\\tanh^{-1}\\left(${args[0]}\\right)' + }, + cos: { + 1: '\\cos\\left(${args[0]}\\right)' + }, + cosh: { + 1: '\\cosh\\left(${args[0]}\\right)' + }, + cot: { + 1: '\\cot\\left(${args[0]}\\right)' + }, + coth: { + 1: '\\coth\\left(${args[0]}\\right)' + }, + csc: { + 1: '\\csc\\left(${args[0]}\\right)' + }, + csch: { + 1: '\\mathrm{csch}\\left(${args[0]}\\right)' + }, + sec: { + 1: '\\sec\\left(${args[0]}\\right)' + }, + sech: { + 1: '\\mathrm{sech}\\left(${args[0]}\\right)' + }, + sin: { + 1: '\\sin\\left(${args[0]}\\right)' + }, + sinh: { + 1: '\\sinh\\left(${args[0]}\\right)' + }, + tan: { + 1: '\\tan\\left(${args[0]}\\right)' + }, + tanh: { + 1: '\\tanh\\left(${args[0]}\\right)' + }, + // unit + to: { + 2: `\\left(\${args[0]}${latexOperators.to}\${args[1]}\\right)` + }, + // utils + numeric: function (node, options) { + // Not sure if this is strictly right but should work correctly for the vast majority of use cases. + return node.args[0].toTex(); + }, + // type + number: { + 0: '0', + 1: '\\left(${args[0]}\\right)', + 2: '\\left(\\left(${args[0]}\\right)${args[1]}\\right)' + }, + string: { + 0: '\\mathtt{""}', + 1: '\\mathrm{string}\\left(${args[0]}\\right)' + }, + bignumber: { + 0: '0', + 1: '\\left(${args[0]}\\right)' + }, + bigint: { + 0: '0', + 1: '\\left(${args[0]}\\right)' + }, + complex: { + 0: '0', + 1: '\\left(${args[0]}\\right)', + 2: `\\left(\\left(\${args[0]}\\right)+${latexSymbols.i}\\cdot\\left(\${args[1]}\\right)\\right)` + }, + matrix: { + 0: '\\begin{bmatrix}\\end{bmatrix}', + 1: '\\left(${args[0]}\\right)', + 2: '\\left(${args[0]}\\right)' + }, + sparse: { + 0: '\\begin{bsparse}\\end{bsparse}', + 1: '\\left(${args[0]}\\right)' + }, + unit: { + 1: '\\left(${args[0]}\\right)', + 2: '\\left(\\left(${args[0]}\\right)${args[1]}\\right)' + } +}; +const defaultTemplate = exports.defaultTemplate = '\\mathrm{${name}}\\left(${args}\\right)'; +const latexUnits = { + deg: '^\\circ' +}; +function escapeLatex(string) { + return (0, _escapeLatex.default)(string, { + preserveFormatting: true + }); +} + +// @param {string} name +// @param {boolean} isUnit +function toSymbol(name, isUnit) { + isUnit = typeof isUnit === 'undefined' ? false : isUnit; + if (isUnit) { + if ((0, _object.hasOwnProperty)(latexUnits, name)) { + return latexUnits[name]; + } + return '\\mathrm{' + escapeLatex(name) + '}'; + } + if ((0, _object.hasOwnProperty)(latexSymbols, name)) { + return latexSymbols[name]; + } + return escapeLatex(name); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/log.js new file mode 100644 index 0000000..53705bc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/log.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.warnOnce = void 0; +/** + * Log a console.warn message only once + */ +const warnOnce = exports.warnOnce = (() => { + const messages = {}; + return function warnOnce() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + const message = args.join(', '); + if (!messages[message]) { + messages[message] = true; + console.warn('Warning:', ...args); + } + }; +})(); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/lruQueue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/lruQueue.js new file mode 100644 index 0000000..4f8534e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/lruQueue.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lruQueue = lruQueue; +// (c) 2018, Mariusz Nowak +// SPDX-License-Identifier: ISC +// Derived from https://github.com/medikoo/lru-queue +function lruQueue(limit) { + let size = 0; + let base = 1; + let queue = Object.create(null); + let map = Object.create(null); + let index = 0; + const del = function (id) { + const oldIndex = map[id]; + if (!oldIndex) return; + delete queue[oldIndex]; + delete map[id]; + --size; + if (base !== oldIndex) return; + if (!size) { + index = 0; + base = 1; + return; + } + while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */} + }; + limit = Math.abs(limit); + return { + hit: function (id) { + const oldIndex = map[id]; + const nuIndex = ++index; + queue[nuIndex] = id; + map[id] = nuIndex; + if (!oldIndex) { + ++size; + if (size <= limit) return undefined; + id = queue[base]; + del(id); + return id; + } + delete queue[oldIndex]; + if (base !== oldIndex) return undefined; + while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */} + return undefined; + }, + delete: del, + clear: function () { + size = index = 0; + base = 1; + queue = Object.create(null); + map = Object.create(null); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/map.js new file mode 100644 index 0000000..b66191c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/map.js @@ -0,0 +1,214 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PartitionedMap = exports.ObjectWrappingMap = void 0; +exports.assign = assign; +exports.createEmptyMap = createEmptyMap; +exports.createMap = createMap; +exports.toObject = toObject; +var _customs = require("./customs.js"); +var _is = require("./is.js"); +/** + * A map facade on a bare object. + * + * The small number of methods needed to implement a scope, + * forwarding on to the SafeProperty functions. Over time, the codebase + * will stop using this method, as all objects will be Maps, rather than + * more security prone objects. + */ +class ObjectWrappingMap { + constructor(object) { + this.wrappedObject = object; + this[Symbol.iterator] = this.entries; + } + keys() { + return Object.keys(this.wrappedObject).filter(key => this.has(key)).values(); + } + get(key) { + return (0, _customs.getSafeProperty)(this.wrappedObject, key); + } + set(key, value) { + (0, _customs.setSafeProperty)(this.wrappedObject, key, value); + return this; + } + has(key) { + return (0, _customs.isSafeProperty)(this.wrappedObject, key) && key in this.wrappedObject; + } + entries() { + return mapIterator(this.keys(), key => [key, this.get(key)]); + } + forEach(callback) { + for (const key of this.keys()) { + callback(this.get(key), key, this); + } + } + delete(key) { + if ((0, _customs.isSafeProperty)(this.wrappedObject, key)) { + delete this.wrappedObject[key]; + } + } + clear() { + for (const key of this.keys()) { + this.delete(key); + } + } + get size() { + return Object.keys(this.wrappedObject).length; + } +} + +/** + * Create a map with two partitions: a and b. + * The set with bKeys determines which keys/values are read/written to map b, + * all other values are read/written to map a + * + * For example: + * + * const a = new Map() + * const b = new Map() + * const p = new PartitionedMap(a, b, new Set(['x', 'y'])) + * + * In this case, values `x` and `y` are read/written to map `b`, + * all other values are read/written to map `a`. + */ +exports.ObjectWrappingMap = ObjectWrappingMap; +class PartitionedMap { + /** + * @param {Map} a + * @param {Map} b + * @param {Set} bKeys + */ + constructor(a, b, bKeys) { + this.a = a; + this.b = b; + this.bKeys = bKeys; + this[Symbol.iterator] = this.entries; + } + get(key) { + return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key); + } + set(key, value) { + if (this.bKeys.has(key)) { + this.b.set(key, value); + } else { + this.a.set(key, value); + } + return this; + } + has(key) { + return this.b.has(key) || this.a.has(key); + } + keys() { + return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator](); + } + entries() { + return mapIterator(this.keys(), key => [key, this.get(key)]); + } + forEach(callback) { + for (const key of this.keys()) { + callback(this.get(key), key, this); + } + } + delete(key) { + return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key); + } + clear() { + this.a.clear(); + this.b.clear(); + } + get size() { + return [...this.keys()].length; + } +} + +/** + * Create a new iterator that maps over the provided iterator, applying a mapping function to each item + */ +exports.PartitionedMap = PartitionedMap; +function mapIterator(it, callback) { + return { + next: () => { + const n = it.next(); + return n.done ? n : { + value: callback(n.value), + done: false + }; + } + }; +} + +/** + * Creates an empty map, or whatever your platform's polyfill is. + * + * @returns an empty Map or Map like object. + */ +function createEmptyMap() { + return new Map(); +} + +/** + * Creates a Map from the given object. + * + * @param { Map | { [key: string]: unknown } | undefined } mapOrObject + * @returns + */ +function createMap(mapOrObject) { + if (!mapOrObject) { + return createEmptyMap(); + } + if ((0, _is.isMap)(mapOrObject)) { + return mapOrObject; + } + if ((0, _is.isObject)(mapOrObject)) { + return new ObjectWrappingMap(mapOrObject); + } + throw new Error('createMap can create maps from objects or Maps'); +} + +/** + * Unwraps a map into an object. + * + * @param {Map} map + * @returns { [key: string]: unknown } + */ +function toObject(map) { + if (map instanceof ObjectWrappingMap) { + return map.wrappedObject; + } + const object = {}; + for (const key of map.keys()) { + const value = map.get(key); + (0, _customs.setSafeProperty)(object, key, value); + } + return object; +} + +/** + * Copies the contents of key-value pairs from each `objects` in to `map`. + * + * Object is `objects` can be a `Map` or object. + * + * This is the `Map` analog to `Object.assign`. + */ +function assign(map) { + for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + objects[_key - 1] = arguments[_key]; + } + for (const args of objects) { + if (!args) { + continue; + } + if ((0, _is.isMap)(args)) { + for (const key of args.keys()) { + map.set(key, args.get(key)); + } + } else if ((0, _is.isObject)(args)) { + for (const key of Object.keys(args)) { + map.set(key, args[key]); + } + } + } + return map; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/noop.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/noop.js new file mode 100644 index 0000000..48c334e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/noop.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.noBignumber = noBignumber; +exports.noFraction = noFraction; +exports.noIndex = noIndex; +exports.noMatrix = noMatrix; +exports.noSubset = noSubset; +function noBignumber() { + throw new Error('No "bignumber" implementation available'); +} +function noFraction() { + throw new Error('No "fraction" implementation available'); +} +function noMatrix() { + throw new Error('No "matrix" implementation available'); +} +function noIndex() { + throw new Error('No "index" implementation available'); +} +function noSubset() { + throw new Error('No "matrix" implementation available'); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/number.js new file mode 100644 index 0000000..de9a2e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/number.js @@ -0,0 +1,761 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cbrt = exports.atanh = exports.asinh = exports.acosh = exports.DBL_EPSILON = void 0; +exports.copysign = copysign; +exports.cosh = void 0; +exports.digits = digits; +exports.expm1 = void 0; +exports.format = format; +exports.isInteger = isInteger; +exports.isIntegerStr = isIntegerStr; +exports.log2 = exports.log1p = exports.log10 = void 0; +exports.nearlyEqual = nearlyEqual; +exports.normalizeFormatOptions = normalizeFormatOptions; +exports.roundDigits = roundDigits; +exports.safeNumberType = safeNumberType; +exports.sinh = exports.sign = void 0; +exports.splitNumber = splitNumber; +exports.tanh = void 0; +exports.toEngineering = toEngineering; +exports.toExponential = toExponential; +exports.toFixed = toFixed; +exports.toPrecision = toPrecision; +var _is = require("./is.js"); +/** + * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue + */ + +/** + * Check if a number is integer + * @param {number | boolean} value + * @return {boolean} isInteger + */ +function isInteger(value) { + if (typeof value === 'boolean') { + return true; + } + return isFinite(value) ? value === Math.round(value) : false; +} + +/** + * Check if a string contains an integer + * @param {string} str + * @return {boolean} isInteger + */ +function isIntegerStr(str) { + // regex matching strings like "123" and "-123" + return /^-?\d+$/.test(str); +} + +/** + * Ensure the number type is compatible with the provided value. + * If not, return 'number' instead. + * + * For example: + * + * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' }) + * + * will return 'number' and not 'bigint' because trying to create a bigint with + * value 2.3 would throw an exception. + * + * @param {string} numberStr + * @param {{ + * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction' + * numberFallback: 'number' | 'BigNumber' + * }} config + * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'} + */ +function safeNumberType(numberStr, config) { + if (config.number === 'bigint' && !isIntegerStr(numberStr)) { + return config.numberFallback; + } + return config.number; +} + +/** + * Calculate the sign of a number + * @param {number} x + * @returns {number} + */ +const sign = exports.sign = Math.sign || function (x) { + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}; + +/** + * Calculate the base-2 logarithm of a number + * @param {number} x + * @returns {number} + */ +const log2 = exports.log2 = Math.log2 || function log2(x) { + return Math.log(x) / Math.LN2; +}; + +/** + * Calculate the base-10 logarithm of a number + * @param {number} x + * @returns {number} + */ +const log10 = exports.log10 = Math.log10 || function log10(x) { + return Math.log(x) / Math.LN10; +}; + +/** + * Calculate the natural logarithm of a number + 1 + * @param {number} x + * @returns {number} + */ +const log1p = exports.log1p = Math.log1p || function (x) { + return Math.log(x + 1); +}; + +/** + * Calculate cubic root for a number + * + * Code from es6-shim.js: + * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577 + * + * @param {number} x + * @returns {number} Returns the cubic root of x + */ +const cbrt = exports.cbrt = Math.cbrt || function cbrt(x) { + if (x === 0) { + return x; + } + const negate = x < 0; + let result; + if (negate) { + x = -x; + } + if (isFinite(x)) { + result = Math.exp(Math.log(x) / 3); + // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods + result = (x / (result * result) + 2 * result) / 3; + } else { + result = x; + } + return negate ? -result : result; +}; + +/** + * Calculates exponentiation minus 1 + * @param {number} x + * @return {number} res + */ +const expm1 = exports.expm1 = Math.expm1 || function expm1(x) { + return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6; +}; + +/** + * Formats a number in a given base + * @param {number} n + * @param {number} base + * @param {number} size + * @returns {string} + */ +function formatNumberToBase(n, base, size) { + const prefixes = { + 2: '0b', + 8: '0o', + 16: '0x' + }; + const prefix = prefixes[base]; + let suffix = ''; + if (size) { + if (size < 1) { + throw new Error('size must be in greater than 0'); + } + if (!isInteger(size)) { + throw new Error('size must be an integer'); + } + if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) { + throw new Error(`Value must be in range [-2^${size - 1}, 2^${size - 1}-1]`); + } + if (!isInteger(n)) { + throw new Error('Value must be an integer'); + } + if (n < 0) { + n = n + 2 ** size; + } + suffix = `i${size}`; + } + let sign = ''; + if (n < 0) { + n = -n; + sign = '-'; + } + return `${sign}${prefix}${n.toString(base)}${suffix}`; +} + +/** + * Convert a number to a formatted string representation. + * + * Syntax: + * + * format(value) + * format(value, options) + * format(value, precision) + * format(value, fn) + * + * Where: + * + * {number} value The value to be formatted + * {Object} options An object with formatting options. Available options: + * {string} notation + * Number notation. Choose from: + * 'fixed' Always use regular number notation. + * For example '123.40' and '14000000' + * 'exponential' Always use exponential notation. + * For example '1.234e+2' and '1.4e+7' + * 'engineering' Always use engineering notation. + * For example '123.4e+0' and '14.0e+6' + * 'auto' (default) Regular number notation for numbers + * having an absolute value between + * `lowerExp` and `upperExp` bounds, and + * uses exponential notation elsewhere. + * Lower bound is included, upper bound + * is excluded. + * For example '123.4' and '1.4e7'. + * 'bin', 'oct, or + * 'hex' Format the number using binary, octal, + * or hexadecimal notation. + * For example '0b1101' and '0x10fe'. + * {number} wordSize The word size in bits to use for formatting + * in binary, octal, or hexadecimal notation. + * To be used only with 'bin', 'oct', or 'hex' + * values for 'notation' option. When this option + * is defined the value is formatted as a signed + * twos complement integer of the given word size + * and the size suffix is appended to the output. + * For example + * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'. + * Default value is undefined. + * {number} precision A number between 0 and 16 to round + * the digits of the number. + * In case of notations 'exponential', + * 'engineering', and 'auto', + * `precision` defines the total + * number of significant digits returned. + * In case of notation 'fixed', + * `precision` defines the number of + * significant digits after the decimal + * point. + * `precision` is undefined by default, + * not rounding any digits. + * {number} lowerExp Exponent determining the lower boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `-3`. + * {number} upperExp Exponent determining the upper boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `5`. + * {Function} fn A custom formatting function. Can be used to override the + * built-in notations. Function `fn` is called with `value` as + * parameter and must return a string. Is useful for example to + * format all values inside a matrix in a particular way. + * + * Examples: + * + * format(6.4) // '6.4' + * format(1240000) // '1.24e6' + * format(1/3) // '0.3333333333333333' + * format(1/3, 3) // '0.333' + * format(21385, 2) // '21000' + * format(12.071, {notation: 'fixed'}) // '12' + * format(2.3, {notation: 'fixed', precision: 2}) // '2.30' + * format(52.8, {notation: 'exponential'}) // '5.28e+1' + * format(12345678, {notation: 'engineering'}) // '12.345678e+6' + * + * @param {number} value + * @param {Object | Function | number} [options] + * @return {string} str The formatted value + */ +function format(value, options) { + if (typeof options === 'function') { + // handle format(value, fn) + return options(value); + } + + // handle special cases + if (value === Infinity) { + return 'Infinity'; + } else if (value === -Infinity) { + return '-Infinity'; + } else if (isNaN(value)) { + return 'NaN'; + } + const { + notation, + precision, + wordSize + } = normalizeFormatOptions(options); + + // handle the various notations + switch (notation) { + case 'fixed': + return toFixed(value, precision); + case 'exponential': + return toExponential(value, precision); + case 'engineering': + return toEngineering(value, precision); + case 'bin': + return formatNumberToBase(value, 2, wordSize); + case 'oct': + return formatNumberToBase(value, 8, wordSize); + case 'hex': + return formatNumberToBase(value, 16, wordSize); + case 'auto': + // remove trailing zeros after the decimal point + return toPrecision(value, precision, options).replace(/((\.\d*?)(0+))($|e)/, function () { + const digits = arguments[2]; + const e = arguments[4]; + return digits !== '.' ? digits + e : e; + }); + default: + throw new Error('Unknown notation "' + notation + '". ' + 'Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.'); + } +} + +/** + * Normalize format options into an object: + * { + * notation: string, + * precision: number | undefined, + * wordSize: number | undefined + * } + */ +function normalizeFormatOptions(options) { + // default values for options + let notation = 'auto'; + let precision; + let wordSize; + if (options !== undefined) { + if ((0, _is.isNumber)(options)) { + precision = options; + } else if ((0, _is.isBigNumber)(options)) { + precision = options.toNumber(); + } else if ((0, _is.isObject)(options)) { + if (options.precision !== undefined) { + precision = _toNumberOrThrow(options.precision, () => { + throw new Error('Option "precision" must be a number or BigNumber'); + }); + } + if (options.wordSize !== undefined) { + wordSize = _toNumberOrThrow(options.wordSize, () => { + throw new Error('Option "wordSize" must be a number or BigNumber'); + }); + } + if (options.notation) { + notation = options.notation; + } + } else { + throw new Error('Unsupported type of options, number, BigNumber, or object expected'); + } + } + return { + notation, + precision, + wordSize + }; +} + +/** + * Split a number into sign, coefficients, and exponent + * @param {number | string} value + * @return {SplitValue} + * Returns an object containing sign, coefficients, and exponent + */ +function splitNumber(value) { + // parse the input value + const match = String(value).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/); + if (!match) { + throw new SyntaxError('Invalid number ' + value); + } + const sign = match[1]; + const digits = match[2]; + let exponent = parseFloat(match[4] || '0'); + const dot = digits.indexOf('.'); + exponent += dot !== -1 ? dot - 1 : digits.length - 1; + const coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros) + .replace(/^0*/, function (zeros) { + // remove leading zeros, add their count to the exponent + exponent -= zeros.length; + return ''; + }).replace(/0*$/, '') // remove trailing zeros + .split('').map(function (d) { + return parseInt(d); + }); + if (coefficients.length === 0) { + coefficients.push(0); + exponent++; + } + return { + sign, + coefficients, + exponent + }; +} + +/** + * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3' + * @param {number | string} value + * @param {number} [precision] Optional number of significant figures to return. + */ +function toEngineering(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + const split = splitNumber(value); + const rounded = roundDigits(split, precision); + const e = rounded.exponent; + const c = rounded.coefficients; + + // find nearest lower multiple of 3 for exponent + const newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3; + if ((0, _is.isNumber)(precision)) { + // add zeroes to give correct sig figs + while (precision > c.length || e - newExp + 1 > c.length) { + c.push(0); + } + } else { + // concatenate coefficients with necessary zeros + // add zeros if necessary (for example: 1e+8 -> 100e+6) + const missingZeros = Math.abs(e - newExp) - (c.length - 1); + for (let i = 0; i < missingZeros; i++) { + c.push(0); + } + } + + // find difference in exponents + let expDiff = Math.abs(e - newExp); + let decimalIdx = 1; + + // push decimal index over by expDiff times + while (expDiff > 0) { + decimalIdx++; + expDiff--; + } + + // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value. + // otherwise concat with the rest of the coefficients + const decimals = c.slice(decimalIdx).join(''); + const decimalVal = (0, _is.isNumber)(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : ''; + const str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString(); + return rounded.sign + str; +} + +/** + * Format a number with fixed notation. + * @param {number | string} value + * @param {number} [precision=undefined] Optional number of decimals after the + * decimal point. null by default. + */ +function toFixed(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + const splitValue = splitNumber(value); + const rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue; + let c = rounded.coefficients; + let p = rounded.exponent + 1; // exponent may have changed + + // append zeros if needed + const pp = p + (precision || 0); + if (c.length < pp) { + c = c.concat(zeros(pp - c.length)); + } + + // prepend zeros if needed + if (p < 0) { + c = zeros(-p + 1).concat(c); + p = 1; + } + + // insert a dot if needed + if (p < c.length) { + c.splice(p, 0, p === 0 ? '0.' : '.'); + } + return rounded.sign + c.join(''); +} + +/** + * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3' + * @param {number | string} value + * @param {number} [precision] Number of digits in formatted output. + * If not provided, the maximum available digits + * is used. + */ +function toExponential(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + + // round if needed, else create a clone + const split = splitNumber(value); + const rounded = precision ? roundDigits(split, precision) : split; + let c = rounded.coefficients; + const e = rounded.exponent; + + // append zeros if needed + if (c.length < precision) { + c = c.concat(zeros(precision - c.length)); + } + + // format as `C.CCCe+EEE` or `C.CCCe-EEE` + const first = c.shift(); + return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e; +} + +/** + * Format a number with a certain precision + * @param {number | string} value + * @param {number} [precision=undefined] Optional number of digits. + * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options] + * By default: + * lowerExp = -3 (incl) + * upper = +5 (excl) + * @return {string} + */ +function toPrecision(value, precision, options) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + + // determine lower and upper bound for exponential notation. + const lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3); + const upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5); + const split = splitNumber(value); + const rounded = precision ? roundDigits(split, precision) : split; + if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) { + // exponential notation + return toExponential(value, precision); + } else { + let c = rounded.coefficients; + const e = rounded.exponent; + + // append trailing zeros + if (c.length < precision) { + c = c.concat(zeros(precision - c.length)); + } + + // append trailing zeros + // TODO: simplify the next statement + c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0))); + + // prepend zeros + c = zeros(-e).concat(c); + const dot = e > 0 ? e : 0; + if (dot < c.length - 1) { + c.splice(dot + 1, 0, '.'); + } + return rounded.sign + c.join(''); + } +} + +/** + * Round the number of digits of a number * + * @param {SplitValue} split A value split with .splitNumber(value) + * @param {number} precision A positive integer + * @return {SplitValue} + * Returns an object containing sign, coefficients, and exponent + * with rounded digits + */ +function roundDigits(split, precision) { + // create a clone + const rounded = { + sign: split.sign, + coefficients: split.coefficients, + exponent: split.exponent + }; + const c = rounded.coefficients; + + // prepend zeros if needed + while (precision <= 0) { + c.unshift(0); + rounded.exponent++; + precision++; + } + if (c.length > precision) { + const removed = c.splice(precision, c.length - precision); + if (removed[0] >= 5) { + let i = precision - 1; + c[i]++; + while (c[i] === 10) { + c.pop(); + if (i === 0) { + c.unshift(0); + rounded.exponent++; + i++; + } + i--; + c[i]++; + } + } + } + return rounded; +} + +/** + * Create an array filled with zeros. + * @param {number} length + * @return {Array} + */ +function zeros(length) { + const arr = []; + for (let i = 0; i < length; i++) { + arr.push(0); + } + return arr; +} + +/** + * Count the number of significant digits of a number. + * + * For example: + * 2.34 returns 3 + * 0.0034 returns 2 + * 120.5e+30 returns 4 + * + * @param {number} value + * @return {number} digits Number of significant digits + */ +function digits(value) { + return value.toExponential().replace(/e.*$/, '') // remove exponential notation + .replace(/^0\.?0*|\./, '') // remove decimal point and leading zeros + .length; +} + +/** + * Minimum number added to one that makes the result different than one + */ +const DBL_EPSILON = exports.DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16; + +/** + * Compares two floating point numbers. + * @param {number} a - First value to compare + * @param {number} b - Second value to compare + * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0. + * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0. + * @return {boolean} whether the two numbers are nearly equal + * + * @throws {Error} If `relTol` is less than or equal to 0. + * @throws {Error} If `absTol` is less than 0. + * + * @example + * nearlyEqual(1.000000001, 1.0, 1e-8); // true + * nearlyEqual(1.000000002, 1.0, 0); // false + * nearlyEqual(1.0, 1.009, undefined, 0.01); // true + * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true + */ +function nearlyEqual(a, b) { + let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8; + let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (relTol <= 0) { + throw new Error('Relative tolerance must be greater than 0'); + } + if (absTol < 0) { + throw new Error('Absolute tolerance must be at least 0'); + } + + // NaN + if (isNaN(a) || isNaN(b)) { + return false; + } + if (!isFinite(a) || !isFinite(b)) { + return a === b; + } + if (a === b) { + return true; + } + + // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) + return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol); +} + +/** + * Calculate the hyperbolic arccos of a number + * @param {number} x + * @return {number} + */ +const acosh = exports.acosh = Math.acosh || function (x) { + return Math.log(Math.sqrt(x * x - 1) + x); +}; +const asinh = exports.asinh = Math.asinh || function (x) { + return Math.log(Math.sqrt(x * x + 1) + x); +}; + +/** + * Calculate the hyperbolic arctangent of a number + * @param {number} x + * @return {number} + */ +const atanh = exports.atanh = Math.atanh || function (x) { + return Math.log((1 + x) / (1 - x)) / 2; +}; + +/** + * Calculate the hyperbolic cosine of a number + * @param {number} x + * @returns {number} + */ +const cosh = exports.cosh = Math.cosh || function (x) { + return (Math.exp(x) + Math.exp(-x)) / 2; +}; + +/** + * Calculate the hyperbolic sine of a number + * @param {number} x + * @returns {number} + */ +const sinh = exports.sinh = Math.sinh || function (x) { + return (Math.exp(x) - Math.exp(-x)) / 2; +}; + +/** + * Calculate the hyperbolic tangent of a number + * @param {number} x + * @returns {number} + */ +const tanh = exports.tanh = Math.tanh || function (x) { + const e = Math.exp(2 * x); + return (e - 1) / (e + 1); +}; + +/** + * Returns a value with the magnitude of x and the sign of y. + * @param {number} x + * @param {number} y + * @returns {number} + */ +function copysign(x, y) { + const signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity; + const signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity; + return signx ^ signy ? -x : x; +} +function _toNumberOrThrow(value, onError) { + if ((0, _is.isNumber)(value)) { + return value; + } else if ((0, _is.isBigNumber)(value)) { + return value.toNumber(); + } else { + onError(); + } +} +function _toNumberOrDefault(value, defaultValue) { + if ((0, _is.isNumber)(value)) { + return value; + } else if ((0, _is.isBigNumber)(value)) { + return value.toNumber(); + } else { + return defaultValue; + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/object.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/object.js new file mode 100644 index 0000000..becc403 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/object.js @@ -0,0 +1,391 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.canDefineProperty = canDefineProperty; +exports.clone = clone; +exports.deepExtend = deepExtend; +exports.deepFlatten = deepFlatten; +exports.deepStrictEqual = deepStrictEqual; +exports.extend = extend; +exports.get = get; +exports.hasOwnProperty = hasOwnProperty; +exports.isLegacyFactory = isLegacyFactory; +exports.lazy = lazy; +exports.mapObject = mapObject; +exports.pick = pick; +exports.pickShallow = pickShallow; +exports.set = set; +exports.traverse = traverse; +var _is = require("./is.js"); +/** + * Clone an object + * + * clone(x) + * + * Can clone any primitive type, array, and object. + * If x has a function clone, this function will be invoked to clone the object. + * + * @param {*} x + * @return {*} clone + */ +function clone(x) { + const type = typeof x; + + // immutable primitive types + if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) { + return x; + } + + // use clone function of the object when available + if (typeof x.clone === 'function') { + return x.clone(); + } + + // array + if (Array.isArray(x)) { + return x.map(function (value) { + return clone(value); + }); + } + if (x instanceof Date) return new Date(x.valueOf()); + if ((0, _is.isBigNumber)(x)) return x; // bignumbers are immutable + + // object + if ((0, _is.isObject)(x)) { + return mapObject(x, clone); + } + throw new TypeError(`Cannot clone: unknown type of value (value: ${x})`); +} + +/** + * Apply map to all properties of an object + * @param {Object} object + * @param {function} callback + * @return {Object} Returns a copy of the object with mapped properties + */ +function mapObject(object, callback) { + const clone = {}; + for (const key in object) { + if (hasOwnProperty(object, key)) { + clone[key] = callback(object[key]); + } + } + return clone; +} + +/** + * Extend object a with the properties of object b + * @param {Object} a + * @param {Object} b + * @return {Object} a + */ +function extend(a, b) { + for (const prop in b) { + if (hasOwnProperty(b, prop)) { + a[prop] = b[prop]; + } + } + return a; +} + +/** + * Deep extend an object a with the properties of object b + * @param {Object} a + * @param {Object} b + * @returns {Object} + */ +function deepExtend(a, b) { + // TODO: add support for Arrays to deepExtend + if (Array.isArray(b)) { + throw new TypeError('Arrays are not supported by deepExtend'); + } + for (const prop in b) { + // We check against prop not being in Object.prototype or Function.prototype + // to prevent polluting for example Object.__proto__. + if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) { + if (b[prop] && b[prop].constructor === Object) { + if (a[prop] === undefined) { + a[prop] = {}; + } + if (a[prop] && a[prop].constructor === Object) { + deepExtend(a[prop], b[prop]); + } else { + a[prop] = b[prop]; + } + } else if (Array.isArray(b[prop])) { + throw new TypeError('Arrays are not supported by deepExtend'); + } else { + a[prop] = b[prop]; + } + } + } + return a; +} + +/** + * Deep test equality of all fields in two pairs of arrays or objects. + * Compares values and functions strictly (ie. 2 is not the same as '2'). + * @param {Array | Object} a + * @param {Array | Object} b + * @returns {boolean} + */ +function deepStrictEqual(a, b) { + let prop, i, len; + if (Array.isArray(a)) { + if (!Array.isArray(b)) { + return false; + } + if (a.length !== b.length) { + return false; + } + for (i = 0, len = a.length; i < len; i++) { + if (!deepStrictEqual(a[i], b[i])) { + return false; + } + } + return true; + } else if (typeof a === 'function') { + return a === b; + } else if (a instanceof Object) { + if (Array.isArray(b) || !(b instanceof Object)) { + return false; + } + for (prop in a) { + // noinspection JSUnfilteredForInLoop + if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) { + return false; + } + } + for (prop in b) { + // noinspection JSUnfilteredForInLoop + if (!(prop in a)) { + return false; + } + } + return true; + } else { + return a === b; + } +} + +/** + * Recursively flatten a nested object. + * @param {Object} nestedObject + * @return {Object} Returns the flattened object + */ +function deepFlatten(nestedObject) { + const flattenedObject = {}; + _deepFlatten(nestedObject, flattenedObject); + return flattenedObject; +} + +// helper function used by deepFlatten +function _deepFlatten(nestedObject, flattenedObject) { + for (const prop in nestedObject) { + if (hasOwnProperty(nestedObject, prop)) { + const value = nestedObject[prop]; + if (typeof value === 'object' && value !== null) { + _deepFlatten(value, flattenedObject); + } else { + flattenedObject[prop] = value; + } + } + } +} + +/** + * Test whether the current JavaScript engine supports Object.defineProperty + * @returns {boolean} returns true if supported + */ +function canDefineProperty() { + // test needed for broken IE8 implementation + try { + if (Object.defineProperty) { + Object.defineProperty({}, 'x', { + get: function () { + return null; + } + }); + return true; + } + } catch (e) {} + return false; +} + +/** + * Attach a lazy loading property to a constant. + * The given function `fn` is called once when the property is first requested. + * + * @param {Object} object Object where to add the property + * @param {string} prop Property name + * @param {Function} valueResolver Function returning the property value. Called + * without arguments. + */ +function lazy(object, prop, valueResolver) { + let _uninitialized = true; + let _value; + Object.defineProperty(object, prop, { + get: function () { + if (_uninitialized) { + _value = valueResolver(); + _uninitialized = false; + } + return _value; + }, + set: function (value) { + _value = value; + _uninitialized = false; + }, + configurable: true, + enumerable: true + }); +} + +/** + * Traverse a path into an object. + * When a namespace is missing, it will be created + * @param {Object} object + * @param {string | string[]} path A dot separated string like 'name.space' + * @return {Object} Returns the object at the end of the path + */ +function traverse(object, path) { + if (path && typeof path === 'string') { + return traverse(object, path.split('.')); + } + let obj = object; + if (path) { + for (let i = 0; i < path.length; i++) { + const key = path[i]; + if (!(key in obj)) { + obj[key] = {}; + } + obj = obj[key]; + } + } + return obj; +} + +/** + * A safe hasOwnProperty + * @param {Object} object + * @param {string} property + */ +function hasOwnProperty(object, property) { + return object && Object.hasOwnProperty.call(object, property); +} + +/** + * Test whether an object is a factory. a factory has fields: + * + * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required) + * - name: string (optional) + * - path: string A dot separated path (optional) + * - math: boolean If true (false by default), the math namespace is passed + * as fifth argument of the factory function + * + * @param {*} object + * @returns {boolean} + */ +function isLegacyFactory(object) { + return object && typeof object.factory === 'function'; +} + +/** + * Get a nested property from an object + * @param {Object} object + * @param {string | string[]} path + * @returns {Object} + */ +function get(object, path) { + if (typeof path === 'string') { + if (isPath(path)) { + return get(object, path.split('.')); + } else { + return object[path]; + } + } + let child = object; + for (let i = 0; i < path.length; i++) { + const key = path[i]; + child = child ? child[key] : undefined; + } + return child; +} + +/** + * Set a nested property in an object + * Mutates the object itself + * If the path doesn't exist, it will be created + * @param {Object} object + * @param {string | string[]} path + * @param {*} value + * @returns {Object} + */ +function set(object, path, value) { + if (typeof path === 'string') { + if (isPath(path)) { + return set(object, path.split('.'), value); + } else { + object[path] = value; + return object; + } + } + let child = object; + for (let i = 0; i < path.length - 1; i++) { + const key = path[i]; + if (child[key] === undefined) { + child[key] = {}; + } + child = child[key]; + } + if (path.length > 0) { + const lastKey = path[path.length - 1]; + child[lastKey] = value; + } + return object; +} + +/** + * Create an object composed of the picked object properties + * @param {Object} object + * @param {string[]} properties + * @param {function} [transform] Optional value to transform a value when picking it + * @return {Object} + */ +function pick(object, properties, transform) { + const copy = {}; + for (let i = 0; i < properties.length; i++) { + const key = properties[i]; + const value = get(object, key); + if (value !== undefined) { + set(copy, key, transform ? transform(value, key) : value); + } + } + return copy; +} + +/** + * Shallow version of pick, creating an object composed of the picked object properties + * but not for nested properties + * @param {Object} object + * @param {string[]} properties + * @return {Object} + */ +function pickShallow(object, properties) { + const copy = {}; + for (let i = 0; i < properties.length; i++) { + const key = properties[i]; + const value = object[key]; + if (value !== undefined) { + copy[key] = value; + } + } + return copy; +} + +// helper function to test whether a string contains a path like 'user.name' +function isPath(str) { + return str.includes('.'); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js new file mode 100644 index 0000000..1ec3e89 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js @@ -0,0 +1,94 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.optimizeCallback = optimizeCallback; +var _typedFunction = _interopRequireDefault(require("typed-function")); +var _array = require("./array.js"); +var _is = require("./is.js"); +/** + * Simplifies a callback function by reducing its complexity and potentially improving its performance. + * + * @param {Function} callback The original callback function to simplify. + * @param {Array|Matrix} array The array that will be used with the callback function. + * @param {string} name The name of the function that is using the callback. + * @returns {Function} Returns a simplified version of the callback function. + */ +function optimizeCallback(callback, array, name) { + if (_typedFunction.default.isTypedFunction(callback)) { + const firstIndex = (array.isMatrix ? array.size() : (0, _array.arraySize)(array)).map(() => 0); + const firstValue = array.isMatrix ? array.get(firstIndex) : (0, _array.get)(array, firstIndex); + const hasSingleSignature = Object.keys(callback.signatures).length === 1; + const numberOfArguments = _findNumberOfArguments(callback, firstValue, firstIndex, array); + const fastCallback = hasSingleSignature ? Object.values(callback.signatures)[0] : callback; + if (numberOfArguments >= 1 && numberOfArguments <= 3) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name); + }; + } + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return _tryFunctionWithArgs(fastCallback, args, name, callback.name); + }; + } + return callback; +} +function _findNumberOfArguments(callback, value, index, array) { + const testArgs = [value, index, array]; + for (let i = 3; i > 0; i--) { + const args = testArgs.slice(0, i); + if (_typedFunction.default.resolve(callback, args) !== null) { + return i; + } + } +} + +/** + * @param {function} func The selected function taken from one of the signatures of the callback function + * @param {Array} args List with arguments to apply to the selected signature + * @param {string} mappingFnName the name of the function that is using the callback + * @param {string} callbackName the name of the callback function + * @returns {*} Returns the return value of the invoked signature + * @throws {TypeError} Throws an error when no matching signature was found + */ +function _tryFunctionWithArgs(func, args, mappingFnName, callbackName) { + try { + return func(...args); + } catch (err) { + _createCallbackError(err, args, mappingFnName, callbackName); + } +} + +/** + * Creates and throws a detailed TypeError when a callback function fails. + * + * @param {Error} err The original error thrown by the callback function. + * @param {Array} args The arguments that were passed to the callback function. + * @param {string} mappingFnName The name of the function that is using the callback. + * @param {string} callbackName The name of the callback function. + * @throws {TypeError} Throws a detailed TypeError with enriched error message. + */ +function _createCallbackError(err, args, mappingFnName, callbackName) { + var _err$data; + // Enrich the error message so the user understands that it took place inside the callback function + if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') { + const argsDesc = []; + argsDesc.push(`value: ${(0, _is.typeOf)(args[0])}`); + if (args.length >= 2) { + argsDesc.push(`index: ${(0, _is.typeOf)(args[1])}`); + } + if (args.length >= 3) { + argsDesc.push(`array: ${(0, _is.typeOf)(args[2])}`); + } + throw new TypeError(`Function ${mappingFnName} cannot apply callback arguments ` + `${callbackName}(${argsDesc.join(', ')}) at index ${JSON.stringify(args[1])}`); + } else { + throw new TypeError(`Function ${mappingFnName} cannot apply callback arguments ` + `to function ${callbackName}: ${err.message}`); + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/print.js new file mode 100644 index 0000000..701f0a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/print.js @@ -0,0 +1,7 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printTemplate = void 0; +const printTemplate = exports.printTemplate = /\$([\w.]+)/g; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/product.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/product.js new file mode 100644 index 0000000..181ea12 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/product.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.product = product; +/** @param {number} i + * @param {number} n + * @returns {number} product of i to n + */ +function product(i, n) { + if (n < i) { + return 1; + } + if (n === i) { + return n; + } + const half = n + i >> 1; // divide (n + i) by 2 and truncate to integer + return product(i, half) * product(half + 1, n); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/scope.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/scope.js new file mode 100644 index 0000000..de3b381 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/scope.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSubScope = createSubScope; +var _map = require("./map.js"); +/** + * Create a new scope which can access the parent scope, + * but does not affect it when written. This is suitable for variable definitions + * within a block node, or function definition. + * + * If parent scope has a createSubScope method, it delegates to that. Otherwise, + * creates an empty map, and copies the parent scope to it, adding in + * the remaining `args`. + * + * @param {Map} parentScope + * @param {Object} args + * @returns {PartitionedMap} + */ +function createSubScope(parentScope, args) { + return new _map.PartitionedMap(parentScope, new _map.ObjectWrappingMap(args), new Set(Object.keys(args))); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/snapshot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/snapshot.js new file mode 100644 index 0000000..e2d1914 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/snapshot.js @@ -0,0 +1,248 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createSnapshotFromFactories = createSnapshotFromFactories; +exports.validateBundle = validateBundle; +exports.validateTypeOf = void 0; +var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); +var _assert = _interopRequireDefault(require("assert")); +var allIsFunctions = _interopRequireWildcard(require("./is.js")); +var _create = require("../core/create.js"); +var _string = require("./string.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +/** + * This file contains helper methods to create expected snapshot structures + * of both instance and ES6 exports. + * + * The files are located here and not under /test or /tools so it's transpiled + * into ES5 code under /lib and can be used straight by node.js + */ + +const validateTypeOf = exports.validateTypeOf = allIsFunctions.typeOf; +function validateBundle(expectedBundleStructure, bundle) { + const originalWarn = console.warn; + console.warn = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (args.join(' ').includes('is moved to') && args.join(' ').includes('Please use the new location instead')) { + // Ignore warnings like: + // Warning: math.type.isNumber is moved to math.isNumber in v6.0.0. Please use the new location instead. + return; + } + originalWarn.apply(console, args); + }; + try { + const issues = []; + + // see whether all expected functions and objects are there + traverse(expectedBundleStructure, (expectedType, path) => { + const actualValue = get(bundle, path); + const actualType = validateTypeOf(actualValue); + const message = actualType === 'undefined' ? 'Missing entry in bundle. ' + `Path: ${JSON.stringify(path)}, expected type: ${expectedType}, actual type: ${actualType}` : 'Unexpected entry type in bundle. ' + `Path: ${JSON.stringify(path)}, expected type: ${expectedType}, actual type: ${actualType}`; + if (actualType !== expectedType) { + issues.push({ + actualType, + expectedType, + message + }); + console.warn(message); + } + }); + + // see whether there are any functions or objects that shouldn't be there + traverse(bundle, (actualValue, path) => { + const actualType = validateTypeOf(actualValue); + const expectedType = get(expectedBundleStructure, path) || 'undefined'; + + // FIXME: ugly to have these special cases + if (path.join('.').includes('docs.')) { + // ignore the contents of docs + return; + } + if (path.join('.').includes('all.')) { + // ignore the contents of all dependencies + return; + } + const message = expectedType === 'undefined' ? 'Unknown entry in bundle. ' + 'Is there a new function added which is missing in this snapshot test? ' + `Path: ${JSON.stringify(path)}, expected type: ${expectedType}, actual type: ${actualType}` : 'Unexpected entry type in bundle. ' + `Path: ${JSON.stringify(path)}, expected type: ${expectedType}, actual type: ${actualType}`; + if (actualType !== expectedType) { + issues.push({ + actualType, + expectedType, + message + }); + console.warn(message); + } + }); + + // assert on the first issue (if any) + if (issues.length > 0) { + const { + actualType, + expectedType, + message + } = issues[0]; + console.warn(`${issues.length} bundle issues found`); + _assert.default.strictEqual(actualType, expectedType, message); + } + } finally { + console.warn = originalWarn; + } +} + +/** + * Based on an object with factory functions, create the expected + * structures for ES6 export and a mathjs instance. + * @param {Object} factories + * @return {{expectedInstanceStructure: Object, expectedES6Structure: Object}} + */ +function createSnapshotFromFactories(factories) { + const math = (0, _create.create)(factories); + const allFactoryFunctions = {}; + const allFunctionsConstantsClasses = {}; + const allFunctionsConstants = {}; + const allTransformFunctions = {}; + const allDependencyCollections = {}; + const allClasses = {}; + const allNodeClasses = {}; + Object.keys(factories).forEach(factoryName => { + const factory = factories[factoryName]; + const name = factory.fn; + const isTransformFunction = factory.meta && factory.meta.isTransformFunction; + const isClass = !isLowerCase(name[0]) && validateTypeOf(math[name]) === 'function'; + const dependenciesName = factory.fn + (isTransformFunction ? 'Transform' : '') + 'Dependencies'; + allFactoryFunctions[factoryName] = 'function'; + allFunctionsConstantsClasses[name] = validateTypeOf(math[name]); + allDependencyCollections[dependenciesName] = 'Object'; + if (isTransformFunction) { + allTransformFunctions[name] = 'function'; + } + if (isClass) { + if ((0, _string.endsWith)(name, 'Node')) { + allNodeClasses[name] = 'function'; + } else { + allClasses[name] = 'function'; + } + } else { + allFunctionsConstants[name] = validateTypeOf(math[name]); + } + }); + let embeddedDocs = {}; + Object.keys(factories).forEach(factoryName => { + const factory = factories[factoryName]; + const name = factory.fn; + if (isLowerCase(factory.fn[0])) { + // ignore class names starting with upper case + embeddedDocs[name] = 'Object'; + } + }); + embeddedDocs = exclude(embeddedDocs, ['equalScalar', 'apply', 'addScalar', 'subtractScalar', 'multiplyScalar', 'print', 'divideScalar', 'parse', 'compile', 'parser', 'chain', 'reviver', 'replacer']); + const allTypeChecks = {}; + Object.keys(allIsFunctions).forEach(name => { + if (name.indexOf('is') === 0) { + allTypeChecks[name] = 'function'; + } + }); + const allErrorClasses = { + ArgumentsError: 'function', + DimensionError: 'function', + IndexError: 'function' + }; + const expectedInstanceStructure = { + ...allFunctionsConstantsClasses, + on: 'function', + off: 'function', + once: 'function', + emit: 'function', + import: 'function', + config: 'function', + create: 'function', + factory: 'function', + ...allTypeChecks, + ...allErrorClasses, + expression: { + transform: { + ...allTransformFunctions + }, + mathWithTransform: { + // note that we don't have classes here, + // only functions and constants are allowed in the editor + ...exclude(allFunctionsConstants, ['chain']), + config: 'function' + } + } + }; + const expectedES6Structure = { + // functions + ...exclude(allFunctionsConstantsClasses, ['E', 'false', 'Infinity', 'NaN', 'null', 'PI', 'true']), + create: 'function', + config: 'function', + factory: 'function', + _true: 'boolean', + _false: 'boolean', + _null: 'null', + _Infinity: 'number', + _NaN: 'number', + ...allTypeChecks, + ...allErrorClasses, + ...allDependencyCollections, + ...allFactoryFunctions, + docs: embeddedDocs + }; + return { + expectedInstanceStructure, + expectedES6Structure + }; +} +function traverse(obj) { + let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (value, path) => {}; + let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + // FIXME: ugly to have these special cases + if (path.length > 0 && path[0].includes('Dependencies')) { + // special case for objects holding a collection of dependencies + callback(obj, path); + } else if (validateTypeOf(obj) === 'Array') { + obj.map((item, index) => traverse(item, callback, path.concat(index))); + } else if (validateTypeOf(obj) === 'Object') { + Object.keys(obj).forEach(key => { + // FIXME: ugly to have these special cases + // ignore special case of deprecated docs + if (key === 'docs' && path.join('.') === 'expression') { + return; + } + traverse(obj[key], callback, path.concat(key)); + }); + } else { + callback(obj, path); + } +} +function get(object, path) { + let child = object; + for (let i = 0; i < path.length; i++) { + const key = path[i]; + child = child ? child[key] : undefined; + } + return child; +} + +/** + * Create a copy of the provided `object` and delete + * all properties listed in `excludedProperties` + * @param {Object} object + * @param {string[]} excludedProperties + * @return {Object} + */ +function exclude(object, excludedProperties) { + const strippedObject = (0, _extends2.default)({}, object); + excludedProperties.forEach(excludedProperty => { + delete strippedObject[excludedProperty]; + }); + return strippedObject; +} +function isLowerCase(text) { + return typeof text === 'string' && text.toLowerCase() === text; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/string.js new file mode 100644 index 0000000..3317d18 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/string.js @@ -0,0 +1,203 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.compareText = compareText; +exports.endsWith = endsWith; +exports.escape = escape; +exports.format = format; +exports.stringify = stringify; +var _is = require("./is.js"); +var _number = require("./number.js"); +var _formatter = require("./bignumber/formatter.js"); +/** + * Check if a text ends with a certain string. + * @param {string} text + * @param {string} search + */ +function endsWith(text, search) { + const start = text.length - search.length; + const end = text.length; + return text.substring(start, end) === search; +} + +/** + * Format a value of any type into a string. + * + * Usage: + * math.format(value) + * math.format(value, precision) + * math.format(value, options) + * + * When value is a function: + * + * - When the function has a property `syntax`, it returns this + * syntax description. + * - In other cases, a string `'function'` is returned. + * + * When `value` is an Object: + * + * - When the object contains a property `format` being a function, this + * function is invoked as `value.format(options)` and the result is returned. + * - When the object has its own `toString` method, this method is invoked + * and the result is returned. + * - In other cases the function will loop over all object properties and + * return JSON object notation like '{"a": 2, "b": 3}'. + * + * Example usage: + * math.format(2/7) // '0.2857142857142857' + * math.format(math.pi, 3) // '3.14' + * math.format(new Complex(2, 3)) // '2 + 3i' + * math.format('hello') // '"hello"' + * + * @param {*} value Value to be stringified + * @param {Object | number | Function} [options] + * Formatting options. See src/utils/number.js:format for a + * description of the available options controlling number output. + * This generic "format" also supports the option property `truncate: NN` + * giving the maximum number NN of characters to return (if there would + * have been more, they are deleted and replaced by an ellipsis). + * @return {string} str + */ +function format(value, options) { + const result = _format(value, options); + if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) { + return result.substring(0, options.truncate - 3) + '...'; + } + return result; +} +function _format(value, options) { + if (typeof value === 'number') { + return (0, _number.format)(value, options); + } + if ((0, _is.isBigNumber)(value)) { + return (0, _formatter.format)(value, options); + } + + // note: we use unsafe duck-typing here to check for Fractions, this is + // ok here since we're only invoking toString or concatenating its values + if (looksLikeFraction(value)) { + if (!options || options.fraction !== 'decimal') { + // output as ratio, like '1/3' + return value.s * value.n + '/' + value.d; + } else { + // output as decimal, like '0.(3)' + return value.toString(); + } + } + if (Array.isArray(value)) { + return formatArray(value, options); + } + if ((0, _is.isString)(value)) { + return stringify(value); + } + if (typeof value === 'function') { + return value.syntax ? String(value.syntax) : 'function'; + } + if (value && typeof value === 'object') { + if (typeof value.format === 'function') { + return value.format(options); + } else if (value && value.toString(options) !== {}.toString()) { + // this object has a non-native toString method, use that one + return value.toString(options); + } else { + const entries = Object.keys(value).map(key => { + return stringify(key) + ': ' + format(value[key], options); + }); + return '{' + entries.join(', ') + '}'; + } + } + return String(value); +} + +/** + * Stringify a value into a string enclosed in double quotes. + * Unescaped double quotes and backslashes inside the value are escaped. + * @param {*} value + * @return {string} + */ +function stringify(value) { + const text = String(value); + let escaped = ''; + let i = 0; + while (i < text.length) { + const c = text.charAt(i); + escaped += c in controlCharacters ? controlCharacters[c] : c; + i++; + } + return '"' + escaped + '"'; +} +const controlCharacters = { + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t' +}; + +/** + * Escape special HTML characters + * @param {*} value + * @return {string} + */ +function escape(value) { + let text = String(value); + text = text.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>'); + return text; +} + +/** + * Recursively format an n-dimensional matrix + * Example output: "[[1, 2], [3, 4]]" + * @param {Array} array + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ +function formatArray(array, options) { + if (Array.isArray(array)) { + let str = '['; + const len = array.length; + for (let i = 0; i < len; i++) { + if (i !== 0) { + str += ', '; + } + str += formatArray(array[i], options); + } + str += ']'; + return str; + } else { + return format(array, options); + } +} + +/** + * Check whether a value looks like a Fraction (unsafe duck-type check) + * @param {*} value + * @return {boolean} + */ +function looksLikeFraction(value) { + return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false; +} + +/** + * Compare two strings + * @param {string} x + * @param {string} y + * @returns {number} + */ +function compareText(x, y) { + // we don't want to convert numbers to string, only accept string input + if (!(0, _is.isString)(x)) { + throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + (0, _is.typeOf)(x) + ', index: 0)'); + } + if (!(0, _is.isString)(y)) { + throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + (0, _is.typeOf)(y) + ', index: 1)'); + } + return x === y ? 0 : x > y ? 1 : -1; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/switch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/switch.js new file mode 100644 index 0000000..ad5f8ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/utils/switch.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports._switch = _switch; +/** + * Transpose a matrix + * @param {Array} mat + * @returns {Array} ret + * @private + */ +function _switch(mat) { + const I = mat.length; + const J = mat[0].length; + let i, j; + const ret = []; + for (j = 0; j < J; j++) { + const tmp = []; + for (i = 0; i < I; i++) { + tmp.push(mat[i][j]); + } + ret.push(tmp); + } + return ret; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/version.js b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/version.js new file mode 100644 index 0000000..c9ce638 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/cjs/version.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.version = void 0; +const version = exports.version = '13.2.0'; +// Note: This file is automatically generated when building math.js. +// Changes made in this file will be overwritten. \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/constants.js new file mode 100644 index 0000000..8629181 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/constants.js @@ -0,0 +1,124 @@ +import { factory } from './utils/factory.js'; +import { version } from './version.js'; +import { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau } from './utils/bignumber/constants.js'; +import { pi, tau, e, phi } from './plain/number/index.js'; +export var createTrue = /* #__PURE__ */factory('true', [], () => true); +export var createFalse = /* #__PURE__ */factory('false', [], () => false); +export var createNull = /* #__PURE__ */factory('null', [], () => null); +export var createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => { + var { + config, + BigNumber + } = _ref; + return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity; +}); +export var createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => { + var { + config, + BigNumber + } = _ref2; + return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN; +}); +export var createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => { + var { + config, + BigNumber + } = _ref3; + return config.number === 'BigNumber' ? createBigNumberPi(BigNumber) : pi; +}); +export var createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => { + var { + config, + BigNumber + } = _ref4; + return config.number === 'BigNumber' ? createBigNumberTau(BigNumber) : tau; +}); +export var createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => { + var { + config, + BigNumber + } = _ref5; + return config.number === 'BigNumber' ? createBigNumberE(BigNumber) : e; +}); + +// golden ratio, (1+sqrt(5))/2 +export var createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => { + var { + config, + BigNumber + } = _ref6; + return config.number === 'BigNumber' ? createBigNumberPhi(BigNumber) : phi; +}); +export var createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => { + var { + config, + BigNumber + } = _ref7; + return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2; +}); +export var createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => { + var { + config, + BigNumber + } = _ref8; + return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10; +}); +export var createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => { + var { + config, + BigNumber + } = _ref9; + return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E; +}); +export var createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => { + var { + config, + BigNumber + } = _ref10; + return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E; +}); +export var createSQRT1_2 = /* #__PURE__ */recreateFactory( +// eslint-disable-line camelcase +'SQRT1_2', ['config', '?BigNumber'], _ref11 => { + var { + config, + BigNumber + } = _ref11; + return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2; +}); +export var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => { + var { + config, + BigNumber + } = _ref12; + return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2; +}); +export var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => { + var { + Complex + } = _ref13; + return Complex.I; +}); + +// for backward compatibility with v5 +export var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref14 => { + var { + pi + } = _ref14; + return pi; +}); +export var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref15 => { + var { + e + } = _ref15; + return e; +}); +export var createVersion = /* #__PURE__ */factory('version', [], () => version); + +// helper function to create a factory with a flag recreateOnConfigChange +// idea: allow passing optional properties to be attached to the factory function as 4th argument? +function recreateFactory(name, dependencies, create) { + return factory(name, dependencies, create, { + recreateOnConfigChange: true + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/config.js new file mode 100644 index 0000000..10861f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/config.js @@ -0,0 +1,25 @@ +export var DEFAULT_CONFIG = { + // minimum relative difference between two compared values, + // used by all comparison functions + relTol: 1e-12, + // minimum absolute difference between two compared values, + // used by all comparison functions + absTol: 1e-15, + // type of default matrix output. Choose 'matrix' (default) or 'array' + matrix: 'Matrix', + // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction' + number: 'number', + // type of fallback used for config { number: 'bigint' } when a value cannot be represented + // in the configured numeric type. Choose 'number' (default) or 'BigNumber'. + numberFallback: 'number', + // number of significant digits in BigNumbers + precision: 64, + // 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. + predictable: false, + // random seed for seeded pseudo random number generation + // null = randomly seed + randomSeed: null +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/create.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/create.js new file mode 100644 index 0000000..15baadf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/create.js @@ -0,0 +1,205 @@ +import _extends from "@babel/runtime/helpers/extends"; +import typedFunction from 'typed-function'; +import { ArgumentsError } from '../error/ArgumentsError.js'; +import { DimensionError } from '../error/DimensionError.js'; +import { IndexError } from '../error/IndexError.js'; +import { factory, isFactory } from '../utils/factory.js'; +import { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isObjectWrappingMap, isOperatorNode, isParenthesisNode, isPartitionedMap, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../utils/is.js'; +import { deepFlatten, isLegacyFactory } from '../utils/object.js'; +import * as emitter from './../utils/emitter.js'; +import { DEFAULT_CONFIG } from './config.js'; +import { configFactory } from './function/config.js'; +import { importFactory } from './function/import.js'; + +/** + * Create a mathjs instance from given factory functions and optionally config + * + * Usage: + * + * const mathjs1 = create({ createAdd, createMultiply, ...}) + * const config = { number: 'BigNumber' } + * const mathjs2 = create(all, config) + * + * @param {Object} [factories] An object with factory functions + * The object can contain nested objects, + * all nested objects will be flattened. + * @param {Object} [config] Available options: + * {number} relTol + * Minimum relative difference between two + * compared values, used by all comparison functions. + * {number} absTol + * Minimum absolute 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. + * {string} randomSeed + * Random seed for seeded pseudo random number generator. + * Set to null to randomly seed. + * @returns {Object} Returns a bare-bone math.js instance containing + * functions: + * - `import` to add new functions + * - `config` to change configuration + * - `on`, `off`, `once`, `emit` for events + */ +export function create(factories, config) { + var configInternal = _extends({}, DEFAULT_CONFIG, config); + + // simple test for ES5 support + if (typeof Object.create !== 'function') { + throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.'); + } + + // create the mathjs instance + var math = emitter.mixin({ + // only here for backward compatibility for legacy factory functions + isNumber, + isComplex, + isBigNumber, + isBigInt, + isFraction, + isUnit, + isString, + isArray, + isMatrix, + isCollection, + isDenseMatrix, + isSparseMatrix, + isRange, + isIndex, + isBoolean, + isResultSet, + isHelp, + isFunction, + isDate, + isRegExp, + isObject, + isMap, + isPartitionedMap, + isObjectWrappingMap, + isNull, + isUndefined, + isAccessorNode, + isArrayNode, + isAssignmentNode, + isBlockNode, + isConditionalNode, + isConstantNode, + isFunctionAssignmentNode, + isFunctionNode, + isIndexNode, + isNode, + isObjectNode, + isOperatorNode, + isParenthesisNode, + isRangeNode, + isRelationalNode, + isSymbolNode, + isChain + }); + + // load config function and apply provided config + math.config = configFactory(configInternal, math.emit); + math.expression = { + transform: {}, + mathWithTransform: { + config: math.config + } + }; + + // cached factories and instances used by function load + var legacyFactories = []; + var legacyInstances = []; + + /** + * Load a function or data type from a factory. + * If the function or data type already exists, the existing instance is + * returned. + * @param {Function} factory + * @returns {*} + */ + function load(factory) { + if (isFactory(factory)) { + return factory(math); + } + var firstProperty = factory[Object.keys(factory)[0]]; + if (isFactory(firstProperty)) { + return firstProperty(math); + } + if (!isLegacyFactory(factory)) { + console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory); + throw new Error('Factory object with properties `type`, `name`, and `factory` expected'); + } + var index = legacyFactories.indexOf(factory); + var instance; + if (index === -1) { + // doesn't yet exist + if (factory.math === true) { + // pass with math namespace + instance = factory.factory(math.type, configInternal, load, math.typed, math); + } else { + instance = factory.factory(math.type, configInternal, load, math.typed); + } + + // append to the cache + legacyFactories.push(factory); + legacyInstances.push(instance); + } else { + // already existing function, return the cached instance + instance = legacyInstances[index]; + } + return instance; + } + var importedFactories = {}; + + // load the import function + function lazyTyped() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return math.typed.apply(math.typed, args); + } + lazyTyped.isTypedFunction = typedFunction.isTypedFunction; + var internalImport = importFactory(lazyTyped, load, math, importedFactories); + math.import = internalImport; + + // listen for changes in config, import all functions again when changed + // TODO: move this listener into the import function? + math.on('config', () => { + Object.values(importedFactories).forEach(factory => { + if (factory && factory.meta && factory.meta.recreateOnConfigChange) { + // FIXME: only re-create when the current instance is the same as was initially created + // FIXME: delete the functions/constants before importing them again? + internalImport(factory, { + override: true + }); + } + }); + }); + + // the create function exposed on the mathjs instance is bound to + // the factory functions passed before + math.create = create.bind(null, factories); + + // export factory function + math.factory = factory; + + // import the factory functions like createAdd as an array instead of object, + // else they will get a different naming (`createAdd` instead of `add`). + math.import(Object.values(deepFlatten(factories))); + math.ArgumentsError = ArgumentsError; + math.DimensionError = DimensionError; + math.IndexError = IndexError; + return math; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/config.js new file mode 100644 index 0000000..7c50520 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/config.js @@ -0,0 +1,108 @@ +import { clone, deepExtend } from '../../utils/object.js'; +import { DEFAULT_CONFIG } from '../config.js'; +export var MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix +export var NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number + +export function configFactory(config, emit) { + /** + * Set configuration options for math.js, and get current options. + * Will emit a 'config' event, with arguments (curr, prev, changes). + * + * This function is only available on a mathjs instance created using `create`. + * + * Syntax: + * + * math.config(config: Object): Object + * + * Examples: + * + * + * import { create, all } from 'mathjs' + * + * // create a mathjs instance + * const math = create(all) + * + * math.config().number // outputs 'number' + * math.evaluate('0.4') // outputs number 0.4 + * math.config({number: 'Fraction'}) + * math.evaluate('0.4') // outputs Fraction 2/5 + * + * @param {Object} [options] Available options: + * {number} relTol + * Minimum relative difference between two + * compared values, used by all comparison functions. + * {number} absTol + * Minimum absolute 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', 'bigint', or 'Fraction' + * {number} precision + * The number of significant digits for BigNumbers. + * Not applicable for Numbers. + * {string} parenthesis + * How to display parentheses in LaTeX and string + * output. + * {string} randomSeed + * Random seed for seeded pseudo random number generator. + * Set to null to randomly seed. + * @return {Object} Returns the current configuration + */ + function _config(options) { + if (options) { + if (options.epsilon !== undefined) { + // this if is only for backwards compatibility, it can be removed in the future. + console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.'); + var optionsFix = clone(options); + optionsFix.relTol = options.epsilon; + optionsFix.absTol = options.epsilon * 1e-3; + delete optionsFix.epsilon; + return _config(optionsFix); + } + var prev = clone(config); + + // validate some of the options + validateOption(options, 'matrix', MATRIX_OPTIONS); + validateOption(options, 'number', NUMBER_OPTIONS); + + // merge options + deepExtend(config, options); + var curr = clone(config); + var changes = clone(options); + + // emit 'config' event + emit('config', curr, prev, changes); + return curr; + } else { + return clone(config); + } + } + + // attach the valid options to the function so they can be extended + _config.MATRIX_OPTIONS = MATRIX_OPTIONS; + _config.NUMBER_OPTIONS = NUMBER_OPTIONS; + + // attach the config properties as readonly properties to the config function + Object.keys(DEFAULT_CONFIG).forEach(key => { + Object.defineProperty(_config, key, { + get: () => config[key], + enumerable: true, + configurable: true + }); + }); + return _config; +} + +/** + * Validate an option + * @param {Object} options Object with options + * @param {string} name Name of the option to validate + * @param {Array.} values Array with valid values for this option + */ +function validateOption(options, name, values) { + if (options[name] !== undefined && !values.includes(options[name])) { + // unknown value + console.warn('Warning: Unknown value "' + options[name] + '" for configuration option "' + name + '". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.'); + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/import.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/import.js new file mode 100644 index 0000000..2b1ff64 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/import.js @@ -0,0 +1,325 @@ +import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js'; +import { isFactory, stripOptionalNotation } from '../../utils/factory.js'; +import { hasOwnProperty, lazy } from '../../utils/object.js'; +import { ArgumentsError } from '../../error/ArgumentsError.js'; +export function importFactory(typed, load, math, importedFactories) { + /** + * Import functions from an object or a module. + * + * This function is only available on a mathjs instance created using `create`. + * + * Syntax: + * + * math.import(functions) + * math.import(functions, options) + * + * Where: + * + * - `functions: Object` + * An object with functions or factories to be imported. + * - `options: Object` An object with import options. Available options: + * - `override: boolean` + * If true, existing functions will be overwritten. False by default. + * - `silent: boolean` + * If true, the function will not throw errors on duplicates or invalid + * types. False by default. + * - `wrap: boolean` + * If true, the functions will be wrapped in a wrapper function + * which converts data types like Matrix to primitive data types like Array. + * The wrapper is needed when extending math.js with libraries which do not + * support these data type. False by default. + * + * Examples: + * + * import { create, all } from 'mathjs' + * import * as numbers from 'numbers' + * + * // create a mathjs instance + * const math = create(all) + * + * // define new functions and variables + * math.import({ + * myvalue: 42, + * hello: function (name) { + * return 'hello, ' + name + '!' + * } + * }) + * + * // use the imported function and variable + * math.myvalue * 2 // 84 + * math.hello('user') // 'hello, user!' + * + * // import the npm module 'numbers' + * // (must be installed first with `npm install numbers`) + * math.import(numbers, {wrap: true}) + * + * math.fibonacci(7) // returns 13 + * + * @param {Object | Array} functions Object with functions to be imported. + * @param {Object} [options] Import options. + */ + function mathImport(functions, options) { + var num = arguments.length; + if (num !== 1 && num !== 2) { + throw new ArgumentsError('import', num, 1, 2); + } + if (!options) { + options = {}; + } + function flattenImports(flatValues, value, name) { + if (Array.isArray(value)) { + value.forEach(item => flattenImports(flatValues, item)); + } else if (typeof value === 'object') { + for (var _name in value) { + if (hasOwnProperty(value, _name)) { + flattenImports(flatValues, value[_name], _name); + } + } + } else if (isFactory(value) || name !== undefined) { + var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly + : value.fn : name; + + // we allow importing the same function twice if it points to the same implementation + if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) { + throw new Error('Cannot import "' + flatName + '" twice'); + } + flatValues[flatName] = value; + } else { + if (!options.silent) { + throw new TypeError('Factory, Object, or Array expected'); + } + } + } + var flatValues = {}; + flattenImports(flatValues, functions); + for (var name in flatValues) { + if (hasOwnProperty(flatValues, name)) { + // console.log('import', name) + var value = flatValues[name]; + if (isFactory(value)) { + // we ignore name here and enforce the name of the factory + // maybe at some point we do want to allow overriding it + // in that case we can implement an option overrideFactoryNames: true + _importFactory(value, options); + } else if (isSupportedType(value)) { + _import(name, value, options); + } else { + if (!options.silent) { + throw new TypeError('Factory, Object, or Array expected'); + } + } + } + } + } + + /** + * Add a property to the math namespace + * @param {string} name + * @param {*} value + * @param {Object} options See import for a description of the options + * @private + */ + function _import(name, value, options) { + // TODO: refactor this function, it's to complicated and contains duplicate code + if (options.wrap && typeof value === 'function') { + // create a wrapper around the function + value = _wrap(value); + } + + // turn a plain function with a typed-function signature into a typed-function + if (hasTypedFunctionSignature(value)) { + value = typed(name, { + [value.signature]: value + }); + } + if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) { + if (options.override) { + // give the typed function the right name + value = typed(name, value.signatures); + } else { + // merge the existing and typed function + value = typed(math[name], value); + } + math[name] = value; + delete importedFactories[name]; + _importTransform(name, value); + math.emit('import', name, function resolver() { + return value; + }); + return; + } + if (math[name] === undefined || options.override) { + math[name] = value; + delete importedFactories[name]; + _importTransform(name, value); + math.emit('import', name, function resolver() { + return value; + }); + return; + } + if (!options.silent) { + throw new Error('Cannot import "' + name + '": already exists'); + } + } + function _importTransform(name, value) { + if (value && typeof value.transform === 'function') { + math.expression.transform[name] = value.transform; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = value.transform; + } + } else { + // remove existing transform + delete math.expression.transform[name]; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = value; + } + } + } + function _deleteTransform(name) { + delete math.expression.transform[name]; + if (allowedInExpressions(name)) { + math.expression.mathWithTransform[name] = math[name]; + } else { + delete math.expression.mathWithTransform[name]; + } + } + + /** + * Create a wrapper a round an function which converts the arguments + * to their primitive values (like convert a Matrix to Array) + * @param {Function} fn + * @return {Function} Returns the wrapped function + * @private + */ + function _wrap(fn) { + var wrapper = function wrapper() { + var args = []; + for (var i = 0, len = arguments.length; i < len; i++) { + var arg = arguments[i]; + args[i] = arg && arg.valueOf(); + } + return fn.apply(math, args); + }; + if (fn.transform) { + wrapper.transform = fn.transform; + } + return wrapper; + } + + /** + * Import an instance of a factory into math.js + * @param {function(scope: object)} factory + * @param {Object} options See import for a description of the options + * @param {string} [name=factory.name] Optional custom name + * @private + */ + function _importFactory(factory, options) { + var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn; + if (name.includes('.')) { + throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name)); + } + var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math; + var existingTransform = name in math.expression.transform; + var existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined; + var resolver = function resolver() { + // collect all dependencies, handle finding both functions and classes and other special cases + var dependencies = {}; + factory.dependencies.map(stripOptionalNotation).forEach(dependency => { + if (dependency.includes('.')) { + throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency)); + } + if (dependency === 'math') { + dependencies.math = math; + } else if (dependency === 'mathWithTransform') { + dependencies.mathWithTransform = math.expression.mathWithTransform; + } else if (dependency === 'classes') { + // special case for json reviver + dependencies.classes = math; + } else { + dependencies[dependency] = math[dependency]; + } + }); + var instance = /* #__PURE__ */factory(dependencies); + if (instance && typeof instance.transform === 'function') { + throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = "expression.transform"'); + } + if (existing === undefined || options.override) { + return instance; + } + if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) { + // merge the existing and new typed function + return typed(existing, instance); + } + if (options.silent) { + // keep existing, ignore imported function + return existing; + } else { + throw new Error('Cannot import "' + name + '": already exists'); + } + }; + + // TODO: add unit test with non-lazy factory + if (!factory.meta || factory.meta.lazy !== false) { + lazy(namespace, name, resolver); + + // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two) + if (existing && existingTransform) { + _deleteTransform(name); + } else { + if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) { + lazy(math.expression.mathWithTransform, name, () => namespace[name]); + } + } + } else { + namespace[name] = resolver(); + + // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two) + if (existing && existingTransform) { + _deleteTransform(name); + } else { + if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) { + lazy(math.expression.mathWithTransform, name, () => namespace[name]); + } + } + } + + // TODO: improve factories, store a list with imports instead which can be re-played + importedFactories[name] = factory; + math.emit('import', name, resolver); + } + + /** + * Check whether given object is a type which can be imported + * @param {Function | number | string | boolean | null | Unit | Complex} object + * @return {boolean} + * @private + */ + function isSupportedType(object) { + return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object); + } + function hasTypedFunctionSignature(fn) { + return typeof fn === 'function' && typeof fn.signature === 'string'; + } + function allowedInExpressions(name) { + return !hasOwnProperty(unsafe, name); + } + function factoryAllowedInExpressions(factory) { + return !factory.fn.includes('.') && + // FIXME: make checking on path redundant, check on meta data instead + !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass); + } + function isTransformFunctionFactory(factory) { + return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false; + } + + // namespaces and functions not available in the parser for safety reasons + var unsafe = { + expression: true, + type: true, + docs: true, + error: true, + json: true, + chain: true // chain method not supported. Note that there is a unit chain too. + }; + return mathImport; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/typed.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/typed.js new file mode 100644 index 0000000..8507510 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/core/function/typed.js @@ -0,0 +1,455 @@ +/** + * Create a typed-function which checks the types of the arguments and + * can match them against multiple provided signatures. The typed-function + * automatically converts inputs in order to find a matching signature. + * Typed functions throw informative errors in case of wrong input arguments. + * + * See the library [typed-function](https://github.com/josdejong/typed-function) + * for detailed documentation. + * + * Syntax: + * + * math.typed(name, signatures) : function + * math.typed(signatures) : function + * + * Examples: + * + * // create a typed function with multiple types per argument (type union) + * const fn2 = typed({ + * 'number | boolean': function (b) { + * return 'b is a number or boolean' + * }, + * 'string, number | boolean': function (a, b) { + * return 'a is a string, b is a number or boolean' + * } + * }) + * + * // create a typed function with an any type argument + * const log = typed({ + * 'string, any': function (event, data) { + * console.log('event: ' + event + ', data: ' + JSON.stringify(data)) + * } + * }) + * + * @param {string} [name] Optional name for the typed-function + * @param {Object} signatures Object with one or multiple function signatures + * @returns {function} The created typed-function. + */ + +import typedFunction from 'typed-function'; +import { factory } from '../../utils/factory.js'; +import { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../../utils/is.js'; +import { digits } from '../../utils/number.js'; + +// returns a new instance of typed-function +var _createTyped2 = function _createTyped() { + // initially, return the original instance of typed-function + // consecutively, return a new instance from typed.create. + _createTyped2 = typedFunction.create; + return typedFunction; +}; +var dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction']; + +/** + * Factory function for creating a new typed instance + * @param {Object} dependencies Object with data types like Complex and BigNumber + * @returns {Function} + */ +export var createTyped = /* #__PURE__ */factory('typed', dependencies, function createTyped(_ref) { + var { + BigNumber, + Complex, + DenseMatrix, + Fraction + } = _ref; + // TODO: typed-function must be able to silently ignore signatures with unknown data types + + // get a new instance of typed-function + var typed = _createTyped2(); + + // define all types. The order of the types determines in which order function + // arguments are type-checked (so for performance it's important to put the + // most used types first). + typed.clear(); + typed.addTypes([{ + name: 'number', + test: isNumber + }, { + name: 'Complex', + test: isComplex + }, { + name: 'BigNumber', + test: isBigNumber + }, { + name: 'bigint', + test: isBigInt + }, { + name: 'Fraction', + test: isFraction + }, { + name: 'Unit', + test: isUnit + }, + // The following type matches a valid variable name, i.e., an alphanumeric + // string starting with an alphabetic character. It is used (at least) + // in the definition of the derivative() function, as the argument telling + // what to differentiate over must (currently) be a variable. + // TODO: deprecate the identifier type (it's not used anymore, see https://github.com/josdejong/mathjs/issues/3253) + { + name: 'identifier', + test: s => isString && /^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-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15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uA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EF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(s) + }, { + name: 'string', + test: isString + }, { + name: 'Chain', + test: isChain + }, { + name: 'Array', + test: isArray + }, { + name: 'Matrix', + test: isMatrix + }, { + name: 'DenseMatrix', + test: isDenseMatrix + }, { + name: 'SparseMatrix', + test: isSparseMatrix + }, { + name: 'Range', + test: isRange + }, { + name: 'Index', + test: isIndex + }, { + name: 'boolean', + test: isBoolean + }, { + name: 'ResultSet', + test: isResultSet + }, { + name: 'Help', + test: isHelp + }, { + name: 'function', + test: isFunction + }, { + name: 'Date', + test: isDate + }, { + name: 'RegExp', + test: isRegExp + }, { + name: 'null', + test: isNull + }, { + name: 'undefined', + test: isUndefined + }, { + name: 'AccessorNode', + test: isAccessorNode + }, { + name: 'ArrayNode', + test: isArrayNode + }, { + name: 'AssignmentNode', + test: isAssignmentNode + }, { + name: 'BlockNode', + test: isBlockNode + }, { + name: 'ConditionalNode', + test: isConditionalNode + }, { + name: 'ConstantNode', + test: isConstantNode + }, { + name: 'FunctionNode', + test: isFunctionNode + }, { + name: 'FunctionAssignmentNode', + test: isFunctionAssignmentNode + }, { + name: 'IndexNode', + test: isIndexNode + }, { + name: 'Node', + test: isNode + }, { + name: 'ObjectNode', + test: isObjectNode + }, { + name: 'OperatorNode', + test: isOperatorNode + }, { + name: 'ParenthesisNode', + test: isParenthesisNode + }, { + name: 'RangeNode', + test: isRangeNode + }, { + name: 'RelationalNode', + test: isRelationalNode + }, { + name: 'SymbolNode', + test: isSymbolNode + }, { + name: 'Map', + test: isMap + }, { + name: 'Object', + test: isObject + } // order 'Object' last, it matches on other classes too + ]); + typed.addConversions([{ + from: 'number', + to: 'BigNumber', + convert: function convert(x) { + if (!BigNumber) { + throwNoBignumber(x); + } + + // note: conversion from number to BigNumber can fail if x has >15 digits + if (digits(x) > 15) { + throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.'); + } + return new BigNumber(x); + } + }, { + from: 'number', + to: 'Complex', + convert: function convert(x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x, 0); + } + }, { + from: 'BigNumber', + to: 'Complex', + convert: function convert(x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x.toNumber(), 0); + } + }, { + from: 'bigint', + to: 'number', + convert: function convert(x) { + if (x > Number.MAX_SAFE_INTEGER) { + throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')'); + } + return Number(x); + } + }, { + from: 'bigint', + to: 'BigNumber', + convert: function convert(x) { + if (!BigNumber) { + throwNoBignumber(x); + } + return new BigNumber(x.toString()); + } + }, { + from: 'bigint', + to: 'Fraction', + convert: function convert(x) { + if (!Fraction) { + throwNoFraction(x); + } + return new Fraction(x.toString()); + } + }, { + from: 'Fraction', + to: 'BigNumber', + convert: function convert(x) { + throw new TypeError('Cannot implicitly convert a Fraction to BigNumber or vice versa. ' + 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.'); + } + }, { + from: 'Fraction', + to: 'Complex', + convert: function convert(x) { + if (!Complex) { + throwNoComplex(x); + } + return new Complex(x.valueOf(), 0); + } + }, { + from: 'number', + to: 'Fraction', + convert: function convert(x) { + if (!Fraction) { + throwNoFraction(x); + } + var f = new Fraction(x); + if (f.valueOf() !== x) { + throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.'); + } + return f; + } + }, { + // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))` + // from: 'Fraction', + // to: 'number', + // convert: function (x) { + // return x.valueOf() + // } + // }, { + from: 'string', + to: 'number', + convert: function convert(x) { + var n = Number(x); + if (isNaN(n)) { + throw new Error('Cannot convert "' + x + '" to a number'); + } + return n; + } + }, { + from: 'string', + to: 'BigNumber', + convert: function convert(x) { + if (!BigNumber) { + throwNoBignumber(x); + } + try { + return new BigNumber(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to BigNumber'); + } + } + }, { + from: 'string', + to: 'bigint', + convert: function convert(x) { + try { + return BigInt(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to BigInt'); + } + } + }, { + from: 'string', + to: 'Fraction', + convert: function convert(x) { + if (!Fraction) { + throwNoFraction(x); + } + try { + return new Fraction(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to Fraction'); + } + } + }, { + from: 'string', + to: 'Complex', + convert: function convert(x) { + if (!Complex) { + throwNoComplex(x); + } + try { + return new Complex(x); + } catch (err) { + throw new Error('Cannot convert "' + x + '" to Complex'); + } + } + }, { + from: 'boolean', + to: 'number', + convert: function convert(x) { + return +x; + } + }, { + from: 'boolean', + to: 'BigNumber', + convert: function convert(x) { + if (!BigNumber) { + throwNoBignumber(x); + } + return new BigNumber(+x); + } + }, { + from: 'boolean', + to: 'bigint', + convert: function convert(x) { + return BigInt(+x); + } + }, { + from: 'boolean', + to: 'Fraction', + convert: function convert(x) { + if (!Fraction) { + throwNoFraction(x); + } + return new Fraction(+x); + } + }, { + from: 'boolean', + to: 'string', + convert: function convert(x) { + return String(x); + } + }, { + from: 'Array', + to: 'Matrix', + convert: function convert(array) { + if (!DenseMatrix) { + throwNoMatrix(); + } + return new DenseMatrix(array); + } + }, { + from: 'Matrix', + to: 'Array', + convert: function convert(matrix) { + return matrix.valueOf(); + } + }]); + + // Provide a suggestion on how to call a function elementwise + // This was added primarily as guidance for the v10 -> v11 transition, + // and could potentially be removed in the future if it no longer seems + // to be helpful. + typed.onMismatch = (name, args, signatures) => { + var usualError = typed.createError(name, args, signatures); + if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) && + // check if the function can be unary: + signatures.some(sig => !sig.params.includes(','))) { + var err = new TypeError("Function '".concat(name, "' doesn't apply to matrices. To call it ") + "elementwise on a matrix 'M', try 'map(M, ".concat(name, ")'.")); + err.data = usualError.data; + throw err; + } + throw usualError; + }; + + // Provide a suggestion on how to call a function elementwise + // This was added primarily as guidance for the v10 -> v11 transition, + // and could potentially be removed in the future if it no longer seems + // to be helpful. + typed.onMismatch = (name, args, signatures) => { + var usualError = typed.createError(name, args, signatures); + if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) && + // check if the function can be unary: + signatures.some(sig => !sig.params.includes(','))) { + var err = new TypeError("Function '".concat(name, "' doesn't apply to matrices. To call it ") + "elementwise on a matrix 'M', try 'map(M, ".concat(name, ")'.")); + err.data = usualError.data; + throw err; + } + throw usualError; + }; + return typed; +}); +function throwNoBignumber(x) { + throw new Error("Cannot convert value ".concat(x, " into a BigNumber: no class 'BigNumber' provided")); +} +function throwNoComplex(x) { + throw new Error("Cannot convert value ".concat(x, " into a Complex number: no class 'Complex' provided")); +} +function throwNoMatrix() { + throw new Error('Cannot convert array into a Matrix: no class \'DenseMatrix\' provided'); +} +function throwNoFraction(x) { + throw new Error("Cannot convert value ".concat(x, " into a Fraction, no class 'Fraction' provided.")); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/defaultInstance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/defaultInstance.js new file mode 100644 index 0000000..630e984 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/defaultInstance.js @@ -0,0 +1,3 @@ +import * as all from './factoriesAny.js'; +import { create } from './core/create.js'; +export default create(all); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js new file mode 100644 index 0000000..b4e11fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js @@ -0,0 +1,3 @@ +// creating all factories here in a separate file is needed to get tree-shaking working +import * as allFactories from '../factoriesAny.js'; +export var all = allFactories; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js new file mode 100644 index 0000000..e4221a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js @@ -0,0 +1,3 @@ +// creating all factories here in a separate file is needed to get tree-shaking working +import * as allFactories from '../factoriesNumber.js'; +export var all = allFactories; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/configReadonly.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/configReadonly.js new file mode 100644 index 0000000..c6f5702 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/configReadonly.js @@ -0,0 +1,15 @@ +import _extends from "@babel/runtime/helpers/extends"; +import { DEFAULT_CONFIG } from '../core/config.js'; +import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config.js'; + +// create a read-only version of config +export var config = function config(options) { + if (options) { + throw new Error('The global config is readonly. \n' + 'Please create a mathjs instance if you want to change the default configuration. \n' + 'Example:\n' + '\n' + ' import { create, all } from \'mathjs\';\n' + ' const mathjs = create(all);\n' + ' mathjs.config({ number: \'BigNumber\' });\n'); + } + return Object.freeze(DEFAULT_CONFIG); +}; +_extends(config, DEFAULT_CONFIG, { + MATRIX_OPTIONS, + NUMBER_OPTIONS +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js new file mode 100644 index 0000000..be73c38 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js @@ -0,0 +1,367 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +export { absDependencies } from './dependenciesAny/dependenciesAbs.generated.js'; +export { AccessorNodeDependencies } from './dependenciesAny/dependenciesAccessorNode.generated.js'; +export { acosDependencies } from './dependenciesAny/dependenciesAcos.generated.js'; +export { acoshDependencies } from './dependenciesAny/dependenciesAcosh.generated.js'; +export { acotDependencies } from './dependenciesAny/dependenciesAcot.generated.js'; +export { acothDependencies } from './dependenciesAny/dependenciesAcoth.generated.js'; +export { acscDependencies } from './dependenciesAny/dependenciesAcsc.generated.js'; +export { acschDependencies } from './dependenciesAny/dependenciesAcsch.generated.js'; +export { addDependencies } from './dependenciesAny/dependenciesAdd.generated.js'; +export { addScalarDependencies } from './dependenciesAny/dependenciesAddScalar.generated.js'; +export { andDependencies } from './dependenciesAny/dependenciesAnd.generated.js'; +export { andTransformDependencies } from './dependenciesAny/dependenciesAndTransform.generated.js'; +export { applyDependencies } from './dependenciesAny/dependenciesApply.generated.js'; +export { applyTransformDependencies } from './dependenciesAny/dependenciesApplyTransform.generated.js'; +export { argDependencies } from './dependenciesAny/dependenciesArg.generated.js'; +export { ArrayNodeDependencies } from './dependenciesAny/dependenciesArrayNode.generated.js'; +export { asecDependencies } from './dependenciesAny/dependenciesAsec.generated.js'; +export { asechDependencies } from './dependenciesAny/dependenciesAsech.generated.js'; +export { asinDependencies } from './dependenciesAny/dependenciesAsin.generated.js'; +export { asinhDependencies } from './dependenciesAny/dependenciesAsinh.generated.js'; +export { AssignmentNodeDependencies } from './dependenciesAny/dependenciesAssignmentNode.generated.js'; +export { atanDependencies } from './dependenciesAny/dependenciesAtan.generated.js'; +export { atan2Dependencies } from './dependenciesAny/dependenciesAtan2.generated.js'; +export { atanhDependencies } from './dependenciesAny/dependenciesAtanh.generated.js'; +export { atomicMassDependencies } from './dependenciesAny/dependenciesAtomicMass.generated.js'; +export { avogadroDependencies } from './dependenciesAny/dependenciesAvogadro.generated.js'; +export { bellNumbersDependencies } from './dependenciesAny/dependenciesBellNumbers.generated.js'; +export { BigNumberDependencies } from './dependenciesAny/dependenciesBigNumberClass.generated.js'; +export { bigintDependencies } from './dependenciesAny/dependenciesBigint.generated.js'; +export { bignumberDependencies } from './dependenciesAny/dependenciesBignumber.generated.js'; +export { binDependencies } from './dependenciesAny/dependenciesBin.generated.js'; +export { bitAndDependencies } from './dependenciesAny/dependenciesBitAnd.generated.js'; +export { bitAndTransformDependencies } from './dependenciesAny/dependenciesBitAndTransform.generated.js'; +export { bitNotDependencies } from './dependenciesAny/dependenciesBitNot.generated.js'; +export { bitOrDependencies } from './dependenciesAny/dependenciesBitOr.generated.js'; +export { bitOrTransformDependencies } from './dependenciesAny/dependenciesBitOrTransform.generated.js'; +export { bitXorDependencies } from './dependenciesAny/dependenciesBitXor.generated.js'; +export { BlockNodeDependencies } from './dependenciesAny/dependenciesBlockNode.generated.js'; +export { bohrMagnetonDependencies } from './dependenciesAny/dependenciesBohrMagneton.generated.js'; +export { bohrRadiusDependencies } from './dependenciesAny/dependenciesBohrRadius.generated.js'; +export { boltzmannDependencies } from './dependenciesAny/dependenciesBoltzmann.generated.js'; +export { booleanDependencies } from './dependenciesAny/dependenciesBoolean.generated.js'; +export { catalanDependencies } from './dependenciesAny/dependenciesCatalan.generated.js'; +export { cbrtDependencies } from './dependenciesAny/dependenciesCbrt.generated.js'; +export { ceilDependencies } from './dependenciesAny/dependenciesCeil.generated.js'; +export { chainDependencies } from './dependenciesAny/dependenciesChain.generated.js'; +export { ChainDependencies } from './dependenciesAny/dependenciesChainClass.generated.js'; +export { classicalElectronRadiusDependencies } from './dependenciesAny/dependenciesClassicalElectronRadius.generated.js'; +export { cloneDependencies } from './dependenciesAny/dependenciesClone.generated.js'; +export { columnDependencies } from './dependenciesAny/dependenciesColumn.generated.js'; +export { columnTransformDependencies } from './dependenciesAny/dependenciesColumnTransform.generated.js'; +export { combinationsDependencies } from './dependenciesAny/dependenciesCombinations.generated.js'; +export { combinationsWithRepDependencies } from './dependenciesAny/dependenciesCombinationsWithRep.generated.js'; +export { compareDependencies } from './dependenciesAny/dependenciesCompare.generated.js'; +export { compareNaturalDependencies } from './dependenciesAny/dependenciesCompareNatural.generated.js'; +export { compareTextDependencies } from './dependenciesAny/dependenciesCompareText.generated.js'; +export { compileDependencies } from './dependenciesAny/dependenciesCompile.generated.js'; +export { complexDependencies } from './dependenciesAny/dependenciesComplex.generated.js'; +export { ComplexDependencies } from './dependenciesAny/dependenciesComplexClass.generated.js'; +export { compositionDependencies } from './dependenciesAny/dependenciesComposition.generated.js'; +export { concatDependencies } from './dependenciesAny/dependenciesConcat.generated.js'; +export { concatTransformDependencies } from './dependenciesAny/dependenciesConcatTransform.generated.js'; +export { ConditionalNodeDependencies } from './dependenciesAny/dependenciesConditionalNode.generated.js'; +export { conductanceQuantumDependencies } from './dependenciesAny/dependenciesConductanceQuantum.generated.js'; +export { conjDependencies } from './dependenciesAny/dependenciesConj.generated.js'; +export { ConstantNodeDependencies } from './dependenciesAny/dependenciesConstantNode.generated.js'; +export { corrDependencies } from './dependenciesAny/dependenciesCorr.generated.js'; +export { cosDependencies } from './dependenciesAny/dependenciesCos.generated.js'; +export { coshDependencies } from './dependenciesAny/dependenciesCosh.generated.js'; +export { cotDependencies } from './dependenciesAny/dependenciesCot.generated.js'; +export { cothDependencies } from './dependenciesAny/dependenciesCoth.generated.js'; +export { coulombDependencies } from './dependenciesAny/dependenciesCoulomb.generated.js'; +export { countDependencies } from './dependenciesAny/dependenciesCount.generated.js'; +export { createUnitDependencies } from './dependenciesAny/dependenciesCreateUnit.generated.js'; +export { crossDependencies } from './dependenciesAny/dependenciesCross.generated.js'; +export { cscDependencies } from './dependenciesAny/dependenciesCsc.generated.js'; +export { cschDependencies } from './dependenciesAny/dependenciesCsch.generated.js'; +export { ctransposeDependencies } from './dependenciesAny/dependenciesCtranspose.generated.js'; +export { cubeDependencies } from './dependenciesAny/dependenciesCube.generated.js'; +export { cumsumDependencies } from './dependenciesAny/dependenciesCumSum.generated.js'; +export { cumsumTransformDependencies } from './dependenciesAny/dependenciesCumSumTransform.generated.js'; +export { deepEqualDependencies } from './dependenciesAny/dependenciesDeepEqual.generated.js'; +export { DenseMatrixDependencies } from './dependenciesAny/dependenciesDenseMatrixClass.generated.js'; +export { derivativeDependencies } from './dependenciesAny/dependenciesDerivative.generated.js'; +export { detDependencies } from './dependenciesAny/dependenciesDet.generated.js'; +export { deuteronMassDependencies } from './dependenciesAny/dependenciesDeuteronMass.generated.js'; +export { diagDependencies } from './dependenciesAny/dependenciesDiag.generated.js'; +export { diffDependencies } from './dependenciesAny/dependenciesDiff.generated.js'; +export { diffTransformDependencies } from './dependenciesAny/dependenciesDiffTransform.generated.js'; +export { distanceDependencies } from './dependenciesAny/dependenciesDistance.generated.js'; +export { divideDependencies } from './dependenciesAny/dependenciesDivide.generated.js'; +export { divideScalarDependencies } from './dependenciesAny/dependenciesDivideScalar.generated.js'; +export { dotDependencies } from './dependenciesAny/dependenciesDot.generated.js'; +export { dotDivideDependencies } from './dependenciesAny/dependenciesDotDivide.generated.js'; +export { dotMultiplyDependencies } from './dependenciesAny/dependenciesDotMultiply.generated.js'; +export { dotPowDependencies } from './dependenciesAny/dependenciesDotPow.generated.js'; +export { eDependencies } from './dependenciesAny/dependenciesE.generated.js'; +export { efimovFactorDependencies } from './dependenciesAny/dependenciesEfimovFactor.generated.js'; +export { eigsDependencies } from './dependenciesAny/dependenciesEigs.generated.js'; +export { electricConstantDependencies } from './dependenciesAny/dependenciesElectricConstant.generated.js'; +export { electronMassDependencies } from './dependenciesAny/dependenciesElectronMass.generated.js'; +export { elementaryChargeDependencies } from './dependenciesAny/dependenciesElementaryCharge.generated.js'; +export { equalDependencies } from './dependenciesAny/dependenciesEqual.generated.js'; +export { equalScalarDependencies } from './dependenciesAny/dependenciesEqualScalar.generated.js'; +export { equalTextDependencies } from './dependenciesAny/dependenciesEqualText.generated.js'; +export { erfDependencies } from './dependenciesAny/dependenciesErf.generated.js'; +export { evaluateDependencies } from './dependenciesAny/dependenciesEvaluate.generated.js'; +export { expDependencies } from './dependenciesAny/dependenciesExp.generated.js'; +export { expmDependencies } from './dependenciesAny/dependenciesExpm.generated.js'; +export { expm1Dependencies } from './dependenciesAny/dependenciesExpm1.generated.js'; +export { factorialDependencies } from './dependenciesAny/dependenciesFactorial.generated.js'; +export { falseDependencies } from './dependenciesAny/dependenciesFalse.generated.js'; +export { faradayDependencies } from './dependenciesAny/dependenciesFaraday.generated.js'; +export { fermiCouplingDependencies } from './dependenciesAny/dependenciesFermiCoupling.generated.js'; +export { fftDependencies } from './dependenciesAny/dependenciesFft.generated.js'; +export { FibonacciHeapDependencies } from './dependenciesAny/dependenciesFibonacciHeapClass.generated.js'; +export { filterDependencies } from './dependenciesAny/dependenciesFilter.generated.js'; +export { filterTransformDependencies } from './dependenciesAny/dependenciesFilterTransform.generated.js'; +export { fineStructureDependencies } from './dependenciesAny/dependenciesFineStructure.generated.js'; +export { firstRadiationDependencies } from './dependenciesAny/dependenciesFirstRadiation.generated.js'; +export { fixDependencies } from './dependenciesAny/dependenciesFix.generated.js'; +export { flattenDependencies } from './dependenciesAny/dependenciesFlatten.generated.js'; +export { floorDependencies } from './dependenciesAny/dependenciesFloor.generated.js'; +export { forEachDependencies } from './dependenciesAny/dependenciesForEach.generated.js'; +export { forEachTransformDependencies } from './dependenciesAny/dependenciesForEachTransform.generated.js'; +export { formatDependencies } from './dependenciesAny/dependenciesFormat.generated.js'; +export { fractionDependencies } from './dependenciesAny/dependenciesFraction.generated.js'; +export { FractionDependencies } from './dependenciesAny/dependenciesFractionClass.generated.js'; +export { freqzDependencies } from './dependenciesAny/dependenciesFreqz.generated.js'; +export { FunctionAssignmentNodeDependencies } from './dependenciesAny/dependenciesFunctionAssignmentNode.generated.js'; +export { FunctionNodeDependencies } from './dependenciesAny/dependenciesFunctionNode.generated.js'; +export { gammaDependencies } from './dependenciesAny/dependenciesGamma.generated.js'; +export { gasConstantDependencies } from './dependenciesAny/dependenciesGasConstant.generated.js'; +export { gcdDependencies } from './dependenciesAny/dependenciesGcd.generated.js'; +export { getMatrixDataTypeDependencies } from './dependenciesAny/dependenciesGetMatrixDataType.generated.js'; +export { gravitationConstantDependencies } from './dependenciesAny/dependenciesGravitationConstant.generated.js'; +export { gravityDependencies } from './dependenciesAny/dependenciesGravity.generated.js'; +export { hartreeEnergyDependencies } from './dependenciesAny/dependenciesHartreeEnergy.generated.js'; +export { hasNumericValueDependencies } from './dependenciesAny/dependenciesHasNumericValue.generated.js'; +export { helpDependencies } from './dependenciesAny/dependenciesHelp.generated.js'; +export { HelpDependencies } from './dependenciesAny/dependenciesHelpClass.generated.js'; +export { hexDependencies } from './dependenciesAny/dependenciesHex.generated.js'; +export { hypotDependencies } from './dependenciesAny/dependenciesHypot.generated.js'; +export { iDependencies } from './dependenciesAny/dependenciesI.generated.js'; +export { identityDependencies } from './dependenciesAny/dependenciesIdentity.generated.js'; +export { ifftDependencies } from './dependenciesAny/dependenciesIfft.generated.js'; +export { imDependencies } from './dependenciesAny/dependenciesIm.generated.js'; +export { ImmutableDenseMatrixDependencies } from './dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js'; +export { indexDependencies } from './dependenciesAny/dependenciesIndex.generated.js'; +export { IndexDependencies } from './dependenciesAny/dependenciesIndexClass.generated.js'; +export { IndexNodeDependencies } from './dependenciesAny/dependenciesIndexNode.generated.js'; +export { indexTransformDependencies } from './dependenciesAny/dependenciesIndexTransform.generated.js'; +export { InfinityDependencies } from './dependenciesAny/dependenciesInfinity.generated.js'; +export { intersectDependencies } from './dependenciesAny/dependenciesIntersect.generated.js'; +export { invDependencies } from './dependenciesAny/dependenciesInv.generated.js'; +export { inverseConductanceQuantumDependencies } from './dependenciesAny/dependenciesInverseConductanceQuantum.generated.js'; +export { invmodDependencies } from './dependenciesAny/dependenciesInvmod.generated.js'; +export { isIntegerDependencies } from './dependenciesAny/dependenciesIsInteger.generated.js'; +export { isNaNDependencies } from './dependenciesAny/dependenciesIsNaN.generated.js'; +export { isNegativeDependencies } from './dependenciesAny/dependenciesIsNegative.generated.js'; +export { isNumericDependencies } from './dependenciesAny/dependenciesIsNumeric.generated.js'; +export { isPositiveDependencies } from './dependenciesAny/dependenciesIsPositive.generated.js'; +export { isPrimeDependencies } from './dependenciesAny/dependenciesIsPrime.generated.js'; +export { isZeroDependencies } from './dependenciesAny/dependenciesIsZero.generated.js'; +export { kldivergenceDependencies } from './dependenciesAny/dependenciesKldivergence.generated.js'; +export { klitzingDependencies } from './dependenciesAny/dependenciesKlitzing.generated.js'; +export { kronDependencies } from './dependenciesAny/dependenciesKron.generated.js'; +export { LN10Dependencies } from './dependenciesAny/dependenciesLN10.generated.js'; +export { LN2Dependencies } from './dependenciesAny/dependenciesLN2.generated.js'; +export { LOG10EDependencies } from './dependenciesAny/dependenciesLOG10E.generated.js'; +export { LOG2EDependencies } from './dependenciesAny/dependenciesLOG2E.generated.js'; +export { largerDependencies } from './dependenciesAny/dependenciesLarger.generated.js'; +export { largerEqDependencies } from './dependenciesAny/dependenciesLargerEq.generated.js'; +export { lcmDependencies } from './dependenciesAny/dependenciesLcm.generated.js'; +export { leafCountDependencies } from './dependenciesAny/dependenciesLeafCount.generated.js'; +export { leftShiftDependencies } from './dependenciesAny/dependenciesLeftShift.generated.js'; +export { lgammaDependencies } from './dependenciesAny/dependenciesLgamma.generated.js'; +export { logDependencies } from './dependenciesAny/dependenciesLog.generated.js'; +export { log10Dependencies } from './dependenciesAny/dependenciesLog10.generated.js'; +export { log1pDependencies } from './dependenciesAny/dependenciesLog1p.generated.js'; +export { log2Dependencies } from './dependenciesAny/dependenciesLog2.generated.js'; +export { loschmidtDependencies } from './dependenciesAny/dependenciesLoschmidt.generated.js'; +export { lsolveDependencies } from './dependenciesAny/dependenciesLsolve.generated.js'; +export { lsolveAllDependencies } from './dependenciesAny/dependenciesLsolveAll.generated.js'; +export { lupDependencies } from './dependenciesAny/dependenciesLup.generated.js'; +export { lusolveDependencies } from './dependenciesAny/dependenciesLusolve.generated.js'; +export { lyapDependencies } from './dependenciesAny/dependenciesLyap.generated.js'; +export { madDependencies } from './dependenciesAny/dependenciesMad.generated.js'; +export { magneticConstantDependencies } from './dependenciesAny/dependenciesMagneticConstant.generated.js'; +export { magneticFluxQuantumDependencies } from './dependenciesAny/dependenciesMagneticFluxQuantum.generated.js'; +export { mapDependencies } from './dependenciesAny/dependenciesMap.generated.js'; +export { mapTransformDependencies } from './dependenciesAny/dependenciesMapTransform.generated.js'; +export { matrixDependencies } from './dependenciesAny/dependenciesMatrix.generated.js'; +export { MatrixDependencies } from './dependenciesAny/dependenciesMatrixClass.generated.js'; +export { matrixFromColumnsDependencies } from './dependenciesAny/dependenciesMatrixFromColumns.generated.js'; +export { matrixFromFunctionDependencies } from './dependenciesAny/dependenciesMatrixFromFunction.generated.js'; +export { matrixFromRowsDependencies } from './dependenciesAny/dependenciesMatrixFromRows.generated.js'; +export { maxDependencies } from './dependenciesAny/dependenciesMax.generated.js'; +export { maxTransformDependencies } from './dependenciesAny/dependenciesMaxTransform.generated.js'; +export { meanDependencies } from './dependenciesAny/dependenciesMean.generated.js'; +export { meanTransformDependencies } from './dependenciesAny/dependenciesMeanTransform.generated.js'; +export { medianDependencies } from './dependenciesAny/dependenciesMedian.generated.js'; +export { minDependencies } from './dependenciesAny/dependenciesMin.generated.js'; +export { minTransformDependencies } from './dependenciesAny/dependenciesMinTransform.generated.js'; +export { modDependencies } from './dependenciesAny/dependenciesMod.generated.js'; +export { modeDependencies } from './dependenciesAny/dependenciesMode.generated.js'; +export { molarMassDependencies } from './dependenciesAny/dependenciesMolarMass.generated.js'; +export { molarMassC12Dependencies } from './dependenciesAny/dependenciesMolarMassC12.generated.js'; +export { molarPlanckConstantDependencies } from './dependenciesAny/dependenciesMolarPlanckConstant.generated.js'; +export { molarVolumeDependencies } from './dependenciesAny/dependenciesMolarVolume.generated.js'; +export { multinomialDependencies } from './dependenciesAny/dependenciesMultinomial.generated.js'; +export { multiplyDependencies } from './dependenciesAny/dependenciesMultiply.generated.js'; +export { multiplyScalarDependencies } from './dependenciesAny/dependenciesMultiplyScalar.generated.js'; +export { NaNDependencies } from './dependenciesAny/dependenciesNaN.generated.js'; +export { neutronMassDependencies } from './dependenciesAny/dependenciesNeutronMass.generated.js'; +export { NodeDependencies } from './dependenciesAny/dependenciesNode.generated.js'; +export { normDependencies } from './dependenciesAny/dependenciesNorm.generated.js'; +export { notDependencies } from './dependenciesAny/dependenciesNot.generated.js'; +export { nthRootDependencies } from './dependenciesAny/dependenciesNthRoot.generated.js'; +export { nthRootsDependencies } from './dependenciesAny/dependenciesNthRoots.generated.js'; +export { nuclearMagnetonDependencies } from './dependenciesAny/dependenciesNuclearMagneton.generated.js'; +export { nullDependencies } from './dependenciesAny/dependenciesNull.generated.js'; +export { numberDependencies } from './dependenciesAny/dependenciesNumber.generated.js'; +export { numericDependencies } from './dependenciesAny/dependenciesNumeric.generated.js'; +export { ObjectNodeDependencies } from './dependenciesAny/dependenciesObjectNode.generated.js'; +export { octDependencies } from './dependenciesAny/dependenciesOct.generated.js'; +export { onesDependencies } from './dependenciesAny/dependenciesOnes.generated.js'; +export { OperatorNodeDependencies } from './dependenciesAny/dependenciesOperatorNode.generated.js'; +export { orDependencies } from './dependenciesAny/dependenciesOr.generated.js'; +export { orTransformDependencies } from './dependenciesAny/dependenciesOrTransform.generated.js'; +export { ParenthesisNodeDependencies } from './dependenciesAny/dependenciesParenthesisNode.generated.js'; +export { parseDependencies } from './dependenciesAny/dependenciesParse.generated.js'; +export { parserDependencies } from './dependenciesAny/dependenciesParser.generated.js'; +export { ParserDependencies } from './dependenciesAny/dependenciesParserClass.generated.js'; +export { partitionSelectDependencies } from './dependenciesAny/dependenciesPartitionSelect.generated.js'; +export { permutationsDependencies } from './dependenciesAny/dependenciesPermutations.generated.js'; +export { phiDependencies } from './dependenciesAny/dependenciesPhi.generated.js'; +export { piDependencies } from './dependenciesAny/dependenciesPi.generated.js'; +export { pickRandomDependencies } from './dependenciesAny/dependenciesPickRandom.generated.js'; +export { pinvDependencies } from './dependenciesAny/dependenciesPinv.generated.js'; +export { planckChargeDependencies } from './dependenciesAny/dependenciesPlanckCharge.generated.js'; +export { planckConstantDependencies } from './dependenciesAny/dependenciesPlanckConstant.generated.js'; +export { planckLengthDependencies } from './dependenciesAny/dependenciesPlanckLength.generated.js'; +export { planckMassDependencies } from './dependenciesAny/dependenciesPlanckMass.generated.js'; +export { planckTemperatureDependencies } from './dependenciesAny/dependenciesPlanckTemperature.generated.js'; +export { planckTimeDependencies } from './dependenciesAny/dependenciesPlanckTime.generated.js'; +export { polynomialRootDependencies } from './dependenciesAny/dependenciesPolynomialRoot.generated.js'; +export { powDependencies } from './dependenciesAny/dependenciesPow.generated.js'; +export { printDependencies } from './dependenciesAny/dependenciesPrint.generated.js'; +export { printTransformDependencies } from './dependenciesAny/dependenciesPrintTransform.generated.js'; +export { prodDependencies } from './dependenciesAny/dependenciesProd.generated.js'; +export { protonMassDependencies } from './dependenciesAny/dependenciesProtonMass.generated.js'; +export { qrDependencies } from './dependenciesAny/dependenciesQr.generated.js'; +export { quantileSeqDependencies } from './dependenciesAny/dependenciesQuantileSeq.generated.js'; +export { quantileSeqTransformDependencies } from './dependenciesAny/dependenciesQuantileSeqTransform.generated.js'; +export { quantumOfCirculationDependencies } from './dependenciesAny/dependenciesQuantumOfCirculation.generated.js'; +export { randomDependencies } from './dependenciesAny/dependenciesRandom.generated.js'; +export { randomIntDependencies } from './dependenciesAny/dependenciesRandomInt.generated.js'; +export { rangeDependencies } from './dependenciesAny/dependenciesRange.generated.js'; +export { RangeDependencies } from './dependenciesAny/dependenciesRangeClass.generated.js'; +export { RangeNodeDependencies } from './dependenciesAny/dependenciesRangeNode.generated.js'; +export { rangeTransformDependencies } from './dependenciesAny/dependenciesRangeTransform.generated.js'; +export { rationalizeDependencies } from './dependenciesAny/dependenciesRationalize.generated.js'; +export { reDependencies } from './dependenciesAny/dependenciesRe.generated.js'; +export { reducedPlanckConstantDependencies } from './dependenciesAny/dependenciesReducedPlanckConstant.generated.js'; +export { RelationalNodeDependencies } from './dependenciesAny/dependenciesRelationalNode.generated.js'; +export { replacerDependencies } from './dependenciesAny/dependenciesReplacer.generated.js'; +export { reshapeDependencies } from './dependenciesAny/dependenciesReshape.generated.js'; +export { resizeDependencies } from './dependenciesAny/dependenciesResize.generated.js'; +export { resolveDependencies } from './dependenciesAny/dependenciesResolve.generated.js'; +export { ResultSetDependencies } from './dependenciesAny/dependenciesResultSet.generated.js'; +export { reviverDependencies } from './dependenciesAny/dependenciesReviver.generated.js'; +export { rightArithShiftDependencies } from './dependenciesAny/dependenciesRightArithShift.generated.js'; +export { rightLogShiftDependencies } from './dependenciesAny/dependenciesRightLogShift.generated.js'; +export { rotateDependencies } from './dependenciesAny/dependenciesRotate.generated.js'; +export { rotationMatrixDependencies } from './dependenciesAny/dependenciesRotationMatrix.generated.js'; +export { roundDependencies } from './dependenciesAny/dependenciesRound.generated.js'; +export { rowDependencies } from './dependenciesAny/dependenciesRow.generated.js'; +export { rowTransformDependencies } from './dependenciesAny/dependenciesRowTransform.generated.js'; +export { rydbergDependencies } from './dependenciesAny/dependenciesRydberg.generated.js'; +export { SQRT1_2Dependencies } from './dependenciesAny/dependenciesSQRT1_2.generated.js'; // eslint-disable-line camelcase +export { SQRT2Dependencies } from './dependenciesAny/dependenciesSQRT2.generated.js'; +export { sackurTetrodeDependencies } from './dependenciesAny/dependenciesSackurTetrode.generated.js'; +export { schurDependencies } from './dependenciesAny/dependenciesSchur.generated.js'; +export { secDependencies } from './dependenciesAny/dependenciesSec.generated.js'; +export { sechDependencies } from './dependenciesAny/dependenciesSech.generated.js'; +export { secondRadiationDependencies } from './dependenciesAny/dependenciesSecondRadiation.generated.js'; +export { setCartesianDependencies } from './dependenciesAny/dependenciesSetCartesian.generated.js'; +export { setDifferenceDependencies } from './dependenciesAny/dependenciesSetDifference.generated.js'; +export { setDistinctDependencies } from './dependenciesAny/dependenciesSetDistinct.generated.js'; +export { setIntersectDependencies } from './dependenciesAny/dependenciesSetIntersect.generated.js'; +export { setIsSubsetDependencies } from './dependenciesAny/dependenciesSetIsSubset.generated.js'; +export { setMultiplicityDependencies } from './dependenciesAny/dependenciesSetMultiplicity.generated.js'; +export { setPowersetDependencies } from './dependenciesAny/dependenciesSetPowerset.generated.js'; +export { setSizeDependencies } from './dependenciesAny/dependenciesSetSize.generated.js'; +export { setSymDifferenceDependencies } from './dependenciesAny/dependenciesSetSymDifference.generated.js'; +export { setUnionDependencies } from './dependenciesAny/dependenciesSetUnion.generated.js'; +export { signDependencies } from './dependenciesAny/dependenciesSign.generated.js'; +export { simplifyDependencies } from './dependenciesAny/dependenciesSimplify.generated.js'; +export { simplifyConstantDependencies } from './dependenciesAny/dependenciesSimplifyConstant.generated.js'; +export { simplifyCoreDependencies } from './dependenciesAny/dependenciesSimplifyCore.generated.js'; +export { sinDependencies } from './dependenciesAny/dependenciesSin.generated.js'; +export { sinhDependencies } from './dependenciesAny/dependenciesSinh.generated.js'; +export { sizeDependencies } from './dependenciesAny/dependenciesSize.generated.js'; +export { sluDependencies } from './dependenciesAny/dependenciesSlu.generated.js'; +export { smallerDependencies } from './dependenciesAny/dependenciesSmaller.generated.js'; +export { smallerEqDependencies } from './dependenciesAny/dependenciesSmallerEq.generated.js'; +export { solveODEDependencies } from './dependenciesAny/dependenciesSolveODE.generated.js'; +export { sortDependencies } from './dependenciesAny/dependenciesSort.generated.js'; +export { SpaDependencies } from './dependenciesAny/dependenciesSpaClass.generated.js'; +export { sparseDependencies } from './dependenciesAny/dependenciesSparse.generated.js'; +export { SparseMatrixDependencies } from './dependenciesAny/dependenciesSparseMatrixClass.generated.js'; +export { speedOfLightDependencies } from './dependenciesAny/dependenciesSpeedOfLight.generated.js'; +export { splitUnitDependencies } from './dependenciesAny/dependenciesSplitUnit.generated.js'; +export { sqrtDependencies } from './dependenciesAny/dependenciesSqrt.generated.js'; +export { sqrtmDependencies } from './dependenciesAny/dependenciesSqrtm.generated.js'; +export { squareDependencies } from './dependenciesAny/dependenciesSquare.generated.js'; +export { squeezeDependencies } from './dependenciesAny/dependenciesSqueeze.generated.js'; +export { stdDependencies } from './dependenciesAny/dependenciesStd.generated.js'; +export { stdTransformDependencies } from './dependenciesAny/dependenciesStdTransform.generated.js'; +export { stefanBoltzmannDependencies } from './dependenciesAny/dependenciesStefanBoltzmann.generated.js'; +export { stirlingS2Dependencies } from './dependenciesAny/dependenciesStirlingS2.generated.js'; +export { stringDependencies } from './dependenciesAny/dependenciesString.generated.js'; +export { subsetDependencies } from './dependenciesAny/dependenciesSubset.generated.js'; +export { subsetTransformDependencies } from './dependenciesAny/dependenciesSubsetTransform.generated.js'; +export { subtractDependencies } from './dependenciesAny/dependenciesSubtract.generated.js'; +export { subtractScalarDependencies } from './dependenciesAny/dependenciesSubtractScalar.generated.js'; +export { sumDependencies } from './dependenciesAny/dependenciesSum.generated.js'; +export { sumTransformDependencies } from './dependenciesAny/dependenciesSumTransform.generated.js'; +export { sylvesterDependencies } from './dependenciesAny/dependenciesSylvester.generated.js'; +export { SymbolNodeDependencies } from './dependenciesAny/dependenciesSymbolNode.generated.js'; +export { symbolicEqualDependencies } from './dependenciesAny/dependenciesSymbolicEqual.generated.js'; +export { tanDependencies } from './dependenciesAny/dependenciesTan.generated.js'; +export { tanhDependencies } from './dependenciesAny/dependenciesTanh.generated.js'; +export { tauDependencies } from './dependenciesAny/dependenciesTau.generated.js'; +export { thomsonCrossSectionDependencies } from './dependenciesAny/dependenciesThomsonCrossSection.generated.js'; +export { toDependencies } from './dependenciesAny/dependenciesTo.generated.js'; +export { traceDependencies } from './dependenciesAny/dependenciesTrace.generated.js'; +export { transposeDependencies } from './dependenciesAny/dependenciesTranspose.generated.js'; +export { trueDependencies } from './dependenciesAny/dependenciesTrue.generated.js'; +export { typeOfDependencies } from './dependenciesAny/dependenciesTypeOf.generated.js'; +export { typedDependencies } from './dependenciesAny/dependenciesTyped.generated.js'; +export { unaryMinusDependencies } from './dependenciesAny/dependenciesUnaryMinus.generated.js'; +export { unaryPlusDependencies } from './dependenciesAny/dependenciesUnaryPlus.generated.js'; +export { unequalDependencies } from './dependenciesAny/dependenciesUnequal.generated.js'; +export { UnitDependencies } from './dependenciesAny/dependenciesUnitClass.generated.js'; +export { unitDependencies } from './dependenciesAny/dependenciesUnitFunction.generated.js'; +export { EDependencies } from './dependenciesAny/dependenciesUppercaseE.generated.js'; +export { PIDependencies } from './dependenciesAny/dependenciesUppercasePi.generated.js'; +export { usolveDependencies } from './dependenciesAny/dependenciesUsolve.generated.js'; +export { usolveAllDependencies } from './dependenciesAny/dependenciesUsolveAll.generated.js'; +export { vacuumImpedanceDependencies } from './dependenciesAny/dependenciesVacuumImpedance.generated.js'; +export { varianceDependencies } from './dependenciesAny/dependenciesVariance.generated.js'; +export { varianceTransformDependencies } from './dependenciesAny/dependenciesVarianceTransform.generated.js'; +export { versionDependencies } from './dependenciesAny/dependenciesVersion.generated.js'; +export { weakMixingAngleDependencies } from './dependenciesAny/dependenciesWeakMixingAngle.generated.js'; +export { wienDisplacementDependencies } from './dependenciesAny/dependenciesWienDisplacement.generated.js'; +export { xgcdDependencies } from './dependenciesAny/dependenciesXgcd.generated.js'; +export { xorDependencies } from './dependenciesAny/dependenciesXor.generated.js'; +export { zerosDependencies } from './dependenciesAny/dependenciesZeros.generated.js'; +export { zetaDependencies } from './dependenciesAny/dependenciesZeta.generated.js'; +export { zpk2tfDependencies } from './dependenciesAny/dependenciesZpk2tf.generated.js'; +export { all } from './allFactoriesAny.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js new file mode 100644 index 0000000..fd8dd2f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAbs } from '../../factoriesAny.js'; +export var absDependencies = { + typedDependencies, + createAbs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js new file mode 100644 index 0000000..08601f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { createAccessorNode } from '../../factoriesAny.js'; +export var AccessorNodeDependencies = { + NodeDependencies, + subsetDependencies, + createAccessorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js new file mode 100644 index 0000000..a88d60d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcos } from '../../factoriesAny.js'; +export var acosDependencies = { + ComplexDependencies, + typedDependencies, + createAcos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js new file mode 100644 index 0000000..f5ff7aa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcosh } from '../../factoriesAny.js'; +export var acoshDependencies = { + ComplexDependencies, + typedDependencies, + createAcosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js new file mode 100644 index 0000000..178f6a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcot } from '../../factoriesAny.js'; +export var acotDependencies = { + BigNumberDependencies, + typedDependencies, + createAcot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js new file mode 100644 index 0000000..0bc9997 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcoth } from '../../factoriesAny.js'; +export var acothDependencies = { + BigNumberDependencies, + ComplexDependencies, + typedDependencies, + createAcoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js new file mode 100644 index 0000000..cc075d4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcsc } from '../../factoriesAny.js'; +export var acscDependencies = { + BigNumberDependencies, + ComplexDependencies, + typedDependencies, + createAcsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js new file mode 100644 index 0000000..197e00b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcsch } from '../../factoriesAny.js'; +export var acschDependencies = { + BigNumberDependencies, + typedDependencies, + createAcsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js new file mode 100644 index 0000000..2806c0f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAdd } from '../../factoriesAny.js'; +export var addDependencies = { + DenseMatrixDependencies, + SparseMatrixDependencies, + addScalarDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createAdd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js new file mode 100644 index 0000000..d1cb442 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAddScalar } from '../../factoriesAny.js'; +export var addScalarDependencies = { + typedDependencies, + createAddScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js new file mode 100644 index 0000000..acc9883 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { notDependencies } from './dependenciesNot.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createAnd } from '../../factoriesAny.js'; +export var andDependencies = { + concatDependencies, + equalScalarDependencies, + matrixDependencies, + notDependencies, + typedDependencies, + zerosDependencies, + createAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js new file mode 100644 index 0000000..d22c0cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { notDependencies } from './dependenciesNot.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createAndTransform } from '../../factoriesAny.js'; +export var andTransformDependencies = { + addDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + notDependencies, + typedDependencies, + zerosDependencies, + createAndTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApply.generated.js new file mode 100644 index 0000000..46e5c78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApply.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createApply } from '../../factoriesAny.js'; +export var applyDependencies = { + isIntegerDependencies, + typedDependencies, + createApply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApplyTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApplyTransform.generated.js new file mode 100644 index 0000000..c642ad4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApplyTransform.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createApplyTransform } from '../../factoriesAny.js'; +export var applyTransformDependencies = { + isIntegerDependencies, + typedDependencies, + createApplyTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js new file mode 100644 index 0000000..6181dfe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createArg } from '../../factoriesAny.js'; +export var argDependencies = { + typedDependencies, + createArg +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js new file mode 100644 index 0000000..66403fd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createArrayNode } from '../../factoriesAny.js'; +export var ArrayNodeDependencies = { + NodeDependencies, + createArrayNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js new file mode 100644 index 0000000..3173050 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsec } from '../../factoriesAny.js'; +export var asecDependencies = { + BigNumberDependencies, + ComplexDependencies, + typedDependencies, + createAsec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js new file mode 100644 index 0000000..d061320 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsech } from '../../factoriesAny.js'; +export var asechDependencies = { + BigNumberDependencies, + ComplexDependencies, + typedDependencies, + createAsech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js new file mode 100644 index 0000000..1367635 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsin } from '../../factoriesAny.js'; +export var asinDependencies = { + ComplexDependencies, + typedDependencies, + createAsin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js new file mode 100644 index 0000000..bcce057 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsinh } from '../../factoriesAny.js'; +export var asinhDependencies = { + typedDependencies, + createAsinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js new file mode 100644 index 0000000..28d47d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { createAssignmentNode } from '../../factoriesAny.js'; +export var AssignmentNodeDependencies = { + matrixDependencies, + NodeDependencies, + subsetDependencies, + createAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js new file mode 100644 index 0000000..b9b5fcc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtan } from '../../factoriesAny.js'; +export var atanDependencies = { + typedDependencies, + createAtan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js new file mode 100644 index 0000000..9071251 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtan2 } from '../../factoriesAny.js'; +export var atan2Dependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createAtan2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js new file mode 100644 index 0000000..ab877f5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtanh } from '../../factoriesAny.js'; +export var atanhDependencies = { + ComplexDependencies, + typedDependencies, + createAtanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js new file mode 100644 index 0000000..84ad047 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createAtomicMass } from '../../factoriesAny.js'; +export var atomicMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createAtomicMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js new file mode 100644 index 0000000..f2339b0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createAvogadro } from '../../factoriesAny.js'; +export var avogadroDependencies = { + BigNumberDependencies, + UnitDependencies, + createAvogadro +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js new file mode 100644 index 0000000..369a7f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { stirlingS2Dependencies } from './dependenciesStirlingS2.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBellNumbers } from '../../factoriesAny.js'; +export var bellNumbersDependencies = { + addScalarDependencies, + isIntegerDependencies, + isNegativeDependencies, + stirlingS2Dependencies, + typedDependencies, + createBellNumbers +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js new file mode 100644 index 0000000..fcc8438 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createBigNumberClass } from '../../factoriesAny.js'; +export var BigNumberDependencies = { + createBigNumberClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js new file mode 100644 index 0000000..a67aeea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBigint } from '../../factoriesAny.js'; +export var bigintDependencies = { + typedDependencies, + createBigint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js new file mode 100644 index 0000000..e9aabaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBignumber } from '../../factoriesAny.js'; +export var bignumberDependencies = { + BigNumberDependencies, + typedDependencies, + createBignumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js new file mode 100644 index 0000000..37befba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { formatDependencies } from './dependenciesFormat.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBin } from '../../factoriesAny.js'; +export var binDependencies = { + formatDependencies, + typedDependencies, + createBin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js new file mode 100644 index 0000000..d248298 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitAnd } from '../../factoriesAny.js'; +export var bitAndDependencies = { + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createBitAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js new file mode 100644 index 0000000..a5f0274 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { notDependencies } from './dependenciesNot.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createBitAndTransform } from '../../factoriesAny.js'; +export var bitAndTransformDependencies = { + addDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + notDependencies, + typedDependencies, + zerosDependencies, + createBitAndTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js new file mode 100644 index 0000000..f4ecf43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitNot } from '../../factoriesAny.js'; +export var bitNotDependencies = { + typedDependencies, + createBitNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js new file mode 100644 index 0000000..d24033d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitOr } from '../../factoriesAny.js'; +export var bitOrDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createBitOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js new file mode 100644 index 0000000..075aaf6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitOrTransform } from '../../factoriesAny.js'; +export var bitOrTransformDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createBitOrTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js new file mode 100644 index 0000000..7d46ab7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitXor } from '../../factoriesAny.js'; +export var bitXorDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createBitXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js new file mode 100644 index 0000000..d55f841 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { ResultSetDependencies } from './dependenciesResultSet.generated.js'; +import { createBlockNode } from '../../factoriesAny.js'; +export var BlockNodeDependencies = { + NodeDependencies, + ResultSetDependencies, + createBlockNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js new file mode 100644 index 0000000..fd4895f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createBohrMagneton } from '../../factoriesAny.js'; +export var bohrMagnetonDependencies = { + BigNumberDependencies, + UnitDependencies, + createBohrMagneton +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js new file mode 100644 index 0000000..aea8671 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createBohrRadius } from '../../factoriesAny.js'; +export var bohrRadiusDependencies = { + BigNumberDependencies, + UnitDependencies, + createBohrRadius +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js new file mode 100644 index 0000000..3ce13ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createBoltzmann } from '../../factoriesAny.js'; +export var boltzmannDependencies = { + BigNumberDependencies, + UnitDependencies, + createBoltzmann +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js new file mode 100644 index 0000000..61e5c46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBoolean } from '../../factoriesAny.js'; +export var booleanDependencies = { + typedDependencies, + createBoolean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js new file mode 100644 index 0000000..06264f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCatalan } from '../../factoriesAny.js'; +export var catalanDependencies = { + addScalarDependencies, + combinationsDependencies, + divideScalarDependencies, + isIntegerDependencies, + isNegativeDependencies, + multiplyScalarDependencies, + typedDependencies, + createCatalan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js new file mode 100644 index 0000000..051d9c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createCbrt } from '../../factoriesAny.js'; +export var cbrtDependencies = { + BigNumberDependencies, + ComplexDependencies, + FractionDependencies, + isNegativeDependencies, + matrixDependencies, + typedDependencies, + unaryMinusDependencies, + createCbrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js new file mode 100644 index 0000000..fa6d3b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createCeil } from '../../factoriesAny.js'; +export var ceilDependencies = { + DenseMatrixDependencies, + equalScalarDependencies, + matrixDependencies, + roundDependencies, + typedDependencies, + zerosDependencies, + createCeil +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js new file mode 100644 index 0000000..8d9e793 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ChainDependencies } from './dependenciesChainClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createChain } from '../../factoriesAny.js'; +export var chainDependencies = { + ChainDependencies, + typedDependencies, + createChain +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js new file mode 100644 index 0000000..19a1f4b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createChainClass } from '../../factoriesAny.js'; +export var ChainDependencies = { + typedDependencies, + createChainClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js new file mode 100644 index 0000000..2de8c67 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createClassicalElectronRadius } from '../../factoriesAny.js'; +export var classicalElectronRadiusDependencies = { + BigNumberDependencies, + UnitDependencies, + createClassicalElectronRadius +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js new file mode 100644 index 0000000..2e9077b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createClone } from '../../factoriesAny.js'; +export var cloneDependencies = { + typedDependencies, + createClone +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js new file mode 100644 index 0000000..61447d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { rangeDependencies } from './dependenciesRange.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createColumn } from '../../factoriesAny.js'; +export var columnDependencies = { + IndexDependencies, + matrixDependencies, + rangeDependencies, + typedDependencies, + createColumn +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js new file mode 100644 index 0000000..d6bc3ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { rangeDependencies } from './dependenciesRange.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createColumnTransform } from '../../factoriesAny.js'; +export var columnTransformDependencies = { + IndexDependencies, + matrixDependencies, + rangeDependencies, + typedDependencies, + createColumnTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js new file mode 100644 index 0000000..926c7cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCombinations } from '../../factoriesAny.js'; +export var combinationsDependencies = { + typedDependencies, + createCombinations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js new file mode 100644 index 0000000..271eeaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCombinationsWithRep } from '../../factoriesAny.js'; +export var combinationsWithRepDependencies = { + typedDependencies, + createCombinationsWithRep +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js new file mode 100644 index 0000000..f8acf75 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompare } from '../../factoriesAny.js'; +export var compareDependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + FractionDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createCompare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js new file mode 100644 index 0000000..8ecb045 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompareNatural } from '../../factoriesAny.js'; +export var compareNaturalDependencies = { + compareDependencies, + typedDependencies, + createCompareNatural +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js new file mode 100644 index 0000000..b01987f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompareText } from '../../factoriesAny.js'; +export var compareTextDependencies = { + concatDependencies, + matrixDependencies, + typedDependencies, + createCompareText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js new file mode 100644 index 0000000..c4e6841 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompile } from '../../factoriesAny.js'; +export var compileDependencies = { + parseDependencies, + typedDependencies, + createCompile +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js new file mode 100644 index 0000000..42e2055 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createComplex } from '../../factoriesAny.js'; +export var complexDependencies = { + ComplexDependencies, + typedDependencies, + createComplex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js new file mode 100644 index 0000000..abd54d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createComplexClass } from '../../factoriesAny.js'; +export var ComplexDependencies = { + createComplexClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js new file mode 100644 index 0000000..c585659 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createComposition } from '../../factoriesAny.js'; +export var compositionDependencies = { + addScalarDependencies, + combinationsDependencies, + isIntegerDependencies, + isNegativeDependencies, + isPositiveDependencies, + largerDependencies, + typedDependencies, + createComposition +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js new file mode 100644 index 0000000..9a9956c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createConcat } from '../../factoriesAny.js'; +export var concatDependencies = { + isIntegerDependencies, + matrixDependencies, + typedDependencies, + createConcat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js new file mode 100644 index 0000000..11baf40 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createConcatTransform } from '../../factoriesAny.js'; +export var concatTransformDependencies = { + isIntegerDependencies, + matrixDependencies, + typedDependencies, + createConcatTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js new file mode 100644 index 0000000..8001ce1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createConditionalNode } from '../../factoriesAny.js'; +export var ConditionalNodeDependencies = { + NodeDependencies, + createConditionalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js new file mode 100644 index 0000000..61ef521 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createConductanceQuantum } from '../../factoriesAny.js'; +export var conductanceQuantumDependencies = { + BigNumberDependencies, + UnitDependencies, + createConductanceQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js new file mode 100644 index 0000000..4d698d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createConj } from '../../factoriesAny.js'; +export var conjDependencies = { + typedDependencies, + createConj +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js new file mode 100644 index 0000000..338fde0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createConstantNode } from '../../factoriesAny.js'; +export var ConstantNodeDependencies = { + NodeDependencies, + createConstantNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js new file mode 100644 index 0000000..ffe2fd1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js @@ -0,0 +1,28 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { meanDependencies } from './dependenciesMean.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { sumDependencies } from './dependenciesSum.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCorr } from '../../factoriesAny.js'; +export var corrDependencies = { + addDependencies, + divideDependencies, + matrixDependencies, + meanDependencies, + multiplyDependencies, + powDependencies, + sqrtDependencies, + subtractDependencies, + sumDependencies, + typedDependencies, + createCorr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js new file mode 100644 index 0000000..ee553b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCos } from '../../factoriesAny.js'; +export var cosDependencies = { + typedDependencies, + createCos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js new file mode 100644 index 0000000..4c352e8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCosh } from '../../factoriesAny.js'; +export var coshDependencies = { + typedDependencies, + createCosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js new file mode 100644 index 0000000..478e8c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCot } from '../../factoriesAny.js'; +export var cotDependencies = { + BigNumberDependencies, + typedDependencies, + createCot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js new file mode 100644 index 0000000..62f4381 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCoth } from '../../factoriesAny.js'; +export var cothDependencies = { + BigNumberDependencies, + typedDependencies, + createCoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js new file mode 100644 index 0000000..59be861 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createCoulomb } from '../../factoriesAny.js'; +export var coulombDependencies = { + BigNumberDependencies, + UnitDependencies, + createCoulomb +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js new file mode 100644 index 0000000..40d37b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { prodDependencies } from './dependenciesProd.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCount } from '../../factoriesAny.js'; +export var countDependencies = { + prodDependencies, + sizeDependencies, + typedDependencies, + createCount +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js new file mode 100644 index 0000000..cdfe9d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCreateUnit } from '../../factoriesAny.js'; +export var createUnitDependencies = { + UnitDependencies, + typedDependencies, + createCreateUnit +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js new file mode 100644 index 0000000..91b7ad4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCross } from '../../factoriesAny.js'; +export var crossDependencies = { + matrixDependencies, + multiplyDependencies, + subtractDependencies, + typedDependencies, + createCross +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js new file mode 100644 index 0000000..5cc6190 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCsc } from '../../factoriesAny.js'; +export var cscDependencies = { + BigNumberDependencies, + typedDependencies, + createCsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js new file mode 100644 index 0000000..5ce6e0b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCsch } from '../../factoriesAny.js'; +export var cschDependencies = { + BigNumberDependencies, + typedDependencies, + createCsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js new file mode 100644 index 0000000..4d0cec5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { conjDependencies } from './dependenciesConj.generated.js'; +import { transposeDependencies } from './dependenciesTranspose.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCtranspose } from '../../factoriesAny.js'; +export var ctransposeDependencies = { + conjDependencies, + transposeDependencies, + typedDependencies, + createCtranspose +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js new file mode 100644 index 0000000..f42092f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCube } from '../../factoriesAny.js'; +export var cubeDependencies = { + typedDependencies, + createCube +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js new file mode 100644 index 0000000..05941ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryPlusDependencies } from './dependenciesUnaryPlus.generated.js'; +import { createCumSum } from '../../factoriesAny.js'; +export var cumsumDependencies = { + addDependencies, + typedDependencies, + unaryPlusDependencies, + createCumSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js new file mode 100644 index 0000000..fef6c6e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryPlusDependencies } from './dependenciesUnaryPlus.generated.js'; +import { createCumSumTransform } from '../../factoriesAny.js'; +export var cumsumTransformDependencies = { + addDependencies, + typedDependencies, + unaryPlusDependencies, + createCumSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js new file mode 100644 index 0000000..94eb7b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDeepEqual } from '../../factoriesAny.js'; +export var deepEqualDependencies = { + equalDependencies, + typedDependencies, + createDeepEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js new file mode 100644 index 0000000..bad8bd2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { MatrixDependencies } from './dependenciesMatrixClass.generated.js'; +import { createDenseMatrixClass } from '../../factoriesAny.js'; +export var DenseMatrixDependencies = { + MatrixDependencies, + createDenseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js new file mode 100644 index 0000000..3ac3894 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js @@ -0,0 +1,30 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { simplifyDependencies } from './dependenciesSimplify.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDerivative } from '../../factoriesAny.js'; +export var derivativeDependencies = { + ConstantNodeDependencies, + FunctionNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + equalDependencies, + isZeroDependencies, + numericDependencies, + parseDependencies, + simplifyDependencies, + typedDependencies, + createDerivative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js new file mode 100644 index 0000000..7a706ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createDet } from '../../factoriesAny.js'; +export var detDependencies = { + divideScalarDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + subtractScalarDependencies, + typedDependencies, + unaryMinusDependencies, + createDet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js new file mode 100644 index 0000000..605ff5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createDeuteronMass } from '../../factoriesAny.js'; +export var deuteronMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createDeuteronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js new file mode 100644 index 0000000..b852edf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDiag } from '../../factoriesAny.js'; +export var diagDependencies = { + DenseMatrixDependencies, + SparseMatrixDependencies, + matrixDependencies, + typedDependencies, + createDiag +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js new file mode 100644 index 0000000..433e6b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDiff } from '../../factoriesAny.js'; +export var diffDependencies = { + matrixDependencies, + numberDependencies, + subtractDependencies, + typedDependencies, + createDiff +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js new file mode 100644 index 0000000..4781b34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDiffTransform } from '../../factoriesAny.js'; +export var diffTransformDependencies = { + bignumberDependencies, + matrixDependencies, + numberDependencies, + subtractDependencies, + typedDependencies, + createDiffTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js new file mode 100644 index 0000000..5e034ee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { deepEqualDependencies } from './dependenciesDeepEqual.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDistance } from '../../factoriesAny.js'; +export var distanceDependencies = { + absDependencies, + addScalarDependencies, + deepEqualDependencies, + divideScalarDependencies, + multiplyScalarDependencies, + sqrtDependencies, + subtractScalarDependencies, + typedDependencies, + createDistance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js new file mode 100644 index 0000000..4db584f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDivide } from '../../factoriesAny.js'; +export var divideDependencies = { + divideScalarDependencies, + equalScalarDependencies, + invDependencies, + matrixDependencies, + multiplyDependencies, + typedDependencies, + createDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js new file mode 100644 index 0000000..8333cb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDivideScalar } from '../../factoriesAny.js'; +export var divideScalarDependencies = { + numericDependencies, + typedDependencies, + createDivideScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js new file mode 100644 index 0000000..6f5a94a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { conjDependencies } from './dependenciesConj.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDot } from '../../factoriesAny.js'; +export var dotDependencies = { + addScalarDependencies, + conjDependencies, + multiplyScalarDependencies, + sizeDependencies, + typedDependencies, + createDot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js new file mode 100644 index 0000000..f459313 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDotDivide } from '../../factoriesAny.js'; +export var dotDivideDependencies = { + DenseMatrixDependencies, + concatDependencies, + divideScalarDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createDotDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js new file mode 100644 index 0000000..63b2c77 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDotMultiply } from '../../factoriesAny.js'; +export var dotMultiplyDependencies = { + concatDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + typedDependencies, + createDotMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js new file mode 100644 index 0000000..2fc4b60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDotPow } from '../../factoriesAny.js'; +export var dotPowDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + powDependencies, + typedDependencies, + createDotPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js new file mode 100644 index 0000000..d4f8086 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createE } from '../../factoriesAny.js'; +export var eDependencies = { + BigNumberDependencies, + createE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js new file mode 100644 index 0000000..e4a46fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createEfimovFactor } from '../../factoriesAny.js'; +export var efimovFactorDependencies = { + BigNumberDependencies, + createEfimovFactor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js new file mode 100644 index 0000000..7dacf86 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js @@ -0,0 +1,72 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { atanDependencies } from './dependenciesAtan.generated.js'; +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { columnDependencies } from './dependenciesColumn.generated.js'; +import { complexDependencies } from './dependenciesComplex.generated.js'; +import { cosDependencies } from './dependenciesCos.generated.js'; +import { diagDependencies } from './dependenciesDiag.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { dotDependencies } from './dependenciesDot.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { flattenDependencies } from './dependenciesFlatten.generated.js'; +import { imDependencies } from './dependenciesIm.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { matrixFromColumnsDependencies } from './dependenciesMatrixFromColumns.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { qrDependencies } from './dependenciesQr.generated.js'; +import { reDependencies } from './dependenciesRe.generated.js'; +import { reshapeDependencies } from './dependenciesReshape.generated.js'; +import { sinDependencies } from './dependenciesSin.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { usolveDependencies } from './dependenciesUsolve.generated.js'; +import { usolveAllDependencies } from './dependenciesUsolveAll.generated.js'; +import { createEigs } from '../../factoriesAny.js'; +export var eigsDependencies = { + absDependencies, + addDependencies, + addScalarDependencies, + atanDependencies, + bignumberDependencies, + columnDependencies, + complexDependencies, + cosDependencies, + diagDependencies, + divideScalarDependencies, + dotDependencies, + equalDependencies, + flattenDependencies, + imDependencies, + invDependencies, + largerDependencies, + matrixDependencies, + matrixFromColumnsDependencies, + multiplyDependencies, + multiplyScalarDependencies, + numberDependencies, + qrDependencies, + reDependencies, + reshapeDependencies, + sinDependencies, + sizeDependencies, + smallerDependencies, + sqrtDependencies, + subtractDependencies, + typedDependencies, + usolveDependencies, + usolveAllDependencies, + createEigs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js new file mode 100644 index 0000000..711df06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createElectricConstant } from '../../factoriesAny.js'; +export var electricConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createElectricConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js new file mode 100644 index 0000000..75b98ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createElectronMass } from '../../factoriesAny.js'; +export var electronMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createElectronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js new file mode 100644 index 0000000..85874ee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createElementaryCharge } from '../../factoriesAny.js'; +export var elementaryChargeDependencies = { + BigNumberDependencies, + UnitDependencies, + createElementaryCharge +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js new file mode 100644 index 0000000..1489253 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqual } from '../../factoriesAny.js'; +export var equalDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js new file mode 100644 index 0000000..ac93e47 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqualScalar } from '../../factoriesAny.js'; +export var equalScalarDependencies = { + typedDependencies, + createEqualScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js new file mode 100644 index 0000000..7336e81 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareTextDependencies } from './dependenciesCompareText.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqualText } from '../../factoriesAny.js'; +export var equalTextDependencies = { + compareTextDependencies, + isZeroDependencies, + typedDependencies, + createEqualText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js new file mode 100644 index 0000000..ff4636e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createErf } from '../../factoriesAny.js'; +export var erfDependencies = { + typedDependencies, + createErf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js new file mode 100644 index 0000000..dc0ce5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEvaluate } from '../../factoriesAny.js'; +export var evaluateDependencies = { + parseDependencies, + typedDependencies, + createEvaluate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js new file mode 100644 index 0000000..803f469 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createExp } from '../../factoriesAny.js'; +export var expDependencies = { + typedDependencies, + createExp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js new file mode 100644 index 0000000..13c62ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createExpm } from '../../factoriesAny.js'; +export var expmDependencies = { + absDependencies, + addDependencies, + identityDependencies, + invDependencies, + multiplyDependencies, + typedDependencies, + createExpm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js new file mode 100644 index 0000000..00c7bf4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createExpm1 } from '../../factoriesAny.js'; +export var expm1Dependencies = { + ComplexDependencies, + typedDependencies, + createExpm1 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js new file mode 100644 index 0000000..fae74be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { gammaDependencies } from './dependenciesGamma.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFactorial } from '../../factoriesAny.js'; +export var factorialDependencies = { + gammaDependencies, + typedDependencies, + createFactorial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js new file mode 100644 index 0000000..5694706 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createFalse } from '../../factoriesAny.js'; +export var falseDependencies = { + createFalse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js new file mode 100644 index 0000000..b97f80b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createFaraday } from '../../factoriesAny.js'; +export var faradayDependencies = { + BigNumberDependencies, + UnitDependencies, + createFaraday +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js new file mode 100644 index 0000000..daab210 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createFermiCoupling } from '../../factoriesAny.js'; +export var fermiCouplingDependencies = { + BigNumberDependencies, + UnitDependencies, + createFermiCoupling +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js new file mode 100644 index 0000000..303aa12 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { ceilDependencies } from './dependenciesCeil.generated.js'; +import { conjDependencies } from './dependenciesConj.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { dotDivideDependencies } from './dependenciesDotDivide.generated.js'; +import { expDependencies } from './dependenciesExp.generated.js'; +import { iDependencies } from './dependenciesI.generated.js'; +import { log2Dependencies } from './dependenciesLog2.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { tauDependencies } from './dependenciesTau.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFft } from '../../factoriesAny.js'; +export var fftDependencies = { + addScalarDependencies, + ceilDependencies, + conjDependencies, + divideScalarDependencies, + dotDivideDependencies, + expDependencies, + iDependencies, + log2Dependencies, + matrixDependencies, + multiplyScalarDependencies, + powDependencies, + tauDependencies, + typedDependencies, + createFft +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js new file mode 100644 index 0000000..7df71d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { createFibonacciHeapClass } from '../../factoriesAny.js'; +export var FibonacciHeapDependencies = { + largerDependencies, + smallerDependencies, + createFibonacciHeapClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js new file mode 100644 index 0000000..d564159 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFilter } from '../../factoriesAny.js'; +export var filterDependencies = { + typedDependencies, + createFilter +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js new file mode 100644 index 0000000..48a768c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFilterTransform } from '../../factoriesAny.js'; +export var filterTransformDependencies = { + typedDependencies, + createFilterTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js new file mode 100644 index 0000000..d30692d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createFineStructure } from '../../factoriesAny.js'; +export var fineStructureDependencies = { + BigNumberDependencies, + createFineStructure +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js new file mode 100644 index 0000000..571fb9b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createFirstRadiation } from '../../factoriesAny.js'; +export var firstRadiationDependencies = { + BigNumberDependencies, + UnitDependencies, + createFirstRadiation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js new file mode 100644 index 0000000..390b0d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { ceilDependencies } from './dependenciesCeil.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { floorDependencies } from './dependenciesFloor.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createFix } from '../../factoriesAny.js'; +export var fixDependencies = { + ComplexDependencies, + DenseMatrixDependencies, + ceilDependencies, + equalScalarDependencies, + floorDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createFix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js new file mode 100644 index 0000000..f53888b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFlatten } from '../../factoriesAny.js'; +export var flattenDependencies = { + typedDependencies, + createFlatten +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js new file mode 100644 index 0000000..9d681fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createFloor } from '../../factoriesAny.js'; +export var floorDependencies = { + DenseMatrixDependencies, + equalScalarDependencies, + matrixDependencies, + roundDependencies, + typedDependencies, + zerosDependencies, + createFloor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js new file mode 100644 index 0000000..e39b6fe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createForEach } from '../../factoriesAny.js'; +export var forEachDependencies = { + typedDependencies, + createForEach +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js new file mode 100644 index 0000000..1d33837 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createForEachTransform } from '../../factoriesAny.js'; +export var forEachTransformDependencies = { + typedDependencies, + createForEachTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js new file mode 100644 index 0000000..d7d47cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFormat } from '../../factoriesAny.js'; +export var formatDependencies = { + typedDependencies, + createFormat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js new file mode 100644 index 0000000..502b793 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFraction } from '../../factoriesAny.js'; +export var fractionDependencies = { + FractionDependencies, + typedDependencies, + createFraction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js new file mode 100644 index 0000000..139d2b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createFractionClass } from '../../factoriesAny.js'; +export var FractionDependencies = { + createFractionClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js new file mode 100644 index 0000000..f60cfd9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFreqz } from '../../factoriesAny.js'; +export var freqzDependencies = { + ComplexDependencies, + addDependencies, + divideDependencies, + matrixDependencies, + multiplyDependencies, + typedDependencies, + createFreqz +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js new file mode 100644 index 0000000..a191dcd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFunctionAssignmentNode } from '../../factoriesAny.js'; +export var FunctionAssignmentNodeDependencies = { + NodeDependencies, + typedDependencies, + createFunctionAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js new file mode 100644 index 0000000..45d4dbd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { createFunctionNode } from '../../factoriesAny.js'; +export var FunctionNodeDependencies = { + NodeDependencies, + SymbolNodeDependencies, + createFunctionNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js new file mode 100644 index 0000000..56cabf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createGamma } from '../../factoriesAny.js'; +export var gammaDependencies = { + BigNumberDependencies, + ComplexDependencies, + multiplyScalarDependencies, + powDependencies, + typedDependencies, + createGamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js new file mode 100644 index 0000000..ffc3038 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createGasConstant } from '../../factoriesAny.js'; +export var gasConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createGasConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js new file mode 100644 index 0000000..becb59f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createGcd } from '../../factoriesAny.js'; +export var gcdDependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + roundDependencies, + typedDependencies, + zerosDependencies, + createGcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js new file mode 100644 index 0000000..8e7a996 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createGetMatrixDataType } from '../../factoriesAny.js'; +export var getMatrixDataTypeDependencies = { + typedDependencies, + createGetMatrixDataType +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js new file mode 100644 index 0000000..0f7f12a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createGravitationConstant } from '../../factoriesAny.js'; +export var gravitationConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createGravitationConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js new file mode 100644 index 0000000..1030929 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createGravity } from '../../factoriesAny.js'; +export var gravityDependencies = { + BigNumberDependencies, + UnitDependencies, + createGravity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js new file mode 100644 index 0000000..76a305d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createHartreeEnergy } from '../../factoriesAny.js'; +export var hartreeEnergyDependencies = { + BigNumberDependencies, + UnitDependencies, + createHartreeEnergy +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js new file mode 100644 index 0000000..5eb4dfb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHasNumericValue } from '../../factoriesAny.js'; +export var hasNumericValueDependencies = { + isNumericDependencies, + typedDependencies, + createHasNumericValue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js new file mode 100644 index 0000000..58549f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { HelpDependencies } from './dependenciesHelpClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHelp } from '../../factoriesAny.js'; +export var helpDependencies = { + HelpDependencies, + typedDependencies, + createHelp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js new file mode 100644 index 0000000..9ce8fa2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; +import { createHelpClass } from '../../factoriesAny.js'; +export var HelpDependencies = { + evaluateDependencies, + createHelpClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js new file mode 100644 index 0000000..480205f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { formatDependencies } from './dependenciesFormat.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHex } from '../../factoriesAny.js'; +export var hexDependencies = { + formatDependencies, + typedDependencies, + createHex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js new file mode 100644 index 0000000..8100654 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHypot } from '../../factoriesAny.js'; +export var hypotDependencies = { + absDependencies, + addScalarDependencies, + divideScalarDependencies, + isPositiveDependencies, + multiplyScalarDependencies, + smallerDependencies, + sqrtDependencies, + typedDependencies, + createHypot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js new file mode 100644 index 0000000..045dbf0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { createI } from '../../factoriesAny.js'; +export var iDependencies = { + ComplexDependencies, + createI +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js new file mode 100644 index 0000000..4e118ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIdentity } from '../../factoriesAny.js'; +export var identityDependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + SparseMatrixDependencies, + matrixDependencies, + typedDependencies, + createIdentity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js new file mode 100644 index 0000000..e8d8d9c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { conjDependencies } from './dependenciesConj.generated.js'; +import { dotDivideDependencies } from './dependenciesDotDivide.generated.js'; +import { fftDependencies } from './dependenciesFft.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIfft } from '../../factoriesAny.js'; +export var ifftDependencies = { + conjDependencies, + dotDivideDependencies, + fftDependencies, + typedDependencies, + createIfft +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js new file mode 100644 index 0000000..1e7da81 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIm } from '../../factoriesAny.js'; +export var imDependencies = { + typedDependencies, + createIm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js new file mode 100644 index 0000000..8f5067d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { createImmutableDenseMatrixClass } from '../../factoriesAny.js'; +export var ImmutableDenseMatrixDependencies = { + DenseMatrixDependencies, + smallerDependencies, + createImmutableDenseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js new file mode 100644 index 0000000..900da1e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIndex } from '../../factoriesAny.js'; +export var indexDependencies = { + IndexDependencies, + typedDependencies, + createIndex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js new file mode 100644 index 0000000..8b160c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ImmutableDenseMatrixDependencies } from './dependenciesImmutableDenseMatrixClass.generated.js'; +import { getMatrixDataTypeDependencies } from './dependenciesGetMatrixDataType.generated.js'; +import { createIndexClass } from '../../factoriesAny.js'; +export var IndexDependencies = { + ImmutableDenseMatrixDependencies, + getMatrixDataTypeDependencies, + createIndexClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js new file mode 100644 index 0000000..8f2bc19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { createIndexNode } from '../../factoriesAny.js'; +export var IndexNodeDependencies = { + NodeDependencies, + sizeDependencies, + createIndexNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js new file mode 100644 index 0000000..3fb64ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { getMatrixDataTypeDependencies } from './dependenciesGetMatrixDataType.generated.js'; +import { createIndexTransform } from '../../factoriesAny.js'; +export var indexTransformDependencies = { + IndexDependencies, + getMatrixDataTypeDependencies, + createIndexTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js new file mode 100644 index 0000000..870e9e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createInfinity } from '../../factoriesAny.js'; +export var InfinityDependencies = { + BigNumberDependencies, + createInfinity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js new file mode 100644 index 0000000..46ff3fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js @@ -0,0 +1,36 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { flattenDependencies } from './dependenciesFlatten.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIntersect } from '../../factoriesAny.js'; +export var intersectDependencies = { + absDependencies, + addDependencies, + addScalarDependencies, + divideScalarDependencies, + equalScalarDependencies, + flattenDependencies, + isNumericDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + multiplyScalarDependencies, + smallerDependencies, + subtractDependencies, + typedDependencies, + createIntersect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js new file mode 100644 index 0000000..8a19c5f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js @@ -0,0 +1,26 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { detDependencies } from './dependenciesDet.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createInv } from '../../factoriesAny.js'; +export var invDependencies = { + absDependencies, + addScalarDependencies, + detDependencies, + divideScalarDependencies, + identityDependencies, + matrixDependencies, + multiplyDependencies, + typedDependencies, + unaryMinusDependencies, + createInv +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js new file mode 100644 index 0000000..2cd33b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createInverseConductanceQuantum } from '../../factoriesAny.js'; +export var inverseConductanceQuantumDependencies = { + BigNumberDependencies, + UnitDependencies, + createInverseConductanceQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js new file mode 100644 index 0000000..461ee3f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { modDependencies } from './dependenciesMod.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { xgcdDependencies } from './dependenciesXgcd.generated.js'; +import { createInvmod } from '../../factoriesAny.js'; +export var invmodDependencies = { + BigNumberDependencies, + addDependencies, + equalDependencies, + isIntegerDependencies, + modDependencies, + smallerDependencies, + typedDependencies, + xgcdDependencies, + createInvmod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js new file mode 100644 index 0000000..d71f2b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsInteger } from '../../factoriesAny.js'; +export var isIntegerDependencies = { + typedDependencies, + createIsInteger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js new file mode 100644 index 0000000..797b48a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNaN } from '../../factoriesAny.js'; +export var isNaNDependencies = { + typedDependencies, + createIsNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js new file mode 100644 index 0000000..f2b83ad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNegative } from '../../factoriesAny.js'; +export var isNegativeDependencies = { + typedDependencies, + createIsNegative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js new file mode 100644 index 0000000..00cdec9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNumeric } from '../../factoriesAny.js'; +export var isNumericDependencies = { + typedDependencies, + createIsNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js new file mode 100644 index 0000000..1aa1b12 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsPositive } from '../../factoriesAny.js'; +export var isPositiveDependencies = { + typedDependencies, + createIsPositive +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js new file mode 100644 index 0000000..f714257 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsPrime } from '../../factoriesAny.js'; +export var isPrimeDependencies = { + typedDependencies, + createIsPrime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js new file mode 100644 index 0000000..7e28646 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsZero } from '../../factoriesAny.js'; +export var isZeroDependencies = { + equalScalarDependencies, + typedDependencies, + createIsZero +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js new file mode 100644 index 0000000..15edb1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js @@ -0,0 +1,26 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { dotDivideDependencies } from './dependenciesDotDivide.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { logDependencies } from './dependenciesLog.generated.js'; +import { mapDependencies } from './dependenciesMap.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { sumDependencies } from './dependenciesSum.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createKldivergence } from '../../factoriesAny.js'; +export var kldivergenceDependencies = { + divideDependencies, + dotDivideDependencies, + isNumericDependencies, + logDependencies, + mapDependencies, + matrixDependencies, + multiplyDependencies, + sumDependencies, + typedDependencies, + createKldivergence +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js new file mode 100644 index 0000000..c8439b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createKlitzing } from '../../factoriesAny.js'; +export var klitzingDependencies = { + BigNumberDependencies, + UnitDependencies, + createKlitzing +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js new file mode 100644 index 0000000..38af28c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createKron } from '../../factoriesAny.js'; +export var kronDependencies = { + matrixDependencies, + multiplyScalarDependencies, + typedDependencies, + createKron +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js new file mode 100644 index 0000000..f2d08b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createLN10 } from '../../factoriesAny.js'; +export var LN10Dependencies = { + BigNumberDependencies, + createLN10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js new file mode 100644 index 0000000..9c5386c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createLN2 } from '../../factoriesAny.js'; +export var LN2Dependencies = { + BigNumberDependencies, + createLN2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js new file mode 100644 index 0000000..ef35cd5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createLOG10E } from '../../factoriesAny.js'; +export var LOG10EDependencies = { + BigNumberDependencies, + createLOG10E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js new file mode 100644 index 0000000..c9e71e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createLOG2E } from '../../factoriesAny.js'; +export var LOG2EDependencies = { + BigNumberDependencies, + createLOG2E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js new file mode 100644 index 0000000..6919daa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLarger } from '../../factoriesAny.js'; +export var largerDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createLarger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js new file mode 100644 index 0000000..f73352d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLargerEq } from '../../factoriesAny.js'; +export var largerEqDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createLargerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js new file mode 100644 index 0000000..191be38 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLcm } from '../../factoriesAny.js'; +export var lcmDependencies = { + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createLcm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js new file mode 100644 index 0000000..29a4a9f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLeafCount } from '../../factoriesAny.js'; +export var leafCountDependencies = { + parseDependencies, + typedDependencies, + createLeafCount +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js new file mode 100644 index 0000000..66b63b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createLeftShift } from '../../factoriesAny.js'; +export var leftShiftDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createLeftShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js new file mode 100644 index 0000000..de9a2fb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLgamma } from '../../factoriesAny.js'; +export var lgammaDependencies = { + ComplexDependencies, + typedDependencies, + createLgamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js new file mode 100644 index 0000000..456850a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog } from '../../factoriesAny.js'; +export var logDependencies = { + ComplexDependencies, + divideScalarDependencies, + typedDependencies, + createLog +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js new file mode 100644 index 0000000..e5db01f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog10 } from '../../factoriesAny.js'; +export var log10Dependencies = { + ComplexDependencies, + typedDependencies, + createLog10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js new file mode 100644 index 0000000..95cdacf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { logDependencies } from './dependenciesLog.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog1p } from '../../factoriesAny.js'; +export var log1pDependencies = { + ComplexDependencies, + divideScalarDependencies, + logDependencies, + typedDependencies, + createLog1p +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js new file mode 100644 index 0000000..0f9eb10 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog2 } from '../../factoriesAny.js'; +export var log2Dependencies = { + ComplexDependencies, + typedDependencies, + createLog2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js new file mode 100644 index 0000000..e2559c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createLoschmidt } from '../../factoriesAny.js'; +export var loschmidtDependencies = { + BigNumberDependencies, + UnitDependencies, + createLoschmidt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js new file mode 100644 index 0000000..5a20446 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLsolve } from '../../factoriesAny.js'; +export var lsolveDependencies = { + DenseMatrixDependencies, + divideScalarDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + subtractScalarDependencies, + typedDependencies, + createLsolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js new file mode 100644 index 0000000..a190c2f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLsolveAll } from '../../factoriesAny.js'; +export var lsolveAllDependencies = { + DenseMatrixDependencies, + divideScalarDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + subtractScalarDependencies, + typedDependencies, + createLsolveAll +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js new file mode 100644 index 0000000..659c798 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { SpaDependencies } from './dependenciesSpaClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createLup } from '../../factoriesAny.js'; +export var lupDependencies = { + DenseMatrixDependencies, + SpaDependencies, + SparseMatrixDependencies, + absDependencies, + addScalarDependencies, + divideScalarDependencies, + equalScalarDependencies, + largerDependencies, + matrixDependencies, + multiplyScalarDependencies, + subtractScalarDependencies, + typedDependencies, + unaryMinusDependencies, + createLup +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js new file mode 100644 index 0000000..265740a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { lsolveDependencies } from './dependenciesLsolve.generated.js'; +import { lupDependencies } from './dependenciesLup.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { sluDependencies } from './dependenciesSlu.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { usolveDependencies } from './dependenciesUsolve.generated.js'; +import { createLusolve } from '../../factoriesAny.js'; +export var lusolveDependencies = { + DenseMatrixDependencies, + lsolveDependencies, + lupDependencies, + matrixDependencies, + sluDependencies, + typedDependencies, + usolveDependencies, + createLusolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js new file mode 100644 index 0000000..799f98d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { sylvesterDependencies } from './dependenciesSylvester.generated.js'; +import { transposeDependencies } from './dependenciesTranspose.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLyap } from '../../factoriesAny.js'; +export var lyapDependencies = { + matrixDependencies, + multiplyDependencies, + sylvesterDependencies, + transposeDependencies, + typedDependencies, + createLyap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js new file mode 100644 index 0000000..82b4091 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { mapDependencies } from './dependenciesMap.generated.js'; +import { medianDependencies } from './dependenciesMedian.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMad } from '../../factoriesAny.js'; +export var madDependencies = { + absDependencies, + mapDependencies, + medianDependencies, + subtractDependencies, + typedDependencies, + createMad +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js new file mode 100644 index 0000000..3ad2da9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMagneticConstant } from '../../factoriesAny.js'; +export var magneticConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createMagneticConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js new file mode 100644 index 0000000..178fe1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMagneticFluxQuantum } from '../../factoriesAny.js'; +export var magneticFluxQuantumDependencies = { + BigNumberDependencies, + UnitDependencies, + createMagneticFluxQuantum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js new file mode 100644 index 0000000..a3e60dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMap } from '../../factoriesAny.js'; +export var mapDependencies = { + typedDependencies, + createMap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js new file mode 100644 index 0000000..dbc5460 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMapTransform } from '../../factoriesAny.js'; +export var mapTransformDependencies = { + typedDependencies, + createMapTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js new file mode 100644 index 0000000..ab09ac4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { MatrixDependencies } from './dependenciesMatrixClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMatrix } from '../../factoriesAny.js'; +export var matrixDependencies = { + DenseMatrixDependencies, + MatrixDependencies, + SparseMatrixDependencies, + typedDependencies, + createMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js new file mode 100644 index 0000000..12ff246 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createMatrixClass } from '../../factoriesAny.js'; +export var MatrixDependencies = { + createMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js new file mode 100644 index 0000000..b63e1b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { flattenDependencies } from './dependenciesFlatten.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMatrixFromColumns } from '../../factoriesAny.js'; +export var matrixFromColumnsDependencies = { + flattenDependencies, + matrixDependencies, + sizeDependencies, + typedDependencies, + createMatrixFromColumns +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js new file mode 100644 index 0000000..a20f85b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMatrixFromFunction } from '../../factoriesAny.js'; +export var matrixFromFunctionDependencies = { + isZeroDependencies, + matrixDependencies, + typedDependencies, + createMatrixFromFunction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js new file mode 100644 index 0000000..adf7c20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { flattenDependencies } from './dependenciesFlatten.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMatrixFromRows } from '../../factoriesAny.js'; +export var matrixFromRowsDependencies = { + flattenDependencies, + matrixDependencies, + sizeDependencies, + typedDependencies, + createMatrixFromRows +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js new file mode 100644 index 0000000..9fafc4b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMax } from '../../factoriesAny.js'; +export var maxDependencies = { + largerDependencies, + numericDependencies, + typedDependencies, + createMax +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js new file mode 100644 index 0000000..701633f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMaxTransform } from '../../factoriesAny.js'; +export var maxTransformDependencies = { + largerDependencies, + numericDependencies, + typedDependencies, + createMaxTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js new file mode 100644 index 0000000..1d5b71b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMean } from '../../factoriesAny.js'; +export var meanDependencies = { + addDependencies, + divideDependencies, + typedDependencies, + createMean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js new file mode 100644 index 0000000..478c6d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMeanTransform } from '../../factoriesAny.js'; +export var meanTransformDependencies = { + addDependencies, + divideDependencies, + typedDependencies, + createMeanTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js new file mode 100644 index 0000000..6618e5c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { partitionSelectDependencies } from './dependenciesPartitionSelect.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMedian } from '../../factoriesAny.js'; +export var medianDependencies = { + addDependencies, + compareDependencies, + divideDependencies, + partitionSelectDependencies, + typedDependencies, + createMedian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js new file mode 100644 index 0000000..2141446 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMin } from '../../factoriesAny.js'; +export var minDependencies = { + numericDependencies, + smallerDependencies, + typedDependencies, + createMin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js new file mode 100644 index 0000000..475b810 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMinTransform } from '../../factoriesAny.js'; +export var minTransformDependencies = { + numericDependencies, + smallerDependencies, + typedDependencies, + createMinTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js new file mode 100644 index 0000000..54cad6f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createMod } from '../../factoriesAny.js'; +export var modDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + roundDependencies, + typedDependencies, + zerosDependencies, + createMod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js new file mode 100644 index 0000000..1bcd89b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMode } from '../../factoriesAny.js'; +export var modeDependencies = { + isNaNDependencies, + isNumericDependencies, + typedDependencies, + createMode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js new file mode 100644 index 0000000..f1e27ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMolarMass } from '../../factoriesAny.js'; +export var molarMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createMolarMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js new file mode 100644 index 0000000..728a849 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMolarMassC12 } from '../../factoriesAny.js'; +export var molarMassC12Dependencies = { + BigNumberDependencies, + UnitDependencies, + createMolarMassC12 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js new file mode 100644 index 0000000..288b280 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMolarPlanckConstant } from '../../factoriesAny.js'; +export var molarPlanckConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createMolarPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js new file mode 100644 index 0000000..f8f7312 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createMolarVolume } from '../../factoriesAny.js'; +export var molarVolumeDependencies = { + BigNumberDependencies, + UnitDependencies, + createMolarVolume +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js new file mode 100644 index 0000000..f72fb19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultinomial } from '../../factoriesAny.js'; +export var multinomialDependencies = { + addDependencies, + divideDependencies, + factorialDependencies, + isIntegerDependencies, + isPositiveDependencies, + multiplyDependencies, + typedDependencies, + createMultinomial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js new file mode 100644 index 0000000..5b6a14b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { dotDependencies } from './dependenciesDot.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultiply } from '../../factoriesAny.js'; +export var multiplyDependencies = { + addScalarDependencies, + dotDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + typedDependencies, + createMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js new file mode 100644 index 0000000..c47ed5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultiplyScalar } from '../../factoriesAny.js'; +export var multiplyScalarDependencies = { + typedDependencies, + createMultiplyScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js new file mode 100644 index 0000000..159644f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createNaN } from '../../factoriesAny.js'; +export var NaNDependencies = { + BigNumberDependencies, + createNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js new file mode 100644 index 0000000..4e85f4f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createNeutronMass } from '../../factoriesAny.js'; +export var neutronMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createNeutronMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js new file mode 100644 index 0000000..41e5cf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createNode } from '../../factoriesAny.js'; +export var NodeDependencies = { + createNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js new file mode 100644 index 0000000..8acf1ed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { conjDependencies } from './dependenciesConj.generated.js'; +import { ctransposeDependencies } from './dependenciesCtranspose.generated.js'; +import { eigsDependencies } from './dependenciesEigs.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNorm } from '../../factoriesAny.js'; +export var normDependencies = { + absDependencies, + addDependencies, + conjDependencies, + ctransposeDependencies, + eigsDependencies, + equalScalarDependencies, + largerDependencies, + matrixDependencies, + multiplyDependencies, + powDependencies, + smallerDependencies, + sqrtDependencies, + typedDependencies, + createNorm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js new file mode 100644 index 0000000..0954db4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNot } from '../../factoriesAny.js'; +export var notDependencies = { + typedDependencies, + createNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js new file mode 100644 index 0000000..f82ca35 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNthRoot } from '../../factoriesAny.js'; +export var nthRootDependencies = { + BigNumberDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createNthRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js new file mode 100644 index 0000000..830652c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNthRoots } from '../../factoriesAny.js'; +export var nthRootsDependencies = { + ComplexDependencies, + divideScalarDependencies, + typedDependencies, + createNthRoots +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js new file mode 100644 index 0000000..aff4825 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createNuclearMagneton } from '../../factoriesAny.js'; +export var nuclearMagnetonDependencies = { + BigNumberDependencies, + UnitDependencies, + createNuclearMagneton +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js new file mode 100644 index 0000000..8aa017c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createNull } from '../../factoriesAny.js'; +export var nullDependencies = { + createNull +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js new file mode 100644 index 0000000..6bde859 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNumber } from '../../factoriesAny.js'; +export var numberDependencies = { + typedDependencies, + createNumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js new file mode 100644 index 0000000..cb0b193 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { fractionDependencies } from './dependenciesFraction.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { createNumeric } from '../../factoriesAny.js'; +export var numericDependencies = { + bignumberDependencies, + fractionDependencies, + numberDependencies, + createNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js new file mode 100644 index 0000000..d0b0d71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createObjectNode } from '../../factoriesAny.js'; +export var ObjectNodeDependencies = { + NodeDependencies, + createObjectNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js new file mode 100644 index 0000000..38c424c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { formatDependencies } from './dependenciesFormat.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createOct } from '../../factoriesAny.js'; +export var octDependencies = { + formatDependencies, + typedDependencies, + createOct +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js new file mode 100644 index 0000000..d486f28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createOnes } from '../../factoriesAny.js'; +export var onesDependencies = { + BigNumberDependencies, + matrixDependencies, + typedDependencies, + createOnes +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js new file mode 100644 index 0000000..64ff770 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createOperatorNode } from '../../factoriesAny.js'; +export var OperatorNodeDependencies = { + NodeDependencies, + createOperatorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js new file mode 100644 index 0000000..9b4a16c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createOr } from '../../factoriesAny.js'; +export var orDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js new file mode 100644 index 0000000..852045c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createOrTransform } from '../../factoriesAny.js'; +export var orTransformDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createOrTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js new file mode 100644 index 0000000..92d4445 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createParenthesisNode } from '../../factoriesAny.js'; +export var ParenthesisNodeDependencies = { + NodeDependencies, + createParenthesisNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js new file mode 100644 index 0000000..136168d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js @@ -0,0 +1,42 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { AssignmentNodeDependencies } from './dependenciesAssignmentNode.generated.js'; +import { BlockNodeDependencies } from './dependenciesBlockNode.generated.js'; +import { ConditionalNodeDependencies } from './dependenciesConditionalNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionAssignmentNodeDependencies } from './dependenciesFunctionAssignmentNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { RangeNodeDependencies } from './dependenciesRangeNode.generated.js'; +import { RelationalNodeDependencies } from './dependenciesRelationalNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createParse } from '../../factoriesAny.js'; +export var parseDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + AssignmentNodeDependencies, + BlockNodeDependencies, + ConditionalNodeDependencies, + ConstantNodeDependencies, + FunctionAssignmentNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + RangeNodeDependencies, + RelationalNodeDependencies, + SymbolNodeDependencies, + numericDependencies, + typedDependencies, + createParse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js new file mode 100644 index 0000000..f50f56a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ParserDependencies } from './dependenciesParserClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createParser } from '../../factoriesAny.js'; +export var parserDependencies = { + ParserDependencies, + typedDependencies, + createParser +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js new file mode 100644 index 0000000..2922aae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; +import { createParserClass } from '../../factoriesAny.js'; +export var ParserDependencies = { + evaluateDependencies, + createParserClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js new file mode 100644 index 0000000..ecd2205 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPartitionSelect } from '../../factoriesAny.js'; +export var partitionSelectDependencies = { + compareDependencies, + isNaNDependencies, + isNumericDependencies, + typedDependencies, + createPartitionSelect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js new file mode 100644 index 0000000..2c5449b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPermutations } from '../../factoriesAny.js'; +export var permutationsDependencies = { + factorialDependencies, + typedDependencies, + createPermutations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js new file mode 100644 index 0000000..fa8e2c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createPhi } from '../../factoriesAny.js'; +export var phiDependencies = { + BigNumberDependencies, + createPhi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js new file mode 100644 index 0000000..2327874 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createPi } from '../../factoriesAny.js'; +export var piDependencies = { + BigNumberDependencies, + createPi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js new file mode 100644 index 0000000..a6809db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPickRandom } from '../../factoriesAny.js'; +export var pickRandomDependencies = { + typedDependencies, + createPickRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js new file mode 100644 index 0000000..d1dedbc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js @@ -0,0 +1,32 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { ctransposeDependencies } from './dependenciesCtranspose.generated.js'; +import { deepEqualDependencies } from './dependenciesDeepEqual.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { dotDependencies } from './dependenciesDot.generated.js'; +import { dotDivideDependencies } from './dependenciesDotDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPinv } from '../../factoriesAny.js'; +export var pinvDependencies = { + ComplexDependencies, + addDependencies, + ctransposeDependencies, + deepEqualDependencies, + divideScalarDependencies, + dotDependencies, + dotDivideDependencies, + equalDependencies, + invDependencies, + matrixDependencies, + multiplyDependencies, + typedDependencies, + createPinv +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js new file mode 100644 index 0000000..b3849ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckCharge } from '../../factoriesAny.js'; +export var planckChargeDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckCharge +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js new file mode 100644 index 0000000..d2c4c62 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckConstant } from '../../factoriesAny.js'; +export var planckConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js new file mode 100644 index 0000000..221d993 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckLength } from '../../factoriesAny.js'; +export var planckLengthDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckLength +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js new file mode 100644 index 0000000..209989d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckMass } from '../../factoriesAny.js'; +export var planckMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js new file mode 100644 index 0000000..7eac32c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckTemperature } from '../../factoriesAny.js'; +export var planckTemperatureDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckTemperature +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js new file mode 100644 index 0000000..9d07160 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createPlanckTime } from '../../factoriesAny.js'; +export var planckTimeDependencies = { + BigNumberDependencies, + UnitDependencies, + createPlanckTime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js new file mode 100644 index 0000000..1879945 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { cbrtDependencies } from './dependenciesCbrt.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { imDependencies } from './dependenciesIm.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { reDependencies } from './dependenciesRe.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typeOfDependencies } from './dependenciesTypeOf.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createPolynomialRoot } from '../../factoriesAny.js'; +export var polynomialRootDependencies = { + addDependencies, + cbrtDependencies, + divideDependencies, + equalScalarDependencies, + imDependencies, + isZeroDependencies, + multiplyDependencies, + reDependencies, + sqrtDependencies, + subtractDependencies, + typeOfDependencies, + typedDependencies, + unaryMinusDependencies, + createPolynomialRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js new file mode 100644 index 0000000..3c84571 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { fractionDependencies } from './dependenciesFraction.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPow } from '../../factoriesAny.js'; +export var powDependencies = { + ComplexDependencies, + fractionDependencies, + identityDependencies, + invDependencies, + matrixDependencies, + multiplyDependencies, + numberDependencies, + typedDependencies, + createPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js new file mode 100644 index 0000000..731a3bd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPrint } from '../../factoriesAny.js'; +export var printDependencies = { + typedDependencies, + createPrint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js new file mode 100644 index 0000000..d80d6c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createPrintTransform } from '../../factoriesAny.js'; +export var printTransformDependencies = { + addDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createPrintTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js new file mode 100644 index 0000000..59fe201 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createProd } from '../../factoriesAny.js'; +export var prodDependencies = { + multiplyScalarDependencies, + numericDependencies, + typedDependencies, + createProd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js new file mode 100644 index 0000000..351feae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createProtonMass } from '../../factoriesAny.js'; +export var protonMassDependencies = { + BigNumberDependencies, + UnitDependencies, + createProtonMass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js new file mode 100644 index 0000000..047a07b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js @@ -0,0 +1,38 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { complexDependencies } from './dependenciesComplex.generated.js'; +import { conjDependencies } from './dependenciesConj.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { signDependencies } from './dependenciesSign.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createQr } from '../../factoriesAny.js'; +export var qrDependencies = { + addScalarDependencies, + complexDependencies, + conjDependencies, + divideScalarDependencies, + equalDependencies, + identityDependencies, + isZeroDependencies, + matrixDependencies, + multiplyScalarDependencies, + signDependencies, + sqrtDependencies, + subtractScalarDependencies, + typedDependencies, + unaryMinusDependencies, + zerosDependencies, + createQr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js new file mode 100644 index 0000000..9e465cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js @@ -0,0 +1,32 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { partitionSelectDependencies } from './dependenciesPartitionSelect.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createQuantileSeq } from '../../factoriesAny.js'; +export var quantileSeqDependencies = { + bignumberDependencies, + addDependencies, + compareDependencies, + divideDependencies, + isIntegerDependencies, + largerDependencies, + multiplyDependencies, + partitionSelectDependencies, + smallerDependencies, + smallerEqDependencies, + subtractDependencies, + typedDependencies, + createQuantileSeq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js new file mode 100644 index 0000000..76750e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js @@ -0,0 +1,32 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { partitionSelectDependencies } from './dependenciesPartitionSelect.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createQuantileSeqTransform } from '../../factoriesAny.js'; +export var quantileSeqTransformDependencies = { + addDependencies, + bignumberDependencies, + compareDependencies, + divideDependencies, + isIntegerDependencies, + largerDependencies, + multiplyDependencies, + partitionSelectDependencies, + smallerDependencies, + smallerEqDependencies, + subtractDependencies, + typedDependencies, + createQuantileSeqTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js new file mode 100644 index 0000000..5f05d77 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createQuantumOfCirculation } from '../../factoriesAny.js'; +export var quantumOfCirculationDependencies = { + BigNumberDependencies, + UnitDependencies, + createQuantumOfCirculation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js new file mode 100644 index 0000000..b11fb5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRandom } from '../../factoriesAny.js'; +export var randomDependencies = { + typedDependencies, + createRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js new file mode 100644 index 0000000..fb51851 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRandomInt } from '../../factoriesAny.js'; +export var randomIntDependencies = { + typedDependencies, + createRandomInt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js new file mode 100644 index 0000000..cddc0d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js @@ -0,0 +1,26 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { largerEqDependencies } from './dependenciesLargerEq.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRange } from '../../factoriesAny.js'; +export var rangeDependencies = { + bignumberDependencies, + matrixDependencies, + addDependencies, + isPositiveDependencies, + largerDependencies, + largerEqDependencies, + smallerDependencies, + smallerEqDependencies, + typedDependencies, + createRange +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js new file mode 100644 index 0000000..dc28667 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createRangeClass } from '../../factoriesAny.js'; +export var RangeDependencies = { + createRangeClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js new file mode 100644 index 0000000..829b356 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createRangeNode } from '../../factoriesAny.js'; +export var RangeNodeDependencies = { + NodeDependencies, + createRangeNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js new file mode 100644 index 0000000..1ce5802 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js @@ -0,0 +1,26 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { largerEqDependencies } from './dependenciesLargerEq.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRangeTransform } from '../../factoriesAny.js'; +export var rangeTransformDependencies = { + bignumberDependencies, + matrixDependencies, + addDependencies, + isPositiveDependencies, + largerDependencies, + largerEqDependencies, + smallerDependencies, + smallerEqDependencies, + typedDependencies, + createRangeTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js new file mode 100644 index 0000000..b444849 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js @@ -0,0 +1,56 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { fractionDependencies } from './dependenciesFraction.generated.js'; +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { simplifyDependencies } from './dependenciesSimplify.generated.js'; +import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; +import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRationalize } from '../../factoriesAny.js'; +export var rationalizeDependencies = { + bignumberDependencies, + fractionDependencies, + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + simplifyDependencies, + simplifyConstantDependencies, + simplifyCoreDependencies, + subtractDependencies, + typedDependencies, + createRationalize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js new file mode 100644 index 0000000..addd9fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRe } from '../../factoriesAny.js'; +export var reDependencies = { + typedDependencies, + createRe +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js new file mode 100644 index 0000000..58f1fcd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createReducedPlanckConstant } from '../../factoriesAny.js'; +export var reducedPlanckConstantDependencies = { + BigNumberDependencies, + UnitDependencies, + createReducedPlanckConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js new file mode 100644 index 0000000..f76b3f5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createRelationalNode } from '../../factoriesAny.js'; +export var RelationalNodeDependencies = { + NodeDependencies, + createRelationalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js new file mode 100644 index 0000000..6fcdff6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createReplacer } from '../../factoriesAny.js'; +export var replacerDependencies = { + createReplacer +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js new file mode 100644 index 0000000..1668dd9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createReshape } from '../../factoriesAny.js'; +export var reshapeDependencies = { + isIntegerDependencies, + matrixDependencies, + typedDependencies, + createReshape +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js new file mode 100644 index 0000000..3ffb8bf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { createResize } from '../../factoriesAny.js'; +export var resizeDependencies = { + matrixDependencies, + createResize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js new file mode 100644 index 0000000..4512fae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createResolve } from '../../factoriesAny.js'; +export var resolveDependencies = { + ConstantNodeDependencies, + FunctionNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + parseDependencies, + typedDependencies, + createResolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js new file mode 100644 index 0000000..41f61b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createResultSet } from '../../factoriesAny.js'; +export var ResultSetDependencies = { + createResultSet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js new file mode 100644 index 0000000..3dd5918 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createReviver } from '../../factoriesAny.js'; +export var reviverDependencies = { + createReviver +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js new file mode 100644 index 0000000..daf2347 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createRightArithShift } from '../../factoriesAny.js'; +export var rightArithShiftDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createRightArithShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js new file mode 100644 index 0000000..22dade3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createRightLogShift } from '../../factoriesAny.js'; +export var rightLogShiftDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createRightLogShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js new file mode 100644 index 0000000..faf69a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { rotationMatrixDependencies } from './dependenciesRotationMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRotate } from '../../factoriesAny.js'; +export var rotateDependencies = { + multiplyDependencies, + rotationMatrixDependencies, + typedDependencies, + createRotate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js new file mode 100644 index 0000000..667ce47 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js @@ -0,0 +1,30 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { cosDependencies } from './dependenciesCos.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { normDependencies } from './dependenciesNorm.generated.js'; +import { sinDependencies } from './dependenciesSin.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createRotationMatrix } from '../../factoriesAny.js'; +export var rotationMatrixDependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + SparseMatrixDependencies, + addScalarDependencies, + cosDependencies, + matrixDependencies, + multiplyScalarDependencies, + normDependencies, + sinDependencies, + typedDependencies, + unaryMinusDependencies, + createRotationMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js new file mode 100644 index 0000000..38f9715 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createRound } from '../../factoriesAny.js'; +export var roundDependencies = { + BigNumberDependencies, + DenseMatrixDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createRound +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js new file mode 100644 index 0000000..78165be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { rangeDependencies } from './dependenciesRange.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRow } from '../../factoriesAny.js'; +export var rowDependencies = { + IndexDependencies, + matrixDependencies, + rangeDependencies, + typedDependencies, + createRow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js new file mode 100644 index 0000000..b5d752f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { rangeDependencies } from './dependenciesRange.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRowTransform } from '../../factoriesAny.js'; +export var rowTransformDependencies = { + IndexDependencies, + matrixDependencies, + rangeDependencies, + typedDependencies, + createRowTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js new file mode 100644 index 0000000..7494da9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createRydberg } from '../../factoriesAny.js'; +export var rydbergDependencies = { + BigNumberDependencies, + UnitDependencies, + createRydberg +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js new file mode 100644 index 0000000..1b52232 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createSQRT1_2 } from '../../factoriesAny.js'; // eslint-disable-line camelcase + +export var SQRT1_2Dependencies = { + // eslint-disable-line camelcase + BigNumberDependencies, + createSQRT1_2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js new file mode 100644 index 0000000..3ed6f02 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createSQRT2 } from '../../factoriesAny.js'; +export var SQRT2Dependencies = { + BigNumberDependencies, + createSQRT2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js new file mode 100644 index 0000000..c5dcbee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createSackurTetrode } from '../../factoriesAny.js'; +export var sackurTetrodeDependencies = { + BigNumberDependencies, + createSackurTetrode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js new file mode 100644 index 0000000..d378d60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { normDependencies } from './dependenciesNorm.generated.js'; +import { qrDependencies } from './dependenciesQr.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSchur } from '../../factoriesAny.js'; +export var schurDependencies = { + identityDependencies, + matrixDependencies, + multiplyDependencies, + normDependencies, + qrDependencies, + subtractDependencies, + typedDependencies, + createSchur +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js new file mode 100644 index 0000000..cadafe2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSec } from '../../factoriesAny.js'; +export var secDependencies = { + BigNumberDependencies, + typedDependencies, + createSec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js new file mode 100644 index 0000000..51c336e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSech } from '../../factoriesAny.js'; +export var sechDependencies = { + BigNumberDependencies, + typedDependencies, + createSech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js new file mode 100644 index 0000000..29a2a14 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createSecondRadiation } from '../../factoriesAny.js'; +export var secondRadiationDependencies = { + BigNumberDependencies, + UnitDependencies, + createSecondRadiation +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js new file mode 100644 index 0000000..5156f57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetCartesian } from '../../factoriesAny.js'; +export var setCartesianDependencies = { + DenseMatrixDependencies, + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetCartesian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js new file mode 100644 index 0000000..da3d014 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetDifference } from '../../factoriesAny.js'; +export var setDifferenceDependencies = { + DenseMatrixDependencies, + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetDifference +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js new file mode 100644 index 0000000..2fa0712 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetDistinct } from '../../factoriesAny.js'; +export var setDistinctDependencies = { + DenseMatrixDependencies, + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetDistinct +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js new file mode 100644 index 0000000..9af570f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetIntersect } from '../../factoriesAny.js'; +export var setIntersectDependencies = { + DenseMatrixDependencies, + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetIntersect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js new file mode 100644 index 0000000..a868e2e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetIsSubset } from '../../factoriesAny.js'; +export var setIsSubsetDependencies = { + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetIsSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js new file mode 100644 index 0000000..4a9cdeb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetMultiplicity } from '../../factoriesAny.js'; +export var setMultiplicityDependencies = { + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetMultiplicity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js new file mode 100644 index 0000000..9914a7d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetPowerset } from '../../factoriesAny.js'; +export var setPowersetDependencies = { + IndexDependencies, + compareNaturalDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetPowerset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js new file mode 100644 index 0000000..7dcdab9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetSize } from '../../factoriesAny.js'; +export var setSizeDependencies = { + compareNaturalDependencies, + typedDependencies, + createSetSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js new file mode 100644 index 0000000..3a3cee2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { setDifferenceDependencies } from './dependenciesSetDifference.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetSymDifference } from '../../factoriesAny.js'; +export var setSymDifferenceDependencies = { + IndexDependencies, + concatDependencies, + setDifferenceDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetSymDifference +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js new file mode 100644 index 0000000..c288bf6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { IndexDependencies } from './dependenciesIndexClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { setIntersectDependencies } from './dependenciesSetIntersect.generated.js'; +import { setSymDifferenceDependencies } from './dependenciesSetSymDifference.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSetUnion } from '../../factoriesAny.js'; +export var setUnionDependencies = { + IndexDependencies, + concatDependencies, + setIntersectDependencies, + setSymDifferenceDependencies, + sizeDependencies, + subsetDependencies, + typedDependencies, + createSetUnion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js new file mode 100644 index 0000000..e3f38ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { complexDependencies } from './dependenciesComplex.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSign } from '../../factoriesAny.js'; +export var signDependencies = { + BigNumberDependencies, + FractionDependencies, + complexDependencies, + typedDependencies, + createSign +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js new file mode 100644 index 0000000..1256171 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js @@ -0,0 +1,56 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { fractionDependencies } from './dependenciesFraction.generated.js'; +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { resolveDependencies } from './dependenciesResolve.generated.js'; +import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; +import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplify } from '../../factoriesAny.js'; +export var simplifyDependencies = { + bignumberDependencies, + fractionDependencies, + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + resolveDependencies, + simplifyConstantDependencies, + simplifyCoreDependencies, + subtractDependencies, + typedDependencies, + createSimplify +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js new file mode 100644 index 0000000..e437aa7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js @@ -0,0 +1,32 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { fractionDependencies } from './dependenciesFraction.generated.js'; +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplifyConstant } from '../../factoriesAny.js'; +export var simplifyConstantDependencies = { + bignumberDependencies, + fractionDependencies, + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + SymbolNodeDependencies, + matrixDependencies, + typedDependencies, + createSimplifyConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js new file mode 100644 index 0000000..aea2f14 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js @@ -0,0 +1,44 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplifyCore } from '../../factoriesAny.js'; +export var simplifyCoreDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + subtractDependencies, + typedDependencies, + createSimplifyCore +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js new file mode 100644 index 0000000..44dc216 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSin } from '../../factoriesAny.js'; +export var sinDependencies = { + typedDependencies, + createSin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js new file mode 100644 index 0000000..6eacc28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSinh } from '../../factoriesAny.js'; +export var sinhDependencies = { + typedDependencies, + createSinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js new file mode 100644 index 0000000..19d3a80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSize } from '../../factoriesAny.js'; +export var sizeDependencies = { + matrixDependencies, + typedDependencies, + createSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js new file mode 100644 index 0000000..a348ceb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js @@ -0,0 +1,28 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { largerEqDependencies } from './dependenciesLargerEq.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { transposeDependencies } from './dependenciesTranspose.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSlu } from '../../factoriesAny.js'; +export var sluDependencies = { + SparseMatrixDependencies, + absDependencies, + addDependencies, + divideScalarDependencies, + largerDependencies, + largerEqDependencies, + multiplyDependencies, + subtractDependencies, + transposeDependencies, + typedDependencies, + createSlu +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js new file mode 100644 index 0000000..c82629e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSmaller } from '../../factoriesAny.js'; +export var smallerDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createSmaller +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js new file mode 100644 index 0000000..9c417da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSmallerEq } from '../../factoriesAny.js'; +export var smallerEqDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createSmallerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js new file mode 100644 index 0000000..622f62c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js @@ -0,0 +1,38 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { mapDependencies } from './dependenciesMap.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { maxDependencies } from './dependenciesMax.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createSolveODE } from '../../factoriesAny.js'; +export var solveODEDependencies = { + absDependencies, + addDependencies, + bignumberDependencies, + divideDependencies, + isNegativeDependencies, + isPositiveDependencies, + largerDependencies, + mapDependencies, + matrixDependencies, + maxDependencies, + multiplyDependencies, + smallerDependencies, + subtractDependencies, + typedDependencies, + unaryMinusDependencies, + createSolveODE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js new file mode 100644 index 0000000..7ce4fa8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { compareNaturalDependencies } from './dependenciesCompareNatural.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSort } from '../../factoriesAny.js'; +export var sortDependencies = { + compareDependencies, + compareNaturalDependencies, + matrixDependencies, + typedDependencies, + createSort +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js new file mode 100644 index 0000000..2a2c95c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { FibonacciHeapDependencies } from './dependenciesFibonacciHeapClass.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { createSpaClass } from '../../factoriesAny.js'; +export var SpaDependencies = { + FibonacciHeapDependencies, + addScalarDependencies, + equalScalarDependencies, + createSpaClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js new file mode 100644 index 0000000..2166043 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSparse } from '../../factoriesAny.js'; +export var sparseDependencies = { + SparseMatrixDependencies, + typedDependencies, + createSparse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js new file mode 100644 index 0000000..220d4be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { MatrixDependencies } from './dependenciesMatrixClass.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSparseMatrixClass } from '../../factoriesAny.js'; +export var SparseMatrixDependencies = { + MatrixDependencies, + equalScalarDependencies, + typedDependencies, + createSparseMatrixClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js new file mode 100644 index 0000000..963a387 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createSpeedOfLight } from '../../factoriesAny.js'; +export var speedOfLightDependencies = { + BigNumberDependencies, + UnitDependencies, + createSpeedOfLight +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js new file mode 100644 index 0000000..67bfa6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSplitUnit } from '../../factoriesAny.js'; +export var splitUnitDependencies = { + typedDependencies, + createSplitUnit +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js new file mode 100644 index 0000000..f2a68df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSqrt } from '../../factoriesAny.js'; +export var sqrtDependencies = { + ComplexDependencies, + typedDependencies, + createSqrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js new file mode 100644 index 0000000..ad6688f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js @@ -0,0 +1,30 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { invDependencies } from './dependenciesInv.generated.js'; +import { mapDependencies } from './dependenciesMap.generated.js'; +import { maxDependencies } from './dependenciesMax.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSqrtm } from '../../factoriesAny.js'; +export var sqrtmDependencies = { + absDependencies, + addDependencies, + identityDependencies, + invDependencies, + mapDependencies, + maxDependencies, + multiplyDependencies, + sizeDependencies, + sqrtDependencies, + subtractDependencies, + typedDependencies, + createSqrtm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js new file mode 100644 index 0000000..8c24c0e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSquare } from '../../factoriesAny.js'; +export var squareDependencies = { + typedDependencies, + createSquare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js new file mode 100644 index 0000000..09c4252 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSqueeze } from '../../factoriesAny.js'; +export var squeezeDependencies = { + typedDependencies, + createSqueeze +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js new file mode 100644 index 0000000..ae94431 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { mapDependencies } from './dependenciesMap.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { varianceDependencies } from './dependenciesVariance.generated.js'; +import { createStd } from '../../factoriesAny.js'; +export var stdDependencies = { + mapDependencies, + sqrtDependencies, + typedDependencies, + varianceDependencies, + createStd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js new file mode 100644 index 0000000..c2ff940 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { mapDependencies } from './dependenciesMap.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { varianceDependencies } from './dependenciesVariance.generated.js'; +import { createStdTransform } from '../../factoriesAny.js'; +export var stdTransformDependencies = { + mapDependencies, + sqrtDependencies, + typedDependencies, + varianceDependencies, + createStdTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js new file mode 100644 index 0000000..ee5c4d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createStefanBoltzmann } from '../../factoriesAny.js'; +export var stefanBoltzmannDependencies = { + BigNumberDependencies, + UnitDependencies, + createStefanBoltzmann +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js new file mode 100644 index 0000000..de8a193 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { bignumberDependencies } from './dependenciesBignumber.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createStirlingS2 } from '../../factoriesAny.js'; +export var stirlingS2Dependencies = { + bignumberDependencies, + addScalarDependencies, + combinationsDependencies, + divideScalarDependencies, + factorialDependencies, + isIntegerDependencies, + isNegativeDependencies, + largerDependencies, + multiplyScalarDependencies, + numberDependencies, + powDependencies, + subtractScalarDependencies, + typedDependencies, + createStirlingS2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js new file mode 100644 index 0000000..e7d173e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createString } from '../../factoriesAny.js'; +export var stringDependencies = { + typedDependencies, + createString +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js new file mode 100644 index 0000000..0b4285d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createSubset } from '../../factoriesAny.js'; +export var subsetDependencies = { + addDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js new file mode 100644 index 0000000..0fb19e5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { zerosDependencies } from './dependenciesZeros.generated.js'; +import { createSubsetTransform } from '../../factoriesAny.js'; +export var subsetTransformDependencies = { + addDependencies, + matrixDependencies, + typedDependencies, + zerosDependencies, + createSubsetTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js new file mode 100644 index 0000000..a10379a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryMinusDependencies } from './dependenciesUnaryMinus.generated.js'; +import { createSubtract } from '../../factoriesAny.js'; +export var subtractDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + subtractScalarDependencies, + typedDependencies, + unaryMinusDependencies, + createSubtract +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js new file mode 100644 index 0000000..b339578 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSubtractScalar } from '../../factoriesAny.js'; +export var subtractScalarDependencies = { + typedDependencies, + createSubtractScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js new file mode 100644 index 0000000..49fc33d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSum } from '../../factoriesAny.js'; +export var sumDependencies = { + addDependencies, + numericDependencies, + typedDependencies, + createSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js new file mode 100644 index 0000000..a21526f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSumTransform } from '../../factoriesAny.js'; +export var sumTransformDependencies = { + addDependencies, + numericDependencies, + typedDependencies, + createSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js new file mode 100644 index 0000000..371d0c5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js @@ -0,0 +1,38 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { identityDependencies } from './dependenciesIdentity.generated.js'; +import { indexDependencies } from './dependenciesIndex.generated.js'; +import { lusolveDependencies } from './dependenciesLusolve.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { matrixFromColumnsDependencies } from './dependenciesMatrixFromColumns.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { rangeDependencies } from './dependenciesRange.generated.js'; +import { schurDependencies } from './dependenciesSchur.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { transposeDependencies } from './dependenciesTranspose.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSylvester } from '../../factoriesAny.js'; +export var sylvesterDependencies = { + absDependencies, + addDependencies, + concatDependencies, + identityDependencies, + indexDependencies, + lusolveDependencies, + matrixDependencies, + matrixFromColumnsDependencies, + multiplyDependencies, + rangeDependencies, + schurDependencies, + subsetDependencies, + subtractDependencies, + transposeDependencies, + typedDependencies, + createSylvester +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js new file mode 100644 index 0000000..dcde6cf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createSymbolNode } from '../../factoriesAny.js'; +export var SymbolNodeDependencies = { + UnitDependencies, + NodeDependencies, + createSymbolNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js new file mode 100644 index 0000000..6f529c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { simplifyDependencies } from './dependenciesSimplify.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSymbolicEqual } from '../../factoriesAny.js'; +export var symbolicEqualDependencies = { + OperatorNodeDependencies, + parseDependencies, + simplifyDependencies, + typedDependencies, + createSymbolicEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js new file mode 100644 index 0000000..e445666 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTan } from '../../factoriesAny.js'; +export var tanDependencies = { + typedDependencies, + createTan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js new file mode 100644 index 0000000..d770f24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTanh } from '../../factoriesAny.js'; +export var tanhDependencies = { + typedDependencies, + createTanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js new file mode 100644 index 0000000..8cf5bda --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createTau } from '../../factoriesAny.js'; +export var tauDependencies = { + BigNumberDependencies, + createTau +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js new file mode 100644 index 0000000..92d52f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createThomsonCrossSection } from '../../factoriesAny.js'; +export var thomsonCrossSectionDependencies = { + BigNumberDependencies, + UnitDependencies, + createThomsonCrossSection +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js new file mode 100644 index 0000000..c1f15e7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTo } from '../../factoriesAny.js'; +export var toDependencies = { + concatDependencies, + matrixDependencies, + typedDependencies, + createTo +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js new file mode 100644 index 0000000..48b6db0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTrace } from '../../factoriesAny.js'; +export var traceDependencies = { + addDependencies, + matrixDependencies, + typedDependencies, + createTrace +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js new file mode 100644 index 0000000..d89ace7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTranspose } from '../../factoriesAny.js'; +export var transposeDependencies = { + matrixDependencies, + typedDependencies, + createTranspose +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js new file mode 100644 index 0000000..c4e92e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createTrue } from '../../factoriesAny.js'; +export var trueDependencies = { + createTrue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js new file mode 100644 index 0000000..d9aa68b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTypeOf } from '../../factoriesAny.js'; +export var typeOfDependencies = { + typedDependencies, + createTypeOf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js new file mode 100644 index 0000000..61e4723 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { createTyped } from '../../factoriesAny.js'; +export var typedDependencies = { + BigNumberDependencies, + ComplexDependencies, + DenseMatrixDependencies, + FractionDependencies, + createTyped +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js new file mode 100644 index 0000000..465375d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnaryMinus } from '../../factoriesAny.js'; +export var unaryMinusDependencies = { + typedDependencies, + createUnaryMinus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js new file mode 100644 index 0000000..5b63a38 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnaryPlus } from '../../factoriesAny.js'; +export var unaryPlusDependencies = { + numericDependencies, + typedDependencies, + createUnaryPlus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js new file mode 100644 index 0000000..6cd3b05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnequal } from '../../factoriesAny.js'; +export var unequalDependencies = { + DenseMatrixDependencies, + concatDependencies, + equalScalarDependencies, + matrixDependencies, + typedDependencies, + createUnequal +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js new file mode 100644 index 0000000..dd979b4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js @@ -0,0 +1,38 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { FractionDependencies } from './dependenciesFractionClass.generated.js'; +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { fixDependencies } from './dependenciesFix.generated.js'; +import { formatDependencies } from './dependenciesFormat.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { roundDependencies } from './dependenciesRound.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { createUnitClass } from '../../factoriesAny.js'; +export var UnitDependencies = { + BigNumberDependencies, + ComplexDependencies, + FractionDependencies, + absDependencies, + addScalarDependencies, + divideScalarDependencies, + equalDependencies, + fixDependencies, + formatDependencies, + isNumericDependencies, + multiplyScalarDependencies, + numberDependencies, + powDependencies, + roundDependencies, + subtractScalarDependencies, + createUnitClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js new file mode 100644 index 0000000..2b82164 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnitFunction } from '../../factoriesAny.js'; +export var unitDependencies = { + UnitDependencies, + typedDependencies, + createUnitFunction +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js new file mode 100644 index 0000000..2c7a8a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { eDependencies } from './dependenciesE.generated.js'; +import { createUppercaseE } from '../../factoriesAny.js'; +export var EDependencies = { + eDependencies, + createUppercaseE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js new file mode 100644 index 0000000..fe09896 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { piDependencies } from './dependenciesPi.generated.js'; +import { createUppercasePi } from '../../factoriesAny.js'; +export var PIDependencies = { + piDependencies, + createUppercasePi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js new file mode 100644 index 0000000..ca89b20 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUsolve } from '../../factoriesAny.js'; +export var usolveDependencies = { + DenseMatrixDependencies, + divideScalarDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + subtractScalarDependencies, + typedDependencies, + createUsolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js new file mode 100644 index 0000000..263b99f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUsolveAll } from '../../factoriesAny.js'; +export var usolveAllDependencies = { + DenseMatrixDependencies, + divideScalarDependencies, + equalScalarDependencies, + matrixDependencies, + multiplyScalarDependencies, + subtractScalarDependencies, + typedDependencies, + createUsolveAll +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js new file mode 100644 index 0000000..6be2fb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createVacuumImpedance } from '../../factoriesAny.js'; +export var vacuumImpedanceDependencies = { + BigNumberDependencies, + UnitDependencies, + createVacuumImpedance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js new file mode 100644 index 0000000..49151a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { applyDependencies } from './dependenciesApply.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createVariance } from '../../factoriesAny.js'; +export var varianceDependencies = { + addDependencies, + applyDependencies, + divideDependencies, + isNaNDependencies, + multiplyDependencies, + subtractDependencies, + typedDependencies, + createVariance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js new file mode 100644 index 0000000..6095933 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { applyDependencies } from './dependenciesApply.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createVarianceTransform } from '../../factoriesAny.js'; +export var varianceTransformDependencies = { + addDependencies, + applyDependencies, + divideDependencies, + isNaNDependencies, + multiplyDependencies, + subtractDependencies, + typedDependencies, + createVarianceTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js new file mode 100644 index 0000000..7c895fe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createVersion } from '../../factoriesAny.js'; +export var versionDependencies = { + createVersion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js new file mode 100644 index 0000000..716bbf1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { createWeakMixingAngle } from '../../factoriesAny.js'; +export var weakMixingAngleDependencies = { + BigNumberDependencies, + createWeakMixingAngle +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js new file mode 100644 index 0000000..221b0b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { UnitDependencies } from './dependenciesUnitClass.generated.js'; +import { createWienDisplacement } from '../../factoriesAny.js'; +export var wienDisplacementDependencies = { + BigNumberDependencies, + UnitDependencies, + createWienDisplacement +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js new file mode 100644 index 0000000..a2e24d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createXgcd } from '../../factoriesAny.js'; +export var xgcdDependencies = { + BigNumberDependencies, + matrixDependencies, + typedDependencies, + createXgcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js new file mode 100644 index 0000000..caed806 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; +import { concatDependencies } from './dependenciesConcat.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createXor } from '../../factoriesAny.js'; +export var xorDependencies = { + DenseMatrixDependencies, + concatDependencies, + matrixDependencies, + typedDependencies, + createXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js new file mode 100644 index 0000000..de21eba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createZeros } from '../../factoriesAny.js'; +export var zerosDependencies = { + BigNumberDependencies, + matrixDependencies, + typedDependencies, + createZeros +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js new file mode 100644 index 0000000..b75ed9f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js @@ -0,0 +1,38 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { gammaDependencies } from './dependenciesGamma.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { piDependencies } from './dependenciesPi.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { sinDependencies } from './dependenciesSin.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createZeta } from '../../factoriesAny.js'; +export var zetaDependencies = { + BigNumberDependencies, + ComplexDependencies, + addDependencies, + divideDependencies, + equalDependencies, + factorialDependencies, + gammaDependencies, + isNegativeDependencies, + multiplyDependencies, + piDependencies, + powDependencies, + sinDependencies, + smallerEqDependencies, + subtractDependencies, + typedDependencies, + createZeta +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js new file mode 100644 index 0000000..bae859a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createZpk2tf } from '../../factoriesAny.js'; +export var zpk2tfDependencies = { + ComplexDependencies, + addDependencies, + multiplyDependencies, + numberDependencies, + typedDependencies, + createZpk2tf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js new file mode 100644 index 0000000..a77adfe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js @@ -0,0 +1,210 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +export { absDependencies } from './dependenciesNumber/dependenciesAbs.generated.js'; +export { AccessorNodeDependencies } from './dependenciesNumber/dependenciesAccessorNode.generated.js'; +export { acosDependencies } from './dependenciesNumber/dependenciesAcos.generated.js'; +export { acoshDependencies } from './dependenciesNumber/dependenciesAcosh.generated.js'; +export { acotDependencies } from './dependenciesNumber/dependenciesAcot.generated.js'; +export { acothDependencies } from './dependenciesNumber/dependenciesAcoth.generated.js'; +export { acscDependencies } from './dependenciesNumber/dependenciesAcsc.generated.js'; +export { acschDependencies } from './dependenciesNumber/dependenciesAcsch.generated.js'; +export { addDependencies } from './dependenciesNumber/dependenciesAdd.generated.js'; +export { addScalarDependencies } from './dependenciesNumber/dependenciesAddScalar.generated.js'; +export { andDependencies } from './dependenciesNumber/dependenciesAnd.generated.js'; +export { applyDependencies } from './dependenciesNumber/dependenciesApply.generated.js'; +export { applyTransformDependencies } from './dependenciesNumber/dependenciesApplyTransform.generated.js'; +export { ArrayNodeDependencies } from './dependenciesNumber/dependenciesArrayNode.generated.js'; +export { asecDependencies } from './dependenciesNumber/dependenciesAsec.generated.js'; +export { asechDependencies } from './dependenciesNumber/dependenciesAsech.generated.js'; +export { asinDependencies } from './dependenciesNumber/dependenciesAsin.generated.js'; +export { asinhDependencies } from './dependenciesNumber/dependenciesAsinh.generated.js'; +export { AssignmentNodeDependencies } from './dependenciesNumber/dependenciesAssignmentNode.generated.js'; +export { atanDependencies } from './dependenciesNumber/dependenciesAtan.generated.js'; +export { atan2Dependencies } from './dependenciesNumber/dependenciesAtan2.generated.js'; +export { atanhDependencies } from './dependenciesNumber/dependenciesAtanh.generated.js'; +export { bellNumbersDependencies } from './dependenciesNumber/dependenciesBellNumbers.generated.js'; +export { bigintDependencies } from './dependenciesNumber/dependenciesBigint.generated.js'; +export { bitAndDependencies } from './dependenciesNumber/dependenciesBitAnd.generated.js'; +export { bitNotDependencies } from './dependenciesNumber/dependenciesBitNot.generated.js'; +export { bitOrDependencies } from './dependenciesNumber/dependenciesBitOr.generated.js'; +export { bitXorDependencies } from './dependenciesNumber/dependenciesBitXor.generated.js'; +export { BlockNodeDependencies } from './dependenciesNumber/dependenciesBlockNode.generated.js'; +export { booleanDependencies } from './dependenciesNumber/dependenciesBoolean.generated.js'; +export { catalanDependencies } from './dependenciesNumber/dependenciesCatalan.generated.js'; +export { cbrtDependencies } from './dependenciesNumber/dependenciesCbrt.generated.js'; +export { ceilDependencies } from './dependenciesNumber/dependenciesCeil.generated.js'; +export { chainDependencies } from './dependenciesNumber/dependenciesChain.generated.js'; +export { ChainDependencies } from './dependenciesNumber/dependenciesChainClass.generated.js'; +export { cloneDependencies } from './dependenciesNumber/dependenciesClone.generated.js'; +export { combinationsDependencies } from './dependenciesNumber/dependenciesCombinations.generated.js'; +export { combinationsWithRepDependencies } from './dependenciesNumber/dependenciesCombinationsWithRep.generated.js'; +export { compareDependencies } from './dependenciesNumber/dependenciesCompare.generated.js'; +export { compareNaturalDependencies } from './dependenciesNumber/dependenciesCompareNatural.generated.js'; +export { compareTextDependencies } from './dependenciesNumber/dependenciesCompareText.generated.js'; +export { compileDependencies } from './dependenciesNumber/dependenciesCompile.generated.js'; +export { compositionDependencies } from './dependenciesNumber/dependenciesComposition.generated.js'; +export { ConditionalNodeDependencies } from './dependenciesNumber/dependenciesConditionalNode.generated.js'; +export { ConstantNodeDependencies } from './dependenciesNumber/dependenciesConstantNode.generated.js'; +export { corrDependencies } from './dependenciesNumber/dependenciesCorr.generated.js'; +export { cosDependencies } from './dependenciesNumber/dependenciesCos.generated.js'; +export { coshDependencies } from './dependenciesNumber/dependenciesCosh.generated.js'; +export { cotDependencies } from './dependenciesNumber/dependenciesCot.generated.js'; +export { cothDependencies } from './dependenciesNumber/dependenciesCoth.generated.js'; +export { cscDependencies } from './dependenciesNumber/dependenciesCsc.generated.js'; +export { cschDependencies } from './dependenciesNumber/dependenciesCsch.generated.js'; +export { cubeDependencies } from './dependenciesNumber/dependenciesCube.generated.js'; +export { cumsumDependencies } from './dependenciesNumber/dependenciesCumSum.generated.js'; +export { cumsumTransformDependencies } from './dependenciesNumber/dependenciesCumSumTransform.generated.js'; +export { deepEqualDependencies } from './dependenciesNumber/dependenciesDeepEqual.generated.js'; +export { derivativeDependencies } from './dependenciesNumber/dependenciesDerivative.generated.js'; +export { divideDependencies } from './dependenciesNumber/dependenciesDivide.generated.js'; +export { divideScalarDependencies } from './dependenciesNumber/dependenciesDivideScalar.generated.js'; +export { eDependencies } from './dependenciesNumber/dependenciesE.generated.js'; +export { equalDependencies } from './dependenciesNumber/dependenciesEqual.generated.js'; +export { equalScalarDependencies } from './dependenciesNumber/dependenciesEqualScalar.generated.js'; +export { equalTextDependencies } from './dependenciesNumber/dependenciesEqualText.generated.js'; +export { erfDependencies } from './dependenciesNumber/dependenciesErf.generated.js'; +export { evaluateDependencies } from './dependenciesNumber/dependenciesEvaluate.generated.js'; +export { expDependencies } from './dependenciesNumber/dependenciesExp.generated.js'; +export { expm1Dependencies } from './dependenciesNumber/dependenciesExpm1.generated.js'; +export { factorialDependencies } from './dependenciesNumber/dependenciesFactorial.generated.js'; +export { falseDependencies } from './dependenciesNumber/dependenciesFalse.generated.js'; +export { filterDependencies } from './dependenciesNumber/dependenciesFilter.generated.js'; +export { filterTransformDependencies } from './dependenciesNumber/dependenciesFilterTransform.generated.js'; +export { fixDependencies } from './dependenciesNumber/dependenciesFix.generated.js'; +export { floorDependencies } from './dependenciesNumber/dependenciesFloor.generated.js'; +export { forEachDependencies } from './dependenciesNumber/dependenciesForEach.generated.js'; +export { forEachTransformDependencies } from './dependenciesNumber/dependenciesForEachTransform.generated.js'; +export { formatDependencies } from './dependenciesNumber/dependenciesFormat.generated.js'; +export { FunctionAssignmentNodeDependencies } from './dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js'; +export { FunctionNodeDependencies } from './dependenciesNumber/dependenciesFunctionNode.generated.js'; +export { gammaDependencies } from './dependenciesNumber/dependenciesGamma.generated.js'; +export { gcdDependencies } from './dependenciesNumber/dependenciesGcd.generated.js'; +export { hasNumericValueDependencies } from './dependenciesNumber/dependenciesHasNumericValue.generated.js'; +export { helpDependencies } from './dependenciesNumber/dependenciesHelp.generated.js'; +export { HelpDependencies } from './dependenciesNumber/dependenciesHelpClass.generated.js'; +export { hypotDependencies } from './dependenciesNumber/dependenciesHypot.generated.js'; +export { indexDependencies } from './dependenciesNumber/dependenciesIndex.generated.js'; +export { IndexNodeDependencies } from './dependenciesNumber/dependenciesIndexNode.generated.js'; +export { InfinityDependencies } from './dependenciesNumber/dependenciesInfinity.generated.js'; +export { isIntegerDependencies } from './dependenciesNumber/dependenciesIsInteger.generated.js'; +export { isNaNDependencies } from './dependenciesNumber/dependenciesIsNaN.generated.js'; +export { isNegativeDependencies } from './dependenciesNumber/dependenciesIsNegative.generated.js'; +export { isNumericDependencies } from './dependenciesNumber/dependenciesIsNumeric.generated.js'; +export { isPositiveDependencies } from './dependenciesNumber/dependenciesIsPositive.generated.js'; +export { isPrimeDependencies } from './dependenciesNumber/dependenciesIsPrime.generated.js'; +export { isZeroDependencies } from './dependenciesNumber/dependenciesIsZero.generated.js'; +export { LN10Dependencies } from './dependenciesNumber/dependenciesLN10.generated.js'; +export { LN2Dependencies } from './dependenciesNumber/dependenciesLN2.generated.js'; +export { LOG10EDependencies } from './dependenciesNumber/dependenciesLOG10E.generated.js'; +export { LOG2EDependencies } from './dependenciesNumber/dependenciesLOG2E.generated.js'; +export { largerDependencies } from './dependenciesNumber/dependenciesLarger.generated.js'; +export { largerEqDependencies } from './dependenciesNumber/dependenciesLargerEq.generated.js'; +export { lcmDependencies } from './dependenciesNumber/dependenciesLcm.generated.js'; +export { leftShiftDependencies } from './dependenciesNumber/dependenciesLeftShift.generated.js'; +export { lgammaDependencies } from './dependenciesNumber/dependenciesLgamma.generated.js'; +export { logDependencies } from './dependenciesNumber/dependenciesLog.generated.js'; +export { log10Dependencies } from './dependenciesNumber/dependenciesLog10.generated.js'; +export { log1pDependencies } from './dependenciesNumber/dependenciesLog1p.generated.js'; +export { log2Dependencies } from './dependenciesNumber/dependenciesLog2.generated.js'; +export { madDependencies } from './dependenciesNumber/dependenciesMad.generated.js'; +export { mapDependencies } from './dependenciesNumber/dependenciesMap.generated.js'; +export { mapTransformDependencies } from './dependenciesNumber/dependenciesMapTransform.generated.js'; +export { matrixDependencies } from './dependenciesNumber/dependenciesMatrix.generated.js'; +export { maxDependencies } from './dependenciesNumber/dependenciesMax.generated.js'; +export { maxTransformDependencies } from './dependenciesNumber/dependenciesMaxTransform.generated.js'; +export { meanDependencies } from './dependenciesNumber/dependenciesMean.generated.js'; +export { meanTransformDependencies } from './dependenciesNumber/dependenciesMeanTransform.generated.js'; +export { medianDependencies } from './dependenciesNumber/dependenciesMedian.generated.js'; +export { minDependencies } from './dependenciesNumber/dependenciesMin.generated.js'; +export { minTransformDependencies } from './dependenciesNumber/dependenciesMinTransform.generated.js'; +export { modDependencies } from './dependenciesNumber/dependenciesMod.generated.js'; +export { modeDependencies } from './dependenciesNumber/dependenciesMode.generated.js'; +export { multinomialDependencies } from './dependenciesNumber/dependenciesMultinomial.generated.js'; +export { multiplyDependencies } from './dependenciesNumber/dependenciesMultiply.generated.js'; +export { multiplyScalarDependencies } from './dependenciesNumber/dependenciesMultiplyScalar.generated.js'; +export { NaNDependencies } from './dependenciesNumber/dependenciesNaN.generated.js'; +export { NodeDependencies } from './dependenciesNumber/dependenciesNode.generated.js'; +export { normDependencies } from './dependenciesNumber/dependenciesNorm.generated.js'; +export { notDependencies } from './dependenciesNumber/dependenciesNot.generated.js'; +export { nthRootDependencies } from './dependenciesNumber/dependenciesNthRoot.generated.js'; +export { nullDependencies } from './dependenciesNumber/dependenciesNull.generated.js'; +export { numberDependencies } from './dependenciesNumber/dependenciesNumber.generated.js'; +export { numericDependencies } from './dependenciesNumber/dependenciesNumeric.generated.js'; +export { ObjectNodeDependencies } from './dependenciesNumber/dependenciesObjectNode.generated.js'; +export { OperatorNodeDependencies } from './dependenciesNumber/dependenciesOperatorNode.generated.js'; +export { orDependencies } from './dependenciesNumber/dependenciesOr.generated.js'; +export { ParenthesisNodeDependencies } from './dependenciesNumber/dependenciesParenthesisNode.generated.js'; +export { parseDependencies } from './dependenciesNumber/dependenciesParse.generated.js'; +export { parserDependencies } from './dependenciesNumber/dependenciesParser.generated.js'; +export { ParserDependencies } from './dependenciesNumber/dependenciesParserClass.generated.js'; +export { partitionSelectDependencies } from './dependenciesNumber/dependenciesPartitionSelect.generated.js'; +export { permutationsDependencies } from './dependenciesNumber/dependenciesPermutations.generated.js'; +export { phiDependencies } from './dependenciesNumber/dependenciesPhi.generated.js'; +export { piDependencies } from './dependenciesNumber/dependenciesPi.generated.js'; +export { pickRandomDependencies } from './dependenciesNumber/dependenciesPickRandom.generated.js'; +export { powDependencies } from './dependenciesNumber/dependenciesPow.generated.js'; +export { printDependencies } from './dependenciesNumber/dependenciesPrint.generated.js'; +export { prodDependencies } from './dependenciesNumber/dependenciesProd.generated.js'; +export { quantileSeqDependencies } from './dependenciesNumber/dependenciesQuantileSeq.generated.js'; +export { randomDependencies } from './dependenciesNumber/dependenciesRandom.generated.js'; +export { randomIntDependencies } from './dependenciesNumber/dependenciesRandomInt.generated.js'; +export { rangeDependencies } from './dependenciesNumber/dependenciesRange.generated.js'; +export { RangeDependencies } from './dependenciesNumber/dependenciesRangeClass.generated.js'; +export { RangeNodeDependencies } from './dependenciesNumber/dependenciesRangeNode.generated.js'; +export { rangeTransformDependencies } from './dependenciesNumber/dependenciesRangeTransform.generated.js'; +export { rationalizeDependencies } from './dependenciesNumber/dependenciesRationalize.generated.js'; +export { RelationalNodeDependencies } from './dependenciesNumber/dependenciesRelationalNode.generated.js'; +export { replacerDependencies } from './dependenciesNumber/dependenciesReplacer.generated.js'; +export { resolveDependencies } from './dependenciesNumber/dependenciesResolve.generated.js'; +export { ResultSetDependencies } from './dependenciesNumber/dependenciesResultSet.generated.js'; +export { reviverDependencies } from './dependenciesNumber/dependenciesReviver.generated.js'; +export { rightArithShiftDependencies } from './dependenciesNumber/dependenciesRightArithShift.generated.js'; +export { rightLogShiftDependencies } from './dependenciesNumber/dependenciesRightLogShift.generated.js'; +export { roundDependencies } from './dependenciesNumber/dependenciesRound.generated.js'; +export { SQRT1_2Dependencies } from './dependenciesNumber/dependenciesSQRT1_2.generated.js'; // eslint-disable-line camelcase +export { SQRT2Dependencies } from './dependenciesNumber/dependenciesSQRT2.generated.js'; +export { secDependencies } from './dependenciesNumber/dependenciesSec.generated.js'; +export { sechDependencies } from './dependenciesNumber/dependenciesSech.generated.js'; +export { signDependencies } from './dependenciesNumber/dependenciesSign.generated.js'; +export { simplifyDependencies } from './dependenciesNumber/dependenciesSimplify.generated.js'; +export { simplifyConstantDependencies } from './dependenciesNumber/dependenciesSimplifyConstant.generated.js'; +export { simplifyCoreDependencies } from './dependenciesNumber/dependenciesSimplifyCore.generated.js'; +export { sinDependencies } from './dependenciesNumber/dependenciesSin.generated.js'; +export { sinhDependencies } from './dependenciesNumber/dependenciesSinh.generated.js'; +export { sizeDependencies } from './dependenciesNumber/dependenciesSize.generated.js'; +export { smallerDependencies } from './dependenciesNumber/dependenciesSmaller.generated.js'; +export { smallerEqDependencies } from './dependenciesNumber/dependenciesSmallerEq.generated.js'; +export { sqrtDependencies } from './dependenciesNumber/dependenciesSqrt.generated.js'; +export { squareDependencies } from './dependenciesNumber/dependenciesSquare.generated.js'; +export { stdDependencies } from './dependenciesNumber/dependenciesStd.generated.js'; +export { stdTransformDependencies } from './dependenciesNumber/dependenciesStdTransform.generated.js'; +export { stirlingS2Dependencies } from './dependenciesNumber/dependenciesStirlingS2.generated.js'; +export { stringDependencies } from './dependenciesNumber/dependenciesString.generated.js'; +export { subsetDependencies } from './dependenciesNumber/dependenciesSubset.generated.js'; +export { subsetTransformDependencies } from './dependenciesNumber/dependenciesSubsetTransform.generated.js'; +export { subtractDependencies } from './dependenciesNumber/dependenciesSubtract.generated.js'; +export { subtractScalarDependencies } from './dependenciesNumber/dependenciesSubtractScalar.generated.js'; +export { sumDependencies } from './dependenciesNumber/dependenciesSum.generated.js'; +export { sumTransformDependencies } from './dependenciesNumber/dependenciesSumTransform.generated.js'; +export { SymbolNodeDependencies } from './dependenciesNumber/dependenciesSymbolNode.generated.js'; +export { tanDependencies } from './dependenciesNumber/dependenciesTan.generated.js'; +export { tanhDependencies } from './dependenciesNumber/dependenciesTanh.generated.js'; +export { tauDependencies } from './dependenciesNumber/dependenciesTau.generated.js'; +export { trueDependencies } from './dependenciesNumber/dependenciesTrue.generated.js'; +export { typeOfDependencies } from './dependenciesNumber/dependenciesTypeOf.generated.js'; +export { typedDependencies } from './dependenciesNumber/dependenciesTyped.generated.js'; +export { unaryMinusDependencies } from './dependenciesNumber/dependenciesUnaryMinus.generated.js'; +export { unaryPlusDependencies } from './dependenciesNumber/dependenciesUnaryPlus.generated.js'; +export { unequalDependencies } from './dependenciesNumber/dependenciesUnequal.generated.js'; +export { EDependencies } from './dependenciesNumber/dependenciesUppercaseE.generated.js'; +export { PIDependencies } from './dependenciesNumber/dependenciesUppercasePi.generated.js'; +export { varianceDependencies } from './dependenciesNumber/dependenciesVariance.generated.js'; +export { varianceTransformDependencies } from './dependenciesNumber/dependenciesVarianceTransform.generated.js'; +export { versionDependencies } from './dependenciesNumber/dependenciesVersion.generated.js'; +export { xgcdDependencies } from './dependenciesNumber/dependenciesXgcd.generated.js'; +export { xorDependencies } from './dependenciesNumber/dependenciesXor.generated.js'; +export { zetaDependencies } from './dependenciesNumber/dependenciesZeta.generated.js'; +export { all } from './allFactoriesNumber.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js new file mode 100644 index 0000000..8e76a18 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAbs } from '../../factoriesNumber.js'; +export var absDependencies = { + typedDependencies, + createAbs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js new file mode 100644 index 0000000..eb1fee5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { createAccessorNode } from '../../factoriesNumber.js'; +export var AccessorNodeDependencies = { + NodeDependencies, + subsetDependencies, + createAccessorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js new file mode 100644 index 0000000..898a51e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcos } from '../../factoriesNumber.js'; +export var acosDependencies = { + typedDependencies, + createAcos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js new file mode 100644 index 0000000..b84cc05 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcosh } from '../../factoriesNumber.js'; +export var acoshDependencies = { + typedDependencies, + createAcosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js new file mode 100644 index 0000000..f8db302 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcot } from '../../factoriesNumber.js'; +export var acotDependencies = { + typedDependencies, + createAcot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js new file mode 100644 index 0000000..a14ff92 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcoth } from '../../factoriesNumber.js'; +export var acothDependencies = { + typedDependencies, + createAcoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js new file mode 100644 index 0000000..bc87242 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcsc } from '../../factoriesNumber.js'; +export var acscDependencies = { + typedDependencies, + createAcsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js new file mode 100644 index 0000000..3faae99 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAcsch } from '../../factoriesNumber.js'; +export var acschDependencies = { + typedDependencies, + createAcsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js new file mode 100644 index 0000000..a440e5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAdd } from '../../factoriesNumber.js'; +export var addDependencies = { + typedDependencies, + createAdd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js new file mode 100644 index 0000000..47cb618 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAddScalar } from '../../factoriesNumber.js'; +export var addScalarDependencies = { + typedDependencies, + createAddScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js new file mode 100644 index 0000000..045289d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAnd } from '../../factoriesNumber.js'; +export var andDependencies = { + typedDependencies, + createAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApply.generated.js new file mode 100644 index 0000000..fac00eb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApply.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createApply } from '../../factoriesNumber.js'; +export var applyDependencies = { + isIntegerDependencies, + typedDependencies, + createApply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApplyTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApplyTransform.generated.js new file mode 100644 index 0000000..003efa3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesApplyTransform.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createApplyTransform } from '../../factoriesNumber.js'; +export var applyTransformDependencies = { + isIntegerDependencies, + typedDependencies, + createApplyTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js new file mode 100644 index 0000000..0651558 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createArrayNode } from '../../factoriesNumber.js'; +export var ArrayNodeDependencies = { + NodeDependencies, + createArrayNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js new file mode 100644 index 0000000..79fafbe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsec } from '../../factoriesNumber.js'; +export var asecDependencies = { + typedDependencies, + createAsec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js new file mode 100644 index 0000000..607f607 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsech } from '../../factoriesNumber.js'; +export var asechDependencies = { + typedDependencies, + createAsech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js new file mode 100644 index 0000000..631c616 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsin } from '../../factoriesNumber.js'; +export var asinDependencies = { + typedDependencies, + createAsin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js new file mode 100644 index 0000000..d55d45e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAsinh } from '../../factoriesNumber.js'; +export var asinhDependencies = { + typedDependencies, + createAsinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js new file mode 100644 index 0000000..7f83cec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { subsetDependencies } from './dependenciesSubset.generated.js'; +import { createAssignmentNode } from '../../factoriesNumber.js'; +export var AssignmentNodeDependencies = { + matrixDependencies, + NodeDependencies, + subsetDependencies, + createAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js new file mode 100644 index 0000000..ed88d81 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtan } from '../../factoriesNumber.js'; +export var atanDependencies = { + typedDependencies, + createAtan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js new file mode 100644 index 0000000..8aaaafa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtan2 } from '../../factoriesNumber.js'; +export var atan2Dependencies = { + typedDependencies, + createAtan2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js new file mode 100644 index 0000000..d5b8076 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createAtanh } from '../../factoriesNumber.js'; +export var atanhDependencies = { + typedDependencies, + createAtanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js new file mode 100644 index 0000000..5464e7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { stirlingS2Dependencies } from './dependenciesStirlingS2.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBellNumbers } from '../../factoriesNumber.js'; +export var bellNumbersDependencies = { + addScalarDependencies, + isIntegerDependencies, + isNegativeDependencies, + stirlingS2Dependencies, + typedDependencies, + createBellNumbers +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js new file mode 100644 index 0000000..77f9760 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBigint } from '../../factoriesNumber.js'; +export var bigintDependencies = { + typedDependencies, + createBigint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js new file mode 100644 index 0000000..68268db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitAnd } from '../../factoriesNumber.js'; +export var bitAndDependencies = { + typedDependencies, + createBitAnd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js new file mode 100644 index 0000000..a8c3bdc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitNot } from '../../factoriesNumber.js'; +export var bitNotDependencies = { + typedDependencies, + createBitNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js new file mode 100644 index 0000000..4aeaeda --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitOr } from '../../factoriesNumber.js'; +export var bitOrDependencies = { + typedDependencies, + createBitOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js new file mode 100644 index 0000000..81badcb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBitXor } from '../../factoriesNumber.js'; +export var bitXorDependencies = { + typedDependencies, + createBitXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js new file mode 100644 index 0000000..0043939 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { ResultSetDependencies } from './dependenciesResultSet.generated.js'; +import { createBlockNode } from '../../factoriesNumber.js'; +export var BlockNodeDependencies = { + NodeDependencies, + ResultSetDependencies, + createBlockNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js new file mode 100644 index 0000000..f25ec83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createBoolean } from '../../factoriesNumber.js'; +export var booleanDependencies = { + typedDependencies, + createBoolean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js new file mode 100644 index 0000000..1933851 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCatalan } from '../../factoriesNumber.js'; +export var catalanDependencies = { + addScalarDependencies, + combinationsDependencies, + divideScalarDependencies, + isIntegerDependencies, + isNegativeDependencies, + multiplyScalarDependencies, + typedDependencies, + createCatalan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js new file mode 100644 index 0000000..48c4f97 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCbrt } from '../../factoriesNumber.js'; +export var cbrtDependencies = { + typedDependencies, + createCbrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js new file mode 100644 index 0000000..8563817 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCeil } from '../../factoriesNumber.js'; +export var ceilDependencies = { + roundDependencies, + typedDependencies, + createCeil +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js new file mode 100644 index 0000000..71e7b15 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ChainDependencies } from './dependenciesChainClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createChain } from '../../factoriesNumber.js'; +export var chainDependencies = { + ChainDependencies, + typedDependencies, + createChain +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js new file mode 100644 index 0000000..6a1b57f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createChainClass } from '../../factoriesNumber.js'; +export var ChainDependencies = { + typedDependencies, + createChainClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js new file mode 100644 index 0000000..8041edc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createClone } from '../../factoriesNumber.js'; +export var cloneDependencies = { + typedDependencies, + createClone +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js new file mode 100644 index 0000000..9cda3b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCombinations } from '../../factoriesNumber.js'; +export var combinationsDependencies = { + typedDependencies, + createCombinations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js new file mode 100644 index 0000000..e1e4790 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCombinationsWithRep } from '../../factoriesNumber.js'; +export var combinationsWithRepDependencies = { + typedDependencies, + createCombinationsWithRep +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js new file mode 100644 index 0000000..c884350 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompare } from '../../factoriesNumber.js'; +export var compareDependencies = { + typedDependencies, + createCompare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js new file mode 100644 index 0000000..9755e62 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompareNatural } from '../../factoriesNumber.js'; +export var compareNaturalDependencies = { + compareDependencies, + typedDependencies, + createCompareNatural +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js new file mode 100644 index 0000000..ea978ce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompareText } from '../../factoriesNumber.js'; +export var compareTextDependencies = { + typedDependencies, + createCompareText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js new file mode 100644 index 0000000..542a1f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCompile } from '../../factoriesNumber.js'; +export var compileDependencies = { + parseDependencies, + typedDependencies, + createCompile +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js new file mode 100644 index 0000000..f330d8e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createComposition } from '../../factoriesNumber.js'; +export var compositionDependencies = { + addScalarDependencies, + combinationsDependencies, + isIntegerDependencies, + isNegativeDependencies, + isPositiveDependencies, + largerDependencies, + typedDependencies, + createComposition +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js new file mode 100644 index 0000000..4c34e6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createConditionalNode } from '../../factoriesNumber.js'; +export var ConditionalNodeDependencies = { + NodeDependencies, + createConditionalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js new file mode 100644 index 0000000..475a167 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createConstantNode } from '../../factoriesNumber.js'; +export var ConstantNodeDependencies = { + NodeDependencies, + createConstantNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js new file mode 100644 index 0000000..d5c9449 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js @@ -0,0 +1,28 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { meanDependencies } from './dependenciesMean.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { sumDependencies } from './dependenciesSum.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCorr } from '../../factoriesNumber.js'; +export var corrDependencies = { + addDependencies, + divideDependencies, + matrixDependencies, + meanDependencies, + multiplyDependencies, + powDependencies, + sqrtDependencies, + subtractDependencies, + sumDependencies, + typedDependencies, + createCorr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js new file mode 100644 index 0000000..3e5005c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCos } from '../../factoriesNumber.js'; +export var cosDependencies = { + typedDependencies, + createCos +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js new file mode 100644 index 0000000..2baafcc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCosh } from '../../factoriesNumber.js'; +export var coshDependencies = { + typedDependencies, + createCosh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js new file mode 100644 index 0000000..674ee60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCot } from '../../factoriesNumber.js'; +export var cotDependencies = { + typedDependencies, + createCot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js new file mode 100644 index 0000000..7a0499a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCoth } from '../../factoriesNumber.js'; +export var cothDependencies = { + typedDependencies, + createCoth +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js new file mode 100644 index 0000000..9f657c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCsc } from '../../factoriesNumber.js'; +export var cscDependencies = { + typedDependencies, + createCsc +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js new file mode 100644 index 0000000..1744426 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCsch } from '../../factoriesNumber.js'; +export var cschDependencies = { + typedDependencies, + createCsch +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js new file mode 100644 index 0000000..c4ae1d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createCube } from '../../factoriesNumber.js'; +export var cubeDependencies = { + typedDependencies, + createCube +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js new file mode 100644 index 0000000..fb98496 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryPlusDependencies } from './dependenciesUnaryPlus.generated.js'; +import { createCumSum } from '../../factoriesNumber.js'; +export var cumsumDependencies = { + addDependencies, + typedDependencies, + unaryPlusDependencies, + createCumSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js new file mode 100644 index 0000000..4bc32c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { unaryPlusDependencies } from './dependenciesUnaryPlus.generated.js'; +import { createCumSumTransform } from '../../factoriesNumber.js'; +export var cumsumTransformDependencies = { + addDependencies, + typedDependencies, + unaryPlusDependencies, + createCumSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js new file mode 100644 index 0000000..994ed63 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDeepEqual } from '../../factoriesNumber.js'; +export var deepEqualDependencies = { + equalDependencies, + typedDependencies, + createDeepEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js new file mode 100644 index 0000000..388309d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js @@ -0,0 +1,30 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { simplifyDependencies } from './dependenciesSimplify.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDerivative } from '../../factoriesNumber.js'; +export var derivativeDependencies = { + ConstantNodeDependencies, + FunctionNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + equalDependencies, + isZeroDependencies, + numericDependencies, + parseDependencies, + simplifyDependencies, + typedDependencies, + createDerivative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js new file mode 100644 index 0000000..cc18b98 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDivide } from '../../factoriesNumber.js'; +export var divideDependencies = { + typedDependencies, + createDivide +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js new file mode 100644 index 0000000..7471996 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createDivideScalar } from '../../factoriesNumber.js'; +export var divideScalarDependencies = { + typedDependencies, + createDivideScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js new file mode 100644 index 0000000..734a86c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createE } from '../../factoriesNumber.js'; +export var eDependencies = { + createE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js new file mode 100644 index 0000000..f6efd58 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqual } from '../../factoriesNumber.js'; +export var equalDependencies = { + equalScalarDependencies, + typedDependencies, + createEqual +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js new file mode 100644 index 0000000..e8985ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqualScalar } from '../../factoriesNumber.js'; +export var equalScalarDependencies = { + typedDependencies, + createEqualScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js new file mode 100644 index 0000000..cfcbd90 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareTextDependencies } from './dependenciesCompareText.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEqualText } from '../../factoriesNumber.js'; +export var equalTextDependencies = { + compareTextDependencies, + isZeroDependencies, + typedDependencies, + createEqualText +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js new file mode 100644 index 0000000..ccc3714 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createErf } from '../../factoriesNumber.js'; +export var erfDependencies = { + typedDependencies, + createErf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js new file mode 100644 index 0000000..b843c1c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createEvaluate } from '../../factoriesNumber.js'; +export var evaluateDependencies = { + parseDependencies, + typedDependencies, + createEvaluate +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js new file mode 100644 index 0000000..f1af13b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createExp } from '../../factoriesNumber.js'; +export var expDependencies = { + typedDependencies, + createExp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js new file mode 100644 index 0000000..5379c46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createExpm1 } from '../../factoriesNumber.js'; +export var expm1Dependencies = { + typedDependencies, + createExpm1 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js new file mode 100644 index 0000000..9fe7608 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { gammaDependencies } from './dependenciesGamma.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFactorial } from '../../factoriesNumber.js'; +export var factorialDependencies = { + gammaDependencies, + typedDependencies, + createFactorial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js new file mode 100644 index 0000000..ba9c2d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createFalse } from '../../factoriesNumber.js'; +export var falseDependencies = { + createFalse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js new file mode 100644 index 0000000..365fbe3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFilter } from '../../factoriesNumber.js'; +export var filterDependencies = { + typedDependencies, + createFilter +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js new file mode 100644 index 0000000..9195d5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFilterTransform } from '../../factoriesNumber.js'; +export var filterTransformDependencies = { + typedDependencies, + createFilterTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js new file mode 100644 index 0000000..b0599c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ceilDependencies } from './dependenciesCeil.generated.js'; +import { floorDependencies } from './dependenciesFloor.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFix } from '../../factoriesNumber.js'; +export var fixDependencies = { + ceilDependencies, + floorDependencies, + typedDependencies, + createFix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js new file mode 100644 index 0000000..d0a65ab --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { roundDependencies } from './dependenciesRound.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFloor } from '../../factoriesNumber.js'; +export var floorDependencies = { + roundDependencies, + typedDependencies, + createFloor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js new file mode 100644 index 0000000..7bbdc94 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createForEach } from '../../factoriesNumber.js'; +export var forEachDependencies = { + typedDependencies, + createForEach +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js new file mode 100644 index 0000000..f300f41 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createForEachTransform } from '../../factoriesNumber.js'; +export var forEachTransformDependencies = { + typedDependencies, + createForEachTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js new file mode 100644 index 0000000..7be7c47 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFormat } from '../../factoriesNumber.js'; +export var formatDependencies = { + typedDependencies, + createFormat +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js new file mode 100644 index 0000000..fd579c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createFunctionAssignmentNode } from '../../factoriesNumber.js'; +export var FunctionAssignmentNodeDependencies = { + NodeDependencies, + typedDependencies, + createFunctionAssignmentNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js new file mode 100644 index 0000000..24ec5d6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { createFunctionNode } from '../../factoriesNumber.js'; +export var FunctionNodeDependencies = { + NodeDependencies, + SymbolNodeDependencies, + createFunctionNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js new file mode 100644 index 0000000..c380fe5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createGamma } from '../../factoriesNumber.js'; +export var gammaDependencies = { + typedDependencies, + createGamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js new file mode 100644 index 0000000..47feec3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createGcd } from '../../factoriesNumber.js'; +export var gcdDependencies = { + typedDependencies, + createGcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js new file mode 100644 index 0000000..d742528 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHasNumericValue } from '../../factoriesNumber.js'; +export var hasNumericValueDependencies = { + isNumericDependencies, + typedDependencies, + createHasNumericValue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js new file mode 100644 index 0000000..6afd037 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { HelpDependencies } from './dependenciesHelpClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHelp } from '../../factoriesNumber.js'; +export var helpDependencies = { + HelpDependencies, + typedDependencies, + createHelp +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js new file mode 100644 index 0000000..79b6fa0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; +import { createHelpClass } from '../../factoriesNumber.js'; +export var HelpDependencies = { + evaluateDependencies, + createHelpClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js new file mode 100644 index 0000000..fc777ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createHypot } from '../../factoriesNumber.js'; +export var hypotDependencies = { + absDependencies, + addScalarDependencies, + divideScalarDependencies, + isPositiveDependencies, + multiplyScalarDependencies, + smallerDependencies, + sqrtDependencies, + typedDependencies, + createHypot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js new file mode 100644 index 0000000..52f74db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createIndex } from '../../factoriesNumber.js'; +export var indexDependencies = { + createIndex +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js new file mode 100644 index 0000000..2d83eb2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { sizeDependencies } from './dependenciesSize.generated.js'; +import { createIndexNode } from '../../factoriesNumber.js'; +export var IndexNodeDependencies = { + NodeDependencies, + sizeDependencies, + createIndexNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js new file mode 100644 index 0000000..9e44daf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createInfinity } from '../../factoriesNumber.js'; +export var InfinityDependencies = { + createInfinity +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js new file mode 100644 index 0000000..e00294f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsInteger } from '../../factoriesNumber.js'; +export var isIntegerDependencies = { + typedDependencies, + createIsInteger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js new file mode 100644 index 0000000..abb7251 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNaN } from '../../factoriesNumber.js'; +export var isNaNDependencies = { + typedDependencies, + createIsNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js new file mode 100644 index 0000000..853c1cb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNegative } from '../../factoriesNumber.js'; +export var isNegativeDependencies = { + typedDependencies, + createIsNegative +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js new file mode 100644 index 0000000..92559b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsNumeric } from '../../factoriesNumber.js'; +export var isNumericDependencies = { + typedDependencies, + createIsNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js new file mode 100644 index 0000000..f0364ca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsPositive } from '../../factoriesNumber.js'; +export var isPositiveDependencies = { + typedDependencies, + createIsPositive +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js new file mode 100644 index 0000000..6640f72 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsPrime } from '../../factoriesNumber.js'; +export var isPrimeDependencies = { + typedDependencies, + createIsPrime +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js new file mode 100644 index 0000000..5421b80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createIsZero } from '../../factoriesNumber.js'; +export var isZeroDependencies = { + typedDependencies, + createIsZero +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js new file mode 100644 index 0000000..1400488 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createLN10 } from '../../factoriesNumber.js'; +export var LN10Dependencies = { + createLN10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js new file mode 100644 index 0000000..c2d6f69 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createLN2 } from '../../factoriesNumber.js'; +export var LN2Dependencies = { + createLN2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js new file mode 100644 index 0000000..c2b3459 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createLOG10E } from '../../factoriesNumber.js'; +export var LOG10EDependencies = { + createLOG10E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js new file mode 100644 index 0000000..f3160ad --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createLOG2E } from '../../factoriesNumber.js'; +export var LOG2EDependencies = { + createLOG2E +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js new file mode 100644 index 0000000..2f61473 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLarger } from '../../factoriesNumber.js'; +export var largerDependencies = { + typedDependencies, + createLarger +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js new file mode 100644 index 0000000..a4bb0d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLargerEq } from '../../factoriesNumber.js'; +export var largerEqDependencies = { + typedDependencies, + createLargerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js new file mode 100644 index 0000000..e4bd1f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLcm } from '../../factoriesNumber.js'; +export var lcmDependencies = { + typedDependencies, + createLcm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js new file mode 100644 index 0000000..73200ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLeftShift } from '../../factoriesNumber.js'; +export var leftShiftDependencies = { + typedDependencies, + createLeftShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js new file mode 100644 index 0000000..6efa8be --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLgamma } from '../../factoriesNumber.js'; +export var lgammaDependencies = { + typedDependencies, + createLgamma +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js new file mode 100644 index 0000000..cb01c2e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog } from '../../factoriesNumber.js'; +export var logDependencies = { + typedDependencies, + createLog +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js new file mode 100644 index 0000000..1fe8881 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog10 } from '../../factoriesNumber.js'; +export var log10Dependencies = { + typedDependencies, + createLog10 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js new file mode 100644 index 0000000..ca3d2c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog1p } from '../../factoriesNumber.js'; +export var log1pDependencies = { + typedDependencies, + createLog1p +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js new file mode 100644 index 0000000..b05a6f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createLog2 } from '../../factoriesNumber.js'; +export var log2Dependencies = { + typedDependencies, + createLog2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js new file mode 100644 index 0000000..b0f4b23 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { absDependencies } from './dependenciesAbs.generated.js'; +import { mapDependencies } from './dependenciesMap.generated.js'; +import { medianDependencies } from './dependenciesMedian.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMad } from '../../factoriesNumber.js'; +export var madDependencies = { + absDependencies, + mapDependencies, + medianDependencies, + subtractDependencies, + typedDependencies, + createMad +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js new file mode 100644 index 0000000..471b19e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMap } from '../../factoriesNumber.js'; +export var mapDependencies = { + typedDependencies, + createMap +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js new file mode 100644 index 0000000..5164952 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMapTransform } from '../../factoriesNumber.js'; +export var mapTransformDependencies = { + typedDependencies, + createMapTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js new file mode 100644 index 0000000..243ce4d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createMatrix } from '../../factoriesNumber.js'; +export var matrixDependencies = { + createMatrix +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js new file mode 100644 index 0000000..ef1a6c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMax } from '../../factoriesNumber.js'; +export var maxDependencies = { + largerDependencies, + numericDependencies, + typedDependencies, + createMax +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js new file mode 100644 index 0000000..0a8a682 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMaxTransform } from '../../factoriesNumber.js'; +export var maxTransformDependencies = { + largerDependencies, + numericDependencies, + typedDependencies, + createMaxTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js new file mode 100644 index 0000000..b98f47c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMean } from '../../factoriesNumber.js'; +export var meanDependencies = { + addDependencies, + divideDependencies, + typedDependencies, + createMean +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js new file mode 100644 index 0000000..303d649 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMeanTransform } from '../../factoriesNumber.js'; +export var meanTransformDependencies = { + addDependencies, + divideDependencies, + typedDependencies, + createMeanTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js new file mode 100644 index 0000000..901be99 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js @@ -0,0 +1,18 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { partitionSelectDependencies } from './dependenciesPartitionSelect.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMedian } from '../../factoriesNumber.js'; +export var medianDependencies = { + addDependencies, + compareDependencies, + divideDependencies, + partitionSelectDependencies, + typedDependencies, + createMedian +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js new file mode 100644 index 0000000..ad5a53e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMin } from '../../factoriesNumber.js'; +export var minDependencies = { + numericDependencies, + smallerDependencies, + typedDependencies, + createMin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js new file mode 100644 index 0000000..9443dd3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMinTransform } from '../../factoriesNumber.js'; +export var minTransformDependencies = { + numericDependencies, + smallerDependencies, + typedDependencies, + createMinTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js new file mode 100644 index 0000000..05a3684 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMod } from '../../factoriesNumber.js'; +export var modDependencies = { + typedDependencies, + createMod +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js new file mode 100644 index 0000000..536d896 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMode } from '../../factoriesNumber.js'; +export var modeDependencies = { + isNaNDependencies, + isNumericDependencies, + typedDependencies, + createMode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js new file mode 100644 index 0000000..58da7ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultinomial } from '../../factoriesNumber.js'; +export var multinomialDependencies = { + addDependencies, + divideDependencies, + factorialDependencies, + isIntegerDependencies, + isPositiveDependencies, + multiplyDependencies, + typedDependencies, + createMultinomial +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js new file mode 100644 index 0000000..85e70b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultiply } from '../../factoriesNumber.js'; +export var multiplyDependencies = { + typedDependencies, + createMultiply +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js new file mode 100644 index 0000000..9227ace --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createMultiplyScalar } from '../../factoriesNumber.js'; +export var multiplyScalarDependencies = { + typedDependencies, + createMultiplyScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js new file mode 100644 index 0000000..f1d9672 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createNaN } from '../../factoriesNumber.js'; +export var NaNDependencies = { + createNaN +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js new file mode 100644 index 0000000..65103e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createNode } from '../../factoriesNumber.js'; +export var NodeDependencies = { + createNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js new file mode 100644 index 0000000..c717d33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNorm } from '../../factoriesNumber.js'; +export var normDependencies = { + typedDependencies, + createNorm +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js new file mode 100644 index 0000000..7dd2bfb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNot } from '../../factoriesNumber.js'; +export var notDependencies = { + typedDependencies, + createNot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js new file mode 100644 index 0000000..7ec9c5d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNthRoot } from '../../factoriesNumber.js'; +export var nthRootDependencies = { + typedDependencies, + createNthRoot +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js new file mode 100644 index 0000000..4fa0bcb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createNull } from '../../factoriesNumber.js'; +export var nullDependencies = { + createNull +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js new file mode 100644 index 0000000..c694992 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createNumber } from '../../factoriesNumber.js'; +export var numberDependencies = { + typedDependencies, + createNumber +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js new file mode 100644 index 0000000..525b859 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { createNumeric } from '../../factoriesNumber.js'; +export var numericDependencies = { + numberDependencies, + createNumeric +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js new file mode 100644 index 0000000..4575c9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createObjectNode } from '../../factoriesNumber.js'; +export var ObjectNodeDependencies = { + NodeDependencies, + createObjectNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js new file mode 100644 index 0000000..a694cce --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createOperatorNode } from '../../factoriesNumber.js'; +export var OperatorNodeDependencies = { + NodeDependencies, + createOperatorNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js new file mode 100644 index 0000000..6c4cd33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createOr } from '../../factoriesNumber.js'; +export var orDependencies = { + typedDependencies, + createOr +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js new file mode 100644 index 0000000..e21611e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createParenthesisNode } from '../../factoriesNumber.js'; +export var ParenthesisNodeDependencies = { + NodeDependencies, + createParenthesisNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js new file mode 100644 index 0000000..63c742e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js @@ -0,0 +1,42 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { AssignmentNodeDependencies } from './dependenciesAssignmentNode.generated.js'; +import { BlockNodeDependencies } from './dependenciesBlockNode.generated.js'; +import { ConditionalNodeDependencies } from './dependenciesConditionalNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionAssignmentNodeDependencies } from './dependenciesFunctionAssignmentNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { RangeNodeDependencies } from './dependenciesRangeNode.generated.js'; +import { RelationalNodeDependencies } from './dependenciesRelationalNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createParse } from '../../factoriesNumber.js'; +export var parseDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + AssignmentNodeDependencies, + BlockNodeDependencies, + ConditionalNodeDependencies, + ConstantNodeDependencies, + FunctionAssignmentNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + RangeNodeDependencies, + RelationalNodeDependencies, + SymbolNodeDependencies, + numericDependencies, + typedDependencies, + createParse +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js new file mode 100644 index 0000000..b7c3dba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ParserDependencies } from './dependenciesParserClass.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createParser } from '../../factoriesNumber.js'; +export var parserDependencies = { + ParserDependencies, + typedDependencies, + createParser +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js new file mode 100644 index 0000000..bba1cc8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; +import { createParserClass } from '../../factoriesNumber.js'; +export var ParserDependencies = { + evaluateDependencies, + createParserClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js new file mode 100644 index 0000000..87a18c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { isNumericDependencies } from './dependenciesIsNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPartitionSelect } from '../../factoriesNumber.js'; +export var partitionSelectDependencies = { + compareDependencies, + isNaNDependencies, + isNumericDependencies, + typedDependencies, + createPartitionSelect +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js new file mode 100644 index 0000000..319d5b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPermutations } from '../../factoriesNumber.js'; +export var permutationsDependencies = { + factorialDependencies, + typedDependencies, + createPermutations +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js new file mode 100644 index 0000000..085d93e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createPhi } from '../../factoriesNumber.js'; +export var phiDependencies = { + createPhi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js new file mode 100644 index 0000000..76ba1ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createPi } from '../../factoriesNumber.js'; +export var piDependencies = { + createPi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js new file mode 100644 index 0000000..9d030e5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPickRandom } from '../../factoriesNumber.js'; +export var pickRandomDependencies = { + typedDependencies, + createPickRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js new file mode 100644 index 0000000..afa55f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPow } from '../../factoriesNumber.js'; +export var powDependencies = { + typedDependencies, + createPow +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js new file mode 100644 index 0000000..2c84688 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createPrint } from '../../factoriesNumber.js'; +export var printDependencies = { + typedDependencies, + createPrint +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js new file mode 100644 index 0000000..c510314 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createProd } from '../../factoriesNumber.js'; +export var prodDependencies = { + multiplyScalarDependencies, + numericDependencies, + typedDependencies, + createProd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js new file mode 100644 index 0000000..8e177e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js @@ -0,0 +1,30 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { compareDependencies } from './dependenciesCompare.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { partitionSelectDependencies } from './dependenciesPartitionSelect.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createQuantileSeq } from '../../factoriesNumber.js'; +export var quantileSeqDependencies = { + addDependencies, + compareDependencies, + divideDependencies, + isIntegerDependencies, + largerDependencies, + multiplyDependencies, + partitionSelectDependencies, + smallerDependencies, + smallerEqDependencies, + subtractDependencies, + typedDependencies, + createQuantileSeq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js new file mode 100644 index 0000000..604e834 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRandom } from '../../factoriesNumber.js'; +export var randomDependencies = { + typedDependencies, + createRandom +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js new file mode 100644 index 0000000..d0e737d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRandomInt } from '../../factoriesNumber.js'; +export var randomIntDependencies = { + typedDependencies, + createRandomInt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js new file mode 100644 index 0000000..ad9ff5e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { largerEqDependencies } from './dependenciesLargerEq.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRange } from '../../factoriesNumber.js'; +export var rangeDependencies = { + matrixDependencies, + addDependencies, + isPositiveDependencies, + largerDependencies, + largerEqDependencies, + smallerDependencies, + smallerEqDependencies, + typedDependencies, + createRange +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js new file mode 100644 index 0000000..51eb295 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createRangeClass } from '../../factoriesNumber.js'; +export var RangeDependencies = { + createRangeClass +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js new file mode 100644 index 0000000..78457e1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createRangeNode } from '../../factoriesNumber.js'; +export var RangeNodeDependencies = { + NodeDependencies, + createRangeNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js new file mode 100644 index 0000000..92c2248 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js @@ -0,0 +1,24 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { largerEqDependencies } from './dependenciesLargerEq.generated.js'; +import { smallerDependencies } from './dependenciesSmaller.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRangeTransform } from '../../factoriesNumber.js'; +export var rangeTransformDependencies = { + matrixDependencies, + addDependencies, + isPositiveDependencies, + largerDependencies, + largerEqDependencies, + smallerDependencies, + smallerEqDependencies, + typedDependencies, + createRangeTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js new file mode 100644 index 0000000..1d0831a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js @@ -0,0 +1,52 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { simplifyDependencies } from './dependenciesSimplify.generated.js'; +import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; +import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRationalize } from '../../factoriesNumber.js'; +export var rationalizeDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + simplifyDependencies, + simplifyConstantDependencies, + simplifyCoreDependencies, + subtractDependencies, + typedDependencies, + createRationalize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js new file mode 100644 index 0000000..b833c77 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createRelationalNode } from '../../factoriesNumber.js'; +export var RelationalNodeDependencies = { + NodeDependencies, + createRelationalNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js new file mode 100644 index 0000000..93af6ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createReplacer } from '../../factoriesNumber.js'; +export var replacerDependencies = { + createReplacer +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js new file mode 100644 index 0000000..420973d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js @@ -0,0 +1,20 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createResolve } from '../../factoriesNumber.js'; +export var resolveDependencies = { + ConstantNodeDependencies, + FunctionNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + parseDependencies, + typedDependencies, + createResolve +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js new file mode 100644 index 0000000..859c522 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createResultSet } from '../../factoriesNumber.js'; +export var ResultSetDependencies = { + createResultSet +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js new file mode 100644 index 0000000..00bc722 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createReviver } from '../../factoriesNumber.js'; +export var reviverDependencies = { + createReviver +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js new file mode 100644 index 0000000..335469c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRightArithShift } from '../../factoriesNumber.js'; +export var rightArithShiftDependencies = { + typedDependencies, + createRightArithShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js new file mode 100644 index 0000000..e07b745 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRightLogShift } from '../../factoriesNumber.js'; +export var rightLogShiftDependencies = { + typedDependencies, + createRightLogShift +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js new file mode 100644 index 0000000..6a77140 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createRound } from '../../factoriesNumber.js'; +export var roundDependencies = { + typedDependencies, + createRound +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js new file mode 100644 index 0000000..38a4da2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createSQRT1_2 } from '../../factoriesNumber.js'; // eslint-disable-line camelcase + +export var SQRT1_2Dependencies = { + // eslint-disable-line camelcase + createSQRT1_2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js new file mode 100644 index 0000000..5898c96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createSQRT2 } from '../../factoriesNumber.js'; +export var SQRT2Dependencies = { + createSQRT2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js new file mode 100644 index 0000000..037c4d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSec } from '../../factoriesNumber.js'; +export var secDependencies = { + typedDependencies, + createSec +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js new file mode 100644 index 0000000..b37d296 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSech } from '../../factoriesNumber.js'; +export var sechDependencies = { + typedDependencies, + createSech +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js new file mode 100644 index 0000000..27bf617 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSign } from '../../factoriesNumber.js'; +export var signDependencies = { + typedDependencies, + createSign +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js new file mode 100644 index 0000000..e3b97a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js @@ -0,0 +1,52 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { resolveDependencies } from './dependenciesResolve.generated.js'; +import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; +import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplify } from '../../factoriesNumber.js'; +export var simplifyDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + matrixDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + resolveDependencies, + simplifyConstantDependencies, + simplifyCoreDependencies, + subtractDependencies, + typedDependencies, + createSimplify +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js new file mode 100644 index 0000000..ddd2810 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js @@ -0,0 +1,28 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplifyConstant } from '../../factoriesNumber.js'; +export var simplifyConstantDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + SymbolNodeDependencies, + matrixDependencies, + typedDependencies, + createSimplifyConstant +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js new file mode 100644 index 0000000..19208d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js @@ -0,0 +1,44 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js'; +import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js'; +import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js'; +import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js'; +import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js'; +import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js'; +import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js'; +import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js'; +import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js'; +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { isZeroDependencies } from './dependenciesIsZero.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { parseDependencies } from './dependenciesParse.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSimplifyCore } from '../../factoriesNumber.js'; +export var simplifyCoreDependencies = { + AccessorNodeDependencies, + ArrayNodeDependencies, + ConstantNodeDependencies, + FunctionNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + SymbolNodeDependencies, + addDependencies, + divideDependencies, + equalDependencies, + isZeroDependencies, + multiplyDependencies, + parseDependencies, + powDependencies, + subtractDependencies, + typedDependencies, + createSimplifyCore +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js new file mode 100644 index 0000000..36e19f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSin } from '../../factoriesNumber.js'; +export var sinDependencies = { + typedDependencies, + createSin +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js new file mode 100644 index 0000000..526371a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSinh } from '../../factoriesNumber.js'; +export var sinhDependencies = { + typedDependencies, + createSinh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js new file mode 100644 index 0000000..7bf5f8c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { matrixDependencies } from './dependenciesMatrix.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSize } from '../../factoriesNumber.js'; +export var sizeDependencies = { + matrixDependencies, + typedDependencies, + createSize +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js new file mode 100644 index 0000000..c1a70ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSmaller } from '../../factoriesNumber.js'; +export var smallerDependencies = { + typedDependencies, + createSmaller +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js new file mode 100644 index 0000000..8cea526 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSmallerEq } from '../../factoriesNumber.js'; +export var smallerEqDependencies = { + typedDependencies, + createSmallerEq +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js new file mode 100644 index 0000000..4da7267 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSqrt } from '../../factoriesNumber.js'; +export var sqrtDependencies = { + typedDependencies, + createSqrt +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js new file mode 100644 index 0000000..71799ed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSquare } from '../../factoriesNumber.js'; +export var squareDependencies = { + typedDependencies, + createSquare +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js new file mode 100644 index 0000000..b279cf6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { mapDependencies } from './dependenciesMap.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { varianceDependencies } from './dependenciesVariance.generated.js'; +import { createStd } from '../../factoriesNumber.js'; +export var stdDependencies = { + mapDependencies, + sqrtDependencies, + typedDependencies, + varianceDependencies, + createStd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js new file mode 100644 index 0000000..4d7be6c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js @@ -0,0 +1,16 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { mapDependencies } from './dependenciesMap.generated.js'; +import { sqrtDependencies } from './dependenciesSqrt.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { varianceDependencies } from './dependenciesVariance.generated.js'; +import { createStdTransform } from '../../factoriesNumber.js'; +export var stdTransformDependencies = { + mapDependencies, + sqrtDependencies, + typedDependencies, + varianceDependencies, + createStdTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js new file mode 100644 index 0000000..0c958b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js @@ -0,0 +1,32 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addScalarDependencies } from './dependenciesAddScalar.generated.js'; +import { combinationsDependencies } from './dependenciesCombinations.generated.js'; +import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { largerDependencies } from './dependenciesLarger.generated.js'; +import { multiplyScalarDependencies } from './dependenciesMultiplyScalar.generated.js'; +import { numberDependencies } from './dependenciesNumber.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { subtractScalarDependencies } from './dependenciesSubtractScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createStirlingS2 } from '../../factoriesNumber.js'; +export var stirlingS2Dependencies = { + addScalarDependencies, + combinationsDependencies, + divideScalarDependencies, + factorialDependencies, + isIntegerDependencies, + isNegativeDependencies, + largerDependencies, + multiplyScalarDependencies, + numberDependencies, + powDependencies, + subtractScalarDependencies, + typedDependencies, + createStirlingS2 +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js new file mode 100644 index 0000000..57db84e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createString } from '../../factoriesNumber.js'; +export var stringDependencies = { + typedDependencies, + createString +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js new file mode 100644 index 0000000..668726f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createSubset } from '../../factoriesNumber.js'; +export var subsetDependencies = { + createSubset +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js new file mode 100644 index 0000000..6a3251a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createSubsetTransform } from '../../factoriesNumber.js'; +export var subsetTransformDependencies = { + createSubsetTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js new file mode 100644 index 0000000..3f3e157 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSubtract } from '../../factoriesNumber.js'; +export var subtractDependencies = { + typedDependencies, + createSubtract +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js new file mode 100644 index 0000000..7f69b07 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSubtractScalar } from '../../factoriesNumber.js'; +export var subtractScalarDependencies = { + typedDependencies, + createSubtractScalar +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js new file mode 100644 index 0000000..9aa4cf5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSum } from '../../factoriesNumber.js'; +export var sumDependencies = { + addDependencies, + numericDependencies, + typedDependencies, + createSum +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js new file mode 100644 index 0000000..19b997f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js @@ -0,0 +1,14 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { numericDependencies } from './dependenciesNumeric.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createSumTransform } from '../../factoriesNumber.js'; +export var sumTransformDependencies = { + addDependencies, + numericDependencies, + typedDependencies, + createSumTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js new file mode 100644 index 0000000..aca084a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { NodeDependencies } from './dependenciesNode.generated.js'; +import { createSymbolNode } from '../../factoriesNumber.js'; +export var SymbolNodeDependencies = { + NodeDependencies, + createSymbolNode +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js new file mode 100644 index 0000000..cf31167 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTan } from '../../factoriesNumber.js'; +export var tanDependencies = { + typedDependencies, + createTan +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js new file mode 100644 index 0000000..701f718 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTanh } from '../../factoriesNumber.js'; +export var tanhDependencies = { + typedDependencies, + createTanh +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js new file mode 100644 index 0000000..ca81ba7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createTau } from '../../factoriesNumber.js'; +export var tauDependencies = { + createTau +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js new file mode 100644 index 0000000..c29345a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createTrue } from '../../factoriesNumber.js'; +export var trueDependencies = { + createTrue +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js new file mode 100644 index 0000000..dd137bd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createTypeOf } from '../../factoriesNumber.js'; +export var typeOfDependencies = { + typedDependencies, + createTypeOf +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js new file mode 100644 index 0000000..2daf5ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createTyped } from '../../factoriesNumber.js'; +export var typedDependencies = { + createTyped +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js new file mode 100644 index 0000000..a7a3254 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnaryMinus } from '../../factoriesNumber.js'; +export var unaryMinusDependencies = { + typedDependencies, + createUnaryMinus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js new file mode 100644 index 0000000..dd0851d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnaryPlus } from '../../factoriesNumber.js'; +export var unaryPlusDependencies = { + typedDependencies, + createUnaryPlus +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js new file mode 100644 index 0000000..cff54df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js @@ -0,0 +1,12 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createUnequal } from '../../factoriesNumber.js'; +export var unequalDependencies = { + equalScalarDependencies, + typedDependencies, + createUnequal +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js new file mode 100644 index 0000000..152876b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { eDependencies } from './dependenciesE.generated.js'; +import { createUppercaseE } from '../../factoriesNumber.js'; +export var EDependencies = { + eDependencies, + createUppercaseE +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js new file mode 100644 index 0000000..02189a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { piDependencies } from './dependenciesPi.generated.js'; +import { createUppercasePi } from '../../factoriesNumber.js'; +export var PIDependencies = { + piDependencies, + createUppercasePi +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js new file mode 100644 index 0000000..c13bfbe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { applyDependencies } from './dependenciesApply.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createVariance } from '../../factoriesNumber.js'; +export var varianceDependencies = { + addDependencies, + applyDependencies, + divideDependencies, + isNaNDependencies, + multiplyDependencies, + subtractDependencies, + typedDependencies, + createVariance +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js new file mode 100644 index 0000000..596bb1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js @@ -0,0 +1,22 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { applyDependencies } from './dependenciesApply.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createVarianceTransform } from '../../factoriesNumber.js'; +export var varianceTransformDependencies = { + addDependencies, + applyDependencies, + divideDependencies, + isNaNDependencies, + multiplyDependencies, + subtractDependencies, + typedDependencies, + createVarianceTransform +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js new file mode 100644 index 0000000..c16c379 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js @@ -0,0 +1,8 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { createVersion } from '../../factoriesNumber.js'; +export var versionDependencies = { + createVersion +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js new file mode 100644 index 0000000..749e8e8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createXgcd } from '../../factoriesNumber.js'; +export var xgcdDependencies = { + typedDependencies, + createXgcd +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js new file mode 100644 index 0000000..192daf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js @@ -0,0 +1,10 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createXor } from '../../factoriesNumber.js'; +export var xorDependencies = { + typedDependencies, + createXor +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js new file mode 100644 index 0000000..02d3083 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js @@ -0,0 +1,34 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { addDependencies } from './dependenciesAdd.generated.js'; +import { divideDependencies } from './dependenciesDivide.generated.js'; +import { equalDependencies } from './dependenciesEqual.generated.js'; +import { factorialDependencies } from './dependenciesFactorial.generated.js'; +import { gammaDependencies } from './dependenciesGamma.generated.js'; +import { isNegativeDependencies } from './dependenciesIsNegative.generated.js'; +import { multiplyDependencies } from './dependenciesMultiply.generated.js'; +import { piDependencies } from './dependenciesPi.generated.js'; +import { powDependencies } from './dependenciesPow.generated.js'; +import { sinDependencies } from './dependenciesSin.generated.js'; +import { smallerEqDependencies } from './dependenciesSmallerEq.generated.js'; +import { subtractDependencies } from './dependenciesSubtract.generated.js'; +import { typedDependencies } from './dependenciesTyped.generated.js'; +import { createZeta } from '../../factoriesNumber.js'; +export var zetaDependencies = { + addDependencies, + divideDependencies, + equalDependencies, + factorialDependencies, + gammaDependencies, + isNegativeDependencies, + multiplyDependencies, + piDependencies, + powDependencies, + sinDependencies, + smallerEqDependencies, + subtractDependencies, + typedDependencies, + createZeta +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js new file mode 100644 index 0000000..6ebe60c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js @@ -0,0 +1,751 @@ +import _extends from "@babel/runtime/helpers/extends"; +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { config } from './configReadonly.js'; +import { createNode, createObjectNode, createOperatorNode, createParenthesisNode, createRelationalNode, createArrayNode, createBlockNode, createConditionalNode, createConstantNode, createRangeNode, createReviver, createChainClass, createFunctionAssignmentNode, createChain, createIndexNode, createAccessorNode, createAssignmentNode, createSymbolNode, createFunctionNode, createParse, createResolve, createSimplifyConstant, createCompile, createSimplifyCore, createEvaluate, createHelpClass, createParserClass, createSimplify, createSymbolicEqual, createLeafCount, createParser, createRationalize, createDerivative, createHelp, createFilterTransform, createForEachTransform, createMapTransform, createApplyTransform, createOrTransform, createAndTransform, createConcatTransform, createMaxTransform, createPrintTransform, createBitAndTransform, createDiffTransform, createMinTransform, createSubsetTransform, createBitOrTransform, createCumSumTransform, createIndexTransform, createSumTransform, createRangeTransform, createRowTransform, createColumnTransform, createMeanTransform, createQuantileSeqTransform, createVarianceTransform, createStdTransform } from '../factoriesAny.js'; +import { BigNumber, Complex, e, _false, fineStructure, Fraction, i, _Infinity, LN10, LOG10E, Matrix, _NaN, _null, phi, Range, ResultSet, SQRT1_2, +// eslint-disable-line camelcase +sackurTetrode, tau, _true, version, DenseMatrix, efimovFactor, LN2, pi, replacer, SQRT2, typed, weakMixingAngle, abs, acos, acot, acsc, addScalar, arg, asech, asinh, atan, atanh, bigint, bitNot, boolean, clone, combinations, complex, conj, cos, cot, csc, cube, equalScalar, erf, exp, expm1, filter, flatten, forEach, format, getMatrixDataType, hex, im, isInteger, isNegative, isPositive, isZero, LOG2E, lgamma, log10, log2, map, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, SparseMatrix, splitUnit, square, string, subtractScalar, tan, typeOf, acosh, acsch, apply, asec, bignumber, combinationsWithRep, cosh, csch, isNaN, isPrime, randomInt, sech, sinh, sparse, sqrt, squeeze, tanh, unaryMinus, acoth, bin, coth, fraction, isNumeric, matrix, matrixFromFunction, mode, numeric, prod, reshape, size, transpose, xgcd, zeros, asin, cbrt, concat, count, ctranspose, diag, divideScalar, dotDivide, equal, hasNumericValue, identity, kron, largerEq, leftShift, lsolve, matrixFromColumns, nthRoot, ones, qr, resize, rightArithShift, round, smaller, subtract, to, unaryPlus, usolve, xor, add, atan2, bitAnd, bitOr, bitXor, catalan, compare, compareText, cumsum, deepEqual, diff, distance, dot, equalText, floor, gcd, hypot, ImmutableDenseMatrix, Index, larger, log, lsolveAll, matrixFromRows, min, mod, multiply, nthRoots, or, partitionSelect, rightLogShift, slu, subset, sum, trace, usolveAll, zpk2tf, ceil, compareNatural, composition, cross, det, dotMultiply, FibonacciHeap, fix, index, intersect, invmod, lcm, log1p, max, setCartesian, setDistinct, setIsSubset, setPowerset, smallerEq, sort, unequal, and, range, row, setDifference, setMultiplicity, setSymDifference, Spa, column, inv, lup, pinv, pow, setIntersect, setUnion, sqrtm, Unit, vacuumImpedance, wienDisplacement, atomicMass, bohrMagneton, boltzmann, conductanceQuantum, coulomb, deuteronMass, dotPow, electricConstant, elementaryCharge, expm, faraday, fft, gamma, gravitationConstant, hartreeEnergy, ifft, klitzing, loschmidt, magneticConstant, molarMass, molarPlanckConstant, neutronMass, nuclearMagneton, planckCharge, planckLength, planckTemperature, protonMass, quantumOfCirculation, reducedPlanckConstant, rydberg, secondRadiation, speedOfLight, stefanBoltzmann, thomsonCrossSection, avogadro, bohrRadius, createUnit, divide, electronMass, factorial, firstRadiation, gravity, inverseConductanceQuantum, lusolve, magneticFluxQuantum, molarMassC12, multinomial, permutations, planckMass, polynomialRoot, setSize, solveODE, stirlingS2, unit, bellNumbers, eigs, fermiCoupling, gasConstant, kldivergence, mean, molarVolume, planckConstant, quantileSeq, variance, classicalElectronRadius, median, corr, freqz, mad, std, zeta, norm, rotationMatrix, planckTime, schur, rotate, sylvester, lyap } from './pureFunctionsAny.generated.js'; +var math = {}; // NOT pure! +var mathWithTransform = {}; // NOT pure! +var classes = {}; // NOT pure! + +export var Node = createNode({ + mathWithTransform +}); +export var ObjectNode = createObjectNode({ + Node +}); +export var OperatorNode = createOperatorNode({ + Node +}); +export var ParenthesisNode = createParenthesisNode({ + Node +}); +export var RelationalNode = createRelationalNode({ + Node +}); +export var ArrayNode = createArrayNode({ + Node +}); +export var BlockNode = createBlockNode({ + Node, + ResultSet +}); +export var ConditionalNode = createConditionalNode({ + Node +}); +export var ConstantNode = createConstantNode({ + Node +}); +export var RangeNode = createRangeNode({ + Node +}); +export var reviver = createReviver({ + classes +}); +export var Chain = createChainClass({ + math, + typed +}); +export var FunctionAssignmentNode = createFunctionAssignmentNode({ + Node, + typed +}); +export var chain = createChain({ + Chain, + typed +}); +export var IndexNode = createIndexNode({ + Node, + size +}); +export var AccessorNode = createAccessorNode({ + Node, + subset +}); +export var AssignmentNode = createAssignmentNode({ + matrix, + Node, + subset +}); +export var SymbolNode = createSymbolNode({ + Unit, + Node, + math +}); +export var FunctionNode = createFunctionNode({ + Node, + SymbolNode, + math +}); +export var parse = createParse({ + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode, + config, + numeric, + typed +}); +export var resolve = createResolve({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + parse, + typed +}); +export var simplifyConstant = createSimplifyConstant({ + bignumber, + fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + config, + mathWithTransform, + matrix, + typed +}); +export var compile = createCompile({ + parse, + typed +}); +export var simplifyCore = createSimplifyCore({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + divide, + equal, + isZero, + multiply, + parse, + pow, + subtract, + typed +}); +export var evaluate = createEvaluate({ + parse, + typed +}); +export var Help = createHelpClass({ + evaluate +}); +export var Parser = createParserClass({ + evaluate +}); +export var simplify = createSimplify({ + bignumber, + fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + config, + divide, + equal, + isZero, + mathWithTransform, + matrix, + multiply, + parse, + pow, + resolve, + simplifyConstant, + simplifyCore, + subtract, + typed +}); +export var symbolicEqual = createSymbolicEqual({ + OperatorNode, + parse, + simplify, + typed +}); +export var leafCount = createLeafCount({ + parse, + typed +}); +export var parser = createParser({ + Parser, + typed +}); +export var rationalize = createRationalize({ + bignumber, + fraction, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + config, + divide, + equal, + isZero, + mathWithTransform, + matrix, + multiply, + parse, + pow, + simplify, + simplifyConstant, + simplifyCore, + subtract, + typed +}); +export var derivative = createDerivative({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + config, + equal, + isZero, + numeric, + parse, + simplify, + typed +}); +export var help = createHelp({ + Help, + mathWithTransform, + typed +}); +_extends(math, { + e, + false: _false, + fineStructure, + i, + Infinity: _Infinity, + LN10, + LOG10E, + NaN: _NaN, + null: _null, + phi, + SQRT1_2, + sackurTetrode, + tau, + true: _true, + 'E': e, + version, + efimovFactor, + LN2, + pi, + replacer, + reviver, + SQRT2, + typed, + 'PI': pi, + weakMixingAngle, + abs, + acos, + acot, + acsc, + addScalar, + arg, + asech, + asinh, + atan, + atanh, + bigint, + bitNot, + boolean, + clone, + combinations, + complex, + conj, + cos, + cot, + csc, + cube, + equalScalar, + erf, + exp, + expm1, + filter, + flatten, + forEach, + format, + getMatrixDataType, + hex, + im, + isInteger, + isNegative, + isPositive, + isZero, + LOG2E, + lgamma, + log10, + log2, + map, + multiplyScalar, + not, + number, + oct, + pickRandom, + print, + random, + re, + sec, + sign, + sin, + splitUnit, + square, + string, + subtractScalar, + tan, + typeOf, + acosh, + acsch, + apply, + asec, + bignumber, + chain, + combinationsWithRep, + cosh, + csch, + isNaN, + isPrime, + randomInt, + sech, + sinh, + sparse, + sqrt, + squeeze, + tanh, + unaryMinus, + acoth, + bin, + coth, + fraction, + isNumeric, + matrix, + matrixFromFunction, + mode, + numeric, + prod, + reshape, + size, + transpose, + xgcd, + zeros, + asin, + cbrt, + concat, + count, + ctranspose, + diag, + divideScalar, + dotDivide, + equal, + hasNumericValue, + identity, + kron, + largerEq, + leftShift, + lsolve, + matrixFromColumns, + nthRoot, + ones, + qr, + resize, + rightArithShift, + round, + smaller, + subtract, + to, + unaryPlus, + usolve, + xor, + add, + atan2, + bitAnd, + bitOr, + bitXor, + catalan, + compare, + compareText, + cumsum, + deepEqual, + diff, + distance, + dot, + equalText, + floor, + gcd, + hypot, + larger, + log, + lsolveAll, + matrixFromRows, + min, + mod, + multiply, + nthRoots, + or, + partitionSelect, + rightLogShift, + slu, + subset, + sum, + trace, + usolveAll, + zpk2tf, + ceil, + compareNatural, + composition, + cross, + det, + dotMultiply, + fix, + index, + intersect, + invmod, + lcm, + log1p, + max, + setCartesian, + setDistinct, + setIsSubset, + setPowerset, + smallerEq, + sort, + unequal, + and, + range, + row, + setDifference, + setMultiplicity, + setSymDifference, + column, + inv, + lup, + pinv, + pow, + setIntersect, + setUnion, + sqrtm, + vacuumImpedance, + wienDisplacement, + atomicMass, + bohrMagneton, + boltzmann, + conductanceQuantum, + coulomb, + deuteronMass, + dotPow, + electricConstant, + elementaryCharge, + expm, + faraday, + fft, + gamma, + gravitationConstant, + hartreeEnergy, + ifft, + klitzing, + loschmidt, + magneticConstant, + molarMass, + molarPlanckConstant, + neutronMass, + nuclearMagneton, + planckCharge, + planckLength, + planckTemperature, + protonMass, + quantumOfCirculation, + reducedPlanckConstant, + rydberg, + secondRadiation, + speedOfLight, + stefanBoltzmann, + thomsonCrossSection, + avogadro, + bohrRadius, + createUnit, + divide, + electronMass, + factorial, + firstRadiation, + gravity, + inverseConductanceQuantum, + lusolve, + magneticFluxQuantum, + molarMassC12, + multinomial, + parse, + permutations, + planckMass, + polynomialRoot, + resolve, + setSize, + simplifyConstant, + solveODE, + stirlingS2, + unit, + bellNumbers, + compile, + eigs, + fermiCoupling, + gasConstant, + kldivergence, + mean, + molarVolume, + planckConstant, + quantileSeq, + simplifyCore, + variance, + classicalElectronRadius, + evaluate, + median, + simplify, + symbolicEqual, + corr, + freqz, + leafCount, + mad, + parser, + rationalize, + std, + zeta, + derivative, + norm, + rotationMatrix, + help, + planckTime, + schur, + rotate, + sylvester, + lyap, + config +}); +_extends(mathWithTransform, math, { + filter: createFilterTransform({ + typed + }), + forEach: createForEachTransform({ + typed + }), + map: createMapTransform({ + typed + }), + apply: createApplyTransform({ + isInteger, + typed + }), + or: createOrTransform({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed + }), + and: createAndTransform({ + add, + concat, + equalScalar, + matrix, + not, + typed, + zeros + }), + concat: createConcatTransform({ + isInteger, + matrix, + typed + }), + max: createMaxTransform({ + config, + larger, + numeric, + typed + }), + print: createPrintTransform({ + add, + matrix, + typed, + zeros + }), + bitAnd: createBitAndTransform({ + add, + concat, + equalScalar, + matrix, + not, + typed, + zeros + }), + diff: createDiffTransform({ + bignumber, + matrix, + number, + subtract, + typed + }), + min: createMinTransform({ + config, + numeric, + smaller, + typed + }), + subset: createSubsetTransform({ + add, + matrix, + typed, + zeros + }), + bitOr: createBitOrTransform({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed + }), + cumsum: createCumSumTransform({ + add, + typed, + unaryPlus + }), + index: createIndexTransform({ + Index, + getMatrixDataType + }), + sum: createSumTransform({ + add, + config, + numeric, + typed + }), + range: createRangeTransform({ + bignumber, + matrix, + add, + config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed + }), + row: createRowTransform({ + Index, + matrix, + range, + typed + }), + column: createColumnTransform({ + Index, + matrix, + range, + typed + }), + mean: createMeanTransform({ + add, + divide, + typed + }), + quantileSeq: createQuantileSeqTransform({ + add, + bignumber, + compare, + divide, + isInteger, + larger, + multiply, + partitionSelect, + smaller, + smallerEq, + subtract, + typed + }), + variance: createVarianceTransform({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed + }), + std: createStdTransform({ + map, + sqrt, + typed, + variance + }) +}); +_extends(classes, { + BigNumber, + Complex, + Fraction, + Matrix, + Node, + ObjectNode, + OperatorNode, + ParenthesisNode, + Range, + RelationalNode, + ResultSet, + ArrayNode, + BlockNode, + ConditionalNode, + ConstantNode, + DenseMatrix, + RangeNode, + Chain, + FunctionAssignmentNode, + SparseMatrix, + IndexNode, + ImmutableDenseMatrix, + Index, + AccessorNode, + AssignmentNode, + FibonacciHeap, + Spa, + Unit, + SymbolNode, + FunctionNode, + Help, + Parser +}); +Chain.createProxy(math); +export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js new file mode 100644 index 0000000..d67565b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js @@ -0,0 +1,502 @@ +import _extends from "@babel/runtime/helpers/extends"; +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { config } from './configReadonly.js'; +import { createChainClass, createNode, createObjectNode, createRangeNode, createRelationalNode, createReviver, createSymbolNode, createAccessorNode, createAssignmentNode, createBlockNode, createChain, createConditionalNode, createFunctionNode, createIndexNode, createOperatorNode, createConstantNode, createFunctionAssignmentNode, createParenthesisNode, createArrayNode, createSimplifyConstant, createParse, createResolve, createSimplifyCore, createCompile, createEvaluate, createHelpClass, createParserClass, createSimplify, createDerivative, createRationalize, createHelp, createParser, createCumSumTransform, createApplyTransform, createFilterTransform, createForEachTransform, createMapTransform, createMeanTransform, createSubsetTransform, createRangeTransform, createStdTransform, createSumTransform, createMaxTransform, createMinTransform, createVarianceTransform } from '../factoriesNumber.js'; +import { e, _false, index, _Infinity, LN10, LOG10E, matrix, _NaN, _null, phi, Range, replacer, ResultSet, SQRT1_2, +// eslint-disable-line camelcase +subset, tau, typed, unaryPlus, version, xor, abs, acos, acot, acsc, add, and, asec, asin, atan, atanh, bigint, bitNot, bitXor, boolean, cbrt, combinations, compare, compareText, cos, cot, csc, cube, divide, equalScalar, erf, exp, filter, forEach, format, gamma, isInteger, isNegative, isPositive, isZero, LOG2E, largerEq, leftShift, log, log1p, map, mean, mod, multiply, not, number, or, pi, pow, random, rightLogShift, SQRT2, sech, sin, size, smallerEq, square, string, subtract, tanh, typeOf, unequal, xgcd, acoth, addScalar, asech, bitAnd, combinationsWithRep, cosh, csch, divideScalar, equalText, expm1, isNumeric, LN2, lcm, log10, multiplyScalar, nthRoot, pickRandom, randomInt, rightArithShift, sec, sinh, sqrt, tan, unaryMinus, acosh, apply, asinh, bitOr, clone, coth, equal, factorial, hasNumericValue, isNaN, larger, log2, mode, norm, partitionSelect, print, round, smaller, subtractScalar, _true, variance, zeta, acsch, atan2, catalan, compareNatural, composition, cumsum, floor, hypot, lgamma, median, multinomial, permutations, quantileSeq, sign, std, stirlingS2, ceil, deepEqual, fix, isPrime, numeric, prod, bellNumbers, gcd, mad, range, sum, corr, max, min } from './pureFunctionsNumber.generated.js'; +var math = {}; // NOT pure! +var mathWithTransform = {}; // NOT pure! +var classes = {}; // NOT pure! + +export var Chain = createChainClass({ + math, + typed +}); +export var Node = createNode({ + mathWithTransform +}); +export var ObjectNode = createObjectNode({ + Node +}); +export var RangeNode = createRangeNode({ + Node +}); +export var RelationalNode = createRelationalNode({ + Node +}); +export var reviver = createReviver({ + classes +}); +export var SymbolNode = createSymbolNode({ + Node, + math +}); +export var AccessorNode = createAccessorNode({ + Node, + subset +}); +export var AssignmentNode = createAssignmentNode({ + matrix, + Node, + subset +}); +export var BlockNode = createBlockNode({ + Node, + ResultSet +}); +export var chain = createChain({ + Chain, + typed +}); +export var ConditionalNode = createConditionalNode({ + Node +}); +export var FunctionNode = createFunctionNode({ + Node, + SymbolNode, + math +}); +export var IndexNode = createIndexNode({ + Node, + size +}); +export var OperatorNode = createOperatorNode({ + Node +}); +export var ConstantNode = createConstantNode({ + Node +}); +export var FunctionAssignmentNode = createFunctionAssignmentNode({ + Node, + typed +}); +export var ParenthesisNode = createParenthesisNode({ + Node +}); +export var ArrayNode = createArrayNode({ + Node +}); +export var simplifyConstant = createSimplifyConstant({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + config, + mathWithTransform, + matrix, + typed +}); +export var parse = createParse({ + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode, + config, + numeric, + typed +}); +export var resolve = createResolve({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + parse, + typed +}); +export var simplifyCore = createSimplifyCore({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + divide, + equal, + isZero, + multiply, + parse, + pow, + subtract, + typed +}); +export var compile = createCompile({ + parse, + typed +}); +export var evaluate = createEvaluate({ + parse, + typed +}); +export var Help = createHelpClass({ + evaluate +}); +export var Parser = createParserClass({ + evaluate +}); +export var simplify = createSimplify({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + config, + divide, + equal, + isZero, + mathWithTransform, + matrix, + multiply, + parse, + pow, + resolve, + simplifyConstant, + simplifyCore, + subtract, + typed +}); +export var derivative = createDerivative({ + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + config, + equal, + isZero, + numeric, + parse, + simplify, + typed +}); +export var rationalize = createRationalize({ + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode, + add, + config, + divide, + equal, + isZero, + mathWithTransform, + matrix, + multiply, + parse, + pow, + simplify, + simplifyConstant, + simplifyCore, + subtract, + typed +}); +export var help = createHelp({ + Help, + mathWithTransform, + typed +}); +export var parser = createParser({ + Parser, + typed +}); +_extends(math, { + e, + false: _false, + index, + Infinity: _Infinity, + LN10, + LOG10E, + matrix, + NaN: _NaN, + null: _null, + phi, + replacer, + SQRT1_2, + subset, + tau, + typed, + unaryPlus, + 'E': e, + version, + xor, + abs, + acos, + acot, + acsc, + add, + and, + asec, + asin, + atan, + atanh, + bigint, + bitNot, + bitXor, + boolean, + cbrt, + combinations, + compare, + compareText, + cos, + cot, + csc, + cube, + divide, + equalScalar, + erf, + exp, + filter, + forEach, + format, + gamma, + isInteger, + isNegative, + isPositive, + isZero, + LOG2E, + largerEq, + leftShift, + log, + log1p, + map, + mean, + mod, + multiply, + not, + number, + or, + pi, + pow, + random, + reviver, + rightLogShift, + SQRT2, + sech, + sin, + size, + smallerEq, + square, + string, + subtract, + tanh, + typeOf, + unequal, + xgcd, + acoth, + addScalar, + asech, + bitAnd, + chain, + combinationsWithRep, + cosh, + csch, + divideScalar, + equalText, + expm1, + isNumeric, + LN2, + lcm, + log10, + multiplyScalar, + nthRoot, + pickRandom, + randomInt, + rightArithShift, + sec, + sinh, + sqrt, + tan, + unaryMinus, + acosh, + apply, + asinh, + bitOr, + clone, + coth, + equal, + factorial, + hasNumericValue, + isNaN, + larger, + log2, + mode, + norm, + partitionSelect, + print, + round, + smaller, + subtractScalar, + true: _true, + variance, + zeta, + acsch, + atan2, + catalan, + compareNatural, + composition, + cumsum, + floor, + hypot, + lgamma, + median, + multinomial, + permutations, + quantileSeq, + sign, + std, + stirlingS2, + 'PI': pi, + ceil, + deepEqual, + fix, + isPrime, + numeric, + prod, + simplifyConstant, + bellNumbers, + gcd, + mad, + range, + sum, + corr, + max, + parse, + resolve, + simplifyCore, + compile, + evaluate, + simplify, + derivative, + min, + rationalize, + help, + parser, + config +}); +_extends(mathWithTransform, math, { + cumsum: createCumSumTransform({ + add, + typed, + unaryPlus + }), + apply: createApplyTransform({ + isInteger, + typed + }), + filter: createFilterTransform({ + typed + }), + forEach: createForEachTransform({ + typed + }), + map: createMapTransform({ + typed + }), + mean: createMeanTransform({ + add, + divide, + typed + }), + subset: createSubsetTransform({}), + range: createRangeTransform({ + matrix, + add, + config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed + }), + std: createStdTransform({ + map, + sqrt, + typed, + variance + }), + sum: createSumTransform({ + add, + config, + numeric, + typed + }), + max: createMaxTransform({ + config, + larger, + numeric, + typed + }), + min: createMinTransform({ + config, + numeric, + smaller, + typed + }), + variance: createVarianceTransform({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed + }) +}); +_extends(classes, { + Range, + ResultSet, + Chain, + Node, + ObjectNode, + RangeNode, + RelationalNode, + SymbolNode, + AccessorNode, + AssignmentNode, + BlockNode, + ConditionalNode, + FunctionNode, + IndexNode, + OperatorNode, + ConstantNode, + FunctionAssignmentNode, + ParenthesisNode, + ArrayNode, + Help, + Parser +}); +Chain.createProxy(math); +export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainAny.js new file mode 100644 index 0000000..c45eb98 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainAny.js @@ -0,0 +1,22 @@ +// configuration +export { config } from './configReadonly.js'; + +// functions and constants +export * from './pureFunctionsAny.generated.js'; +export * from './impureFunctionsAny.generated.js'; +export * from './typeChecks.js'; + +// error classes +export { IndexError } from '../error/IndexError.js'; +export { DimensionError } from '../error/DimensionError.js'; +export { ArgumentsError } from '../error/ArgumentsError.js'; + +// dependency groups +export * from './dependenciesAny.generated.js'; + +// factory functions +export * from '../factoriesAny.js'; + +// core +export { create } from '../core/create.js'; +export { factory } from '../utils/factory.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainNumber.js new file mode 100644 index 0000000..e9e3ee0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/mainNumber.js @@ -0,0 +1,22 @@ +// configuration +export { config } from './configReadonly.js'; + +// functions and constants +export * from './pureFunctionsNumber.generated.js'; +export * from './impureFunctionsNumber.generated.js'; +export * from './typeChecks.js'; + +// error classes +export { IndexError } from '../error/IndexError.js'; +export { DimensionError } from '../error/DimensionError.js'; +export { ArgumentsError } from '../error/ArgumentsError.js'; + +// dependency groups +export * from './dependenciesNumber.generated.js'; + +// factory functions +export * from '../factoriesNumber.js'; + +// core +export { create } from '../core/create.js'; +export { factory } from '../utils/factory.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js new file mode 100644 index 0000000..5e32edd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js @@ -0,0 +1,1793 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { config } from './configReadonly.js'; +import { createBigNumberClass, createComplexClass, createE, createFalse, createFineStructure, createFractionClass, createI, createInfinity, createLN10, createLOG10E, createMatrixClass, createNaN, createNull, createPhi, createRangeClass, createResultSet, createSQRT1_2, +// eslint-disable-line camelcase +createSackurTetrode, createTau, createTrue, createVersion, createDenseMatrixClass, createEfimovFactor, createLN2, createPi, createReplacer, createSQRT2, createTyped, createWeakMixingAngle, createAbs, createAcos, createAcot, createAcsc, createAddScalar, createArg, createAsech, createAsinh, createAtan, createAtanh, createBigint, createBitNot, createBoolean, createClone, createCombinations, createComplex, createConj, createCos, createCot, createCsc, createCube, createEqualScalar, createErf, createExp, createExpm1, createFilter, createFlatten, createForEach, createFormat, createGetMatrixDataType, createHex, createIm, createIsInteger, createIsNegative, createIsPositive, createIsZero, createLOG2E, createLgamma, createLog10, createLog2, createMap, createMultiplyScalar, createNot, createNumber, createOct, createPickRandom, createPrint, createRandom, createRe, createSec, createSign, createSin, createSparseMatrixClass, createSplitUnit, createSquare, createString, createSubtractScalar, createTan, createTypeOf, createAcosh, createAcsch, createApply, createAsec, createBignumber, createCombinationsWithRep, createCosh, createCsch, createIsNaN, createIsPrime, createRandomInt, createSech, createSinh, createSparse, createSqrt, createSqueeze, createTanh, createUnaryMinus, createAcoth, createBin, createCoth, createFraction, createIsNumeric, createMatrix, createMatrixFromFunction, createMode, createNumeric, createProd, createReshape, createSize, createTranspose, createXgcd, createZeros, createAsin, createCbrt, createConcat, createCount, createCtranspose, createDiag, createDivideScalar, createDotDivide, createEqual, createHasNumericValue, createIdentity, createKron, createLargerEq, createLeftShift, createLsolve, createMatrixFromColumns, createNthRoot, createOnes, createQr, createResize, createRightArithShift, createRound, createSmaller, createSubtract, createTo, createUnaryPlus, createUsolve, createXor, createAdd, createAtan2, createBitAnd, createBitOr, createBitXor, createCatalan, createCompare, createCompareText, createCumSum, createDeepEqual, createDiff, createDistance, createDot, createEqualText, createFloor, createGcd, createHypot, createImmutableDenseMatrixClass, createIndexClass, createLarger, createLog, createLsolveAll, createMatrixFromRows, createMin, createMod, createMultiply, createNthRoots, createOr, createPartitionSelect, createRightLogShift, createSlu, createSubset, createSum, createTrace, createUsolveAll, createZpk2tf, createCeil, createCompareNatural, createComposition, createCross, createDet, createDotMultiply, createFibonacciHeapClass, createFix, createIndex, createIntersect, createInvmod, createLcm, createLog1p, createMax, createSetCartesian, createSetDistinct, createSetIsSubset, createSetPowerset, createSmallerEq, createSort, createUnequal, createAnd, createRange, createRow, createSetDifference, createSetMultiplicity, createSetSymDifference, createSpaClass, createColumn, createInv, createLup, createPinv, createPow, createSetIntersect, createSetUnion, createSqrtm, createUnitClass, createVacuumImpedance, createWienDisplacement, createAtomicMass, createBohrMagneton, createBoltzmann, createConductanceQuantum, createCoulomb, createDeuteronMass, createDotPow, createElectricConstant, createElementaryCharge, createExpm, createFaraday, createFft, createGamma, createGravitationConstant, createHartreeEnergy, createIfft, createKlitzing, createLoschmidt, createMagneticConstant, createMolarMass, createMolarPlanckConstant, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckLength, createPlanckTemperature, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createAvogadro, createBohrRadius, createCreateUnit, createDivide, createElectronMass, createFactorial, createFirstRadiation, createGravity, createInverseConductanceQuantum, createLusolve, createMagneticFluxQuantum, createMolarMassC12, createMultinomial, createPermutations, createPlanckMass, createPolynomialRoot, createSetSize, createSolveODE, createStirlingS2, createUnitFunction, createBellNumbers, createEigs, createFermiCoupling, createGasConstant, createKldivergence, createMean, createMolarVolume, createPlanckConstant, createQuantileSeq, createVariance, createClassicalElectronRadius, createMedian, createCorr, createFreqz, createMad, createStd, createZeta, createNorm, createRotationMatrix, createPlanckTime, createSchur, createRotate, createSylvester, createLyap } from '../factoriesAny.js'; +export var BigNumber = /* #__PURE__ */createBigNumberClass({ + config +}); +export var Complex = /* #__PURE__ */createComplexClass({}); +export var e = /* #__PURE__ */createE({ + BigNumber, + config +}); +export var _false = /* #__PURE__ */createFalse({}); +export var fineStructure = /* #__PURE__ */createFineStructure({ + BigNumber, + config +}); +export var Fraction = /* #__PURE__ */createFractionClass({}); +export var i = /* #__PURE__ */createI({ + Complex +}); +export var _Infinity = /* #__PURE__ */createInfinity({ + BigNumber, + config +}); +export var LN10 = /* #__PURE__ */createLN10({ + BigNumber, + config +}); +export var LOG10E = /* #__PURE__ */createLOG10E({ + BigNumber, + config +}); +export var Matrix = /* #__PURE__ */createMatrixClass({}); +export var _NaN = /* #__PURE__ */createNaN({ + BigNumber, + config +}); +export var _null = /* #__PURE__ */createNull({}); +export var phi = /* #__PURE__ */createPhi({ + BigNumber, + config +}); +export var Range = /* #__PURE__ */createRangeClass({}); +export var ResultSet = /* #__PURE__ */createResultSet({}); +export var SQRT1_2 = /* #__PURE__ */createSQRT1_2({ + BigNumber, + config +}); +export var sackurTetrode = /* #__PURE__ */createSackurTetrode({ + BigNumber, + config +}); +export var tau = /* #__PURE__ */createTau({ + BigNumber, + config +}); +export var _true = /* #__PURE__ */createTrue({}); +export var version = /* #__PURE__ */createVersion({}); +export var DenseMatrix = /* #__PURE__ */createDenseMatrixClass({ + Matrix +}); +export var efimovFactor = /* #__PURE__ */createEfimovFactor({ + BigNumber, + config +}); +export var LN2 = /* #__PURE__ */createLN2({ + BigNumber, + config +}); +export var pi = /* #__PURE__ */createPi({ + BigNumber, + config +}); +export var replacer = /* #__PURE__ */createReplacer({}); +export var SQRT2 = /* #__PURE__ */createSQRT2({ + BigNumber, + config +}); +export var typed = /* #__PURE__ */createTyped({ + BigNumber, + Complex, + DenseMatrix, + Fraction +}); +export var weakMixingAngle = /* #__PURE__ */createWeakMixingAngle({ + BigNumber, + config +}); +export var abs = /* #__PURE__ */createAbs({ + typed +}); +export var acos = /* #__PURE__ */createAcos({ + Complex, + config, + typed +}); +export var acot = /* #__PURE__ */createAcot({ + BigNumber, + typed +}); +export var acsc = /* #__PURE__ */createAcsc({ + BigNumber, + Complex, + config, + typed +}); +export var addScalar = /* #__PURE__ */createAddScalar({ + typed +}); +export var arg = /* #__PURE__ */createArg({ + typed +}); +export var asech = /* #__PURE__ */createAsech({ + BigNumber, + Complex, + config, + typed +}); +export var asinh = /* #__PURE__ */createAsinh({ + typed +}); +export var atan = /* #__PURE__ */createAtan({ + typed +}); +export var atanh = /* #__PURE__ */createAtanh({ + Complex, + config, + typed +}); +export var bigint = /* #__PURE__ */createBigint({ + typed +}); +export var bitNot = /* #__PURE__ */createBitNot({ + typed +}); +export var boolean = /* #__PURE__ */createBoolean({ + typed +}); +export var clone = /* #__PURE__ */createClone({ + typed +}); +export var combinations = /* #__PURE__ */createCombinations({ + typed +}); +export var complex = /* #__PURE__ */createComplex({ + Complex, + typed +}); +export var conj = /* #__PURE__ */createConj({ + typed +}); +export var cos = /* #__PURE__ */createCos({ + typed +}); +export var cot = /* #__PURE__ */createCot({ + BigNumber, + typed +}); +export var csc = /* #__PURE__ */createCsc({ + BigNumber, + typed +}); +export var cube = /* #__PURE__ */createCube({ + typed +}); +export var equalScalar = /* #__PURE__ */createEqualScalar({ + config, + typed +}); +export var erf = /* #__PURE__ */createErf({ + typed +}); +export var exp = /* #__PURE__ */createExp({ + typed +}); +export var expm1 = /* #__PURE__ */createExpm1({ + Complex, + typed +}); +export var filter = /* #__PURE__ */createFilter({ + typed +}); +export var flatten = /* #__PURE__ */createFlatten({ + typed +}); +export var forEach = /* #__PURE__ */createForEach({ + typed +}); +export var format = /* #__PURE__ */createFormat({ + typed +}); +export var getMatrixDataType = /* #__PURE__ */createGetMatrixDataType({ + typed +}); +export var hex = /* #__PURE__ */createHex({ + format, + typed +}); +export var im = /* #__PURE__ */createIm({ + typed +}); +export var isInteger = /* #__PURE__ */createIsInteger({ + typed +}); +export var isNegative = /* #__PURE__ */createIsNegative({ + config, + typed +}); +export var isPositive = /* #__PURE__ */createIsPositive({ + config, + typed +}); +export var isZero = /* #__PURE__ */createIsZero({ + equalScalar, + typed +}); +export var LOG2E = /* #__PURE__ */createLOG2E({ + BigNumber, + config +}); +export var lgamma = /* #__PURE__ */createLgamma({ + Complex, + typed +}); +export var log10 = /* #__PURE__ */createLog10({ + Complex, + config, + typed +}); +export var log2 = /* #__PURE__ */createLog2({ + Complex, + config, + typed +}); +export var map = /* #__PURE__ */createMap({ + typed +}); +export var multiplyScalar = /* #__PURE__ */createMultiplyScalar({ + typed +}); +export var not = /* #__PURE__ */createNot({ + typed +}); +export var number = /* #__PURE__ */createNumber({ + typed +}); +export var oct = /* #__PURE__ */createOct({ + format, + typed +}); +export var pickRandom = /* #__PURE__ */createPickRandom({ + config, + typed +}); +export var print = /* #__PURE__ */createPrint({ + typed +}); +export var random = /* #__PURE__ */createRandom({ + config, + typed +}); +export var re = /* #__PURE__ */createRe({ + typed +}); +export var sec = /* #__PURE__ */createSec({ + BigNumber, + typed +}); +export var sign = /* #__PURE__ */createSign({ + BigNumber, + Fraction, + complex, + typed +}); +export var sin = /* #__PURE__ */createSin({ + typed +}); +export var SparseMatrix = /* #__PURE__ */createSparseMatrixClass({ + Matrix, + equalScalar, + typed +}); +export var splitUnit = /* #__PURE__ */createSplitUnit({ + typed +}); +export var square = /* #__PURE__ */createSquare({ + typed +}); +export var string = /* #__PURE__ */createString({ + typed +}); +export var subtractScalar = /* #__PURE__ */createSubtractScalar({ + typed +}); +export var tan = /* #__PURE__ */createTan({ + typed +}); +export var typeOf = /* #__PURE__ */createTypeOf({ + typed +}); +export var acosh = /* #__PURE__ */createAcosh({ + Complex, + config, + typed +}); +export var acsch = /* #__PURE__ */createAcsch({ + BigNumber, + typed +}); +export var apply = /* #__PURE__ */createApply({ + isInteger, + typed +}); +export var asec = /* #__PURE__ */createAsec({ + BigNumber, + Complex, + config, + typed +}); +export var bignumber = /* #__PURE__ */createBignumber({ + BigNumber, + typed +}); +export var combinationsWithRep = /* #__PURE__ */createCombinationsWithRep({ + typed +}); +export var cosh = /* #__PURE__ */createCosh({ + typed +}); +export var csch = /* #__PURE__ */createCsch({ + BigNumber, + typed +}); +export var isNaN = /* #__PURE__ */createIsNaN({ + typed +}); +export var isPrime = /* #__PURE__ */createIsPrime({ + typed +}); +export var randomInt = /* #__PURE__ */createRandomInt({ + config, + typed +}); +export var sech = /* #__PURE__ */createSech({ + BigNumber, + typed +}); +export var sinh = /* #__PURE__ */createSinh({ + typed +}); +export var sparse = /* #__PURE__ */createSparse({ + SparseMatrix, + typed +}); +export var sqrt = /* #__PURE__ */createSqrt({ + Complex, + config, + typed +}); +export var squeeze = /* #__PURE__ */createSqueeze({ + typed +}); +export var tanh = /* #__PURE__ */createTanh({ + typed +}); +export var unaryMinus = /* #__PURE__ */createUnaryMinus({ + typed +}); +export var acoth = /* #__PURE__ */createAcoth({ + BigNumber, + Complex, + config, + typed +}); +export var bin = /* #__PURE__ */createBin({ + format, + typed +}); +export var coth = /* #__PURE__ */createCoth({ + BigNumber, + typed +}); +export var fraction = /* #__PURE__ */createFraction({ + Fraction, + typed +}); +export var isNumeric = /* #__PURE__ */createIsNumeric({ + typed +}); +export var matrix = /* #__PURE__ */createMatrix({ + DenseMatrix, + Matrix, + SparseMatrix, + typed +}); +export var matrixFromFunction = /* #__PURE__ */createMatrixFromFunction({ + isZero, + matrix, + typed +}); +export var mode = /* #__PURE__ */createMode({ + isNaN, + isNumeric, + typed +}); +export var numeric = /* #__PURE__ */createNumeric({ + bignumber, + fraction, + number +}); +export var prod = /* #__PURE__ */createProd({ + config, + multiplyScalar, + numeric, + typed +}); +export var reshape = /* #__PURE__ */createReshape({ + isInteger, + matrix, + typed +}); +export var size = /* #__PURE__ */createSize({ + matrix, + config, + typed +}); +export var transpose = /* #__PURE__ */createTranspose({ + matrix, + typed +}); +export var xgcd = /* #__PURE__ */createXgcd({ + BigNumber, + config, + matrix, + typed +}); +export var zeros = /* #__PURE__ */createZeros({ + BigNumber, + config, + matrix, + typed +}); +export var asin = /* #__PURE__ */createAsin({ + Complex, + config, + typed +}); +export var cbrt = /* #__PURE__ */createCbrt({ + BigNumber, + Complex, + Fraction, + config, + isNegative, + matrix, + typed, + unaryMinus +}); +export var concat = /* #__PURE__ */createConcat({ + isInteger, + matrix, + typed +}); +export var count = /* #__PURE__ */createCount({ + prod, + size, + typed +}); +export var ctranspose = /* #__PURE__ */createCtranspose({ + conj, + transpose, + typed +}); +export var diag = /* #__PURE__ */createDiag({ + DenseMatrix, + SparseMatrix, + matrix, + typed +}); +export var divideScalar = /* #__PURE__ */createDivideScalar({ + numeric, + typed +}); +export var dotDivide = /* #__PURE__ */createDotDivide({ + DenseMatrix, + concat, + divideScalar, + equalScalar, + matrix, + typed +}); +export var equal = /* #__PURE__ */createEqual({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +export var hasNumericValue = /* #__PURE__ */createHasNumericValue({ + isNumeric, + typed +}); +export var identity = /* #__PURE__ */createIdentity({ + BigNumber, + DenseMatrix, + SparseMatrix, + config, + matrix, + typed +}); +export var kron = /* #__PURE__ */createKron({ + matrix, + multiplyScalar, + typed +}); +export var largerEq = /* #__PURE__ */createLargerEq({ + DenseMatrix, + concat, + config, + matrix, + typed +}); +export var leftShift = /* #__PURE__ */createLeftShift({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +export var lsolve = /* #__PURE__ */createLsolve({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +export var matrixFromColumns = /* #__PURE__ */createMatrixFromColumns({ + flatten, + matrix, + size, + typed +}); +export var nthRoot = /* #__PURE__ */createNthRoot({ + BigNumber, + concat, + equalScalar, + matrix, + typed +}); +export var ones = /* #__PURE__ */createOnes({ + BigNumber, + config, + matrix, + typed +}); +export var qr = /* #__PURE__ */createQr({ + addScalar, + complex, + conj, + divideScalar, + equal, + identity, + isZero, + matrix, + multiplyScalar, + sign, + sqrt, + subtractScalar, + typed, + unaryMinus, + zeros +}); +export var resize = /* #__PURE__ */createResize({ + config, + matrix +}); +export var rightArithShift = /* #__PURE__ */createRightArithShift({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +export var round = /* #__PURE__ */createRound({ + BigNumber, + DenseMatrix, + config, + equalScalar, + matrix, + typed, + zeros +}); +export var smaller = /* #__PURE__ */createSmaller({ + DenseMatrix, + concat, + config, + matrix, + typed +}); +export var subtract = /* #__PURE__ */createSubtract({ + DenseMatrix, + concat, + equalScalar, + matrix, + subtractScalar, + typed, + unaryMinus +}); +export var to = /* #__PURE__ */createTo({ + concat, + matrix, + typed +}); +export var unaryPlus = /* #__PURE__ */createUnaryPlus({ + config, + numeric, + typed +}); +export var usolve = /* #__PURE__ */createUsolve({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +export var xor = /* #__PURE__ */createXor({ + DenseMatrix, + concat, + matrix, + typed +}); +export var add = /* #__PURE__ */createAdd({ + DenseMatrix, + SparseMatrix, + addScalar, + concat, + equalScalar, + matrix, + typed +}); +export var atan2 = /* #__PURE__ */createAtan2({ + BigNumber, + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +export var bitAnd = /* #__PURE__ */createBitAnd({ + concat, + equalScalar, + matrix, + typed +}); +export var bitOr = /* #__PURE__ */createBitOr({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +export var bitXor = /* #__PURE__ */createBitXor({ + DenseMatrix, + concat, + matrix, + typed +}); +export var catalan = /* #__PURE__ */createCatalan({ + addScalar, + combinations, + divideScalar, + isInteger, + isNegative, + multiplyScalar, + typed +}); +export var compare = /* #__PURE__ */createCompare({ + BigNumber, + DenseMatrix, + Fraction, + concat, + config, + equalScalar, + matrix, + typed +}); +export var compareText = /* #__PURE__ */createCompareText({ + concat, + matrix, + typed +}); +export var cumsum = /* #__PURE__ */createCumSum({ + add, + typed, + unaryPlus +}); +export var deepEqual = /* #__PURE__ */createDeepEqual({ + equal, + typed +}); +export var diff = /* #__PURE__ */createDiff({ + matrix, + number, + subtract, + typed +}); +export var distance = /* #__PURE__ */createDistance({ + abs, + addScalar, + deepEqual, + divideScalar, + multiplyScalar, + sqrt, + subtractScalar, + typed +}); +export var dot = /* #__PURE__ */createDot({ + addScalar, + conj, + multiplyScalar, + size, + typed +}); +export var equalText = /* #__PURE__ */createEqualText({ + compareText, + isZero, + typed +}); +export var floor = /* #__PURE__ */createFloor({ + DenseMatrix, + config, + equalScalar, + matrix, + round, + typed, + zeros +}); +export var gcd = /* #__PURE__ */createGcd({ + BigNumber, + DenseMatrix, + concat, + config, + equalScalar, + matrix, + round, + typed, + zeros +}); +export var hypot = /* #__PURE__ */createHypot({ + abs, + addScalar, + divideScalar, + isPositive, + multiplyScalar, + smaller, + sqrt, + typed +}); +export var ImmutableDenseMatrix = /* #__PURE__ */createImmutableDenseMatrixClass({ + DenseMatrix, + smaller +}); +export var Index = /* #__PURE__ */createIndexClass({ + ImmutableDenseMatrix, + getMatrixDataType +}); +export var larger = /* #__PURE__ */createLarger({ + DenseMatrix, + concat, + config, + matrix, + typed +}); +export var log = /* #__PURE__ */createLog({ + Complex, + config, + divideScalar, + typed +}); +export var lsolveAll = /* #__PURE__ */createLsolveAll({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +export var matrixFromRows = /* #__PURE__ */createMatrixFromRows({ + flatten, + matrix, + size, + typed +}); +export var min = /* #__PURE__ */createMin({ + config, + numeric, + smaller, + typed +}); +export var mod = /* #__PURE__ */createMod({ + DenseMatrix, + concat, + config, + equalScalar, + matrix, + round, + typed, + zeros +}); +export var multiply = /* #__PURE__ */createMultiply({ + addScalar, + dot, + equalScalar, + matrix, + multiplyScalar, + typed +}); +export var nthRoots = /* #__PURE__ */createNthRoots({ + Complex, + config, + divideScalar, + typed +}); +export var or = /* #__PURE__ */createOr({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed +}); +export var partitionSelect = /* #__PURE__ */createPartitionSelect({ + compare, + isNaN, + isNumeric, + typed +}); +export var rightLogShift = /* #__PURE__ */createRightLogShift({ + DenseMatrix, + concat, + equalScalar, + matrix, + typed, + zeros +}); +export var slu = /* #__PURE__ */createSlu({ + SparseMatrix, + abs, + add, + divideScalar, + larger, + largerEq, + multiply, + subtract, + transpose, + typed +}); +export var subset = /* #__PURE__ */createSubset({ + add, + matrix, + typed, + zeros +}); +export var sum = /* #__PURE__ */createSum({ + add, + config, + numeric, + typed +}); +export var trace = /* #__PURE__ */createTrace({ + add, + matrix, + typed +}); +export var usolveAll = /* #__PURE__ */createUsolveAll({ + DenseMatrix, + divideScalar, + equalScalar, + matrix, + multiplyScalar, + subtractScalar, + typed +}); +export var zpk2tf = /* #__PURE__ */createZpk2tf({ + Complex, + add, + multiply, + number, + typed +}); +export var ceil = /* #__PURE__ */createCeil({ + DenseMatrix, + config, + equalScalar, + matrix, + round, + typed, + zeros +}); +export var compareNatural = /* #__PURE__ */createCompareNatural({ + compare, + typed +}); +export var composition = /* #__PURE__ */createComposition({ + addScalar, + combinations, + isInteger, + isNegative, + isPositive, + larger, + typed +}); +export var cross = /* #__PURE__ */createCross({ + matrix, + multiply, + subtract, + typed +}); +export var det = /* #__PURE__ */createDet({ + divideScalar, + isZero, + matrix, + multiply, + subtractScalar, + typed, + unaryMinus +}); +export var dotMultiply = /* #__PURE__ */createDotMultiply({ + concat, + equalScalar, + matrix, + multiplyScalar, + typed +}); +export var FibonacciHeap = /* #__PURE__ */createFibonacciHeapClass({ + larger, + smaller +}); +export var fix = /* #__PURE__ */createFix({ + Complex, + DenseMatrix, + ceil, + equalScalar, + floor, + matrix, + typed, + zeros +}); +export var index = /* #__PURE__ */createIndex({ + Index, + typed +}); +export var intersect = /* #__PURE__ */createIntersect({ + abs, + add, + addScalar, + config, + divideScalar, + equalScalar, + flatten, + isNumeric, + isZero, + matrix, + multiply, + multiplyScalar, + smaller, + subtract, + typed +}); +export var invmod = /* #__PURE__ */createInvmod({ + BigNumber, + add, + config, + equal, + isInteger, + mod, + smaller, + typed, + xgcd +}); +export var lcm = /* #__PURE__ */createLcm({ + concat, + equalScalar, + matrix, + typed +}); +export var log1p = /* #__PURE__ */createLog1p({ + Complex, + config, + divideScalar, + log, + typed +}); +export var max = /* #__PURE__ */createMax({ + config, + larger, + numeric, + typed +}); +export var setCartesian = /* #__PURE__ */createSetCartesian({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +export var setDistinct = /* #__PURE__ */createSetDistinct({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +export var setIsSubset = /* #__PURE__ */createSetIsSubset({ + Index, + compareNatural, + size, + subset, + typed +}); +export var setPowerset = /* #__PURE__ */createSetPowerset({ + Index, + compareNatural, + size, + subset, + typed +}); +export var smallerEq = /* #__PURE__ */createSmallerEq({ + DenseMatrix, + concat, + config, + matrix, + typed +}); +export var sort = /* #__PURE__ */createSort({ + compare, + compareNatural, + matrix, + typed +}); +export var unequal = /* #__PURE__ */createUnequal({ + DenseMatrix, + concat, + config, + equalScalar, + matrix, + typed +}); +export var and = /* #__PURE__ */createAnd({ + concat, + equalScalar, + matrix, + not, + typed, + zeros +}); +export var range = /* #__PURE__ */createRange({ + bignumber, + matrix, + add, + config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed +}); +export var row = /* #__PURE__ */createRow({ + Index, + matrix, + range, + typed +}); +export var setDifference = /* #__PURE__ */createSetDifference({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +export var setMultiplicity = /* #__PURE__ */createSetMultiplicity({ + Index, + compareNatural, + size, + subset, + typed +}); +export var setSymDifference = /* #__PURE__ */createSetSymDifference({ + Index, + concat, + setDifference, + size, + subset, + typed +}); +export var Spa = /* #__PURE__ */createSpaClass({ + FibonacciHeap, + addScalar, + equalScalar +}); +export var column = /* #__PURE__ */createColumn({ + Index, + matrix, + range, + typed +}); +export var inv = /* #__PURE__ */createInv({ + abs, + addScalar, + det, + divideScalar, + identity, + matrix, + multiply, + typed, + unaryMinus +}); +export var lup = /* #__PURE__ */createLup({ + DenseMatrix, + Spa, + SparseMatrix, + abs, + addScalar, + divideScalar, + equalScalar, + larger, + matrix, + multiplyScalar, + subtractScalar, + typed, + unaryMinus +}); +export var pinv = /* #__PURE__ */createPinv({ + Complex, + add, + ctranspose, + deepEqual, + divideScalar, + dot, + dotDivide, + equal, + inv, + matrix, + multiply, + typed +}); +export var pow = /* #__PURE__ */createPow({ + Complex, + config, + fraction, + identity, + inv, + matrix, + multiply, + number, + typed +}); +export var setIntersect = /* #__PURE__ */createSetIntersect({ + DenseMatrix, + Index, + compareNatural, + size, + subset, + typed +}); +export var setUnion = /* #__PURE__ */createSetUnion({ + Index, + concat, + setIntersect, + setSymDifference, + size, + subset, + typed +}); +export var sqrtm = /* #__PURE__ */createSqrtm({ + abs, + add, + identity, + inv, + map, + max, + multiply, + size, + sqrt, + subtract, + typed +}); +export var Unit = /* #__PURE__ */createUnitClass({ + BigNumber, + Complex, + Fraction, + abs, + addScalar, + config, + divideScalar, + equal, + fix, + format, + isNumeric, + multiplyScalar, + number, + pow, + round, + subtractScalar +}); +export var vacuumImpedance = /* #__PURE__ */createVacuumImpedance({ + BigNumber, + Unit, + config +}); +export var wienDisplacement = /* #__PURE__ */createWienDisplacement({ + BigNumber, + Unit, + config +}); +export var atomicMass = /* #__PURE__ */createAtomicMass({ + BigNumber, + Unit, + config +}); +export var bohrMagneton = /* #__PURE__ */createBohrMagneton({ + BigNumber, + Unit, + config +}); +export var boltzmann = /* #__PURE__ */createBoltzmann({ + BigNumber, + Unit, + config +}); +export var conductanceQuantum = /* #__PURE__ */createConductanceQuantum({ + BigNumber, + Unit, + config +}); +export var coulomb = /* #__PURE__ */createCoulomb({ + BigNumber, + Unit, + config +}); +export var deuteronMass = /* #__PURE__ */createDeuteronMass({ + BigNumber, + Unit, + config +}); +export var dotPow = /* #__PURE__ */createDotPow({ + DenseMatrix, + concat, + equalScalar, + matrix, + pow, + typed +}); +export var electricConstant = /* #__PURE__ */createElectricConstant({ + BigNumber, + Unit, + config +}); +export var elementaryCharge = /* #__PURE__ */createElementaryCharge({ + BigNumber, + Unit, + config +}); +export var expm = /* #__PURE__ */createExpm({ + abs, + add, + identity, + inv, + multiply, + typed +}); +export var faraday = /* #__PURE__ */createFaraday({ + BigNumber, + Unit, + config +}); +export var fft = /* #__PURE__ */createFft({ + addScalar, + ceil, + conj, + divideScalar, + dotDivide, + exp, + i, + log2, + matrix, + multiplyScalar, + pow, + tau, + typed +}); +export var gamma = /* #__PURE__ */createGamma({ + BigNumber, + Complex, + config, + multiplyScalar, + pow, + typed +}); +export var gravitationConstant = /* #__PURE__ */createGravitationConstant({ + BigNumber, + Unit, + config +}); +export var hartreeEnergy = /* #__PURE__ */createHartreeEnergy({ + BigNumber, + Unit, + config +}); +export var ifft = /* #__PURE__ */createIfft({ + conj, + dotDivide, + fft, + typed +}); +export var klitzing = /* #__PURE__ */createKlitzing({ + BigNumber, + Unit, + config +}); +export var loschmidt = /* #__PURE__ */createLoschmidt({ + BigNumber, + Unit, + config +}); +export var magneticConstant = /* #__PURE__ */createMagneticConstant({ + BigNumber, + Unit, + config +}); +export var molarMass = /* #__PURE__ */createMolarMass({ + BigNumber, + Unit, + config +}); +export var molarPlanckConstant = /* #__PURE__ */createMolarPlanckConstant({ + BigNumber, + Unit, + config +}); +export var neutronMass = /* #__PURE__ */createNeutronMass({ + BigNumber, + Unit, + config +}); +export var nuclearMagneton = /* #__PURE__ */createNuclearMagneton({ + BigNumber, + Unit, + config +}); +export var planckCharge = /* #__PURE__ */createPlanckCharge({ + BigNumber, + Unit, + config +}); +export var planckLength = /* #__PURE__ */createPlanckLength({ + BigNumber, + Unit, + config +}); +export var planckTemperature = /* #__PURE__ */createPlanckTemperature({ + BigNumber, + Unit, + config +}); +export var protonMass = /* #__PURE__ */createProtonMass({ + BigNumber, + Unit, + config +}); +export var quantumOfCirculation = /* #__PURE__ */createQuantumOfCirculation({ + BigNumber, + Unit, + config +}); +export var reducedPlanckConstant = /* #__PURE__ */createReducedPlanckConstant({ + BigNumber, + Unit, + config +}); +export var rydberg = /* #__PURE__ */createRydberg({ + BigNumber, + Unit, + config +}); +export var secondRadiation = /* #__PURE__ */createSecondRadiation({ + BigNumber, + Unit, + config +}); +export var speedOfLight = /* #__PURE__ */createSpeedOfLight({ + BigNumber, + Unit, + config +}); +export var stefanBoltzmann = /* #__PURE__ */createStefanBoltzmann({ + BigNumber, + Unit, + config +}); +export var thomsonCrossSection = /* #__PURE__ */createThomsonCrossSection({ + BigNumber, + Unit, + config +}); +export var avogadro = /* #__PURE__ */createAvogadro({ + BigNumber, + Unit, + config +}); +export var bohrRadius = /* #__PURE__ */createBohrRadius({ + BigNumber, + Unit, + config +}); +export var createUnit = /* #__PURE__ */createCreateUnit({ + Unit, + typed +}); +export var divide = /* #__PURE__ */createDivide({ + divideScalar, + equalScalar, + inv, + matrix, + multiply, + typed +}); +export var electronMass = /* #__PURE__ */createElectronMass({ + BigNumber, + Unit, + config +}); +export var factorial = /* #__PURE__ */createFactorial({ + gamma, + typed +}); +export var firstRadiation = /* #__PURE__ */createFirstRadiation({ + BigNumber, + Unit, + config +}); +export var gravity = /* #__PURE__ */createGravity({ + BigNumber, + Unit, + config +}); +export var inverseConductanceQuantum = /* #__PURE__ */createInverseConductanceQuantum({ + BigNumber, + Unit, + config +}); +export var lusolve = /* #__PURE__ */createLusolve({ + DenseMatrix, + lsolve, + lup, + matrix, + slu, + typed, + usolve +}); +export var magneticFluxQuantum = /* #__PURE__ */createMagneticFluxQuantum({ + BigNumber, + Unit, + config +}); +export var molarMassC12 = /* #__PURE__ */createMolarMassC12({ + BigNumber, + Unit, + config +}); +export var multinomial = /* #__PURE__ */createMultinomial({ + add, + divide, + factorial, + isInteger, + isPositive, + multiply, + typed +}); +export var permutations = /* #__PURE__ */createPermutations({ + factorial, + typed +}); +export var planckMass = /* #__PURE__ */createPlanckMass({ + BigNumber, + Unit, + config +}); +export var polynomialRoot = /* #__PURE__ */createPolynomialRoot({ + add, + cbrt, + divide, + equalScalar, + im, + isZero, + multiply, + re, + sqrt, + subtract, + typeOf, + typed, + unaryMinus +}); +export var setSize = /* #__PURE__ */createSetSize({ + compareNatural, + typed +}); +export var solveODE = /* #__PURE__ */createSolveODE({ + abs, + add, + bignumber, + divide, + isNegative, + isPositive, + larger, + map, + matrix, + max, + multiply, + smaller, + subtract, + typed, + unaryMinus +}); +export var stirlingS2 = /* #__PURE__ */createStirlingS2({ + bignumber, + addScalar, + combinations, + divideScalar, + factorial, + isInteger, + isNegative, + larger, + multiplyScalar, + number, + pow, + subtractScalar, + typed +}); +export var unit = /* #__PURE__ */createUnitFunction({ + Unit, + typed +}); +export var bellNumbers = /* #__PURE__ */createBellNumbers({ + addScalar, + isInteger, + isNegative, + stirlingS2, + typed +}); +export var eigs = /* #__PURE__ */createEigs({ + abs, + add, + addScalar, + atan, + bignumber, + column, + complex, + config, + cos, + diag, + divideScalar, + dot, + equal, + flatten, + im, + inv, + larger, + matrix, + matrixFromColumns, + multiply, + multiplyScalar, + number, + qr, + re, + reshape, + sin, + size, + smaller, + sqrt, + subtract, + typed, + usolve, + usolveAll +}); +export var fermiCoupling = /* #__PURE__ */createFermiCoupling({ + BigNumber, + Unit, + config +}); +export var gasConstant = /* #__PURE__ */createGasConstant({ + BigNumber, + Unit, + config +}); +export var kldivergence = /* #__PURE__ */createKldivergence({ + divide, + dotDivide, + isNumeric, + log, + map, + matrix, + multiply, + sum, + typed +}); +export var mean = /* #__PURE__ */createMean({ + add, + divide, + typed +}); +export var molarVolume = /* #__PURE__ */createMolarVolume({ + BigNumber, + Unit, + config +}); +export var planckConstant = /* #__PURE__ */createPlanckConstant({ + BigNumber, + Unit, + config +}); +export var quantileSeq = /* #__PURE__ */createQuantileSeq({ + bignumber, + add, + compare, + divide, + isInteger, + larger, + multiply, + partitionSelect, + smaller, + smallerEq, + subtract, + typed +}); +export var variance = /* #__PURE__ */createVariance({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed +}); +export var classicalElectronRadius = /* #__PURE__ */createClassicalElectronRadius({ + BigNumber, + Unit, + config +}); +export var median = /* #__PURE__ */createMedian({ + add, + compare, + divide, + partitionSelect, + typed +}); +export var corr = /* #__PURE__ */createCorr({ + add, + divide, + matrix, + mean, + multiply, + pow, + sqrt, + subtract, + sum, + typed +}); +export var freqz = /* #__PURE__ */createFreqz({ + Complex, + add, + divide, + matrix, + multiply, + typed +}); +export var mad = /* #__PURE__ */createMad({ + abs, + map, + median, + subtract, + typed +}); +export var std = /* #__PURE__ */createStd({ + map, + sqrt, + typed, + variance +}); +export var zeta = /* #__PURE__ */createZeta({ + BigNumber, + Complex, + add, + config, + divide, + equal, + factorial, + gamma, + isNegative, + multiply, + pi, + pow, + sin, + smallerEq, + subtract, + typed +}); +export var norm = /* #__PURE__ */createNorm({ + abs, + add, + conj, + ctranspose, + eigs, + equalScalar, + larger, + matrix, + multiply, + pow, + smaller, + sqrt, + typed +}); +export var rotationMatrix = /* #__PURE__ */createRotationMatrix({ + BigNumber, + DenseMatrix, + SparseMatrix, + addScalar, + config, + cos, + matrix, + multiplyScalar, + norm, + sin, + typed, + unaryMinus +}); +export var planckTime = /* #__PURE__ */createPlanckTime({ + BigNumber, + Unit, + config +}); +export var schur = /* #__PURE__ */createSchur({ + identity, + matrix, + multiply, + norm, + qr, + subtract, + typed +}); +export var rotate = /* #__PURE__ */createRotate({ + multiply, + rotationMatrix, + typed +}); +export var sylvester = /* #__PURE__ */createSylvester({ + abs, + add, + concat, + identity, + index, + lusolve, + matrix, + matrixFromColumns, + multiply, + range, + schur, + subset, + subtract, + transpose, + typed +}); +export var lyap = /* #__PURE__ */createLyap({ + matrix, + multiply, + sylvester, + transpose, + typed +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js new file mode 100644 index 0000000..2dddca6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js @@ -0,0 +1,605 @@ +/** + * THIS FILE IS AUTO-GENERATED + * DON'T MAKE CHANGES HERE + */ +import { config } from './configReadonly.js'; +import { createE, createFalse, createIndex, createInfinity, createLN10, createLOG10E, createMatrix, createNaN, createNull, createPhi, createRangeClass, createReplacer, createResultSet, createSQRT1_2, +// eslint-disable-line camelcase +createSubset, createTau, createTyped, createUnaryPlus, createVersion, createXor, createAbs, createAcos, createAcot, createAcsc, createAdd, createAnd, createAsec, createAsin, createAtan, createAtanh, createBigint, createBitNot, createBitXor, createBoolean, createCbrt, createCombinations, createCompare, createCompareText, createCos, createCot, createCsc, createCube, createDivide, createEqualScalar, createErf, createExp, createFilter, createForEach, createFormat, createGamma, createIsInteger, createIsNegative, createIsPositive, createIsZero, createLOG2E, createLargerEq, createLeftShift, createLog, createLog1p, createMap, createMean, createMod, createMultiply, createNot, createNumber, createOr, createPi, createPow, createRandom, createRightLogShift, createSQRT2, createSech, createSin, createSize, createSmallerEq, createSquare, createString, createSubtract, createTanh, createTypeOf, createUnequal, createXgcd, createAcoth, createAddScalar, createAsech, createBitAnd, createCombinationsWithRep, createCosh, createCsch, createDivideScalar, createEqualText, createExpm1, createIsNumeric, createLN2, createLcm, createLog10, createMultiplyScalar, createNthRoot, createPickRandom, createRandomInt, createRightArithShift, createSec, createSinh, createSqrt, createTan, createUnaryMinus, createAcosh, createApply, createAsinh, createBitOr, createClone, createCoth, createEqual, createFactorial, createHasNumericValue, createIsNaN, createLarger, createLog2, createMode, createNorm, createPartitionSelect, createPrint, createRound, createSmaller, createSubtractScalar, createTrue, createVariance, createZeta, createAcsch, createAtan2, createCatalan, createCompareNatural, createComposition, createCumSum, createFloor, createHypot, createLgamma, createMedian, createMultinomial, createPermutations, createQuantileSeq, createSign, createStd, createStirlingS2, createCeil, createDeepEqual, createFix, createIsPrime, createNumeric, createProd, createBellNumbers, createGcd, createMad, createRange, createSum, createCorr, createMax, createMin } from '../factoriesNumber.js'; +export var e = /* #__PURE__ */createE({ + config +}); +export var _false = /* #__PURE__ */createFalse({}); +export var index = /* #__PURE__ */createIndex({}); +export var _Infinity = /* #__PURE__ */createInfinity({ + config +}); +export var LN10 = /* #__PURE__ */createLN10({ + config +}); +export var LOG10E = /* #__PURE__ */createLOG10E({ + config +}); +export var matrix = /* #__PURE__ */createMatrix({}); +export var _NaN = /* #__PURE__ */createNaN({ + config +}); +export var _null = /* #__PURE__ */createNull({}); +export var phi = /* #__PURE__ */createPhi({ + config +}); +export var Range = /* #__PURE__ */createRangeClass({}); +export var replacer = /* #__PURE__ */createReplacer({}); +export var ResultSet = /* #__PURE__ */createResultSet({}); +export var SQRT1_2 = /* #__PURE__ */createSQRT1_2({ + config +}); +export var subset = /* #__PURE__ */createSubset({}); +export var tau = /* #__PURE__ */createTau({ + config +}); +export var typed = /* #__PURE__ */createTyped({}); +export var unaryPlus = /* #__PURE__ */createUnaryPlus({ + typed +}); +export var version = /* #__PURE__ */createVersion({}); +export var xor = /* #__PURE__ */createXor({ + typed +}); +export var abs = /* #__PURE__ */createAbs({ + typed +}); +export var acos = /* #__PURE__ */createAcos({ + typed +}); +export var acot = /* #__PURE__ */createAcot({ + typed +}); +export var acsc = /* #__PURE__ */createAcsc({ + typed +}); +export var add = /* #__PURE__ */createAdd({ + typed +}); +export var and = /* #__PURE__ */createAnd({ + typed +}); +export var asec = /* #__PURE__ */createAsec({ + typed +}); +export var asin = /* #__PURE__ */createAsin({ + typed +}); +export var atan = /* #__PURE__ */createAtan({ + typed +}); +export var atanh = /* #__PURE__ */createAtanh({ + typed +}); +export var bigint = /* #__PURE__ */createBigint({ + typed +}); +export var bitNot = /* #__PURE__ */createBitNot({ + typed +}); +export var bitXor = /* #__PURE__ */createBitXor({ + typed +}); +export var boolean = /* #__PURE__ */createBoolean({ + typed +}); +export var cbrt = /* #__PURE__ */createCbrt({ + typed +}); +export var combinations = /* #__PURE__ */createCombinations({ + typed +}); +export var compare = /* #__PURE__ */createCompare({ + config, + typed +}); +export var compareText = /* #__PURE__ */createCompareText({ + typed +}); +export var cos = /* #__PURE__ */createCos({ + typed +}); +export var cot = /* #__PURE__ */createCot({ + typed +}); +export var csc = /* #__PURE__ */createCsc({ + typed +}); +export var cube = /* #__PURE__ */createCube({ + typed +}); +export var divide = /* #__PURE__ */createDivide({ + typed +}); +export var equalScalar = /* #__PURE__ */createEqualScalar({ + config, + typed +}); +export var erf = /* #__PURE__ */createErf({ + typed +}); +export var exp = /* #__PURE__ */createExp({ + typed +}); +export var filter = /* #__PURE__ */createFilter({ + typed +}); +export var forEach = /* #__PURE__ */createForEach({ + typed +}); +export var format = /* #__PURE__ */createFormat({ + typed +}); +export var gamma = /* #__PURE__ */createGamma({ + typed +}); +export var isInteger = /* #__PURE__ */createIsInteger({ + typed +}); +export var isNegative = /* #__PURE__ */createIsNegative({ + typed +}); +export var isPositive = /* #__PURE__ */createIsPositive({ + typed +}); +export var isZero = /* #__PURE__ */createIsZero({ + typed +}); +export var LOG2E = /* #__PURE__ */createLOG2E({ + config +}); +export var largerEq = /* #__PURE__ */createLargerEq({ + config, + typed +}); +export var leftShift = /* #__PURE__ */createLeftShift({ + typed +}); +export var log = /* #__PURE__ */createLog({ + typed +}); +export var log1p = /* #__PURE__ */createLog1p({ + typed +}); +export var map = /* #__PURE__ */createMap({ + typed +}); +export var mean = /* #__PURE__ */createMean({ + add, + divide, + typed +}); +export var mod = /* #__PURE__ */createMod({ + typed +}); +export var multiply = /* #__PURE__ */createMultiply({ + typed +}); +export var not = /* #__PURE__ */createNot({ + typed +}); +export var number = /* #__PURE__ */createNumber({ + typed +}); +export var or = /* #__PURE__ */createOr({ + typed +}); +export var pi = /* #__PURE__ */createPi({ + config +}); +export var pow = /* #__PURE__ */createPow({ + typed +}); +export var random = /* #__PURE__ */createRandom({ + config, + typed +}); +export var rightLogShift = /* #__PURE__ */createRightLogShift({ + typed +}); +export var SQRT2 = /* #__PURE__ */createSQRT2({ + config +}); +export var sech = /* #__PURE__ */createSech({ + typed +}); +export var sin = /* #__PURE__ */createSin({ + typed +}); +export var size = /* #__PURE__ */createSize({ + matrix, + config, + typed +}); +export var smallerEq = /* #__PURE__ */createSmallerEq({ + config, + typed +}); +export var square = /* #__PURE__ */createSquare({ + typed +}); +export var string = /* #__PURE__ */createString({ + typed +}); +export var subtract = /* #__PURE__ */createSubtract({ + typed +}); +export var tanh = /* #__PURE__ */createTanh({ + typed +}); +export var typeOf = /* #__PURE__ */createTypeOf({ + typed +}); +export var unequal = /* #__PURE__ */createUnequal({ + equalScalar, + typed +}); +export var xgcd = /* #__PURE__ */createXgcd({ + typed +}); +export var acoth = /* #__PURE__ */createAcoth({ + typed +}); +export var addScalar = /* #__PURE__ */createAddScalar({ + typed +}); +export var asech = /* #__PURE__ */createAsech({ + typed +}); +export var bitAnd = /* #__PURE__ */createBitAnd({ + typed +}); +export var combinationsWithRep = /* #__PURE__ */createCombinationsWithRep({ + typed +}); +export var cosh = /* #__PURE__ */createCosh({ + typed +}); +export var csch = /* #__PURE__ */createCsch({ + typed +}); +export var divideScalar = /* #__PURE__ */createDivideScalar({ + typed +}); +export var equalText = /* #__PURE__ */createEqualText({ + compareText, + isZero, + typed +}); +export var expm1 = /* #__PURE__ */createExpm1({ + typed +}); +export var isNumeric = /* #__PURE__ */createIsNumeric({ + typed +}); +export var LN2 = /* #__PURE__ */createLN2({ + config +}); +export var lcm = /* #__PURE__ */createLcm({ + typed +}); +export var log10 = /* #__PURE__ */createLog10({ + typed +}); +export var multiplyScalar = /* #__PURE__ */createMultiplyScalar({ + typed +}); +export var nthRoot = /* #__PURE__ */createNthRoot({ + typed +}); +export var pickRandom = /* #__PURE__ */createPickRandom({ + config, + typed +}); +export var randomInt = /* #__PURE__ */createRandomInt({ + config, + typed +}); +export var rightArithShift = /* #__PURE__ */createRightArithShift({ + typed +}); +export var sec = /* #__PURE__ */createSec({ + typed +}); +export var sinh = /* #__PURE__ */createSinh({ + typed +}); +export var sqrt = /* #__PURE__ */createSqrt({ + typed +}); +export var tan = /* #__PURE__ */createTan({ + typed +}); +export var unaryMinus = /* #__PURE__ */createUnaryMinus({ + typed +}); +export var acosh = /* #__PURE__ */createAcosh({ + typed +}); +export var apply = /* #__PURE__ */createApply({ + isInteger, + typed +}); +export var asinh = /* #__PURE__ */createAsinh({ + typed +}); +export var bitOr = /* #__PURE__ */createBitOr({ + typed +}); +export var clone = /* #__PURE__ */createClone({ + typed +}); +export var coth = /* #__PURE__ */createCoth({ + typed +}); +export var equal = /* #__PURE__ */createEqual({ + equalScalar, + typed +}); +export var factorial = /* #__PURE__ */createFactorial({ + gamma, + typed +}); +export var hasNumericValue = /* #__PURE__ */createHasNumericValue({ + isNumeric, + typed +}); +export var isNaN = /* #__PURE__ */createIsNaN({ + typed +}); +export var larger = /* #__PURE__ */createLarger({ + config, + typed +}); +export var log2 = /* #__PURE__ */createLog2({ + typed +}); +export var mode = /* #__PURE__ */createMode({ + isNaN, + isNumeric, + typed +}); +export var norm = /* #__PURE__ */createNorm({ + typed +}); +export var partitionSelect = /* #__PURE__ */createPartitionSelect({ + compare, + isNaN, + isNumeric, + typed +}); +export var print = /* #__PURE__ */createPrint({ + typed +}); +export var round = /* #__PURE__ */createRound({ + typed +}); +export var smaller = /* #__PURE__ */createSmaller({ + config, + typed +}); +export var subtractScalar = /* #__PURE__ */createSubtractScalar({ + typed +}); +export var _true = /* #__PURE__ */createTrue({}); +export var variance = /* #__PURE__ */createVariance({ + add, + apply, + divide, + isNaN, + multiply, + subtract, + typed +}); +export var zeta = /* #__PURE__ */createZeta({ + add, + config, + divide, + equal, + factorial, + gamma, + isNegative, + multiply, + pi, + pow, + sin, + smallerEq, + subtract, + typed +}); +export var acsch = /* #__PURE__ */createAcsch({ + typed +}); +export var atan2 = /* #__PURE__ */createAtan2({ + typed +}); +export var catalan = /* #__PURE__ */createCatalan({ + addScalar, + combinations, + divideScalar, + isInteger, + isNegative, + multiplyScalar, + typed +}); +export var compareNatural = /* #__PURE__ */createCompareNatural({ + compare, + typed +}); +export var composition = /* #__PURE__ */createComposition({ + addScalar, + combinations, + isInteger, + isNegative, + isPositive, + larger, + typed +}); +export var cumsum = /* #__PURE__ */createCumSum({ + add, + typed, + unaryPlus +}); +export var floor = /* #__PURE__ */createFloor({ + config, + round, + typed +}); +export var hypot = /* #__PURE__ */createHypot({ + abs, + addScalar, + divideScalar, + isPositive, + multiplyScalar, + smaller, + sqrt, + typed +}); +export var lgamma = /* #__PURE__ */createLgamma({ + typed +}); +export var median = /* #__PURE__ */createMedian({ + add, + compare, + divide, + partitionSelect, + typed +}); +export var multinomial = /* #__PURE__ */createMultinomial({ + add, + divide, + factorial, + isInteger, + isPositive, + multiply, + typed +}); +export var permutations = /* #__PURE__ */createPermutations({ + factorial, + typed +}); +export var quantileSeq = /* #__PURE__ */createQuantileSeq({ + add, + compare, + divide, + isInteger, + larger, + multiply, + partitionSelect, + smaller, + smallerEq, + subtract, + typed +}); +export var sign = /* #__PURE__ */createSign({ + typed +}); +export var std = /* #__PURE__ */createStd({ + map, + sqrt, + typed, + variance +}); +export var stirlingS2 = /* #__PURE__ */createStirlingS2({ + addScalar, + combinations, + divideScalar, + factorial, + isInteger, + isNegative, + larger, + multiplyScalar, + number, + pow, + subtractScalar, + typed +}); +export var ceil = /* #__PURE__ */createCeil({ + config, + round, + typed +}); +export var deepEqual = /* #__PURE__ */createDeepEqual({ + equal, + typed +}); +export var fix = /* #__PURE__ */createFix({ + ceil, + floor, + typed +}); +export var isPrime = /* #__PURE__ */createIsPrime({ + typed +}); +export var numeric = /* #__PURE__ */createNumeric({ + number +}); +export var prod = /* #__PURE__ */createProd({ + config, + multiplyScalar, + numeric, + typed +}); +export var bellNumbers = /* #__PURE__ */createBellNumbers({ + addScalar, + isInteger, + isNegative, + stirlingS2, + typed +}); +export var gcd = /* #__PURE__ */createGcd({ + typed +}); +export var mad = /* #__PURE__ */createMad({ + abs, + map, + median, + subtract, + typed +}); +export var range = /* #__PURE__ */createRange({ + matrix, + add, + config, + isPositive, + larger, + largerEq, + smaller, + smallerEq, + typed +}); +export var sum = /* #__PURE__ */createSum({ + add, + config, + numeric, + typed +}); +export var corr = /* #__PURE__ */createCorr({ + add, + divide, + matrix, + mean, + multiply, + pow, + sqrt, + subtract, + sum, + typed +}); +export var max = /* #__PURE__ */createMax({ + config, + larger, + numeric, + typed +}); +export var min = /* #__PURE__ */createMin({ + config, + numeric, + smaller, + typed +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/typeChecks.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/typeChecks.js new file mode 100644 index 0000000..3071835 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/entry/typeChecks.js @@ -0,0 +1,2 @@ +// util functions +export { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigNumber, isBigInt, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMatrix, isNode, isNull, isNumber, isString, isUndefined, isObject, isMap, isPartitionedMap, isObjectWrappingMap, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRelationalNode, isRegExp, isResultSet, isSparseMatrix, isSymbolNode, isUnit } from '../utils/is.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/ArgumentsError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/ArgumentsError.js new file mode 100644 index 0000000..82da95e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/ArgumentsError.js @@ -0,0 +1,24 @@ +/** + * Create a syntax error with the message: + * 'Wrong number of arguments in function ( provided, - expected)' + * @param {string} fn Function name + * @param {number} count Actual argument count + * @param {number} min Minimum required argument count + * @param {number} [max] Maximum required argument count + * @extends Error + */ +export function ArgumentsError(fn, count, min, max) { + if (!(this instanceof ArgumentsError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.fn = fn; + this.count = count; + this.min = min; + this.max = max; + this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)'; + this.stack = new Error().stack; +} +ArgumentsError.prototype = new Error(); +ArgumentsError.prototype.constructor = Error; +ArgumentsError.prototype.name = 'ArgumentsError'; +ArgumentsError.prototype.isArgumentsError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/DimensionError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/DimensionError.js new file mode 100644 index 0000000..f488487 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/DimensionError.js @@ -0,0 +1,23 @@ +/** + * Create a range error with the message: + * 'Dimension mismatch ( != )' + * @param {number | number[]} actual The actual size + * @param {number | number[]} expected The expected size + * @param {string} [relation='!='] Optional relation between actual + * and expected size: '!=', '<', etc. + * @extends RangeError + */ +export function DimensionError(actual, expected, relation) { + if (!(this instanceof DimensionError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.actual = actual; + this.expected = expected; + this.relation = relation; + this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')'; + this.stack = new Error().stack; +} +DimensionError.prototype = new RangeError(); +DimensionError.prototype.constructor = RangeError; +DimensionError.prototype.name = 'DimensionError'; +DimensionError.prototype.isDimensionError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/IndexError.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/IndexError.js new file mode 100644 index 0000000..9755958 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/error/IndexError.js @@ -0,0 +1,35 @@ +/** + * Create a range error with the message: + * 'Index out of range (index < min)' + * 'Index out of range (index < max)' + * + * @param {number} index The actual index + * @param {number} [min=0] Minimum index (included) + * @param {number} [max] Maximum index (excluded) + * @extends RangeError + */ +export function IndexError(index, min, max) { + if (!(this instanceof IndexError)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.index = index; + if (arguments.length < 3) { + this.min = 0; + this.max = min; + } else { + this.min = min; + this.max = max; + } + if (this.min !== undefined && this.index < this.min) { + this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')'; + } else if (this.max !== undefined && this.index >= this.max) { + this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')'; + } else { + this.message = 'Index out of range (' + this.index + ')'; + } + this.stack = new Error().stack; +} +IndexError.prototype = new RangeError(); +IndexError.prototype.constructor = RangeError; +IndexError.prototype.name = 'IndexError'; +IndexError.prototype.isIndexError = true; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Help.js new file mode 100644 index 0000000..5f18914 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Help.js @@ -0,0 +1,132 @@ +import { isHelp } from '../utils/is.js'; +import { clone } from '../utils/object.js'; +import { format } from '../utils/string.js'; +import { factory } from '../utils/factory.js'; +var name = 'Help'; +var dependencies = ['evaluate']; +export var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + evaluate + } = _ref; + /** + * Documentation object + * @param {Object} doc Object containing properties: + * {string} name + * {string} category + * {string} description + * {string[]} syntax + * {string[]} examples + * {string[]} seealso + * @constructor + */ + function Help(doc) { + if (!(this instanceof Help)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (!doc) throw new Error('Argument "doc" missing'); + this.doc = doc; + } + + /** + * Attach type information + */ + Help.prototype.type = 'Help'; + Help.prototype.isHelp = true; + + /** + * Generate a string representation of the Help object + * @return {string} Returns a string + * @private + */ + Help.prototype.toString = function () { + var doc = this.doc || {}; + var desc = '\n'; + if (doc.name) { + desc += 'Name: ' + doc.name + '\n\n'; + } + if (doc.category) { + desc += 'Category: ' + doc.category + '\n\n'; + } + if (doc.description) { + desc += 'Description:\n ' + doc.description + '\n\n'; + } + if (doc.syntax) { + desc += 'Syntax:\n ' + doc.syntax.join('\n ') + '\n\n'; + } + if (doc.examples) { + desc += 'Examples:\n'; + + // after evaluating the examples, we restore config in case the examples + // did change the config. + var configChanged = false; + var originalConfig = evaluate('config()'); + var scope = { + config: newConfig => { + configChanged = true; + return evaluate('config(newConfig)', { + newConfig + }); + } + }; + for (var i = 0; i < doc.examples.length; i++) { + var expr = doc.examples[i]; + desc += ' ' + expr + '\n'; + var res = void 0; + try { + // note: res can be undefined when `expr` is an empty string + res = evaluate(expr, scope); + } catch (e) { + res = e; + } + if (res !== undefined && !isHelp(res)) { + desc += ' ' + format(res, { + precision: 14 + }) + '\n'; + } + } + desc += '\n'; + if (configChanged) { + evaluate('config(originalConfig)', { + originalConfig + }); + } + } + if (doc.mayThrow && doc.mayThrow.length) { + desc += 'Throws: ' + doc.mayThrow.join(', ') + '\n\n'; + } + if (doc.seealso && doc.seealso.length) { + desc += 'See also: ' + doc.seealso.join(', ') + '\n'; + } + return desc; + }; + + /** + * Export the help object to JSON + */ + Help.prototype.toJSON = function () { + var obj = clone(this.doc); + obj.mathjs = 'Help'; + return obj; + }; + + /** + * Instantiate a Help object from a JSON object + * @param {Object} json + * @returns {Help} Returns a new Help object + */ + Help.fromJSON = function (json) { + var doc = {}; + Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => { + doc[prop] = json[prop]; + }); + return new Help(doc); + }; + + /** + * Returns a string representation of the Help object + */ + Help.prototype.valueOf = Help.prototype.toString; + return Help; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Parser.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Parser.js new file mode 100644 index 0000000..ac50bf7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/Parser.js @@ -0,0 +1,141 @@ +import { factory } from '../utils/factory.js'; +import { createEmptyMap, toObject } from '../utils/map.js'; +var name = 'Parser'; +var dependencies = ['evaluate']; +export var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + evaluate + } = _ref; + /** + * @constructor Parser + * Parser contains methods to evaluate or parse expressions, and has a number + * of convenience methods to get, set, and remove variables from memory. Parser + * keeps a scope containing variables in memory, which is used for all + * evaluations. + * + * Methods: + * const result = parser.evaluate(expr) // evaluate an expression + * const value = parser.get(name) // retrieve a variable from the parser + * const values = parser.getAll() // retrieve all defined variables + * parser.set(name, value) // set a variable in the parser + * parser.remove(name) // clear a variable from the + * // parsers scope + * parser.clear() // clear the parsers scope + * + * Example usage: + * const parser = new Parser() + * // Note: there is a convenience method which can be used instead: + * // const parser = new math.parser() + * + * // evaluate expressions + * parser.evaluate('sqrt(3^2 + 4^2)') // 5 + * parser.evaluate('sqrt(-4)') // 2i + * parser.evaluate('2 inch in cm') // 5.08 cm + * parser.evaluate('cos(45 deg)') // 0.7071067811865476 + * + * // define variables and functions + * parser.evaluate('x = 7 / 2') // 3.5 + * parser.evaluate('x + 3') // 6.5 + * parser.evaluate('f(x, y) = x^y') // f(x, y) + * parser.evaluate('f(2, 3)') // 8 + * + * // get and set variables and functions + * const x = parser.get('x') // 3.5 + * const f = parser.get('f') // function + * const g = f(3, 2) // 9 + * parser.set('h', 500) + * const i = parser.evaluate('h / 2') // 250 + * parser.set('hello', function (name) { + * return 'hello, ' + name + '!' + * }) + * parser.evaluate('hello("user")') // "hello, user!" + * + * // clear defined functions and variables + * parser.clear() + * + */ + function Parser() { + if (!(this instanceof Parser)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + Object.defineProperty(this, 'scope', { + value: createEmptyMap(), + writable: false + }); + } + + /** + * Attach type information + */ + Parser.prototype.type = 'Parser'; + Parser.prototype.isParser = true; + + /** + * Parse and evaluate the given expression + * @param {string | string[]} expr A string containing an expression, + * for example "2+3", or a list with expressions + * @return {*} result The result, or undefined when the expression was empty + * @throws {Error} + */ + Parser.prototype.evaluate = function (expr) { + // TODO: validate arguments + return evaluate(expr, this.scope); + }; + + /** + * Get a variable (a function or variable) by name from the parsers scope. + * Returns undefined when not found + * @param {string} name + * @return {* | undefined} value + */ + Parser.prototype.get = function (name) { + // TODO: validate arguments + if (this.scope.has(name)) { + return this.scope.get(name); + } + }; + + /** + * Get a map with all defined variables + * @return {Object} values + */ + Parser.prototype.getAll = function () { + return toObject(this.scope); + }; + + /** + * Get a map with all defined variables + * @return {Map} values + */ + Parser.prototype.getAllAsMap = function () { + return this.scope; + }; + + /** + * Set a symbol (a function or variable) by name from the parsers scope. + * @param {string} name + * @param {* | undefined} value + */ + Parser.prototype.set = function (name, value) { + this.scope.set(name, value); + return value; + }; + + /** + * Remove a variable from the parsers scope + * @param {string} name + */ + Parser.prototype.remove = function (name) { + this.scope.delete(name); + }; + + /** + * Clear the scope with variables and functions + */ + Parser.prototype.clear = function () { + this.scope.clear(); + }; + return Parser; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js new file mode 100644 index 0000000..665c06c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js @@ -0,0 +1,8 @@ +export var InfinityDocs = { + name: 'Infinity', + category: 'Constants', + syntax: ['Infinity'], + description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.', + examples: ['Infinity', '1 / 0'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js new file mode 100644 index 0000000..14cee58 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js @@ -0,0 +1,8 @@ +export var LN10Docs = { + name: 'LN10', + category: 'Constants', + syntax: ['LN10'], + description: 'Returns the natural logarithm of 10, approximately equal to 2.302', + examples: ['LN10', 'log(10)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js new file mode 100644 index 0000000..4cdd420 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js @@ -0,0 +1,8 @@ +export var LN2Docs = { + name: 'LN2', + category: 'Constants', + syntax: ['LN2'], + description: 'Returns the natural logarithm of 2, approximately equal to 0.693', + examples: ['LN2', 'log(2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js new file mode 100644 index 0000000..2bc29fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js @@ -0,0 +1,8 @@ +export var LOG10EDocs = { + name: 'LOG10E', + category: 'Constants', + syntax: ['LOG10E'], + description: 'Returns the base-10 logarithm of E, approximately equal to 0.434', + examples: ['LOG10E', 'log(e, 10)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js new file mode 100644 index 0000000..91352dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js @@ -0,0 +1,8 @@ +export var LOG2EDocs = { + name: 'LOG2E', + category: 'Constants', + syntax: ['LOG2E'], + description: 'Returns the base-2 logarithm of E, approximately equal to 1.442', + examples: ['LOG2E', 'log(e, 2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js new file mode 100644 index 0000000..f44bd42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js @@ -0,0 +1,8 @@ +export var NaNDocs = { + name: 'NaN', + category: 'Constants', + syntax: ['NaN'], + description: 'Not a number', + examples: ['NaN', '0 / 0'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js new file mode 100644 index 0000000..c08a377 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js @@ -0,0 +1,8 @@ +export var SQRT12Docs = { + name: 'SQRT1_2', + category: 'Constants', + syntax: ['SQRT1_2'], + description: 'Returns the square root of 1/2, approximately equal to 0.707', + examples: ['SQRT1_2', 'sqrt(1/2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js new file mode 100644 index 0000000..638c4b2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js @@ -0,0 +1,8 @@ +export var SQRT2Docs = { + name: 'SQRT2', + category: 'Constants', + syntax: ['SQRT2'], + description: 'Returns the square root of 2, approximately equal to 1.414', + examples: ['SQRT2', 'sqrt(2)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js new file mode 100644 index 0000000..e82480a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js @@ -0,0 +1,8 @@ +export var eDocs = { + name: 'e', + category: 'Constants', + syntax: ['e'], + description: 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828', + examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'], + seealso: ['exp'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js new file mode 100644 index 0000000..78c1791 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js @@ -0,0 +1,8 @@ +export var falseDocs = { + name: 'false', + category: 'Constants', + syntax: ['false'], + description: 'Boolean value false', + examples: ['false'], + seealso: ['true'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js new file mode 100644 index 0000000..69d62ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js @@ -0,0 +1,8 @@ +export var iDocs = { + name: 'i', + category: 'Constants', + syntax: ['i'], + description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.', + examples: ['i', 'i * i', 'sqrt(-1)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js new file mode 100644 index 0000000..1d6a721 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js @@ -0,0 +1,8 @@ +export var nullDocs = { + name: 'null', + category: 'Constants', + syntax: ['null'], + description: 'Value null', + examples: ['null'], + seealso: ['true', 'false'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js new file mode 100644 index 0000000..bb48c9a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js @@ -0,0 +1,8 @@ +export var phiDocs = { + name: 'phi', + category: 'Constants', + syntax: ['phi'], + description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...', + examples: ['phi'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js new file mode 100644 index 0000000..c34ae2e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js @@ -0,0 +1,8 @@ +export var piDocs = { + name: 'pi', + category: 'Constants', + syntax: ['pi'], + description: 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159', + examples: ['pi', 'sin(pi/2)'], + seealso: ['tau'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js new file mode 100644 index 0000000..0256449 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js @@ -0,0 +1,8 @@ +export var tauDocs = { + name: 'tau', + category: 'Constants', + syntax: ['tau'], + description: 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.', + examples: ['tau', '2 * pi'], + seealso: ['pi'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js new file mode 100644 index 0000000..52c8f1f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js @@ -0,0 +1,8 @@ +export var trueDocs = { + name: 'true', + category: 'Constants', + syntax: ['true'], + description: 'Boolean value true', + examples: ['true'], + seealso: ['false'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js new file mode 100644 index 0000000..c58c20a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js @@ -0,0 +1,8 @@ +export var versionDocs = { + name: 'version', + category: 'Constants', + syntax: ['version'], + description: 'A string with the version number of math.js', + examples: ['version'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js new file mode 100644 index 0000000..8d965b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js @@ -0,0 +1,8 @@ +export var bigintDocs = { + name: 'bigint', + category: 'Construction', + syntax: ['bigint(x)'], + description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.', + examples: ['123123123123123123 # a large number will lose digits', 'bigint("123123123123123123")', 'bignumber(["1", "3", "5"])'], + seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js new file mode 100644 index 0000000..e2e58e8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js @@ -0,0 +1,8 @@ +export var bignumberDocs = { + name: 'bignumber', + category: 'Construction', + syntax: ['bignumber(x)'], + description: 'Create a big number from a number or string.', + examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber("7.2")', 'bignumber("7.2e500")', 'bignumber([0.1, 0.2, 0.3])'], + seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js new file mode 100644 index 0000000..38f2053 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js @@ -0,0 +1,8 @@ +export var booleanDocs = { + name: 'boolean', + category: 'Construction', + syntax: ['x', 'boolean(x)'], + description: 'Convert a string or number into a boolean.', + examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean("true")', 'boolean("false")', 'boolean([1, 0, 1, 1])'], + seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js new file mode 100644 index 0000000..abbc0f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js @@ -0,0 +1,8 @@ +export var complexDocs = { + name: 'complex', + category: 'Construction', + syntax: ['complex()', 'complex(re, im)', 'complex(string)'], + description: 'Create a complex number.', + examples: ['complex()', 'complex(2, 3)', 'complex("7 - 2i")'], + seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js new file mode 100644 index 0000000..444836d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js @@ -0,0 +1,8 @@ +export var createUnitDocs = { + name: 'createUnit', + category: 'Construction', + syntax: ['createUnit(definitions)', 'createUnit(name, definition)'], + description: 'Create a user-defined unit and register it with the Unit type.', + examples: ['createUnit("foo")', 'createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})', 'createUnit("mph", "1 mile/hour")'], + seealso: ['unit', 'splitUnit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js new file mode 100644 index 0000000..922eb1a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js @@ -0,0 +1,8 @@ +export var fractionDocs = { + name: 'fraction', + category: 'Construction', + syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'], + description: 'Create a fraction from a number or from integer numerator and denominator.', + examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js new file mode 100644 index 0000000..d5ab029 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js @@ -0,0 +1,8 @@ +export var indexDocs = { + name: 'index', + category: 'Construction', + syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'], + description: 'Create an index to get or replace a subset of a matrix', + examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'], + seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js new file mode 100644 index 0000000..bb51892 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js @@ -0,0 +1,8 @@ +export var matrixDocs = { + name: 'matrix', + category: 'Construction', + syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix("dense")', 'matrix([...])'], + description: 'Create a matrix.', + examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], "sparse")', 'matrix([3, 4; 5, 6], "sparse", "number")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js new file mode 100644 index 0000000..4219ce5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js @@ -0,0 +1,8 @@ +export var numberDocs = { + name: 'number', + category: 'Construction', + syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'], + description: 'Create a number or convert a string or boolean into a number.', + examples: ['2', '2e3', '4.05', 'number(2)', 'number("7.2")', 'number(true)', 'number([true, false, true, true])', 'number(unit("52cm"), "m")'], + seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js new file mode 100644 index 0000000..b6a776c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js @@ -0,0 +1,8 @@ +export var sparseDocs = { + name: 'sparse', + category: 'Construction', + syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], "number")'], + description: 'Create a sparse matrix.', + examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], "number")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js new file mode 100644 index 0000000..2b1354b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js @@ -0,0 +1,8 @@ +export var splitUnitDocs = { + name: 'splitUnit', + category: 'Construction', + syntax: ['splitUnit(unit: Unit, parts: Unit[])'], + description: 'Split a unit in an array of units whose sum is equal to the original unit.', + examples: ['splitUnit(1 m, ["feet", "inch"])'], + seealso: ['unit', 'createUnit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js new file mode 100644 index 0000000..deb8406 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js @@ -0,0 +1,8 @@ +export var stringDocs = { + name: 'string', + category: 'Construction', + syntax: ['"text"', 'string(x)'], + description: 'Create a string or convert a value to a string', + examples: ['"Hello World!"', 'string(4.2)', 'string(3 + 2i)'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js new file mode 100644 index 0000000..197f655 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js @@ -0,0 +1,8 @@ +export var unitDocs = { + name: 'unit', + category: 'Construction', + syntax: ['value unit', 'unit(value, unit)', 'unit(string)'], + description: 'Create a unit.', + examples: ['5.5 mm', '3 inch', 'unit(7.1, "kilogram")', 'unit("23 deg")'], + seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js new file mode 100644 index 0000000..3864bfd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js @@ -0,0 +1,8 @@ +export var configDocs = { + name: 'config', + category: 'Core', + syntax: ['config()', 'config(options)'], + description: 'Get configuration or change configuration.', + examples: ['config()', '1/3 + 1/4', 'config({number: "Fraction"})', '1/3 + 1/4'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js new file mode 100644 index 0000000..35df7c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js @@ -0,0 +1,8 @@ +export var importDocs = { + name: 'import', + category: 'Core', + syntax: ['import(functions)', 'import(functions, options)'], + description: 'Import functions or constants from an object.', + examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js new file mode 100644 index 0000000..1e73879 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js @@ -0,0 +1,8 @@ +export var typedDocs = { + name: 'typed', + category: 'Core', + syntax: ['typed(signatures)', 'typed(name, signatures)'], + description: 'Create a typed function.', + examples: ['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })', 'double(2)', 'double("hello")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js new file mode 100644 index 0000000..aae57ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js @@ -0,0 +1,720 @@ +import { eDocs } from './constants/e.js'; +import { falseDocs } from './constants/false.js'; +import { iDocs } from './constants/i.js'; +import { InfinityDocs } from './constants/Infinity.js'; +import { LN10Docs } from './constants/LN10.js'; +import { LN2Docs } from './constants/LN2.js'; +import { LOG10EDocs } from './constants/LOG10E.js'; +import { LOG2EDocs } from './constants/LOG2E.js'; +import { NaNDocs } from './constants/NaN.js'; +import { nullDocs } from './constants/null.js'; +import { phiDocs } from './constants/phi.js'; +import { piDocs } from './constants/pi.js'; +import { SQRT12Docs } from './constants/SQRT1_2.js'; +import { SQRT2Docs } from './constants/SQRT2.js'; +import { tauDocs } from './constants/tau.js'; +import { trueDocs } from './constants/true.js'; +import { versionDocs } from './constants/version.js'; +import { bignumberDocs } from './construction/bignumber.js'; +import { bigintDocs } from './construction/bigint.js'; +import { booleanDocs } from './construction/boolean.js'; +import { complexDocs } from './construction/complex.js'; +import { createUnitDocs } from './construction/createUnit.js'; +import { fractionDocs } from './construction/fraction.js'; +import { indexDocs } from './construction/index.js'; +import { matrixDocs } from './construction/matrix.js'; +import { numberDocs } from './construction/number.js'; +import { sparseDocs } from './construction/sparse.js'; +import { splitUnitDocs } from './construction/splitUnit.js'; +import { stringDocs } from './construction/string.js'; +import { unitDocs } from './construction/unit.js'; +import { configDocs } from './core/config.js'; +import { importDocs } from './core/import.js'; +import { typedDocs } from './core/typed.js'; +import { derivativeDocs } from './function/algebra/derivative.js'; +import { leafCountDocs } from './function/algebra/leafCount.js'; +import { lsolveDocs } from './function/algebra/lsolve.js'; +import { lsolveAllDocs } from './function/algebra/lsolveAll.js'; +import { lupDocs } from './function/algebra/lup.js'; +import { lusolveDocs } from './function/algebra/lusolve.js'; +import { polynomialRootDocs } from './function/algebra/polynomialRoot.js'; +import { qrDocs } from './function/algebra/qr.js'; +import { rationalizeDocs } from './function/algebra/rationalize.js'; +import { resolveDocs } from './function/algebra/resolve.js'; +import { simplifyDocs } from './function/algebra/simplify.js'; +import { simplifyConstantDocs } from './function/algebra/simplifyConstant.js'; +import { simplifyCoreDocs } from './function/algebra/simplifyCore.js'; +import { sluDocs } from './function/algebra/slu.js'; +import { symbolicEqualDocs } from './function/algebra/symbolicEqual.js'; +import { usolveDocs } from './function/algebra/usolve.js'; +import { usolveAllDocs } from './function/algebra/usolveAll.js'; +import { absDocs } from './function/arithmetic/abs.js'; +import { addDocs } from './function/arithmetic/add.js'; +import { cbrtDocs } from './function/arithmetic/cbrt.js'; +import { ceilDocs } from './function/arithmetic/ceil.js'; +import { cubeDocs } from './function/arithmetic/cube.js'; +import { divideDocs } from './function/arithmetic/divide.js'; +import { dotDivideDocs } from './function/arithmetic/dotDivide.js'; +import { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js'; +import { dotPowDocs } from './function/arithmetic/dotPow.js'; +import { expDocs } from './function/arithmetic/exp.js'; +import { expmDocs } from './function/arithmetic/expm.js'; +import { expm1Docs } from './function/arithmetic/expm1.js'; +import { fixDocs } from './function/arithmetic/fix.js'; +import { floorDocs } from './function/arithmetic/floor.js'; +import { gcdDocs } from './function/arithmetic/gcd.js'; +import { hypotDocs } from './function/arithmetic/hypot.js'; +import { invmodDocs } from './function/arithmetic/invmod.js'; +import { lcmDocs } from './function/arithmetic/lcm.js'; +import { logDocs } from './function/arithmetic/log.js'; +import { log10Docs } from './function/arithmetic/log10.js'; +import { log1pDocs } from './function/arithmetic/log1p.js'; +import { log2Docs } from './function/arithmetic/log2.js'; +import { modDocs } from './function/arithmetic/mod.js'; +import { multiplyDocs } from './function/arithmetic/multiply.js'; +import { normDocs } from './function/arithmetic/norm.js'; +import { nthRootDocs } from './function/arithmetic/nthRoot.js'; +import { nthRootsDocs } from './function/arithmetic/nthRoots.js'; +import { powDocs } from './function/arithmetic/pow.js'; +import { roundDocs } from './function/arithmetic/round.js'; +import { signDocs } from './function/arithmetic/sign.js'; +import { sqrtDocs } from './function/arithmetic/sqrt.js'; +import { sqrtmDocs } from './function/arithmetic/sqrtm.js'; +import { sylvesterDocs } from './function/algebra/sylvester.js'; +import { schurDocs } from './function/algebra/schur.js'; +import { lyapDocs } from './function/algebra/lyap.js'; +import { squareDocs } from './function/arithmetic/square.js'; +import { subtractDocs } from './function/arithmetic/subtract.js'; +import { unaryMinusDocs } from './function/arithmetic/unaryMinus.js'; +import { unaryPlusDocs } from './function/arithmetic/unaryPlus.js'; +import { xgcdDocs } from './function/arithmetic/xgcd.js'; +import { bitAndDocs } from './function/bitwise/bitAnd.js'; +import { bitNotDocs } from './function/bitwise/bitNot.js'; +import { bitOrDocs } from './function/bitwise/bitOr.js'; +import { bitXorDocs } from './function/bitwise/bitXor.js'; +import { leftShiftDocs } from './function/bitwise/leftShift.js'; +import { rightArithShiftDocs } from './function/bitwise/rightArithShift.js'; +import { rightLogShiftDocs } from './function/bitwise/rightLogShift.js'; +import { bellNumbersDocs } from './function/combinatorics/bellNumbers.js'; +import { catalanDocs } from './function/combinatorics/catalan.js'; +import { compositionDocs } from './function/combinatorics/composition.js'; +import { stirlingS2Docs } from './function/combinatorics/stirlingS2.js'; +import { argDocs } from './function/complex/arg.js'; +import { conjDocs } from './function/complex/conj.js'; +import { imDocs } from './function/complex/im.js'; +import { reDocs } from './function/complex/re.js'; +import { evaluateDocs } from './function/expression/evaluate.js'; +import { helpDocs } from './function/expression/help.js'; +import { distanceDocs } from './function/geometry/distance.js'; +import { intersectDocs } from './function/geometry/intersect.js'; +import { andDocs } from './function/logical/and.js'; +import { notDocs } from './function/logical/not.js'; +import { orDocs } from './function/logical/or.js'; +import { xorDocs } from './function/logical/xor.js'; +import { columnDocs } from './function/matrix/column.js'; +import { concatDocs } from './function/matrix/concat.js'; +import { countDocs } from './function/matrix/count.js'; +import { crossDocs } from './function/matrix/cross.js'; +import { ctransposeDocs } from './function/matrix/ctranspose.js'; +import { detDocs } from './function/matrix/det.js'; +import { diagDocs } from './function/matrix/diag.js'; +import { diffDocs } from './function/matrix/diff.js'; +import { dotDocs } from './function/matrix/dot.js'; +import { eigsDocs } from './function/matrix/eigs.js'; +import { filterDocs } from './function/matrix/filter.js'; +import { flattenDocs } from './function/matrix/flatten.js'; +import { forEachDocs } from './function/matrix/forEach.js'; +import { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js'; +import { identityDocs } from './function/matrix/identity.js'; +import { invDocs } from './function/matrix/inv.js'; +import { pinvDocs } from './function/matrix/pinv.js'; +import { kronDocs } from './function/matrix/kron.js'; +import { mapDocs } from './function/matrix/map.js'; +import { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js'; +import { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js'; +import { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js'; +import { onesDocs } from './function/matrix/ones.js'; +import { partitionSelectDocs } from './function/matrix/partitionSelect.js'; +import { rangeDocs } from './function/matrix/range.js'; +import { reshapeDocs } from './function/matrix/reshape.js'; +import { resizeDocs } from './function/matrix/resize.js'; +import { rotateDocs } from './function/matrix/rotate.js'; +import { rotationMatrixDocs } from './function/matrix/rotationMatrix.js'; +import { rowDocs } from './function/matrix/row.js'; +import { sizeDocs } from './function/matrix/size.js'; +import { sortDocs } from './function/matrix/sort.js'; +import { squeezeDocs } from './function/matrix/squeeze.js'; +import { subsetDocs } from './function/matrix/subset.js'; +import { traceDocs } from './function/matrix/trace.js'; +import { transposeDocs } from './function/matrix/transpose.js'; +import { zerosDocs } from './function/matrix/zeros.js'; +import { fftDocs } from './function/matrix/fft.js'; +import { ifftDocs } from './function/matrix/ifft.js'; +import { combinationsDocs } from './function/probability/combinations.js'; +import { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js'; +import { factorialDocs } from './function/probability/factorial.js'; +import { gammaDocs } from './function/probability/gamma.js'; +import { lgammaDocs } from './function/probability/lgamma.js'; +import { kldivergenceDocs } from './function/probability/kldivergence.js'; +import { multinomialDocs } from './function/probability/multinomial.js'; +import { permutationsDocs } from './function/probability/permutations.js'; +import { pickRandomDocs } from './function/probability/pickRandom.js'; +import { randomDocs } from './function/probability/random.js'; +import { randomIntDocs } from './function/probability/randomInt.js'; +import { compareDocs } from './function/relational/compare.js'; +import { compareNaturalDocs } from './function/relational/compareNatural.js'; +import { compareTextDocs } from './function/relational/compareText.js'; +import { deepEqualDocs } from './function/relational/deepEqual.js'; +import { equalDocs } from './function/relational/equal.js'; +import { equalTextDocs } from './function/relational/equalText.js'; +import { largerDocs } from './function/relational/larger.js'; +import { largerEqDocs } from './function/relational/largerEq.js'; +import { smallerDocs } from './function/relational/smaller.js'; +import { smallerEqDocs } from './function/relational/smallerEq.js'; +import { unequalDocs } from './function/relational/unequal.js'; +import { setCartesianDocs } from './function/set/setCartesian.js'; +import { setDifferenceDocs } from './function/set/setDifference.js'; +import { setDistinctDocs } from './function/set/setDistinct.js'; +import { setIntersectDocs } from './function/set/setIntersect.js'; +import { setIsSubsetDocs } from './function/set/setIsSubset.js'; +import { setMultiplicityDocs } from './function/set/setMultiplicity.js'; +import { setPowersetDocs } from './function/set/setPowerset.js'; +import { setSizeDocs } from './function/set/setSize.js'; +import { setSymDifferenceDocs } from './function/set/setSymDifference.js'; +import { setUnionDocs } from './function/set/setUnion.js'; +import { zpk2tfDocs } from './function/signal/zpk2tf.js'; +import { freqzDocs } from './function/signal/freqz.js'; +import { erfDocs } from './function/special/erf.js'; +import { zetaDocs } from './function/special/zeta.js'; +import { madDocs } from './function/statistics/mad.js'; +import { maxDocs } from './function/statistics/max.js'; +import { meanDocs } from './function/statistics/mean.js'; +import { medianDocs } from './function/statistics/median.js'; +import { minDocs } from './function/statistics/min.js'; +import { modeDocs } from './function/statistics/mode.js'; +import { prodDocs } from './function/statistics/prod.js'; +import { quantileSeqDocs } from './function/statistics/quantileSeq.js'; +import { stdDocs } from './function/statistics/std.js'; +import { cumSumDocs } from './function/statistics/cumsum.js'; +import { sumDocs } from './function/statistics/sum.js'; +import { varianceDocs } from './function/statistics/variance.js'; +import { corrDocs } from './function/statistics/corr.js'; +import { acosDocs } from './function/trigonometry/acos.js'; +import { acoshDocs } from './function/trigonometry/acosh.js'; +import { acotDocs } from './function/trigonometry/acot.js'; +import { acothDocs } from './function/trigonometry/acoth.js'; +import { acscDocs } from './function/trigonometry/acsc.js'; +import { acschDocs } from './function/trigonometry/acsch.js'; +import { asecDocs } from './function/trigonometry/asec.js'; +import { asechDocs } from './function/trigonometry/asech.js'; +import { asinDocs } from './function/trigonometry/asin.js'; +import { asinhDocs } from './function/trigonometry/asinh.js'; +import { atanDocs } from './function/trigonometry/atan.js'; +import { atan2Docs } from './function/trigonometry/atan2.js'; +import { atanhDocs } from './function/trigonometry/atanh.js'; +import { cosDocs } from './function/trigonometry/cos.js'; +import { coshDocs } from './function/trigonometry/cosh.js'; +import { cotDocs } from './function/trigonometry/cot.js'; +import { cothDocs } from './function/trigonometry/coth.js'; +import { cscDocs } from './function/trigonometry/csc.js'; +import { cschDocs } from './function/trigonometry/csch.js'; +import { secDocs } from './function/trigonometry/sec.js'; +import { sechDocs } from './function/trigonometry/sech.js'; +import { sinDocs } from './function/trigonometry/sin.js'; +import { sinhDocs } from './function/trigonometry/sinh.js'; +import { tanDocs } from './function/trigonometry/tan.js'; +import { tanhDocs } from './function/trigonometry/tanh.js'; +import { toDocs } from './function/units/to.js'; +import { binDocs } from './function/utils/bin.js'; +import { cloneDocs } from './function/utils/clone.js'; +import { formatDocs } from './function/utils/format.js'; +import { hasNumericValueDocs } from './function/utils/hasNumericValue.js'; +import { hexDocs } from './function/utils/hex.js'; +import { isIntegerDocs } from './function/utils/isInteger.js'; +import { isNaNDocs } from './function/utils/isNaN.js'; +import { isNegativeDocs } from './function/utils/isNegative.js'; +import { isNumericDocs } from './function/utils/isNumeric.js'; +import { isPositiveDocs } from './function/utils/isPositive.js'; +import { isPrimeDocs } from './function/utils/isPrime.js'; +import { isZeroDocs } from './function/utils/isZero.js'; +import { numericDocs } from './function/utils/numeric.js'; +import { octDocs } from './function/utils/oct.js'; +import { printDocs } from './function/utils/print.js'; +import { typeOfDocs } from './function/utils/typeOf.js'; +import { solveODEDocs } from './function/numeric/solveODE.js'; +export var embeddedDocs = { + // construction functions + bignumber: bignumberDocs, + bigint: bigintDocs, + boolean: booleanDocs, + complex: complexDocs, + createUnit: createUnitDocs, + fraction: fractionDocs, + index: indexDocs, + matrix: matrixDocs, + number: numberDocs, + sparse: sparseDocs, + splitUnit: splitUnitDocs, + string: stringDocs, + unit: unitDocs, + // constants + e: eDocs, + E: eDocs, + false: falseDocs, + i: iDocs, + Infinity: InfinityDocs, + LN2: LN2Docs, + LN10: LN10Docs, + LOG2E: LOG2EDocs, + LOG10E: LOG10EDocs, + NaN: NaNDocs, + null: nullDocs, + pi: piDocs, + PI: piDocs, + phi: phiDocs, + SQRT1_2: SQRT12Docs, + SQRT2: SQRT2Docs, + tau: tauDocs, + true: trueDocs, + version: versionDocs, + // physical constants + // TODO: more detailed docs for physical constants + speedOfLight: { + description: 'Speed of light in vacuum', + examples: ['speedOfLight'] + }, + gravitationConstant: { + description: 'Newtonian constant of gravitation', + examples: ['gravitationConstant'] + }, + planckConstant: { + description: 'Planck constant', + examples: ['planckConstant'] + }, + reducedPlanckConstant: { + description: 'Reduced Planck constant', + examples: ['reducedPlanckConstant'] + }, + magneticConstant: { + description: 'Magnetic constant (vacuum permeability)', + examples: ['magneticConstant'] + }, + electricConstant: { + description: 'Electric constant (vacuum permeability)', + examples: ['electricConstant'] + }, + vacuumImpedance: { + description: 'Characteristic impedance of vacuum', + examples: ['vacuumImpedance'] + }, + coulomb: { + description: 'Coulomb\'s constant', + examples: ['coulomb'] + }, + elementaryCharge: { + description: 'Elementary charge', + examples: ['elementaryCharge'] + }, + bohrMagneton: { + description: 'Bohr magneton', + examples: ['bohrMagneton'] + }, + conductanceQuantum: { + description: 'Conductance quantum', + examples: ['conductanceQuantum'] + }, + inverseConductanceQuantum: { + description: 'Inverse conductance quantum', + examples: ['inverseConductanceQuantum'] + }, + // josephson: {description: 'Josephson constant', examples: ['josephson']}, + magneticFluxQuantum: { + description: 'Magnetic flux quantum', + examples: ['magneticFluxQuantum'] + }, + nuclearMagneton: { + description: 'Nuclear magneton', + examples: ['nuclearMagneton'] + }, + klitzing: { + description: 'Von Klitzing constant', + examples: ['klitzing'] + }, + bohrRadius: { + description: 'Bohr radius', + examples: ['bohrRadius'] + }, + classicalElectronRadius: { + description: 'Classical electron radius', + examples: ['classicalElectronRadius'] + }, + electronMass: { + description: 'Electron mass', + examples: ['electronMass'] + }, + fermiCoupling: { + description: 'Fermi coupling constant', + examples: ['fermiCoupling'] + }, + fineStructure: { + description: 'Fine-structure constant', + examples: ['fineStructure'] + }, + hartreeEnergy: { + description: 'Hartree energy', + examples: ['hartreeEnergy'] + }, + protonMass: { + description: 'Proton mass', + examples: ['protonMass'] + }, + deuteronMass: { + description: 'Deuteron Mass', + examples: ['deuteronMass'] + }, + neutronMass: { + description: 'Neutron mass', + examples: ['neutronMass'] + }, + quantumOfCirculation: { + description: 'Quantum of circulation', + examples: ['quantumOfCirculation'] + }, + rydberg: { + description: 'Rydberg constant', + examples: ['rydberg'] + }, + thomsonCrossSection: { + description: 'Thomson cross section', + examples: ['thomsonCrossSection'] + }, + weakMixingAngle: { + description: 'Weak mixing angle', + examples: ['weakMixingAngle'] + }, + efimovFactor: { + description: 'Efimov factor', + examples: ['efimovFactor'] + }, + atomicMass: { + description: 'Atomic mass constant', + examples: ['atomicMass'] + }, + avogadro: { + description: 'Avogadro\'s number', + examples: ['avogadro'] + }, + boltzmann: { + description: 'Boltzmann constant', + examples: ['boltzmann'] + }, + faraday: { + description: 'Faraday constant', + examples: ['faraday'] + }, + firstRadiation: { + description: 'First radiation constant', + examples: ['firstRadiation'] + }, + loschmidt: { + description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa', + examples: ['loschmidt'] + }, + gasConstant: { + description: 'Gas constant', + examples: ['gasConstant'] + }, + molarPlanckConstant: { + description: 'Molar Planck constant', + examples: ['molarPlanckConstant'] + }, + molarVolume: { + description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa', + examples: ['molarVolume'] + }, + sackurTetrode: { + description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa', + examples: ['sackurTetrode'] + }, + secondRadiation: { + description: 'Second radiation constant', + examples: ['secondRadiation'] + }, + stefanBoltzmann: { + description: 'Stefan-Boltzmann constant', + examples: ['stefanBoltzmann'] + }, + wienDisplacement: { + description: 'Wien displacement law constant', + examples: ['wienDisplacement'] + }, + // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']}, + + molarMass: { + description: 'Molar mass constant', + examples: ['molarMass'] + }, + molarMassC12: { + description: 'Molar mass constant of carbon-12', + examples: ['molarMassC12'] + }, + gravity: { + description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)', + examples: ['gravity'] + }, + planckLength: { + description: 'Planck length', + examples: ['planckLength'] + }, + planckMass: { + description: 'Planck mass', + examples: ['planckMass'] + }, + planckTime: { + description: 'Planck time', + examples: ['planckTime'] + }, + planckCharge: { + description: 'Planck charge', + examples: ['planckCharge'] + }, + planckTemperature: { + description: 'Planck temperature', + examples: ['planckTemperature'] + }, + // functions - algebra + derivative: derivativeDocs, + lsolve: lsolveDocs, + lsolveAll: lsolveAllDocs, + lup: lupDocs, + lusolve: lusolveDocs, + leafCount: leafCountDocs, + polynomialRoot: polynomialRootDocs, + resolve: resolveDocs, + simplify: simplifyDocs, + simplifyConstant: simplifyConstantDocs, + simplifyCore: simplifyCoreDocs, + symbolicEqual: symbolicEqualDocs, + rationalize: rationalizeDocs, + slu: sluDocs, + usolve: usolveDocs, + usolveAll: usolveAllDocs, + qr: qrDocs, + // functions - arithmetic + abs: absDocs, + add: addDocs, + cbrt: cbrtDocs, + ceil: ceilDocs, + cube: cubeDocs, + divide: divideDocs, + dotDivide: dotDivideDocs, + dotMultiply: dotMultiplyDocs, + dotPow: dotPowDocs, + exp: expDocs, + expm: expmDocs, + expm1: expm1Docs, + fix: fixDocs, + floor: floorDocs, + gcd: gcdDocs, + hypot: hypotDocs, + lcm: lcmDocs, + log: logDocs, + log2: log2Docs, + log1p: log1pDocs, + log10: log10Docs, + mod: modDocs, + multiply: multiplyDocs, + norm: normDocs, + nthRoot: nthRootDocs, + nthRoots: nthRootsDocs, + pow: powDocs, + round: roundDocs, + sign: signDocs, + sqrt: sqrtDocs, + sqrtm: sqrtmDocs, + square: squareDocs, + subtract: subtractDocs, + unaryMinus: unaryMinusDocs, + unaryPlus: unaryPlusDocs, + xgcd: xgcdDocs, + invmod: invmodDocs, + // functions - bitwise + bitAnd: bitAndDocs, + bitNot: bitNotDocs, + bitOr: bitOrDocs, + bitXor: bitXorDocs, + leftShift: leftShiftDocs, + rightArithShift: rightArithShiftDocs, + rightLogShift: rightLogShiftDocs, + // functions - combinatorics + bellNumbers: bellNumbersDocs, + catalan: catalanDocs, + composition: compositionDocs, + stirlingS2: stirlingS2Docs, + // functions - core + config: configDocs, + import: importDocs, + typed: typedDocs, + // functions - complex + arg: argDocs, + conj: conjDocs, + re: reDocs, + im: imDocs, + // functions - expression + evaluate: evaluateDocs, + help: helpDocs, + // functions - geometry + distance: distanceDocs, + intersect: intersectDocs, + // functions - logical + and: andDocs, + not: notDocs, + or: orDocs, + xor: xorDocs, + // functions - matrix + concat: concatDocs, + count: countDocs, + cross: crossDocs, + column: columnDocs, + ctranspose: ctransposeDocs, + det: detDocs, + diag: diagDocs, + diff: diffDocs, + dot: dotDocs, + getMatrixDataType: getMatrixDataTypeDocs, + identity: identityDocs, + filter: filterDocs, + flatten: flattenDocs, + forEach: forEachDocs, + inv: invDocs, + pinv: pinvDocs, + eigs: eigsDocs, + kron: kronDocs, + matrixFromFunction: matrixFromFunctionDocs, + matrixFromRows: matrixFromRowsDocs, + matrixFromColumns: matrixFromColumnsDocs, + map: mapDocs, + ones: onesDocs, + partitionSelect: partitionSelectDocs, + range: rangeDocs, + resize: resizeDocs, + reshape: reshapeDocs, + rotate: rotateDocs, + rotationMatrix: rotationMatrixDocs, + row: rowDocs, + size: sizeDocs, + sort: sortDocs, + squeeze: squeezeDocs, + subset: subsetDocs, + trace: traceDocs, + transpose: transposeDocs, + zeros: zerosDocs, + fft: fftDocs, + ifft: ifftDocs, + sylvester: sylvesterDocs, + schur: schurDocs, + lyap: lyapDocs, + // functions - numeric + solveODE: solveODEDocs, + // functions - probability + combinations: combinationsDocs, + combinationsWithRep: combinationsWithRepDocs, + // distribution: distributionDocs, + factorial: factorialDocs, + gamma: gammaDocs, + kldivergence: kldivergenceDocs, + lgamma: lgammaDocs, + multinomial: multinomialDocs, + permutations: permutationsDocs, + pickRandom: pickRandomDocs, + random: randomDocs, + randomInt: randomIntDocs, + // functions - relational + compare: compareDocs, + compareNatural: compareNaturalDocs, + compareText: compareTextDocs, + deepEqual: deepEqualDocs, + equal: equalDocs, + equalText: equalTextDocs, + larger: largerDocs, + largerEq: largerEqDocs, + smaller: smallerDocs, + smallerEq: smallerEqDocs, + unequal: unequalDocs, + // functions - set + setCartesian: setCartesianDocs, + setDifference: setDifferenceDocs, + setDistinct: setDistinctDocs, + setIntersect: setIntersectDocs, + setIsSubset: setIsSubsetDocs, + setMultiplicity: setMultiplicityDocs, + setPowerset: setPowersetDocs, + setSize: setSizeDocs, + setSymDifference: setSymDifferenceDocs, + setUnion: setUnionDocs, + // functions - signal + zpk2tf: zpk2tfDocs, + freqz: freqzDocs, + // functions - special + erf: erfDocs, + zeta: zetaDocs, + // functions - statistics + cumsum: cumSumDocs, + mad: madDocs, + max: maxDocs, + mean: meanDocs, + median: medianDocs, + min: minDocs, + mode: modeDocs, + prod: prodDocs, + quantileSeq: quantileSeqDocs, + std: stdDocs, + sum: sumDocs, + variance: varianceDocs, + corr: corrDocs, + // functions - trigonometry + acos: acosDocs, + acosh: acoshDocs, + acot: acotDocs, + acoth: acothDocs, + acsc: acscDocs, + acsch: acschDocs, + asec: asecDocs, + asech: asechDocs, + asin: asinDocs, + asinh: asinhDocs, + atan: atanDocs, + atanh: atanhDocs, + atan2: atan2Docs, + cos: cosDocs, + cosh: coshDocs, + cot: cotDocs, + coth: cothDocs, + csc: cscDocs, + csch: cschDocs, + sec: secDocs, + sech: sechDocs, + sin: sinDocs, + sinh: sinhDocs, + tan: tanDocs, + tanh: tanhDocs, + // functions - units + to: toDocs, + // functions - utils + clone: cloneDocs, + format: formatDocs, + bin: binDocs, + oct: octDocs, + hex: hexDocs, + isNaN: isNaNDocs, + isInteger: isIntegerDocs, + isNegative: isNegativeDocs, + isNumeric: isNumericDocs, + hasNumericValue: hasNumericValueDocs, + isPositive: isPositiveDocs, + isPrime: isPrimeDocs, + isZero: isZeroDocs, + print: printDocs, + typeOf: typeOfDocs, + numeric: numericDocs +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js new file mode 100644 index 0000000..755c5db --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js @@ -0,0 +1,8 @@ +export var derivativeDocs = { + name: 'derivative', + category: 'Algebra', + syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'], + description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.', + examples: ['derivative("2x^3", "x")', 'derivative("2x^3", "x", {simplify: false})', 'derivative("2x^2 + 3x + 4", "x")', 'derivative("sin(2x)", "x")', 'f = parse("x^2 + x")', 'x = parse("x")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'], + seealso: ['simplify', 'parse', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js new file mode 100644 index 0000000..5b7acd8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js @@ -0,0 +1,8 @@ +export var leafCountDocs = { + name: 'leafCount', + category: 'Algebra', + syntax: ['leafCount(expr)'], + description: 'Computes the number of leaves in the parse tree of the given expression', + examples: ['leafCount("e^(i*pi)-1")', 'leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'], + seealso: ['simplify'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js new file mode 100644 index 0000000..e45f544 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js @@ -0,0 +1,8 @@ +export var lsolveDocs = { + name: 'lsolve', + category: 'Algebra', + syntax: ['x=lsolve(L, b)'], + description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'], + seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js new file mode 100644 index 0000000..2bdf1d1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js @@ -0,0 +1,8 @@ +export var lsolveAllDocs = { + name: 'lsolveAll', + category: 'Algebra', + syntax: ['x=lsolveAll(L, b)'], + description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'], + seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js new file mode 100644 index 0000000..4b3af50 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js @@ -0,0 +1,8 @@ +export var lupDocs = { + name: 'lup', + category: 'Algebra', + syntax: ['lup(m)'], + description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U', + examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'], + seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js new file mode 100644 index 0000000..25a4709 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js @@ -0,0 +1,8 @@ +export var lusolveDocs = { + name: 'lusolve', + category: 'Algebra', + syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'], + description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.', + examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'], + seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js new file mode 100644 index 0000000..5d92c34 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js @@ -0,0 +1,8 @@ +export var lyapDocs = { + name: 'lyap', + category: 'Algebra', + syntax: ['lyap(A,Q)'], + description: 'Solves the Continuous-time Lyapunov equation AP+PA\'+Q=0 for P', + examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'], + seealso: ['schur', 'sylvester'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js new file mode 100644 index 0000000..015c69b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js @@ -0,0 +1,8 @@ +export var polynomialRootDocs = { + name: 'polynomialRoot', + category: 'Algebra', + syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'], + description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.', + examples: ['a = polynomialRoot(-6, 11, -6, 1)'], + seealso: ['cbrt', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js new file mode 100644 index 0000000..f6e2433 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js @@ -0,0 +1,8 @@ +export var qrDocs = { + name: 'qr', + category: 'Algebra', + syntax: ['qr(A)'], + description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.', + examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'], + seealso: ['lup', 'slu', 'matrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js new file mode 100644 index 0000000..0e93662 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js @@ -0,0 +1,8 @@ +export var rationalizeDocs = { + name: 'rationalize', + category: 'Algebra', + syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'], + description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.', + examples: ['rationalize("2x/y - y/(x+1)")', 'rationalize("2x/y - y/(x+1)", true)'], + seealso: ['simplify'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js new file mode 100644 index 0000000..05cf54d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js @@ -0,0 +1,9 @@ +export var resolveDocs = { + name: 'resolve', + category: 'Algebra', + syntax: ['resolve(node, scope)'], + description: 'Recursively substitute variables in an expression tree.', + examples: ['resolve(parse("1 + x"), { x: 7 })', 'resolve(parse("size(text)"), { text: "Hello World" })', 'resolve(parse("x + y"), { x: parse("3z") })', 'resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'], + seealso: ['simplify', 'evaluate'], + mayThrow: ['ReferenceError'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js new file mode 100644 index 0000000..45de73d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js @@ -0,0 +1,8 @@ +export var schurDocs = { + name: 'schur', + category: 'Algebra', + syntax: ['schur(A)'], + description: 'Performs a real Schur decomposition of the real matrix A = UTU\'', + examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'], + seealso: ['lyap', 'sylvester'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js new file mode 100644 index 0000000..a777a97 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js @@ -0,0 +1,8 @@ +export var simplifyDocs = { + name: 'simplify', + category: 'Algebra', + syntax: ['simplify(expr)', 'simplify(expr, rules)'], + description: 'Simplify an expression tree.', + examples: ['simplify("3 + 2 / 4")', 'simplify("2x + x")', 'f = parse("x * (x + 2 + x)")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'], + seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js new file mode 100644 index 0000000..8881281 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js @@ -0,0 +1,8 @@ +export var simplifyConstantDocs = { + name: 'simplifyConstant', + category: 'Algebra', + syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'], + description: 'Replace constant subexpressions of node with their values.', + examples: ['simplifyConstant("(3-3)*x")', 'simplifyConstant(parse("z-cos(tau/8)"))'], + seealso: ['simplify', 'simplifyCore', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js new file mode 100644 index 0000000..4eed2a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js @@ -0,0 +1,8 @@ +export var simplifyCoreDocs = { + name: 'simplifyCore', + category: 'Algebra', + syntax: ['simplifyCore(node)'], + description: 'Perform simple one-pass simplifications on an expression tree.', + examples: ['simplifyCore(parse("0*x"))', 'simplifyCore(parse("(x+0)*2"))'], + seealso: ['simplify', 'simplifyConstant', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js new file mode 100644 index 0000000..f1527e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js @@ -0,0 +1,8 @@ +export var sluDocs = { + name: 'slu', + category: 'Algebra', + syntax: ['slu(A, order, threshold)'], + description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U', + examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'], + seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js new file mode 100644 index 0000000..6b42976 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js @@ -0,0 +1,8 @@ +export var sylvesterDocs = { + name: 'sylvester', + category: 'Algebra', + syntax: ['sylvester(A,B,C)'], + description: 'Solves the real-valued Sylvester equation AX+XB=C for X', + examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'], + seealso: ['schur', 'lyap'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js new file mode 100644 index 0000000..87b25fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js @@ -0,0 +1,8 @@ +export var symbolicEqualDocs = { + name: 'symbolicEqual', + category: 'Algebra', + syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'], + description: 'Returns true if the difference of the expressions simplifies to 0', + examples: ['symbolicEqual("x*y","y*x")', 'symbolicEqual("abs(x^2)", "x^2")', 'symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'], + seealso: ['simplify', 'evaluate'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js new file mode 100644 index 0000000..4020054 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js @@ -0,0 +1,8 @@ +export var usolveDocs = { + name: 'usolve', + category: 'Algebra', + syntax: ['x=usolve(U, b)'], + description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.', + examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'], + seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js new file mode 100644 index 0000000..b05833a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js @@ -0,0 +1,8 @@ +export var usolveAllDocs = { + name: 'usolveAll', + category: 'Algebra', + syntax: ['x=usolve(U, b)'], + description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.', + examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'], + seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js new file mode 100644 index 0000000..27c8f89 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js @@ -0,0 +1,8 @@ +export var absDocs = { + name: 'abs', + category: 'Arithmetic', + syntax: ['abs(x)'], + description: 'Compute the absolute value.', + examples: ['abs(3.5)', 'abs(-4.2)'], + seealso: ['sign'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js new file mode 100644 index 0000000..50c902b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js @@ -0,0 +1,8 @@ +export var addDocs = { + name: 'add', + category: 'Operators', + syntax: ['x + y', 'add(x, y)'], + description: 'Add two values.', + examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '"2.3" + "4"'], + seealso: ['subtract'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js new file mode 100644 index 0000000..225cd12 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js @@ -0,0 +1,8 @@ +export var cbrtDocs = { + name: 'cbrt', + category: 'Arithmetic', + syntax: ['cbrt(x)', 'cbrt(x, allRoots)'], + description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned', + examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'], + seealso: ['square', 'sqrt', 'cube', 'multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js new file mode 100644 index 0000000..e38bb35 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js @@ -0,0 +1,8 @@ +export var ceilDocs = { + name: 'ceil', + category: 'Arithmetic', + syntax: ['ceil(x)'], + description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.', + examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'], + seealso: ['floor', 'fix', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js new file mode 100644 index 0000000..db2ea35 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js @@ -0,0 +1,8 @@ +export var cubeDocs = { + name: 'cube', + category: 'Arithmetic', + syntax: ['cube(x)'], + description: 'Compute the cube of a value. The cube of x is x * x * x.', + examples: ['cube(2)', '2^3', '2 * 2 * 2'], + seealso: ['multiply', 'square', 'pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js new file mode 100644 index 0000000..350eaa2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js @@ -0,0 +1,8 @@ +export var divideDocs = { + name: 'divide', + category: 'Operators', + syntax: ['x / y', 'divide(x, y)'], + description: 'Divide two values.', + examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'], + seealso: ['multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js new file mode 100644 index 0000000..d0124ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js @@ -0,0 +1,8 @@ +export var dotDivideDocs = { + name: 'dotDivide', + category: 'Operators', + syntax: ['x ./ y', 'dotDivide(x, y)'], + description: 'Divide two values element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'], + seealso: ['multiply', 'dotMultiply', 'divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js new file mode 100644 index 0000000..f66bba9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js @@ -0,0 +1,8 @@ +export var dotMultiplyDocs = { + name: 'dotMultiply', + category: 'Operators', + syntax: ['x .* y', 'dotMultiply(x, y)'], + description: 'Multiply two values element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'], + seealso: ['multiply', 'divide', 'dotDivide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js new file mode 100644 index 0000000..a977c1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js @@ -0,0 +1,8 @@ +export var dotPowDocs = { + name: 'dotPow', + category: 'Operators', + syntax: ['x .^ y', 'dotPow(x, y)'], + description: 'Calculates the power of x to y element wise.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'], + seealso: ['pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js new file mode 100644 index 0000000..0067c84 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js @@ -0,0 +1,8 @@ +export var expDocs = { + name: 'exp', + category: 'Arithmetic', + syntax: ['exp(x)'], + description: 'Calculate the exponent of a value.', + examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\'s formula'], + seealso: ['expm', 'expm1', 'pow', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js new file mode 100644 index 0000000..8fc045c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js @@ -0,0 +1,8 @@ +export var expmDocs = { + name: 'expm', + category: 'Arithmetic', + syntax: ['exp(x)'], + description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.', + examples: ['expm([[0,2],[0,0]])'], + seealso: ['exp'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js new file mode 100644 index 0000000..28098a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js @@ -0,0 +1,8 @@ +export var expm1Docs = { + name: 'expm1', + category: 'Arithmetic', + syntax: ['expm1(x)'], + description: 'Calculate the value of subtracting 1 from the exponential value.', + examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'], + seealso: ['exp', 'pow', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js new file mode 100644 index 0000000..69ad27d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js @@ -0,0 +1,8 @@ +export var fixDocs = { + name: 'fix', + category: 'Arithmetic', + syntax: ['fix(x)'], + description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.', + examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'], + seealso: ['ceil', 'floor', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js new file mode 100644 index 0000000..e004fe4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js @@ -0,0 +1,8 @@ +export var floorDocs = { + name: 'floor', + category: 'Arithmetic', + syntax: ['floor(x)'], + description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.', + examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'], + seealso: ['ceil', 'fix', 'round'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js new file mode 100644 index 0000000..3944fc2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js @@ -0,0 +1,8 @@ +export var gcdDocs = { + name: 'gcd', + category: 'Arithmetic', + syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'], + description: 'Compute the greatest common divisor.', + examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'], + seealso: ['lcm', 'xgcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js new file mode 100644 index 0000000..fa65019 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js @@ -0,0 +1,8 @@ +export var hypotDocs = { + name: 'hypot', + category: 'Arithmetic', + syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'], + description: 'Calculate the hypotenuse of a list with values.', + examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'], + seealso: ['abs', 'norm'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js new file mode 100644 index 0000000..3ad8e2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js @@ -0,0 +1,8 @@ +export var invmodDocs = { + name: 'invmod', + category: 'Arithmetic', + syntax: ['invmod(a, b)'], + description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)', + examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'], + seealso: ['gcd', 'xgcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js new file mode 100644 index 0000000..3b6309f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js @@ -0,0 +1,8 @@ +export var lcmDocs = { + name: 'lcm', + category: 'Arithmetic', + syntax: ['lcm(x, y)'], + description: 'Compute the least common multiple.', + examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'], + seealso: ['gcd'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js new file mode 100644 index 0000000..af228dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js @@ -0,0 +1,8 @@ +export var logDocs = { + name: 'log', + category: 'Arithmetic', + syntax: ['log(x)', 'log(x, base)'], + description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).', + examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'], + seealso: ['exp', 'log1p', 'log2', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js new file mode 100644 index 0000000..4687c87 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js @@ -0,0 +1,8 @@ +export var log10Docs = { + name: 'log10', + category: 'Arithmetic', + syntax: ['log10(x)'], + description: 'Compute the 10-base logarithm of a value.', + examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'], + seealso: ['exp', 'log'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js new file mode 100644 index 0000000..4c0a5cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js @@ -0,0 +1,8 @@ +export var log1pDocs = { + name: 'log1p', + category: 'Arithmetic', + syntax: ['log1p(x)', 'log1p(x, base)'], + description: 'Calculate the logarithm of a `value+1`', + examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'], + seealso: ['exp', 'log', 'log2', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js new file mode 100644 index 0000000..faf07cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js @@ -0,0 +1,8 @@ +export var log2Docs = { + name: 'log2', + category: 'Arithmetic', + syntax: ['log2(x)'], + description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.', + examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'], + seealso: ['exp', 'log1p', 'log', 'log10'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js new file mode 100644 index 0000000..f8eda30 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js @@ -0,0 +1,8 @@ +export var modDocs = { + name: 'mod', + category: 'Operators', + syntax: ['x % y', 'x mod y', 'mod(x, y)'], + description: 'Calculates the modulus, the remainder of an integer division.', + examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'], + seealso: ['divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js new file mode 100644 index 0000000..1f28098 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js @@ -0,0 +1,8 @@ +export var multiplyDocs = { + name: 'multiply', + category: 'Operators', + syntax: ['x * y', 'multiply(x, y)'], + description: 'multiply two values.', + examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'], + seealso: ['divide'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js new file mode 100644 index 0000000..129579e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js @@ -0,0 +1,7 @@ +export var normDocs = { + name: 'norm', + category: 'Arithmetic', + syntax: ['norm(x)', 'norm(x, p)'], + description: 'Calculate the norm of a number, vector or matrix.', + examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], "inf")', 'norm([[1, 2], [3, 4]], "fro")'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js new file mode 100644 index 0000000..9cf2442 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js @@ -0,0 +1,8 @@ +export var nthRootDocs = { + name: 'nthRoot', + category: 'Arithmetic', + syntax: ['nthRoot(a)', 'nthRoot(a, root)'], + description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation "x^root = A".', + examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'], + seealso: ['nthRoots', 'pow', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js new file mode 100644 index 0000000..2b5de3c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js @@ -0,0 +1,8 @@ +export var nthRootsDocs = { + name: 'nthRoots', + category: 'Arithmetic', + syntax: ['nthRoots(A)', 'nthRoots(A, root)'], + description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation "x^root = A". ' + 'This function returns an array of complex values.', + examples: ['nthRoots(1)', 'nthRoots(1, 3)'], + seealso: ['sqrt', 'pow', 'nthRoot'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js new file mode 100644 index 0000000..3924b92 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js @@ -0,0 +1,8 @@ +export var powDocs = { + name: 'pow', + category: 'Operators', + syntax: ['x ^ y', 'pow(x, y)'], + description: 'Calculates the power of x to y, x^y.', + examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'], + seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js new file mode 100644 index 0000000..aefd523 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js @@ -0,0 +1,8 @@ +export var roundDocs = { + name: 'round', + category: 'Arithmetic', + syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'], + description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.', + examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'], + seealso: ['ceil', 'floor', 'fix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js new file mode 100644 index 0000000..8972a5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js @@ -0,0 +1,8 @@ +export var signDocs = { + name: 'sign', + category: 'Arithmetic', + syntax: ['sign(x)'], + description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.', + examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'], + seealso: ['abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js new file mode 100644 index 0000000..9fc19ac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js @@ -0,0 +1,8 @@ +export var sqrtDocs = { + name: 'sqrt', + category: 'Arithmetic', + syntax: ['sqrt(x)'], + description: 'Compute the square root value. If x = y * y, then y is the square root of x.', + examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'], + seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js new file mode 100644 index 0000000..859deb3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js @@ -0,0 +1,8 @@ +export var sqrtmDocs = { + name: 'sqrtm', + category: 'Arithmetic', + syntax: ['sqrtm(x)'], + description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.', + examples: ['sqrtm([[33, 24], [48, 57]])'], + seealso: ['sqrt', 'abs', 'square', 'multiply'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js new file mode 100644 index 0000000..5c858f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js @@ -0,0 +1,8 @@ +export var squareDocs = { + name: 'square', + category: 'Arithmetic', + syntax: ['square(x)'], + description: 'Compute the square of a value. The square of x is x * x.', + examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'], + seealso: ['multiply', 'pow', 'sqrt', 'cube'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js new file mode 100644 index 0000000..c6a2084 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js @@ -0,0 +1,8 @@ +export var subtractDocs = { + name: 'subtract', + category: 'Operators', + syntax: ['x - y', 'subtract(x, y)'], + description: 'subtract two values.', + examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'], + seealso: ['add'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js new file mode 100644 index 0000000..e4dcbaf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js @@ -0,0 +1,8 @@ +export var unaryMinusDocs = { + name: 'unaryMinus', + category: 'Operators', + syntax: ['-x', 'unaryMinus(x)'], + description: 'Inverse the sign of a value. Converts booleans and strings to numbers.', + examples: ['-4.5', '-(-5.6)', '-"22"'], + seealso: ['add', 'subtract', 'unaryPlus'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js new file mode 100644 index 0000000..783efc4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js @@ -0,0 +1,8 @@ +export var unaryPlusDocs = { + name: 'unaryPlus', + category: 'Operators', + syntax: ['+x', 'unaryPlus(x)'], + description: 'Converts booleans and strings to numbers.', + examples: ['+true', '+"2"'], + seealso: ['add', 'subtract', 'unaryMinus'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js new file mode 100644 index 0000000..a0ec1de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js @@ -0,0 +1,8 @@ +export var xgcdDocs = { + name: 'xgcd', + category: 'Arithmetic', + syntax: ['xgcd(a, b)'], + description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.', + examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'], + seealso: ['gcd', 'lcm'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js new file mode 100644 index 0000000..5e4af2a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js @@ -0,0 +1,8 @@ +export var bitAndDocs = { + name: 'bitAnd', + category: 'Bitwise', + syntax: ['x & y', 'bitAnd(x, y)'], + description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0', + examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'], + seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js new file mode 100644 index 0000000..905841f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js @@ -0,0 +1,8 @@ +export var bitNotDocs = { + name: 'bitNot', + category: 'Bitwise', + syntax: ['~x', 'bitNot(x)'], + description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.', + examples: ['~1', '~2', 'bitNot([2, -3, 4])'], + seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js new file mode 100644 index 0000000..2e98ee5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js @@ -0,0 +1,8 @@ +export var bitOrDocs = { + name: 'bitOr', + category: 'Bitwise', + syntax: ['x | y', 'bitOr(x, y)'], + description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.', + examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'], + seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js new file mode 100644 index 0000000..4be877e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js @@ -0,0 +1,8 @@ +export var bitXorDocs = { + name: 'bitXor', + category: 'Bitwise', + syntax: ['bitXor(x, y)'], + description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.', + examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js new file mode 100644 index 0000000..a693a22 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js @@ -0,0 +1,8 @@ +export var leftShiftDocs = { + name: 'leftShift', + category: 'Bitwise', + syntax: ['x << y', 'leftShift(x, y)'], + description: 'Bitwise left logical shift of a value x by y number of bits.', + examples: ['4 << 1', '8 >> 1'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js new file mode 100644 index 0000000..107a877 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js @@ -0,0 +1,8 @@ +export var rightArithShiftDocs = { + name: 'rightArithShift', + category: 'Bitwise', + syntax: ['x >> y', 'rightArithShift(x, y)'], + description: 'Bitwise right arithmetic shift of a value x by y number of bits.', + examples: ['8 >> 1', '4 << 1', '-12 >> 2'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js new file mode 100644 index 0000000..fed62da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js @@ -0,0 +1,8 @@ +export var rightLogShiftDocs = { + name: 'rightLogShift', + category: 'Bitwise', + syntax: ['x >>> y', 'rightLogShift(x, y)'], + description: 'Bitwise right logical shift of a value x by y number of bits.', + examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'], + seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js new file mode 100644 index 0000000..2a24de3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js @@ -0,0 +1,8 @@ +export var bellNumbersDocs = { + name: 'bellNumbers', + category: 'Combinatorics', + syntax: ['bellNumbers(n)'], + description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: ['bellNumbers(3)', 'bellNumbers(8)'], + seealso: ['stirlingS2'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js new file mode 100644 index 0000000..e68903b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js @@ -0,0 +1,8 @@ +export var catalanDocs = { + name: 'catalan', + category: 'Combinatorics', + syntax: ['catalan(n)'], + description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: ['catalan(3)', 'catalan(8)'], + seealso: ['bellNumbers'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js new file mode 100644 index 0000000..17ddea5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js @@ -0,0 +1,8 @@ +export var compositionDocs = { + name: 'composition', + category: 'Combinatorics', + syntax: ['composition(n, k)'], + description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.', + examples: ['composition(5, 3)'], + seealso: ['combinations'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js new file mode 100644 index 0000000..42da118 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js @@ -0,0 +1,8 @@ +export var stirlingS2Docs = { + name: 'stirlingS2', + category: 'Combinatorics', + syntax: ['stirlingS2(n, k)'], + description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.', + examples: ['stirlingS2(5, 3)'], + seealso: ['bellNumbers'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js new file mode 100644 index 0000000..365d159 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js @@ -0,0 +1,8 @@ +export var argDocs = { + name: 'arg', + category: 'Complex', + syntax: ['arg(x)'], + description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).', + examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'], + seealso: ['re', 'im', 'conj', 'abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js new file mode 100644 index 0000000..95d6966 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js @@ -0,0 +1,8 @@ +export var conjDocs = { + name: 'conj', + category: 'Complex', + syntax: ['conj(x)'], + description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.', + examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'], + seealso: ['re', 'im', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js new file mode 100644 index 0000000..1ef8686 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js @@ -0,0 +1,8 @@ +export var imDocs = { + name: 'im', + category: 'Complex', + syntax: ['im(x)'], + description: 'Get the imaginary part of a complex number.', + examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'], + seealso: ['re', 'conj', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js new file mode 100644 index 0000000..5ba0074 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js @@ -0,0 +1,8 @@ +export var reDocs = { + name: 're', + category: 'Complex', + syntax: ['re(x)'], + description: 'Get the real part of a complex number.', + examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'], + seealso: ['im', 'conj', 'abs', 'arg'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js new file mode 100644 index 0000000..8462482 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js @@ -0,0 +1,8 @@ +export var evaluateDocs = { + name: 'evaluate', + category: 'Expression', + syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'], + description: 'Evaluate an expression or an array with expressions.', + examples: ['evaluate("2 + 3")', 'evaluate("sqrt(16)")', 'evaluate("2 inch to cm")', 'evaluate("sin(x * pi)", { "x": 1/2 })', 'evaluate(["width=2", "height=4","width*height"])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js new file mode 100644 index 0000000..51d9401 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js @@ -0,0 +1,8 @@ +export var helpDocs = { + name: 'help', + category: 'Expression', + syntax: ['help(object)', 'help(string)'], + description: 'Display documentation on a function or data type.', + examples: ['help(sqrt)', 'help("complex")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js new file mode 100644 index 0000000..f372020 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js @@ -0,0 +1,8 @@ +export var distanceDocs = { + name: 'distance', + category: 'Geometry', + syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'], + description: 'Calculates the Euclidean distance between two points.', + examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js new file mode 100644 index 0000000..ebf61d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js @@ -0,0 +1,8 @@ +export var intersectDocs = { + name: 'intersect', + category: 'Geometry', + syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'], + description: 'Computes the intersection point of lines and/or planes.', + examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js new file mode 100644 index 0000000..88112d0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js @@ -0,0 +1,8 @@ +export var andDocs = { + name: 'and', + category: 'Logical', + syntax: ['x and y', 'and(x, y)'], + description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.', + examples: ['true and false', 'true and true', '2 and 4'], + seealso: ['not', 'or', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js new file mode 100644 index 0000000..e5a7c58 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js @@ -0,0 +1,8 @@ +export var notDocs = { + name: 'not', + category: 'Logical', + syntax: ['not x', 'not(x)'], + description: 'Logical not. Flips the boolean value of given argument.', + examples: ['not true', 'not false', 'not 2', 'not 0'], + seealso: ['and', 'or', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js new file mode 100644 index 0000000..dbcd620 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js @@ -0,0 +1,8 @@ +export var orDocs = { + name: 'or', + category: 'Logical', + syntax: ['x or y', 'or(x, y)'], + description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.', + examples: ['true or false', 'false or false', '0 or 4'], + seealso: ['not', 'and', 'xor'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js new file mode 100644 index 0000000..c362d93 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js @@ -0,0 +1,8 @@ +export var xorDocs = { + name: 'xor', + category: 'Logical', + syntax: ['x xor y', 'xor(x, y)'], + description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.', + examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'], + seealso: ['not', 'and', 'or'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js new file mode 100644 index 0000000..2a2ee86 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js @@ -0,0 +1,8 @@ +export var columnDocs = { + name: 'column', + category: 'Matrix', + syntax: ['column(x, index)'], + description: 'Return a column from a matrix or array.', + examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'], + seealso: ['row', 'matrixFromColumns'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js new file mode 100644 index 0000000..b865da7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js @@ -0,0 +1,8 @@ +export var concatDocs = { + name: 'concat', + category: 'Matrix', + syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'], + description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.', + examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'], + seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js new file mode 100644 index 0000000..6237021 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js @@ -0,0 +1,8 @@ +export var countDocs = { + name: 'count', + category: 'Matrix', + syntax: ['count(x)'], + description: 'Count the number of elements of a matrix, array or string.', + examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count("hello world")'], + seealso: ['size'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js new file mode 100644 index 0000000..c9eed54 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js @@ -0,0 +1,8 @@ +export var crossDocs = { + name: 'cross', + category: 'Matrix', + syntax: ['cross(A, B)'], + description: 'Calculate the cross product for two vectors in three dimensional space.', + examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'], + seealso: ['multiply', 'dot'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js new file mode 100644 index 0000000..730680e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js @@ -0,0 +1,8 @@ +export var ctransposeDocs = { + name: 'ctranspose', + category: 'Matrix', + syntax: ['x\'', 'ctranspose(x)'], + description: 'Complex Conjugate and Transpose a matrix', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\'', 'ctranspose(a)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js new file mode 100644 index 0000000..79e0c92 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js @@ -0,0 +1,8 @@ +export var detDocs = { + name: 'det', + category: 'Matrix', + syntax: ['det(x)'], + description: 'Calculate the determinant of a matrix', + examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'], + seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js new file mode 100644 index 0000000..b6f65c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js @@ -0,0 +1,8 @@ +export var diagDocs = { + name: 'diag', + category: 'Matrix', + syntax: ['diag(x)', 'diag(x, k)'], + description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.', + examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'], + seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js new file mode 100644 index 0000000..518aa59 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js @@ -0,0 +1,8 @@ +export var diffDocs = { + name: 'diff', + category: 'Matrix', + syntax: ['diff(arr)', 'diff(arr, dim)'], + description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \'rectangular\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'], + examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'], + seealso: ['subtract', 'partitionSelect'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js new file mode 100644 index 0000000..05d137d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js @@ -0,0 +1,8 @@ +export var dotDocs = { + name: 'dot', + category: 'Matrix', + syntax: ['dot(A, B)', 'A * B'], + description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn', + examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'], + seealso: ['multiply', 'cross'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js new file mode 100644 index 0000000..56bfea9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js @@ -0,0 +1,8 @@ +export var eigsDocs = { + name: 'eigs', + category: 'Matrix', + syntax: ['eigs(x)'], + description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix', + examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'], + seealso: ['inv'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js new file mode 100644 index 0000000..6a372a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js @@ -0,0 +1,8 @@ +export var fftDocs = { + name: 'fft', + category: 'Matrix', + syntax: ['fft(x)'], + description: 'Calculate N-dimensional Fourier transform', + examples: ['fft([[1, 0], [1, 0]])'], + seealso: ['ifft'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js new file mode 100644 index 0000000..01658cd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js @@ -0,0 +1,8 @@ +export var filterDocs = { + name: 'filter', + category: 'Matrix', + syntax: ['filter(x, test)'], + description: 'Filter items in a matrix.', + examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'], + seealso: ['sort', 'map', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js new file mode 100644 index 0000000..02660a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js @@ -0,0 +1,8 @@ +export var flattenDocs = { + name: 'flatten', + category: 'Matrix', + syntax: ['flatten(x)'], + description: 'Flatten a multi dimensional matrix into a single dimensional matrix.', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'], + seealso: ['concat', 'resize', 'size', 'squeeze'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js new file mode 100644 index 0000000..11f11dc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js @@ -0,0 +1,8 @@ +export var forEachDocs = { + name: 'forEach', + category: 'Matrix', + syntax: ['forEach(x, callback)'], + description: 'Iterates over all elements of a matrix/array, and executes the given callback function.', + examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach(["Dog","Cat","Cat"], addPet)', 'numberOfPets'], + seealso: ['map', 'sort', 'filter'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js new file mode 100644 index 0000000..cc1daa2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js @@ -0,0 +1,8 @@ +export var getMatrixDataTypeDocs = { + name: 'getMatrixDataType', + category: 'Matrix', + syntax: ['getMatrixDataType(x)'], + description: 'Find the data type of all elements in a matrix or array, ' + 'for example "number" if all items are a number ' + 'and "Complex" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return "mixed".', + examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, "text"])', 'getMatrixDataType([1, bignumber(4)])'], + seealso: ['matrix', 'sparse', 'typeOf'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js new file mode 100644 index 0000000..c3d717e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js @@ -0,0 +1,8 @@ +export var identityDocs = { + name: 'identity', + category: 'Matrix', + syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'], + description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.', + examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'], + seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js new file mode 100644 index 0000000..99b6ce8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js @@ -0,0 +1,8 @@ +export var ifftDocs = { + name: 'ifft', + category: 'Matrix', + syntax: ['ifft(x)'], + description: 'Calculate N-dimensional inverse Fourier transform', + examples: ['ifft([[2, 2], [0, 0]])'], + seealso: ['fft'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js new file mode 100644 index 0000000..db48c64 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js @@ -0,0 +1,8 @@ +export var invDocs = { + name: 'inv', + category: 'Matrix', + syntax: ['inv(x)'], + description: 'Calculate the inverse of a matrix', + examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'], + seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js new file mode 100644 index 0000000..9d655ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js @@ -0,0 +1,8 @@ +export var kronDocs = { + name: 'kron', + category: 'Matrix', + syntax: ['kron(x, y)'], + description: 'Calculates the Kronecker product of 2 matrices or vectors.', + examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'], + seealso: ['multiply', 'dot', 'cross'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js new file mode 100644 index 0000000..711294e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js @@ -0,0 +1,8 @@ +export var mapDocs = { + name: 'map', + category: 'Matrix', + syntax: ['map(x, callback)', 'map(x, y, ..., callback)'], + description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.', + examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'], + seealso: ['filter', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js new file mode 100644 index 0000000..7d9a8e4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js @@ -0,0 +1,8 @@ +export var matrixFromColumnsDocs = { + name: 'matrixFromColumns', + category: 'Matrix', + syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'], + description: 'Create a dense matrix from vectors as individual columns.', + examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'], + seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js new file mode 100644 index 0000000..b872299 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js @@ -0,0 +1,8 @@ +export var matrixFromFunctionDocs = { + name: 'matrixFromFunction', + category: 'Matrix', + syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'], + description: 'Create a matrix by evaluating a generating function at each index.', + examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], "sparse", g)', 'matrixFromFunction([5], random)'], + seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js new file mode 100644 index 0000000..2ffdb7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js @@ -0,0 +1,8 @@ +export var matrixFromRowsDocs = { + name: 'matrixFromRows', + category: 'Matrix', + syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'], + description: 'Create a dense matrix from vectors as individual rows.', + examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'], + seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js new file mode 100644 index 0000000..793db0e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js @@ -0,0 +1,8 @@ +export var onesDocs = { + name: 'ones', + category: 'Matrix', + syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'], + description: 'Create a matrix containing ones.', + examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js new file mode 100644 index 0000000..b896b3f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js @@ -0,0 +1,8 @@ +export var partitionSelectDocs = { + name: 'partitionSelect', + category: 'Matrix', + syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'], + description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.', + examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect(["C", "B", "A", "D"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \'desc\') # returns 2, arr is now: [5, 2, 1]', 'arr'], + seealso: ['sort'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js new file mode 100644 index 0000000..93a7a43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js @@ -0,0 +1,8 @@ +export var pinvDocs = { + name: 'pinv', + category: 'Matrix', + syntax: ['pinv(x)'], + description: 'Calculate the Moore–Penrose inverse of a matrix', + examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'], + seealso: ['inv'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js new file mode 100644 index 0000000..d059efc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js @@ -0,0 +1,8 @@ +export var rangeDocs = { + name: 'range', + category: 'Type', + syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'], + description: 'Create a range. Lower bound of the range is included, upper bound is excluded.', + examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range("4:10")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js new file mode 100644 index 0000000..4a7e1da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js @@ -0,0 +1,8 @@ +export var reshapeDocs = { + name: 'reshape', + category: 'Matrix', + syntax: ['reshape(x, sizes)'], + description: 'Reshape a multi dimensional array to fit the specified dimensions.', + examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'], + seealso: ['size', 'squeeze', 'resize'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js new file mode 100644 index 0000000..8ff141a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js @@ -0,0 +1,8 @@ +export var resizeDocs = { + name: 'resize', + category: 'Matrix', + syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'], + description: 'Resize a matrix.', + examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize("hello", [8], "!")'], + seealso: ['size', 'subset', 'squeeze', 'reshape'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js new file mode 100644 index 0000000..8d45123 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js @@ -0,0 +1,8 @@ +export var rotateDocs = { + name: 'rotate', + category: 'Matrix', + syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'], + description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.', + examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit("35deg"))', 'rotate([1, 0, 0], unit("90deg"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'], + seealso: ['matrix', 'rotationMatrix'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js new file mode 100644 index 0000000..52c553d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js @@ -0,0 +1,8 @@ +export var rotationMatrixDocs = { + name: 'rotationMatrix', + category: 'Matrix', + syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'], + description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.', + examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit("45deg"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), "sparse")'], + seealso: ['cos', 'sin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js new file mode 100644 index 0000000..ca6626b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js @@ -0,0 +1,8 @@ +export var rowDocs = { + name: 'row', + category: 'Matrix', + syntax: ['row(x, index)'], + description: 'Return a row from a matrix or array.', + examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'], + seealso: ['column', 'matrixFromRows'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js new file mode 100644 index 0000000..a93282e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js @@ -0,0 +1,8 @@ +export var sizeDocs = { + name: 'size', + category: 'Matrix', + syntax: ['size(x)'], + description: 'Calculate the size of a matrix.', + examples: ['size(2.3)', 'size("hello world")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'], + seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js new file mode 100644 index 0000000..5f21063 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js @@ -0,0 +1,8 @@ +export var sortDocs = { + name: 'sort', + category: 'Matrix', + syntax: ['sort(x)', 'sort(x, compare)'], + description: 'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.', + examples: ['sort([5, 10, 1])', 'sort(["C", "B", "A", "D"], "natural")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort(["Langdon", "Tom", "Sara"], sortByLength)', 'sort(["10", "1", "2"], "natural")'], + seealso: ['map', 'filter', 'forEach'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js new file mode 100644 index 0000000..bd699fe --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js @@ -0,0 +1,8 @@ +export var squeezeDocs = { + name: 'squeeze', + category: 'Matrix', + syntax: ['squeeze(x)'], + description: 'Remove inner and outer singleton dimensions from a matrix.', + examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js new file mode 100644 index 0000000..9c3907e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js @@ -0,0 +1,8 @@ +export var subsetDocs = { + name: 'subset', + category: 'Matrix', + syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'], + description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.', + examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js new file mode 100644 index 0000000..863f7f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js @@ -0,0 +1,8 @@ +export var traceDocs = { + name: 'trace', + category: 'Matrix', + syntax: ['trace(A)'], + description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.', + examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js new file mode 100644 index 0000000..a565ec5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js @@ -0,0 +1,8 @@ +export var transposeDocs = { + name: 'transpose', + category: 'Matrix', + syntax: ['x\'', 'transpose(x)'], + description: 'Transpose a matrix', + examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\'', 'transpose(a)'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js new file mode 100644 index 0000000..c6bbeb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js @@ -0,0 +1,8 @@ +export var zerosDocs = { + name: 'zeros', + category: 'Matrix', + syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'], + description: 'Create a matrix containing zeros.', + examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'], + seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js new file mode 100644 index 0000000..412cac9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js @@ -0,0 +1,8 @@ +export var solveODEDocs = { + name: 'solveODE', + category: 'Numeric', + syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'], + description: 'Numerical Integration of Ordinary Differential Equations.', + examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'], + seealso: ['derivative', 'simplifyCore'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js new file mode 100644 index 0000000..e9d3396 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js @@ -0,0 +1,8 @@ +export var combinationsDocs = { + name: 'combinations', + category: 'Probability', + syntax: ['combinations(n, k)'], + description: 'Compute the number of combinations of n items taken k at a time', + examples: ['combinations(7, 5)'], + seealso: ['combinationsWithRep', 'permutations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js new file mode 100644 index 0000000..1938bf8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js @@ -0,0 +1,8 @@ +export var combinationsWithRepDocs = { + name: 'combinationsWithRep', + category: 'Probability', + syntax: ['combinationsWithRep(n, k)'], + description: 'Compute the number of combinations of n items taken k at a time with replacements.', + examples: ['combinationsWithRep(7, 5)'], + seealso: ['combinations', 'permutations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js new file mode 100644 index 0000000..fce3ffb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js @@ -0,0 +1,8 @@ +export var distributionDocs = { + name: 'distribution', + category: 'Probability', + syntax: ['distribution(name)', 'distribution(name, arg1, arg2, ...)'], + description: 'Create a distribution object of a specific type. ' + 'A distribution object contains functions `random([size,] [min,] [max])`, ' + '`randomInt([size,] [min,] [max])` and `pickRandom(array)`. ' + 'Available types of distributions: "uniform", "normal". ' + 'Note that the function distribution is currently not available via the expression parser.', + examples: [], + seealso: ['random', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js new file mode 100644 index 0000000..a3086a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js @@ -0,0 +1,8 @@ +export var factorialDocs = { + name: 'factorial', + category: 'Probability', + syntax: ['n!', 'factorial(n)'], + description: 'Compute the factorial of a value', + examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'], + seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js new file mode 100644 index 0000000..a5101a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js @@ -0,0 +1,8 @@ +export var gammaDocs = { + name: 'gamma', + category: 'Probability', + syntax: ['gamma(n)'], + description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.', + examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'], + seealso: ['factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js new file mode 100644 index 0000000..f9e967a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js @@ -0,0 +1,8 @@ +export var kldivergenceDocs = { + name: 'kldivergence', + category: 'Probability', + syntax: ['kldivergence(x, y)'], + description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.', + examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js new file mode 100644 index 0000000..0c9c7ca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js @@ -0,0 +1,8 @@ +export var lgammaDocs = { + name: 'lgamma', + category: 'Probability', + syntax: ['lgamma(n)'], + description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.', + examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'], + seealso: ['gamma'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js new file mode 100644 index 0000000..d32e1f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js @@ -0,0 +1,8 @@ +export var multinomialDocs = { + name: 'multinomial', + category: 'Probability', + syntax: ['multinomial(A)'], + description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.', + examples: ['multinomial([1, 2, 1])'], + seealso: ['combinations', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js new file mode 100644 index 0000000..f955d24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js @@ -0,0 +1,8 @@ +export var permutationsDocs = { + name: 'permutations', + category: 'Probability', + syntax: ['permutations(n)', 'permutations(n, k)'], + description: 'Compute the number of permutations of n items taken k at a time', + examples: ['permutations(5)', 'permutations(5, 3)'], + seealso: ['combinations', 'combinationsWithRep', 'factorial'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js new file mode 100644 index 0000000..4acf5dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js @@ -0,0 +1,8 @@ +export var pickRandomDocs = { + name: 'pickRandom', + category: 'Probability', + syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'], + description: 'Pick a random entry from a given array.', + examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'], + seealso: ['random', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js new file mode 100644 index 0000000..69d6711 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js @@ -0,0 +1,8 @@ +export var randomDocs = { + name: 'random', + category: 'Probability', + syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'], + description: 'Return a random number.', + examples: ['random()', 'random(10, 20)', 'random([2, 3])'], + seealso: ['pickRandom', 'randomInt'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js new file mode 100644 index 0000000..6518fc3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js @@ -0,0 +1,8 @@ +export var randomIntDocs = { + name: 'randomInt', + category: 'Probability', + syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'], + description: 'Return a random integer number', + examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'], + seealso: ['pickRandom', 'random'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js new file mode 100644 index 0000000..17361a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js @@ -0,0 +1,8 @@ +export var compareDocs = { + name: 'compare', + category: 'Relational', + syntax: ['compare(x, y)'], + description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js new file mode 100644 index 0000000..c4202df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js @@ -0,0 +1,8 @@ +export var compareNaturalDocs = { + name: 'compareNatural', + category: 'Relational', + syntax: ['compareNatural(x, y)'], + description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural("2", "10")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js new file mode 100644 index 0000000..7225760 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js @@ -0,0 +1,8 @@ +export var compareTextDocs = { + name: 'compareText', + category: 'Relational', + syntax: ['compareText(x, y)'], + description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', + examples: ['compareText("B", "A")', 'compareText("A", "B")', 'compareText("A", "A")', 'compareText("2", "10")', 'compare("2", "10")', 'compare(2, 10)', 'compareNatural("2", "10")', 'compareText("B", ["A", "B", "C"])'], + seealso: ['compare', 'compareNatural'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js new file mode 100644 index 0000000..7332e8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js @@ -0,0 +1,8 @@ +export var deepEqualDocs = { + name: 'deepEqual', + category: 'Relational', + syntax: ['deepEqual(x, y)'], + description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.', + examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'], + seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js new file mode 100644 index 0000000..e0c956d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js @@ -0,0 +1,8 @@ +export var equalDocs = { + name: 'equal', + category: 'Relational', + syntax: ['x == y', 'equal(x, y)'], + description: 'Check equality of two values. Returns true if the values are equal, and false if not.', + examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'], + seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js new file mode 100644 index 0000000..f02230e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js @@ -0,0 +1,8 @@ +export var equalTextDocs = { + name: 'equalText', + category: 'Relational', + syntax: ['equalText(x, y)'], + description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.', + examples: ['equalText("Hello", "Hello")', 'equalText("a", "A")', 'equal("2e3", "2000")', 'equalText("2e3", "2000")', 'equalText("B", ["A", "B", "C"])'], + seealso: ['compare', 'compareNatural', 'compareText', 'equal'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js new file mode 100644 index 0000000..355fcb7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js @@ -0,0 +1,8 @@ +export var largerDocs = { + name: 'larger', + category: 'Relational', + syntax: ['x > y', 'larger(x, y)'], + description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.', + examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'], + seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js new file mode 100644 index 0000000..22fc8e2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js @@ -0,0 +1,8 @@ +export var largerEqDocs = { + name: 'largerEq', + category: 'Relational', + syntax: ['x >= y', 'largerEq(x, y)'], + description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.', + examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'], + seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js new file mode 100644 index 0000000..7776324 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js @@ -0,0 +1,8 @@ +export var smallerDocs = { + name: 'smaller', + category: 'Relational', + syntax: ['x < y', 'smaller(x, y)'], + description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.', + examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'], + seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js new file mode 100644 index 0000000..c0a7b0a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js @@ -0,0 +1,8 @@ +export var smallerEqDocs = { + name: 'smallerEq', + category: 'Relational', + syntax: ['x <= y', 'smallerEq(x, y)'], + description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.', + examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'], + seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js new file mode 100644 index 0000000..df7b95b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js @@ -0,0 +1,8 @@ +export var unequalDocs = { + name: 'unequal', + category: 'Relational', + syntax: ['x != y', 'unequal(x, y)'], + description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.', + examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'], + seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js new file mode 100644 index 0000000..2c80f7b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js @@ -0,0 +1,8 @@ +export var setCartesianDocs = { + name: 'setCartesian', + category: 'Set', + syntax: ['setCartesian(set1, set2)'], + description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.', + examples: ['setCartesian([1, 2], [3, 4])'], + seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js new file mode 100644 index 0000000..844f47b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js @@ -0,0 +1,8 @@ +export var setDifferenceDocs = { + name: 'setDifference', + category: 'Set', + syntax: ['setDifference(set1, set2)'], + description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setIntersect', 'setSymDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js new file mode 100644 index 0000000..50d839e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js @@ -0,0 +1,8 @@ +export var setDistinctDocs = { + name: 'setDistinct', + category: 'Set', + syntax: ['setDistinct(set)'], + description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setDistinct([1, 1, 1, 2, 2, 3])'], + seealso: ['setMultiplicity'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js new file mode 100644 index 0000000..b8dd9eb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js @@ -0,0 +1,8 @@ +export var setIntersectDocs = { + name: 'setIntersect', + category: 'Set', + syntax: ['setIntersect(set1, set2)'], + description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js new file mode 100644 index 0000000..095c83f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js @@ -0,0 +1,8 @@ +export var setIsSubsetDocs = { + name: 'setIsSubset', + category: 'Set', + syntax: ['setIsSubset(set1, set2)'], + description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js new file mode 100644 index 0000000..8ad1670 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js @@ -0,0 +1,8 @@ +export var setMultiplicityDocs = { + name: 'setMultiplicity', + category: 'Set', + syntax: ['setMultiplicity(element, set)'], + description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'], + seealso: ['setDistinct', 'setSize'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js new file mode 100644 index 0000000..b868e6e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js @@ -0,0 +1,8 @@ +export var setPowersetDocs = { + name: 'setPowerset', + category: 'Set', + syntax: ['setPowerset(set)'], + description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setPowerset([1, 2, 3])'], + seealso: ['setCartesian'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js new file mode 100644 index 0000000..dbeff60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js @@ -0,0 +1,8 @@ +export var setSizeDocs = { + name: 'setSize', + category: 'Set', + syntax: ['setSize(set)', 'setSize(set, unique)'], + description: 'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.', + examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js new file mode 100644 index 0000000..f3bdcd6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js @@ -0,0 +1,8 @@ +export var setSymDifferenceDocs = { + name: 'setSymDifference', + category: 'Set', + syntax: ['setSymDifference(set1, set2)'], + description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setUnion', 'setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js new file mode 100644 index 0000000..fadee5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js @@ -0,0 +1,8 @@ +export var setUnionDocs = { + name: 'setUnion', + category: 'Set', + syntax: ['setUnion(set1, set2)'], + description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', + examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'], + seealso: ['setIntersect', 'setDifference'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js new file mode 100644 index 0000000..f175874 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js @@ -0,0 +1,8 @@ +export var freqzDocs = { + name: 'freqz', + category: 'Signal', + syntax: ['freqz(b, a)', 'freqz(b, a, w)'], + description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.', + examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js new file mode 100644 index 0000000..7d39325 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js @@ -0,0 +1,8 @@ +export var zpk2tfDocs = { + name: 'zpk2tf', + category: 'Signal', + syntax: ['zpk2tf(z, p, k)'], + description: 'Compute the transfer function of a zero-pole-gain model.', + examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js new file mode 100644 index 0000000..2a2f63b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js @@ -0,0 +1,8 @@ +export var erfDocs = { + name: 'erf', + category: 'Special', + syntax: ['erf(x)'], + description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x', + examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js new file mode 100644 index 0000000..fd0d020 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js @@ -0,0 +1,8 @@ +export var zetaDocs = { + name: 'zeta', + category: 'Special', + syntax: ['zeta(s)'], + description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\'s Functional Equation for the entire complex plane', + examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js new file mode 100644 index 0000000..9509463 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js @@ -0,0 +1,8 @@ +export var corrDocs = { + name: 'corr', + category: 'Statistics', + syntax: ['corr(A,B)'], + description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.', + examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js new file mode 100644 index 0000000..18c3556 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js @@ -0,0 +1,8 @@ +export var cumSumDocs = { + name: 'cumsum', + category: 'Statistics', + syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'], + description: 'Compute the cumulative sum of all values.', + examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'], + seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js new file mode 100644 index 0000000..3ad0341 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js @@ -0,0 +1,8 @@ +export var madDocs = { + name: 'mad', + category: 'Statistics', + syntax: ['mad(a, b, c, ...)', 'mad(A)'], + description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.', + examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'], + seealso: ['mean', 'median', 'std', 'abs'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js new file mode 100644 index 0000000..502d572 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js @@ -0,0 +1,8 @@ +export var maxDocs = { + name: 'max', + category: 'Statistics', + syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'], + description: 'Compute the maximum value of a list of values.', + examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'], + seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js new file mode 100644 index 0000000..3ae39f4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js @@ -0,0 +1,8 @@ +export var meanDocs = { + name: 'mean', + category: 'Statistics', + syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'], + description: 'Compute the arithmetic mean of a list of values.', + examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'], + seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js new file mode 100644 index 0000000..7461756 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js @@ -0,0 +1,8 @@ +export var medianDocs = { + name: 'median', + category: 'Statistics', + syntax: ['median(a, b, c, ...)', 'median(A)'], + description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.', + examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'], + seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js new file mode 100644 index 0000000..d7fb06b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js @@ -0,0 +1,8 @@ +export var minDocs = { + name: 'min', + category: 'Statistics', + syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'], + description: 'Compute the minimum value of a list of values.', + examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'], + seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js new file mode 100644 index 0000000..e61e57c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js @@ -0,0 +1,8 @@ +export var modeDocs = { + name: 'mode', + category: 'Statistics', + syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'], + description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.', + examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'], + seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js new file mode 100644 index 0000000..7f86d23 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js @@ -0,0 +1,8 @@ +export var prodDocs = { + name: 'prod', + category: 'Statistics', + syntax: ['prod(a, b, c, ...)', 'prod(A)'], + description: 'Compute the product of all values.', + examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js new file mode 100644 index 0000000..e95eaac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js @@ -0,0 +1,8 @@ +export var quantileSeqDocs = { + name: 'quantileSeq', + category: 'Statistics', + syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'], + description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.', + examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'], + seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js new file mode 100644 index 0000000..8149980 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js @@ -0,0 +1,8 @@ +export var stdDocs = { + name: 'std', + category: 'Statistics', + syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'], + description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], "uncorrected")', 'std([2, 4, 6, 8], "biased")', 'std([1, 2, 3; 4, 5, 6])'], + seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js new file mode 100644 index 0000000..b84cc33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js @@ -0,0 +1,8 @@ +export var sumDocs = { + name: 'sum', + category: 'Statistics', + syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'], + description: 'Compute the sum of all values.', + examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'], + seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js new file mode 100644 index 0000000..1158062 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js @@ -0,0 +1,8 @@ +export var varianceDocs = { + name: 'variance', + category: 'Statistics', + syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'], + description: 'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], "uncorrected")', 'variance([2, 4, 6, 8], "biased")', 'variance([1, 2, 3; 4, 5, 6])'], + seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js new file mode 100644 index 0000000..f2aafc9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js @@ -0,0 +1,8 @@ +export var acosDocs = { + name: 'acos', + category: 'Trigonometry', + syntax: ['acos(x)'], + description: 'Compute the inverse cosine of a value in radians.', + examples: ['acos(0.5)', 'acos(cos(2.3))'], + seealso: ['cos', 'atan', 'asin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js new file mode 100644 index 0000000..e8be448 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js @@ -0,0 +1,8 @@ +export var acoshDocs = { + name: 'acosh', + category: 'Trigonometry', + syntax: ['acosh(x)'], + description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.', + examples: ['acosh(1.5)'], + seealso: ['cosh', 'asinh', 'atanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js new file mode 100644 index 0000000..96dc7df --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js @@ -0,0 +1,8 @@ +export var acotDocs = { + name: 'acot', + category: 'Trigonometry', + syntax: ['acot(x)'], + description: 'Calculate the inverse cotangent of a value.', + examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'], + seealso: ['cot', 'atan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js new file mode 100644 index 0000000..85d3955 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js @@ -0,0 +1,8 @@ +export var acothDocs = { + name: 'acoth', + category: 'Trigonometry', + syntax: ['acoth(x)'], + description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.', + examples: ['acoth(2)', 'acoth(0.5)'], + seealso: ['acsch', 'asech'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js new file mode 100644 index 0000000..9d93a03 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js @@ -0,0 +1,8 @@ +export var acscDocs = { + name: 'acsc', + category: 'Trigonometry', + syntax: ['acsc(x)'], + description: 'Calculate the inverse cotangent of a value.', + examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'], + seealso: ['csc', 'asin', 'asec'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js new file mode 100644 index 0000000..492b548 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js @@ -0,0 +1,8 @@ +export var acschDocs = { + name: 'acsch', + category: 'Trigonometry', + syntax: ['acsch(x)'], + description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.', + examples: ['acsch(0.5)'], + seealso: ['asech', 'acoth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js new file mode 100644 index 0000000..2b3a0c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js @@ -0,0 +1,8 @@ +export var asecDocs = { + name: 'asec', + category: 'Trigonometry', + syntax: ['asec(x)'], + description: 'Calculate the inverse secant of a value.', + examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'], + seealso: ['acos', 'acot', 'acsc'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js new file mode 100644 index 0000000..ed223d8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js @@ -0,0 +1,8 @@ +export var asechDocs = { + name: 'asech', + category: 'Trigonometry', + syntax: ['asech(x)'], + description: 'Calculate the inverse secant of a value.', + examples: ['asech(0.5)'], + seealso: ['acsch', 'acoth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js new file mode 100644 index 0000000..4d956e9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js @@ -0,0 +1,8 @@ +export var asinDocs = { + name: 'asin', + category: 'Trigonometry', + syntax: ['asin(x)'], + description: 'Compute the inverse sine of a value in radians.', + examples: ['asin(0.5)', 'asin(sin(0.5))'], + seealso: ['sin', 'acos', 'atan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js new file mode 100644 index 0000000..ae60da9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js @@ -0,0 +1,8 @@ +export var asinhDocs = { + name: 'asinh', + category: 'Trigonometry', + syntax: ['asinh(x)'], + description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.', + examples: ['asinh(0.5)'], + seealso: ['acosh', 'atanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js new file mode 100644 index 0000000..3b94dc6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js @@ -0,0 +1,8 @@ +export var atanDocs = { + name: 'atan', + category: 'Trigonometry', + syntax: ['atan(x)'], + description: 'Compute the inverse tangent of a value in radians.', + examples: ['atan(0.5)', 'atan(tan(0.5))'], + seealso: ['tan', 'acos', 'asin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js new file mode 100644 index 0000000..2489919 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js @@ -0,0 +1,8 @@ +export var atan2Docs = { + name: 'atan2', + category: 'Trigonometry', + syntax: ['atan2(y, x)'], + description: 'Computes the principal value of the arc tangent of y/x in radians.', + examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'], + seealso: ['sin', 'cos', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js new file mode 100644 index 0000000..3065fd7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js @@ -0,0 +1,8 @@ +export var atanhDocs = { + name: 'atanh', + category: 'Trigonometry', + syntax: ['atanh(x)'], + description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.', + examples: ['atanh(0.5)'], + seealso: ['acosh', 'asinh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js new file mode 100644 index 0000000..6fecbbc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js @@ -0,0 +1,8 @@ +export var cosDocs = { + name: 'cos', + category: 'Trigonometry', + syntax: ['cos(x)'], + description: 'Compute the cosine of x in radians.', + examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'], + seealso: ['acos', 'sin', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js new file mode 100644 index 0000000..b9b6a81 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js @@ -0,0 +1,8 @@ +export var coshDocs = { + name: 'cosh', + category: 'Trigonometry', + syntax: ['cosh(x)'], + description: 'Compute the hyperbolic cosine of x in radians.', + examples: ['cosh(0.5)'], + seealso: ['sinh', 'tanh', 'coth'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js new file mode 100644 index 0000000..3b48e1f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js @@ -0,0 +1,8 @@ +export var cotDocs = { + name: 'cot', + category: 'Trigonometry', + syntax: ['cot(x)'], + description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)', + examples: ['cot(2)', '1 / tan(2)'], + seealso: ['sec', 'csc', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js new file mode 100644 index 0000000..605e125 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js @@ -0,0 +1,8 @@ +export var cothDocs = { + name: 'coth', + category: 'Trigonometry', + syntax: ['coth(x)'], + description: 'Compute the hyperbolic cotangent of x in radians.', + examples: ['coth(2)', '1 / tanh(2)'], + seealso: ['sech', 'csch', 'tanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js new file mode 100644 index 0000000..0ab3e1d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js @@ -0,0 +1,8 @@ +export var cscDocs = { + name: 'csc', + category: 'Trigonometry', + syntax: ['csc(x)'], + description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)', + examples: ['csc(2)', '1 / sin(2)'], + seealso: ['sec', 'cot', 'sin'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js new file mode 100644 index 0000000..7c1e0f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js @@ -0,0 +1,8 @@ +export var cschDocs = { + name: 'csch', + category: 'Trigonometry', + syntax: ['csch(x)'], + description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)', + examples: ['csch(2)', '1 / sinh(2)'], + seealso: ['sech', 'coth', 'sinh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js new file mode 100644 index 0000000..68e37dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js @@ -0,0 +1,8 @@ +export var secDocs = { + name: 'sec', + category: 'Trigonometry', + syntax: ['sec(x)'], + description: 'Compute the secant of x in radians. Defined as 1/cos(x)', + examples: ['sec(2)', '1 / cos(2)'], + seealso: ['cot', 'csc', 'cos'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js new file mode 100644 index 0000000..3a51e19 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js @@ -0,0 +1,8 @@ +export var sechDocs = { + name: 'sech', + category: 'Trigonometry', + syntax: ['sech(x)'], + description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)', + examples: ['sech(2)', '1 / cosh(2)'], + seealso: ['coth', 'csch', 'cosh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js new file mode 100644 index 0000000..79de9f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js @@ -0,0 +1,8 @@ +export var sinDocs = { + name: 'sin', + category: 'Trigonometry', + syntax: ['sin(x)'], + description: 'Compute the sine of x in radians.', + examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'], + seealso: ['asin', 'cos', 'tan'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js new file mode 100644 index 0000000..4656c82 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js @@ -0,0 +1,8 @@ +export var sinhDocs = { + name: 'sinh', + category: 'Trigonometry', + syntax: ['sinh(x)'], + description: 'Compute the hyperbolic sine of x in radians.', + examples: ['sinh(0.5)'], + seealso: ['cosh', 'tanh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js new file mode 100644 index 0000000..0a96d8e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js @@ -0,0 +1,8 @@ +export var tanDocs = { + name: 'tan', + category: 'Trigonometry', + syntax: ['tan(x)'], + description: 'Compute the tangent of x in radians.', + examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'], + seealso: ['atan', 'sin', 'cos'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js new file mode 100644 index 0000000..61cf2dd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js @@ -0,0 +1,8 @@ +export var tanhDocs = { + name: 'tanh', + category: 'Trigonometry', + syntax: ['tanh(x)'], + description: 'Compute the hyperbolic tangent of x in radians.', + examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'], + seealso: ['sinh', 'cosh'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js new file mode 100644 index 0000000..090ebee --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js @@ -0,0 +1,8 @@ +export var toDocs = { + name: 'to', + category: 'Units', + syntax: ['x to unit', 'to(x, unit)'], + description: 'Change the unit of a value.', + examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js new file mode 100644 index 0000000..e7f1ac2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js @@ -0,0 +1,8 @@ +export var binDocs = { + name: 'bin', + category: 'Utils', + syntax: ['bin(value)'], + description: 'Format a number as binary', + examples: ['bin(2)'], + seealso: ['oct', 'hex'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js new file mode 100644 index 0000000..17685b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js @@ -0,0 +1,8 @@ +export var cloneDocs = { + name: 'clone', + category: 'Utils', + syntax: ['clone(x)'], + description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices', + examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone("hello world")'], + seealso: [] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js new file mode 100644 index 0000000..a2d5544 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js @@ -0,0 +1,8 @@ +export var formatDocs = { + name: 'format', + category: 'Utils', + syntax: ['format(value)', 'format(value, precision)'], + description: 'Format a value of any type as string.', + examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'], + seealso: ['print'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js new file mode 100644 index 0000000..fdc397c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js @@ -0,0 +1,8 @@ +export var hasNumericValueDocs = { + name: 'hasNumericValue', + category: 'Utils', + syntax: ['hasNumericValue(x)'], + description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.', + examples: ['hasNumericValue(2)', 'hasNumericValue("2")', 'isNumeric("2")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, "foo", false])'], + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js new file mode 100644 index 0000000..9764dc4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js @@ -0,0 +1,8 @@ +export var hexDocs = { + name: 'hex', + category: 'Utils', + syntax: ['hex(value)'], + description: 'Format a number as hexadecimal', + examples: ['hex(240)'], + seealso: ['bin', 'oct'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js new file mode 100644 index 0000000..5b87586 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js @@ -0,0 +1,8 @@ +export var isIntegerDocs = { + name: 'isInteger', + category: 'Utils', + syntax: ['isInteger(x)'], + description: 'Test whether a value is an integer number.', + examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'], + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js new file mode 100644 index 0000000..87bc055 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js @@ -0,0 +1,8 @@ +export var isNaNDocs = { + name: 'isNaN', + category: 'Utils', + syntax: ['isNaN(x)'], + description: 'Test whether a value is NaN (not a number)', + examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'], + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js new file mode 100644 index 0000000..a0f90c5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js @@ -0,0 +1,8 @@ +export var isNegativeDocs = { + name: 'isNegative', + category: 'Utils', + syntax: ['isNegative(x)'], + description: 'Test whether a value is negative: smaller than zero.', + examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'], + seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js new file mode 100644 index 0000000..9ecb3d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js @@ -0,0 +1,8 @@ +export var isNumericDocs = { + name: 'isNumeric', + category: 'Utils', + syntax: ['isNumeric(x)'], + description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.', + examples: ['isNumeric(2)', 'isNumeric("2")', 'hasNumericValue("2")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, "foo", false])'], + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js new file mode 100644 index 0000000..3af6886 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js @@ -0,0 +1,8 @@ +export var isPositiveDocs = { + name: 'isPositive', + category: 'Utils', + syntax: ['isPositive(x)'], + description: 'Test whether a value is positive: larger than zero.', + examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js new file mode 100644 index 0000000..a46ed17 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js @@ -0,0 +1,8 @@ +export var isPrimeDocs = { + name: 'isPrime', + category: 'Utils', + syntax: ['isPrime(x)'], + description: 'Test whether a value is prime: has no divisors other than itself and one.', + examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js new file mode 100644 index 0000000..3e08770 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js @@ -0,0 +1,8 @@ +export var isZeroDocs = { + name: 'isZero', + category: 'Utils', + syntax: ['isZero(x)'], + description: 'Test whether a value is zero.', + examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'], + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js new file mode 100644 index 0000000..382f6c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js @@ -0,0 +1,8 @@ +export var numericDocs = { + name: 'numeric', + category: 'Utils', + syntax: ['numeric(x)'], + description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.', + examples: ['numeric("4")', 'numeric("4", "number")', 'numeric("4", "bigint")', 'numeric("4", "BigNumber")', 'numeric("4", "Fraction")', 'numeric(4, "Fraction")', 'numeric(fraction(2, 5), "number")'], + seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js new file mode 100644 index 0000000..535a28b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js @@ -0,0 +1,8 @@ +export var octDocs = { + name: 'oct', + category: 'Utils', + syntax: ['oct(value)'], + description: 'Format a number as octal', + examples: ['oct(56)'], + seealso: ['bin', 'hex'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js new file mode 100644 index 0000000..6671b0c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js @@ -0,0 +1,8 @@ +export var printDocs = { + name: 'print', + category: 'Utils', + syntax: ['print(template, values)', 'print(template, values, precision)'], + description: 'Interpolate values into a string template.', + examples: ['print("Lucy is $age years old", {age: 5})', 'print("The value of pi is $pi", {pi: pi}, 3)', 'print("Hello, $user.name!", {user: {name: "John"}})', 'print("Values: $1, $2, $3", [6, 9, 4])'], + seealso: ['format'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js new file mode 100644 index 0000000..91629c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js @@ -0,0 +1,8 @@ +export var typeOfDocs = { + name: 'typeOf', + category: 'Utils', + syntax: ['typeOf(x)'], + description: 'Get the type of a variable.', + examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf("hello world")'], + seealso: ['getMatrixDataType'] +}; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/compile.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/compile.js new file mode 100644 index 0000000..b9441a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/compile.js @@ -0,0 +1,54 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'compile'; +var dependencies = ['typed', 'parse']; +export var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + parse + } = _ref; + /** + * Parse and compile an expression. + * Returns a an object with a function `evaluate([scope])` to evaluate the + * compiled expression. + * + * Syntax: + * + * math.compile(expr) // returns one node + * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes + * + * Examples: + * + * const code1 = math.compile('sqrt(3^2 + 4^2)') + * code1.evaluate() // 5 + * + * let scope = {a: 3, b: 4} + * const code2 = math.compile('a * b') // 12 + * code2.evaluate(scope) // 12 + * scope.a = 5 + * code2.evaluate(scope) // 20 + * + * const nodes = math.compile(['a = 3', 'b = 4', 'a * b']) + * nodes[2].evaluate() // 12 + * + * See also: + * + * parse, evaluate + * + * @param {string | string[] | Array | Matrix} expr + * The expression to be compiled + * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code + * An object with the compiled expression + * @throws {Error} + */ + return typed(name, { + string: function string(expr) { + return parse(expr).compile(); + }, + 'Array | Matrix': function Array__Matrix(expr) { + return deepMap(expr, function (entry) { + return parse(entry).compile(); + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/evaluate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/evaluate.js new file mode 100644 index 0000000..a4a68d0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/evaluate.js @@ -0,0 +1,68 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { createEmptyMap } from '../../utils/map.js'; +var name = 'evaluate'; +var dependencies = ['typed', 'parse']; +export var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + parse + } = _ref; + /** + * Evaluate an expression. + * + * The expression parser does not use JavaScript. Its syntax is close + * to JavaScript but more suited for mathematical expressions. + * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn + * the syntax and get an overview of the exact differences from JavaScript. + * + * Note the evaluating arbitrary expressions may involve security risks, + * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. + * + * Syntax: + * + * math.evaluate(expr) + * math.evaluate(expr, scope) + * math.evaluate([expr1, expr2, expr3, ...]) + * math.evaluate([expr1, expr2, expr3, ...], scope) + * + * Example: + * + * math.evaluate('(2+3)/4') // 1.25 + * math.evaluate('sqrt(3^2 + 4^2)') // 5 + * math.evaluate('sqrt(-4)') // 2i + * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12] + * + * let scope = {a:3, b:4} + * math.evaluate('a * b', scope) // 12 + * + * See also: + * + * parse, compile + * + * @param {string | string[] | Matrix} expr The expression to be evaluated + * @param {Object} [scope] Scope to read/write variables + * @return {*} The result of the expression + * @throws {Error} + */ + return typed(name, { + string: function string(expr) { + var scope = createEmptyMap(); + return parse(expr).compile().evaluate(scope); + }, + 'string, Map | Object': function string_Map__Object(expr, scope) { + return parse(expr).compile().evaluate(scope); + }, + 'Array | Matrix': function Array__Matrix(expr) { + var scope = createEmptyMap(); + return deepMap(expr, function (entry) { + return parse(entry).compile().evaluate(scope); + }); + }, + 'Array | Matrix, Map | Object': function Array__Matrix_Map__Object(expr, scope) { + return deepMap(expr, function (entry) { + return parse(entry).compile().evaluate(scope); + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/help.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/help.js new file mode 100644 index 0000000..8252aba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/help.js @@ -0,0 +1,66 @@ +import { factory } from '../../utils/factory.js'; +import { getSafeProperty } from '../../utils/customs.js'; +import { embeddedDocs } from '../embeddedDocs/embeddedDocs.js'; +import { hasOwnProperty } from '../../utils/object.js'; +var name = 'help'; +var dependencies = ['typed', 'mathWithTransform', 'Help']; +export var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + mathWithTransform, + Help + } = _ref; + /** + * Retrieve help on a function or data type. + * Help files are retrieved from the embedded documentation in math.docs. + * + * Syntax: + * + * math.help(search) + * + * Examples: + * + * console.log(math.help('sin').toString()) + * console.log(math.help(math.add).toString()) + * console.log(math.help(math.add).toJSON()) + * + * @param {Function | string | Object} search A function or function name + * for which to get help + * @return {Help} A help object + */ + return typed(name, { + any: function any(search) { + var prop; + var searchName = search; + if (typeof search !== 'string') { + for (prop in mathWithTransform) { + // search in functions and constants + if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) { + searchName = prop; + break; + } + } + + /* TODO: implement help for data types + if (!text) { + // search data type + for (prop in math.type) { + if (hasOwnProperty(math, prop)) { + if (search === math.type[prop]) { + text = prop + break + } + } + } + } + */ + } + var doc = getSafeProperty(embeddedDocs, searchName); + if (!doc) { + var searchText = typeof searchName === 'function' ? searchName.name : searchName; + throw new Error('No documentation found on "' + searchText + '"'); + } + return new Help(doc); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/parser.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/parser.js new file mode 100644 index 0000000..a976cec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/function/parser.js @@ -0,0 +1,57 @@ +import { factory } from '../../utils/factory.js'; +var name = 'parser'; +var dependencies = ['typed', 'Parser']; +export var createParser = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Parser + } = _ref; + /** + * Create a parser. The function creates a new `math.Parser` object. + * + * Syntax: + * + * math.parser() + * + * Examples: + * + * const parser = new math.parser() + * + * // evaluate expressions + * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5 + * const b = parser.evaluate('sqrt(-4)') // 2i + * const c = parser.evaluate('2 inch in cm') // 5.08 cm + * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476 + * + * // define variables and functions + * parser.evaluate('x = 7 / 2') // 3.5 + * parser.evaluate('x + 3') // 6.5 + * parser.evaluate('f(x, y) = x^y') // f(x, y) + * parser.evaluate('f(2, 3)') // 8 + * + * // get and set variables and functions + * const x = parser.get('x') // 3.5 + * const f = parser.get('f') // function + * const g = f(3, 2) // 9 + * parser.set('h', 500) + * const i = parser.evaluate('h / 2') // 250 + * parser.set('hello', function (name) { + * return 'hello, ' + name + '!' + * }) + * parser.evaluate('hello("user")') // "hello, user!" + * + * // clear defined functions and variables + * parser.clear() + * + * See also: + * + * evaluate, compile, parse + * + * @return {Parser} Parser + */ + return typed(name, { + '': function _() { + return new Parser(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/keywords.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/keywords.js new file mode 100644 index 0000000..4ab02b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/keywords.js @@ -0,0 +1,2 @@ +// Reserved keywords not allowed to use in the parser +export var keywords = new Set(['end']); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js new file mode 100644 index 0000000..de4b92d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js @@ -0,0 +1,189 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js'; +import { getSafeProperty } from '../../utils/customs.js'; +import { factory } from '../../utils/factory.js'; +import { accessFactory } from './utils/access.js'; +var name = 'AccessorNode'; +var dependencies = ['subset', 'Node']; +export var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + subset, + Node + } = _ref; + var access = accessFactory({ + subset + }); + + /** + * Are parenthesis needed? + * @private + */ + function needParenthesis(node) { + // TODO: maybe make a method on the nodes which tells whether they need parenthesis? + return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node)); + } + class AccessorNode extends Node { + /** + * @constructor AccessorNode + * @extends {Node} + * Access an object property or get a matrix subset + * + * @param {Node} object The object from which to retrieve + * a property or subset. + * @param {IndexNode} index IndexNode containing ranges + */ + constructor(object, index) { + super(); + if (!isNode(object)) { + throw new TypeError('Node expected for parameter "object"'); + } + if (!isIndexNode(index)) { + throw new TypeError('IndexNode expected for parameter "index"'); + } + this.object = object; + this.index = index; + } + + // readonly property name + get name() { + if (this.index) { + return this.index.isObjectProperty() ? this.index.getObjectProperty() : ''; + } else { + return this.object.name || ''; + } + } + get type() { + return name; + } + get isAccessorNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalObject = this.object._compile(math, argNames); + var evalIndex = this.index._compile(math, argNames); + if (this.index.isObjectProperty()) { + var prop = this.index.getObjectProperty(); + return function evalAccessorNode(scope, args, context) { + // get a property from an object evaluated using the scope. + return getSafeProperty(evalObject(scope, args, context), prop); + }; + } else { + return function evalAccessorNode(scope, args, context) { + var object = evalObject(scope, args, context); + // we pass just object here instead of context: + var index = evalIndex(scope, args, object); + return access(object, index); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.object, 'object', this); + callback(this.index, 'index', this); + } + + /** + * Create a new AccessorNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {AccessorNode} Returns a transformed copy of the node + */ + map(callback) { + return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {AccessorNode} + */ + clone() { + return new AccessorNode(this.object, this.index); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} + */ + _toString(options) { + var object = this.object.toString(options); + if (needParenthesis(this.object)) { + object = '(' + object + ')'; + } + return object + this.index.toString(options); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} + */ + _toHTML(options) { + var object = this.object.toHTML(options); + if (needParenthesis(this.object)) { + object = '(' + object + ')'; + } + return object + this.index.toHTML(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} + */ + _toTex(options) { + var object = this.object.toTex(options); + if (needParenthesis(this.object)) { + object = '\\left(\' + object + \'\\right)'; + } + return object + this.index.toTex(options); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + object: this.object, + index: this.index + }; + } + + /** + * Instantiate an AccessorNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "AccessorNode", object: ..., index: ...}`, + * where mathjs is optional + * @returns {AccessorNode} + */ + static fromJSON(json) { + return new AccessorNode(json.object, json.index); + } + } + _defineProperty(AccessorNode, "name", name); + return AccessorNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js new file mode 100644 index 0000000..9382a2c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js @@ -0,0 +1,176 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isArrayNode, isNode } from '../../utils/is.js'; +import { map } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'ArrayNode'; +var dependencies = ['Node']; +export var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + class ArrayNode extends Node { + /** + * @constructor ArrayNode + * @extends {Node} + * Holds an 1-dimensional array with items + * @param {Node[]} [items] 1 dimensional array with items + */ + constructor(items) { + super(); + this.items = items || []; + + // validate input + if (!Array.isArray(this.items) || !this.items.every(isNode)) { + throw new TypeError('Array containing Nodes expected'); + } + } + get type() { + return name; + } + get isArrayNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalItems = map(this.items, function (item) { + return item._compile(math, argNames); + }); + var asMatrix = math.config.matrix !== 'Array'; + if (asMatrix) { + var matrix = math.matrix; + return function evalArrayNode(scope, args, context) { + return matrix(map(evalItems, function (evalItem) { + return evalItem(scope, args, context); + })); + }; + } else { + return function evalArrayNode(scope, args, context) { + return map(evalItems, function (evalItem) { + return evalItem(scope, args, context); + }); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (var i = 0; i < this.items.length; i++) { + var node = this.items[i]; + callback(node, 'items[' + i + ']', this); + } + } + + /** + * Create a new ArrayNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ArrayNode} Returns a transformed copy of the node + */ + map(callback) { + var items = []; + for (var i = 0; i < this.items.length; i++) { + items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this)); + } + return new ArrayNode(items); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ArrayNode} + */ + clone() { + return new ArrayNode(this.items.slice(0)); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + var items = this.items.map(function (node) { + return node.toString(options); + }); + return '[' + items.join(', ') + ']'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + items: this.items + }; + } + + /** + * Instantiate an ArrayNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ArrayNode", items: [...]}`, + * where mathjs is optional + * @returns {ArrayNode} + */ + static fromJSON(json) { + return new ArrayNode(json.items); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + var items = this.items.map(function (node) { + return node.toHTML(options); + }); + return '[' + items.join(',') + ']'; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + function itemsToTex(items, nested) { + var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode); + var itemsFormRow = nested || mixedItems; + var itemSep = itemsFormRow ? '&' : '\\\\'; + var itemsTex = items.map(function (node) { + if (node.items) { + return itemsToTex(node.items, !nested); + } else { + return node.toTex(options); + } + }).join(itemSep); + return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\begin{bmatrix}' + itemsTex + '\\end{bmatrix}' : itemsTex; + } + return itemsToTex(this.items, false); + } + } + _defineProperty(ArrayNode, "name", name); + return ArrayNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js new file mode 100644 index 0000000..dacaadb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js @@ -0,0 +1,306 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js'; +import { getSafeProperty, setSafeProperty } from '../../utils/customs.js'; +import { factory } from '../../utils/factory.js'; +import { accessFactory } from './utils/access.js'; +import { assignFactory } from './utils/assign.js'; +import { getPrecedence } from '../operators.js'; +var name = 'AssignmentNode'; +var dependencies = ['subset', '?matrix', +// FIXME: should not be needed at all, should be handled by subset +'Node']; +export var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + subset, + matrix, + Node + } = _ref; + var access = accessFactory({ + subset + }); + var assign = assignFactory({ + subset, + matrix + }); + + /* + * Is parenthesis needed? + * @param {node} node + * @param {string} [parenthesis='keep'] + * @param {string} implicit + * @private + */ + function needParenthesis(node, parenthesis, implicit) { + if (!parenthesis) { + parenthesis = 'keep'; + } + var precedence = getPrecedence(node, parenthesis, implicit); + var exprPrecedence = getPrecedence(node.value, parenthesis, implicit); + return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence; + } + class AssignmentNode extends Node { + /** + * @constructor AssignmentNode + * @extends {Node} + * + * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or + * replace a subset of a matrix like `A[2,2]=42`. + * + * Syntax: + * + * new AssignmentNode(symbol, value) + * new AssignmentNode(object, index, value) + * + * Usage: + * + * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2 + * new AssignmentNode(new SymbolNode('a'), + * new IndexNode('b'), + * new ConstantNode(2)) // a.b=2 + * new AssignmentNode(new SymbolNode('a'), + * new IndexNode(1, 2), + * new ConstantNode(3)) // a[1,2]=3 + * + * @param {SymbolNode | AccessorNode} object + * Object on which to assign a value + * @param {IndexNode} [index=null] + * Index, property name or matrix index. Optional. If not provided + * and `object` is a SymbolNode, the property is assigned to the + * global scope. + * @param {Node} value + * The value to be assigned + */ + constructor(object, index, value) { + super(); + this.object = object; + this.index = value ? index : null; + this.value = value || index; + + // validate input + if (!isSymbolNode(object) && !isAccessorNode(object)) { + throw new TypeError('SymbolNode or AccessorNode expected as "object"'); + } + if (isSymbolNode(object) && object.name === 'end') { + throw new Error('Cannot assign to symbol "end"'); + } + if (this.index && !isIndexNode(this.index)) { + // index is optional + throw new TypeError('IndexNode expected as "index"'); + } + if (!isNode(this.value)) { + throw new TypeError('Node expected as "value"'); + } + } + + // class name for typing purposes: + + // readonly property name + get name() { + if (this.index) { + return this.index.isObjectProperty() ? this.index.getObjectProperty() : ''; + } else { + return this.object.name || ''; + } + } + get type() { + return name; + } + get isAssignmentNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalObject = this.object._compile(math, argNames); + var evalIndex = this.index ? this.index._compile(math, argNames) : null; + var evalValue = this.value._compile(math, argNames); + var name = this.object.name; + if (!this.index) { + // apply a variable to the scope, for example `a=2` + if (!isSymbolNode(this.object)) { + throw new TypeError('SymbolNode expected as object'); + } + return function evalAssignmentNode(scope, args, context) { + var value = evalValue(scope, args, context); + scope.set(name, value); + return value; + }; + } else if (this.index.isObjectProperty()) { + // apply an object property for example `a.b=2` + var prop = this.index.getObjectProperty(); + return function evalAssignmentNode(scope, args, context) { + var object = evalObject(scope, args, context); + var value = evalValue(scope, args, context); + setSafeProperty(object, prop, value); + return value; + }; + } else if (isSymbolNode(this.object)) { + // update a matrix subset, for example `a[2]=3` + return function evalAssignmentNode(scope, args, context) { + var childObject = evalObject(scope, args, context); + var value = evalValue(scope, args, context); + // Important: we pass childObject instead of context: + var index = evalIndex(scope, args, childObject); + scope.set(name, assign(childObject, index, value)); + return value; + }; + } else { + // isAccessorNode(node.object) === true + // update a matrix subset, for example `a.b[2]=3` + + // we will not use the compile function of the AccessorNode, but + // compile it ourselves here as we need the parent object of the + // AccessorNode: + // wee need to apply the updated object to parent object + var evalParentObject = this.object.object._compile(math, argNames); + if (this.object.index.isObjectProperty()) { + var parentProp = this.object.index.getObjectProperty(); + return function evalAssignmentNode(scope, args, context) { + var parent = evalParentObject(scope, args, context); + var childObject = getSafeProperty(parent, parentProp); + // Important: we pass childObject instead of context: + var index = evalIndex(scope, args, childObject); + var value = evalValue(scope, args, context); + setSafeProperty(parent, parentProp, assign(childObject, index, value)); + return value; + }; + } else { + // if some parameters use the 'end' parameter, we need to calculate + // the size + var evalParentIndex = this.object.index._compile(math, argNames); + return function evalAssignmentNode(scope, args, context) { + var parent = evalParentObject(scope, args, context); + // Important: we pass parent instead of context: + var parentIndex = evalParentIndex(scope, args, parent); + var childObject = access(parent, parentIndex); + // Important: we pass childObject instead of context + var index = evalIndex(scope, args, childObject); + var value = evalValue(scope, args, context); + assign(parent, parentIndex, assign(childObject, index, value)); + return value; + }; + } + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.object, 'object', this); + if (this.index) { + callback(this.index, 'index', this); + } + callback(this.value, 'value', this); + } + + /** + * Create a new AssignmentNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {AssignmentNode} Returns a transformed copy of the node + */ + map(callback) { + var object = this._ifNode(callback(this.object, 'object', this)); + var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null; + var value = this._ifNode(callback(this.value, 'value', this)); + return new AssignmentNode(object, index, value); + } + + /** + * Create a clone of this node, a shallow copy + * @return {AssignmentNode} + */ + clone() { + return new AssignmentNode(this.object, this.index, this.value); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} + */ + _toString(options) { + var object = this.object.toString(options); + var index = this.index ? this.index.toString(options) : ''; + var value = this.value.toString(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = '(' + value + ')'; + } + return object + index + ' = ' + value; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + object: this.object, + index: this.index, + value: this.value + }; + } + + /** + * Instantiate an AssignmentNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "AssignmentNode", object: ..., index: ..., value: ...}`, + * where mathjs is optional + * @returns {AssignmentNode} + */ + static fromJSON(json) { + return new AssignmentNode(json.object, json.index, json.value); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} + */ + _toHTML(options) { + var object = this.object.toHTML(options); + var index = this.index ? this.index.toHTML(options) : ''; + var value = this.value.toHTML(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = '(' + value + ')'; + } + return object + index + '=' + value; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} + */ + _toTex(options) { + var object = this.object.toTex(options); + var index = this.index ? this.index.toTex(options) : ''; + var value = this.value.toTex(options); + if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) { + value = "\\left(".concat(value, "\\right)"); + } + return object + index + '=' + value; + } + } + _defineProperty(AssignmentNode, "name", name); + return AssignmentNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/BlockNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/BlockNode.js new file mode 100644 index 0000000..e32f428 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/BlockNode.js @@ -0,0 +1,185 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isNode } from '../../utils/is.js'; +import { forEach, map } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'BlockNode'; +var dependencies = ['ResultSet', 'Node']; +export var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + ResultSet, + Node + } = _ref; + class BlockNode extends Node { + /** + * @constructor BlockNode + * @extends {Node} + * Holds a set with blocks + * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks + * An array with blocks, where a block is constructed as an + * Object with properties block, which is a Node, and visible, + * which is a boolean. The property visible is optional and + * is true by default + */ + constructor(blocks) { + super(); + // validate input, copy blocks + if (!Array.isArray(blocks)) throw new Error('Array expected'); + this.blocks = blocks.map(function (block) { + var node = block && block.node; + var visible = block && block.visible !== undefined ? block.visible : true; + if (!isNode(node)) throw new TypeError('Property "node" must be a Node'); + if (typeof visible !== 'boolean') { + throw new TypeError('Property "visible" must be a boolean'); + } + return { + node, + visible + }; + }); + } + get type() { + return name; + } + get isBlockNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalBlocks = map(this.blocks, function (block) { + return { + evaluate: block.node._compile(math, argNames), + visible: block.visible + }; + }); + return function evalBlockNodes(scope, args, context) { + var results = []; + forEach(evalBlocks, function evalBlockNode(block) { + var result = block.evaluate(scope, args, context); + if (block.visible) { + results.push(result); + } + }); + return new ResultSet(results); + }; + } + + /** + * Execute a callback for each of the child blocks of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (var i = 0; i < this.blocks.length; i++) { + callback(this.blocks[i].node, 'blocks[' + i + '].node', this); + } + } + + /** + * Create a new BlockNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {BlockNode} Returns a transformed copy of the node + */ + map(callback) { + var blocks = []; + for (var i = 0; i < this.blocks.length; i++) { + var block = this.blocks[i]; + var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this)); + blocks[i] = { + node, + visible: block.visible + }; + } + return new BlockNode(blocks); + } + + /** + * Create a clone of this node, a shallow copy + * @return {BlockNode} + */ + clone() { + var blocks = this.blocks.map(function (block) { + return { + node: block.node, + visible: block.visible + }; + }); + return new BlockNode(blocks); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + return this.blocks.map(function (param) { + return param.node.toString(options) + (param.visible ? '' : ';'); + }).join('\n'); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + blocks: this.blocks + }; + } + + /** + * Instantiate an BlockNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "BlockNode", blocks: [{node: ..., visible: false}, ...]}`, + * where mathjs is optional + * @returns {BlockNode} + */ + static fromJSON(json) { + return new BlockNode(json.blocks); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + return this.blocks.map(function (param) { + return param.node.toHTML(options) + (param.visible ? '' : ';'); + }).join('
    '); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + return this.blocks.map(function (param) { + return param.node.toTex(options) + (param.visible ? '' : ';'); + }).join('\\;\\;\n'); + } + } + _defineProperty(BlockNode, "name", name); + return BlockNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js new file mode 100644 index 0000000..3dfb8c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js @@ -0,0 +1,225 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { getPrecedence } from '../operators.js'; +var name = 'ConditionalNode'; +var dependencies = ['Node']; +export var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + /** + * Test whether a condition is met + * @param {*} condition + * @returns {boolean} true if condition is true or non-zero, else false + */ + function testCondition(condition) { + if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') { + return !!condition; + } + if (condition) { + if (isBigNumber(condition)) { + return !condition.isZero(); + } + if (isComplex(condition)) { + return !!(condition.re || condition.im); + } + if (isUnit(condition)) { + return !!condition.value; + } + } + if (condition === null || condition === undefined) { + return false; + } + throw new TypeError('Unsupported type of condition "' + typeOf(condition) + '"'); + } + class ConditionalNode extends Node { + /** + * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr' + * + * @param {Node} condition Condition, must result in a boolean + * @param {Node} trueExpr Expression evaluated when condition is true + * @param {Node} falseExpr Expression evaluated when condition is true + * + * @constructor ConditionalNode + * @extends {Node} + */ + constructor(condition, trueExpr, falseExpr) { + super(); + if (!isNode(condition)) { + throw new TypeError('Parameter condition must be a Node'); + } + if (!isNode(trueExpr)) { + throw new TypeError('Parameter trueExpr must be a Node'); + } + if (!isNode(falseExpr)) { + throw new TypeError('Parameter falseExpr must be a Node'); + } + this.condition = condition; + this.trueExpr = trueExpr; + this.falseExpr = falseExpr; + } + get type() { + return name; + } + get isConditionalNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalCondition = this.condition._compile(math, argNames); + var evalTrueExpr = this.trueExpr._compile(math, argNames); + var evalFalseExpr = this.falseExpr._compile(math, argNames); + return function evalConditionalNode(scope, args, context) { + return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context); + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.condition, 'condition', this); + callback(this.trueExpr, 'trueExpr', this); + callback(this.falseExpr, 'falseExpr', this); + } + + /** + * Create a new ConditionalNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ConditionalNode} Returns a transformed copy of the node + */ + map(callback) { + return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ConditionalNode} + */ + clone() { + return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var precedence = getPrecedence(this, parenthesis, options && options.implicit); + + // Enclose Arguments in parentheses if they are an OperatorNode + // or have lower or equal precedence + // NOTE: enclosing all OperatorNodes in parentheses is a decision + // purely based on aesthetics and readability + var condition = this.condition.toString(options); + var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) { + condition = '(' + condition + ')'; + } + var trueExpr = this.trueExpr.toString(options); + var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) { + trueExpr = '(' + trueExpr + ')'; + } + var falseExpr = this.falseExpr.toString(options); + var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) { + falseExpr = '(' + falseExpr + ')'; + } + return condition + ' ? ' + trueExpr + ' : ' + falseExpr; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + condition: this.condition, + trueExpr: this.trueExpr, + falseExpr: this.falseExpr + }; + } + + /** + * Instantiate an ConditionalNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "ConditionalNode", + * "condition": ..., + * "trueExpr": ..., + * "falseExpr": ...} + * ``` + * where mathjs is optional + * @returns {ConditionalNode} + */ + static fromJSON(json) { + return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var precedence = getPrecedence(this, parenthesis, options && options.implicit); + + // Enclose Arguments in parentheses if they are an OperatorNode + // or have lower or equal precedence + // NOTE: enclosing all OperatorNodes in parentheses is a decision + // purely based on aesthetics and readability + var condition = this.condition.toHTML(options); + var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) { + condition = '(' + condition + ')'; + } + var trueExpr = this.trueExpr.toHTML(options); + var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) { + trueExpr = '(' + trueExpr + ')'; + } + var falseExpr = this.falseExpr.toHTML(options); + var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit); + if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) { + falseExpr = '(' + falseExpr + ')'; + } + return condition + '?' + trueExpr + ':' + falseExpr; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + return '\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\quad{\\text{if }\\;' + this.condition.toTex(options) + '}\\\\{' + this.falseExpr.toTex(options) + '}, &\\quad{\\text{otherwise}}\\end{cases}'; + } + } + _defineProperty(ConditionalNode, "name", name); + return ConditionalNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js new file mode 100644 index 0000000..908eb87 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js @@ -0,0 +1,179 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { format } from '../../utils/string.js'; +import { typeOf } from '../../utils/is.js'; +import { escapeLatex } from '../../utils/latex.js'; +import { factory } from '../../utils/factory.js'; +var name = 'ConstantNode'; +var dependencies = ['Node']; +export var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + class ConstantNode extends Node { + /** + * A ConstantNode holds a constant value like a number or string. + * + * Usage: + * + * new ConstantNode(2.3) + * new ConstantNode('hello') + * + * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...) + * @constructor ConstantNode + * @extends {Node} + */ + constructor(value) { + super(); + this.value = value; + } + get type() { + return name; + } + get isConstantNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var value = this.value; + return function evalConstantNode() { + return value; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // nothing to do, we don't have any children + } + + /** + * Create a new ConstantNode with children produced by the given callback. + * Trivial because there are no children. + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {ConstantNode} Returns a clone of the node + */ + map(callback) { + return this.clone(); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ConstantNode} + */ + clone() { + return new ConstantNode(this.value); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + return format(this.value, options); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var value = this._toString(options); + switch (typeOf(this.value)) { + case 'number': + case 'bigint': + case 'BigNumber': + case 'Fraction': + return '' + value + ''; + case 'string': + return '' + value + ''; + case 'boolean': + return '' + value + ''; + case 'null': + return '' + value + ''; + case 'undefined': + return '' + value + ''; + default: + return '' + value + ''; + } + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + value: this.value + }; + } + + /** + * Instantiate a ConstantNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "SymbolNode", value: 2.3}`, + * where mathjs is optional + * @returns {ConstantNode} + */ + static fromJSON(json) { + return new ConstantNode(json.value); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var value = this._toString(options); + var type = typeOf(this.value); + switch (type) { + case 'string': + return '\\mathtt{' + escapeLatex(value) + '}'; + case 'number': + case 'BigNumber': + { + var finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value); + if (!finite) { + return this.value.valueOf() < 0 ? '-\\infty' : '\\infty'; + } + var index = value.toLowerCase().indexOf('e'); + if (index !== -1) { + return value.substring(0, index) + '\\cdot10^{' + value.substring(index + 1) + '}'; + } + return value; + } + case 'bigint': + { + return value.toString(); + } + case 'Fraction': + return this.value.toLatex(); + default: + return value; + } + } + } + _defineProperty(ConstantNode, "name", name); + return ConstantNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js new file mode 100644 index 0000000..c05a53a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js @@ -0,0 +1,235 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isNode } from '../../utils/is.js'; +import { keywords } from '../keywords.js'; +import { escape } from '../../utils/string.js'; +import { forEach, join } from '../../utils/array.js'; +import { toSymbol } from '../../utils/latex.js'; +import { getPrecedence } from '../operators.js'; +import { factory } from '../../utils/factory.js'; +var name = 'FunctionAssignmentNode'; +var dependencies = ['typed', 'Node']; +export var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Node + } = _ref; + /** + * Is parenthesis needed? + * @param {Node} node + * @param {Object} parenthesis + * @param {string} implicit + * @private + */ + function needParenthesis(node, parenthesis, implicit) { + var precedence = getPrecedence(node, parenthesis, implicit); + var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit); + return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence; + } + class FunctionAssignmentNode extends Node { + /** + * @constructor FunctionAssignmentNode + * @extends {Node} + * Function assignment + * + * @param {string} name Function name + * @param {string[] | Array.<{name: string, type: string}>} params + * Array with function parameter names, or an + * array with objects containing the name + * and type of the parameter + * @param {Node} expr The function expression + */ + constructor(name, params, expr) { + super(); + // validate input + if (typeof name !== 'string') { + throw new TypeError('String expected for parameter "name"'); + } + if (!Array.isArray(params)) { + throw new TypeError('Array containing strings or objects expected for parameter "params"'); + } + if (!isNode(expr)) { + throw new TypeError('Node expected for parameter "expr"'); + } + if (keywords.has(name)) { + throw new Error('Illegal function name, "' + name + '" is a reserved keyword'); + } + var paramNames = new Set(); + for (var param of params) { + var _name = typeof param === 'string' ? param : param.name; + if (paramNames.has(_name)) { + throw new Error("Duplicate parameter name \"".concat(_name, "\"")); + } else { + paramNames.add(_name); + } + } + this.name = name; + this.params = params.map(function (param) { + return param && param.name || param; + }); + this.types = params.map(function (param) { + return param && param.type || 'any'; + }); + this.expr = expr; + } + get type() { + return name; + } + get isFunctionAssignmentNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var childArgNames = Object.create(argNames); + forEach(this.params, function (param) { + childArgNames[param] = true; + }); + + // compile the function expression with the child args + var evalExpr = this.expr._compile(math, childArgNames); + var name = this.name; + var params = this.params; + var signature = join(this.types, ','); + var syntax = name + '(' + join(this.params, ', ') + ')'; + return function evalFunctionAssignmentNode(scope, args, context) { + var signatures = {}; + signatures[signature] = function () { + var childArgs = Object.create(args); + for (var i = 0; i < params.length; i++) { + childArgs[params[i]] = arguments[i]; + } + return evalExpr(scope, childArgs, context); + }; + var fn = typed(name, signatures); + fn.syntax = syntax; + scope.set(name, fn); + return fn; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.expr, 'expr', this); + } + + /** + * Create a new FunctionAssignmentNode whose children are the results of + * calling the provided callback function for each child of the original + * node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {FunctionAssignmentNode} Returns a transformed copy of the node + */ + map(callback) { + var expr = this._ifNode(callback(this.expr, 'expr', this)); + return new FunctionAssignmentNode(this.name, this.params.slice(0), expr); + } + + /** + * Create a clone of this node, a shallow copy + * @return {FunctionAssignmentNode} + */ + clone() { + return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr); + } + + /** + * get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var expr = this.expr.toString(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = '(' + expr + ')'; + } + return this.name + '(' + this.params.join(', ') + ') = ' + expr; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + var types = this.types; + return { + mathjs: name, + name: this.name, + params: this.params.map(function (param, index) { + return { + name: param, + type: types[index] + }; + }), + expr: this.expr + }; + } + + /** + * Instantiate an FunctionAssignmentNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "FunctionAssignmentNode", + * name: ..., params: ..., expr: ...} + * ``` + * where mathjs is optional + * @returns {FunctionAssignmentNode} + */ + static fromJSON(json) { + return new FunctionAssignmentNode(json.name, json.params, json.expr); + } + + /** + * get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var params = []; + for (var i = 0; i < this.params.length; i++) { + params.push('' + escape(this.params[i]) + ''); + } + var expr = this.expr.toHTML(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = '(' + expr + ')'; + } + return '' + escape(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr; + } + + /** + * get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var expr = this.expr.toTex(options); + if (needParenthesis(this, parenthesis, options && options.implicit)) { + expr = "\\left(".concat(expr, "\\right)"); + } + return '\\mathrm{' + this.name + '}\\left(' + this.params.map(toSymbol).join(',') + '\\right)=' + expr; + } + } + _defineProperty(FunctionAssignmentNode, "name", name); + return FunctionAssignmentNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js new file mode 100644 index 0000000..19e896d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js @@ -0,0 +1,479 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js'; +import { escape, format } from '../../utils/string.js'; +import { hasOwnProperty } from '../../utils/object.js'; +import { getSafeProperty, getSafeMethod } from '../../utils/customs.js'; +import { createSubScope } from '../../utils/scope.js'; +import { factory } from '../../utils/factory.js'; +import { defaultTemplate, latexFunctions } from '../../utils/latex.js'; +var name = 'FunctionNode'; +var dependencies = ['math', 'Node', 'SymbolNode']; +export var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var _FunctionNode; + var { + math, + Node, + SymbolNode + } = _ref; + /* format to fixed length */ + var strin = entity => format(entity, { + truncate: 78 + }); + + /* + * Expand a LaTeX template + * + * @param {string} template + * @param {Node} node + * @param {Object} options + * @private + **/ + function expandTemplate(template, node, options) { + var latex = ''; + + // Match everything of the form ${identifier} or ${identifier[2]} or $$ + // while submatching identifier and 2 (in the second case) + var regex = /\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi; + var inputPos = 0; // position in the input string + var match; + while ((match = regex.exec(template)) !== null) { + // go through all matches + // add everything in front of the match to the LaTeX string + latex += template.substring(inputPos, match.index); + inputPos = match.index; + if (match[0] === '$$') { + // escaped dollar sign + latex += '$'; + inputPos++; + } else { + // template parameter + inputPos += match[0].length; + var property = node[match[1]]; + if (!property) { + throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.'); + } + if (match[2] === undefined) { + // no square brackets + switch (typeof property) { + case 'string': + latex += property; + break; + case 'object': + if (isNode(property)) { + latex += property.toTex(options); + } else if (Array.isArray(property)) { + // make array of Nodes into comma separated list + latex += property.map(function (arg, index) { + if (isNode(arg)) { + return arg.toTex(options); + } + throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.'); + }).join(','); + } else { + throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes'); + } + break; + default: + throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes'); + } + } else { + // with square brackets + if (isNode(property[match[2]] && property[match[2]])) { + latex += property[match[2]].toTex(options); + } else { + throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.'); + } + } + } + } + latex += template.slice(inputPos); // append rest of the template + + return latex; + } + class FunctionNode extends Node { + /** + * @constructor FunctionNode + * @extends {./Node} + * invoke a list with arguments on a node + * @param {./Node | string} fn + * Item resolving to a function on which to invoke + * the arguments, typically a SymbolNode or AccessorNode + * @param {./Node[]} args + */ + constructor(fn, args) { + super(); + if (typeof fn === 'string') { + fn = new SymbolNode(fn); + } + + // validate input + if (!isNode(fn)) throw new TypeError('Node expected as parameter "fn"'); + if (!Array.isArray(args) || !args.every(isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "args"'); + } + this.fn = fn; + this.args = args || []; + } + + // readonly property name + get name() { + return this.fn.name || ''; + } + get type() { + return name; + } + get isFunctionNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // compile arguments + var evalArgs = this.args.map(arg => arg._compile(math, argNames)); + if (isSymbolNode(this.fn)) { + var _name = this.fn.name; + if (!argNames[_name]) { + // we can statically determine whether the function + // has the rawArgs property + var fn = _name in math ? getSafeProperty(math, _name) : undefined; + var isRaw = typeof fn === 'function' && fn.rawArgs === true; + var resolveFn = scope => { + var value; + if (scope.has(_name)) { + value = scope.get(_name); + } else if (_name in math) { + value = getSafeProperty(math, _name); + } else { + return FunctionNode.onUndefinedFunction(_name); + } + if (typeof value === 'function') { + return value; + } + throw new TypeError("'".concat(_name, "' is not a function; its value is:\n ").concat(strin(value))); + }; + if (isRaw) { + // pass unevaluated parameters (nodes) to the function + // "raw" evaluation + var rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + var fn = resolveFn(scope); + + // the original function can be overwritten in the scope with a non-rawArgs function + if (fn.rawArgs === true) { + return fn(rawArgs, math, createSubScope(scope, args)); + } else { + // "regular" evaluation + var values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn(...values); + } + }; + } else { + // "regular" evaluation + switch (evalArgs.length) { + case 0: + return function evalFunctionNode(scope, args, context) { + var fn = resolveFn(scope); + return fn(); + }; + case 1: + return function evalFunctionNode(scope, args, context) { + var fn = resolveFn(scope); + var evalArg0 = evalArgs[0]; + return fn(evalArg0(scope, args, context)); + }; + case 2: + return function evalFunctionNode(scope, args, context) { + var fn = resolveFn(scope); + var evalArg0 = evalArgs[0]; + var evalArg1 = evalArgs[1]; + return fn(evalArg0(scope, args, context), evalArg1(scope, args, context)); + }; + default: + return function evalFunctionNode(scope, args, context) { + var fn = resolveFn(scope); + var values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn(...values); + }; + } + } + } else { + // the function symbol is an argName + var _rawArgs = this.args; + return function evalFunctionNode(scope, args, context) { + var fn = getSafeProperty(args, _name); + if (typeof fn !== 'function') { + throw new TypeError("Argument '".concat(_name, "' was not a function; received: ").concat(strin(fn))); + } + if (fn.rawArgs) { + // "Raw" evaluation + return fn(_rawArgs, math, createSubScope(scope, args)); + } else { + var values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(fn, values); + } + }; + } + } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) { + // execute the function with the right context: + // the object of the AccessorNode + + var evalObject = this.fn.object._compile(math, argNames); + var prop = this.fn.index.getObjectProperty(); + var _rawArgs2 = this.args; + return function evalFunctionNode(scope, args, context) { + var object = evalObject(scope, args, context); + var fn = getSafeMethod(object, prop); + if (fn !== null && fn !== void 0 && fn.rawArgs) { + // "Raw" evaluation + return fn(_rawArgs2, math, createSubScope(scope, args)); + } else { + // "regular" evaluation + var values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(object, values); + } + }; + } else { + // node.fn.isAccessorNode && !node.fn.index.isObjectProperty() + // we have to dynamically determine whether the function has the + // rawArgs property + var fnExpr = this.fn.toString(); + var evalFn = this.fn._compile(math, argNames); + var _rawArgs3 = this.args; + return function evalFunctionNode(scope, args, context) { + var fn = evalFn(scope, args, context); + if (typeof fn !== 'function') { + throw new TypeError("Expression '".concat(fnExpr, "' did not evaluate to a function; value is:") + "\n ".concat(strin(fn))); + } + if (fn.rawArgs) { + // "Raw" evaluation + return fn(_rawArgs3, math, createSubScope(scope, args)); + } else { + // "regular" evaluation + var values = evalArgs.map(evalArg => evalArg(scope, args, context)); + return fn.apply(fn, values); + } + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.fn, 'fn', this); + for (var i = 0; i < this.args.length; i++) { + callback(this.args[i], 'args[' + i + ']', this); + } + } + + /** + * Create a new FunctionNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {FunctionNode} Returns a transformed copy of the node + */ + map(callback) { + var fn = this._ifNode(callback(this.fn, 'fn', this)); + var args = []; + for (var i = 0; i < this.args.length; i++) { + args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this)); + } + return new FunctionNode(fn, args); + } + + /** + * Create a clone of this node, a shallow copy + * @return {FunctionNode} + */ + clone() { + return new FunctionNode(this.fn, this.args.slice(0)); + } + + /** + * Throws an error 'Undefined function {name}' + * @param {string} name + */ + + /** + * Get string representation. (wrapper function) + * This overrides parts of Node's toString function. + * If callback is an object containing callbacks, it + * calls the correct callback for the current node, + * otherwise it falls back to calling Node's toString + * function. + * + * @param {Object} options + * @return {string} str + * @override + */ + toString(options) { + var customString; + var name = this.fn.toString(options); + if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) { + // callback is a map of callback functions + customString = options.handler[name](this, options); + } + if (typeof customString !== 'undefined') { + return customString; + } + + // fall back to Node's toString + return super.toString(options); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var args = this.args.map(function (arg) { + return arg.toString(options); + }); + var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options); + + // format the arguments like "add(2, 4.2)" + return fn + '(' + args.join(', ') + ')'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + fn: this.fn, + args: this.args + }; + } + + /** + * Instantiate an AssignmentNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "FunctionNode", fn: ..., args: ...}`, + * where mathjs is optional + * @returns {FunctionNode} + */ + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var args = this.args.map(function (arg) { + return arg.toHTML(options); + }); + + // format the arguments like "add(2, 4.2)" + return '' + escape(this.fn) + '(' + args.join(',') + ')'; + } + + /** + * Get LaTeX representation. (wrapper function) + * This overrides parts of Node's toTex function. + * If callback is an object containing callbacks, it + * calls the correct callback for the current node, + * otherwise it falls back to calling Node's toTex + * function. + * + * @param {Object} options + * @return {string} + */ + toTex(options) { + var customTex; + if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) { + // callback is a map of callback functions + customTex = options.handler[this.name](this, options); + } + if (typeof customTex !== 'undefined') { + return customTex; + } + + // fall back to Node's toTex + return super.toTex(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var args = this.args.map(function (arg) { + // get LaTeX of the arguments + return arg.toTex(options); + }); + var latexConverter; + if (latexFunctions[this.name]) { + latexConverter = latexFunctions[this.name]; + } + + // toTex property on the function itself + if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) { + // .toTex is a callback function + latexConverter = math[this.name].toTex; + } + var customToTex; + switch (typeof latexConverter) { + case 'function': + // a callback function + customToTex = latexConverter(this, options); + break; + case 'string': + // a template string + customToTex = expandTemplate(latexConverter, this, options); + break; + case 'object': + // an object with different "converters" for different + // numbers of arguments + switch (typeof latexConverter[args.length]) { + case 'function': + customToTex = latexConverter[args.length](this, options); + break; + case 'string': + customToTex = expandTemplate(latexConverter[args.length], this, options); + break; + } + } + if (typeof customToTex !== 'undefined') { + return customToTex; + } + return expandTemplate(defaultTemplate, this, options); + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type + ':' + this.name; + } + } + _FunctionNode = FunctionNode; + _defineProperty(FunctionNode, "name", name); + _defineProperty(FunctionNode, "onUndefinedFunction", function (name) { + throw new Error('Undefined function ' + name); + }); + _defineProperty(FunctionNode, "fromJSON", function (json) { + return new _FunctionNode(json.fn, json.args); + }); + return FunctionNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/IndexNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/IndexNode.js new file mode 100644 index 0000000..5c91a21 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/IndexNode.js @@ -0,0 +1,219 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { map } from '../../utils/array.js'; +import { getSafeProperty } from '../../utils/customs.js'; +import { factory } from '../../utils/factory.js'; +import { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js'; +import { escape } from '../../utils/string.js'; +var name = 'IndexNode'; +var dependencies = ['Node', 'size']; +export var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node, + size + } = _ref; + class IndexNode extends Node { + /** + * @constructor IndexNode + * @extends Node + * + * Describes a subset of a matrix or an object property. + * Cannot be used on its own, needs to be used within an AccessorNode or + * AssignmentNode. + * + * @param {Node[]} dimensions + * @param {boolean} [dotNotation=false] + * Optional property describing whether this index was written using dot + * notation like `a.b`, or using bracket notation like `a["b"]` + * (which is the default). This property is used for string conversion. + */ + constructor(dimensions, dotNotation) { + super(); + this.dimensions = dimensions; + this.dotNotation = dotNotation || false; + + // validate input + if (!Array.isArray(dimensions) || !dimensions.every(isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "dimensions"'); + } + if (this.dotNotation && !this.isObjectProperty()) { + throw new Error('dotNotation only applicable for object properties'); + } + } + get type() { + return name; + } + get isIndexNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // TODO: implement support for bignumber (currently bignumbers are silently + // reduced to numbers when changing the value to zero-based) + + // TODO: Optimization: when the range values are ConstantNodes, + // we can beforehand resolve the zero-based value + + // optimization for a simple object property + var evalDimensions = map(this.dimensions, function (dimension, i) { + var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0; + if (needsEnd) { + // SymbolNode 'end' is used inside the index, + // like in `A[end]` or `A[end - 2]` + var childArgNames = Object.create(argNames); + childArgNames.end = true; + var _evalDimension = dimension._compile(math, childArgNames); + return function evalDimension(scope, args, context) { + if (!isMatrix(context) && !isArray(context) && !isString(context)) { + throw new TypeError('Cannot resolve "end": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context)); + } + var s = size(context).valueOf(); + var childArgs = Object.create(args); + childArgs.end = s[i]; + return _evalDimension(scope, childArgs, context); + }; + } else { + // SymbolNode `end` not used + return dimension._compile(math, argNames); + } + }); + var index = getSafeProperty(math, 'index'); + return function evalIndexNode(scope, args, context) { + var dimensions = map(evalDimensions, function (evalDimension) { + return evalDimension(scope, args, context); + }); + return index(...dimensions); + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (var i = 0; i < this.dimensions.length; i++) { + callback(this.dimensions[i], 'dimensions[' + i + ']', this); + } + } + + /** + * Create a new IndexNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {IndexNode} Returns a transformed copy of the node + */ + map(callback) { + var dimensions = []; + for (var i = 0; i < this.dimensions.length; i++) { + dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this)); + } + return new IndexNode(dimensions, this.dotNotation); + } + + /** + * Create a clone of this node, a shallow copy + * @return {IndexNode} + */ + clone() { + return new IndexNode(this.dimensions.slice(0), this.dotNotation); + } + + /** + * Test whether this IndexNode contains a single property name + * @return {boolean} + */ + isObjectProperty() { + return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string'; + } + + /** + * Returns the property name if IndexNode contains a property. + * If not, returns null. + * @return {string | null} + */ + getObjectProperty() { + return this.isObjectProperty() ? this.dimensions[0].value : null; + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + // format the parameters like "[1, 0:5]" + return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + dimensions: this.dimensions, + dotNotation: this.dotNotation + }; + } + + /** + * Instantiate an IndexNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "IndexNode", dimensions: [...], dotNotation: false}`, + * where mathjs is optional + * @returns {IndexNode} + */ + static fromJSON(json) { + return new IndexNode(json.dimensions, json.dotNotation); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + // format the parameters like "[1, 0:5]" + var dimensions = []; + for (var i = 0; i < this.dimensions.length; i++) { + dimensions[i] = this.dimensions[i].toHTML(); + } + if (this.dotNotation) { + return '.' + '' + escape(this.getObjectProperty()) + ''; + } else { + return '[' + dimensions.join(',') + ']'; + } + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var dimensions = this.dimensions.map(function (range) { + return range.toTex(options); + }); + return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}'; + } + } + _defineProperty(IndexNode, "name", name); + return IndexNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/Node.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/Node.js new file mode 100644 index 0000000..17a7671 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/Node.js @@ -0,0 +1,372 @@ +import { isNode } from '../../utils/is.js'; +import { keywords } from '../keywords.js'; +import { deepStrictEqual } from '../../utils/object.js'; +import { factory } from '../../utils/factory.js'; +import { createMap } from '../../utils/map.js'; +var name = 'Node'; +var dependencies = ['mathWithTransform']; +export var createNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + mathWithTransform + } = _ref; + /** + * Validate the symbol names of a scope. + * Throws an error when the scope contains an illegal symbol. + * @param {Object} scope + */ + function _validateScope(scope) { + for (var symbol of [...keywords]) { + if (scope.has(symbol)) { + throw new Error('Scope contains an illegal symbol, "' + symbol + '" is a reserved keyword'); + } + } + } + class Node { + get type() { + return 'Node'; + } + get isNode() { + return true; + } + + /** + * Evaluate the node + * @param {Object} [scope] Scope to read/write variables + * @return {*} Returns the result + */ + evaluate(scope) { + return this.compile().evaluate(scope); + } + + /** + * Compile the node into an optimized, evauatable JavaScript function + * @return {{evaluate: function([Object])}} object + * Returns an object with a function 'evaluate', + * which can be invoked as expr.evaluate([scope: Object]), + * where scope is an optional object with + * variables. + */ + compile() { + var expr = this._compile(mathWithTransform, {}); + var args = {}; + var context = null; + function evaluate(scope) { + var s = createMap(scope); + _validateScope(s); + return expr(s, args, context); + } + return { + evaluate + }; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + throw new Error('Method _compile must be implemented by type ' + this.type); + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // must be implemented by each of the Node implementations + throw new Error('Cannot run forEach on a Node interface'); + } + + /** + * Create a new Node whose children are the results of calling the + * provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {OperatorNode} Returns a transformed copy of the node + */ + map(callback) { + // must be implemented by each of the Node implementations + throw new Error('Cannot run map on a Node interface'); + } + + /** + * Validate whether an object is a Node, for use with map + * @param {Node} node + * @returns {Node} Returns the input if it's a node, else throws an Error + * @protected + */ + _ifNode(node) { + if (!isNode(node)) { + throw new TypeError('Callback function must return a Node'); + } + return node; + } + + /** + * Recursively traverse all nodes in a node tree. Executes given callback for + * this node and each of its child nodes. + * @param {function(node: Node, path: string, parent: Node)} callback + * A callback called for every node in the node tree. + */ + traverse(callback) { + // execute callback for itself + // eslint-disable-next-line + callback(this, null, null); + + // recursively traverse over all children of a node + function _traverse(node, callback) { + node.forEach(function (child, path, parent) { + callback(child, path, parent); + _traverse(child, callback); + }); + } + _traverse(this, callback); + } + + /** + * Recursively transform a node tree via a transform function. + * + * For example, to replace all nodes of type SymbolNode having name 'x' with + * a ConstantNode with value 2: + * + * const res = Node.transform(function (node, path, parent) { + * if (node && node.isSymbolNode) && (node.name === 'x')) { + * return new ConstantNode(2) + * } + * else { + * return node + * } + * }) + * + * @param {function(node: Node, path: string, parent: Node) : Node} callback + * A mapping function accepting a node, and returning + * a replacement for the node or the original node. The "signature" + * of the callback must be: + * callback(node: Node, index: string, parent: Node) : Node + * @return {Node} Returns the original node or its replacement + */ + transform(callback) { + function _transform(child, path, parent) { + var replacement = callback(child, path, parent); + if (replacement !== child) { + // stop iterating when the node is replaced + return replacement; + } + return child.map(_transform); + } + return _transform(this, null, null); + } + + /** + * Find any node in the node tree matching given filter function. For + * example, to find all nodes of type SymbolNode having name 'x': + * + * const results = Node.filter(function (node) { + * return (node && node.isSymbolNode) && (node.name === 'x') + * }) + * + * @param {function(node: Node, path: string, parent: Node) : Node} callback + * A test function returning true when a node matches, and false + * otherwise. Function signature: + * callback(node: Node, index: string, parent: Node) : boolean + * @return {Node[]} nodes + * An array with nodes matching given filter criteria + */ + filter(callback) { + var nodes = []; + this.traverse(function (node, path, parent) { + if (callback(node, path, parent)) { + nodes.push(node); + } + }); + return nodes; + } + + /** + * Create a shallow clone of this node + * @return {Node} + */ + clone() { + // must be implemented by each of the Node implementations + throw new Error('Cannot clone a Node interface'); + } + + /** + * Create a deep clone of this node + * @return {Node} + */ + cloneDeep() { + return this.map(function (node) { + return node.cloneDeep(); + }); + } + + /** + * Deep compare this node with another node. + * @param {Node} other + * @return {boolean} Returns true when both nodes are of the same type and + * contain the same values (as do their childs) + */ + equals(other) { + return other ? this.type === other.type && deepStrictEqual(this, other) : false; + } + + /** + * Get string representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)"or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toString(options) { + var customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toString(options); + } + + /** + * Internal function to generate the string output. + * This has to be implemented by every Node + * + * @throws {Error} + */ + _toString() { + // must be implemented by each of the Node implementations + throw new Error('_toString not implemented for ' + this.type); + } + + /** + * Get a JSON representation of the node + * Both .toJSON() and the static .fromJSON(json) should be implemented by all + * implementations of Node + * @returns {Object} + */ + toJSON() { + throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type); + } + + /** + * Get HTML representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)" or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toHTML(options) { + var customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toHTML(options); + } + + /** + * Internal function to generate the HTML output. + * This has to be implemented by every Node + * + * @throws {Error} + */ + _toHTML() { + // must be implemented by each of the Node implementations + throw new Error('_toHTML not implemented for ' + this.type); + } + + /** + * Get LaTeX representation. (wrapper function) + * + * This function can get an object of the following form: + * { + * handler: //This can be a callback function of the form + * // "function callback(node, options)"or + * // a map that maps function names (used in FunctionNodes) + * // to callbacks + * parenthesis: "keep" //the parenthesis option (This is optional) + * } + * + * @param {Object} [options] + * @return {string} + */ + toTex(options) { + var customString = this._getCustomString(options); + if (typeof customString !== 'undefined') { + return customString; + } + return this._toTex(options); + } + + /** + * Internal function to generate the LaTeX output. + * This has to be implemented by every Node + * + * @param {Object} [options] + * @throws {Error} + */ + _toTex(options) { + // must be implemented by each of the Node implementations + throw new Error('_toTex not implemented for ' + this.type); + } + + /** + * Helper used by `to...` functions. + */ + _getCustomString(options) { + if (options && typeof options === 'object') { + switch (typeof options.handler) { + case 'object': + case 'undefined': + return; + case 'function': + return options.handler(this, options); + default: + throw new TypeError('Object or function expected as callback'); + } + } + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type; + } + + /** + * Get the content of the current Node. + * @return {Node} node + **/ + getContent() { + return this; + } + } + return Node; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js new file mode 100644 index 0000000..c5156ef --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js @@ -0,0 +1,193 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { getSafeProperty } from '../../utils/customs.js'; +import { factory } from '../../utils/factory.js'; +import { isNode } from '../../utils/is.js'; +import { hasOwnProperty } from '../../utils/object.js'; +import { escape, stringify } from '../../utils/string.js'; +var name = 'ObjectNode'; +var dependencies = ['Node']; +export var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + class ObjectNode extends Node { + /** + * @constructor ObjectNode + * @extends {Node} + * Holds an object with keys/values + * @param {Object.} [properties] object with key/value pairs + */ + constructor(properties) { + super(); + this.properties = properties || {}; + + // validate input + if (properties) { + if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) { + return isNode(properties[key]); + })) { + throw new TypeError('Object containing Nodes expected'); + } + } + } + get type() { + return name; + } + get isObjectNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var evalEntries = {}; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + // we stringify/parse the key here to resolve unicode characters, + // so you cannot create a key like {"co\\u006Estructor": null} + var stringifiedKey = stringify(key); + var parsedKey = JSON.parse(stringifiedKey); + var prop = getSafeProperty(this.properties, key); + evalEntries[parsedKey] = prop._compile(math, argNames); + } + } + return function evalObjectNode(scope, args, context) { + var obj = {}; + for (var _key in evalEntries) { + if (hasOwnProperty(evalEntries, _key)) { + obj[_key] = evalEntries[_key](scope, args, context); + } + } + return obj; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + callback(this.properties[key], 'properties[' + stringify(key) + ']', this); + } + } + } + + /** + * Create a new ObjectNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {ObjectNode} Returns a transformed copy of the node + */ + map(callback) { + var properties = {}; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this)); + } + } + return new ObjectNode(properties); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ObjectNode} + */ + clone() { + var properties = {}; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + properties[key] = this.properties[key]; + } + } + return new ObjectNode(properties); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + var entries = []; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + entries.push(stringify(key) + ': ' + this.properties[key].toString(options)); + } + } + return '{' + entries.join(', ') + '}'; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + properties: this.properties + }; + } + + /** + * Instantiate an OperatorNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ObjectNode", "properties": {...}}`, + * where mathjs is optional + * @returns {ObjectNode} + */ + static fromJSON(json) { + return new ObjectNode(json.properties); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + var entries = []; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + entries.push('' + escape(key) + '' + '' + ':' + this.properties[key].toHTML(options)); + } + } + return '{' + entries.join(',') + '}'; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var entries = []; + for (var key in this.properties) { + if (hasOwnProperty(this.properties, key)) { + entries.push('\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\'); + } + } + var tex = '\\left\\{\\begin{array}{ll}' + entries.join('\n') + '\\end{array}\\right\\}'; + return tex; + } + } + _defineProperty(ObjectNode, "name", name); + return ObjectNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js new file mode 100644 index 0000000..61a8339 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js @@ -0,0 +1,629 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js'; +import { map } from '../../utils/array.js'; +import { createSubScope } from '../../utils/scope.js'; +import { escape } from '../../utils/string.js'; +import { getSafeProperty, isSafeMethod } from '../../utils/customs.js'; +import { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js'; +import { latexOperators } from '../../utils/latex.js'; +import { factory } from '../../utils/factory.js'; +var name = 'OperatorNode'; +var dependencies = ['Node']; +export var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + /** + * Returns true if the expression starts with a constant, under + * the current parenthesization: + * @param {Node} expression + * @param {string} parenthesis + * @return {boolean} + */ + function startsWithConstant(expr, parenthesis) { + var curNode = expr; + if (parenthesis === 'auto') { + while (isParenthesisNode(curNode)) curNode = curNode.content; + } + if (isConstantNode(curNode)) return true; + if (isOperatorNode(curNode)) { + return startsWithConstant(curNode.args[0], parenthesis); + } + return false; + } + + /** + * Calculate which parentheses are necessary. Gets an OperatorNode + * (which is the root of the tree) and an Array of Nodes + * (this.args) and returns an array where 'true' means that an argument + * has to be enclosed in parentheses whereas 'false' means the opposite. + * + * @param {OperatorNode} root + * @param {string} parenthesis + * @param {Node[]} args + * @param {boolean} latex + * @return {boolean[]} + * @private + */ + function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) { + // precedence of the root OperatorNode + var precedence = getPrecedence(root, parenthesis, implicit); + var associativity = getAssociativity(root, parenthesis); + if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') { + return args.map(function (arg) { + switch (arg.getContent().type) { + // Nodes that don't need extra parentheses + case 'ArrayNode': + case 'ConstantNode': + case 'SymbolNode': + case 'ParenthesisNode': + return false; + default: + return true; + } + }); + } + var result; + switch (args.length) { + case 0: + result = []; + break; + case 1: + // unary operators + { + // precedence of the operand + var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root); + + // handle special cases for LaTeX, where some of the parentheses aren't needed + if (latex && operandPrecedence !== null) { + var operandIdentifier; + var rootIdentifier; + if (parenthesis === 'keep') { + operandIdentifier = args[0].getIdentifier(); + rootIdentifier = root.getIdentifier(); + } else { + // Ignore Parenthesis Nodes when not in 'keep' mode + operandIdentifier = args[0].getContent().getIdentifier(); + rootIdentifier = root.getContent().getIdentifier(); + } + if (properties[precedence][rootIdentifier].latexLeftParens === false) { + result = [false]; + break; + } + if (properties[operandPrecedence][operandIdentifier].latexParens === false) { + result = [false]; + break; + } + } + if (operandPrecedence === null) { + // if the operand has no defined precedence, no parens are needed + result = [false]; + break; + } + if (operandPrecedence <= precedence) { + // if the operands precedence is lower, parens are needed + result = [true]; + break; + } + + // otherwise, no parens needed + result = [false]; + } + break; + case 2: + // binary operators + { + var lhsParens; // left hand side needs parenthesis? + // precedence of the left hand side + var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root); + // is the root node associative with the left hand side + var assocWithLhs = isAssociativeWith(root, args[0], parenthesis); + if (lhsPrecedence === null) { + // if the left hand side has no defined precedence, no parens are needed + // FunctionNode for example + lhsParens = false; + } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) { + // In case of equal precedence, if the root node is left associative + // parens are **never** necessary for the left hand side. + // If it is right associative however, parens are necessary + // if the root node isn't associative with the left hand side + lhsParens = true; + } else if (lhsPrecedence < precedence) { + lhsParens = true; + } else { + lhsParens = false; + } + var rhsParens; // right hand side needs parenthesis? + // precedence of the right hand side + var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root); + // is the root node associative with the right hand side? + var assocWithRhs = isAssociativeWith(root, args[1], parenthesis); + if (rhsPrecedence === null) { + // if the right hand side has no defined precedence, no parens are needed + // FunctionNode for example + rhsParens = false; + } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) { + // In case of equal precedence, if the root node is right associative + // parens are **never** necessary for the right hand side. + // If it is left associative however, parens are necessary + // if the root node isn't associative with the right hand side + rhsParens = true; + } else if (rhsPrecedence < precedence) { + rhsParens = true; + } else { + rhsParens = false; + } + + // handle special cases for LaTeX, where some of the parentheses aren't needed + if (latex) { + var _rootIdentifier; + var lhsIdentifier; + var rhsIdentifier; + if (parenthesis === 'keep') { + _rootIdentifier = root.getIdentifier(); + lhsIdentifier = root.args[0].getIdentifier(); + rhsIdentifier = root.args[1].getIdentifier(); + } else { + // Ignore ParenthesisNodes when not in 'keep' mode + _rootIdentifier = root.getContent().getIdentifier(); + lhsIdentifier = root.args[0].getContent().getIdentifier(); + rhsIdentifier = root.args[1].getContent().getIdentifier(); + } + if (lhsPrecedence !== null) { + if (properties[precedence][_rootIdentifier].latexLeftParens === false) { + lhsParens = false; + } + if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) { + lhsParens = false; + } + } + if (rhsPrecedence !== null) { + if (properties[precedence][_rootIdentifier].latexRightParens === false) { + rhsParens = false; + } + if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) { + rhsParens = false; + } + } + } + result = [lhsParens, rhsParens]; + } + break; + default: + if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') { + result = args.map(function (arg) { + var argPrecedence = getPrecedence(arg, parenthesis, implicit, root); + var assocWithArg = isAssociativeWith(root, arg, parenthesis); + var argAssociativity = getAssociativity(arg, parenthesis); + if (argPrecedence === null) { + // if the argument has no defined precedence, no parens are needed + return false; + } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) { + return true; + } else if (argPrecedence < precedence) { + return true; + } + return false; + }); + } + break; + } + + // Handles an edge case of parentheses with implicit multiplication + // of ConstantNode. + // In that case, parenthesize ConstantNodes that follow an unparenthesized + // expression, even though they normally wouldn't be printed. + if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') { + for (var i = 1; i < result.length; ++i) { + if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) { + result[i] = true; + } + } + } + return result; + } + class OperatorNode extends Node { + /** + * @constructor OperatorNode + * @extends {Node} + * An operator with two arguments, like 2+3 + * + * @param {string} op Operator name, for example '+' + * @param {string} fn Function name, for example 'add' + * @param {Node[]} args Operator arguments + * @param {boolean} [implicit] Is this an implicit multiplication? + * @param {boolean} [isPercentage] Is this an percentage Operation? + */ + constructor(op, fn, args, implicit, isPercentage) { + super(); + // validate input + if (typeof op !== 'string') { + throw new TypeError('string expected for parameter "op"'); + } + if (typeof fn !== 'string') { + throw new TypeError('string expected for parameter "fn"'); + } + if (!Array.isArray(args) || !args.every(isNode)) { + throw new TypeError('Array containing Nodes expected for parameter "args"'); + } + this.implicit = implicit === true; + this.isPercentage = isPercentage === true; + this.op = op; + this.fn = fn; + this.args = args || []; + } + get type() { + return name; + } + get isOperatorNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + // validate fn + if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) { + if (!math[this.fn]) { + throw new Error('Function ' + this.fn + ' missing in provided namespace "math"'); + } else { + throw new Error('No access to function "' + this.fn + '"'); + } + } + var fn = getSafeProperty(math, this.fn); + var evalArgs = map(this.args, function (arg) { + return arg._compile(math, argNames); + }); + if (typeof fn === 'function' && fn.rawArgs === true) { + // pass unevaluated parameters (nodes) to the function + // "raw" evaluation + var rawArgs = this.args; + return function evalOperatorNode(scope, args, context) { + return fn(rawArgs, math, createSubScope(scope, args)); + }; + } else if (evalArgs.length === 1) { + var evalArg0 = evalArgs[0]; + return function evalOperatorNode(scope, args, context) { + return fn(evalArg0(scope, args, context)); + }; + } else if (evalArgs.length === 2) { + var _evalArg = evalArgs[0]; + var evalArg1 = evalArgs[1]; + return function evalOperatorNode(scope, args, context) { + return fn(_evalArg(scope, args, context), evalArg1(scope, args, context)); + }; + } else { + return function evalOperatorNode(scope, args, context) { + return fn.apply(null, map(evalArgs, function (evalArg) { + return evalArg(scope, args, context); + })); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + for (var i = 0; i < this.args.length; i++) { + callback(this.args[i], 'args[' + i + ']', this); + } + } + + /** + * Create a new OperatorNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {OperatorNode} Returns a transformed copy of the node + */ + map(callback) { + var args = []; + for (var i = 0; i < this.args.length; i++) { + args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this)); + } + return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage); + } + + /** + * Create a clone of this node, a shallow copy + * @return {OperatorNode} + */ + clone() { + return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage); + } + + /** + * Check whether this is an unary OperatorNode: + * has exactly one argument, like `-a`. + * @return {boolean} + * Returns true when an unary operator node, false otherwise. + */ + isUnary() { + return this.args.length === 1; + } + + /** + * Check whether this is a binary OperatorNode: + * has exactly two arguments, like `a + b`. + * @return {boolean} + * Returns true when a binary operator node, false otherwise. + */ + isBinary() { + return this.args.length === 2; + } + + /** + * Get string representation. + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var implicit = options && options.implicit ? options.implicit : 'hide'; + var args = this.args; + var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false); + if (args.length === 1) { + // unary operators + var assoc = getAssociativity(this, parenthesis); + var operand = args[0].toString(options); + if (parens[0]) { + operand = '(' + operand + ')'; + } + + // for example for "not", we want a space between operand and argument + var opIsNamed = /[a-zA-Z]+/.test(this.op); + if (assoc === 'right') { + // prefix operator + return this.op + (opIsNamed ? ' ' : '') + operand; + } else if (assoc === 'left') { + // postfix + return operand + (opIsNamed ? ' ' : '') + this.op; + } + + // fall back to postfix + return operand + this.op; + } else if (args.length === 2) { + var lhs = args[0].toString(options); // left hand side + var rhs = args[1].toString(options); // right hand side + if (parens[0]) { + // left hand side in parenthesis? + lhs = '(' + lhs + ')'; + } + if (parens[1]) { + // right hand side in parenthesis? + rhs = '(' + rhs + ')'; + } + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return lhs + ' ' + rhs; + } + return lhs + ' ' + this.op + ' ' + rhs; + } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + var stringifiedArgs = args.map(function (arg, index) { + arg = arg.toString(options); + if (parens[index]) { + // put in parenthesis? + arg = '(' + arg + ')'; + } + return arg; + }); + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return stringifiedArgs.join(' '); + } + return stringifiedArgs.join(' ' + this.op + ' '); + } else { + // fallback to formatting as a function call + return this.fn + '(' + this.args.join(', ') + ')'; + } + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + op: this.op, + fn: this.fn, + args: this.args, + implicit: this.implicit, + isPercentage: this.isPercentage + }; + } + + /** + * Instantiate an OperatorNode from its JSON representation + * @param {Object} json + * An object structured like + * ``` + * {"mathjs": "OperatorNode", + * "op": "+", "fn": "add", "args": [...], + * "implicit": false, + * "isPercentage":false} + * ``` + * where mathjs is optional + * @returns {OperatorNode} + */ + static fromJSON(json) { + return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage); + } + + /** + * Get HTML representation. + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var implicit = options && options.implicit ? options.implicit : 'hide'; + var args = this.args; + var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false); + if (args.length === 1) { + // unary operators + var assoc = getAssociativity(this, parenthesis); + var operand = args[0].toHTML(options); + if (parens[0]) { + operand = '(' + operand + ')'; + } + if (assoc === 'right') { + // prefix operator + return '' + escape(this.op) + '' + operand; + } else { + // postfix when assoc === 'left' or undefined + return operand + '' + escape(this.op) + ''; + } + } else if (args.length === 2) { + // binary operatoes + var lhs = args[0].toHTML(options); // left hand side + var rhs = args[1].toHTML(options); // right hand side + if (parens[0]) { + // left hand side in parenthesis? + lhs = '(' + lhs + ')'; + } + if (parens[1]) { + // right hand side in parenthesis? + rhs = '(' + rhs + ')'; + } + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return lhs + '' + rhs; + } + return lhs + '' + escape(this.op) + '' + rhs; + } else { + var stringifiedArgs = args.map(function (arg, index) { + arg = arg.toHTML(options); + if (parens[index]) { + // put in parenthesis? + arg = '(' + arg + ')'; + } + return arg; + }); + if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') { + return stringifiedArgs.join(''); + } + return stringifiedArgs.join('' + escape(this.op) + ''); + } else { + // fallback to formatting as a function call + return '' + escape(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')'; + } + } + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var implicit = options && options.implicit ? options.implicit : 'hide'; + var args = this.args; + var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true); + var op = latexOperators[this.fn]; + op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op + + if (args.length === 1) { + // unary operators + var assoc = getAssociativity(this, parenthesis); + var operand = args[0].toTex(options); + if (parens[0]) { + operand = "\\left(".concat(operand, "\\right)"); + } + if (assoc === 'right') { + // prefix operator + return op + operand; + } else if (assoc === 'left') { + // postfix operator + return operand + op; + } + + // fall back to postfix + return operand + op; + } else if (args.length === 2) { + // binary operators + var lhs = args[0]; // left hand side + var lhsTex = lhs.toTex(options); + if (parens[0]) { + lhsTex = "\\left(".concat(lhsTex, "\\right)"); + } + var rhs = args[1]; // right hand side + var rhsTex = rhs.toTex(options); + if (parens[1]) { + rhsTex = "\\left(".concat(rhsTex, "\\right)"); + } + + // handle some exceptions (due to the way LaTeX works) + var lhsIdentifier; + if (parenthesis === 'keep') { + lhsIdentifier = lhs.getIdentifier(); + } else { + // Ignore ParenthesisNodes if in 'keep' mode + lhsIdentifier = lhs.getContent().getIdentifier(); + } + switch (this.getIdentifier()) { + case 'OperatorNode:divide': + // op contains '\\frac' at this point + return op + '{' + lhsTex + '}' + '{' + rhsTex + '}'; + case 'OperatorNode:pow': + lhsTex = '{' + lhsTex + '}'; + rhsTex = '{' + rhsTex + '}'; + switch (lhsIdentifier) { + case 'ConditionalNode': // + case 'OperatorNode:divide': + lhsTex = "\\left(".concat(lhsTex, "\\right)"); + } + break; + case 'OperatorNode:multiply': + if (this.implicit && implicit === 'hide') { + return lhsTex + '~' + rhsTex; + } + } + return lhsTex + op + rhsTex; + } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) { + var texifiedArgs = args.map(function (arg, index) { + arg = arg.toTex(options); + if (parens[index]) { + arg = "\\left(".concat(arg, "\\right)"); + } + return arg; + }); + if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') { + return texifiedArgs.join('~'); + } + return texifiedArgs.join(op); + } else { + // fall back to formatting as a function call + // as this is a fallback, it doesn't use + // fancy function names + return '\\mathrm{' + this.fn + '}\\left(' + args.map(function (arg) { + return arg.toTex(options); + }).join(',') + '\\right)'; + } + } + + /** + * Get identifier. + * @return {string} + */ + getIdentifier() { + return this.type + ':' + this.fn; + } + } + _defineProperty(OperatorNode, "name", name); + return OperatorNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js new file mode 100644 index 0000000..630f44b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js @@ -0,0 +1,152 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isNode } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'ParenthesisNode'; +var dependencies = ['Node']; +export var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + class ParenthesisNode extends Node { + /** + * @constructor ParenthesisNode + * @extends {Node} + * A parenthesis node describes manual parenthesis from the user input + * @param {Node} content + * @extends {Node} + */ + constructor(content) { + super(); + // validate input + if (!isNode(content)) { + throw new TypeError('Node expected for parameter "content"'); + } + this.content = content; + } + get type() { + return name; + } + get isParenthesisNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + return this.content._compile(math, argNames); + } + + /** + * Get the content of the current Node. + * @return {Node} content + * @override + **/ + getContent() { + return this.content.getContent(); + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.content, 'content', this); + } + + /** + * Create a new ParenthesisNode whose child is the result of calling + * the provided callback function on the child of this node. + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {ParenthesisNode} Returns a clone of the node + */ + map(callback) { + var content = callback(this.content, 'content', this); + return new ParenthesisNode(content); + } + + /** + * Create a clone of this node, a shallow copy + * @return {ParenthesisNode} + */ + clone() { + return new ParenthesisNode(this.content); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return '(' + this.content.toString(options) + ')'; + } + return this.content.toString(options); + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + content: this.content + }; + } + + /** + * Instantiate an ParenthesisNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "ParenthesisNode", "content": ...}`, + * where mathjs is optional + * @returns {ParenthesisNode} + */ + static fromJSON(json) { + return new ParenthesisNode(json.content); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return '(' + this.content.toHTML(options) + ')'; + } + return this.content.toHTML(options); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + * @override + */ + _toTex(options) { + if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') { + return "\\left(".concat(this.content.toTex(options), "\\right)"); + } + return this.content.toTex(options); + } + } + _defineProperty(ParenthesisNode, "name", name); + return ParenthesisNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RangeNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RangeNode.js new file mode 100644 index 0000000..e30edf7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RangeNode.js @@ -0,0 +1,250 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { isNode, isSymbolNode } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { getPrecedence } from '../operators.js'; +var name = 'RangeNode'; +var dependencies = ['Node']; +export var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + /** + * Calculate the necessary parentheses + * @param {Node} node + * @param {string} parenthesis + * @param {string} implicit + * @return {Object} parentheses + * @private + */ + function calculateNecessaryParentheses(node, parenthesis, implicit) { + var precedence = getPrecedence(node, parenthesis, implicit); + var parens = {}; + var startPrecedence = getPrecedence(node.start, parenthesis, implicit); + parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all'; + if (node.step) { + var stepPrecedence = getPrecedence(node.step, parenthesis, implicit); + parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all'; + } + var endPrecedence = getPrecedence(node.end, parenthesis, implicit); + parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all'; + return parens; + } + class RangeNode extends Node { + /** + * @constructor RangeNode + * @extends {Node} + * create a range + * @param {Node} start included lower-bound + * @param {Node} end included upper-bound + * @param {Node} [step] optional step + */ + constructor(start, end, step) { + super(); + // validate inputs + if (!isNode(start)) throw new TypeError('Node expected'); + if (!isNode(end)) throw new TypeError('Node expected'); + if (step && !isNode(step)) throw new TypeError('Node expected'); + if (arguments.length > 3) throw new Error('Too many arguments'); + this.start = start; // included lower-bound + this.end = end; // included upper-bound + this.step = step || null; // optional step + } + get type() { + return name; + } + get isRangeNode() { + return true; + } + + /** + * Check whether the RangeNode needs the `end` symbol to be defined. + * This end is the size of the Matrix in current dimension. + * @return {boolean} + */ + needsEnd() { + // find all `end` symbols in this RangeNode + var endSymbols = this.filter(function (node) { + return isSymbolNode(node) && node.name === 'end'; + }); + return endSymbols.length > 0; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var range = math.range; + var evalStart = this.start._compile(math, argNames); + var evalEnd = this.end._compile(math, argNames); + if (this.step) { + var evalStep = this.step._compile(math, argNames); + return function evalRangeNode(scope, args, context) { + return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context)); + }; + } else { + return function evalRangeNode(scope, args, context) { + return range(evalStart(scope, args, context), evalEnd(scope, args, context)); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + callback(this.start, 'start', this); + callback(this.end, 'end', this); + if (this.step) { + callback(this.step, 'step', this); + } + } + + /** + * Create a new RangeNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {RangeNode} Returns a transformed copy of the node + */ + map(callback) { + return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this))); + } + + /** + * Create a clone of this node, a shallow copy + * @return {RangeNode} + */ + clone() { + return new RangeNode(this.start, this.end, this.step && this.step); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + + // format string as start:step:stop + var str; + var start = this.start.toString(options); + if (parens.start) { + start = '(' + start + ')'; + } + str = start; + if (this.step) { + var step = this.step.toString(options); + if (parens.step) { + step = '(' + step + ')'; + } + str += ':' + step; + } + var end = this.end.toString(options); + if (parens.end) { + end = '(' + end + ')'; + } + str += ':' + end; + return str; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + start: this.start, + end: this.end, + step: this.step + }; + } + + /** + * Instantiate an RangeNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "RangeNode", "start": ..., "end": ..., "step": ...}`, + * where mathjs is optional + * @returns {RangeNode} + */ + static fromJSON(json) { + return new RangeNode(json.start, json.end, json.step); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + + // format string as start:step:stop + var str; + var start = this.start.toHTML(options); + if (parens.start) { + start = '(' + start + ')'; + } + str = start; + if (this.step) { + var step = this.step.toHTML(options); + if (parens.step) { + step = '(' + step + ')'; + } + str += ':' + step; + } + var end = this.end.toHTML(options); + if (parens.end) { + end = '(' + end + ')'; + } + str += ':' + end; + return str; + } + + /** + * Get LaTeX representation + * @params {Object} options + * @return {string} str + */ + _toTex(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit); + var str = this.start.toTex(options); + if (parens.start) { + str = "\\left(".concat(str, "\\right)"); + } + if (this.step) { + var step = this.step.toTex(options); + if (parens.step) { + step = "\\left(".concat(step, "\\right)"); + } + str += ':' + step; + } + var end = this.end.toTex(options); + if (parens.end) { + end = "\\left(".concat(end, "\\right)"); + } + str += ':' + end; + return str; + } + } + _defineProperty(RangeNode, "name", name); + return RangeNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js new file mode 100644 index 0000000..dd654c7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js @@ -0,0 +1,198 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import { getPrecedence } from '../operators.js'; +import { escape } from '../../utils/string.js'; +import { getSafeProperty } from '../../utils/customs.js'; +import { latexOperators } from '../../utils/latex.js'; +import { factory } from '../../utils/factory.js'; +var name = 'RelationalNode'; +var dependencies = ['Node']; +export var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Node + } = _ref; + var operatorMap = { + equal: '==', + unequal: '!=', + smaller: '<', + larger: '>', + smallerEq: '<=', + largerEq: '>=' + }; + class RelationalNode extends Node { + /** + * A node representing a chained conditional expression, such as 'x > y > z' + * + * @param {String[]} conditionals + * An array of conditional operators used to compare the parameters + * @param {Node[]} params + * The parameters that will be compared + * + * @constructor RelationalNode + * @extends {Node} + */ + constructor(conditionals, params) { + super(); + if (!Array.isArray(conditionals)) { + throw new TypeError('Parameter conditionals must be an array'); + } + if (!Array.isArray(params)) { + throw new TypeError('Parameter params must be an array'); + } + if (conditionals.length !== params.length - 1) { + throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals'); + } + this.conditionals = conditionals; + this.params = params; + } + get type() { + return name; + } + get isRelationalNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var self = this; + var compiled = this.params.map(p => p._compile(math, argNames)); + return function evalRelationalNode(scope, args, context) { + var evalLhs; + var evalRhs = compiled[0](scope, args, context); + for (var i = 0; i < self.conditionals.length; i++) { + evalLhs = evalRhs; + evalRhs = compiled[i + 1](scope, args, context); + var condFn = getSafeProperty(math, self.conditionals[i]); + if (!condFn(evalLhs, evalRhs)) { + return false; + } + } + return true; + }; + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this); + } + + /** + * Create a new RelationalNode whose children are the results of calling + * the provided callback function for each child of the original node. + * @param {function(child: Node, path: string, parent: Node): Node} callback + * @returns {RelationalNode} Returns a transformed copy of the node + */ + map(callback) { + return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this)); + } + + /** + * Create a clone of this node, a shallow copy + * @return {RelationalNode} + */ + clone() { + return new RelationalNode(this.conditionals, this.params); + } + + /** + * Get string representation. + * @param {Object} options + * @return {string} str + */ + _toString(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var precedence = getPrecedence(this, parenthesis, options && options.implicit); + var paramStrings = this.params.map(function (p, index) { + var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options); + }); + var ret = paramStrings[0]; + for (var i = 0; i < this.conditionals.length; i++) { + ret += ' ' + operatorMap[this.conditionals[i]]; + ret += ' ' + paramStrings[i + 1]; + } + return ret; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: name, + conditionals: this.conditionals, + params: this.params + }; + } + + /** + * Instantiate a RelationalNode from its JSON representation + * @param {Object} json + * An object structured like + * `{"mathjs": "RelationalNode", "conditionals": ..., "params": ...}`, + * where mathjs is optional + * @returns {RelationalNode} + */ + static fromJSON(json) { + return new RelationalNode(json.conditionals, json.params); + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + */ + _toHTML(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var precedence = getPrecedence(this, parenthesis, options && options.implicit); + var paramStrings = this.params.map(function (p, index) { + var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options); + }); + var ret = paramStrings[0]; + for (var i = 0; i < this.conditionals.length; i++) { + ret += '' + escape(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1]; + } + return ret; + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + */ + _toTex(options) { + var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep'; + var precedence = getPrecedence(this, parenthesis, options && options.implicit); + var paramStrings = this.params.map(function (p, index) { + var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit); + return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\left(' + p.toTex(options) + '\right)' : p.toTex(options); + }); + var ret = paramStrings[0]; + for (var i = 0; i < this.conditionals.length; i++) { + ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1]; + } + return ret; + } + } + _defineProperty(RelationalNode, "name", name); + return RelationalNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js new file mode 100644 index 0000000..1f46062 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js @@ -0,0 +1,193 @@ +import { escape } from '../../utils/string.js'; +import { getSafeProperty } from '../../utils/customs.js'; +import { factory } from '../../utils/factory.js'; +import { toSymbol } from '../../utils/latex.js'; +var name = 'SymbolNode'; +var dependencies = ['math', '?Unit', 'Node']; +export var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + math, + Unit, + Node + } = _ref; + /** + * Check whether some name is a valueless unit like "inch". + * @param {string} name + * @return {boolean} + */ + function isValuelessUnit(name) { + return Unit ? Unit.isValuelessUnit(name) : false; + } + class SymbolNode extends Node { + /** + * @constructor SymbolNode + * @extends {Node} + * A symbol node can hold and resolve a symbol + * @param {string} name + * @extends {Node} + */ + constructor(name) { + super(); + // validate input + if (typeof name !== 'string') { + throw new TypeError('String expected for parameter "name"'); + } + this.name = name; + } + get type() { + return 'SymbolNode'; + } + get isSymbolNode() { + return true; + } + + /** + * Compile a node into a JavaScript function. + * This basically pre-calculates as much as possible and only leaves open + * calculations which depend on a dynamic scope with variables. + * @param {Object} math Math.js namespace with functions and constants. + * @param {Object} argNames An object with argument names as key and `true` + * as value. Used in the SymbolNode to optimize + * for arguments from user assigned functions + * (see FunctionAssignmentNode) or special symbols + * like `end` (see IndexNode). + * @return {function} Returns a function which can be called like: + * evalNode(scope: Object, args: Object, context: *) + */ + _compile(math, argNames) { + var name = this.name; + if (argNames[name] === true) { + // this is a FunctionAssignment argument + // (like an x when inside the expression of a function + // assignment `f(x) = ...`) + return function (scope, args, context) { + return getSafeProperty(args, name); + }; + } else if (name in math) { + return function (scope, args, context) { + return scope.has(name) ? scope.get(name) : getSafeProperty(math, name); + }; + } else { + var isUnit = isValuelessUnit(name); + return function (scope, args, context) { + return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name); + }; + } + } + + /** + * Execute a callback for each of the child nodes of this node + * @param {function(child: Node, path: string, parent: Node)} callback + */ + forEach(callback) { + // nothing to do, we don't have any children + } + + /** + * Create a new SymbolNode with children produced by the given callback. + * Trivial since a SymbolNode has no children + * @param {function(child: Node, path: string, parent: Node) : Node} callback + * @returns {SymbolNode} Returns a clone of the node + */ + map(callback) { + return this.clone(); + } + + /** + * Throws an error 'Undefined symbol {name}' + * @param {string} name + */ + static onUndefinedSymbol(name) { + throw new Error('Undefined symbol ' + name); + } + + /** + * Create a clone of this node, a shallow copy + * @return {SymbolNode} + */ + clone() { + return new SymbolNode(this.name); + } + + /** + * Get string representation + * @param {Object} options + * @return {string} str + * @override + */ + _toString(options) { + return this.name; + } + + /** + * Get HTML representation + * @param {Object} options + * @return {string} str + * @override + */ + _toHTML(options) { + var name = escape(this.name); + if (name === 'true' || name === 'false') { + return '' + name + ''; + } else if (name === 'i') { + return '' + name + ''; + } else if (name === 'Infinity') { + return '' + name + ''; + } else if (name === 'NaN') { + return '' + name + ''; + } else if (name === 'null') { + return '' + name + ''; + } else if (name === 'undefined') { + return '' + name + ''; + } + return '' + name + ''; + } + + /** + * Get a JSON representation of the node + * @returns {Object} + */ + toJSON() { + return { + mathjs: 'SymbolNode', + name: this.name + }; + } + + /** + * Instantiate a SymbolNode from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "SymbolNode", name: "x"}`, + * where mathjs is optional + * @returns {SymbolNode} + */ + static fromJSON(json) { + return new SymbolNode(json.name); + } + + /** + * Get LaTeX representation + * @param {Object} options + * @return {string} str + * @override + */ + _toTex(options) { + var isUnit = false; + if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) { + isUnit = true; + } + var symbol = toSymbol(this.name, isUnit); + if (symbol[0] === '\\') { + // no space needed if the symbol starts with '\' + return symbol; + } + // the space prevents symbols from breaking stuff like '\cdot' + // if it's written right before the symbol + return ' ' + symbol; + } + } + return SymbolNode; +}, { + isClass: true, + isNode: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/access.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/access.js new file mode 100644 index 0000000..4da61c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/access.js @@ -0,0 +1,40 @@ +import { errorTransform } from '../../transform/utils/errorTransform.js'; +import { getSafeProperty } from '../../../utils/customs.js'; +export function accessFactory(_ref) { + var { + subset + } = _ref; + /** + * Retrieve part of an object: + * + * - Retrieve a property from an object + * - Retrieve a part of a string + * - Retrieve a matrix subset + * + * @param {Object | Array | Matrix | string} object + * @param {Index} index + * @return {Object | Array | Matrix | string} Returns the subset + */ + return function access(object, index) { + try { + if (Array.isArray(object)) { + return subset(object, index); + } else if (object && typeof object.subset === 'function') { + // Matrix + return object.subset(index); + } else if (typeof object === 'string') { + // TODO: move getStringSubset into a separate util file, use that + return subset(object, index); + } else if (typeof object === 'object') { + if (!index.isObjectProperty()) { + throw new TypeError('Cannot apply a numeric index as object property'); + } + return getSafeProperty(object, index.getObjectProperty()); + } else { + throw new TypeError('Cannot apply index: unsupported type of object'); + } + } catch (err) { + throw errorTransform(err); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/assign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/assign.js new file mode 100644 index 0000000..84fd91c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/node/utils/assign.js @@ -0,0 +1,51 @@ +import { errorTransform } from '../../transform/utils/errorTransform.js'; +import { setSafeProperty } from '../../../utils/customs.js'; +export function assignFactory(_ref) { + var { + subset, + matrix + } = _ref; + /** + * Replace part of an object: + * + * - Assign a property to an object + * - Replace a part of a string + * - Replace a matrix subset + * + * @param {Object | Array | Matrix | string} object + * @param {Index} index + * @param {*} value + * @return {Object | Array | Matrix | string} Returns the original object + * except in case of a string + */ + // TODO: change assign to return the value instead of the object + return function assign(object, index, value) { + try { + if (Array.isArray(object)) { + var result = matrix(object).subset(index, value).valueOf(); + + // shallow copy all (updated) items into the original array + result.forEach((item, index) => { + object[index] = item; + }); + return object; + } else if (object && typeof object.subset === 'function') { + // Matrix + return object.subset(index, value); + } else if (typeof object === 'string') { + // TODO: move setStringSubset into a separate util file, use that + return subset(object, index, value); + } else if (typeof object === 'object') { + if (!index.isObjectProperty()) { + throw TypeError('Cannot apply a numeric index as object property'); + } + setSafeProperty(object, index.getObjectProperty(), value); + return object; + } else { + throw new TypeError('Cannot apply index: unsupported type of object'); + } + } catch (err) { + throw errorTransform(err); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/operators.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/operators.js new file mode 100644 index 0000000..91ea92d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/operators.js @@ -0,0 +1,377 @@ +// list of identifiers of nodes in order of their precedence +// also contains information about left/right associativity +// and which other operator the operator is associative with +// Example: +// addition is associative with addition and subtraction, because: +// (a+b)+c=a+(b+c) +// (a+b)-c=a+(b-c) +// +// postfix operators are left associative, prefix operators +// are right associative +// +// It's also possible to set the following properties: +// latexParens: if set to false, this node doesn't need to be enclosed +// in parentheses when using LaTeX +// latexLeftParens: if set to false, this !OperatorNode's! +// left argument doesn't need to be enclosed +// in parentheses +// latexRightParens: the same for the right argument +import { hasOwnProperty } from '../utils/object.js'; +import { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js'; +export var properties = [{ + // assignment + AssignmentNode: {}, + FunctionAssignmentNode: {} +}, { + // conditional expression + ConditionalNode: { + latexLeftParens: false, + latexRightParens: false, + latexParens: false + // conditionals don't need parentheses in LaTeX because + // they are 2 dimensional + } +}, { + // logical or + 'OperatorNode:or': { + op: 'or', + associativity: 'left', + associativeWith: [] + } +}, { + // logical xor + 'OperatorNode:xor': { + op: 'xor', + associativity: 'left', + associativeWith: [] + } +}, { + // logical and + 'OperatorNode:and': { + op: 'and', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise or + 'OperatorNode:bitOr': { + op: '|', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise xor + 'OperatorNode:bitXor': { + op: '^|', + associativity: 'left', + associativeWith: [] + } +}, { + // bitwise and + 'OperatorNode:bitAnd': { + op: '&', + associativity: 'left', + associativeWith: [] + } +}, { + // relational operators + 'OperatorNode:equal': { + op: '==', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:unequal': { + op: '!=', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:smaller': { + op: '<', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:larger': { + op: '>', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:smallerEq': { + op: '<=', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:largerEq': { + op: '>=', + associativity: 'left', + associativeWith: [] + }, + RelationalNode: { + associativity: 'left', + associativeWith: [] + } +}, { + // bitshift operators + 'OperatorNode:leftShift': { + op: '<<', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:rightArithShift': { + op: '>>', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:rightLogShift': { + op: '>>>', + associativity: 'left', + associativeWith: [] + } +}, { + // unit conversion + 'OperatorNode:to': { + op: 'to', + associativity: 'left', + associativeWith: [] + } +}, { + // range + RangeNode: {} +}, { + // addition, subtraction + 'OperatorNode:add': { + op: '+', + associativity: 'left', + associativeWith: ['OperatorNode:add', 'OperatorNode:subtract'] + }, + 'OperatorNode:subtract': { + op: '-', + associativity: 'left', + associativeWith: [] + } +}, { + // multiply, divide, modulus + 'OperatorNode:multiply': { + op: '*', + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide'] + }, + 'OperatorNode:divide': { + op: '/', + associativity: 'left', + associativeWith: [], + latexLeftParens: false, + latexRightParens: false, + latexParens: false + // fractions don't require parentheses because + // they're 2 dimensional, so parens aren't needed + // in LaTeX + }, + 'OperatorNode:dotMultiply': { + op: '.*', + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide'] + }, + 'OperatorNode:dotDivide': { + op: './', + associativity: 'left', + associativeWith: [] + }, + 'OperatorNode:mod': { + op: 'mod', + associativity: 'left', + associativeWith: [] + } +}, { + // Repeat multiplication for implicit multiplication + 'OperatorNode:multiply': { + associativity: 'left', + associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide'] + } +}, { + // unary prefix operators + 'OperatorNode:unaryPlus': { + op: '+', + associativity: 'right' + }, + 'OperatorNode:unaryMinus': { + op: '-', + associativity: 'right' + }, + 'OperatorNode:bitNot': { + op: '~', + associativity: 'right' + }, + 'OperatorNode:not': { + op: 'not', + associativity: 'right' + } +}, { + // exponentiation + 'OperatorNode:pow': { + op: '^', + associativity: 'right', + associativeWith: [], + latexRightParens: false + // the exponent doesn't need parentheses in + // LaTeX because it's 2 dimensional + // (it's on top) + }, + 'OperatorNode:dotPow': { + op: '.^', + associativity: 'right', + associativeWith: [] + } +}, { + // factorial + 'OperatorNode:factorial': { + op: '!', + associativity: 'left' + } +}, { + // matrix transpose + 'OperatorNode:ctranspose': { + op: "'", + associativity: 'left' + } +}]; + +/** + * Returns the first non-parenthesis internal node, but only + * when the 'parenthesis' option is unset or auto. + * @param {Node} _node + * @param {string} parenthesis + * @return {Node} + */ +function unwrapParen(_node, parenthesis) { + if (!parenthesis || parenthesis !== 'auto') return _node; + var node = _node; + while (isParenthesisNode(node)) node = node.content; + return node; +} + +/** + * Get the precedence of a Node. + * Higher number for higher precedence, starting with 0. + * Returns null if the precedence is undefined. + * + * @param {Node} _node + * @param {string} parenthesis + * @param {string} implicit + * @param {Node} parent (for determining context for implicit multiplication) + * @return {number | null} + */ +export function getPrecedence(_node, parenthesis, implicit, parent) { + var node = _node; + if (parenthesis !== 'keep') { + // ParenthesisNodes are only ignored when not in 'keep' mode + node = _node.getContent(); + } + var identifier = node.getIdentifier(); + var precedence = null; + for (var i = 0; i < properties.length; i++) { + if (identifier in properties[i]) { + precedence = i; + break; + } + } + // Bump up precedence of implicit multiplication, except when preceded + // by a "Rule 2" fraction ( [unaryOp]constant / constant ) + if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') { + var leftArg = unwrapParen(node.args[0], parenthesis); + if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) { + precedence += 1; + } + } + return precedence; +} + +/** + * Get the associativity of an operator (left or right). + * Returns a string containing 'left' or 'right' or null if + * the associativity is not defined. + * + * @param {Node} _node + * @param {string} parenthesis + * @return {string|null} + * @throws {Error} + */ +export function getAssociativity(_node, parenthesis) { + var node = _node; + if (parenthesis !== 'keep') { + // ParenthesisNodes are only ignored when not in 'keep' mode + node = _node.getContent(); + } + var identifier = node.getIdentifier(); + var index = getPrecedence(node, parenthesis); + if (index === null) { + // node isn't in the list + return null; + } + var property = properties[index][identifier]; + if (hasOwnProperty(property, 'associativity')) { + if (property.associativity === 'left') { + return 'left'; + } + if (property.associativity === 'right') { + return 'right'; + } + // associativity is invalid + throw Error('\'' + identifier + '\' has the invalid associativity \'' + property.associativity + '\'.'); + } + + // associativity is undefined + return null; +} + +/** + * Check if an operator is associative with another operator. + * Returns either true or false or null if not defined. + * + * @param {Node} nodeA + * @param {Node} nodeB + * @param {string} parenthesis + * @return {boolean | null} + */ +export function isAssociativeWith(nodeA, nodeB, parenthesis) { + // ParenthesisNodes are only ignored when not in 'keep' mode + var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA; + var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB; + var identifierA = a.getIdentifier(); + var identifierB = b.getIdentifier(); + var index = getPrecedence(a, parenthesis); + if (index === null) { + // node isn't in the list + return null; + } + var property = properties[index][identifierA]; + if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) { + for (var i = 0; i < property.associativeWith.length; i++) { + if (property.associativeWith[i] === identifierB) { + return true; + } + } + return false; + } + + // associativeWith is not defined + return null; +} + +/** + * Get the operator associated with a function name. + * Returns a string with the operator symbol, or null if the + * input is not the name of a function associated with an + * operator. + * + * @param {string} Function name + * @return {string | null} Associated operator symbol, if any + */ +export function getOperator(fn) { + var identifier = 'OperatorNode:' + fn; + for (var group of properties) { + if (identifier in group) { + return group[identifier].op; + } + } + return null; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/parse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/parse.js new file mode 100644 index 0000000..9feff95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/parse.js @@ -0,0 +1,1634 @@ +import _extends from "@babel/runtime/helpers/extends"; +import { factory } from '../utils/factory.js'; +import { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js'; +import { deepMap } from '../utils/collection.js'; +import { safeNumberType } from '../utils/number.js'; +import { hasOwnProperty } from '../utils/object.js'; +var name = 'parse'; +var dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode']; +export var createParse = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + numeric, + config, + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode + } = _ref; + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(). + * + * Note the evaluating arbitrary expressions may involve security risks, + * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. + * + * Syntax: + * + * math.parse(expr) + * math.parse(expr, options) + * math.parse([expr1, expr2, expr3, ...]) + * math.parse([expr1, expr2, expr3, ...], options) + * + * Example: + * + * const node1 = math.parse('sqrt(3^2 + 4^2)') + * node1.compile().evaluate() // 5 + * + * let scope = {a:3, b:4} + * const node2 = math.parse('a * b') // 12 + * const code2 = node2.compile() + * code2.evaluate(scope) // 12 + * scope.a = 5 + * code2.evaluate(scope) // 20 + * + * const nodes = math.parse(['a = 3', 'b = 4', 'a * b']) + * nodes[2].compile().evaluate() // 12 + * + * See also: + * + * evaluate, compile + * + * @param {string | string[] | Matrix} expr Expression to be parsed + * @param {{nodes: Object}} [options] Available options: + * - `nodes` a set of custom nodes + * @return {Node | Node[]} node + * @throws {Error} + */ + var parse = typed(name, { + string: function string(expression) { + return parseStart(expression, {}); + }, + 'Array | Matrix': function Array__Matrix(expressions) { + return parseMultiple(expressions, {}); + }, + 'string, Object': function string_Object(expression, options) { + var extraNodes = options.nodes !== undefined ? options.nodes : {}; + return parseStart(expression, extraNodes); + }, + 'Array | Matrix, Object': parseMultiple + }); + function parseMultiple(expressions) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var extraNodes = options.nodes !== undefined ? options.nodes : {}; + + // parse an array or matrix with expressions + return deepMap(expressions, function (elem) { + if (typeof elem !== 'string') throw new TypeError('String expected'); + return parseStart(elem, extraNodes); + }); + } + + // token types enumeration + var TOKENTYPE = { + NULL: 0, + DELIMITER: 1, + NUMBER: 2, + SYMBOL: 3, + UNKNOWN: 4 + }; + + // map with all delimiters + var DELIMITERS = { + ',': true, + '(': true, + ')': true, + '[': true, + ']': true, + '{': true, + '}': true, + '"': true, + '\'': true, + ';': true, + '+': true, + '-': true, + '*': true, + '.*': true, + '/': true, + './': true, + '%': true, + '^': true, + '.^': true, + '~': true, + '!': true, + '&': true, + '|': true, + '^|': true, + '=': true, + ':': true, + '?': true, + '==': true, + '!=': true, + '<': true, + '>': true, + '<=': true, + '>=': true, + '<<': true, + '>>': true, + '>>>': true + }; + + // map with all named delimiters + var NAMED_DELIMITERS = { + mod: true, + to: true, + in: true, + and: true, + xor: true, + or: true, + not: true + }; + var CONSTANTS = { + true: true, + false: false, + null: null, + undefined + }; + var NUMERIC_CONSTANTS = ['NaN', 'Infinity']; + var ESCAPE_CHARACTERS = { + '"': '"', + "'": "'", + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + // note that \u is handled separately in parseStringToken() + }; + function initialState() { + return { + extraNodes: {}, + // current extra nodes, must be careful not to mutate + expression: '', + // current expression + comment: '', + // last parsed comment + index: 0, + // current index in expr + token: '', + // current token + tokenType: TOKENTYPE.NULL, + // type of the token + nestingLevel: 0, + // level of nesting inside parameters, used to ignore newline characters + conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here + }; + } + + /** + * View upto `length` characters of the expression starting at the current character. + * + * @param {Object} state + * @param {number} [length=1] Number of characters to view + * @returns {string} + * @private + */ + function currentString(state, length) { + return state.expression.substr(state.index, length); + } + + /** + * View the current character. Returns '' if end of expression is reached. + * + * @param {Object} state + * @returns {string} + * @private + */ + function currentCharacter(state) { + return currentString(state, 1); + } + + /** + * Get the next character from the expression. + * The character is stored into the char c. If the end of the expression is + * reached, the function puts an empty string in c. + * @private + */ + function next(state) { + state.index++; + } + + /** + * Preview the previous character from the expression. + * @return {string} cNext + * @private + */ + function prevCharacter(state) { + return state.expression.charAt(state.index - 1); + } + + /** + * Preview the next character from the expression. + * @return {string} cNext + * @private + */ + function nextCharacter(state) { + return state.expression.charAt(state.index + 1); + } + + /** + * Get next token in the current string expr. + * The token and token type are available as token and tokenType + * @private + */ + function getToken(state) { + state.tokenType = TOKENTYPE.NULL; + state.token = ''; + state.comment = ''; + + // skip over ignored characters: + while (true) { + // comments: + if (currentCharacter(state) === '#') { + while (currentCharacter(state) !== '\n' && currentCharacter(state) !== '') { + state.comment += currentCharacter(state); + next(state); + } + } + // whitespace: space, tab, and newline when inside parameters + if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) { + next(state); + } else { + break; + } + } + + // check for end of expression + if (currentCharacter(state) === '') { + // token is still empty + state.tokenType = TOKENTYPE.DELIMITER; + return; + } + + // check for new line character + if (currentCharacter(state) === '\n' && !state.nestingLevel) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = currentCharacter(state); + next(state); + return; + } + var c1 = currentCharacter(state); + var c2 = currentString(state, 2); + var c3 = currentString(state, 3); + if (c3.length === 3 && DELIMITERS[c3]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c3; + next(state); + next(state); + next(state); + return; + } + + // check for delimiters consisting of 2 characters + if (c2.length === 2 && DELIMITERS[c2]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c2; + next(state); + next(state); + return; + } + + // check for delimiters consisting of 1 character + if (DELIMITERS[c1]) { + state.tokenType = TOKENTYPE.DELIMITER; + state.token = c1; + next(state); + return; + } + + // check for a number + if (parse.isDigitDot(c1)) { + state.tokenType = TOKENTYPE.NUMBER; + + // check for binary, octal, or hex + var _c = currentString(state, 2); + if (_c === '0b' || _c === '0o' || _c === '0x') { + state.token += currentCharacter(state); + next(state); + state.token += currentCharacter(state); + next(state); + while (parse.isHexDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (currentCharacter(state) === '.') { + // this number has a radix point + state.token += '.'; + next(state); + // get the digits after the radix + while (parse.isHexDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } else if (currentCharacter(state) === 'i') { + // this number has a word size suffix + state.token += 'i'; + next(state); + // get the word size + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } + return; + } + + // get number, can have a single dot + if (currentCharacter(state) === '.') { + state.token += currentCharacter(state); + next(state); + if (!parse.isDigit(currentCharacter(state))) { + // this is no number, it is just a dot (can be dot notation) + state.tokenType = TOKENTYPE.DELIMITER; + return; + } + } else { + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + } + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + // check for exponential notation like "2.3e-4", "1.23e50" or "2e+4" + if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') { + if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') { + state.token += currentCharacter(state); + next(state); + if (currentCharacter(state) === '+' || currentCharacter(state) === '-') { + state.token += currentCharacter(state); + next(state); + } + // Scientific notation MUST be followed by an exponent + if (!parse.isDigit(currentCharacter(state))) { + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + while (parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) { + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + } else if (nextCharacter(state) === '.') { + next(state); + throw createSyntaxError(state, 'Digit expected, got "' + currentCharacter(state) + '"'); + } + } + return; + } + + // check for variables, functions, named operators + if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) { + while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) { + state.token += currentCharacter(state); + next(state); + } + if (hasOwnProperty(NAMED_DELIMITERS, state.token)) { + state.tokenType = TOKENTYPE.DELIMITER; + } else { + state.tokenType = TOKENTYPE.SYMBOL; + } + return; + } + + // something unknown is found, wrong characters -> a syntax error + state.tokenType = TOKENTYPE.UNKNOWN; + while (currentCharacter(state) !== '') { + state.token += currentCharacter(state); + next(state); + } + throw createSyntaxError(state, 'Syntax error in part "' + state.token + '"'); + } + + /** + * Get next token and skip newline tokens + */ + function getTokenSkipNewline(state) { + do { + getToken(state); + } while (state.token === '\n'); // eslint-disable-line no-unmodified-loop-condition + } + + /** + * Open parameters. + * New line characters will be ignored until closeParams(state) is called + */ + function openParams(state) { + state.nestingLevel++; + } + + /** + * Close parameters. + * New line characters will no longer be ignored + */ + function closeParams(state) { + state.nestingLevel--; + } + + /** + * Checks whether the current character `c` is a valid alpha character: + * + * - A latin letter (upper or lower case) Ascii: a-z, A-Z + * - An underscore Ascii: _ + * - A dollar sign Ascii: $ + * - A latin letter with accents Unicode: \u00C0 - \u02AF + * - A greek letter Unicode: \u0370 - \u03FF + * - A mathematical alphanumeric symbol Unicode: \u{1D400} - \u{1D7FF} excluding invalid code points + * + * The previous and next characters are needed to determine whether + * this character is part of a unicode surrogate pair. + * + * @param {string} c Current character in the expression + * @param {string} cPrev Previous character + * @param {string} cNext Next character + * @return {boolean} + */ + parse.isAlpha = function isAlpha(c, cPrev, cNext) { + return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c); + }; + + /** + * Test whether a character is a valid latin, greek, or letter-like character + * @param {string} c + * @return {boolean} + */ + parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) { + return /^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(c); + }; + + /** + * Test whether two given 16 bit characters form a surrogate pair of a + * unicode math symbol. + * + * https://unicode-table.com/en/ + * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode + * + * Note: In ES6 will be unicode aware: + * https://stackoverflow.com/questions/280712/javascript-unicode-regexes + * https://mathiasbynens.be/notes/es6-unicode-regex + * + * @param {string} high + * @param {string} low + * @return {boolean} + */ + parse.isValidMathSymbol = function isValidMathSymbol(high, low) { + return /^[\uD835]$/.test(high) && /^[\uDC00-\uDFFF]$/.test(low) && /^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(low); + }; + + /** + * Check whether given character c is a white space character: space, tab, or enter + * @param {string} c + * @param {number} nestingLevel + * @return {boolean} + */ + parse.isWhitespace = function isWhitespace(c, nestingLevel) { + // TODO: also take '\r' carriage return as newline? Or does that give problems on mac? + return c === ' ' || c === '\t' || c === '\n' && nestingLevel > 0; + }; + + /** + * Test whether the character c is a decimal mark (dot). + * This is the case when it's not the start of a delimiter '.*', './', or '.^' + * @param {string} c + * @param {string} cNext + * @return {boolean} + */ + parse.isDecimalMark = function isDecimalMark(c, cNext) { + return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^'; + }; + + /** + * checks if the given char c is a digit or dot + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isDigitDot = function isDigitDot(c) { + return c >= '0' && c <= '9' || c === '.'; + }; + + /** + * checks if the given char c is a digit + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isDigit = function isDigit(c) { + return c >= '0' && c <= '9'; + }; + + /** + * checks if the given char c is a hex digit + * @param {string} c a string with one character + * @return {boolean} + */ + parse.isHexDigit = function isHexDigit(c) { + return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F'; + }; + + /** + * Start of the parse levels below, in order of precedence + * @return {Node} node + * @private + */ + function parseStart(expression, extraNodes) { + var state = initialState(); + _extends(state, { + expression, + extraNodes + }); + getToken(state); + var node = parseBlock(state); + + // check for garbage at the end of the expression + // an expression ends with a empty character '' and tokenType DELIMITER + if (state.token !== '') { + if (state.tokenType === TOKENTYPE.DELIMITER) { + // user entered a not existing operator like "//" + + // TODO: give hints for aliases, for example with "<>" give as hint " did you mean !== ?" + throw createError(state, 'Unexpected operator ' + state.token); + } else { + throw createSyntaxError(state, 'Unexpected part "' + state.token + '"'); + } + } + return node; + } + + /** + * Parse a block with expressions. Expressions can be separated by a newline + * character '\n', or by a semicolon ';'. In case of a semicolon, no output + * of the preceding line is returned. + * @return {Node} node + * @private + */ + function parseBlock(state) { + var node; + var blocks = []; + var visible; + if (state.token !== '' && state.token !== '\n' && state.token !== ';') { + node = parseAssignment(state); + if (state.comment) { + node.comment = state.comment; + } + } + + // TODO: simplify this loop + while (state.token === '\n' || state.token === ';') { + // eslint-disable-line no-unmodified-loop-condition + if (blocks.length === 0 && node) { + visible = state.token !== ';'; + blocks.push({ + node, + visible + }); + } + getToken(state); + if (state.token !== '\n' && state.token !== ';' && state.token !== '') { + node = parseAssignment(state); + if (state.comment) { + node.comment = state.comment; + } + visible = state.token !== ';'; + blocks.push({ + node, + visible + }); + } + } + if (blocks.length > 0) { + return new BlockNode(blocks); + } else { + if (!node) { + node = new ConstantNode(undefined); + if (state.comment) { + node.comment = state.comment; + } + } + return node; + } + } + + /** + * Assignment of a function or variable, + * - can be a variable like 'a=2.3' + * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]' + * - defining a function like 'f(x) = x^2' + * @return {Node} node + * @private + */ + function parseAssignment(state) { + var name, args, value, valid; + var node = parseConditional(state); + if (state.token === '=') { + if (isSymbolNode(node)) { + // parse a variable assignment like 'a = 2/3' + name = node.name; + getTokenSkipNewline(state); + value = parseAssignment(state); + return new AssignmentNode(new SymbolNode(name), value); + } else if (isAccessorNode(node)) { + // parse a matrix subset assignment like 'A[1,2] = 4' + getTokenSkipNewline(state); + value = parseAssignment(state); + return new AssignmentNode(node.object, node.index, value); + } else if (isFunctionNode(node) && isSymbolNode(node.fn)) { + // parse function assignment like 'f(x) = x^2' + valid = true; + args = []; + name = node.name; + node.args.forEach(function (arg, index) { + if (isSymbolNode(arg)) { + args[index] = arg.name; + } else { + valid = false; + } + }); + if (valid) { + getTokenSkipNewline(state); + value = parseAssignment(state); + return new FunctionAssignmentNode(name, args, value); + } + } + throw createSyntaxError(state, 'Invalid left hand side of assignment operator ='); + } + return node; + } + + /** + * conditional operation + * + * condition ? truePart : falsePart + * + * Note: conditional operator is right-associative + * + * @return {Node} node + * @private + */ + function parseConditional(state) { + var node = parseLogicalOr(state); + while (state.token === '?') { + // eslint-disable-line no-unmodified-loop-condition + // set a conditional level, the range operator will be ignored as long + // as conditionalLevel === state.nestingLevel. + var prev = state.conditionalLevel; + state.conditionalLevel = state.nestingLevel; + getTokenSkipNewline(state); + var condition = node; + var trueExpr = parseAssignment(state); + if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected'); + state.conditionalLevel = null; + getTokenSkipNewline(state); + var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity + + node = new ConditionalNode(condition, trueExpr, falseExpr); + + // restore the previous conditional level + state.conditionalLevel = prev; + } + return node; + } + + /** + * logical or, 'x or y' + * @return {Node} node + * @private + */ + function parseLogicalOr(state) { + var node = parseLogicalXor(state); + while (state.token === 'or') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]); + } + return node; + } + + /** + * logical exclusive or, 'x xor y' + * @return {Node} node + * @private + */ + function parseLogicalXor(state) { + var node = parseLogicalAnd(state); + while (state.token === 'xor') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]); + } + return node; + } + + /** + * logical and, 'x and y' + * @return {Node} node + * @private + */ + function parseLogicalAnd(state) { + var node = parseBitwiseOr(state); + while (state.token === 'and') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]); + } + return node; + } + + /** + * bitwise or, 'x | y' + * @return {Node} node + * @private + */ + function parseBitwiseOr(state) { + var node = parseBitwiseXor(state); + while (state.token === '|') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]); + } + return node; + } + + /** + * bitwise exclusive or (xor), 'x ^| y' + * @return {Node} node + * @private + */ + function parseBitwiseXor(state) { + var node = parseBitwiseAnd(state); + while (state.token === '^|') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]); + } + return node; + } + + /** + * bitwise and, 'x & y' + * @return {Node} node + * @private + */ + function parseBitwiseAnd(state) { + var node = parseRelational(state); + while (state.token === '&') { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]); + } + return node; + } + + /** + * Parse a chained conditional, like 'a > b >= c' + * @return {Node} node + */ + function parseRelational(state) { + var params = [parseShift(state)]; + var conditionals = []; + var operators = { + '==': 'equal', + '!=': 'unequal', + '<': 'smaller', + '>': 'larger', + '<=': 'smallerEq', + '>=': 'largerEq' + }; + while (hasOwnProperty(operators, state.token)) { + // eslint-disable-line no-unmodified-loop-condition + var cond = { + name: state.token, + fn: operators[state.token] + }; + conditionals.push(cond); + getTokenSkipNewline(state); + params.push(parseShift(state)); + } + if (params.length === 1) { + return params[0]; + } else if (params.length === 2) { + return new OperatorNode(conditionals[0].name, conditionals[0].fn, params); + } else { + return new RelationalNode(conditionals.map(c => c.fn), params); + } + } + + /** + * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift + * @return {Node} node + * @private + */ + function parseShift(state) { + var node, name, fn, params; + node = parseConversion(state); + var operators = { + '<<': 'leftShift', + '>>': 'rightArithShift', + '>>>': 'rightLogShift' + }; + while (hasOwnProperty(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + params = [node, parseConversion(state)]; + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * conversion operators 'to' and 'in' + * @return {Node} node + * @private + */ + function parseConversion(state) { + var node, name, fn, params; + node = parseRange(state); + var operators = { + to: 'to', + in: 'to' // alias of 'to' + }; + while (hasOwnProperty(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + if (name === 'in' && state.token === '') { + // end of expression -> this is the unit 'in' ('inch') + node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true); + } else { + // operator 'a to b' or 'a in b' + params = [node, parseRange(state)]; + node = new OperatorNode(name, fn, params); + } + } + return node; + } + + /** + * parse range, "start:end", "start:step:end", ":", "start:", ":end", etc + * @return {Node} node + * @private + */ + function parseRange(state) { + var node; + var params = []; + if (state.token === ':') { + // implicit start=1 (one-based) + node = new ConstantNode(1); + } else { + // explicit start + node = parseAddSubtract(state); + } + if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) { + // we ignore the range operator when a conditional operator is being processed on the same level + params.push(node); + + // parse step and end + while (state.token === ':' && params.length < 3) { + // eslint-disable-line no-unmodified-loop-condition + getTokenSkipNewline(state); + if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') { + // implicit end + params.push(new SymbolNode('end')); + } else { + // explicit end + params.push(parseAddSubtract(state)); + } + } + if (params.length === 3) { + // params = [start, step, end] + node = new RangeNode(params[0], params[2], params[1]); // start, end, step + } else { + // length === 2 + // params = [start, end] + node = new RangeNode(params[0], params[1]); // start, end + } + } + return node; + } + + /** + * add or subtract + * @return {Node} node + * @private + */ + function parseAddSubtract(state) { + var node, name, fn, params; + node = parseMultiplyDivide(state); + var operators = { + '+': 'add', + '-': 'subtract' + }; + while (hasOwnProperty(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + var rightNode = parseMultiplyDivide(state); + if (rightNode.isPercentage) { + params = [node, new OperatorNode('*', 'multiply', [node, rightNode])]; + } else { + params = [node, rightNode]; + } + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * multiply, divide + * @return {Node} node + * @private + */ + function parseMultiplyDivide(state) { + var node, last, name, fn; + node = parseImplicitMultiplication(state); + last = node; + var operators = { + '*': 'multiply', + '.*': 'dotMultiply', + '/': 'divide', + './': 'dotDivide' + }; + while (true) { + if (hasOwnProperty(operators, state.token)) { + // explicit operators + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + last = parseImplicitMultiplication(state); + node = new OperatorNode(name, fn, [node, last]); + } else { + break; + } + } + return node; + } + + /** + * implicit multiplication + * @return {Node} node + * @private + */ + function parseImplicitMultiplication(state) { + var node, last; + node = parseRule2(state); + last = node; + while (true) { + if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') { + // parse implicit multiplication + // + // symbol: implicit multiplication like '2a', '(2+3)a', 'a b' + // number: implicit multiplication like '(2+3)2' + // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)' + last = parseRule2(state); + node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */); + } else { + break; + } + } + return node; + } + + /** + * Infamous "rule 2" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370 + * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164 + * Explicit division gets higher precedence than implicit multiplication + * when the division matches this pattern: + * [unaryPrefixOp]?[number] / [number] [symbol] + * @return {Node} node + * @private + */ + function parseRule2(state) { + var node = parseModulusPercentage(state); + var last = node; + var tokenStates = []; + while (true) { + // Match the "number /" part of the pattern "number / number symbol" + if (state.token === '/' && rule2Node(last)) { + // Look ahead to see if the next token is a number + tokenStates.push(_extends({}, state)); + getTokenSkipNewline(state); + + // Match the "number / number" part of the pattern + if (state.tokenType === TOKENTYPE.NUMBER) { + // Look ahead again + tokenStates.push(_extends({}, state)); + getTokenSkipNewline(state); + + // Match the "symbol" part of the pattern, or a left parenthesis + if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') { + // We've matched the pattern "number / number symbol". + // Rewind once and build the "number / number" node; the symbol will be consumed later + _extends(state, tokenStates.pop()); + tokenStates.pop(); + last = parseModulusPercentage(state); + node = new OperatorNode('/', 'divide', [node, last]); + } else { + // Not a match, so rewind + tokenStates.pop(); + _extends(state, tokenStates.pop()); + break; + } + } else { + // Not a match, so rewind + _extends(state, tokenStates.pop()); + break; + } + } else { + break; + } + } + return node; + } + + /** + * modulus and percentage + * @return {Node} node + * @private + */ + function parseModulusPercentage(state) { + var node, name, fn, params; + node = parseUnary(state); + var operators = { + '%': 'mod', + mod: 'mod' + }; + while (hasOwnProperty(operators, state.token)) { + name = state.token; + fn = operators[name]; + getTokenSkipNewline(state); + if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') { + // If the expression contains only %, then treat that as /100 + node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true); + } else { + params = [node, parseUnary(state)]; + node = new OperatorNode(name, fn, params); + } + } + return node; + } + + /** + * Unary plus and minus, and logical and bitwise not + * @return {Node} node + * @private + */ + function parseUnary(state) { + var name, params, fn; + var operators = { + '-': 'unaryMinus', + '+': 'unaryPlus', + '~': 'bitNot', + not: 'not' + }; + if (hasOwnProperty(operators, state.token)) { + fn = operators[state.token]; + name = state.token; + getTokenSkipNewline(state); + params = [parseUnary(state)]; + return new OperatorNode(name, fn, params); + } + return parsePow(state); + } + + /** + * power + * Note: power operator is right associative + * @return {Node} node + * @private + */ + function parsePow(state) { + var node, name, fn, params; + node = parseLeftHandOperators(state); + if (state.token === '^' || state.token === '.^') { + name = state.token; + fn = name === '^' ? 'pow' : 'dotPow'; + getTokenSkipNewline(state); + params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3' + node = new OperatorNode(name, fn, params); + } + return node; + } + + /** + * Left hand operators: factorial x!, ctranspose x' + * @return {Node} node + * @private + */ + function parseLeftHandOperators(state) { + var node, name, fn, params; + node = parseCustomNodes(state); + var operators = { + '!': 'factorial', + '\'': 'ctranspose' + }; + while (hasOwnProperty(operators, state.token)) { + name = state.token; + fn = operators[name]; + getToken(state); + params = [node]; + node = new OperatorNode(name, fn, params); + node = parseAccessors(state, node); + } + return node; + } + + /** + * Parse a custom node handler. A node handler can be used to process + * nodes in a custom way, for example for handling a plot. + * + * A handler must be passed as second argument of the parse function. + * - must extend math.Node + * - must contain a function _compile(defs: Object) : string + * - must contain a function find(filter: Object) : Node[] + * - must contain a function toString() : string + * - the constructor is called with a single argument containing all parameters + * + * For example: + * + * nodes = { + * 'plot': PlotHandler + * } + * + * The constructor of the handler is called as: + * + * node = new PlotHandler(params) + * + * The handler will be invoked when evaluating an expression like: + * + * node = math.parse('plot(sin(x), x)', nodes) + * + * @return {Node} node + * @private + */ + function parseCustomNodes(state) { + var params = []; + if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) { + var CustomNode = state.extraNodes[state.token]; + getToken(state); + + // parse parameters + if (state.token === '(') { + params = []; + openParams(state); + getToken(state); + if (state.token !== ')') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + } + + // create a new custom node + // noinspection JSValidateTypes + return new CustomNode(params); + } + return parseSymbol(state); + } + + /** + * parse symbols: functions, variables, constants, units + * @return {Node} node + * @private + */ + function parseSymbol(state) { + var node, name; + if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) { + name = state.token; + getToken(state); + if (hasOwnProperty(CONSTANTS, name)) { + // true, false, null, ... + node = new ConstantNode(CONSTANTS[name]); + } else if (NUMERIC_CONSTANTS.includes(name)) { + // NaN, Infinity + node = new ConstantNode(numeric(name, 'number')); + } else { + node = new SymbolNode(name); + } + + // parse function parameters and matrix index + node = parseAccessors(state, node); + return node; + } + return parseString(state); + } + + /** + * parse accessors: + * - function invocation in round brackets (...), for example sqrt(2) + * - index enclosed in square brackets [...], for example A[2,3] + * - dot notation for properties, like foo.bar + * @param {Object} state + * @param {Node} node Node on which to apply the parameters. If there + * are no parameters in the expression, the node + * itself is returned + * @param {string[]} [types] Filter the types of notations + * can be ['(', '[', '.'] + * @return {Node} node + * @private + */ + function parseAccessors(state, node, types) { + var params; + while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) { + // eslint-disable-line no-unmodified-loop-condition + params = []; + if (state.token === '(') { + if (isSymbolNode(node) || isAccessorNode(node)) { + // function invocation like fn(2, 3) or obj.fn(2, 3) + openParams(state); + getToken(state); + if (state.token !== ')') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + node = new FunctionNode(node, params); + } else { + // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2) + // don't parse it here but let it be handled by parseImplicitMultiplication + // with correct precedence + return node; + } + } else if (state.token === '[') { + // index notation like variable[2, 3] + openParams(state); + getToken(state); + if (state.token !== ']') { + params.push(parseAssignment(state)); + + // parse a list with parameters + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + params.push(parseAssignment(state)); + } + } + if (state.token !== ']') { + throw createSyntaxError(state, 'Parenthesis ] expected'); + } + closeParams(state); + getToken(state); + node = new AccessorNode(node, new IndexNode(params)); + } else { + // dot notation like variable.prop + getToken(state); + var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS; + if (!isPropertyName) { + throw createSyntaxError(state, 'Property name expected after dot'); + } + params.push(new ConstantNode(state.token)); + getToken(state); + var dotNotation = true; + node = new AccessorNode(node, new IndexNode(params, dotNotation)); + } + } + return node; + } + + /** + * Parse a single or double quoted string. + * @return {Node} node + * @private + */ + function parseString(state) { + var node, str; + if (state.token === '"' || state.token === "'") { + str = parseStringToken(state, state.token); + + // create constant + node = new ConstantNode(str); + + // parse index parameters + node = parseAccessors(state, node); + return node; + } + return parseMatrix(state); + } + + /** + * Parse a string surrounded by single or double quotes + * @param {Object} state + * @param {"'" | "\""} quote + * @return {string} + */ + function parseStringToken(state, quote) { + var str = ''; + while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) { + if (currentCharacter(state) === '\\') { + next(state); + var char = currentCharacter(state); + var escapeChar = ESCAPE_CHARACTERS[char]; + if (escapeChar !== undefined) { + // an escaped control character like \" or \n + str += escapeChar; + state.index += 1; + } else if (char === 'u') { + // escaped unicode character + var unicode = state.expression.slice(state.index + 1, state.index + 5); + if (/^[0-9A-Fa-f]{4}$/.test(unicode)) { + // test whether the string holds four hexadecimal values + str += String.fromCharCode(parseInt(unicode, 16)); + state.index += 5; + } else { + throw createSyntaxError(state, "Invalid unicode character \\u".concat(unicode)); + } + } else { + throw createSyntaxError(state, "Bad escape character \\".concat(char)); + } + } else { + // any regular character + str += currentCharacter(state); + next(state); + } + } + getToken(state); + if (state.token !== quote) { + throw createSyntaxError(state, "End of string ".concat(quote, " expected")); + } + getToken(state); + return str; + } + + /** + * parse the matrix + * @return {Node} node + * @private + */ + function parseMatrix(state) { + var array, params, rows, cols; + if (state.token === '[') { + // matrix [...] + openParams(state); + getToken(state); + if (state.token !== ']') { + // this is a non-empty matrix + var row = parseRow(state); + if (state.token === ';') { + // 2 dimensional array + rows = 1; + params = [row]; + + // the rows of the matrix are separated by dot-comma's + while (state.token === ';') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + if (state.token !== ']') { + params[rows] = parseRow(state); + rows++; + } + } + if (state.token !== ']') { + throw createSyntaxError(state, 'End of matrix ] expected'); + } + closeParams(state); + getToken(state); + + // check if the number of columns matches in all rows + cols = params[0].items.length; + for (var r = 1; r < rows; r++) { + if (params[r].items.length !== cols) { + throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')'); + } + } + array = new ArrayNode(params); + } else { + // 1 dimensional vector + if (state.token !== ']') { + throw createSyntaxError(state, 'End of matrix ] expected'); + } + closeParams(state); + getToken(state); + array = row; + } + } else { + // this is an empty matrix "[ ]" + closeParams(state); + getToken(state); + array = new ArrayNode([]); + } + return parseAccessors(state, array); + } + return parseObject(state); + } + + /** + * Parse a single comma-separated row from a matrix, like 'a, b, c' + * @return {ArrayNode} node + */ + function parseRow(state) { + var params = [parseAssignment(state)]; + var len = 1; + while (state.token === ',') { + // eslint-disable-line no-unmodified-loop-condition + getToken(state); + + // parse expression + if (state.token !== ']' && state.token !== ';') { + params[len] = parseAssignment(state); + len++; + } + } + return new ArrayNode(params); + } + + /** + * parse an object, enclosed in angle brackets{...}, for example {value: 2} + * @return {Node} node + * @private + */ + function parseObject(state) { + if (state.token === '{') { + openParams(state); + var key; + var properties = {}; + do { + getToken(state); + if (state.token !== '}') { + // parse key + if (state.token === '"' || state.token === "'") { + key = parseStringToken(state, state.token); + } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) { + key = state.token; + getToken(state); + } else { + throw createSyntaxError(state, 'Symbol or string expected as object key'); + } + + // parse key/value separator + if (state.token !== ':') { + throw createSyntaxError(state, 'Colon : expected after object key'); + } + getToken(state); + + // parse key + properties[key] = parseAssignment(state); + } + } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition + + if (state.token !== '}') { + throw createSyntaxError(state, 'Comma , or bracket } expected after object value'); + } + closeParams(state); + getToken(state); + var node = new ObjectNode(properties); + + // parse index parameters + node = parseAccessors(state, node); + return node; + } + return parseNumber(state); + } + + /** + * parse a number + * @return {Node} node + * @private + */ + function parseNumber(state) { + var numberStr; + if (state.tokenType === TOKENTYPE.NUMBER) { + // this is a number + numberStr = state.token; + getToken(state); + var numericType = safeNumberType(numberStr, config); + var value = numeric(numberStr, numericType); + return new ConstantNode(value); + } + return parseParentheses(state); + } + + /** + * parentheses + * @return {Node} node + * @private + */ + function parseParentheses(state) { + var node; + + // check if it is a parenthesized expression + if (state.token === '(') { + // parentheses (...) + openParams(state); + getToken(state); + node = parseAssignment(state); // start again + + if (state.token !== ')') { + throw createSyntaxError(state, 'Parenthesis ) expected'); + } + closeParams(state); + getToken(state); + node = new ParenthesisNode(node); + node = parseAccessors(state, node); + return node; + } + return parseEnd(state); + } + + /** + * Evaluated when the expression is not yet ended but expected to end + * @return {Node} res + * @private + */ + function parseEnd(state) { + if (state.token === '') { + // syntax error or unexpected end of expression + throw createSyntaxError(state, 'Unexpected end of expression'); + } else { + throw createSyntaxError(state, 'Value expected'); + } + } + + /** + * Shortcut for getting the current row value (one based) + * Returns the line of the currently handled expression + * @private + */ + /* TODO: implement keeping track on the row number + function row () { + return null + } + */ + + /** + * Shortcut for getting the current col value (one based) + * Returns the column (position) where the last state.token starts + * @private + */ + function col(state) { + return state.index - state.token.length + 1; + } + + /** + * Create an error + * @param {Object} state + * @param {string} message + * @return {SyntaxError} instantiated error + * @private + */ + function createSyntaxError(state, message) { + var c = col(state); + var error = new SyntaxError(message + ' (char ' + c + ')'); + error.char = c; + return error; + } + + /** + * Create an error + * @param {Object} state + * @param {string} message + * @return {Error} instantiated error + * @private + */ + function createError(state, message) { + var c = col(state); + var error = new SyntaxError(message + ' (char ' + c + ')'); + error.char = c; + return error; + } + + // Now that we can parse, automatically convert strings to Nodes by parsing + typed.addConversion({ + from: 'string', + to: 'Node', + convert: parse + }); + return parse; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/and.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/and.transform.js new file mode 100644 index 0000000..9c80960 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/and.transform.js @@ -0,0 +1,35 @@ +import { createAnd } from '../../function/logical/and.js'; +import { factory } from '../../utils/factory.js'; +import { isCollection } from '../../utils/is.js'; +var name = 'and'; +var dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']; +export var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + var and = createAnd({ + typed, + matrix, + equalScalar, + zeros, + not, + concat + }); + function andTransform(args, math, scope) { + var condition1 = args[0].compile().evaluate(scope); + if (!isCollection(condition1) && !and(condition1, true)) { + return false; + } + var condition2 = args[1].compile().evaluate(scope); + return and(condition1, condition2); + } + andTransform.rawArgs = true; + return andTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/apply.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/apply.transform.js new file mode 100644 index 0000000..cef65c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/apply.transform.js @@ -0,0 +1,44 @@ +import { errorTransform } from './utils/errorTransform.js'; +import { factory } from '../../utils/factory.js'; +import { createApply } from '../../function/matrix/apply.js'; +import { isBigNumber, isNumber } from '../../utils/is.js'; +var name = 'apply'; +var dependencies = ['typed', 'isInteger']; + +/** + * Attach a transform function to math.apply + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function apply + * from one-based to zero based + */ +export var createApplyTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isInteger + } = _ref; + var apply = createApply({ + typed, + isInteger + }); + + // @see: comment of concat itself + return typed('apply', { + '...any': function any(args) { + // change dim from one-based to zero-based + var dim = args[1]; + if (isNumber(dim)) { + args[1] = dim - 1; + } else if (isBigNumber(dim)) { + args[1] = dim.minus(1); + } + try { + return apply.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js new file mode 100644 index 0000000..0985a33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js @@ -0,0 +1,40 @@ +import { createBitAnd } from '../../function/bitwise/bitAnd.js'; +import { factory } from '../../utils/factory.js'; +import { isCollection } from '../../utils/is.js'; +var name = 'bitAnd'; +var dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat']; +export var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + var bitAnd = createBitAnd({ + typed, + matrix, + equalScalar, + zeros, + not, + concat + }); + function bitAndTransform(args, math, scope) { + var condition1 = args[0].compile().evaluate(scope); + if (!isCollection(condition1)) { + if (isNaN(condition1)) { + return NaN; + } + if (condition1 === 0 || condition1 === false) { + return 0; + } + } + var condition2 = args[1].compile().evaluate(scope); + return bitAnd(condition1, condition2); + } + bitAndTransform.rawArgs = true; + return bitAndTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js new file mode 100644 index 0000000..9f154f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js @@ -0,0 +1,41 @@ +import { createBitOr } from '../../function/bitwise/bitOr.js'; +import { factory } from '../../utils/factory.js'; +import { isCollection } from '../../utils/is.js'; +var name = 'bitOr'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +export var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + var bitOr = createBitOr({ + typed, + matrix, + equalScalar, + DenseMatrix, + concat + }); + function bitOrTransform(args, math, scope) { + var condition1 = args[0].compile().evaluate(scope); + if (!isCollection(condition1)) { + if (isNaN(condition1)) { + return NaN; + } + if (condition1 === -1) { + return -1; + } + if (condition1 === true) { + return 1; + } + } + var condition2 = args[1].compile().evaluate(scope); + return bitOr(condition1, condition2); + } + bitOrTransform.rawArgs = true; + return bitOrTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/column.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/column.transform.js new file mode 100644 index 0000000..ccfb0a3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/column.transform.js @@ -0,0 +1,47 @@ +import { errorTransform } from './utils/errorTransform.js'; +import { factory } from '../../utils/factory.js'; +import { createColumn } from '../../function/matrix/column.js'; +import { isNumber } from '../../utils/is.js'; +var name = 'column'; +var dependencies = ['typed', 'Index', 'matrix', 'range']; + +/** + * Attach a transform function to matrix.column + * Adds a property transform containing the transform function. + * + * This transform changed the last `index` parameter of function column + * from zero-based to one-based + */ +export var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Index, + matrix, + range + } = _ref; + var column = createColumn({ + typed, + Index, + matrix, + range + }); + + // @see: comment of column itself + return typed('column', { + '...any': function any(args) { + // change last argument from zero-based to one-based + var lastIndex = args.length - 1; + var last = args[lastIndex]; + if (isNumber(last)) { + args[lastIndex] = last - 1; + } + try { + return column.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js new file mode 100644 index 0000000..737876d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js @@ -0,0 +1,45 @@ +import { isBigNumber, isNumber } from '../../utils/is.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { factory } from '../../utils/factory.js'; +import { createConcat } from '../../function/matrix/concat.js'; +var name = 'concat'; +var dependencies = ['typed', 'matrix', 'isInteger']; +export var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + isInteger + } = _ref; + var concat = createConcat({ + typed, + matrix, + isInteger + }); + + /** + * Attach a transform function to math.range + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function concat + * from one-based to zero based + */ + return typed('concat', { + '...any': function any(args) { + // change last argument from one-based to zero-based + var lastIndex = args.length - 1; + var last = args[lastIndex]; + if (isNumber(last)) { + args[lastIndex] = last - 1; + } else if (isBigNumber(last)) { + args[lastIndex] = last.minus(1); + } + try { + return concat.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js new file mode 100644 index 0000000..049dc14 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js @@ -0,0 +1,46 @@ +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createCumSum } from '../../function/statistics/cumsum.js'; + +/** + * Attach a transform function to math.sum + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function sum + * from one-based to zero based + */ +var name = 'cumsum'; +var dependencies = ['typed', 'add', 'unaryPlus']; +export var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + unaryPlus + } = _ref; + var cumsum = createCumSum({ + typed, + add, + unaryPlus + }); + return typed(name, { + '...any': function any(args) { + // change last argument dim from one-based to zero-based + if (args.length === 2 && isCollection(args[0])) { + var dim = args[1]; + if (isNumber(dim)) { + args[1] = dim - 1; + } else if (isBigNumber(dim)) { + args[1] = dim.minus(1); + } + } + try { + return cumsum.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js new file mode 100644 index 0000000..970cf80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createDiff } from '../../function/matrix/diff.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'diff'; +var dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber']; +export var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + subtract, + number, + bignumber + } = _ref; + var diff = createDiff({ + typed, + matrix, + subtract, + number, + bignumber + }); + + /** + * Attach a transform function to math.diff + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed(name, { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return diff.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js new file mode 100644 index 0000000..33e383f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js @@ -0,0 +1,56 @@ +import { createFilter } from '../../function/matrix/filter.js'; +import { factory } from '../../utils/factory.js'; +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'; +import { compileInlineExpression } from './utils/compileInlineExpression.js'; +import { createTransformCallback } from './utils/transformCallback.js'; +var name = 'filter'; +var dependencies = ['typed']; +export var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Attach a transform function to math.filter + * Adds a property transform containing the transform function. + * + * This transform adds support for equations as test function for math.filter, + * so you can do something like 'filter([3, -2, 5], x > 0)'. + */ + function filterTransform(args, math, scope) { + var filter = createFilter({ + typed + }); + var transformCallback = createTransformCallback({ + typed + }); + if (args.length === 0) { + return filter(); + } + var x = args[0]; + if (args.length === 1) { + return filter(x); + } + var N = args.length - 1; + var callback = args[N]; + if (x) { + x = _compileAndEvaluate(x, scope); + } + if (callback) { + if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = compileInlineExpression(callback, math, scope); + } + } + return filter(x, transformCallback(callback, N)); + } + filterTransform.rawArgs = true; + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + return filterTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js new file mode 100644 index 0000000..4934561 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js @@ -0,0 +1,55 @@ +import { createForEach } from '../../function/matrix/forEach.js'; +import { createTransformCallback } from './utils/transformCallback.js'; +import { factory } from '../../utils/factory.js'; +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'; +import { compileInlineExpression } from './utils/compileInlineExpression.js'; +var name = 'forEach'; +var dependencies = ['typed']; +export var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Attach a transform function to math.forEach + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + var forEach = createForEach({ + typed + }); + var transformCallback = createTransformCallback({ + typed + }); + function forEachTransform(args, math, scope) { + if (args.length === 0) { + return forEach(); + } + var x = args[0]; + if (args.length === 1) { + return forEach(x); + } + var N = args.length - 1; + var callback = args[N]; + if (x) { + x = _compileAndEvaluate(x, scope); + } + if (callback) { + if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = compileInlineExpression(callback, math, scope); + } + } + return forEach(x, transformCallback(callback, N)); + } + forEachTransform.rawArgs = true; + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + return forEachTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/index.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/index.transform.js new file mode 100644 index 0000000..9655a70 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/index.transform.js @@ -0,0 +1,52 @@ +import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'index'; +var dependencies = ['Index', 'getMatrixDataType']; +export var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Index, + getMatrixDataType + } = _ref; + /** + * Attach a transform function to math.index + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + return function indexTransform() { + var args = []; + for (var i = 0, ii = arguments.length; i < ii; i++) { + var arg = arguments[i]; + + // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is + if (isRange(arg)) { + arg.start--; + arg.end -= arg.step > 0 ? 0 : 2; + } else if (arg && arg.isSet === true) { + arg = arg.map(function (v) { + return v - 1; + }); + } else if (isArray(arg) || isMatrix(arg)) { + if (getMatrixDataType(arg) !== 'boolean') { + arg = arg.map(function (v) { + return v - 1; + }); + } + } else if (isNumber(arg)) { + arg--; + } else if (isBigNumber(arg)) { + arg = arg.toNumber() - 1; + } else if (typeof arg === 'string') { + // leave as is + } else { + throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range'); + } + args[i] = arg; + } + var res = new Index(); + Index.apply(res, args); + return res; + }; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/map.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/map.transform.js new file mode 100644 index 0000000..252a862 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/map.transform.js @@ -0,0 +1,53 @@ +import { factory } from '../../utils/factory.js'; +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js'; +import { createMap } from '../../function/matrix/map.js'; +import { compileInlineExpression } from './utils/compileInlineExpression.js'; +import { createTransformCallback } from './utils/transformCallback.js'; +var name = 'map'; +var dependencies = ['typed']; +export var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Attach a transform function to math.map + * Adds a property transform containing the transform function. + * + * This transform creates a one-based index instead of a zero-based index + */ + var map = createMap({ + typed + }); + var transformCallback = createTransformCallback({ + typed + }); + function mapTransform(args, math, scope) { + if (args.length === 0) { + return map(); + } + if (args.length === 1) { + return map(args[0]); + } + var N = args.length - 1; + var X = args.slice(0, N); + var callback = args[N]; + X = X.map(arg => _compileAndEvaluate(arg, scope)); + if (callback) { + if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) { + // a function pointer, like filter([3, -2, 5], myTestFunction) + callback = _compileAndEvaluate(callback, scope); + } else { + // an expression like filter([3, -2, 5], x > 0) + callback = compileInlineExpression(callback, math, scope); + } + } + return map(...X, transformCallback(callback, N)); + function _compileAndEvaluate(arg, scope) { + return arg.compile().evaluate(scope); + } + } + mapTransform.rawArgs = true; + return mapTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/max.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/max.transform.js new file mode 100644 index 0000000..781e5da --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/max.transform.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createMax } from '../../function/statistics/max.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'max'; +var dependencies = ['typed', 'config', 'numeric', 'larger']; +export var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + numeric, + larger + } = _ref; + var max = createMax({ + typed, + config, + numeric, + larger + }); + + /** + * Attach a transform function to math.max + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function max + * from one-based to zero based + */ + return typed('max', { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return max.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js new file mode 100644 index 0000000..8d080f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js @@ -0,0 +1,38 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createMean } from '../../function/statistics/mean.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'mean'; +var dependencies = ['typed', 'add', 'divide']; +export var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + divide + } = _ref; + var mean = createMean({ + typed, + add, + divide + }); + + /** + * Attach a transform function to math.mean + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function mean + * from one-based to zero based + */ + return typed('mean', { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return mean.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/min.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/min.transform.js new file mode 100644 index 0000000..b0afc80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/min.transform.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createMin } from '../../function/statistics/min.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'min'; +var dependencies = ['typed', 'config', 'numeric', 'smaller']; +export var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + numeric, + smaller + } = _ref; + var min = createMin({ + typed, + config, + numeric, + smaller + }); + + /** + * Attach a transform function to math.min + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function min + * from one-based to zero based + */ + return typed('min', { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return min.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/or.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/or.transform.js new file mode 100644 index 0000000..1b1920e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/or.transform.js @@ -0,0 +1,33 @@ +import { createOr } from '../../function/logical/or.js'; +import { factory } from '../../utils/factory.js'; +import { isCollection } from '../../utils/is.js'; +var name = 'or'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +export var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + var or = createOr({ + typed, + matrix, + equalScalar, + DenseMatrix, + concat + }); + function orTransform(args, math, scope) { + var condition1 = args[0].compile().evaluate(scope); + if (!isCollection(condition1) && or(condition1, false)) { + return true; + } + var condition2 = args[1].compile().evaluate(scope); + return or(condition1, condition2); + } + orTransform.rawArgs = true; + return orTransform; +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/print.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/print.transform.js new file mode 100644 index 0000000..645000d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/print.transform.js @@ -0,0 +1,42 @@ +import { createPrint } from '../../function/string/print.js'; +import { factory } from '../../utils/factory.js'; +import { printTemplate } from '../../utils/print.js'; +var name = 'print'; +var dependencies = ['typed', 'matrix', 'zeros', 'add']; +export var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + zeros, + add + } = _ref; + var print = createPrint({ + typed, + matrix, + zeros, + add + }); + return typed(name, { + 'string, Object | Array': function string_Object__Array(template, values) { + return print(_convertTemplateToZeroBasedIndex(template), values); + }, + 'string, Object | Array, number | Object': function string_Object__Array_number__Object(template, values, options) { + return print(_convertTemplateToZeroBasedIndex(template), values, options); + } + }); + function _convertTemplateToZeroBasedIndex(template) { + return template.replace(printTemplate, x => { + var parts = x.slice(1).split('.'); + var result = parts.map(function (part) { + if (!isNaN(part) && part.length > 0) { + return parseInt(part) - 1; + } else { + return part; + } + }); + return '$' + result.join('.'); + }); + } +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js new file mode 100644 index 0000000..2e6a00f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js @@ -0,0 +1,59 @@ +import { factory } from '../../utils/factory.js'; +import { createQuantileSeq } from '../../function/statistics/quantileSeq.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'quantileSeq'; +var dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']; + +/** + * Attach a transform function to math.quantileSeq + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function std + * from one-based to zero based + */ +export var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + } = _ref; + var quantileSeq = createQuantileSeq({ + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + }); + return typed('quantileSeq', { + 'Array | Matrix, number | BigNumber': quantileSeq, + 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)), + 'Array | Matrix, number | BigNumber, boolean': quantileSeq, + 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)), + 'Array | Matrix, Array | Matrix': quantileSeq, + 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)), + 'Array | Matrix, Array | Matrix, boolean': quantileSeq, + 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim)) + }); + function dimToZeroBase(dim) { + // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases. + return lastDimToZeroBase([[], dim])[1]; + } +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/range.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/range.transform.js new file mode 100644 index 0000000..aa3468e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/range.transform.js @@ -0,0 +1,50 @@ +import { factory } from '../../utils/factory.js'; +import { createRange } from '../../function/matrix/range.js'; +var name = 'range'; +var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']; +export var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + } = _ref; + var range = createRange({ + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + }); + + /** + * Attach a transform function to math.range + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed('range', { + '...any': function any(args) { + var lastIndex = args.length - 1; + var last = args[lastIndex]; + if (typeof last !== 'boolean') { + // append a parameter includeEnd=true + args.push(true); + } + return range.apply(null, args); + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/row.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/row.transform.js new file mode 100644 index 0000000..2bb7084 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/row.transform.js @@ -0,0 +1,47 @@ +import { factory } from '../../utils/factory.js'; +import { createRow } from '../../function/matrix/row.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { isNumber } from '../../utils/is.js'; +var name = 'row'; +var dependencies = ['typed', 'Index', 'matrix', 'range']; + +/** + * Attach a transform function to matrix.column + * Adds a property transform containing the transform function. + * + * This transform changed the last `index` parameter of function column + * from zero-based to one-based + */ +export var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Index, + matrix, + range + } = _ref; + var row = createRow({ + typed, + Index, + matrix, + range + }); + + // @see: comment of row itself + return typed('row', { + '...any': function any(args) { + // change last argument from zero-based to one-based + var lastIndex = args.length - 1; + var last = args[lastIndex]; + if (isNumber(last)) { + args[lastIndex] = last - 1; + } + try { + return row.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/std.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/std.transform.js new file mode 100644 index 0000000..5e83737 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/std.transform.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +import { createStd } from '../../function/statistics/std.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'std'; +var dependencies = ['typed', 'map', 'sqrt', 'variance']; + +/** + * Attach a transform function to math.std + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function std + * from one-based to zero based + */ +export var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + map, + sqrt, + variance + } = _ref; + var std = createStd({ + typed, + map, + sqrt, + variance + }); + return typed('std', { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return std.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js new file mode 100644 index 0000000..23f29cf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js @@ -0,0 +1,37 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createSubset } from '../../function/matrix/subset.js'; +var name = 'subset'; +var dependencies = ['typed', 'matrix', 'zeros', 'add']; +export var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + zeros, + add + } = _ref; + var subset = createSubset({ + typed, + matrix, + zeros, + add + }); + + /** + * Attach a transform function to math.subset + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed('subset', { + '...any': function any(args) { + try { + return subset.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js new file mode 100644 index 0000000..d5a27f8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createSum } from '../../function/statistics/sum.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; + +/** + * Attach a transform function to math.sum + * Adds a property transform containing the transform function. + * + * This transform changed the last `dim` parameter of function sum + * from one-based to zero based + */ +var name = 'sum'; +var dependencies = ['typed', 'config', 'add', 'numeric']; +export var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + add, + numeric + } = _ref; + var sum = createSum({ + typed, + config, + add, + numeric + }); + return typed(name, { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return sum.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js new file mode 100644 index 0000000..96f7c32 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js @@ -0,0 +1,30 @@ +import { isSymbolNode } from '../../../utils/is.js'; +import { PartitionedMap } from '../../../utils/map.js'; + +/** + * Compile an inline expression like "x > 0" + * @param {Node} expression + * @param {Object} math + * @param {Map} scope + * @return {function} Returns a function with one argument which fills in the + * undefined variable (like "x") and evaluates the expression + */ +export function compileInlineExpression(expression, math, scope) { + // find an undefined symbol + var symbol = expression.filter(function (node) { + return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name); + })[0]; + if (!symbol) { + throw new Error('No undefined variable found in inline expression "' + expression + '"'); + } + + // create a test function for this equation + var name = symbol.name; // variable name + var argsScope = new Map(); + var subScope = new PartitionedMap(scope, argsScope, new Set([name])); + var eq = expression.compile(); + return function inlineExpression(x) { + argsScope.set(name, x); + return eq.evaluate(subScope); + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js new file mode 100644 index 0000000..6c17d76 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js @@ -0,0 +1,16 @@ +import { isNumber, isBigNumber } from '../../../utils/is.js'; +/** + * Change last argument dim from one-based to zero-based. + */ +export function dimToZeroBase(dim) { + if (isNumber(dim)) { + return dim - 1; + } else if (isBigNumber(dim)) { + return dim.minus(1); + } else { + return dim; + } +} +export function isNumberOrBigNumber(n) { + return isNumber(n) || isBigNumber(n); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js new file mode 100644 index 0000000..b64f7ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js @@ -0,0 +1,13 @@ +import { IndexError } from '../../../error/IndexError.js'; + +/** + * Transform zero-based indices to one-based indices in errors + * @param {Error} err + * @returns {Error | IndexError} Returns the transformed error + */ +export function errorTransform(err) { + if (err && err.isIndexError) { + return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined); + } + return err; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js new file mode 100644 index 0000000..d2d939c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js @@ -0,0 +1,15 @@ +import { isCollection } from '../../../utils/is.js'; +import { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js'; +/** + * Change last argument dim from one-based to zero-based. + */ +export function lastDimToZeroBase(args) { + if (args.length === 2 && isCollection(args[0])) { + args = args.slice(); + var dim = args[1]; + if (isNumberOrBigNumber(dim)) { + args[1] = dimToZeroBase(dim); + } + } + return args; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js new file mode 100644 index 0000000..090a0c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js @@ -0,0 +1,95 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'transformCallback'; +var dependencies = ['typed']; +export var createTransformCallback = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Transforms the given callback function based on its type and number of arrays. + * + * @param {Function} callback - The callback function to transform. + * @param {number} numberOfArrays - The number of arrays to pass to the callback function. + * @returns {*} - The transformed callback function. + */ + return function (callback, numberOfArrays) { + if (typed.isTypedFunction(callback)) { + return _transformTypedCallbackFunction(callback, numberOfArrays); + } else { + return _transformCallbackFunction(callback, callback.length, numberOfArrays); + } + }; + + /** + * Transforms the given typed callback function based on the number of arrays. + * + * @param {Function} typedFunction - The typed callback function to transform. + * @param {number} numberOfArrays - The number of arrays to pass to the callback function. + * @returns {*} - The transformed callback function. + */ + function _transformTypedCallbackFunction(typedFunction, numberOfArrays) { + var signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => { + var [signature, callbackFunction] = _ref2; + var numberOfCallbackInputs = signature.split(',').length; + if (typed.isTypedFunction(callbackFunction)) { + return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)]; + } else { + return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)]; + } + })); + if (typeof typedFunction.name === 'string') { + return typed(typedFunction.name, signatures); + } else { + return typed(signatures); + } + } +}); + +/** + * Transforms the callback function based on the number of callback inputs and arrays. + * There are three cases: + * 1. The callback function has N arguments. + * 2. The callback function has N+1 arguments. + * 3. The callback function has 2N+1 arguments. + * + * @param {Function} callbackFunction - The callback function to transform. + * @param {number} numberOfCallbackInputs - The number of callback inputs. + * @param {number} numberOfArrays - The number of arrays. + * @returns {Function} The transformed callback function. + */ +function _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) { + if (numberOfCallbackInputs === numberOfArrays) { + return callbackFunction; + } else if (numberOfCallbackInputs === numberOfArrays + 1) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var vals = args.slice(0, numberOfArrays); + var idx = _transformDims(args[numberOfArrays]); + return callbackFunction(...vals, idx); + }; + } else if (numberOfCallbackInputs > numberOfArrays + 1) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + var vals = args.slice(0, numberOfArrays); + var idx = _transformDims(args[numberOfArrays]); + var rest = args.slice(numberOfArrays + 1); + return callbackFunction(...vals, idx, ...rest); + }; + } else { + return callbackFunction; + } +} + +/** + * Transforms the dimensions by adding 1 to each dimension. + * + * @param {Array} dims - The dimensions to transform. + * @returns {Array} The transformed dimensions. + */ +function _transformDims(dims) { + return dims.map(dim => dim + 1); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js new file mode 100644 index 0000000..c17d970 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js @@ -0,0 +1,46 @@ +import { factory } from '../../utils/factory.js'; +import { errorTransform } from './utils/errorTransform.js'; +import { createVariance } from '../../function/statistics/variance.js'; +import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js'; +var name = 'variance'; +var dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']; + +/** + * Attach a transform function to math.var + * Adds a property transform containing the transform function. + * + * This transform changed the `dim` parameter of function var + * from one-based to zero based + */ +export var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + } = _ref; + var variance = createVariance({ + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + }); + return typed(name, { + '...any': function any(args) { + args = lastDimToZeroBase(args); + try { + return variance.apply(null, args); + } catch (err) { + throw errorTransform(err); + } + } + }); +}, { + isTransformFunction: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesAny.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesAny.js new file mode 100644 index 0000000..ee47917 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesAny.js @@ -0,0 +1,297 @@ +export { createTyped } from './core/function/typed.js'; +export { createResultSet } from './type/resultset/ResultSet.js'; +export { createBigNumberClass } from './type/bignumber/BigNumber.js'; +export { createComplexClass } from './type/complex/Complex.js'; +export { createFractionClass } from './type/fraction/Fraction.js'; +export { createRangeClass } from './type/matrix/Range.js'; +export { createMatrixClass } from './type/matrix/Matrix.js'; +export { createDenseMatrixClass } from './type/matrix/DenseMatrix.js'; +export { createClone } from './function/utils/clone.js'; +export { createIsInteger } from './function/utils/isInteger.js'; +export { createIsNegative } from './function/utils/isNegative.js'; +export { createIsNumeric } from './function/utils/isNumeric.js'; +export { createHasNumericValue } from './function/utils/hasNumericValue.js'; +export { createIsPositive } from './function/utils/isPositive.js'; +export { createIsZero } from './function/utils/isZero.js'; +export { createIsNaN } from './function/utils/isNaN.js'; +export { createTypeOf } from './function/utils/typeOf.js'; +export { createEqualScalar } from './function/relational/equalScalar.js'; +export { createSparseMatrixClass } from './type/matrix/SparseMatrix.js'; +export { createNumber } from './type/number.js'; +export { createBigint } from './type/bigint.js'; +export { createString } from './type/string.js'; +export { createBoolean } from './type/boolean.js'; +export { createBignumber } from './type/bignumber/function/bignumber.js'; +export { createComplex } from './type/complex/function/complex.js'; +export { createFraction } from './type/fraction/function/fraction.js'; +export { createMatrix } from './type/matrix/function/matrix.js'; +export { createMatrixFromFunction } from './function/matrix/matrixFromFunction.js'; +export { createMatrixFromRows } from './function/matrix/matrixFromRows.js'; +export { createMatrixFromColumns } from './function/matrix/matrixFromColumns.js'; +export { createSplitUnit } from './type/unit/function/splitUnit.js'; +export { createUnaryMinus } from './function/arithmetic/unaryMinus.js'; +export { createUnaryPlus } from './function/arithmetic/unaryPlus.js'; +export { createAbs } from './function/arithmetic/abs.js'; +export { createApply } from './function/matrix/apply.js'; +export { createAddScalar } from './function/arithmetic/addScalar.js'; +export { createSubtractScalar } from './function/arithmetic/subtractScalar.js'; +export { createCbrt } from './function/arithmetic/cbrt.js'; +export { createCeil } from './function/arithmetic/ceil.js'; +export { createCube } from './function/arithmetic/cube.js'; +export { createExp } from './function/arithmetic/exp.js'; +export { createExpm1 } from './function/arithmetic/expm1.js'; +export { createFix } from './function/arithmetic/fix.js'; +export { createFloor } from './function/arithmetic/floor.js'; +export { createGcd } from './function/arithmetic/gcd.js'; +export { createLcm } from './function/arithmetic/lcm.js'; +export { createLog10 } from './function/arithmetic/log10.js'; +export { createLog2 } from './function/arithmetic/log2.js'; +export { createMod } from './function/arithmetic/mod.js'; +export { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js'; +export { createMultiply } from './function/arithmetic/multiply.js'; +export { createNthRoot } from './function/arithmetic/nthRoot.js'; +export { createSign } from './function/arithmetic/sign.js'; +export { createSqrt } from './function/arithmetic/sqrt.js'; +export { createSquare } from './function/arithmetic/square.js'; +export { createSubtract } from './function/arithmetic/subtract.js'; +export { createXgcd } from './function/arithmetic/xgcd.js'; +export { createInvmod } from './function/arithmetic/invmod.js'; +export { createDotMultiply } from './function/arithmetic/dotMultiply.js'; +export { createBitAnd } from './function/bitwise/bitAnd.js'; +export { createBitNot } from './function/bitwise/bitNot.js'; +export { createBitOr } from './function/bitwise/bitOr.js'; +export { createBitXor } from './function/bitwise/bitXor.js'; +export { createArg } from './function/complex/arg.js'; +export { createConj } from './function/complex/conj.js'; +export { createIm } from './function/complex/im.js'; +export { createRe } from './function/complex/re.js'; +export { createNot } from './function/logical/not.js'; +export { createOr } from './function/logical/or.js'; +export { createXor } from './function/logical/xor.js'; +export { createConcat } from './function/matrix/concat.js'; +export { createColumn } from './function/matrix/column.js'; +export { createCount } from './function/matrix/count.js'; +export { createCross } from './function/matrix/cross.js'; +export { createDiag } from './function/matrix/diag.js'; +export { createFilter } from './function/matrix/filter.js'; +export { createFlatten } from './function/matrix/flatten.js'; +export { createForEach } from './function/matrix/forEach.js'; +export { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js'; +export { createIdentity } from './function/matrix/identity.js'; +export { createKron } from './function/matrix/kron.js'; +export { createMap } from './function/matrix/map.js'; +export { createDiff } from './function/matrix/diff.js'; +export { createOnes } from './function/matrix/ones.js'; +export { createRange } from './function/matrix/range.js'; +export { createReshape } from './function/matrix/reshape.js'; +export { createResize } from './function/matrix/resize.js'; +export { createRotate } from './function/matrix/rotate.js'; +export { createRotationMatrix } from './function/matrix/rotationMatrix.js'; +export { createRow } from './function/matrix/row.js'; +export { createSize } from './function/matrix/size.js'; +export { createSqueeze } from './function/matrix/squeeze.js'; +export { createSubset } from './function/matrix/subset.js'; +export { createTranspose } from './function/matrix/transpose.js'; +export { createCtranspose } from './function/matrix/ctranspose.js'; +export { createZeros } from './function/matrix/zeros.js'; +export { createFft } from './function/matrix/fft.js'; +export { createIfft } from './function/matrix/ifft.js'; +export { createSolveODE } from './function/numeric/solveODE.js'; +export { createErf } from './function/special/erf.js'; +export { createZeta } from './function/special/zeta.js'; +export { createMode } from './function/statistics/mode.js'; +export { createProd } from './function/statistics/prod.js'; +export { createFormat } from './function/string/format.js'; +export { createBin } from './function/string/bin.js'; +export { createOct } from './function/string/oct.js'; +export { createHex } from './function/string/hex.js'; +export { createPrint } from './function/string/print.js'; +export { createTo } from './function/unit/to.js'; +export { createIsPrime } from './function/utils/isPrime.js'; +export { createNumeric } from './function/utils/numeric.js'; +export { createDivideScalar } from './function/arithmetic/divideScalar.js'; +export { createPow } from './function/arithmetic/pow.js'; +export { createRound } from './function/arithmetic/round.js'; +export { createLog } from './function/arithmetic/log.js'; +export { createLog1p } from './function/arithmetic/log1p.js'; +export { createNthRoots } from './function/arithmetic/nthRoots.js'; +export { createDotPow } from './function/arithmetic/dotPow.js'; +export { createDotDivide } from './function/arithmetic/dotDivide.js'; +export { createLsolve } from './function/algebra/solver/lsolve.js'; +export { createUsolve } from './function/algebra/solver/usolve.js'; +export { createLsolveAll } from './function/algebra/solver/lsolveAll.js'; +export { createUsolveAll } from './function/algebra/solver/usolveAll.js'; +export { createLeftShift } from './function/bitwise/leftShift.js'; +export { createRightArithShift } from './function/bitwise/rightArithShift.js'; +export { createRightLogShift } from './function/bitwise/rightLogShift.js'; +export { createAnd } from './function/logical/and.js'; +export { createCompare } from './function/relational/compare.js'; +export { createCompareNatural } from './function/relational/compareNatural.js'; +export { createCompareText } from './function/relational/compareText.js'; +export { createEqual } from './function/relational/equal.js'; +export { createEqualText } from './function/relational/equalText.js'; +export { createSmaller } from './function/relational/smaller.js'; +export { createSmallerEq } from './function/relational/smallerEq.js'; +export { createLarger } from './function/relational/larger.js'; +export { createLargerEq } from './function/relational/largerEq.js'; +export { createDeepEqual } from './function/relational/deepEqual.js'; +export { createUnequal } from './function/relational/unequal.js'; +export { createPartitionSelect } from './function/matrix/partitionSelect.js'; +export { createSort } from './function/matrix/sort.js'; +export { createMax } from './function/statistics/max.js'; +export { createMin } from './function/statistics/min.js'; +export { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js'; +export { createIndexClass } from './type/matrix/MatrixIndex.js'; +export { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js'; +export { createSpaClass } from './type/matrix/Spa.js'; +export { createUnitClass } from './type/unit/Unit.js'; +export { createUnitFunction } from './type/unit/function/unit.js'; +export { createSparse } from './type/matrix/function/sparse.js'; +export { createCreateUnit } from './type/unit/function/createUnit.js'; +export { createAcos } from './function/trigonometry/acos.js'; +export { createAcosh } from './function/trigonometry/acosh.js'; +export { createAcot } from './function/trigonometry/acot.js'; +export { createAcoth } from './function/trigonometry/acoth.js'; +export { createAcsc } from './function/trigonometry/acsc.js'; +export { createAcsch } from './function/trigonometry/acsch.js'; +export { createAsec } from './function/trigonometry/asec.js'; +export { createAsech } from './function/trigonometry/asech.js'; +export { createAsin } from './function/trigonometry/asin.js'; +export { createAsinh } from './function/trigonometry/asinh.js'; +export { createAtan } from './function/trigonometry/atan.js'; +export { createAtan2 } from './function/trigonometry/atan2.js'; +export { createAtanh } from './function/trigonometry/atanh.js'; +export { createCos } from './function/trigonometry/cos.js'; +export { createCosh } from './function/trigonometry/cosh.js'; +export { createCot } from './function/trigonometry/cot.js'; +export { createCoth } from './function/trigonometry/coth.js'; +export { createCsc } from './function/trigonometry/csc.js'; +export { createCsch } from './function/trigonometry/csch.js'; +export { createSec } from './function/trigonometry/sec.js'; +export { createSech } from './function/trigonometry/sech.js'; +export { createSin } from './function/trigonometry/sin.js'; +export { createSinh } from './function/trigonometry/sinh.js'; +export { createTan } from './function/trigonometry/tan.js'; +export { createTanh } from './function/trigonometry/tanh.js'; +export { createSetCartesian } from './function/set/setCartesian.js'; +export { createSetDifference } from './function/set/setDifference.js'; +export { createSetDistinct } from './function/set/setDistinct.js'; +export { createSetIntersect } from './function/set/setIntersect.js'; +export { createSetIsSubset } from './function/set/setIsSubset.js'; +export { createSetMultiplicity } from './function/set/setMultiplicity.js'; +export { createSetPowerset } from './function/set/setPowerset.js'; +export { createSetSize } from './function/set/setSize.js'; +export { createSetSymDifference } from './function/set/setSymDifference.js'; +export { createSetUnion } from './function/set/setUnion.js'; +export { createAdd } from './function/arithmetic/add.js'; +export { createHypot } from './function/arithmetic/hypot.js'; +export { createNorm } from './function/arithmetic/norm.js'; +export { createDot } from './function/matrix/dot.js'; +export { createTrace } from './function/matrix/trace.js'; +export { createIndex } from './type/matrix/function/index.js'; +export { createNode } from './expression/node/Node.js'; +export { createAccessorNode } from './expression/node/AccessorNode.js'; +export { createArrayNode } from './expression/node/ArrayNode.js'; +export { createAssignmentNode } from './expression/node/AssignmentNode.js'; +export { createBlockNode } from './expression/node/BlockNode.js'; +export { createConditionalNode } from './expression/node/ConditionalNode.js'; +export { createConstantNode } from './expression/node/ConstantNode.js'; +export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js'; +export { createIndexNode } from './expression/node/IndexNode.js'; +export { createObjectNode } from './expression/node/ObjectNode.js'; +export { createOperatorNode } from './expression/node/OperatorNode.js'; +export { createParenthesisNode } from './expression/node/ParenthesisNode.js'; +export { createRangeNode } from './expression/node/RangeNode.js'; +export { createRelationalNode } from './expression/node/RelationalNode.js'; +export { createSymbolNode } from './expression/node/SymbolNode.js'; +export { createFunctionNode } from './expression/node/FunctionNode.js'; +export { createParse } from './expression/parse.js'; +export { createCompile } from './expression/function/compile.js'; +export { createEvaluate } from './expression/function/evaluate.js'; +export { createParserClass } from './expression/Parser.js'; +export { createParser } from './expression/function/parser.js'; +export { createLup } from './function/algebra/decomposition/lup.js'; +export { createQr } from './function/algebra/decomposition/qr.js'; +export { createSlu } from './function/algebra/decomposition/slu.js'; +export { createLusolve } from './function/algebra/solver/lusolve.js'; +export { createPolynomialRoot } from './function/algebra/polynomialRoot.js'; +export { createHelpClass } from './expression/Help.js'; +export { createChainClass } from './type/chain/Chain.js'; +export { createHelp } from './expression/function/help.js'; +export { createChain } from './type/chain/function/chain.js'; +export { createDet } from './function/matrix/det.js'; +export { createInv } from './function/matrix/inv.js'; +export { createPinv } from './function/matrix/pinv.js'; +export { createEigs } from './function/matrix/eigs.js'; +export { createExpm } from './function/matrix/expm.js'; +export { createSqrtm } from './function/matrix/sqrtm.js'; +export { createSylvester } from './function/algebra/sylvester.js'; +export { createSchur } from './function/algebra/decomposition/schur.js'; +export { createLyap } from './function/algebra/lyap.js'; +export { createDivide } from './function/arithmetic/divide.js'; +export { createDistance } from './function/geometry/distance.js'; +export { createIntersect } from './function/geometry/intersect.js'; +export { createSum } from './function/statistics/sum.js'; +export { createCumSum } from './function/statistics/cumsum.js'; +export { createMean } from './function/statistics/mean.js'; +export { createMedian } from './function/statistics/median.js'; +export { createMad } from './function/statistics/mad.js'; +export { createVariance } from './function/statistics/variance.js'; +export { createQuantileSeq } from './function/statistics/quantileSeq.js'; +export { createStd } from './function/statistics/std.js'; +export { createCorr } from './function/statistics/corr.js'; +export { createCombinations } from './function/probability/combinations.js'; +export { createCombinationsWithRep } from './function/probability/combinationsWithRep.js'; +export { createGamma } from './function/probability/gamma.js'; +export { createLgamma } from './function/probability/lgamma.js'; +export { createFactorial } from './function/probability/factorial.js'; +export { createKldivergence } from './function/probability/kldivergence.js'; +export { createMultinomial } from './function/probability/multinomial.js'; +export { createPermutations } from './function/probability/permutations.js'; +export { createPickRandom } from './function/probability/pickRandom.js'; +export { createRandom } from './function/probability/random.js'; +export { createRandomInt } from './function/probability/randomInt.js'; +export { createStirlingS2 } from './function/combinatorics/stirlingS2.js'; +export { createBellNumbers } from './function/combinatorics/bellNumbers.js'; +export { createCatalan } from './function/combinatorics/catalan.js'; +export { createComposition } from './function/combinatorics/composition.js'; +export { createLeafCount } from './function/algebra/leafCount.js'; +export { createSimplify } from './function/algebra/simplify.js'; +export { createSimplifyConstant } from './function/algebra/simplifyConstant.js'; +export { createSimplifyCore } from './function/algebra/simplifyCore.js'; +export { createResolve } from './function/algebra/resolve.js'; +export { createSymbolicEqual } from './function/algebra/symbolicEqual.js'; +export { createDerivative } from './function/algebra/derivative.js'; +export { createRationalize } from './function/algebra/rationalize.js'; +export { createZpk2tf } from './function/signal/zpk2tf.js'; +export { createFreqz } from './function/signal/freqz.js'; +export { createReviver } from './json/reviver.js'; +export { createReplacer } from './json/replacer.js'; +export { createE, createUppercaseE, createFalse, createI, createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2, +// eslint-disable-line camelcase +createSQRT2, createTau, createTrue, createVersion } from './constants.js'; +export { createAtomicMass, createAvogadro, createBohrMagneton, createBohrRadius, createBoltzmann, createClassicalElectronRadius, createConductanceQuantum, createCoulomb, createDeuteronMass, createEfimovFactor, createElectricConstant, createElectronMass, createElementaryCharge, createFaraday, createFermiCoupling, createFineStructure, createFirstRadiation, createGasConstant, createGravitationConstant, createGravity, createHartreeEnergy, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMagneticFluxQuantum, createMolarMass, createMolarMassC12, createMolarPlanckConstant, createMolarVolume, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckConstant, createPlanckLength, createPlanckMass, createPlanckTemperature, createPlanckTime, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSackurTetrode, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVacuumImpedance, createWeakMixingAngle, createWienDisplacement } from './type/unit/physicalConstants.js'; +export { createApplyTransform } from './expression/transform/apply.transform.js'; +export { createColumnTransform } from './expression/transform/column.transform.js'; +export { createFilterTransform } from './expression/transform/filter.transform.js'; +export { createForEachTransform } from './expression/transform/forEach.transform.js'; +export { createIndexTransform } from './expression/transform/index.transform.js'; +export { createMapTransform } from './expression/transform/map.transform.js'; +export { createMaxTransform } from './expression/transform/max.transform.js'; +export { createMeanTransform } from './expression/transform/mean.transform.js'; +export { createMinTransform } from './expression/transform/min.transform.js'; +export { createRangeTransform } from './expression/transform/range.transform.js'; +export { createRowTransform } from './expression/transform/row.transform.js'; +export { createSubsetTransform } from './expression/transform/subset.transform.js'; +export { createConcatTransform } from './expression/transform/concat.transform.js'; +export { createDiffTransform } from './expression/transform/diff.transform.js'; +export { createStdTransform } from './expression/transform/std.transform.js'; +export { createSumTransform } from './expression/transform/sum.transform.js'; +export { createQuantileSeqTransform } from './expression/transform/quantileSeq.transform.js'; +export { createCumSumTransform } from './expression/transform/cumsum.transform.js'; +export { createVarianceTransform } from './expression/transform/variance.transform.js'; +export { createPrintTransform } from './expression/transform/print.transform.js'; +export { createAndTransform } from './expression/transform/and.transform.js'; +export { createOrTransform } from './expression/transform/or.transform.js'; +export { createBitAndTransform } from './expression/transform/bitAnd.transform.js'; +export { createBitOrTransform } from './expression/transform/bitOr.transform.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesNumber.js new file mode 100644 index 0000000..8b81648 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/factoriesNumber.js @@ -0,0 +1,266 @@ +import { absNumber, acoshNumber, acosNumber, acothNumber, acotNumber, acschNumber, acscNumber, addNumber, andNumber, asechNumber, asecNumber, asinhNumber, asinNumber, atan2Number, atanhNumber, atanNumber, bitAndNumber, bitNotNumber, bitOrNumber, bitXorNumber, cbrtNumber, combinationsNumber, coshNumber, cosNumber, cothNumber, cotNumber, cschNumber, cscNumber, cubeNumber, divideNumber, expm1Number, expNumber, gammaNumber, gcdNumber, isIntegerNumber, isNaNNumber, isNegativeNumber, isPositiveNumber, isZeroNumber, lcmNumber, leftShiftNumber, lgammaNumber, log10Number, log1pNumber, log2Number, logNumber, modNumber, multiplyNumber, normNumber, notNumber, nthRootNumber, orNumber, powNumber, rightArithShiftNumber, rightLogShiftNumber, roundNumber, sechNumber, secNumber, signNumber, sinhNumber, sinNumber, sqrtNumber, squareNumber, subtractNumber, tanhNumber, tanNumber, unaryMinusNumber, unaryPlusNumber, xgcdNumber, xorNumber } from './plain/number/index.js'; +import { factory } from './utils/factory.js'; +import { noIndex, noMatrix, noSubset } from './utils/noop.js'; + +// ---------------------------------------------------------------------------- +// classes and functions + +// core +export { createTyped } from './core/function/typed.js'; + +// classes +export { createResultSet } from './type/resultset/ResultSet.js'; +export { createRangeClass } from './type/matrix/Range.js'; +export { createHelpClass } from './expression/Help.js'; +export { createChainClass } from './type/chain/Chain.js'; +export { createHelp } from './expression/function/help.js'; +export { createChain } from './type/chain/function/chain.js'; + +// algebra +export { createResolve } from './function/algebra/resolve.js'; +export { createSimplify } from './function/algebra/simplify.js'; +export { createSimplifyConstant } from './function/algebra/simplifyConstant.js'; +export { createSimplifyCore } from './function/algebra/simplifyCore.js'; +export { createDerivative } from './function/algebra/derivative.js'; +export { createRationalize } from './function/algebra/rationalize.js'; + +// arithmetic +export var createUnaryMinus = /* #__PURE__ */createNumberFactory('unaryMinus', unaryMinusNumber); +export var createUnaryPlus = /* #__PURE__ */createNumberFactory('unaryPlus', unaryPlusNumber); +export var createAbs = /* #__PURE__ */createNumberFactory('abs', absNumber); +export var createAddScalar = /* #__PURE__ */createNumberFactory('addScalar', addNumber); +export var createSubtractScalar = /* #__PURE__ */createNumberFactory('subtractScalar', subtractNumber); +export var createCbrt = /* #__PURE__ */createNumberFactory('cbrt', cbrtNumber); +export { createCeilNumber as createCeil } from './function/arithmetic/ceil.js'; +export var createCube = /* #__PURE__ */createNumberFactory('cube', cubeNumber); +export var createExp = /* #__PURE__ */createNumberFactory('exp', expNumber); +export var createExpm1 = /* #__PURE__ */createNumberFactory('expm1', expm1Number); +export { createFixNumber as createFix } from './function/arithmetic/fix.js'; +export { createFloorNumber as createFloor } from './function/arithmetic/floor.js'; +export var createGcd = /* #__PURE__ */createNumberFactory('gcd', gcdNumber); +export var createLcm = /* #__PURE__ */createNumberFactory('lcm', lcmNumber); +export var createLog10 = /* #__PURE__ */createNumberFactory('log10', log10Number); +export var createLog2 = /* #__PURE__ */createNumberFactory('log2', log2Number); +export var createMod = /* #__PURE__ */createNumberFactory('mod', modNumber); +export var createMultiplyScalar = /* #__PURE__ */createNumberFactory('multiplyScalar', multiplyNumber); +export var createMultiply = /* #__PURE__ */createNumberFactory('multiply', multiplyNumber); +export var createNthRoot = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('nthRoot', nthRootNumber); +export var createSign = /* #__PURE__ */createNumberFactory('sign', signNumber); +export var createSqrt = /* #__PURE__ */createNumberFactory('sqrt', sqrtNumber); +export var createSquare = /* #__PURE__ */createNumberFactory('square', squareNumber); +export var createSubtract = /* #__PURE__ */createNumberFactory('subtract', subtractNumber); +export var createXgcd = /* #__PURE__ */createNumberFactory('xgcd', xgcdNumber); +export var createDivideScalar = /* #__PURE__ */createNumberFactory('divideScalar', divideNumber); +export var createPow = /* #__PURE__ */createNumberFactory('pow', powNumber); +export var createRound = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('round', roundNumber); +export var createLog = /* #__PURE__ */ +createNumberOptionalSecondArgFactory('log', logNumber); +export var createLog1p = /* #__PURE__ */createNumberFactory('log1p', log1pNumber); +export var createAdd = /* #__PURE__ */createNumberFactory('add', addNumber); +export { createHypot } from './function/arithmetic/hypot.js'; +export var createNorm = /* #__PURE__ */createNumberFactory('norm', normNumber); +export var createDivide = /* #__PURE__ */createNumberFactory('divide', divideNumber); + +// bitwise +export var createBitAnd = /* #__PURE__ */createNumberFactory('bitAnd', bitAndNumber); +export var createBitNot = /* #__PURE__ */createNumberFactory('bitNot', bitNotNumber); +export var createBitOr = /* #__PURE__ */createNumberFactory('bitOr', bitOrNumber); +export var createBitXor = /* #__PURE__ */createNumberFactory('bitXor', bitXorNumber); +export var createLeftShift = /* #__PURE__ */createNumberFactory('leftShift', leftShiftNumber); +export var createRightArithShift = /* #__PURE__ */createNumberFactory('rightArithShift', rightArithShiftNumber); +export var createRightLogShift = /* #__PURE__ */createNumberFactory('rightLogShift', rightLogShiftNumber); + +// combinatorics +export { createStirlingS2 } from './function/combinatorics/stirlingS2.js'; +export { createBellNumbers } from './function/combinatorics/bellNumbers.js'; +export { createCatalan } from './function/combinatorics/catalan.js'; +export { createComposition } from './function/combinatorics/composition.js'; + +// constants +export { createE, createUppercaseE, createFalse, +// createI, +createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2, +// eslint-disable-line camelcase +createSQRT2, createTau, createTrue, createVersion } from './constants.js'; + +// create +export { createNumber } from './type/number.js'; +export { createBigint } from './type/bigint.js'; +export { createString } from './type/string.js'; +export { createBoolean } from './type/boolean.js'; +export { createParser } from './expression/function/parser.js'; + +// expression +export { createNode } from './expression/node/Node.js'; +export { createAccessorNode } from './expression/node/AccessorNode.js'; +export { createArrayNode } from './expression/node/ArrayNode.js'; +export { createAssignmentNode } from './expression/node/AssignmentNode.js'; +export { createBlockNode } from './expression/node/BlockNode.js'; +export { createConditionalNode } from './expression/node/ConditionalNode.js'; +export { createConstantNode } from './expression/node/ConstantNode.js'; +export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js'; +export { createIndexNode } from './expression/node/IndexNode.js'; +export { createObjectNode } from './expression/node/ObjectNode.js'; +export { createOperatorNode } from './expression/node/OperatorNode.js'; +export { createParenthesisNode } from './expression/node/ParenthesisNode.js'; +export { createRangeNode } from './expression/node/RangeNode.js'; +export { createRelationalNode } from './expression/node/RelationalNode.js'; +export { createSymbolNode } from './expression/node/SymbolNode.js'; +export { createFunctionNode } from './expression/node/FunctionNode.js'; +export { createParse } from './expression/parse.js'; +export { createCompile } from './expression/function/compile.js'; +export { createEvaluate } from './expression/function/evaluate.js'; +export { createParserClass } from './expression/Parser.js'; + +// logical +export var createAnd = /* #__PURE__ */createNumberFactory('and', andNumber); +export var createNot = /* #__PURE__ */createNumberFactory('not', notNumber); +export var createOr = /* #__PURE__ */createNumberFactory('or', orNumber); +export var createXor = /* #__PURE__ */createNumberFactory('xor', xorNumber); + +// matrix +export { createApply } from './function/matrix/apply.js'; +export { createFilter } from './function/matrix/filter.js'; +export { createForEach } from './function/matrix/forEach.js'; +export { createMap } from './function/matrix/map.js'; +export { createRange } from './function/matrix/range.js'; +export { createSize } from './function/matrix/size.js'; +// FIXME: create a lightweight "number" implementation of subset only supporting plain objects/arrays +export var createIndex = /* #__PURE__ */factory('index', [], () => noIndex); +export var createMatrix = /* #__PURE__ */factory('matrix', [], () => noMatrix); // FIXME: needed now because subset transform needs it. Remove the need for it in subset +export var createSubset = /* #__PURE__ */factory('subset', [], () => noSubset); +// TODO: provide number+array implementations for map, filter, forEach, zeros, ...? +// TODO: create range implementation for range? +export { createPartitionSelect } from './function/matrix/partitionSelect.js'; + +// probability +export var createCombinations = createNumberFactory('combinations', combinationsNumber); +export var createGamma = createNumberFactory('gamma', gammaNumber); +export var createLgamma = createNumberFactory('lgamma', lgammaNumber); +export { createCombinationsWithRep } from './function/probability/combinationsWithRep.js'; +export { createFactorial } from './function/probability/factorial.js'; +export { createMultinomial } from './function/probability/multinomial.js'; +export { createPermutations } from './function/probability/permutations.js'; +export { createPickRandom } from './function/probability/pickRandom.js'; +export { createRandomNumber as createRandom } from './function/probability/random.js'; +export { createRandomInt } from './function/probability/randomInt.js'; + +// relational +export { createEqualScalarNumber as createEqualScalar } from './function/relational/equalScalar.js'; +export { createCompareNumber as createCompare } from './function/relational/compare.js'; +export { createCompareNatural } from './function/relational/compareNatural.js'; +export { createCompareTextNumber as createCompareText } from './function/relational/compareText.js'; +export { createEqualNumber as createEqual } from './function/relational/equal.js'; +export { createEqualText } from './function/relational/equalText.js'; +export { createSmallerNumber as createSmaller } from './function/relational/smaller.js'; +export { createSmallerEqNumber as createSmallerEq } from './function/relational/smallerEq.js'; +export { createLargerNumber as createLarger } from './function/relational/larger.js'; +export { createLargerEqNumber as createLargerEq } from './function/relational/largerEq.js'; +export { createDeepEqual } from './function/relational/deepEqual.js'; +export { createUnequalNumber as createUnequal } from './function/relational/unequal.js'; + +// special +export { createErf } from './function/special/erf.js'; +export { createZeta } from './function/special/zeta.js'; +// statistics +export { createMode } from './function/statistics/mode.js'; +export { createProd } from './function/statistics/prod.js'; +export { createMax } from './function/statistics/max.js'; +export { createMin } from './function/statistics/min.js'; +export { createSum } from './function/statistics/sum.js'; +export { createCumSum } from './function/statistics/cumsum.js'; +export { createMean } from './function/statistics/mean.js'; +export { createMedian } from './function/statistics/median.js'; +export { createMad } from './function/statistics/mad.js'; +export { createVariance } from './function/statistics/variance.js'; +export { createQuantileSeq } from './function/statistics/quantileSeq.js'; +export { createStd } from './function/statistics/std.js'; +export { createCorr } from './function/statistics/corr.js'; + +// string +export { createFormat } from './function/string/format.js'; +export { createPrint } from './function/string/print.js'; + +// trigonometry +export var createAcos = /* #__PURE__ */createNumberFactory('acos', acosNumber); +export var createAcosh = /* #__PURE__ */createNumberFactory('acosh', acoshNumber); +export var createAcot = /* #__PURE__ */createNumberFactory('acot', acotNumber); +export var createAcoth = /* #__PURE__ */createNumberFactory('acoth', acothNumber); +export var createAcsc = /* #__PURE__ */createNumberFactory('acsc', acscNumber); +export var createAcsch = /* #__PURE__ */createNumberFactory('acsch', acschNumber); +export var createAsec = /* #__PURE__ */createNumberFactory('asec', asecNumber); +export var createAsech = /* #__PURE__ */createNumberFactory('asech', asechNumber); +export var createAsin = /* #__PURE__ */createNumberFactory('asin', asinNumber); +export var createAsinh = /* #__PURE__ */createNumberFactory('asinh', asinhNumber); +export var createAtan = /* #__PURE__ */createNumberFactory('atan', atanNumber); +export var createAtan2 = /* #__PURE__ */createNumberFactory('atan2', atan2Number); +export var createAtanh = /* #__PURE__ */createNumberFactory('atanh', atanhNumber); +export var createCos = /* #__PURE__ */createNumberFactory('cos', cosNumber); +export var createCosh = /* #__PURE__ */createNumberFactory('cosh', coshNumber); +export var createCot = /* #__PURE__ */createNumberFactory('cot', cotNumber); +export var createCoth = /* #__PURE__ */createNumberFactory('coth', cothNumber); +export var createCsc = /* #__PURE__ */createNumberFactory('csc', cscNumber); +export var createCsch = /* #__PURE__ */createNumberFactory('csch', cschNumber); +export var createSec = /* #__PURE__ */createNumberFactory('sec', secNumber); +export var createSech = /* #__PURE__ */createNumberFactory('sech', sechNumber); +export var createSin = /* #__PURE__ */createNumberFactory('sin', sinNumber); +export var createSinh = /* #__PURE__ */createNumberFactory('sinh', sinhNumber); +export var createTan = /* #__PURE__ */createNumberFactory('tan', tanNumber); +export var createTanh = /* #__PURE__ */createNumberFactory('tanh', tanhNumber); + +// transforms +export { createApplyTransform } from './expression/transform/apply.transform.js'; +export { createFilterTransform } from './expression/transform/filter.transform.js'; +export { createForEachTransform } from './expression/transform/forEach.transform.js'; +export { createMapTransform } from './expression/transform/map.transform.js'; +export { createMaxTransform } from './expression/transform/max.transform.js'; +export { createMeanTransform } from './expression/transform/mean.transform.js'; +export { createMinTransform } from './expression/transform/min.transform.js'; +export { createRangeTransform } from './expression/transform/range.transform.js'; +export var createSubsetTransform = /* #__PURE__ */factory('subset', [], () => noSubset, { + isTransformFunction: true +}); +export { createStdTransform } from './expression/transform/std.transform.js'; +export { createSumTransform } from './expression/transform/sum.transform.js'; +export { createCumSumTransform } from './expression/transform/cumsum.transform.js'; +export { createVarianceTransform } from './expression/transform/variance.transform.js'; + +// utils +export { createClone } from './function/utils/clone.js'; +export var createIsInteger = /* #__PURE__ */createNumberFactory('isInteger', isIntegerNumber); +export var createIsNegative = /* #__PURE__ */createNumberFactory('isNegative', isNegativeNumber); +export { createIsNumeric } from './function/utils/isNumeric.js'; +export { createHasNumericValue } from './function/utils/hasNumericValue.js'; +export var createIsPositive = /* #__PURE__ */createNumberFactory('isPositive', isPositiveNumber); +export var createIsZero = /* #__PURE__ */createNumberFactory('isZero', isZeroNumber); +export var createIsNaN = /* #__PURE__ */createNumberFactory('isNaN', isNaNNumber); +export { createTypeOf } from './function/utils/typeOf.js'; +export { createIsPrime } from './function/utils/isPrime.js'; +export { createNumeric } from './function/utils/numeric.js'; + +// json +export { createReviver } from './json/reviver.js'; +export { createReplacer } from './json/replacer.js'; + +// helper functions to create a factory function for a function which only needs typed-function +function createNumberFactory(name, fn) { + return factory(name, ['typed'], _ref => { + var { + typed + } = _ref; + return typed(fn); + }); +} +function createNumberOptionalSecondArgFactory(name, fn) { + return factory(name, ['typed'], _ref2 => { + var { + typed + } = _ref2; + return typed({ + number: fn, + 'number,number': fn + }); + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js new file mode 100644 index 0000000..aa4c6b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js @@ -0,0 +1,379 @@ +import { clone } from '../../../utils/object.js'; +import { factory } from '../../../utils/factory.js'; +var name = 'lup'; +var dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa']; +export var createLup = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + abs, + addScalar, + divideScalar, + multiplyScalar, + subtractScalar, + larger, + equalScalar, + unaryMinus, + DenseMatrix, + SparseMatrix, + Spa + } = _ref; + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a + * row permutation vector `p` where `A[p,:] = L * U` + * + * Syntax: + * + * math.lup(A) + * + * Example: + * + * const m = [[2, 1], [1, 4]] + * const r = math.lup(m) + * // r = { + * // L: [[1, 0], [0.5, 1]], + * // U: [[2, 1], [0, 3.5]], + * // P: [0, 1] + * // } + * + * See also: + * + * slu, lsolve, lusolve, usolve + * + * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition. + * + * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix. + */ + return typed(name, { + DenseMatrix: function DenseMatrix(m) { + return _denseLUP(m); + }, + SparseMatrix: function SparseMatrix(m) { + return _sparseLUP(m); + }, + Array: function Array(a) { + // create dense matrix from array + var m = matrix(a); + // lup, use matrix implementation + var r = _denseLUP(m); + // result + return { + L: r.L.valueOf(), + U: r.U.valueOf(), + p: r.p + }; + } + }); + function _denseLUP(m) { + // rows & columns + var rows = m._size[0]; + var columns = m._size[1]; + // minimum rows and columns + var n = Math.min(rows, columns); + // matrix array, clone original data + var data = clone(m._data); + // l matrix arrays + var ldata = []; + var lsize = [rows, n]; + // u matrix arrays + var udata = []; + var usize = [n, columns]; + // vars + var i, j, k; + // permutation vector + var p = []; + for (i = 0; i < rows; i++) { + p[i] = i; + } + // loop columns + for (j = 0; j < columns; j++) { + // skip first column in upper triangular matrix + if (j > 0) { + // loop rows + for (i = 0; i < rows; i++) { + // min i,j + var min = Math.min(i, j); + // v[i, j] + var s = 0; + // loop up to min + for (k = 0; k < min; k++) { + // s = l[i, k] - data[k, j] + s = addScalar(s, multiplyScalar(data[i][k], data[k][j])); + } + data[i][j] = subtractScalar(data[i][j], s); + } + } + // row with larger value in cvector, row >= j + var pi = j; + var pabsv = 0; + var vjj = 0; + // loop rows + for (i = j; i < rows; i++) { + // data @ i, j + var v = data[i][j]; + // absolute value + var absv = abs(v); + // value is greater than pivote value + if (larger(absv, pabsv)) { + // store row + pi = i; + // update max value + pabsv = absv; + // value @ [j, j] + vjj = v; + } + } + // swap rows (j <-> pi) + if (j !== pi) { + // swap values j <-> pi in p + p[j] = [p[pi], p[pi] = p[j]][0]; + // swap j <-> pi in data + DenseMatrix._swapRows(j, pi, data); + } + // check column is in lower triangular matrix + if (j < rows) { + // loop rows (lower triangular matrix) + for (i = j + 1; i < rows; i++) { + // value @ i, j + var vij = data[i][j]; + if (!equalScalar(vij, 0)) { + // update data + data[i][j] = divideScalar(data[i][j], vjj); + } + } + } + } + // loop columns + for (j = 0; j < columns; j++) { + // loop rows + for (i = 0; i < rows; i++) { + // initialize row in arrays + if (j === 0) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i] = []; + } + // L + ldata[i] = []; + } + // check we are in the upper triangular matrix + if (i < j) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = data[i][j]; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = 0; + } + continue; + } + // diagonal value + if (i === j) { + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = data[i][j]; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = 1; + } + continue; + } + // check row exists in upper triangular matrix + if (i < columns) { + // U + udata[i][j] = 0; + } + // check column exists in lower triangular matrix + if (j < rows) { + // L + ldata[i][j] = data[i][j]; + } + } + } + // l matrix + var l = new DenseMatrix({ + data: ldata, + size: lsize + }); + // u matrix + var u = new DenseMatrix({ + data: udata, + size: usize + }); + // p vector + var pv = []; + for (i = 0, n = p.length; i < n; i++) { + pv[p[i]] = i; + } + // return matrices + return { + L: l, + U: u, + p: pv, + toString: function toString() { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\nP: ' + this.p; + } + }; + } + function _sparseLUP(m) { + // rows & columns + var rows = m._size[0]; + var columns = m._size[1]; + // minimum rows and columns + var n = Math.min(rows, columns); + // matrix arrays (will not be modified, thanks to permutation vector) + var values = m._values; + var index = m._index; + var ptr = m._ptr; + // l matrix arrays + var lvalues = []; + var lindex = []; + var lptr = []; + var lsize = [rows, n]; + // u matrix arrays + var uvalues = []; + var uindex = []; + var uptr = []; + var usize = [n, columns]; + // vars + var i, j, k; + // permutation vectors, (current index -> original index) and (original index -> current index) + var pvCo = []; + var pvOc = []; + for (i = 0; i < rows; i++) { + pvCo[i] = i; + pvOc[i] = i; + } + // swap indices in permutation vectors (condition x < y)! + var swapIndeces = function swapIndeces(x, y) { + // find pv indeces getting data from x and y + var kx = pvOc[x]; + var ky = pvOc[y]; + // update permutation vector current -> original + pvCo[kx] = y; + pvCo[ky] = x; + // update permutation vector original -> current + pvOc[x] = ky; + pvOc[y] = kx; + }; + // loop columns + var _loop = function _loop() { + // sparse accumulator + var spa = new Spa(); + // check lower triangular matrix has a value @ column j + if (j < rows) { + // update ptr + lptr.push(lvalues.length); + // first value in j column for lower triangular matrix + lvalues.push(1); + lindex.push(j); + } + // update ptr + uptr.push(uvalues.length); + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = ptr[j]; + var k1 = ptr[j + 1]; + // copy column j into sparse accumulator + for (k = k0; k < k1; k++) { + // row + i = index[k]; + // copy column values into sparse accumulator (use permutation vector) + spa.set(pvCo[i], values[k]); + } + // skip first column in upper triangular matrix + if (j > 0) { + // loop rows in column j (above diagonal) + spa.forEach(0, j - 1, function (k, vkj) { + // loop rows in column k (L) + SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) { + // check row is below k + if (i > k) { + // update spa value + spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj))); + } + }); + }); + } + // row with larger value in spa, row >= j + var pi = j; + var vjj = spa.get(j); + var pabsv = abs(vjj); + // loop values in spa (order by row, below diagonal) + spa.forEach(j + 1, rows - 1, function (x, v) { + // absolute value + var absv = abs(v); + // value is greater than pivote value + if (larger(absv, pabsv)) { + // store row + pi = x; + // update max value + pabsv = absv; + // value @ [j, j] + vjj = v; + } + }); + // swap rows (j <-> pi) + if (j !== pi) { + // swap values j <-> pi in L + SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr); + // swap values j <-> pi in U + SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr); + // swap values in spa + spa.swap(j, pi); + // update permutation vector (swap values @ j, pi) + swapIndeces(j, pi); + } + // loop values in spa (order by row) + spa.forEach(0, rows - 1, function (x, v) { + // check we are above diagonal + if (x <= j) { + // update upper triangular matrix + uvalues.push(v); + uindex.push(x); + } else { + // update value + v = divideScalar(v, vjj); + // check value is non zero + if (!equalScalar(v, 0)) { + // update lower triangular matrix + lvalues.push(v); + lindex.push(x); + } + } + }); + }; + for (j = 0; j < columns; j++) { + _loop(); + } + // update ptrs + uptr.push(uvalues.length); + lptr.push(lvalues.length); + + // return matrices + return { + L: new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: lsize + }), + U: new SparseMatrix({ + values: uvalues, + index: uindex, + ptr: uptr, + size: usize + }), + p: pvCo, + toString: function toString() { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\nP: ' + this.p; + } + }; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js new file mode 100644 index 0000000..ad79a33 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js @@ -0,0 +1,222 @@ +import _extends from "@babel/runtime/helpers/extends"; +import { factory } from '../../../utils/factory.js'; +var name = 'qr'; +var dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex']; +export var createQr = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + zeros, + identity, + isZero, + equal, + sign, + sqrt, + conj, + unaryMinus, + addScalar, + divideScalar, + multiplyScalar, + subtractScalar, + complex + } = _ref; + /** + * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in + * two matrices (`Q`, `R`) where `Q` is an + * orthogonal matrix and `R` is an upper triangular matrix. + * + * Syntax: + * + * math.qr(A) + * + * Example: + * + * const m = [ + * [1, -1, 4], + * [1, 4, -2], + * [1, 4, 2], + * [1, -1, 0] + * ] + * const result = math.qr(m) + * // r = { + * // Q: [ + * // [0.5, -0.5, 0.5], + * // [0.5, 0.5, -0.5], + * // [0.5, 0.5, 0.5], + * // [0.5, -0.5, -0.5], + * // ], + * // R: [ + * // [2, 3, 2], + * // [0, 5, -2], + * // [0, 0, 4], + * // [0, 0, 0] + * // ] + * // } + * + * See also: + * + * lup, lusolve + * + * @param {Matrix | Array} A A two dimensional matrix or array + * for which to get the QR decomposition. + * + * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal + * matrix and R: the upper triangular matrix + */ + return _extends(typed(name, { + DenseMatrix: function DenseMatrix(m) { + return _denseQR(m); + }, + SparseMatrix: function SparseMatrix(m) { + return _sparseQR(m); + }, + Array: function Array(a) { + // create dense matrix from array + var m = matrix(a); + // lup, use matrix implementation + var r = _denseQR(m); + // result + return { + Q: r.Q.valueOf(), + R: r.R.valueOf() + }; + } + }), { + _denseQRimpl + }); + function _denseQRimpl(m) { + // rows & columns (m x n) + var rows = m._size[0]; // m + var cols = m._size[1]; // n + + var Q = identity([rows], 'dense'); + var Qdata = Q._data; + var R = m.clone(); + var Rdata = R._data; + + // vars + var i, j, k; + var w = zeros([rows], ''); + for (k = 0; k < Math.min(cols, rows); ++k) { + /* + * **k-th Household matrix** + * + * The matrix I - 2*v*transpose(v) + * x = first column of A + * x1 = first element of x + * alpha = x1 / |x1| * |x| + * e1 = tranpose([1, 0, 0, ...]) + * u = x - alpha * e1 + * v = u / |u| + * + * Household matrix = I - 2 * v * tranpose(v) + * + * * Initially Q = I and R = A. + * * Household matrix is a reflection in a plane normal to v which + * will zero out all but the top right element in R. + * * Appplying reflection to both Q and R will not change product. + * * Repeat this process on the (1,1) minor to get R as an upper + * triangular matrix. + * * Reflections leave the magnitude of the columns of Q unchanged + * so Q remains othoganal. + * + */ + + var pivot = Rdata[k][k]; + var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot)); + var conjSgn = conj(sgn); + var alphaSquared = 0; + for (i = k; i < rows; i++) { + alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k]))); + } + var alpha = multiplyScalar(sgn, sqrt(alphaSquared)); + if (!isZero(alpha)) { + // first element in vector u + var u1 = subtractScalar(pivot, alpha); + + // w = v * u1 / |u| (only elements k to (rows-1) are used) + w[k] = 1; + for (i = k + 1; i < rows; i++) { + w[i] = divideScalar(Rdata[i][k], u1); + } + + // tau = - conj(u1 / alpha) + var tau = unaryMinus(conj(divideScalar(u1, alpha))); + var s = void 0; + + /* + * tau and w have been choosen so that + * + * 2 * v * tranpose(v) = tau * w * tranpose(w) + */ + + /* + * -- calculate R = R - tau * w * tranpose(w) * R -- + * Only do calculation with rows k to (rows-1) + * Additionally columns 0 to (k-1) will not be changed by this + * multiplication so do not bother recalculating them + */ + for (j = k; j < cols; j++) { + s = 0.0; + + // calculate jth element of [tranpose(w) * R] + for (i = k; i < rows; i++) { + s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j])); + } + + // calculate the jth element of [tau * transpose(w) * R] + s = multiplyScalar(s, tau); + for (i = k; i < rows; i++) { + Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn); + } + } + /* + * -- calculate Q = Q - tau * Q * w * transpose(w) -- + * Q is a square matrix (rows x rows) + * Only do calculation with columns k to (rows-1) + * Additionally rows 0 to (k-1) will not be changed by this + * multiplication so do not bother recalculating them + */ + for (i = 0; i < rows; i++) { + s = 0.0; + + // calculate ith element of [Q * w] + for (j = k; j < rows; j++) { + s = addScalar(s, multiplyScalar(Qdata[i][j], w[j])); + } + + // calculate the ith element of [tau * Q * w] + s = multiplyScalar(s, tau); + for (j = k; j < rows; ++j) { + Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn); + } + } + } + } + + // return matrices + return { + Q, + R, + toString: function toString() { + return 'Q: ' + this.Q.toString() + '\nR: ' + this.R.toString(); + } + }; + } + function _denseQR(m) { + var ret = _denseQRimpl(m); + var Rdata = ret.R._data; + if (m._data.length > 0) { + var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0; + for (var i = 0; i < Rdata.length; ++i) { + for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) { + Rdata[i][j] = zero; + } + } + } + return ret; + } + function _sparseQR(m) { + throw new Error('qr not implemented for sparse matrices yet'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js new file mode 100644 index 0000000..a3ee46f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js @@ -0,0 +1,70 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'schur'; +var dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract']; +export var createSchur = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + identity, + multiply, + qr, + norm, + subtract + } = _ref; + /** + * + * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal + * and T is upper quasi-triangular. + * https://en.wikipedia.org/wiki/Schur_decomposition + * + * Syntax: + * + * math.schur(A) + * + * Examples: + * + * const A = [[1, 0], [-4, 3]] + * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]} + * + * See also: + * + * sylvester, lyap, qr + * + * @param {Array | Matrix} A Matrix A + * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU' + */ + return typed(name, { + Array: function Array(X) { + var r = _schur(matrix(X)); + return { + U: r.U.valueOf(), + T: r.T.valueOf() + }; + }, + Matrix: function Matrix(X) { + return _schur(X); + } + }); + function _schur(X) { + var n = X.size()[0]; + var A = X; + var U = identity(n); + var k = 0; + var A0; + do { + A0 = A; + var QR = qr(A); + var Q = QR.Q; + var R = QR.R; + A = multiply(R, Q); + U = multiply(U, Q); + if (k++ > 100) { + break; + } + } while (norm(subtract(A, A0)) > 1e-4); + return { + U, + T: A + }; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js new file mode 100644 index 0000000..13f07f9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js @@ -0,0 +1,101 @@ +import { isInteger } from '../../../utils/number.js'; +import { factory } from '../../../utils/factory.js'; +import { createCsSqr } from '../sparse/csSqr.js'; +import { createCsLu } from '../sparse/csLu.js'; +var name = 'slu'; +var dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix']; +export var createSlu = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + add, + multiply, + transpose, + divideScalar, + subtract, + larger, + largerEq, + SparseMatrix + } = _ref; + var csSqr = createCsSqr({ + add, + multiply, + transpose + }); + var csLu = createCsLu({ + abs, + divideScalar, + multiply, + subtract, + larger, + largerEq, + SparseMatrix + }); + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where + * + * `P * A * Q = L * U` + * + * Syntax: + * + * math.slu(A, order, threshold) + * + * Examples: + * + * const A = math.sparse([[4,3], [6, 3]]) + * math.slu(A, 1, 0.001) + * // returns: + * // { + * // L: [[1, 0], [1.5, 1]] + * // U: [[4, 3], [0, -1.5]] + * // p: [0, 1] + * // q: [0, 1] + * // } + * + * See also: + * + * lup, lsolve, usolve, lusolve + * + * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition. + * @param {Number} order The Symbolic Ordering and Analysis order: + * 0 - Natural ordering, no permutation vector q is returned + * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' + * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. + * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. + * A dense row is a row with more than 10*sqr(columns) entries. + * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting) + * + * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors. + */ + return typed(name, { + 'SparseMatrix, number, number': function SparseMatrix_number_number(a, order, threshold) { + // verify order + if (!isInteger(order) || order < 0 || order > 3) { + throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]'); + } + // verify threshold + if (threshold < 0 || threshold > 1) { + throw new Error('Partial pivoting threshold must be a number from 0 to 1'); + } + + // perform symbolic ordering and analysis + var s = csSqr(order, a, false); + + // perform lu decomposition + var f = csLu(a, s, threshold); + + // return decomposition + return { + L: f.L, + U: f.U, + p: f.pinv, + q: s.q, + toString: function toString() { + return 'L: ' + this.L.toString() + '\nU: ' + this.U.toString() + '\np: ' + this.p.toString() + (this.q ? '\nq: ' + this.q.toString() : '') + '\n'; + } + }; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/derivative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/derivative.js new file mode 100644 index 0000000..6291d6d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/derivative.js @@ -0,0 +1,519 @@ +import { isConstantNode, typeOf } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +var name = 'derivative'; +var dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +export var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + parse, + simplify, + equal, + isZero, + numeric, + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + /** + * Takes the derivative of an expression expressed in parser Nodes. + * The derivative will be taken over the supplied variable in the + * second parameter. If there are multiple variables in the expression, + * it will return a partial derivative. + * + * This uses rules of differentiation which can be found here: + * + * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules) + * + * Syntax: + * + * math.derivative(expr, variable) + * math.derivative(expr, variable, options) + * + * Examples: + * + * math.derivative('x^2', 'x') // Node '2 * x' + * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)' + * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)' + * math.derivative('2*x', 'x').evaluate() // number 2 + * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8 + * const f = math.parse('x^2') + * const x = math.parse('x') + * math.derivative(f, x) // Node {2 * x} + * + * See also: + * + * simplify, parse, evaluate + * + * @param {Node | string} expr The expression to differentiate + * @param {SymbolNode | string} variable The variable over which to differentiate + * @param {{simplify: boolean}} [options] + * There is one option available, `simplify`, which + * is true by default. When false, output will not + * be simplified. + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` + */ + function plainDerivative(expr, variable) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { + simplify: true + }; + var constNodes = {}; + constTag(constNodes, expr, variable.name); + var res = _derivative(expr, constNodes); + return options.simplify ? simplify(res) : res; + } + function parseIdentifier(string) { + var symbol = parse(string); + if (!symbol.isSymbolNode) { + throw new TypeError('Invalid variable. ' + "Cannot parse ".concat(JSON.stringify(string), " into a variable in function derivative")); + } + return symbol; + } + var derivative = typed(name, { + 'Node, SymbolNode': plainDerivative, + 'Node, SymbolNode, Object': plainDerivative, + 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)), + 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options) + + /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number} + 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) { + let res = expr + for (let i = 0; i < order; i++) { + let constNodes = {} + constTag(constNodes, expr, variable.name) + res = _derivative(res, constNodes) + } + return res + } + */ + }); + derivative._simplify = true; + derivative.toTex = function (deriv) { + return _derivTex.apply(null, deriv.args); + }; + + // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse. + // NOTE: the optional "order" parameter here is currently unused + var _derivTex = typed('_derivTex', { + 'Node, SymbolNode': function Node_SymbolNode(expr, x) { + if (isConstantNode(expr) && typeOf(expr.value) === 'string') { + return _derivTex(parse(expr.value).toString(), x.toString(), 1); + } else { + return _derivTex(expr.toTex(), x.toString(), 1); + } + }, + 'Node, ConstantNode': function Node_ConstantNode(expr, x) { + if (typeOf(x.value) === 'string') { + return _derivTex(expr, parse(x.value)); + } else { + throw new Error("The second parameter to 'derivative' is a non-string constant"); + } + }, + 'Node, SymbolNode, ConstantNode': function Node_SymbolNode_ConstantNode(expr, x, order) { + return _derivTex(expr.toString(), x.name, order.value); + }, + 'string, string, number': function string_string_number(expr, x, order) { + var d; + if (order === 1) { + d = '{d\\over d' + x + '}'; + } else { + d = '{d^{' + order + '}\\over d' + x + '^{' + order + '}}'; + } + return d + "\\left[".concat(expr, "\\right]"); + } + }); + + /** + * Does a depth-first search on the expression tree to identify what Nodes + * are constants (e.g. 2 + 2), and stores the ones that are constants in + * constNodes. Classification is done as follows: + * + * 1. ConstantNodes are constants. + * 2. If there exists a SymbolNode, of which we are differentiating over, + * in the subtree it is not constant. + * + * @param {Object} constNodes Holds the nodes that are constant + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {string} varName Variable that we are differentiating + * @return {boolean} if node is constant + */ + // TODO: can we rewrite constTag into a pure function? + var constTag = typed('constTag', { + 'Object, ConstantNode, string': function Object_ConstantNode_string(constNodes, node) { + constNodes[node] = true; + return true; + }, + 'Object, SymbolNode, string': function Object_SymbolNode_string(constNodes, node, varName) { + // Treat other variables like constants. For reasoning, see: + // https://en.wikipedia.org/wiki/Partial_derivative + if (node.name !== varName) { + constNodes[node] = true; + return true; + } + return false; + }, + 'Object, ParenthesisNode, string': function Object_ParenthesisNode_string(constNodes, node, varName) { + return constTag(constNodes, node.content, varName); + }, + 'Object, FunctionAssignmentNode, string': function Object_FunctionAssignmentNode_string(constNodes, node, varName) { + if (!node.params.includes(varName)) { + constNodes[node] = true; + return true; + } + return constTag(constNodes, node.expr, varName); + }, + 'Object, FunctionNode | OperatorNode, string': function Object_FunctionNode__OperatorNode_string(constNodes, node, varName) { + if (node.args.length > 0) { + var isConst = constTag(constNodes, node.args[0], varName); + for (var i = 1; i < node.args.length; ++i) { + isConst = constTag(constNodes, node.args[i], varName) && isConst; + } + if (isConst) { + constNodes[node] = true; + return true; + } + } + return false; + } + }); + + /** + * Applies differentiation rules. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object} constNodes Holds the nodes that are constant + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` + */ + var _derivative = typed('_derivative', { + 'ConstantNode, Object': function ConstantNode_Object(node) { + return createConstantNode(0); + }, + 'SymbolNode, Object': function SymbolNode_Object(node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + return createConstantNode(1); + }, + 'ParenthesisNode, Object': function ParenthesisNode_Object(node, constNodes) { + return new ParenthesisNode(_derivative(node.content, constNodes)); + }, + 'FunctionAssignmentNode, Object': function FunctionAssignmentNode_Object(node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + return _derivative(node.expr, constNodes); + }, + 'FunctionNode, Object': function FunctionNode_Object(node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + var arg0 = node.args[0]; + var arg1; + var div = false; // is output a fraction? + var negative = false; // is output negative? + + var funcDerivative; + switch (node.name) { + case 'cbrt': + // d/dx(cbrt(x)) = 1 / (3x^(2/3)) + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]); + break; + case 'sqrt': + case 'nthRoot': + // d/dx(sqrt(x)) = 1 / (2*sqrt(x)) + if (node.args.length === 1) { + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]); + } else if (node.args.length === 2) { + // Rearrange from nthRoot(x, a) -> x^(1/a) + arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]); + + // Is a variable? + constNodes[arg1] = constNodes[node.args[1]]; + return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes); + } + break; + case 'log10': + arg1 = createConstantNode(10); + /* fall through! */ + case 'log': + if (!arg1 && node.args.length === 1) { + // d/dx(log(x)) = 1 / x + funcDerivative = arg0.clone(); + div = true; + } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) { + // d/dx(log(x, c)) = 1 / (x*ln(c)) + funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]); + div = true; + } else if (node.args.length === 2) { + // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x))) + return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes); + } + break; + case 'pow': + if (node.args.length === 2) { + constNodes[arg1] = constNodes[node.args[1]]; + // Pass to pow operator node parser + return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes); + } + break; + case 'exp': + // d/dx(e^x) = e^x + funcDerivative = new FunctionNode('exp', [arg0.clone()]); + break; + case 'sin': + // d/dx(sin(x)) = cos(x) + funcDerivative = new FunctionNode('cos', [arg0.clone()]); + break; + case 'cos': + // d/dx(cos(x)) = -sin(x) + funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]); + break; + case 'tan': + // d/dx(tan(x)) = sec(x)^2 + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]); + break; + case 'sec': + // d/dx(sec(x)) = sec(x)tan(x) + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]); + break; + case 'csc': + // d/dx(csc(x)) = -csc(x)cot(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]); + break; + case 'cot': + // d/dx(cot(x)) = -csc(x)^2 + negative = true; + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]); + break; + case 'asin': + // d/dx(asin(x)) = 1 / sqrt(1 - x^2) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]); + break; + case 'acos': + // d/dx(acos(x)) = -1 / sqrt(1 - x^2) + div = true; + negative = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]); + break; + case 'atan': + // d/dx(atan(x)) = 1 / (x^2 + 1) + div = true; + funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]); + break; + case 'asec': + // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1)) + div = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acsc': + // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acot': + // d/dx(acot(x)) = -1 / (x^2 + 1) + div = true; + negative = true; + funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]); + break; + case 'sinh': + // d/dx(sinh(x)) = cosh(x) + funcDerivative = new FunctionNode('cosh', [arg0.clone()]); + break; + case 'cosh': + // d/dx(cosh(x)) = sinh(x) + funcDerivative = new FunctionNode('sinh', [arg0.clone()]); + break; + case 'tanh': + // d/dx(tanh(x)) = sech(x)^2 + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]); + break; + case 'sech': + // d/dx(sech(x)) = -sech(x)tanh(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]); + break; + case 'csch': + // d/dx(csch(x)) = -csch(x)coth(x) + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]); + break; + case 'coth': + // d/dx(coth(x)) = -csch(x)^2 + negative = true; + funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]); + break; + case 'asinh': + // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]); + break; + case 'acosh': + // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum) + div = true; + funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]); + break; + case 'atanh': + // d/dx(atanh(x)) = 1 / (1 - x^2) + div = true; + funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]); + break; + case 'asech': + // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]); + break; + case 'acsch': + // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1)) + div = true; + negative = true; + funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]); + break; + case 'acoth': + // d/dx(acoth(x)) = -1 / (1 - x^2) + div = true; + negative = true; + funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]); + break; + case 'abs': + // d/dx(abs(x)) = abs(x)/x + funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]); + break; + case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x) + default: + throw new Error('Cannot process function "' + node.name + '" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported'); + } + var op, func; + if (div) { + op = '/'; + func = 'divide'; + } else { + op = '*'; + func = 'multiply'; + } + + /* Apply chain rule to all functions: + F(x) = f(g(x)) + F'(x) = g'(x)*f'(g(x)) */ + var chainDerivative = _derivative(arg0, constNodes); + if (negative) { + chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]); + } + return new OperatorNode(op, func, [chainDerivative, funcDerivative]); + }, + 'OperatorNode, Object': function OperatorNode_Object(node, constNodes) { + if (constNodes[node] !== undefined) { + return createConstantNode(0); + } + if (node.op === '+') { + // d/dx(sum(f(x)) = sum(f'(x)) + return new OperatorNode(node.op, node.fn, node.args.map(function (arg) { + return _derivative(arg, constNodes); + })); + } + if (node.op === '-') { + // d/dx(+/-f(x)) = +/-f'(x) + if (node.isUnary()) { + return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]); + } + + // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x) + if (node.isBinary()) { + return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]); + } + } + if (node.op === '*') { + // d/dx(c*f(x)) = c*f'(x) + var constantTerms = node.args.filter(function (arg) { + return constNodes[arg] !== undefined; + }); + if (constantTerms.length > 0) { + var nonConstantTerms = node.args.filter(function (arg) { + return constNodes[arg] === undefined; + }); + var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms); + var newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes)); + return new OperatorNode('*', 'multiply', newArgs); + } + + // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x) + return new OperatorNode('+', 'add', node.args.map(function (argOuter) { + return new OperatorNode('*', 'multiply', node.args.map(function (argInner) { + return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone(); + })); + })); + } + if (node.op === '/' && node.isBinary()) { + var arg0 = node.args[0]; + var arg1 = node.args[1]; + + // d/dx(f(x) / c) = f'(x) / c + if (constNodes[arg1] !== undefined) { + return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]); + } + + // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2) + if (constNodes[arg0] !== undefined) { + return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]); + } + + // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2 + return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]); + } + if (node.op === '^' && node.isBinary()) { + var _arg = node.args[0]; + var _arg2 = node.args[1]; + if (constNodes[_arg] !== undefined) { + // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1 + if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) { + return createConstantNode(0); + } + + // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x) + return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]); + } + if (constNodes[_arg2] !== undefined) { + if (isConstantNode(_arg2)) { + // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0 + if (isZero(_arg2.value)) { + return createConstantNode(0); + } + // Ignore exponent; f(x)^1 = f(x) + if (equal(_arg2.value, 1)) { + return _derivative(_arg, constNodes); + } + } + + // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1) + var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]); + return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), powMinusOne])]); + } + + // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)] + return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, constNodes), new FunctionNode('log', [_arg.clone()])])])]); + } + throw new Error('Cannot process operator "' + node.op + '" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported'); + } + }); + + /** + * Helper function to create a constant node with a specific type + * (number, BigNumber, Fraction) + * @param {number} value + * @param {string} [valueType] + * @return {ConstantNode} + */ + function createConstantNode(value, valueType) { + return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config))); + } + return derivative; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/leafCount.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/leafCount.js new file mode 100644 index 0000000..b8ea7d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/leafCount.js @@ -0,0 +1,54 @@ +import { factory } from '../../utils/factory.js'; +var name = 'leafCount'; +var dependencies = ['parse', 'typed']; +export var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + parse, + typed + } = _ref; + // This does the real work, but we don't have to recurse through + // a typed call if we separate it out + function countLeaves(node) { + var count = 0; + node.forEach(n => { + count += countLeaves(n); + }); + return count || 1; + } + + /** + * Gives the number of "leaf nodes" in the parse tree of the given expression + * A leaf node is one that has no subexpressions, essentially either a + * symbol or a constant. Note that `5!` has just one leaf, the '5'; the + * unary factorial operator does not add a leaf. On the other hand, + * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves. + * + * The `simplify()` function should generally not increase the `leafCount()` + * of an expression, although currently there is no guarantee that it never + * does so. In many cases, `simplify()` reduces the leaf count. + * + * Syntax: + * + * math.leafCount(expr) + * + * Examples: + * + * math.leafCount('x') // 1 + * math.leafCount(math.parse('a*d-b*c')) // 4 + * math.leafCount('[a,b;c,d][0,1]') // 6 + * + * See also: + * + * simplify + * + * @param {Node|string} expr The expression to count the leaves of + * + * @return {number} The number of leaves of `expr` + * + */ + return typed(name, { + Node: function Node(expr) { + return countLeaves(expr); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/lyap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/lyap.js new file mode 100644 index 0000000..007a006 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/lyap.js @@ -0,0 +1,52 @@ +import { factory } from '../../utils/factory.js'; +var name = 'lyap'; +var dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose']; +export var createLyap = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + sylvester, + multiply, + transpose + } = _ref; + /** + * + * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where + * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice + * that different equivalent definitions exist for the Continuous-time + * Lyapunov equation. + * https://en.wikipedia.org/wiki/Lyapunov_equation + * + * Syntax: + * + * math.lyap(A, Q) + * + * Examples: + * + * const A = [[-2, 0], [1, -4]] + * const Q = [[3, 1], [1, 3]] + * const P = math.lyap(A, Q) + * + * See also: + * + * sylvester, schur + * + * @param {Matrix | Array} A Matrix A + * @param {Matrix | Array} Q Matrix Q + * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q + */ + return typed(name, { + 'Matrix, Matrix': function Matrix_Matrix(A, Q) { + return sylvester(A, transpose(A), multiply(-1, Q)); + }, + 'Array, Matrix': function Array_Matrix(A, Q) { + return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q)); + }, + 'Matrix, Array': function Matrix_Array(A, Q) { + return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q))); + }, + 'Array, Array': function Array_Array(A, Q) { + return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js new file mode 100644 index 0000000..d195254 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js @@ -0,0 +1,122 @@ +import { factory } from '../../utils/factory.js'; +var name = 'polynomialRoot'; +var dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're']; +export var createPolynomialRoot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isZero, + equalScalar, + add, + subtract, + multiply, + divide, + sqrt, + unaryMinus, + cbrt, + typeOf, + im, + re + } = _ref; + /** + * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients. + * Currently operates only on linear, quadratic, and cubic polynomials using the standard + * formulas for the roots. + * + * Syntax: + * + * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff) + * + * Examples: + * // linear + * math.polynomialRoot(6, 3) // [-2] + * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i] + * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i] + * // quadratic + * math.polynomialRoot(2, -3, 1) // [2, 1] + * math.polynomialRoot(8, 8, 2) // [-2] + * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951] + * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i] + * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i] + * // cubic + * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2] + * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i] + * math.polynomialRoot(0, 8, 8, 2) // [0, -2] + * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i] + * + * See also: + * cbrt, sqrt + * + * @param {... number | Complex} coeffs + * The coefficients of the polynomial, starting with with the constant coefficent, followed + * by the linear coefficient and subsequent coefficients of increasing powers. + * @return {Array} The distinct roots of the polynomial + */ + + return typed(name, { + 'number|Complex, ...number|Complex': (constant, restCoeffs) => { + var coeffs = [constant, ...restCoeffs]; + while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) { + coeffs.pop(); + } + if (coeffs.length < 2) { + throw new RangeError("Polynomial [".concat(constant, ", ").concat(restCoeffs, "] must have a non-zero non-constant coefficient")); + } + switch (coeffs.length) { + case 2: + // linear + return [unaryMinus(divide(coeffs[0], coeffs[1]))]; + case 3: + { + // quadratic + var [c, b, a] = coeffs; + var denom = multiply(2, a); + var d1 = multiply(b, b); + var d2 = multiply(4, a, c); + if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)]; + var discriminant = sqrt(subtract(d1, d2)); + return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)]; + } + case 4: + { + // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation + var [d, _c, _b, _a] = coeffs; + var _denom = unaryMinus(multiply(3, _a)); + var D0_1 = multiply(_b, _b); + var D0_2 = multiply(3, _a, _c); + var D1_1 = add(multiply(2, _b, _b, _b), multiply(27, _a, _a, d)); + var D1_2 = multiply(9, _a, _b, _c); + if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) { + return [divide(_b, _denom)]; + } + var Delta0 = subtract(D0_1, D0_2); + var Delta1 = subtract(D1_1, D1_2); + var discriminant1 = add(multiply(18, _a, _b, _c, d), multiply(_b, _b, _c, _c)); + var discriminant2 = add(multiply(4, _b, _b, _b, d), multiply(4, _a, _c, _c, _c), multiply(27, _a, _a, d, d)); + if (equalScalar(discriminant1, discriminant2)) { + return [divide(subtract(multiply(4, _a, _b, _c), add(multiply(9, _a, _a, d), multiply(_b, _b, _b))), multiply(_a, Delta0)), + // simple root + divide(subtract(multiply(9, _a, d), multiply(_b, _c)), multiply(2, Delta0)) // double root + ]; + } + // OK, we have three distinct roots + var Ccubed; + if (equalScalar(D0_1, D0_2)) { + Ccubed = Delta1; + } else { + Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2); + } + var allRoots = true; + var rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(_b, C, divide(Delta0, C)), _denom)); + return rawRoots.map(r => { + if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) { + return re(r); + } + return r; + }); + } + default: + throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(coeffs)); + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/rationalize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/rationalize.js new file mode 100644 index 0000000..ef702ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/rationalize.js @@ -0,0 +1,819 @@ +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'rationalize'; +var dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode']; +export var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + typed, + equal, + isZero, + add, + subtract, + multiply, + divide, + pow, + parse, + simplifyConstant, + simplifyCore, + simplify, + fraction, + bignumber, + mathWithTransform, + matrix, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode, + ParenthesisNode + } = _ref; + /** + * Transform a rationalizable expression in a rational fraction. + * If rational fraction is one variable polynomial then converts + * the numerator and denominator in canonical form, with decreasing + * exponents, returning the coefficients of numerator. + * + * Syntax: + * + * math.rationalize(expr) + * math.rationalize(expr, detailed) + * math.rationalize(expr, scope) + * math.rationalize(expr, scope, detailed) + * + * Examples: + * + * math.rationalize('sin(x)+y') + * // Error: There is an unsolved function call + * math.rationalize('2x/y - y/(x+1)') + * // (2*x^2-y^2+2*x)/(x*y+y) + * math.rationalize('(2x+1)^6') + * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1 + * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3') + * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4) + * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') = + * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/ + * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72) + * + * math.rationalize('x+x+x+y',{y:1}) // 3*x+1 + * math.rationalize('x+x+x+y',{}) // 3*x+y + * + * const ret = math.rationalize('x+x+x+y',{},true) + * // ret.expression=3*x+y, ret.variables = ["x","y"] + * const ret = math.rationalize('-2+5x^2',{},true) + * // ret.expression=5*x^2-2, ret.variables = ["x"], ret.coefficients=[-2,0,5] + * + * See also: + * + * simplify + * + * @param {Node|string} expr The expression to check if is a polynomial expression + * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input + * @param {Boolean} detailed optional True if return an object, false if return expression node (default) + * + * @return {Object | Node} The rational polynomial of `expr` or an object + * `{expression, numerator, denominator, variables, coefficients}`, where + * `expression` is a `Node` with the node simplified expression, + * `numerator` is a `Node` with the simplified numerator of expression, + * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator), + * `variables` is an array with variable names, + * and `coefficients` is an array with coefficients of numerator sorted by increased exponent + * {Expression Node} node simplified expression + * + */ + function _rationalize(expr) { + var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form + var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial + var nVars = polyRet.variables.length; + var noExactFractions = { + exactFractions: false + }; + var withExactFractions = { + exactFractions: true + }; + expr = polyRet.expression; + if (nVars >= 1) { + // If expression in not a constant + expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!) + var sBefore; // Previous expression + var rules; + var eDistrDiv = true; + var redoInic = false; + // Apply the initial rules, including succ div rules: + expr = simplify(expr, setRules.firstRules, {}, noExactFractions); + var s; + while (true) { + // Alternate applying successive division rules and distr.div.rules + // until there are no more changes: + rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules; + expr = simplify(expr, rules, {}, withExactFractions); + eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules + + s = expr.toString(); + if (s === sBefore) { + break; // No changes : end of the loop + } + redoInic = true; + sBefore = s; + } + if (redoInic) { + // Apply first rules again without succ div rules (if there are changes) + expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions); + } + // Apply final rules: + expr = simplify(expr, setRules.finalRules, {}, noExactFractions); + } // NVars >= 1 + + var coefficients = []; + var retRationalize = {}; + if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') { + // Separate numerator from denominator + if (nVars === 1) { + expr.args[0] = polyToCanonical(expr.args[0], coefficients); + expr.args[1] = polyToCanonical(expr.args[1]); + } + if (detailed) { + retRationalize.numerator = expr.args[0]; + retRationalize.denominator = expr.args[1]; + } + } else { + if (nVars === 1) { + expr = polyToCanonical(expr, coefficients); + } + if (detailed) { + retRationalize.numerator = expr; + retRationalize.denominator = null; + } + } + // nVars + + if (!detailed) return expr; + retRationalize.coefficients = coefficients; + retRationalize.variables = polyRet.variables; + retRationalize.expression = expr; + return retRationalize; + } + return typed(name, { + Node: _rationalize, + 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed), + 'Node, Object': _rationalize, + 'Node, Object, boolean': _rationalize + }); // end of typed rationalize + + /** + * Function to simplify an expression using an optional scope and + * return it if the expression is a polynomial expression, i.e. + * an expression with one or more variables and the operators + * +, -, *, and ^, where the exponent can only be a positive integer. + * + * Syntax: + * + * polynomial(expr,scope,extended, rules) + * + * @param {Node | string} expr The expression to simplify and check if is polynomial expression + * @param {object} scope Optional scope for expression simplification + * @param {boolean} extended Optional. Default is false. When true allows divide operator. + * @param {array} rules Optional. Default is no rule. + * + * + * @return {Object} + * {Object} node: node simplified expression + * {Array} variables: variable names + */ + function polynomial(expr, scope, extended, rules) { + var variables = []; + var node = simplify(expr, rules, scope, { + exactFractions: false + }); // Resolves any variables and functions with all defined parameters + extended = !!extended; + var oper = '+-*' + (extended ? '/' : ''); + recPoly(node); + var retFunc = {}; + retFunc.expression = node; + retFunc.variables = variables; + return retFunc; + + // ------------------------------------------------------------------------------------------------------- + + /** + * Function to simplify an expression using an optional scope and + * return it if the expression is a polynomial expression, i.e. + * an expression with one or more variables and the operators + * +, -, *, and ^, where the exponent can only be a positive integer. + * + * Syntax: + * + * recPoly(node) + * + * + * @param {Node} node The current sub tree expression in recursion + * + * @return nothing, throw an exception if error + */ + function recPoly(node) { + var tp = node.type; // node type + if (tp === 'FunctionNode') { + // No function call in polynomial expression + throw new Error('There is an unsolved function call'); + } else if (tp === 'OperatorNode') { + if (node.op === '^') { + // TODO: handle negative exponents like in '1/x^(-2)' + if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) { + throw new Error('There is a non-integer exponent'); + } else { + recPoly(node.args[0]); + } + } else { + if (!oper.includes(node.op)) { + throw new Error('Operator ' + node.op + ' invalid in polynomial expression'); + } + for (var i = 0; i < node.args.length; i++) { + recPoly(node.args[i]); + } + } // type of operator + } else if (tp === 'SymbolNode') { + var _name = node.name; // variable name + var pos = variables.indexOf(_name); + if (pos === -1) { + // new variable in expression + variables.push(_name); + } + } else if (tp === 'ParenthesisNode') { + recPoly(node.content); + } else if (tp !== 'ConstantNode') { + throw new Error('type ' + tp + ' is not allowed in polynomial expression'); + } + } // end of recPoly + } // end of polynomial + + // --------------------------------------------------------------------------------------- + /** + * Return a rule set to rationalize an polynomial expression in rationalize + * + * Syntax: + * + * rulesRationalize() + * + * @return {array} rule set to rationalize an polynomial expression + */ + function rulesRationalize() { + var oldRules = [simplifyCore, + // sCore + { + l: 'n+n', + r: '2*n' + }, { + l: 'n+-n', + r: '0' + }, simplifyConstant, + // sConstant + { + l: 'n*(n1^-1)', + r: 'n/n1' + }, { + l: 'n*n1^-n2', + r: 'n/n1^n2' + }, { + l: 'n1^-1', + r: '1/n1' + }, { + l: 'n*(n1/n2)', + r: '(n*n1)/n2' + }, { + l: '1*n', + r: 'n' + }]; + var rulesFirst = [{ + l: '(-n1)/(-n2)', + r: 'n1/n2' + }, + // Unary division + { + l: '(-n1)*(-n2)', + r: 'n1*n2' + }, + // Unary multiplication + { + l: 'n1--n2', + r: 'n1+n2' + }, + // '--' elimination + { + l: 'n1-n2', + r: 'n1+(-n2)' + }, + // Subtraction turn into add with un�ry minus + { + l: '(n1+n2)*n3', + r: '(n1*n3 + n2*n3)' + }, + // Distributive 1 + { + l: 'n1*(n2+n3)', + r: '(n1*n2+n1*n3)' + }, + // Distributive 2 + { + l: 'c1*n + c2*n', + r: '(c1+c2)*n' + }, + // Joining constants + { + l: 'c1*n + n', + r: '(c1+1)*n' + }, + // Joining constants + { + l: 'c1*n - c2*n', + r: '(c1-c2)*n' + }, + // Joining constants + { + l: 'c1*n - n', + r: '(c1-1)*n' + }, + // Joining constants + { + l: 'v/c', + r: '(1/c)*v' + }, + // variable/constant (new!) + { + l: 'v/-c', + r: '-(1/c)*v' + }, + // variable/constant (new!) + { + l: '-v*-c', + r: 'c*v' + }, + // Inversion constant and variable 1 + { + l: '-v*c', + r: '-c*v' + }, + // Inversion constant and variable 2 + { + l: 'v*-c', + r: '-c*v' + }, + // Inversion constant and variable 3 + { + l: 'v*c', + r: 'c*v' + }, + // Inversion constant and variable 4 + { + l: '-(-n1*n2)', + r: '(n1*n2)' + }, + // Unary propagation + { + l: '-(n1*n2)', + r: '(-n1*n2)' + }, + // Unary propagation + { + l: '-(-n1+n2)', + r: '(n1-n2)' + }, + // Unary propagation + { + l: '-(n1+n2)', + r: '(-n1-n2)' + }, + // Unary propagation + { + l: '(n1^n2)^n3', + r: '(n1^(n2*n3))' + }, + // Power to Power + { + l: '-(-n1/n2)', + r: '(n1/n2)' + }, + // Division and Unary + { + l: '-(n1/n2)', + r: '(-n1/n2)' + }]; // Divisao and Unary + + var rulesDistrDiv = [{ + l: '(n1/n2 + n3/n4)', + r: '((n1*n4 + n3*n2)/(n2*n4))' + }, + // Sum of fractions + { + l: '(n1/n2 + n3)', + r: '((n1 + n3*n2)/n2)' + }, + // Sum fraction with number 1 + { + l: '(n1 + n2/n3)', + r: '((n1*n3 + n2)/n3)' + }]; // Sum fraction with number 1 + + var rulesSucDiv = [{ + l: '(n1/(n2/n3))', + r: '((n1*n3)/n2)' + }, + // Division simplification + { + l: '(n1/n2/n3)', + r: '(n1/(n2*n3))' + }]; + var setRules = {}; // rules set in 4 steps. + + // All rules => infinite loop + // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv) + + setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set + setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules + setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules + setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div. + + // Division simplification + + // Second rule set. + // There is no aggregate expression with parentesis, but the only variable can be scattered. + setRules.finalRules = [simplifyCore, + // simplify.rules[0] + { + l: 'n*-n', + r: '-n^2' + }, + // Joining multiply with power 1 + { + l: 'n*n', + r: 'n^2' + }, + // Joining multiply with power 2 + simplifyConstant, + // simplify.rules[14] old 3rd index in oldRules + { + l: 'n*-n^n1', + r: '-n^(n1+1)' + }, + // Joining multiply with power 3 + { + l: 'n*n^n1', + r: 'n^(n1+1)' + }, + // Joining multiply with power 4 + { + l: 'n^n1*-n^n2', + r: '-n^(n1+n2)' + }, + // Joining multiply with power 5 + { + l: 'n^n1*n^n2', + r: 'n^(n1+n2)' + }, + // Joining multiply with power 6 + { + l: 'n^n1*-n', + r: '-n^(n1+1)' + }, + // Joining multiply with power 7 + { + l: 'n^n1*n', + r: 'n^(n1+1)' + }, + // Joining multiply with power 8 + { + l: 'n^n1/-n', + r: '-n^(n1-1)' + }, + // Joining multiply with power 8 + { + l: 'n^n1/n', + r: 'n^(n1-1)' + }, + // Joining division with power 1 + { + l: 'n/-n^n1', + r: '-n^(1-n1)' + }, + // Joining division with power 2 + { + l: 'n/n^n1', + r: 'n^(1-n1)' + }, + // Joining division with power 3 + { + l: 'n^n1/-n^n2', + r: 'n^(n1-n2)' + }, + // Joining division with power 4 + { + l: 'n^n1/n^n2', + r: 'n^(n1-n2)' + }, + // Joining division with power 5 + { + l: 'n1+(-n2*n3)', + r: 'n1-n2*n3' + }, + // Solving useless parenthesis 1 + { + l: 'v*(-c)', + r: '-c*v' + }, + // Solving useless unary 2 + { + l: 'n1+-n2', + r: 'n1-n2' + }, + // Solving +- together (new!) + { + l: 'v*c', + r: 'c*v' + }, + // inversion constant with variable + { + l: '(n1^n2)^n3', + r: '(n1^(n2*n3))' + } // Power to Power + ]; + return setRules; + } // End rulesRationalize + + // --------------------------------------------------------------------------------------- + /** + * Expand recursively a tree node for handling with expressions with exponents + * (it's not for constants, symbols or functions with exponents) + * PS: The other parameters are internal for recursion + * + * Syntax: + * + * expandPower(node) + * + * @param {Node} node Current expression node + * @param {node} parent Parent current node inside the recursion + * @param (int} Parent number of chid inside the rercursion + * + * @return {node} node expression with all powers expanded. + */ + function expandPower(node, parent, indParent) { + var tp = node.type; + var internal = arguments.length > 1; // TRUE in internal calls + + if (tp === 'OperatorNode' && node.isBinary()) { + var does = false; + var val; + if (node.op === '^') { + // First operator: Parenthesis or UnaryMinus + if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') { + // Second operator: Constant + val = parseFloat(node.args[1].value); + does = val >= 2 && isInteger(val); + } + } + if (does) { + // Exponent >= 2 + // Before: + // operator A --> Subtree + // parent pow + // constant + // + if (val > 2) { + // Exponent > 2, + // AFTER: (exponent > 2) + // operator A --> Subtree + // parent * + // deep clone (operator A --> Subtree + // pow + // constant - 1 + // + var nEsqTopo = node.args[0]; + var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]); + node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]); + } else { + // Expo = 2 - no power + // AFTER: (exponent = 2) + // operator A --> Subtree + // parent oper + // deep clone (operator A --> Subtree) + // + node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]); + } + if (internal) { + // Change parent references in internal recursive calls + if (indParent === 'content') { + parent.content = node; + } else { + parent.args[indParent] = node; + } + } + } // does + } // binary OperatorNode + + if (tp === 'ParenthesisNode') { + // Recursion + expandPower(node.content, node, 'content'); + } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') { + for (var i = 0; i < node.args.length; i++) { + expandPower(node.args[i], node, i); + } + } + if (!internal) { + // return the root node + return node; + } + } // End expandPower + + // --------------------------------------------------------------------------------------- + /** + * Auxilary function for rationalize + * Convert near canonical polynomial in one variable in a canonical polynomial + * with one term for each exponent in decreasing order + * + * Syntax: + * + * polyToCanonical(node [, coefficients]) + * + * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression + * + * The string or tree expression needs to be at below syntax, with free spaces: + * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+ + * Where 'var' is one variable with any valid name + * 'cte' are real numeric constants with any value. It can be omitted if equal than 1 + * 'expo' are integers greater than 0. It can be omitted if equal than 1. + * + * @param {array} coefficients Optional returns coefficients sorted by increased exponent + * + * + * @return {node} new node tree with one variable polynomial or string error. + */ + function polyToCanonical(node, coefficients) { + if (coefficients === undefined) { + coefficients = []; + } // coefficients. + + coefficients[0] = 0; // index is the exponent + var o = {}; + o.cte = 1; + o.oper = '+'; + + // fire: mark with * or ^ when finds * or ^ down tree, reset to "" with + and -. + // It is used to deduce the exponent: 1 for *, 0 for "". + o.fire = ''; + var maxExpo = 0; // maximum exponent + var varname = ''; // variable name + + recurPol(node, null, o); + maxExpo = coefficients.length - 1; + var first = true; + var no; + for (var i = maxExpo; i >= 0; i--) { + if (coefficients[i] === 0) continue; + var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i])); + var op = coefficients[i] < 0 ? '-' : '+'; + if (i > 0) { + // Is not a constant without variable + var n2 = new SymbolNode(varname); + if (i > 1) { + var n3 = new ConstantNode(i); + n2 = new OperatorNode('^', 'pow', [n2, n3]); + } + if (coefficients[i] === -1 && first) { + n1 = new OperatorNode('-', 'unaryMinus', [n2]); + } else if (Math.abs(coefficients[i]) === 1) { + n1 = n2; + } else { + n1 = new OperatorNode('*', 'multiply', [n1, n2]); + } + } + if (first) { + no = n1; + } else if (op === '+') { + no = new OperatorNode('+', 'add', [no, n1]); + } else { + no = new OperatorNode('-', 'subtract', [no, n1]); + } + first = false; + } // for + + if (first) { + return new ConstantNode(0); + } else { + return no; + } + + /** + * Recursive auxilary function inside polyToCanonical for + * converting expression in canonical form + * + * Syntax: + * + * recurPol(node, noPai, obj) + * + * @param {Node} node The current subpolynomial expression + * @param {Node | Null} noPai The current parent node + * @param {object} obj Object with many internal flags + * + * @return {} No return. If error, throws an exception + */ + function recurPol(node, noPai, o) { + var tp = node.type; + if (tp === 'FunctionNode') { + // ***** FunctionName ***** + // No function call in polynomial expression + throw new Error('There is an unsolved function call'); + } else if (tp === 'OperatorNode') { + // ***** OperatorName ***** + if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid'); + if (noPai !== null) { + // -(unary),^ : children of *,+,- + if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') { + throw new Error('Invalid ' + node.op + ' placing'); + } + + // -,+,* : children of +,- + if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') { + throw new Error('Invalid ' + node.op + ' placing'); + } + + // -,+ : first child + if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) { + throw new Error('Invalid ' + node.op + ' placing'); + } + } // Has parent + + // Firers: ^,* Old: ^,&,-(unary): firers + if (node.op === '^' || node.op === '*') { + o.fire = node.op; + } + for (var _i = 0; _i < node.args.length; _i++) { + // +,-: reset fire + if (node.fn === 'unaryMinus') o.oper = '-'; + if (node.op === '+' || node.fn === 'subtract') { + o.fire = ''; + o.cte = 1; // default if there is no constant + o.oper = _i === 0 ? '+' : node.op; + } + o.noFil = _i; // number of son + recurPol(node.args[_i], node, o); + } // for in children + } else if (tp === 'SymbolNode') { + // ***** SymbolName ***** + if (node.name !== varname && varname !== '') { + throw new Error('There is more than one variable'); + } + varname = node.name; + if (noPai === null) { + coefficients[1] = 1; + return; + } + + // ^: Symbol is First child + if (noPai.op === '^' && o.noFil !== 0) { + throw new Error('In power the variable should be the first parameter'); + } + + // *: Symbol is Second child + if (noPai.op === '*' && o.noFil !== 1) { + throw new Error('In multiply the variable should be the second parameter'); + } + + // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var) + if (o.fire === '' || o.fire === '*') { + if (maxExpo < 1) coefficients[1] = 0; + coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1); + maxExpo = Math.max(1, maxExpo); + } + } else if (tp === 'ConstantNode') { + var valor = parseFloat(node.value); + if (noPai === null) { + coefficients[0] = valor; + return; + } + if (noPai.op === '^') { + // cte: second child of power + if (o.noFil !== 1) throw new Error('Constant cannot be powered'); + if (!isInteger(valor) || valor <= 0) { + throw new Error('Non-integer exponent is not allowed'); + } + for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0; + if (valor > maxExpo) coefficients[valor] = 0; + coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1); + maxExpo = Math.max(valor, maxExpo); + return; + } + o.cte = valor; + + // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0. + if (o.fire === '') { + coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1); + } + } else { + throw new Error('Type ' + tp + ' is not allowed'); + } + } // End of recurPol + } // End of polyToCanonical +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/resolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/resolve.js new file mode 100644 index 0000000..925cdb5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/resolve.js @@ -0,0 +1,97 @@ +import { createMap } from '../../utils/map.js'; +import { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'resolve'; +var dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode']; +export var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + parse, + ConstantNode, + FunctionNode, + OperatorNode, + ParenthesisNode + } = _ref; + /** + * resolve(expr, scope) replaces variable nodes with their scoped values + * + * Syntax: + * + * math.resolve(expr, scope) + * + * Examples: + * + * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2' + * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2' + * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // "6" + * + * See also: + * + * simplify, evaluate + * + * @param {Node | Node[]} node + * The expression tree (or trees) to be simplified + * @param {Object} scope + * Scope specifying variables to be resolved + * @return {Node | Node[]} Returns `node` with variables recursively substituted. + * @throws {ReferenceError} + * If there is a cyclic dependency among the variables in `scope`, + * resolution is impossible and a ReferenceError is thrown. + */ + function _resolve(node, scope) { + var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set(); + // note `within`: + // `within` is not documented, since it is for internal cycle + // detection only + if (!scope) { + return node; + } + if (isSymbolNode(node)) { + if (within.has(node.name)) { + var variables = Array.from(within).join(', '); + throw new ReferenceError("recursive loop of variable definitions among {".concat(variables, "}")); + } + var value = scope.get(node.name); + if (isNode(value)) { + var nextWithin = new Set(within); + nextWithin.add(node.name); + return _resolve(value, scope, nextWithin); + } else if (typeof value === 'number') { + return parse(String(value)); + } else if (value !== undefined) { + return new ConstantNode(value); + } else { + return node; + } + } else if (isOperatorNode(node)) { + var args = node.args.map(function (arg) { + return _resolve(arg, scope, within); + }); + return new OperatorNode(node.op, node.fn, args, node.implicit); + } else if (isParenthesisNode(node)) { + return new ParenthesisNode(_resolve(node.content, scope, within)); + } else if (isFunctionNode(node)) { + var _args = node.args.map(function (arg) { + return _resolve(arg, scope, within); + }); + return new FunctionNode(node.name, _args); + } + + // Otherwise just recursively resolve any children (might also work + // for some of the above special cases) + return node.map(child => _resolve(child, scope, within)); + } + return typed('resolve', { + Node: _resolve, + 'Node, Map | null | undefined': _resolve, + 'Node, Object': (n, scope) => _resolve(n, createMap(scope)), + // For arrays and matrices, we map `self` rather than `_resolve` + // because resolve is fairly expensive anyway, and this way + // we get nice error messages if one entry in the array has wrong type. + 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))), + 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))), + 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))), + 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))), + 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope))) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify.js new file mode 100644 index 0000000..3adef7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify.js @@ -0,0 +1,1256 @@ +import { isParenthesisNode } from '../../utils/is.js'; +import { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js'; +import { factory } from '../../utils/factory.js'; +import { createUtil } from './simplify/util.js'; +import { hasOwnProperty } from '../../utils/object.js'; +import { createEmptyMap, createMap } from '../../utils/map.js'; +var name = 'simplify'; +var dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +export var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + typed, + parse, + add, + subtract, + multiply, + divide, + pow, + isZero, + equal, + resolve, + simplifyConstant, + simplifyCore, + fraction, + bignumber, + mathWithTransform, + matrix, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + var { + hasProperty, + isCommutative, + isAssociative, + mergeContext, + flatten, + unflattenr, + unflattenl, + createMakeNodeFunction, + defaultContext, + realContext, + positiveContext + } = createUtil({ + FunctionNode, + OperatorNode, + SymbolNode + }); + + /** + * Simplify an expression tree. + * + * A list of rules are applied to an expression, repeating over the list until + * no further changes are made. + * It's possible to pass a custom set of rules to the function as second + * argument. A rule can be specified as an object, string, or function: + * + * const rules = [ + * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' }, + * 'n1*n3 + n2*n3 -> (n1+n2)*n3', + * function (node) { + * // ... return a new node or return the node unchanged + * return node + * } + * ] + * + * String and object rules consist of a left and right pattern. The left is + * used to match against the expression and the right determines what matches + * are replaced with. The main difference between a pattern and a normal + * expression is that variables starting with the following characters are + * interpreted as wildcards: + * + * - 'n' - Matches any node [Node] + * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode] + * - 'cl' - Matches a constant literal; same as c [ConstantNode] + * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode] + * - 'ce' - Matches a constant expression (-5 or √3) [Expressions consisting of only ConstantNodes, functions, and operators] + * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode] + * - 'vl' - Matches a variable literal (x or y) [SymbolNode] + * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or √3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode] + * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term] + * + * The default list of rules is exposed on the function as `simplify.rules` + * and can be used as a basis to built a set of custom rules. Note that since + * the `simplifyCore` function is in the default list of rules, by default + * simplify will convert any function calls in the expression that have + * operator equivalents to their operator forms. + * + * To specify a rule as a string, separate the left and right pattern by '->' + * When specifying a rule as an object, the following keys are meaningful: + * - l - the left pattern + * - r - the right pattern + * - s - in lieu of l and r, the string form that is broken at -> to give them + * - repeat - whether to repeat this rule until the expression stabilizes + * - assuming - gives a context object, as in the 'context' option to + * simplify. Every property in the context object must match the current + * context in order, or else the rule will not be applied. + * - imposeContext - gives a context object, as in the 'context' option to + * simplify. Any settings specified will override the incoming context + * for all matches of this rule. + * + * For more details on the theory, see: + * + * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) + * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification) + * + * An optional `options` argument can be passed as last argument of `simplify`. + * Currently available options (defaults in parentheses): + * - `consoleDebug` (false): whether to write the expression being simplified + * and any changes to it, along with the rule responsible, to console + * - `context` (simplify.defaultContext): an object giving properties of + * each operator, which determine what simplifications are allowed. The + * currently meaningful properties are commutative, associative, + * total (whether the operation is defined for all arguments), and + * trivial (whether the operation applied to a single argument leaves + * that argument unchanged). The default context is very permissive and + * allows almost all simplifications. Only properties differing from + * the default need to be specified; the default context is used as a + * fallback. Additional contexts `simplify.realContext` and + * `simplify.positiveContext` are supplied to cause simplify to perform + * just simplifications guaranteed to preserve all values of the expression + * assuming all variables and subexpressions are real numbers or + * positive real numbers, respectively. (Note that these are in some cases + * more restrictive than the default context; for example, the default + * context will allow `x/x` to simplify to 1, whereas + * `simplify.realContext` will not, as `0/0` is not equal to 1.) + * - `exactFractions` (true): whether to try to convert all constants to + * exact rational numbers. + * - `fractionsLimit` (10000): when `exactFractions` is true, constants will + * be expressed as fractions only when both numerator and denominator + * are smaller than `fractionsLimit`. + * + * Syntax: + * + * math.simplify(expr) + * math.simplify(expr, rules) + * math.simplify(expr, rules) + * math.simplify(expr, rules, scope) + * math.simplify(expr, rules, scope, options) + * math.simplify(expr, scope) + * math.simplify(expr, scope, options) + * + * Examples: + * + * math.simplify('2 * 1 * x ^ (2 - 1)') // Node "2 * x" + * math.simplify('2 * 3 * x', {x: 4}) // Node "24" + * const f = math.parse('2 * 1 * x ^ (2 - 1)') + * math.simplify(f) // Node "2 * x" + * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node "x * 2 / 5" + * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node "0.4 * x" + * + * See also: + * + * simplifyCore, derivative, evaluate, parse, rationalize, resolve + * + * @param {Node | string} expr + * The expression to be simplified + * @param {SimplifyRule[]} [rules] + * Optional list with custom rules + * @param {Object} [scope] Optional scope with variables + * @param {SimplifyOptions} [options] Optional configuration settings + * @return {Node} Returns the simplified form of `expr` + */ + typed.addConversion({ + from: 'Object', + to: 'Map', + convert: createMap + }); + var simplify = typed('simplify', { + Node: _simplify, + 'Node, Map': (expr, scope) => _simplify(expr, false, scope), + 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options), + 'Node, Array': _simplify, + 'Node, Array, Map': _simplify, + 'Node, Array, Map, Object': _simplify + }); + typed.removeConversion({ + from: 'Object', + to: 'Map', + convert: createMap + }); + simplify.defaultContext = defaultContext; + simplify.realContext = realContext; + simplify.positiveContext = positiveContext; + function removeParens(node) { + return node.transform(function (node, path, parent) { + return isParenthesisNode(node) ? removeParens(node.content) : node; + }); + } + + // All constants that are allowed in rules + var SUPPORTED_CONSTANTS = { + true: true, + false: true, + e: true, + i: true, + Infinity: true, + LN2: true, + LN10: true, + LOG2E: true, + LOG10E: true, + NaN: true, + phi: true, + pi: true, + SQRT1_2: true, + SQRT2: true, + tau: true + // null: false, + // undefined: false, + // version: false, + }; + + // Array of strings, used to build the ruleSet. + // Each l (left side) and r (right side) are parsed by + // the expression parser into a node tree. + // Left hand sides are matched to subtrees within the + // expression to be parsed and replaced with the right + // hand side. + // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically]) + // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format. + // It is possible to get into an infinite loop with conflicting rules + simplify.rules = [simplifyCore, + // { l: 'n+0', r: 'n' }, // simplifyCore + // { l: 'n^0', r: '1' }, // simplifyCore + // { l: '0*n', r: '0' }, // simplifyCore + // { l: 'n/n', r: '1'}, // simplifyCore + // { l: 'n^1', r: 'n' }, // simplifyCore + // { l: '+n1', r:'n1' }, // simplifyCore + // { l: 'n--n1', r:'n+n1' }, // simplifyCore + { + l: 'log(e)', + r: '1' + }, + // temporary rules + // Note initially we tend constants to the right because like-term + // collection prefers the left, and we would rather collect nonconstants + { + s: 'n-n1 -> n+-n1', + // temporarily replace 'subtract' so we can further flatten the 'add' operator + assuming: { + subtract: { + total: true + } + } + }, { + s: 'n-n -> 0', + // partial alternative when we can't always subtract + assuming: { + subtract: { + total: false + } + } + }, { + s: '-(cl*v) -> v * (-cl)', + // make non-constant terms positive + assuming: { + multiply: { + commutative: true + }, + subtract: { + total: true + } + } + }, { + s: '-(cl*v) -> (-cl) * v', + // non-commutative version, part 1 + assuming: { + multiply: { + commutative: false + }, + subtract: { + total: true + } + } + }, { + s: '-(v*cl) -> v * (-cl)', + // non-commutative version, part 2 + assuming: { + multiply: { + commutative: false + }, + subtract: { + total: true + } + } + }, { + l: '-(n1/n2)', + r: '-n1/n2' + }, { + l: '-v', + r: 'v * (-1)' + }, + // finish making non-constant terms positive + { + l: '(n1 + n2)*(-1)', + r: 'n1*(-1) + n2*(-1)', + repeat: true + }, + // expand negations to achieve as much sign cancellation as possible + { + l: 'n/n1^n2', + r: 'n*n1^-n2' + }, + // temporarily replace 'divide' so we can further flatten the 'multiply' operator + { + l: 'n/n1', + r: 'n*n1^-1' + }, { + s: '(n1*n2)^n3 -> n1^n3 * n2^n3', + assuming: { + multiply: { + commutative: true + } + } + }, { + s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)', + assuming: { + multiply: { + commutative: false + } + } + }, + // expand nested exponentiation + { + s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)', + assuming: { + divide: { + total: true + } + } // 1/(1/n) = n needs 1/n to exist + }, + // collect like factors; into a sum, only do this for nonconstants + { + l: ' vd * ( vd * n1 + n2)', + r: 'vd^2 * n1 + vd * n2' + }, { + s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2', + assuming: { + divide: { + total: true + } + } // v*1/v = v^(1+-1) needs 1/v + }, { + s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2', + assuming: { + divide: { + total: true + } + } + }, { + s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2', + assuming: { + divide: { + total: true + } + } + }, { + l: 'n*n', + r: 'n^2' + }, { + s: 'n * n^n1 -> n^(n1+1)', + assuming: { + divide: { + total: true + } + } // n*1/n = n^(-1+1) needs 1/n + }, { + s: 'n^n1 * n^n2 -> n^(n1+n2)', + assuming: { + divide: { + total: true + } + } // ditto for n^2*1/n^2 + }, + // Unfortunately, to deal with more complicated cancellations, it + // becomes necessary to simplify constants twice per pass. It's not + // terribly expensive compared to matching rules, so this should not + // pose a performance problem. + simplifyConstant, + // First: before collecting like terms + + // collect like terms + { + s: 'n+n -> 2*n', + assuming: { + add: { + total: true + } + } // 2 = 1 + 1 needs to exist + }, { + l: 'n+-n', + r: '0' + }, { + l: 'vd*n + vd', + r: 'vd*(n+1)' + }, + // NOTE: leftmost position is special: + { + l: 'n3*n1 + n3*n2', + r: 'n3*(n1+n2)' + }, + // All sub-monomials tried there. + { + l: 'n3^(-n4)*n1 + n3 * n2', + r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)' + }, { + l: 'n3^(-n4)*n1 + n3^n5 * n2', + r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)' + }, + // noncommutative additional cases (term collection & factoring) + { + s: 'n*vd + vd -> (n+1)*vd', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'vd + n*vd -> (1+n)*vd', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3 + n2*n3 -> (n1+n2)*n3', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n^n1 * n -> n^(n1+1)', + assuming: { + divide: { + total: true + }, + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)', + assuming: { + multiply: { + commutative: false + } + } + }, { + l: 'n*cd + cd', + r: '(n+1)*cd' + }, { + s: 'cd*n + cd -> cd*(n+1)', + assuming: { + multiply: { + commutative: false + } + } + }, { + s: 'cd + cd*n -> cd*(1+n)', + assuming: { + multiply: { + commutative: false + } + } + }, simplifyConstant, + // Second: before returning expressions to "standard form" + + // make factors positive (and undo 'make non-constant terms positive') + { + s: '(-n)*n1 -> -(n*n1)', + assuming: { + subtract: { + total: true + } + } + }, { + s: 'n1*(-n) -> -(n1*n)', + // in case * non-commutative + assuming: { + subtract: { + total: true + }, + multiply: { + commutative: false + } + } + }, + // final ordering of constants + { + s: 'ce+ve -> ve+ce', + assuming: { + add: { + commutative: true + } + }, + imposeContext: { + add: { + commutative: false + } + } + }, { + s: 'vd*cd -> cd*vd', + assuming: { + multiply: { + commutative: true + } + }, + imposeContext: { + multiply: { + commutative: false + } + } + }, + // undo temporary rules + // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant + { + l: 'n+-n1', + r: 'n-n1' + }, + // undo replace 'subtract' + { + l: 'n+-(n1)', + r: 'n-(n1)' + }, { + s: 'n*(n1^-1) -> n/n1', + // undo replace 'divide'; for * commutative + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + s: 'n*n1^-n2 -> n/n1^n2', + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + s: 'n^-1 -> 1/n', + assuming: { + multiply: { + commutative: true + } + } // o.w. / not conventional + }, { + l: 'n^1', + r: 'n' + }, + // can be produced by power cancellation + { + s: 'n*(n1/n2) -> (n*n1)/n2', + // '*' before '/' + assuming: { + multiply: { + associative: true + } + } + }, { + s: 'n-(n1+n2) -> n-n1-n2', + // '-' before '+' + assuming: { + addition: { + associative: true, + commutative: true + } + } + }, + // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' }, + // { l: '(n*n1)/(n*n2)', r: 'n1/n2' }, + + // simplifyConstant can leave an extra factor of 1, which can always + // be eliminated, since the identity always commutes + { + l: '1*n', + r: 'n', + imposeContext: { + multiply: { + commutative: true + } + } + }, { + s: 'n1/(n2/n3) -> (n1*n3)/n2', + assuming: { + multiply: { + associative: true + } + } + }, { + l: 'n1/(-n2)', + r: '-n1/n2' + }]; + + /** + * Takes any rule object as allowed by the specification in simplify + * and puts it in a standard form used by applyRule + */ + function _canonicalizeRule(ruleObject, context) { + var newRule = {}; + if (ruleObject.s) { + var lr = ruleObject.s.split('->'); + if (lr.length === 2) { + newRule.l = lr[0]; + newRule.r = lr[1]; + } else { + throw SyntaxError('Could not parse rule: ' + ruleObject.s); + } + } else { + newRule.l = ruleObject.l; + newRule.r = ruleObject.r; + } + newRule.l = removeParens(parse(newRule.l)); + newRule.r = removeParens(parse(newRule.r)); + for (var prop of ['imposeContext', 'repeat', 'assuming']) { + if (prop in ruleObject) { + newRule[prop] = ruleObject[prop]; + } + } + if (ruleObject.evaluate) { + newRule.evaluate = parse(ruleObject.evaluate); + } + if (isAssociative(newRule.l, context)) { + var nonCommutative = !isCommutative(newRule.l, context); + var leftExpandsym; + // Gen. the LHS placeholder used in this NC-context specific expansion rules + if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol(); + var makeNode = createMakeNodeFunction(newRule.l); + var expandsym = _getExpandPlaceholderSymbol(); + newRule.expanded = {}; + newRule.expanded.l = makeNode([newRule.l, expandsym]); + // Push the expandsym into the deepest possible branch. + // This helps to match the newRule against nodes returned from getSplits() later on. + flatten(newRule.expanded.l, context); + unflattenr(newRule.expanded.l, context); + newRule.expanded.r = makeNode([newRule.r, expandsym]); + + // In and for a non-commutative context, attempting with yet additional expansion rules makes + // way for more matches cases of multi-arg expressions; such that associative rules (such as + // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'. + if (nonCommutative) { + // 'Non-commutative' 1: LHS (placeholder) only + newRule.expandedNC1 = {}; + newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]); + newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]); + // 'Non-commutative' 2: farmost LHS and RHS placeholders + newRule.expandedNC2 = {}; + newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]); + newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]); + } + } + return newRule; + } + + /** + * Parse the string array of rules into nodes + * + * Example syntax for rules: + * + * Position constants to the left in a product: + * { l: 'n1 * c1', r: 'c1 * n1' } + * n1 is any Node, and c1 is a ConstantNode. + * + * Apply difference of squares formula: + * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' } + * n1, n2 mean any Node. + * + * Short hand notation: + * 'n1 * c1 -> c1 * n1' + */ + function _buildRules(rules, context) { + // Array of rules to be used to simplify expressions + var ruleSet = []; + for (var i = 0; i < rules.length; i++) { + var rule = rules[i]; + var newRule = void 0; + var ruleType = typeof rule; + switch (ruleType) { + case 'string': + rule = { + s: rule + }; + /* falls through */ + case 'object': + newRule = _canonicalizeRule(rule, context); + break; + case 'function': + newRule = rule; + break; + default: + throw TypeError('Unsupported type of rule: ' + ruleType); + } + // console.log('Adding rule: ' + rules[i]) + // console.log(newRule) + ruleSet.push(newRule); + } + return ruleSet; + } + var _lastsym = 0; + function _getExpandPlaceholderSymbol() { + return new SymbolNode('_p' + _lastsym++); + } + function _simplify(expr, rules) { + var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap(); + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var debug = options.consoleDebug; + rules = _buildRules(rules || simplify.rules, options.context); + var res = resolve(expr, scope); + res = removeParens(res); + var visited = {}; + var str = res.toString({ + parenthesis: 'all' + }); + while (!visited[str]) { + visited[str] = true; + _lastsym = 0; // counter for placeholder symbols + var laststr = str; + if (debug) console.log('Working on: ', str); + for (var i = 0; i < rules.length; i++) { + var rulestr = ''; + if (typeof rules[i] === 'function') { + res = rules[i](res, options); + if (debug) rulestr = rules[i].name; + } else { + flatten(res, options.context); + res = applyRule(res, rules[i], options.context); + if (debug) { + rulestr = "".concat(rules[i].l.toString(), " -> ").concat(rules[i].r.toString()); + } + } + if (debug) { + var newstr = res.toString({ + parenthesis: 'all' + }); + if (newstr !== laststr) { + console.log('Applying', rulestr, 'produced', newstr); + laststr = newstr; + } + } + /* Use left-heavy binary tree internally, + * since custom rule functions may expect it + */ + unflattenl(res, options.context); + } + str = res.toString({ + parenthesis: 'all' + }); + } + return res; + } + function mapRule(nodes, rule, context) { + var resNodes = nodes; + if (nodes) { + for (var i = 0; i < nodes.length; ++i) { + var newNode = applyRule(nodes[i], rule, context); + if (newNode !== nodes[i]) { + if (resNodes === nodes) { + resNodes = nodes.slice(); + } + resNodes[i] = newNode; + } + } + } + return resNodes; + } + + /** + * Returns a simplfied form of node, or the original node if no simplification was possible. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object | Function} rule + * @param {Object} context -- information about assumed properties of operators + * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible. + */ + function applyRule(node, rule, context) { + // console.log('Entering applyRule("', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '",', node.toString({parenthesis:'all'}),')') + + // check that the assumptions for this rule are satisfied by the current + // context: + if (rule.assuming) { + for (var symbol in rule.assuming) { + for (var property in rule.assuming[symbol]) { + if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) { + return node; + } + } + } + } + var mergedContext = mergeContext(rule.imposeContext, context); + + // Do not clone node unless we find a match + var res = node; + + // First replace our child nodes with their simplified versions + // If a child could not be simplified, applying the rule to it + // will have no effect since the node is returned unchanged + if (res instanceof OperatorNode || res instanceof FunctionNode) { + var newArgs = mapRule(res.args, rule, context); + if (newArgs !== res.args) { + res = res.clone(); + res.args = newArgs; + } + } else if (res instanceof ParenthesisNode) { + if (res.content) { + var newContent = applyRule(res.content, rule, context); + if (newContent !== res.content) { + res = new ParenthesisNode(newContent); + } + } + } else if (res instanceof ArrayNode) { + var newItems = mapRule(res.items, rule, context); + if (newItems !== res.items) { + res = new ArrayNode(newItems); + } + } else if (res instanceof AccessorNode) { + var newObj = res.object; + if (res.object) { + newObj = applyRule(res.object, rule, context); + } + var newIndex = res.index; + if (res.index) { + newIndex = applyRule(res.index, rule, context); + } + if (newObj !== res.object || newIndex !== res.index) { + res = new AccessorNode(newObj, newIndex); + } + } else if (res instanceof IndexNode) { + var newDims = mapRule(res.dimensions, rule, context); + if (newDims !== res.dimensions) { + res = new IndexNode(newDims); + } + } else if (res instanceof ObjectNode) { + var changed = false; + var newProps = {}; + for (var prop in res.properties) { + newProps[prop] = applyRule(res.properties[prop], rule, context); + if (newProps[prop] !== res.properties[prop]) { + changed = true; + } + } + if (changed) { + res = new ObjectNode(newProps); + } + } + + // Try to match a rule against this node + var repl = rule.r; + var matches = _ruleMatch(rule.l, res, mergedContext)[0]; + + // If the rule is associative operator, we can try matching it while allowing additional terms. + // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative. + if (!matches && rule.expanded) { + repl = rule.expanded.r; + matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0]; + } + // Additional, non-commutative context expansion-rules + if (!matches && rule.expandedNC1) { + repl = rule.expandedNC1.r; + matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0]; + if (!matches) { + // Existence of NC1 implies NC2 + repl = rule.expandedNC2.r; + matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0]; + } + } + if (matches) { + // const before = res.toString({parenthesis: 'all'}) + + // Create a new node by cloning the rhs of the matched rule + // we keep any implicit multiplication state if relevant + var implicit = res.implicit; + res = repl.clone(); + if (implicit && 'implicit' in repl) { + res.implicit = true; + } + + // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes + res = res.transform(function (node) { + if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) { + return matches.placeholders[node.name].clone(); + } else { + return node; + } + }); + + // const after = res.toString({parenthesis: 'all'}) + // console.log('Simplified ' + before + ' to ' + after) + } + if (rule.repeat && res !== node) { + res = applyRule(res, rule, context); + } + return res; + } + + /** + * Get (binary) combinations of a flattened binary node + * e.g. +(node1, node2, node3) -> [ + * +(node1, +(node2, node3)), + * +(node2, +(node1, node3)), + * +(node3, +(node1, node2))] + * + */ + function getSplits(node, context) { + var res = []; + var right, rightArgs; + var makeNode = createMakeNodeFunction(node); + if (isCommutative(node, context)) { + for (var i = 0; i < node.args.length; i++) { + rightArgs = node.args.slice(0); + rightArgs.splice(i, 1); + right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs); + res.push(makeNode([node.args[i], right])); + } + } else { + // Keep order, but try all parenthesizations + for (var _i = 1; _i < node.args.length; _i++) { + var left = node.args[0]; + if (_i > 1) { + left = makeNode(node.args.slice(0, _i)); + } + rightArgs = node.args.slice(_i); + right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs); + res.push(makeNode([left, right])); + } + } + return res; + } + + /** + * Returns the set union of two match-placeholders or null if there is a conflict. + */ + function mergeMatch(match1, match2) { + var res = { + placeholders: {} + }; + + // Some matches may not have placeholders; this is OK + if (!match1.placeholders && !match2.placeholders) { + return res; + } else if (!match1.placeholders) { + return match2; + } else if (!match2.placeholders) { + return match1; + } + + // Placeholders with the same key must match exactly + for (var key in match1.placeholders) { + if (hasOwnProperty(match1.placeholders, key)) { + res.placeholders[key] = match1.placeholders[key]; + if (hasOwnProperty(match2.placeholders, key)) { + if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) { + return null; + } + } + } + } + for (var _key in match2.placeholders) { + if (hasOwnProperty(match2.placeholders, _key)) { + res.placeholders[_key] = match2.placeholders[_key]; + } + } + return res; + } + + /** + * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches. + * Each list represents matches found in one child of a node. + */ + function combineChildMatches(list1, list2) { + var res = []; + if (list1.length === 0 || list2.length === 0) { + return res; + } + var merged; + for (var i1 = 0; i1 < list1.length; i1++) { + for (var i2 = 0; i2 < list2.length; i2++) { + merged = mergeMatch(list1[i1], list2[i2]); + if (merged) { + res.push(merged); + } + } + } + return res; + } + + /** + * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches. + * Each list represents matches found in one child of a node. + * Returns a list of unique matches. + */ + function mergeChildMatches(childMatches) { + if (childMatches.length === 0) { + return childMatches; + } + var sets = childMatches.reduce(combineChildMatches); + var uniqueSets = []; + var unique = {}; + for (var i = 0; i < sets.length; i++) { + var s = JSON.stringify(sets[i]); + if (!unique[s]) { + unique[s] = true; + uniqueSets.push(sets[i]); + } + } + return uniqueSets; + } + + /** + * Determines whether node matches rule. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node + * @param {Object} context -- provides assumed properties of operators + * @param {Boolean} isSplit -- whether we are in process of splitting an + * n-ary operator node into possible binary combinations. + * Defaults to false. + * @return {Object} Information about the match, if it exists. + */ + function _ruleMatch(rule, node, context, isSplit) { + // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')') + // console.log('rule = ' + rule) + // console.log('node = ' + node) + + // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')') + var res = [{ + placeholders: {} + }]; + if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) { + // If the rule is an OperatorNode or a FunctionNode, then node must match exactly + if (rule instanceof OperatorNode) { + if (rule.op !== node.op || rule.fn !== node.fn) { + return []; + } + } else if (rule instanceof FunctionNode) { + if (rule.name !== node.name) { + return []; + } + } + + // rule and node match. Search the children of rule and node. + if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) { + // Expect non-associative operators to match exactly, + // except in any order if operator is commutative + var childMatches = []; + for (var i = 0; i < rule.args.length; i++) { + var childMatch = _ruleMatch(rule.args[i], node.args[i], context); + if (childMatch.length === 0) { + // Child did not match, so stop searching immediately + break; + } + // The child matched, so add the information returned from the child to our result + childMatches.push(childMatch); + } + if (childMatches.length !== rule.args.length) { + if (!isCommutative(node, context) || + // exact match in order needed + rule.args.length === 1) { + // nothing to commute + return []; + } + if (rule.args.length > 2) { + /* Need to generate all permutations and try them. + * It's a bit complicated, and unlikely to come up since there + * are very few ternary or higher operators. So punt for now. + */ + throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented'); + } + /* Exactly two arguments, try them reversed */ + var leftMatch = _ruleMatch(rule.args[0], node.args[1], context); + if (leftMatch.length === 0) { + return []; + } + var rightMatch = _ruleMatch(rule.args[1], node.args[0], context); + if (rightMatch.length === 0) { + return []; + } + childMatches = [leftMatch, rightMatch]; + } + res = mergeChildMatches(childMatches); + } else if (node.args.length >= 2 && rule.args.length === 2) { + // node is flattened, rule is not + // Associative operators/functions can be split in different ways so we check if the rule + // matches for each of them and return their union. + var splits = getSplits(node, context); + var splitMatches = []; + for (var _i2 = 0; _i2 < splits.length; _i2++) { + var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here + splitMatches = splitMatches.concat(matchSet); + } + return splitMatches; + } else if (rule.args.length > 2) { + throw Error('Unexpected non-binary associative function: ' + rule.toString()); + } else { + // Incorrect number of arguments in rule and node, so no match + return []; + } + } else if (rule instanceof SymbolNode) { + // If the rule is a SymbolNode, then it carries a special meaning + // according to the first one or two characters of the symbol node name. + // These meanings are expalined in the documentation for simplify() + if (rule.name.length === 0) { + throw new Error('Symbol in rule has 0 length...!?'); + } + if (SUPPORTED_CONSTANTS[rule.name]) { + // built-in constant must match exactly + if (rule.name !== node.name) { + return []; + } + } else { + // wildcards are composed of up to two alphabetic or underscore characters + switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) { + case 'n': + case '_p': + // rule matches _anything_, so assign this node to the rule.name placeholder + // Assign node to the rule.name placeholder. + // Our parent will check for matches among placeholders. + res[0].placeholders[rule.name] = node; + break; + case 'c': + case 'cl': + // rule matches a ConstantNode + if (isConstantNode(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'v': + // rule matches anything other than a ConstantNode + if (!isConstantNode(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'vl': + // rule matches VariableNode + if (isVariableNode(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'cd': + // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode + if (isNumericNode(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'vd': + // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode + if (!isNumericNode(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 'ce': + // rule matches expressions that have a constant value + if (isConstantExpression(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + case 've': + // rule matches expressions that do not have a constant value + if (!isConstantExpression(node)) { + res[0].placeholders[rule.name] = node; + } else { + // mis-match: rule does not encompass current node + return []; + } + break; + default: + throw new Error('Invalid symbol in rule: ' + rule.name); + } + } + } else if (rule instanceof ConstantNode) { + // Literal constant must match exactly + if (!equal(rule.value, node.value)) { + return []; + } + } else { + // Some other node was encountered which we aren't prepared for, so no match + return []; + } + + // It's a match! + + // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match') + return res; + } + + /** + * Determines whether p and q (and all their children nodes) are identical. + * + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p + * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q + * @return {Object} Information about the match, if it exists. + */ + function _exactMatch(p, q) { + if (p instanceof ConstantNode && q instanceof ConstantNode) { + if (!equal(p.value, q.value)) { + return false; + } + } else if (p instanceof SymbolNode && q instanceof SymbolNode) { + if (p.name !== q.name) { + return false; + } + } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) { + if (p instanceof OperatorNode) { + if (p.op !== q.op || p.fn !== q.fn) { + return false; + } + } else if (p instanceof FunctionNode) { + if (p.name !== q.name) { + return false; + } + } + if (p.args.length !== q.args.length) { + return false; + } + for (var i = 0; i < p.args.length; i++) { + if (!_exactMatch(p.args[i], q.args[i])) { + return false; + } + } + } else { + return false; + } + return true; + } + return simplify; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js new file mode 100644 index 0000000..5d63949 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js @@ -0,0 +1,261 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +import { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js'; +import { factory } from '../../../utils/factory.js'; +import { hasOwnProperty } from '../../../utils/object.js'; +var name = 'simplifyUtil'; +var dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode']; +export var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + FunctionNode, + OperatorNode, + SymbolNode + } = _ref; + // TODO commutative/associative properties rely on the arguments + // e.g. multiply is not commutative for matrices + // The properties should be calculated from an argument to simplify, or possibly something in math.config + // the other option is for typed() to specify a return type so that we can evaluate the type of arguments + + /* So that properties of an operator fit on one line: */ + var T = true; + var F = false; + var defaultName = 'defaultF'; + var defaultContext = { + /* */add: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /**/unaryPlus: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /* */subtract: { + trivial: F, + total: T, + commutative: F, + associative: F + }, + /* */multiply: { + trivial: T, + total: T, + commutative: T, + associative: T + }, + /* */divide: { + trivial: F, + total: T, + commutative: F, + associative: F + }, + /* */paren: { + trivial: T, + total: T, + commutative: T, + associative: F + }, + /* */defaultF: { + trivial: F, + total: T, + commutative: F, + associative: F + } + }; + var realContext = { + divide: { + total: F + }, + log: { + total: F + } + }; + var positiveContext = { + subtract: { + total: F + }, + abs: { + trivial: T + }, + log: { + total: T + } + }; + function hasProperty(nodeOrName, property) { + var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext; + var name = defaultName; + if (typeof nodeOrName === 'string') { + name = nodeOrName; + } else if (isOperatorNode(nodeOrName)) { + name = nodeOrName.fn.toString(); + } else if (isFunctionNode(nodeOrName)) { + name = nodeOrName.name; + } else if (isParenthesisNode(nodeOrName)) { + name = 'paren'; + } + if (hasOwnProperty(context, name)) { + var properties = context[name]; + if (hasOwnProperty(properties, property)) { + return properties[property]; + } + if (hasOwnProperty(defaultContext, name)) { + return defaultContext[name][property]; + } + } + if (hasOwnProperty(context, defaultName)) { + var _properties = context[defaultName]; + if (hasOwnProperty(_properties, property)) { + return _properties[property]; + } + return defaultContext[defaultName][property]; + } + /* name not found in context and context has no global default */ + /* So use default context. */ + if (hasOwnProperty(defaultContext, name)) { + var _properties2 = defaultContext[name]; + if (hasOwnProperty(_properties2, property)) { + return _properties2[property]; + } + } + return defaultContext[defaultName][property]; + } + function isCommutative(node) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext; + return hasProperty(node, 'commutative', context); + } + function isAssociative(node) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext; + return hasProperty(node, 'associative', context); + } + + /** + * Merge the given contexts, with primary overriding secondary + * wherever they might conflict + */ + function mergeContext(primary, secondary) { + var merged = _objectSpread({}, primary); + for (var prop in secondary) { + if (hasOwnProperty(primary, prop)) { + merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]); + } else { + merged[prop] = secondary[prop]; + } + } + return merged; + } + + /** + * Flatten all associative operators in an expression tree. + * Assumes parentheses have already been removed. + */ + function flatten(node, context) { + if (!node.args || node.args.length === 0) { + return node; + } + node.args = allChildren(node, context); + for (var i = 0; i < node.args.length; i++) { + flatten(node.args[i], context); + } + } + + /** + * Get the children of a node as if it has been flattened. + * TODO implement for FunctionNodes + */ + function allChildren(node, context) { + var op; + var children = []; + var _findChildren = function findChildren(node) { + for (var i = 0; i < node.args.length; i++) { + var child = node.args[i]; + if (isOperatorNode(child) && op === child.op) { + _findChildren(child); + } else { + children.push(child); + } + } + }; + if (isAssociative(node, context)) { + op = node.op; + _findChildren(node); + return children; + } else { + return node.args; + } + } + + /** + * Unflatten all flattened operators to a right-heavy binary tree. + */ + function unflattenr(node, context) { + if (!node.args || node.args.length === 0) { + return; + } + var makeNode = createMakeNodeFunction(node); + var l = node.args.length; + for (var i = 0; i < l; i++) { + unflattenr(node.args[i], context); + } + if (l > 2 && isAssociative(node, context)) { + var curnode = node.args.pop(); + while (node.args.length > 0) { + curnode = makeNode([node.args.pop(), curnode]); + } + node.args = curnode.args; + } + } + + /** + * Unflatten all flattened operators to a left-heavy binary tree. + */ + function unflattenl(node, context) { + if (!node.args || node.args.length === 0) { + return; + } + var makeNode = createMakeNodeFunction(node); + var l = node.args.length; + for (var i = 0; i < l; i++) { + unflattenl(node.args[i], context); + } + if (l > 2 && isAssociative(node, context)) { + var curnode = node.args.shift(); + while (node.args.length > 0) { + curnode = makeNode([curnode, node.args.shift()]); + } + node.args = curnode.args; + } + } + function createMakeNodeFunction(node) { + if (isOperatorNode(node)) { + return function (args) { + try { + return new OperatorNode(node.op, node.fn, args, node.implicit); + } catch (err) { + console.error(err); + return []; + } + }; + } else { + return function (args) { + return new FunctionNode(new SymbolNode(node.name), args); + }; + } + } + return { + createMakeNodeFunction, + hasProperty, + isCommutative, + isAssociative, + mergeContext, + flatten, + allChildren, + unflattenr, + unflattenl, + defaultContext, + realContext, + positiveContext + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js new file mode 100644 index 0000000..557ac1c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js @@ -0,0 +1,20 @@ +import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js'; +export { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js'; +export function isNumericNode(x) { + return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]); +} +export function isConstantExpression(x) { + if (isConstantNode(x)) { + // Basic Constant types + return true; + } + if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) { + // Can be constant depending on arguments + return true; + } + if (isParenthesisNode(x) && isConstantExpression(x.content)) { + // Parenthesis are transparent + return true; + } + return false; // Probably missing some edge cases +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js new file mode 100644 index 0000000..e160337 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js @@ -0,0 +1,472 @@ +import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +import { createUtil } from './simplify/util.js'; +import { noBignumber, noFraction } from '../../utils/noop.js'; +var name = 'simplifyConstant'; +var dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode']; +export var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + mathWithTransform, + matrix, + fraction, + bignumber, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + SymbolNode + } = _ref; + var { + isCommutative, + isAssociative, + allChildren, + createMakeNodeFunction + } = createUtil({ + FunctionNode, + OperatorNode, + SymbolNode + }); + + /** + * simplifyConstant() takes a mathjs expression (either a Node representing + * a parse tree or a string which it parses to produce a node), and replaces + * any subexpression of it consisting entirely of constants with the computed + * value of that subexpression. + * + * Syntax: + * + * math.simplifyConstant(expr) + * math.simplifyConstant(expr, options) + * + * Examples: + * + * math.simplifyConstant('x + 4*3/6') // Node "x + 2" + * math.simplifyConstant('z cos(0)') // Node "z 1" + * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node "6.28 t" + * + * See also: + * + * simplify, simplifyCore, resolve, derivative + * + * @param {Node | string} node + * The expression to be simplified + * @param {Object} options + * Simplification options, as per simplify() + * @return {Node} Returns expression with constant subexpressions evaluated + */ + var simplifyConstant = typed('simplifyConstant', { + Node: node => _ensureNode(foldFraction(node, {})), + 'Node, Object': function Node_Object(expr, options) { + return _ensureNode(foldFraction(expr, options)); + } + }); + function _removeFractions(thing) { + if (isFraction(thing)) { + return thing.valueOf(); + } + if (thing instanceof Array) { + return thing.map(_removeFractions); + } + if (isMatrix(thing)) { + return matrix(_removeFractions(thing.valueOf())); + } + return thing; + } + function _eval(fnname, args, options) { + try { + return mathWithTransform[fnname].apply(null, args); + } catch (ignore) { + // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions + args = args.map(_removeFractions); + return _toNumber(mathWithTransform[fnname].apply(null, args), options); + } + } + var _toNode = typed({ + Fraction: _fractionToNode, + number: function number(n) { + if (n < 0) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); + }, + BigNumber: function BigNumber(n) { + if (n < 0) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); // old parameters: (n.toString(), 'number') + }, + bigint: function bigint(n) { + if (n < 0n) { + return unaryMinusNode(new ConstantNode(-n)); + } + return new ConstantNode(n); + }, + Complex: function Complex(s) { + throw new Error('Cannot convert Complex number to Node'); + }, + string: function string(s) { + return new ConstantNode(s); + }, + Matrix: function Matrix(m) { + return new ArrayNode(m.valueOf().map(e => _toNode(e))); + } + }); + function _ensureNode(thing) { + if (isNode(thing)) { + return thing; + } + return _toNode(thing); + } + + // convert a number to a fraction only if it can be expressed exactly, + // and when both numerator and denominator are small enough + function _exactFraction(n, options) { + var exactFractions = options && options.exactFractions !== false; + if (exactFractions && isFinite(n) && fraction) { + var f = fraction(n); + var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default + + if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) { + return f; + } + } + return n; + } + + // Convert numbers to a preferred number type in preference order: Fraction, number, Complex + // BigNumbers are left alone + var _toNumber = typed({ + 'string, Object': function string_Object(s, options) { + var numericType = safeNumberType(s, config); + if (numericType === 'BigNumber') { + if (bignumber === undefined) { + noBignumber(); + } + return bignumber(s); + } else if (numericType === 'bigint') { + return BigInt(s); + } else if (numericType === 'Fraction') { + if (fraction === undefined) { + noFraction(); + } + return fraction(s); + } else { + var n = parseFloat(s); + return _exactFraction(n, options); + } + }, + 'Fraction, Object': function Fraction_Object(s, options) { + return s; + }, + // we don't need options here + + 'BigNumber, Object': function BigNumber_Object(s, options) { + return s; + }, + // we don't need options here + + 'number, Object': function number_Object(s, options) { + return _exactFraction(s, options); + }, + 'bigint, Object': function bigint_Object(s, options) { + return s; + }, + 'Complex, Object': function Complex_Object(s, options) { + if (s.im !== 0) { + return s; + } + return _exactFraction(s.re, options); + }, + 'Matrix, Object': function Matrix_Object(s, options) { + return matrix(_exactFraction(s.valueOf())); + }, + 'Array, Object': function Array_Object(s, options) { + return s.map(_exactFraction); + } + }); + function unaryMinusNode(n) { + return new OperatorNode('-', 'unaryMinus', [n]); + } + function _fractionToNode(f) { + var n; + var vn = f.s * f.n; + if (vn < 0) { + n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]); + } else { + n = new ConstantNode(vn); + } + if (f.d === 1) { + return n; + } + return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]); + } + + /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */ + function _foldAccessor(obj, index, options) { + if (!isIndexNode(index)) { + // don't know what to do with that... + return new AccessorNode(_ensureNode(obj), _ensureNode(index)); + } + if (isArrayNode(obj) || isMatrix(obj)) { + var remainingDims = Array.from(index.dimensions); + /* We will resolve constant indices one at a time, looking + * just in the first or second dimensions because (a) arrays + * of more than two dimensions are likely rare, and (b) pulling + * out the third or higher dimension would be pretty intricate. + * The price is that we miss simplifying [..3d array][x,y,1] + */ + while (remainingDims.length > 0) { + if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') { + var first = _toNumber(remainingDims.shift().value, options); + if (isArrayNode(obj)) { + obj = obj.items[first - 1]; + } else { + // matrix + obj = obj.valueOf()[first - 1]; + if (obj instanceof Array) { + obj = matrix(obj); + } + } + } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') { + var second = _toNumber(remainingDims[1].value, options); + var tryItems = []; + var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf(); + for (var item of fromItems) { + if (isArrayNode(item)) { + tryItems.push(item.items[second - 1]); + } else if (isMatrix(obj)) { + tryItems.push(item[second - 1]); + } else { + break; + } + } + if (tryItems.length === fromItems.length) { + if (isArrayNode(obj)) { + obj = new ArrayNode(tryItems); + } else { + // matrix + obj = matrix(tryItems); + } + remainingDims.splice(1, 1); + } else { + // extracting slice along 2nd dimension failed, give up + break; + } + } else { + // neither 1st or 2nd dimension is constant, give up + break; + } + } + if (remainingDims.length === index.dimensions.length) { + /* No successful constant indexing */ + return new AccessorNode(_ensureNode(obj), index); + } + if (remainingDims.length > 0) { + /* Indexed some but not all dimensions */ + index = new IndexNode(remainingDims); + return new AccessorNode(_ensureNode(obj), index); + } + /* All dimensions were constant, access completely resolved */ + return obj; + } + if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) { + var key = index.dimensions[0].value; + if (key in obj.properties) { + return obj.properties[key]; + } + return new ConstantNode(); // undefined + } + /* Don't know how to index this sort of obj, at least not with this index */ + return new AccessorNode(_ensureNode(obj), index); + } + + /* + * Create a binary tree from a list of Fractions and Nodes. + * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so + * `args` should be sorted to have the Fractions at the start (if the operator is commutative). + * @param args - list of Fractions and Nodes + * @param fn - evaluator for the binary operation evaluator that accepts two Fractions + * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes + * if args.length is 1, returns args[0] + * @return - Either a Node representing a binary expression or Fraction + */ + function foldOp(fn, args, makeNode, options) { + var first = args.shift(); + + // In the following reduction, sofar always has one of the three following + // forms: [NODE], [CONSTANT], or [NODE, CONSTANT] + var reduction = args.reduce((sofar, next) => { + if (!isNode(next)) { + var last = sofar.pop(); + if (isNode(last)) { + return [last, next]; + } + // Two constants in a row, try to fold them into one + try { + sofar.push(_eval(fn, [last, next], options)); + return sofar; + } catch (ignoreandcontinue) { + sofar.push(last); + // fall through to Node case + } + } + + // Encountered a Node, or failed folding -- + // collapse everything so far into a single tree: + sofar.push(_ensureNode(sofar.pop())); + var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar); + return [makeNode([newtree, _ensureNode(next)])]; + }, [first]); + if (reduction.length === 1) { + return reduction[0]; + } + // Might end up with a tree and a constant at the end: + return makeNode([reduction[0], _toNode(reduction[1])]); + } + + // destroys the original node and returns a folded one + function foldFraction(node, options) { + switch (node.type) { + case 'SymbolNode': + return node; + case 'ConstantNode': + switch (typeof node.value) { + case 'number': + return _toNumber(node.value, options); + case 'bigint': + return _toNumber(node.value, options); + case 'string': + return node.value; + default: + if (!isNaN(node.value)) return _toNumber(node.value, options); + } + return node; + case 'FunctionNode': + if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) { + return node; + } + { + // Process operators as OperatorNode + var operatorFunctions = ['add', 'multiply']; + if (!operatorFunctions.includes(node.name)) { + var args = node.args.map(arg => foldFraction(arg, options)); + + // If all args are numbers + if (!args.some(isNode)) { + try { + return _eval(node.name, args, options); + } catch (ignoreandcontinue) {} + } + + // Size of a matrix does not depend on entries + if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) { + var sz = []; + var section = args[0]; + while (isArrayNode(section)) { + sz.push(section.items.length); + section = section.items[0]; + } + return matrix(sz); + } + + // Convert all args to nodes and construct a symbolic function call + return new FunctionNode(node.name, args.map(_ensureNode)); + } else { + // treat as operator + } + } + /* falls through */ + case 'OperatorNode': + { + var fn = node.fn.toString(); + var _args; + var res; + var makeNode = createMakeNodeFunction(node); + if (isOperatorNode(node) && node.isUnary()) { + _args = [foldFraction(node.args[0], options)]; + if (!isNode(_args[0])) { + res = _eval(fn, _args, options); + } else { + res = makeNode(_args); + } + } else if (isAssociative(node, options.context)) { + _args = allChildren(node, options.context); + _args = _args.map(arg => foldFraction(arg, options)); + if (isCommutative(fn, options.context)) { + // commutative binary operator + var consts = []; + var vars = []; + for (var i = 0; i < _args.length; i++) { + if (!isNode(_args[i])) { + consts.push(_args[i]); + } else { + vars.push(_args[i]); + } + } + if (consts.length > 1) { + res = foldOp(fn, consts, makeNode, options); + vars.unshift(res); + res = foldOp(fn, vars, makeNode, options); + } else { + // we won't change the children order since it's not neccessary + res = foldOp(fn, _args, makeNode, options); + } + } else { + // non-commutative binary operator + res = foldOp(fn, _args, makeNode, options); + } + } else { + // non-associative binary operator + _args = node.args.map(arg => foldFraction(arg, options)); + res = foldOp(fn, _args, makeNode, options); + } + return res; + } + case 'ParenthesisNode': + // remove the uneccessary parenthesis + return foldFraction(node.content, options); + case 'AccessorNode': + return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options); + case 'ArrayNode': + { + var foldItems = node.items.map(item => foldFraction(item, options)); + if (foldItems.some(isNode)) { + return new ArrayNode(foldItems.map(_ensureNode)); + } + /* All literals -- return a Matrix so we can operate on it */ + return matrix(foldItems); + } + case 'IndexNode': + { + return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options))); + } + case 'ObjectNode': + { + var foldProps = {}; + for (var prop in node.properties) { + foldProps[prop] = simplifyConstant(node.properties[prop], options); + } + return new ObjectNode(foldProps); + } + case 'AssignmentNode': + /* falls through */ + case 'BlockNode': + /* falls through */ + case 'FunctionAssignmentNode': + /* falls through */ + case 'RangeNode': + /* falls through */ + case 'ConditionalNode': + /* falls through */ + default: + throw new Error("Unimplemented node type in simplifyConstant: ".concat(node.type)); + } + } + return simplifyConstant; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js new file mode 100644 index 0000000..07139bc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js @@ -0,0 +1,291 @@ +import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js'; +import { getOperator } from '../../expression/operators.js'; +import { createUtil } from './simplify/util.js'; +import { factory } from '../../utils/factory.js'; +var name = 'simplifyCore'; +var dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode']; +export var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + parse, + equal, + isZero, + add, + subtract, + multiply, + divide, + pow, + AccessorNode, + ArrayNode, + ConstantNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + SymbolNode + } = _ref; + var node0 = new ConstantNode(0); + var node1 = new ConstantNode(1); + var nodeT = new ConstantNode(true); + var nodeF = new ConstantNode(false); + // test if a node will always have a boolean value (true/false) + // not sure if this list is complete + function isAlwaysBoolean(node) { + return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op); + } + var { + hasProperty, + isCommutative + } = createUtil({ + FunctionNode, + OperatorNode, + SymbolNode + }); + /** + * simplifyCore() performs single pass simplification suitable for + * applications requiring ultimate performance. To roughly summarize, + * it handles cases along the lines of simplifyConstant() but where + * knowledge of a single argument is sufficient to determine the value. + * In contrast, simplify() extends simplifyCore() with additional passes + * to provide deeper simplification (such as gathering like terms). + * + * Specifically, simplifyCore: + * + * * Converts all function calls with operator equivalents to their + * operator forms. + * * Removes operators or function calls that are guaranteed to have no + * effect (such as unary '+'). + * * Removes double unary '-', '~', and 'not' + * * Eliminates addition/subtraction of 0 and multiplication/division/powers + * by 1 or 0. + * * Converts addition of a negation into subtraction. + * * Eliminates logical operations with constant true or false leading + * arguments. + * * Puts constants on the left of a product, if multiplication is + * considered commutative by the options (which is the default) + * + * Syntax: + * + * math.simplifyCore(expr) + * math.simplifyCore(expr, options) + * + * Examples: + * + * const f = math.parse('2 * 1 * x ^ (1 - 0)') + * math.simplifyCore(f) // Node "2 * x" + * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node "2 * x" + * + * See also: + * + * simplify, simplifyConstant, resolve, derivative + * + * @param {Node | string} node + * The expression to be simplified + * @param {Object} options + * Simplification options, as per simplify() + * @return {Node} Returns expression with basic simplifications applied + */ + function _simplifyCore(nodeToSimplify) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var context = options ? options.context : undefined; + if (hasProperty(nodeToSimplify, 'trivial', context)) { + // This node does nothing if it has only one argument, so if so, + // return that argument simplified + if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) { + return _simplifyCore(nodeToSimplify.args[0], options); + } + // For other node types, we try the generic methods + var simpChild = false; + var childCount = 0; + nodeToSimplify.forEach(c => { + ++childCount; + if (childCount === 1) { + simpChild = _simplifyCore(c, options); + } + }); + if (childCount === 1) { + return simpChild; + } + } + var node = nodeToSimplify; + if (isFunctionNode(node)) { + var op = getOperator(node.name); + if (op) { + // Replace FunctionNode with a new OperatorNode + if (node.args.length > 2 && hasProperty(node, 'associative', context)) { + // unflatten into binary operations since that's what simplifyCore handles + while (node.args.length > 2) { + var last = node.args.pop(); + var seclast = node.args.pop(); + node.args.push(new OperatorNode(op, node.name, [last, seclast])); + } + } + node = new OperatorNode(op, node.name, node.args); + } else { + return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options))); + } + } + if (isOperatorNode(node) && node.isUnary()) { + var a0 = _simplifyCore(node.args[0], options); + if (node.op === '~') { + // bitwise not + if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') { + return a0.args[0]; + } + } + if (node.op === 'not') { + // logical not + if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') { + // Has the effect of turning the argument into a boolean + // So can only eliminate the double negation if + // the inside is already boolean + if (isAlwaysBoolean(a0.args[0])) { + return a0.args[0]; + } + } + } + var finish = true; + if (node.op === '-') { + // unary minus + if (isOperatorNode(a0)) { + if (a0.isBinary() && a0.fn === 'subtract') { + node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]); + finish = false; // continue to process the new binary node + } + if (a0.isUnary() && a0.op === '-') { + return a0.args[0]; + } + } + } + if (finish) return new OperatorNode(node.op, node.fn, [a0]); + } + if (isOperatorNode(node) && node.isBinary()) { + var _a = _simplifyCore(node.args[0], options); + var a1 = _simplifyCore(node.args[1], options); + if (node.op === '+') { + if (isConstantNode(_a) && isZero(_a.value)) { + return a1; + } + if (isConstantNode(a1) && isZero(a1.value)) { + return _a; + } + if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') { + a1 = a1.args[0]; + node = new OperatorNode('-', 'subtract', [_a, a1]); + } + } + if (node.op === '-') { + if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') { + return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options); + } + if (isConstantNode(_a) && isZero(_a.value)) { + return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1])); + } + if (isConstantNode(a1) && isZero(a1.value)) { + return _a; + } + return new OperatorNode(node.op, node.fn, [_a, a1]); + } + if (node.op === '*') { + if (isConstantNode(_a)) { + if (isZero(_a.value)) { + return node0; + } else if (equal(_a.value, 1)) { + return a1; + } + } + if (isConstantNode(a1)) { + if (isZero(a1.value)) { + return node0; + } else if (equal(a1.value, 1)) { + return _a; + } + if (isCommutative(node, context)) { + return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left + } + } + return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit); + } + if (node.op === '/') { + if (isConstantNode(_a) && isZero(_a.value)) { + return node0; + } + if (isConstantNode(a1) && equal(a1.value, 1)) { + return _a; + } + return new OperatorNode(node.op, node.fn, [_a, a1]); + } + if (node.op === '^') { + if (isConstantNode(a1)) { + if (isZero(a1.value)) { + return node1; + } else if (equal(a1.value, 1)) { + return _a; + } + } + } + if (node.op === 'and') { + if (isConstantNode(_a)) { + if (_a.value) { + if (isAlwaysBoolean(a1)) return a1; + if (isConstantNode(a1)) { + return a1.value ? nodeT : nodeF; + } + } else { + return nodeF; + } + } + if (isConstantNode(a1)) { + if (a1.value) { + if (isAlwaysBoolean(_a)) return _a; + } else { + return nodeF; + } + } + } + if (node.op === 'or') { + if (isConstantNode(_a)) { + if (_a.value) { + return nodeT; + } else { + if (isAlwaysBoolean(a1)) return a1; + } + } + if (isConstantNode(a1)) { + if (a1.value) { + return nodeT; + } else { + if (isAlwaysBoolean(_a)) return _a; + } + } + } + return new OperatorNode(node.op, node.fn, [_a, a1]); + } + if (isOperatorNode(node)) { + return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options))); + } + if (isArrayNode(node)) { + return new ArrayNode(node.items.map(n => _simplifyCore(n, options))); + } + if (isAccessorNode(node)) { + return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options)); + } + if (isIndexNode(node)) { + return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options))); + } + if (isObjectNode(node)) { + var newProps = {}; + for (var prop in node.properties) { + newProps[prop] = _simplifyCore(node.properties[prop], options); + } + return new ObjectNode(newProps); + } + // cannot simplify + return node; + } + return typed(name, { + Node: _simplifyCore, + 'Node,Object': _simplifyCore + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js new file mode 100644 index 0000000..ed0bc60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js @@ -0,0 +1,157 @@ +import { factory } from '../../../utils/factory.js'; +import { createSolveValidation } from './utils/solveValidation.js'; +var name = 'lsolve'; +var dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +export var createLsolve = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + var solveValidation = createSolveValidation({ + DenseMatrix + }); + + /** + * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution. + * + * `L * x = b` + * + * Syntax: + * + * math.lsolve(L, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = lsolve(a, b) // [[-5.5], [20]] + * + * See also: + * + * lsolveAll, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} L A N x N matrix or array (L) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix | Array} A column vector with the linear system solution (x) + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) { + return _sparseForwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) { + return _denseForwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function Array_Array__Matrix(a, b) { + var m = matrix(a); + var r = _denseForwardSubstitution(m, b); + return r.valueOf(); + } + }); + function _denseForwardSubstitution(m, b) { + // validate matrix and vector, return copy of column vector b + b = solveValidation(m, b, true); + var bdata = b._data; + var rows = m._size[0]; + var columns = m._size[1]; + + // result + var x = []; + var mdata = m._data; + + // loop columns + for (var j = 0; j < columns; j++) { + var bj = bdata[j][0] || 0; + var xj = void 0; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + var vjj = mdata[j][j]; + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + xj = divideScalar(bj, vjj); + + // loop rows + for (var i = j + 1; i < rows; i++) { + bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]; + } + } else { + // degenerate row, we can choose any value + xj = 0; + } + x[j] = [xj]; + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } + function _sparseForwardSubstitution(m, b) { + // validate matrix and vector, return copy of column vector b + b = solveValidation(m, b, true); + var bdata = b._data; + var rows = m._size[0]; + var columns = m._size[1]; + var values = m._values; + var index = m._index; + var ptr = m._ptr; + + // result + var x = []; + + // loop columns + for (var j = 0; j < columns; j++) { + var bj = bdata[j][0] || 0; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + var vjj = 0; + // matrix values & indices (column j) + var jValues = []; + var jIndices = []; + + // first and last index in the column + var firstIndex = ptr[j]; + var lastIndex = ptr[j + 1]; + + // values in column, find value at [j, j] + for (var k = firstIndex; k < lastIndex; k++) { + var i = index[k]; + + // check row (rows are not sorted!) + if (i === j) { + vjj = values[k]; + } else if (i > j) { + // store lower triangular + jValues.push(values[k]); + jIndices.push(i); + } + } + + // at this point we must have a value in vjj + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + var xj = divideScalar(bj, vjj); + for (var _k = 0, l = jIndices.length; _k < l; _k++) { + var _i = jIndices[_k]; + bdata[_i] = [subtractScalar(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))]; + } + x[j] = [xj]; + } else { + // degenerate row, we can choose any value + x[j] = [0]; + } + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js new file mode 100644 index 0000000..a6f2d8c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js @@ -0,0 +1,186 @@ +import { factory } from '../../../utils/factory.js'; +import { createSolveValidation } from './utils/solveValidation.js'; +var name = 'lsolveAll'; +var dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +export var createLsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + var solveValidation = createSolveValidation({ + DenseMatrix + }); + + /** + * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. + * + * `L * x = b` + * + * Syntax: + * + * math.lsolveAll(L, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ] + * + * See also: + * + * lsolve, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} L A N x N matrix or array (L) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) { + return _sparseForwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) { + return _denseForwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function Array_Array__Matrix(a, b) { + var m = matrix(a); + var R = _denseForwardSubstitution(m, b); + return R.map(r => r.valueOf()); + } + }); + function _denseForwardSubstitution(m, b_) { + // the algorithm is derived from + // https://www.overleaf.com/read/csvgqdxggyjv + + // array of right-hand sides + var B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + var M = m._data; + var rows = m._size[0]; + var columns = m._size[1]; + + // loop columns + for (var i = 0; i < columns; i++) { + var L = B.length; + + // loop right-hand sides + for (var k = 0; k < L; k++) { + var b = B[k]; + if (!equalScalar(M[i][i], 0)) { + // non-singular row + + b[i] = divideScalar(b[i], M[i][i]); + for (var j = i + 1; j < columns; j++) { + // b[j] -= b[i] * M[j,i] + b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + var bNew = [...b]; + bNew[i] = 1; + for (var _j = i + 1; _j < columns; _j++) { + bNew[_j] = subtractScalar(bNew[_j], M[_j][i]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } + function _sparseForwardSubstitution(m, b_) { + // array of right-hand sides + var B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + var rows = m._size[0]; + var columns = m._size[1]; + var values = m._values; + var index = m._index; + var ptr = m._ptr; + + // loop columns + for (var i = 0; i < columns; i++) { + var L = B.length; + + // loop right-hand sides + for (var k = 0; k < L; k++) { + var b = B[k]; + + // values & indices (column i) + var iValues = []; + var iIndices = []; + + // first & last indeces in column + var firstIndex = ptr[i]; + var lastIndex = ptr[i + 1]; + + // find the value at [i, i] + var Mii = 0; + for (var j = firstIndex; j < lastIndex; j++) { + var J = index[j]; + // check row + if (J === i) { + Mii = values[j]; + } else if (J > i) { + // store lower triangular + iValues.push(values[j]); + iIndices.push(J); + } + } + if (!equalScalar(Mii, 0)) { + // non-singular row + + b[i] = divideScalar(b[i], Mii); + for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) { + var _J = iIndices[_j2]; + b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + var bNew = [...b]; + bNew[i] = 1; + for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) { + var _J2 = iIndices[_j3]; + bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js new file mode 100644 index 0000000..a0109e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js @@ -0,0 +1,108 @@ +import { isArray, isMatrix } from '../../../utils/is.js'; +import { factory } from '../../../utils/factory.js'; +import { createSolveValidation } from './utils/solveValidation.js'; +import { csIpvec } from '../sparse/csIpvec.js'; +var name = 'lusolve'; +var dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix']; +export var createLusolve = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + lup, + slu, + usolve, + lsolve, + DenseMatrix + } = _ref; + var solveValidation = createSolveValidation({ + DenseMatrix + }); + + /** + * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector. + * + * Syntax: + * + * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b + * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A) + * + * Examples: + * + * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]] + * + * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]] + * + * const f = math.lup(m) + * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]] + * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]] + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = math.lusolve(a, b) // [[2], [5]] + * + * See also: + * + * lup, slu, lsolve, usolve + * + * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition + * @param {Matrix | Array} b Column Vector + * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix + * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix. + * + * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b + */ + return typed(name, { + 'Array, Array | Matrix': function Array_Array__Matrix(a, b) { + a = matrix(a); + var d = lup(a); + var x = _lusolve(d.L, d.U, d.p, null, b); + return x.valueOf(); + }, + 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(a, b) { + var d = lup(a); + return _lusolve(d.L, d.U, d.p, null, b); + }, + 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(a, b) { + var d = lup(a); + return _lusolve(d.L, d.U, d.p, null, b); + }, + 'SparseMatrix, Array | Matrix, number, number': function SparseMatrix_Array__Matrix_number_number(a, b, order, threshold) { + var d = slu(a, order, threshold); + return _lusolve(d.L, d.U, d.p, d.q, b); + }, + 'Object, Array | Matrix': function Object_Array__Matrix(d, b) { + return _lusolve(d.L, d.U, d.p, d.q, b); + } + }); + function _toMatrix(a) { + if (isMatrix(a)) { + return a; + } + if (isArray(a)) { + return matrix(a); + } + throw new TypeError('Invalid Matrix LU decomposition'); + } + function _lusolve(l, u, p, q, b) { + // verify decomposition + l = _toMatrix(l); + u = _toMatrix(u); + + // apply row permutations if needed (b is a DenseMatrix) + if (p) { + b = solveValidation(l, b, true); + b._data = csIpvec(p, b._data); + } + + // use forward substitution to resolve L * y = b + var y = lsolve(l, b); + // use backward substitution to resolve U * x = y + var x = usolve(u, y); + + // apply column permutations if needed (x is a DenseMatrix) + if (q) { + x._data = csIpvec(q, x._data); + } + return x; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js new file mode 100644 index 0000000..5ca5d9d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js @@ -0,0 +1,161 @@ +import { factory } from '../../../utils/factory.js'; +import { createSolveValidation } from './utils/solveValidation.js'; +var name = 'usolve'; +var dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +export var createUsolve = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + var solveValidation = createSolveValidation({ + DenseMatrix + }); + + /** + * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution. + * + * `U * x = b` + * + * Syntax: + * + * math.usolve(U, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = usolve(a, b) // [[8], [9]] + * + * See also: + * + * usolveAll, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} U A N x N matrix or array (U) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix | Array} A column vector with the linear system solution (x) + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) { + return _sparseBackwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) { + return _denseBackwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function Array_Array__Matrix(a, b) { + var m = matrix(a); + var r = _denseBackwardSubstitution(m, b); + return r.valueOf(); + } + }); + function _denseBackwardSubstitution(m, b) { + // make b into a column vector + b = solveValidation(m, b, true); + var bdata = b._data; + var rows = m._size[0]; + var columns = m._size[1]; + + // result + var x = []; + var mdata = m._data; + // loop columns backwards + for (var j = columns - 1; j >= 0; j--) { + // b[j] + var bj = bdata[j][0] || 0; + // x[j] + var xj = void 0; + if (!equalScalar(bj, 0)) { + // value at [j, j] + var vjj = mdata[j][j]; + if (equalScalar(vjj, 0)) { + // system cannot be solved + throw new Error('Linear system cannot be solved since matrix is singular'); + } + xj = divideScalar(bj, vjj); + + // loop rows + for (var i = j - 1; i >= 0; i--) { + // update copy of b + bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))]; + } + } else { + // zero value at j + xj = 0; + } + // update x + x[j] = [xj]; + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } + function _sparseBackwardSubstitution(m, b) { + // make b into a column vector + b = solveValidation(m, b, true); + var bdata = b._data; + var rows = m._size[0]; + var columns = m._size[1]; + var values = m._values; + var index = m._index; + var ptr = m._ptr; + + // result + var x = []; + + // loop columns backwards + for (var j = columns - 1; j >= 0; j--) { + var bj = bdata[j][0] || 0; + if (!equalScalar(bj, 0)) { + // non-degenerate row, find solution + + var vjj = 0; + + // upper triangular matrix values & index (column j) + var jValues = []; + var jIndices = []; + + // first & last indeces in column + var firstIndex = ptr[j]; + var lastIndex = ptr[j + 1]; + + // values in column, find value at [j, j], loop backwards + for (var k = lastIndex - 1; k >= firstIndex; k--) { + var i = index[k]; + + // check row (rows are not sorted!) + if (i === j) { + vjj = values[k]; + } else if (i < j) { + // store upper triangular + jValues.push(values[k]); + jIndices.push(i); + } + } + + // at this point we must have a value in vjj + if (equalScalar(vjj, 0)) { + throw new Error('Linear system cannot be solved since matrix is singular'); + } + var xj = divideScalar(bj, vjj); + for (var _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) { + var _i = jIndices[_k]; + bdata[_i] = [subtractScalar(bdata[_i][0], multiplyScalar(xj, jValues[_k]))]; + } + x[j] = [xj]; + } else { + // degenerate row, we can choose any value + x[j] = [0]; + } + } + return new DenseMatrix({ + data: x, + size: [rows, 1] + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js new file mode 100644 index 0000000..39366c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js @@ -0,0 +1,190 @@ +import { factory } from '../../../utils/factory.js'; +import { createSolveValidation } from './utils/solveValidation.js'; +var name = 'usolveAll'; +var dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix']; +export var createUsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divideScalar, + multiplyScalar, + subtractScalar, + equalScalar, + DenseMatrix + } = _ref; + var solveValidation = createSolveValidation({ + DenseMatrix + }); + + /** + * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. + * + * `U * x = b` + * + * Syntax: + * + * math.usolveAll(U, b) + * + * Examples: + * + * const a = [[-2, 3], [2, 1]] + * const b = [11, 9] + * const x = usolveAll(a, b) // [ [[8], [9]] ] + * + * See also: + * + * usolve, lup, slu, usolve, lusolve + * + * @param {Matrix, Array} U A N x N matrix or array (U) + * @param {Matrix, Array} b A column vector with the b values + * + * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system + */ + return typed(name, { + 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) { + return _sparseBackwardSubstitution(m, b); + }, + 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) { + return _denseBackwardSubstitution(m, b); + }, + 'Array, Array | Matrix': function Array_Array__Matrix(a, b) { + var m = matrix(a); + var R = _denseBackwardSubstitution(m, b); + return R.map(r => r.valueOf()); + } + }); + function _denseBackwardSubstitution(m, b_) { + // the algorithm is derived from + // https://www.overleaf.com/read/csvgqdxggyjv + + // array of right-hand sides + var B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + var M = m._data; + var rows = m._size[0]; + var columns = m._size[1]; + + // loop columns backwards + for (var i = columns - 1; i >= 0; i--) { + var L = B.length; + + // loop right-hand sides + for (var k = 0; k < L; k++) { + var b = B[k]; + if (!equalScalar(M[i][i], 0)) { + // non-singular row + + b[i] = divideScalar(b[i], M[i][i]); + for (var j = i - 1; j >= 0; j--) { + // b[j] -= b[i] * M[j,i] + b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + var bNew = [...b]; + bNew[i] = 1; + for (var _j = i - 1; _j >= 0; _j--) { + bNew[_j] = subtractScalar(bNew[_j], M[_j][i]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } + function _sparseBackwardSubstitution(m, b_) { + // array of right-hand sides + var B = [solveValidation(m, b_, true)._data.map(e => e[0])]; + var rows = m._size[0]; + var columns = m._size[1]; + var values = m._values; + var index = m._index; + var ptr = m._ptr; + + // loop columns backwards + for (var i = columns - 1; i >= 0; i--) { + var L = B.length; + + // loop right-hand sides + for (var k = 0; k < L; k++) { + var b = B[k]; + + // values & indices (column i) + var iValues = []; + var iIndices = []; + + // first & last indeces in column + var firstIndex = ptr[i]; + var lastIndex = ptr[i + 1]; + + // find the value at [i, i] + var Mii = 0; + for (var j = lastIndex - 1; j >= firstIndex; j--) { + var J = index[j]; + // check row + if (J === i) { + Mii = values[j]; + } else if (J < i) { + // store upper triangular + iValues.push(values[j]); + iIndices.push(J); + } + } + if (!equalScalar(Mii, 0)) { + // non-singular row + + b[i] = divideScalar(b[i], Mii); + + // loop upper triangular + for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) { + var _J = iIndices[_j2]; + b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2])); + } + } else if (!equalScalar(b[i], 0)) { + // singular row, nonzero RHS + + if (k === 0) { + // There is no valid solution + return []; + } else { + // This RHS is invalid but other solutions may still exist + B.splice(k, 1); + k -= 1; + L -= 1; + } + } else if (k === 0) { + // singular row, RHS is zero + + var bNew = [...b]; + bNew[i] = 1; + + // loop upper triangular + for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) { + var _J2 = iIndices[_j3]; + bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]); + } + B.push(bNew); + } + } + } + return B.map(x => new DenseMatrix({ + data: x.map(e => [e]), + size: [rows, 1] + })); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js new file mode 100644 index 0000000..42239a1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js @@ -0,0 +1,115 @@ +import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js'; +import { arraySize } from '../../../../utils/array.js'; +import { format } from '../../../../utils/string.js'; +export function createSolveValidation(_ref) { + var { + DenseMatrix + } = _ref; + /** + * Validates matrix and column vector b for backward/forward substitution algorithms. + * + * @param {Matrix} m An N x N matrix + * @param {Array | Matrix} b A column vector + * @param {Boolean} copy Return a copy of vector b + * + * @return {DenseMatrix} Dense column vector b + */ + return function solveValidation(m, b, copy) { + var mSize = m.size(); + if (mSize.length !== 2) { + throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')'); + } + var rows = mSize[0]; + var columns = mSize[1]; + if (rows !== columns) { + throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')'); + } + var data = []; + if (isMatrix(b)) { + var bSize = b.size(); + var bdata = b._data; + + // 1-dim vector + if (bSize.length === 1) { + if (bSize[0] !== rows) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (var i = 0; i < rows; i++) { + data[i] = [bdata[i]]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + + // 2-dim column + if (bSize.length === 2) { + if (bSize[0] !== rows || bSize[1] !== 1) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + if (isDenseMatrix(b)) { + if (copy) { + data = []; + for (var _i = 0; _i < rows; _i++) { + data[_i] = [bdata[_i][0]]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + return b; + } + if (isSparseMatrix(b)) { + for (var _i2 = 0; _i2 < rows; _i2++) { + data[_i2] = [0]; + } + var values = b._values; + var index = b._index; + var ptr = b._ptr; + for (var k1 = ptr[1], k = ptr[0]; k < k1; k++) { + var _i3 = index[k]; + data[_i3][0] = values[k]; + } + return new DenseMatrix({ + data, + size: [rows, 1], + datatype: b._datatype + }); + } + } + throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.'); + } + if (isArray(b)) { + var bsize = arraySize(b); + if (bsize.length === 1) { + if (bsize[0] !== rows) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (var _i4 = 0; _i4 < rows; _i4++) { + data[_i4] = [b[_i4]]; + } + return new DenseMatrix({ + data, + size: [rows, 1] + }); + } + if (bsize.length === 2) { + if (bsize[0] !== rows || bsize[1] !== 1) { + throw new RangeError('Dimension mismatch. Matrix columns must match vector length.'); + } + for (var _i5 = 0; _i5 < rows; _i5++) { + data[_i5] = [b[_i5][0]]; + } + return new DenseMatrix({ + data, + size: [rows, 1] + }); + } + throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.'); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js new file mode 100644 index 0000000..c83299c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js @@ -0,0 +1,580 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { factory } from '../../../utils/factory.js'; +import { csFkeep } from './csFkeep.js'; +import { csFlip } from './csFlip.js'; +import { csTdfs } from './csTdfs.js'; +var name = 'csAmd'; +var dependencies = ['add', 'multiply', 'transpose']; +export var createCsAmd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + add, + multiply, + transpose + } = _ref; + /** + * Approximate minimum degree ordering. The minimum degree algorithm is a widely used + * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization + * than A. It is a gready method that selects the sparsest pivot row and column during the course + * of a right looking sparse Cholesky factorization. + * + * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR + * @param {Matrix} m Sparse Matrix + */ + return function csAmd(order, a) { + // check input parameters + if (!a || order <= 0 || order > 3) { + return null; + } + // a matrix arrays + var asize = a._size; + // rows and columns + var m = asize[0]; + var n = asize[1]; + // initialize vars + var lemax = 0; + // dense threshold + var dense = Math.max(16, 10 * Math.sqrt(n)); + dense = Math.min(n - 2, dense); + // create target matrix C + var cm = _createTargetMatrix(order, a, m, n, dense); + // drop diagonal entries + csFkeep(cm, _diag, null); + // C matrix arrays + var cindex = cm._index; + var cptr = cm._ptr; + + // number of nonzero elements in C + var cnz = cptr[n]; + + // allocate result (n+1) + var P = []; + + // create workspace (8 * (n + 1)) + var W = []; + var len = 0; // first n + 1 entries + var nv = n + 1; // next n + 1 entries + var next = 2 * (n + 1); // next n + 1 entries + var head = 3 * (n + 1); // next n + 1 entries + var elen = 4 * (n + 1); // next n + 1 entries + var degree = 5 * (n + 1); // next n + 1 entries + var w = 6 * (n + 1); // next n + 1 entries + var hhead = 7 * (n + 1); // last n + 1 entries + + // use P as workspace for last + var last = P; + + // initialize quotient graph + var mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree); + + // initialize degree lists + var nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next); + + // minimum degree node + var mindeg = 0; + + // vars + var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d; + + // while (selecting pivots) do + while (nel < n) { + // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first + // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow + // many nodes have been eliminated. + for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++); + if (W[next + k] !== -1) { + last[W[next + k]] = -1; + } + // remove k from degree list + W[head + mindeg] = W[next + k]; + // elenk = |Ek| + var elenk = W[elen + k]; + // # of nodes k represents + var nvk = W[nv + k]; + // W[nv + k] nodes of A eliminated + nel += nvk; + + // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is + // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the + // degree lists. All elements e in Ek are absorved into element k. + var dk = 0; + // flag k as in Lk + W[nv + k] = -nvk; + var p = cptr[k]; + // do in place if W[elen + k] === 0 + var pk1 = elenk === 0 ? p : cnz; + var pk2 = pk1; + for (k1 = 1; k1 <= elenk + 1; k1++) { + if (k1 > elenk) { + // search the nodes in k + e = k; + // list of nodes starts at cindex[pj] + pj = p; + // length of list of nodes in k + ln = W[len + k] - elenk; + } else { + // search the nodes in e + e = cindex[p++]; + pj = cptr[e]; + // length of list of nodes in e + ln = W[len + e]; + } + for (k2 = 1; k2 <= ln; k2++) { + i = cindex[pj++]; + // check node i dead, or seen + if ((nvi = W[nv + i]) <= 0) { + continue; + } + // W[degree + Lk] += size of node i + dk += nvi; + // negate W[nv + i] to denote i in Lk + W[nv + i] = -nvi; + // place i in Lk + cindex[pk2++] = i; + if (W[next + i] !== -1) { + last[W[next + i]] = last[i]; + } + // check we need to remove i from degree list + if (last[i] !== -1) { + W[next + last[i]] = W[next + i]; + } else { + W[head + W[degree + i]] = W[next + i]; + } + } + if (e !== k) { + // absorb e into k + cptr[e] = csFlip(k); + // e is now a dead element + W[w + e] = 0; + } + } + // cindex[cnz...nzmax] is free + if (elenk !== 0) { + cnz = pk2; + } + // external degree of k - |Lk\i| + W[degree + k] = dk; + // element k is in cindex[pk1..pk2-1] + cptr[k] = pk1; + W[len + k] = pk2 - pk1; + // k is now an element + W[elen + k] = -2; + + // Find set differences. The scan1 function now computes the set differences |Le \ Lk| for all elements e. At the start of the + // scan, no entry in the w array is greater than or equal to mark. + + // clear w if necessary + mark = _wclear(mark, lemax, W, w, n); + // scan 1: find |Le\Lk| + for (pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check if W[elen + i] empty, skip it + if ((eln = W[elen + i]) <= 0) { + continue; + } + // W[nv + i] was negated + nvi = -W[nv + i]; + var wnvi = mark - nvi; + // scan Ei + for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) { + e = cindex[p]; + if (W[w + e] >= mark) { + // decrement |Le\Lk| + W[w + e] -= nvi; + } else if (W[w + e] !== 0) { + // ensure e is a live element, 1st time e seen in scan 1 + W[w + e] = W[degree + e] + wnvi; + } + } + } + + // degree update + // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash + // function h(i) for all nodes in Lk. + + // scan2: degree update + for (pk = pk1; pk < pk2; pk++) { + // consider node i in Lk + i = cindex[pk]; + p1 = cptr[i]; + p2 = p1 + W[elen + i] - 1; + pn = p1; + // scan Ei + for (h = 0, d = 0, p = p1; p <= p2; p++) { + e = cindex[p]; + // check e is an unabsorbed element + if (W[w + e] !== 0) { + // dext = |Le\Lk| + var dext = W[w + e] - mark; + if (dext > 0) { + // sum up the set differences + d += dext; + // keep e in Ei + cindex[pn++] = e; + // compute the hash of node i + h += e; + } else { + // aggressive absorb. e->k + cptr[e] = csFlip(k); + // e is a dead element + W[w + e] = 0; + } + } + } + // W[elen + i] = |Ei| + W[elen + i] = pn - p1 + 1; + var p3 = pn; + var p4 = p1 + W[len + i]; + // prune edges in Ai + for (p = p2 + 1; p < p4; p++) { + j = cindex[p]; + // check node j dead or in Lk + var nvj = W[nv + j]; + if (nvj <= 0) { + continue; + } + // degree(i) += |j| + d += nvj; + // place j in node list of i + cindex[pn++] = j; + // compute hash for node i + h += j; + } + // check for mass elimination + if (d === 0) { + // absorb i into k + cptr[i] = csFlip(k); + nvi = -W[nv + i]; + // |Lk| -= |i| + dk -= nvi; + // |k| += W[nv + i] + nvk += nvi; + nel += nvi; + W[nv + i] = 0; + // node i is dead + W[elen + i] = -1; + } else { + // update degree(i) + W[degree + i] = Math.min(W[degree + i], d); + // move first node to end + cindex[pn] = cindex[p3]; + // move 1st el. to end of Ei + cindex[p3] = cindex[p1]; + // add k as 1st element in of Ei + cindex[p1] = k; + // new len of adj. list of node i + W[len + i] = pn - p1 + 1; + // finalize hash of i + h = (h < 0 ? -h : h) % n; + // place i in hash bucket + W[next + i] = W[hhead + h]; + W[hhead + h] = i; + // save hash of i in last[i] + last[i] = h; + } + } + // finalize |Lk| + W[degree + k] = dk; + lemax = Math.max(lemax, dk); + // clear w + mark = _wclear(mark + lemax, lemax, W, w, n); + + // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i. + // If two nodes have identical adjacency lists, their hash functions wil be identical. + for (pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check i is dead, skip it + if (W[nv + i] >= 0) { + continue; + } + // scan hash bucket of node i + h = last[i]; + i = W[hhead + h]; + // hash bucket will be empty + W[hhead + h] = -1; + for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) { + ln = W[len + i]; + eln = W[elen + i]; + for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) { + W[w + cindex[p]] = mark; + } + var jlast = i; + // compare i with all j + for (j = W[next + i]; j !== -1;) { + var ok = W[len + j] === ln && W[elen + j] === eln; + for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) { + // compare i and j + if (W[w + cindex[p]] !== mark) { + ok = 0; + } + } + // check i and j are identical + if (ok) { + // absorb j into i + cptr[j] = csFlip(i); + W[nv + i] += W[nv + j]; + W[nv + j] = 0; + // node j is dead + W[elen + j] = -1; + // delete j from hash bucket + j = W[next + j]; + W[next + jlast] = j; + } else { + // j and i are different + jlast = j; + j = W[next + j]; + } + } + } + } + + // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time. + // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared. + for (p = pk1, pk = pk1; pk < pk2; pk++) { + i = cindex[pk]; + // check i is dead, skip it + if ((nvi = -W[nv + i]) <= 0) { + continue; + } + // restore W[nv + i] + W[nv + i] = nvi; + // compute external degree(i) + d = W[degree + i] + dk - nvi; + d = Math.min(d, n - nel - nvi); + if (W[head + d] !== -1) { + last[W[head + d]] = i; + } + // put i back in degree list + W[next + i] = W[head + d]; + last[i] = -1; + W[head + d] = i; + // find new minimum degree + mindeg = Math.min(mindeg, d); + W[degree + i] = d; + // place i in Lk + cindex[p++] = i; + } + // # nodes absorbed into k + W[nv + k] = nvk; + // length of adj list of element k + if ((W[len + k] = p - pk1) === 0) { + // k is a root of the tree + cptr[k] = -1; + // k is now a dead element + W[w + k] = 0; + } + if (elenk !== 0) { + // free unused space in Lk + cnz = p; + } + } + + // Postordering. The elimination is complete, but no permutation has been computed. All that is left + // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if + // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation + // is computed. The tree is restored by unflipping all of ptr. + + // fix assembly tree + for (i = 0; i < n; i++) { + cptr[i] = csFlip(cptr[i]); + } + for (j = 0; j <= n; j++) { + W[head + j] = -1; + } + // place unordered nodes in lists + for (j = n; j >= 0; j--) { + // skip if j is an element + if (W[nv + j] > 0) { + continue; + } + // place j in list of its parent + W[next + j] = W[head + cptr[j]]; + W[head + cptr[j]] = j; + } + // place elements in lists + for (e = n; e >= 0; e--) { + // skip unless e is an element + if (W[nv + e] <= 0) { + continue; + } + if (cptr[e] !== -1) { + // place e in list of its parent + W[next + e] = W[head + cptr[e]]; + W[head + cptr[e]] = e; + } + } + // postorder the assembly tree + for (k = 0, i = 0; i <= n; i++) { + if (cptr[i] === -1) { + k = csTdfs(i, k, W, head, next, P, w); + } + } + // remove last item in array + P.splice(P.length - 1, 1); + // return P + return P; + }; + + /** + * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation + * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed. + * + * Order: 0 + * A natural ordering P=null matrix is returned. + * + * Order: 1 + * Matrix must be square. This is appropriate for a Cholesky or LU factorization. + * P = M + M' + * + * Order: 2 + * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices. + * P = M' * M + * + * Order: 3 + * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries. + * P = M' * M + */ + function _createTargetMatrix(order, a, m, n, dense) { + // compute A' + var at = transpose(a); + + // check order = 1, matrix must be square + if (order === 1 && n === m) { + // C = A + A' + return add(a, at); + } + + // check order = 2, drop dense columns from M' + if (order === 2) { + // transpose arrays + var tindex = at._index; + var tptr = at._ptr; + // new column index + var p2 = 0; + // loop A' columns (rows) + for (var j = 0; j < m; j++) { + // column j of AT starts here + var p = tptr[j]; + // new column j starts here + tptr[j] = p2; + // skip dense col j + if (tptr[j + 1] - p > dense) { + continue; + } + // map rows in column j of A + for (var p1 = tptr[j + 1]; p < p1; p++) { + tindex[p2++] = tindex[p]; + } + } + // finalize AT + tptr[m] = p2; + // recreate A from new transpose matrix + a = transpose(at); + // use A' * A + return multiply(at, a); + } + + // use A' * A, square or rectangular matrix + return multiply(at, a); + } + + /** + * Initialize quotient graph. There are four kind of nodes and elements that must be represented: + * + * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode. + * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]). + * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot. + * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]). + */ + function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) { + // Initialize quotient graph + for (var k = 0; k < n; k++) { + W[len + k] = cptr[k + 1] - cptr[k]; + } + W[len + n] = 0; + // initialize workspace + for (var i = 0; i <= n; i++) { + // degree list i is empty + W[head + i] = -1; + last[i] = -1; + W[next + i] = -1; + // hash list i is empty + W[hhead + i] = -1; + // node i is just one node + W[nv + i] = 1; + // node i is alive + W[w + i] = 1; + // Ek of node i is empty + W[elen + i] = 0; + // degree of node i + W[degree + i] = W[len + i]; + } + // clear w + var mark = _wclear(0, 0, W, w, n); + // n is a dead element + W[elen + n] = -2; + // n is a root of assembly tree + cptr[n] = -1; + // n is a dead element + W[w + n] = 0; + // return mark + return mark; + } + + /** + * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with + * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the + * output permutation p. + */ + function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) { + // result + var nel = 0; + // loop columns + for (var i = 0; i < n; i++) { + // degree @ i + var d = W[degree + i]; + // check node i is empty + if (d === 0) { + // element i is dead + W[elen + i] = -2; + nel++; + // i is a root of assembly tree + cptr[i] = -1; + W[w + i] = 0; + } else if (d > dense) { + // absorb i into element n + W[nv + i] = 0; + // node i is dead + W[elen + i] = -1; + nel++; + cptr[i] = csFlip(n); + W[nv + n]++; + } else { + var h = W[head + d]; + if (h !== -1) { + last[h] = i; + } + // put node i in degree list d + W[next + i] = W[head + d]; + W[head + d] = i; + } + } + return nel; + } + function _wclear(mark, lemax, W, w, n) { + if (mark < 2 || mark + lemax < 0) { + for (var k = 0; k < n; k++) { + if (W[w + k] !== 0) { + W[w + k] = 1; + } + } + mark = 2; + } + // at this point, W [0..n-1] < mark holds + return mark; + } + function _diag(i, j) { + return i !== j; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js new file mode 100644 index 0000000..3ea2422 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js @@ -0,0 +1,157 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { factory } from '../../../utils/factory.js'; +import { csEreach } from './csEreach.js'; +import { createCsSymperm } from './csSymperm.js'; +var name = 'csChol'; +var dependencies = ['divideScalar', 'sqrt', 'subtract', 'multiply', 'im', 're', 'conj', 'equal', 'smallerEq', 'SparseMatrix']; +export var createCsChol = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + divideScalar, + sqrt, + subtract, + multiply, + im, + re, + conj, + equal, + smallerEq, + SparseMatrix + } = _ref; + var csSymperm = createCsSymperm({ + conj, + SparseMatrix + }); + + /** + * Computes the Cholesky factorization of matrix A. It computes L and P so + * L * L' = P * A * P' + * + * @param {Matrix} m The A Matrix to factorize, only upper triangular part used + * @param {Object} s The symbolic analysis from cs_schol() + * + * @return {Number} The numeric Cholesky factorization of A or null + */ + return function csChol(m, s) { + // validate input + if (!m) { + return null; + } + // m arrays + var size = m._size; + // columns + var n = size[1]; + // symbolic analysis result + var parent = s.parent; + var cp = s.cp; + var pinv = s.pinv; + // L arrays + var lvalues = []; + var lindex = []; + var lptr = []; + // L + var L = new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: [n, n] + }); + // vars + var c = []; // (2 * n) + var x = []; // (n) + // compute C = P * A * P' + var cm = pinv ? csSymperm(m, pinv, 1) : m; + // C matrix arrays + var cvalues = cm._values; + var cindex = cm._index; + var cptr = cm._ptr; + // vars + var k, p; + // initialize variables + for (k = 0; k < n; k++) { + lptr[k] = c[k] = cp[k]; + } + // compute L(k,:) for L*L' = C + for (k = 0; k < n; k++) { + // nonzero pattern of L(k,:) + var top = csEreach(cm, k, parent, c); + // x (0:k) is now zero + x[k] = 0; + // x = full(triu(C(:,k))) + for (p = cptr[k]; p < cptr[k + 1]; p++) { + if (cindex[p] <= k) { + x[cindex[p]] = cvalues[p]; + } + } + // d = C(k,k) + var d = x[k]; + // clear x for k+1st iteration + x[k] = 0; + // solve L(0:k-1,0:k-1) * x = C(:,k) + for (; top < n; top++) { + // s[top..n-1] is pattern of L(k,:) + var i = s[top]; + // L(k,i) = x (i) / L(i,i) + var lki = divideScalar(x[i], lvalues[lptr[i]]); + // clear x for k+1st iteration + x[i] = 0; + for (p = lptr[i] + 1; p < c[i]; p++) { + // row + var r = lindex[p]; + // update x[r] + x[r] = subtract(x[r], multiply(lvalues[p], lki)); + } + // d = d - L(k,i)*L(k,i) + d = subtract(d, multiply(lki, conj(lki))); + p = c[i]++; + // store L(k,i) in column i + lindex[p] = k; + lvalues[p] = conj(lki); + } + // compute L(k,k) + if (smallerEq(re(d), 0) || !equal(im(d), 0)) { + // not pos def + return null; + } + p = c[k]++; + // store L(k,k) = sqrt(d) in column k + lindex[p] = k; + lvalues[p] = sqrt(d); + } + // finalize L + lptr[n] = cp[n]; + // P matrix + var P; + // check we need to calculate P + if (pinv) { + // P arrays + var pvalues = []; + var pindex = []; + var pptr = []; + // create P matrix + for (p = 0; p < n; p++) { + // initialize ptr (one value per column) + pptr[p] = p; + // index (apply permutation vector) + pindex.push(pinv[p]); + // value 1 + pvalues.push(1); + } + // update ptr + pptr[n] = n; + // P + P = new SparseMatrix({ + values: pvalues, + index: pindex, + ptr: pptr, + size: [n, n] + }); + } + // return L & P + return { + L, + P + }; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js new file mode 100644 index 0000000..9eaa2bd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js @@ -0,0 +1,126 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { factory } from '../../../utils/factory.js'; +import { csLeaf } from './csLeaf.js'; +var name = 'csCounts'; +var dependencies = ['transpose']; +export var createCsCounts = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + transpose + } = _ref; + /** + * Computes the column counts using the upper triangular part of A. + * It transposes A internally, none of the input parameters are modified. + * + * @param {Matrix} a The sparse matrix A + * + * @param {Matrix} ata Count the columns of A'A instead + * + * @return An array of size n of the column counts or null on error + */ + return function (a, parent, post, ata) { + // check inputs + if (!a || !parent || !post) { + return null; + } + // a matrix arrays + var asize = a._size; + // rows and columns + var m = asize[0]; + var n = asize[1]; + // variables + var i, j, k, J, p, p0, p1; + + // workspace size + var s = 4 * n + (ata ? n + m + 1 : 0); + // allocate workspace + var w = []; // (s) + var ancestor = 0; // first n entries + var maxfirst = n; // next n entries + var prevleaf = 2 * n; // next n entries + var first = 3 * n; // next n entries + var head = 4 * n; // next n + 1 entries (used when ata is true) + var next = 5 * n + 1; // last entries in workspace + // clear workspace w[0..s-1] + for (k = 0; k < s; k++) { + w[k] = -1; + } + + // allocate result + var colcount = []; // (n) + + // AT = A' + var at = transpose(a); + // at arrays + var tindex = at._index; + var tptr = at._ptr; + + // find w[first + j] + for (k = 0; k < n; k++) { + j = post[k]; + // colcount[j]=1 if j is a leaf + colcount[j] = w[first + j] === -1 ? 1 : 0; + for (; j !== -1 && w[first + j] === -1; j = parent[j]) { + w[first + j] = k; + } + } + + // initialize ata if needed + if (ata) { + // invert post + for (k = 0; k < n; k++) { + w[post[k]] = k; + } + // loop rows (columns in AT) + for (i = 0; i < m; i++) { + // values in column i of AT + for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) { + k = Math.min(k, w[tindex[p]]); + } + // place row i in linked list k + w[next + i] = w[head + k]; + w[head + k] = i; + } + } + + // each node in its own set + for (i = 0; i < n; i++) { + w[ancestor + i] = i; + } + for (k = 0; k < n; k++) { + // j is the kth node in postordered etree + j = post[k]; + // check j is not a root + if (parent[j] !== -1) { + colcount[parent[j]]--; + } + + // J=j for LL'=A case + for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) { + for (p = tptr[J]; p < tptr[J + 1]; p++) { + i = tindex[p]; + var r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor); + // check A(i,j) is in skeleton + if (r.jleaf >= 1) { + colcount[j]++; + } + // check account for overlap in q + if (r.jleaf === 2) { + colcount[r.q]--; + } + } + } + if (parent[j] !== -1) { + w[ancestor + j] = parent[j]; + } + } + // sum up colcount's of each child + for (j = 0; j < n; j++) { + if (parent[j] !== -1) { + colcount[parent[j]] += colcount[j]; + } + } + return colcount; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js new file mode 100644 index 0000000..1c89ada --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js @@ -0,0 +1,28 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * It sets the p[i] equal to the sum of c[0] through c[i-1]. + * + * @param {Array} ptr The Sparse Matrix ptr array + * @param {Array} c The Sparse Matrix ptr array + * @param {Number} n The number of columns + */ +export function csCumsum(ptr, c, n) { + // variables + var i; + var nz = 0; + for (i = 0; i < n; i++) { + // initialize ptr @ i + ptr[i] = nz; + // increment number of nonzeros + nz += c[i]; + // also copy p[0..n-1] back into c[0..n-1] + c[i] = ptr[i]; + } + // finalize ptr + ptr[n] = nz; + // return sum (c [0..n-1]) + return nz; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js new file mode 100644 index 0000000..79e3f96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js @@ -0,0 +1,76 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csMarked } from './csMarked.js'; +import { csMark } from './csMark.js'; +import { csUnflip } from './csUnflip.js'; + +/** + * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting + * at nodes in B (see csReach()). + * + * @param {Number} j The starting node for the DFS algorithm + * @param {Matrix} g The G matrix to search, ptr array modified, then restored + * @param {Number} top Start index in stack xi[top..n-1] + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b + * + * @return {Number} New value of top + */ +export function csDfs(j, g, top, xi, pinv) { + // g arrays + var index = g._index; + var ptr = g._ptr; + var size = g._size; + // columns + var n = size[1]; + // vars + var i, p, p2; + // initialize head + var head = 0; + // initialize the recursion stack + xi[0] = j; + // loop + while (head >= 0) { + // get j from the top of the recursion stack + j = xi[head]; + // apply permutation vector + var jnew = pinv ? pinv[j] : j; + // check node j is marked + if (!csMarked(ptr, j)) { + // mark node j as visited + csMark(ptr, j); + // update stack (last n entries in xi) + xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew]); + } + // node j done if no unvisited neighbors + var done = 1; + // examine all neighbors of j, stack (last n entries in xi) + for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) { + // consider neighbor node i + i = index[p]; + // check we have visited node i, skip it + if (csMarked(ptr, i)) { + continue; + } + // pause depth-first search of node j, update stack (last n entries in xi) + xi[n + head] = p; + // start dfs at node i + xi[++head] = i; + // node j is not done + done = 0; + // break, to start dfs(i) + break; + } + // check depth-first search at node j is done + if (done) { + // remove j from the recursion stack + head--; + // and place in the output stack + xi[--top] = j; + } + } + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js new file mode 100644 index 0000000..3d16615 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js @@ -0,0 +1,63 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csMark } from './csMark.js'; +import { csMarked } from './csMarked.js'; + +/** + * Find nonzero pattern of Cholesky L(k,1:k-1) using etree and triu(A(:,k)) + * + * @param {Matrix} a The A matrix + * @param {Number} k The kth column in A + * @param {Array} parent The parent vector from the symbolic analysis result + * @param {Array} w The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * + * @return {Number} The index for the nonzero pattern + */ +export function csEreach(a, k, parent, w) { + // a arrays + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + // columns + var n = asize[1]; + // initialize top + var top = n; + // vars + var p, p0, p1, len; + // mark node k as visited + csMark(w, k); + // loop values & index for column k + for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // A(i,k) is nonzero + var i = aindex[p]; + // only use upper triangular part of A + if (i > k) { + continue; + } + // traverse up etree + for (len = 0; !csMarked(w, i); i = parent[i]) { + // L(k,i) is nonzero, last n entries in w + w[n + len++] = i; + // mark i as visited + csMark(w, i); + } + while (len > 0) { + // decrement top & len + --top; + --len; + // push path onto stack, last n entries in w + w[n + top] = w[n + len]; + } + } + // unmark all nodes + for (p = top; p < n; p++) { + // use stack value, last n entries in w + csMark(w, w[n + p]); + } + // unmark node k + csMark(w, k); + // s[top..n-1] contains pattern of L(k,:) + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js new file mode 100644 index 0000000..0b0b29c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js @@ -0,0 +1,71 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Computes the elimination tree of Matrix A (using triu(A)) or the + * elimination tree of A'A without forming A'A. + * + * @param {Matrix} a The A Matrix + * @param {boolean} ata A value of true the function computes the etree of A'A + */ +export function csEtree(a, ata) { + // check inputs + if (!a) { + return null; + } + // a arrays + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + // rows & columns + var m = asize[0]; + var n = asize[1]; + + // allocate result + var parent = []; // (n) + + // allocate workspace + var w = []; // (n + (ata ? m : 0)) + var ancestor = 0; // first n entries in w + var prev = n; // last m entries (ata = true) + + var i, inext; + + // check we are calculating A'A + if (ata) { + // initialize workspace + for (i = 0; i < m; i++) { + w[prev + i] = -1; + } + } + // loop columns + for (var k = 0; k < n; k++) { + // node k has no parent yet + parent[k] = -1; + // nor does k have an ancestor + w[ancestor + k] = -1; + // values in column k + for (var p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // row + var r = aindex[p]; + // node + i = ata ? w[prev + r] : r; + // traverse from i to k + for (; i !== -1 && i < k; i = inext) { + // inext = ancestor of i + inext = w[ancestor + i]; + // path compression + w[ancestor + i] = k; + // check no anc., parent is k + if (inext === -1) { + parent[i] = k; + } + } + if (ata) { + w[prev + r] = k; + } + } + } + return parent; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js new file mode 100644 index 0000000..cd1e003 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js @@ -0,0 +1,58 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise + * + * @param {Matrix} a The sparse matrix + * @param {function} callback The callback function, function will be invoked with the following args: + * - The entry row + * - The entry column + * - The entry value + * - The state parameter + * @param {any} other The state + * + * @return The number of nonzero elements in the matrix + */ +export function csFkeep(a, callback, other) { + // a arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + // columns + var n = asize[1]; + // nonzero items + var nz = 0; + // loop columns + for (var j = 0; j < n; j++) { + // get current location of col j + var p = aptr[j]; + // record new location of col j + aptr[j] = nz; + for (; p < aptr[j + 1]; p++) { + // check we need to keep this item + if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) { + // keep A(i,j) + aindex[nz] = aindex[p]; + // check we need to process values (pattern only) + if (avalues) { + avalues[nz] = avalues[p]; + } + // increment nonzero items + nz++; + } + } + } + // finalize A + aptr[n] = nz; + // trim arrays + aindex.splice(nz, aindex.length - nz); + // check we need to process values (pattern only) + if (avalues) { + avalues.splice(nz, avalues.length - nz); + } + // return number of nonzero items + return nz; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js new file mode 100644 index 0000000..f375c03 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js @@ -0,0 +1,13 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * This function "flips" its input about the integer -1. + * + * @param {Number} i The value to flip + */ +export function csFlip(i) { + // flip the value + return -i - 2; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js new file mode 100644 index 0000000..8a4eb24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js @@ -0,0 +1,33 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b. + * + * @param {Array} p The permutation vector of length n. null value denotes identity + * @param {Array} b The input vector + * + * @return {Array} The output vector x = P'b + */ +export function csIpvec(p, b) { + // vars + var k; + var n = b.length; + var x = []; + // check permutation vector was provided, p = null denotes identity + if (p) { + // loop vector + for (k = 0; k < n; k++) { + // apply permutation + x[p[k]] = b[k]; + } + } else { + // loop vector + for (k = 0; k < n; k++) { + // x[i] = b[i] + x[k] = b[k]; + } + } + return x; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js new file mode 100644 index 0000000..9b23e52 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js @@ -0,0 +1,56 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * This function determines if j is a leaf of the ith row subtree. + * Consider A(i,j), node j in ith row subtree and return lca(jprev,j) + * + * @param {Number} i The ith row subtree + * @param {Number} j The node to test + * @param {Array} w The workspace array + * @param {Number} first The index offset within the workspace for the first array + * @param {Number} maxfirst The index offset within the workspace for the maxfirst array + * @param {Number} prevleaf The index offset within the workspace for the prevleaf array + * @param {Number} ancestor The index offset within the workspace for the ancestor array + * + * @return {Object} + */ +export function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) { + var s, sparent; + + // our result + var jleaf = 0; + var q; + + // check j is a leaf + if (i <= j || w[first + j] <= w[maxfirst + i]) { + return -1; + } + // update max first[j] seen so far + w[maxfirst + i] = w[first + j]; + // jprev = previous leaf of ith subtree + var jprev = w[prevleaf + i]; + w[prevleaf + i] = j; + + // check j is first or subsequent leaf + if (jprev === -1) { + // 1st leaf, q = root of ith subtree + jleaf = 1; + q = i; + } else { + // update jleaf + jleaf = 2; + // q = least common ancester (jprev,j) + for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]); + for (s = jprev; s !== q; s = sparent) { + // path compression + sparent = w[ancestor + s]; + w[ancestor + s] = q; + } + } + return { + jleaf, + q + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js new file mode 100644 index 0000000..544f4fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js @@ -0,0 +1,182 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +import { factory } from '../../../utils/factory.js'; +import { createCsSpsolve } from './csSpsolve.js'; +var name = 'csLu'; +var dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix']; +export var createCsLu = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + abs, + divideScalar, + multiply, + subtract, + larger, + largerEq, + SparseMatrix + } = _ref; + var csSpsolve = createCsSpsolve({ + divideScalar, + multiply, + subtract + }); + + /** + * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization + * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L + * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so + * L * U = A(p, q), where p is the inverse of pinv. + * + * @param {Matrix} m The A Matrix to factorize + * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing + * column ordering q + * @param {Number} tol Partial pivoting threshold (1 for partial pivoting) + * + * @return {Number} The numeric LU factorization of A or null + */ + return function csLu(m, s, tol) { + // validate input + if (!m) { + return null; + } + // m arrays + var size = m._size; + // columns + var n = size[1]; + // symbolic analysis result + var q; + var lnz = 100; + var unz = 100; + // update symbolic analysis parameters + if (s) { + q = s.q; + lnz = s.lnz || lnz; + unz = s.unz || unz; + } + // L arrays + var lvalues = []; // (lnz) + var lindex = []; // (lnz) + var lptr = []; // (n + 1) + // L + var L = new SparseMatrix({ + values: lvalues, + index: lindex, + ptr: lptr, + size: [n, n] + }); + // U arrays + var uvalues = []; // (unz) + var uindex = []; // (unz) + var uptr = []; // (n + 1) + // U + var U = new SparseMatrix({ + values: uvalues, + index: uindex, + ptr: uptr, + size: [n, n] + }); + // inverse of permutation vector + var pinv = []; // (n) + // vars + var i, p; + // allocate arrays + var x = []; // (n) + var xi = []; // (2 * n) + // initialize variables + for (i = 0; i < n; i++) { + // clear workspace + x[i] = 0; + // no rows pivotal yet + pinv[i] = -1; + // no cols of L yet + lptr[i + 1] = 0; + } + // reset number of nonzero elements in L and U + lnz = 0; + unz = 0; + // compute L(:,k) and U(:,k) + for (var k = 0; k < n; k++) { + // update ptr + lptr[k] = lnz; + uptr[k] = unz; + // apply column permutations if needed + var col = q ? q[k] : k; + // solve triangular system, x = L\A(:,col) + var top = csSpsolve(L, m, col, xi, x, pinv, 1); + // find pivot + var ipiv = -1; + var a = -1; + // loop xi[] from top -> n + for (p = top; p < n; p++) { + // x[i] is nonzero + i = xi[p]; + // check row i is not yet pivotal + if (pinv[i] < 0) { + // absolute value of x[i] + var xabs = abs(x[i]); + // check absoulte value is greater than pivot value + if (larger(xabs, a)) { + // largest pivot candidate so far + a = xabs; + ipiv = i; + } + } else { + // x(i) is the entry U(pinv[i],k) + uindex[unz] = pinv[i]; + uvalues[unz++] = x[i]; + } + } + // validate we found a valid pivot + if (ipiv === -1 || a <= 0) { + return null; + } + // update actual pivot column, give preference to diagonal value + if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) { + ipiv = col; + } + // the chosen pivot + var pivot = x[ipiv]; + // last entry in U(:,k) is U(k,k) + uindex[unz] = k; + uvalues[unz++] = pivot; + // ipiv is the kth pivot row + pinv[ipiv] = k; + // first entry in L(:,k) is L(k,k) = 1 + lindex[lnz] = ipiv; + lvalues[lnz++] = 1; + // L(k+1:n,k) = x / pivot + for (p = top; p < n; p++) { + // row + i = xi[p]; + // check x(i) is an entry in L(:,k) + if (pinv[i] < 0) { + // save unpermuted row in L + lindex[lnz] = i; + // scale pivot column + lvalues[lnz++] = divideScalar(x[i], pivot); + } + // x[0..n-1] = 0 for next k + x[i] = 0; + } + } + // update ptr + lptr[n] = lnz; + uptr[n] = unz; + // fix row indices of L for final pinv + for (p = 0; p < lnz; p++) { + lindex[p] = pinv[lindex[p]]; + } + // trim arrays + lvalues.splice(lnz, lvalues.length - lnz); + lindex.splice(lnz, lindex.length - lnz); + uvalues.splice(unz, uvalues.length - unz); + uindex.splice(unz, uindex.length - unz); + // return LU factor + return { + L, + U, + pinv + }; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js new file mode 100644 index 0000000..ace68c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js @@ -0,0 +1,16 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +import { csFlip } from './csFlip.js'; + +/** + * Marks the node at w[j] + * + * @param {Array} w The array + * @param {Number} j The array index + */ +export function csMark(w, j) { + // mark w[j] + w[j] = csFlip(w[j]); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js new file mode 100644 index 0000000..0d0e5b5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js @@ -0,0 +1,14 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Checks if the node at w[j] is marked + * + * @param {Array} w The array + * @param {Number} j The array index + */ +export function csMarked(w, j) { + // check node is marked + return w[j] < 0; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js new file mode 100644 index 0000000..044b656 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js @@ -0,0 +1,61 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Permutes a sparse matrix C = P * A * Q + * + * @param {SparseMatrix} a The Matrix A + * @param {Array} pinv The row permutation vector + * @param {Array} q The column permutation vector + * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise + * + * @return {Matrix} C = P * A * Q, null on error + */ +export function csPermute(a, pinv, q, values) { + // a arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + var adt = a._datatype; + // rows & columns + var m = asize[0]; + var n = asize[1]; + // c arrays + var cvalues = values && a._values ? [] : null; + var cindex = []; // (aptr[n]) + var cptr = []; // (n + 1) + // initialize vars + var nz = 0; + // loop columns + for (var k = 0; k < n; k++) { + // column k of C is column q[k] of A + cptr[k] = nz; + // apply column permutation + var j = q ? q[k] : k; + // loop values in column j of A + for (var t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) { + // row i of A is row pinv[i] of C + var r = pinv ? pinv[aindex[t]] : aindex[t]; + // index + cindex[nz] = r; + // check we need to populate values + if (cvalues) { + cvalues[nz] = avalues[t]; + } + // increment number of nonzero elements + nz++; + } + } + // finalize the last column of C + cptr[n] = nz; + // return C matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [m, n], + datatype: adt + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js new file mode 100644 index 0000000..6ff7c3f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js @@ -0,0 +1,52 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csTdfs } from './csTdfs.js'; + +/** + * Post order a tree of forest + * + * @param {Array} parent The tree or forest + * @param {Number} n Number of columns + */ +export function csPost(parent, n) { + // check inputs + if (!parent) { + return null; + } + // vars + var k = 0; + var j; + // allocate result + var post = []; // (n) + // workspace, head: first n entries, next: next n entries, stack: last n entries + var w = []; // (3 * n) + var head = 0; + var next = n; + var stack = 2 * n; + // initialize workspace + for (j = 0; j < n; j++) { + // empty linked lists + w[head + j] = -1; + } + // traverse nodes in reverse order + for (j = n - 1; j >= 0; j--) { + // check j is a root + if (parent[j] === -1) { + continue; + } + // add j to list of its parent + w[next + j] = w[head + parent[j]]; + w[head + parent[j]] = j; + } + // loop nodes + for (j = 0; j < n; j++) { + // skip j if it is not a root + if (parent[j] !== -1) { + continue; + } + // depth-first search + k = csTdfs(j, k, w, head, next, post, stack); + } + return post; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js new file mode 100644 index 0000000..2f49fb9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js @@ -0,0 +1,52 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +import { csMarked } from './csMarked.js'; +import { csMark } from './csMark.js'; +import { csDfs } from './csDfs.js'; + +/** + * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1 + * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The + * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B). + * + * @param {Matrix} g The G matrix + * @param {Matrix} b The B matrix + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} pinv The inverse row permutation vector + * + * @return {Number} The index for the nonzero pattern + */ +export function csReach(g, b, k, xi, pinv) { + // g arrays + var gptr = g._ptr; + var gsize = g._size; + // b arrays + var bindex = b._index; + var bptr = b._ptr; + // columns + var n = gsize[1]; + // vars + var p, p0, p1; + // initialize top + var top = n; + // loop column indeces in B + for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) { + // node i + var i = bindex[p]; + // check node i is marked + if (!csMarked(gptr, i)) { + // start a dfs at unmarked node i + top = csDfs(i, g, top, xi, pinv); + } + } + // loop columns from top -> n - 1 + for (p = top; p < n; p++) { + // restore G + csMark(gptr, xi[p]); + } + return top; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js new file mode 100644 index 0000000..82f6f6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js @@ -0,0 +1,84 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csReach } from './csReach.js'; +import { factory } from '../../../utils/factory.js'; +var name = 'csSpsolve'; +var dependencies = ['divideScalar', 'multiply', 'subtract']; +export var createCsSpsolve = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + divideScalar, + multiply, + subtract + } = _ref; + /** + * The function csSpsolve() computes the solution to G * x = bk, where bk is the + * kth column of B. When lo is true, the function assumes G = L is lower triangular with the + * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U + * is upper triangular with the diagonal entry as the last entry in each column. + * + * @param {Matrix} g The G matrix + * @param {Matrix} b The B matrix + * @param {Number} k The kth column in B + * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n + * The first n entries is the nonzero pattern, the last n entries is the stack + * @param {Array} x The soluton to the linear system G * x = b + * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b + * @param {boolean} lo The lower (true) upper triangular (false) flag + * + * @return {Number} The index for the nonzero pattern + */ + return function csSpsolve(g, b, k, xi, x, pinv, lo) { + // g arrays + var gvalues = g._values; + var gindex = g._index; + var gptr = g._ptr; + var gsize = g._size; + // columns + var n = gsize[1]; + // b arrays + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + // vars + var p, p0, p1, q; + // xi[top..n-1] = csReach(B(:,k)) + var top = csReach(g, b, k, xi, pinv); + // clear x + for (p = top; p < n; p++) { + x[xi[p]] = 0; + } + // scatter b + for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) { + x[bindex[p]] = bvalues[p]; + } + // loop columns + for (var px = top; px < n; px++) { + // x array index for px + var j = xi[px]; + // apply permutation vector (U x = b), j maps to column J of G + var J = pinv ? pinv[j] : j; + // check column J is empty + if (J < 0) { + continue; + } + // column value indeces in G, p0 <= p < p1 + p0 = gptr[J]; + p1 = gptr[J + 1]; + // x(j) /= G(j,j) + x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]); + // first entry L(j,j) + p = lo ? p0 + 1 : p0; + q = lo ? p1 : p1 - 1; + // loop + for (; p < q; p++) { + // row + var i = gindex[p]; + // x(i) -= G(i,j) * x(j) + x[i] = subtract(x[i], multiply(gvalues[p], x[j])); + } + } + // return top of stack + return top; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js new file mode 100644 index 0000000..a26579a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js @@ -0,0 +1,179 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csPermute } from './csPermute.js'; +import { csPost } from './csPost.js'; +import { csEtree } from './csEtree.js'; +import { createCsAmd } from './csAmd.js'; +import { createCsCounts } from './csCounts.js'; +import { factory } from '../../../utils/factory.js'; +var name = 'csSqr'; +var dependencies = ['add', 'multiply', 'transpose']; +export var createCsSqr = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + add, + multiply, + transpose + } = _ref; + var csAmd = createCsAmd({ + add, + multiply, + transpose + }); + var csCounts = createCsCounts({ + transpose + }); + + /** + * Symbolic ordering and analysis for QR and LU decompositions. + * + * @param {Number} order The ordering strategy (see csAmd for more details) + * @param {Matrix} a The A matrix + * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or + * symbolic ordering and analysis for LU decomposition (false) + * + * @return {Object} The Symbolic ordering and analysis for matrix A + */ + return function csSqr(order, a, qr) { + // a arrays + var aptr = a._ptr; + var asize = a._size; + // columns + var n = asize[1]; + // vars + var k; + // symbolic analysis result + var s = {}; + // fill-reducing ordering + s.q = csAmd(order, a); + // validate results + if (order && !s.q) { + return null; + } + // QR symbolic analysis + if (qr) { + // apply permutations if needed + var c = order ? csPermute(a, null, s.q, 0) : a; + // etree of C'*C, where C=A(:,q) + s.parent = csEtree(c, 1); + // post order elimination tree + var post = csPost(s.parent, n); + // col counts chol(C'*C) + s.cp = csCounts(c, s.parent, post, 1); + // check we have everything needed to calculate number of nonzero elements + if (c && s.parent && s.cp && _vcount(c, s)) { + // calculate number of nonzero elements + for (s.unz = 0, k = 0; k < n; k++) { + s.unz += s.cp[k]; + } + } + } else { + // for LU factorization only, guess nnz(L) and nnz(U) + s.unz = 4 * aptr[n] + n; + s.lnz = s.unz; + } + // return result S + return s; + }; + + /** + * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent + */ + function _vcount(a, s) { + // a arrays + var aptr = a._ptr; + var aindex = a._index; + var asize = a._size; + // rows & columns + var m = asize[0]; + var n = asize[1]; + // initialize s arrays + s.pinv = []; // (m + n) + s.leftmost = []; // (m) + // vars + var parent = s.parent; + var pinv = s.pinv; + var leftmost = s.leftmost; + // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries + var w = []; // (m + 3 * n) + var next = 0; + var head = m; + var tail = m + n; + var nque = m + 2 * n; + // vars + var i, k, p, p0, p1; + // initialize w + for (k = 0; k < n; k++) { + // queue k is empty + w[head + k] = -1; + w[tail + k] = -1; + w[nque + k] = 0; + } + // initialize row arrays + for (i = 0; i < m; i++) { + leftmost[i] = -1; + } + // loop columns backwards + for (k = n - 1; k >= 0; k--) { + // values & index for column k + for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) { + // leftmost[i] = min(find(A(i,:))) + leftmost[aindex[p]] = k; + } + } + // scan rows in reverse order + for (i = m - 1; i >= 0; i--) { + // row i is not yet ordered + pinv[i] = -1; + k = leftmost[i]; + // check row i is empty + if (k === -1) { + continue; + } + // first row in queue k + if (w[nque + k]++ === 0) { + w[tail + k] = i; + } + // put i at head of queue k + w[next + i] = w[head + k]; + w[head + k] = i; + } + s.lnz = 0; + s.m2 = m; + // find row permutation and nnz(V) + for (k = 0; k < n; k++) { + // remove row i from queue k + i = w[head + k]; + // count V(k,k) as nonzero + s.lnz++; + // add a fictitious row + if (i < 0) { + i = s.m2++; + } + // associate row i with V(:,k) + pinv[i] = k; + // skip if V(k+1:m,k) is empty + if (--nque[k] <= 0) { + continue; + } + // nque[k] is nnz (V(k+1:m,k)) + s.lnz += w[nque + k]; + // move all rows to parent of k + var pa = parent[k]; + if (pa !== -1) { + if (w[nque + pa] === 0) { + w[tail + pa] = w[tail + k]; + } + w[next + w[tail + k]] = w[head + pa]; + w[head + pa] = w[next + i]; + w[nque + pa] += w[nque + k]; + } + } + for (i = 0; i < m; i++) { + if (pinv[i] < 0) { + pinv[i] = k++; + } + } + return true; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js new file mode 100644 index 0000000..f1b0321 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js @@ -0,0 +1,93 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csCumsum } from './csCumsum.js'; +import { factory } from '../../../utils/factory.js'; +var name = 'csSymperm'; +var dependencies = ['conj', 'SparseMatrix']; +export var createCsSymperm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + conj, + SparseMatrix + } = _ref; + /** + * Computes the symmetric permutation of matrix A accessing only + * the upper triangular part of A. + * + * C = P * A * P' + * + * @param {Matrix} a The A matrix + * @param {Array} pinv The inverse of permutation vector + * @param {boolean} values Process matrix values (true) + * + * @return {Matrix} The C matrix, C = P * A * P' + */ + return function csSymperm(a, pinv, values) { + // A matrix arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + // columns + var n = asize[1]; + // C matrix arrays + var cvalues = values && avalues ? [] : null; + var cindex = []; // (nz) + var cptr = []; // (n + 1) + // variables + var i, i2, j, j2, p, p0, p1; + // create workspace vector + var w = []; // (n) + // count entries in each column of C + for (j = 0; j < n; j++) { + // column j of A is column j2 of C + j2 = pinv ? pinv[j] : j; + // loop values in column j + for (p0 = aptr[j], p1 = aptr[j + 1], p = p0; p < p1; p++) { + // row + i = aindex[p]; + // skip lower triangular part of A + if (i > j) { + continue; + } + // row i of A is row i2 of C + i2 = pinv ? pinv[i] : i; + // column count of C + w[Math.max(i2, j2)]++; + } + } + // compute column pointers of C + csCumsum(cptr, w, n); + // loop columns + for (j = 0; j < n; j++) { + // column j of A is column j2 of C + j2 = pinv ? pinv[j] : j; + // loop values in column j + for (p0 = aptr[j], p1 = aptr[j + 1], p = p0; p < p1; p++) { + // row + i = aindex[p]; + // skip lower triangular part of A + if (i > j) { + continue; + } + // row i of A is row i2 of C + i2 = pinv ? pinv[i] : i; + // C index for column j2 + var q = w[Math.max(i2, j2)]++; + // update C index for entry q + cindex[q] = Math.min(i2, j2); + // check we need to process values + if (cvalues) { + cvalues[q] = i2 <= j2 ? avalues[p] : conj(avalues[p]); + } + } + } + // return C matrix + return new SparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [n, n] + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js new file mode 100644 index 0000000..d4b851c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js @@ -0,0 +1,42 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source + +/** + * Depth-first search and postorder of a tree rooted at node j + * + * @param {Number} j The tree node + * @param {Number} k + * @param {Array} w The workspace array + * @param {Number} head The index offset within the workspace for the head array + * @param {Number} next The index offset within the workspace for the next array + * @param {Array} post The post ordering array + * @param {Number} stack The index offset within the workspace for the stack array + */ +export function csTdfs(j, k, w, head, next, post, stack) { + // variables + var top = 0; + // place j on the stack + w[stack] = j; + // while (stack is not empty) + while (top >= 0) { + // p = top of stack + var p = w[stack + top]; + // i = youngest child of p + var i = w[head + p]; + if (i === -1) { + // p has no unordered children left + top--; + // node p is the kth postordered node + post[k++] = p; + } else { + // remove i from children of p + w[head + p] = w[next + i]; + // increment top + ++top; + // start dfs on child node i + w[stack + top] = i; + } + } + return k; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js new file mode 100644 index 0000000..923dc28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js @@ -0,0 +1,14 @@ +// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: LGPL-2.1+ +// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source +import { csFlip } from './csFlip.js'; + +/** + * Flips the value if it is negative of returns the same value otherwise. + * + * @param {Number} i The value to flip + */ +export function csUnflip(i) { + // flip the value if it is negative + return i < 0 ? csFlip(i) : i; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sylvester.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sylvester.js new file mode 100644 index 0000000..7db0b93 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/sylvester.js @@ -0,0 +1,118 @@ +import { factory } from '../../utils/factory.js'; +var name = 'sylvester'; +var dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs']; +export var createSylvester = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + schur, + matrixFromColumns, + matrix, + multiply, + range, + concat, + transpose, + index, + subset, + add, + subtract, + identity, + lusolve, + abs + } = _ref; + /** + * + * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are + * matrices of appropriate dimensions, being A and B squared. Notice that other + * equivalent definitions for the Sylvester equation exist and this function + * assumes the one presented in the original publication of the the Bartels- + * Stewart algorithm, which is implemented by this function. + * https://en.wikipedia.org/wiki/Sylvester_equation + * + * Syntax: + * + * math.sylvester(A, B, C) + * + * Examples: + * + * const A = [[-1, -2], [1, 1]] + * const B = [[2, -1], [1, -2]] + * const C = [[-3, 2], [3, 0]] + * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]] + * + * See also: + * + * schur, lyap + * + * @param {Matrix | Array} A Matrix A + * @param {Matrix | Array} B Matrix B + * @param {Matrix | Array} C Matrix C + * @return {Matrix | Array} Matrix X, solving the Sylvester equation + */ + return typed(name, { + 'Matrix, Matrix, Matrix': _sylvester, + 'Array, Matrix, Matrix': function Array_Matrix_Matrix(A, B, C) { + return _sylvester(matrix(A), B, C); + }, + 'Array, Array, Matrix': function Array_Array_Matrix(A, B, C) { + return _sylvester(matrix(A), matrix(B), C); + }, + 'Array, Matrix, Array': function Array_Matrix_Array(A, B, C) { + return _sylvester(matrix(A), B, matrix(C)); + }, + 'Matrix, Array, Matrix': function Matrix_Array_Matrix(A, B, C) { + return _sylvester(A, matrix(B), C); + }, + 'Matrix, Array, Array': function Matrix_Array_Array(A, B, C) { + return _sylvester(A, matrix(B), matrix(C)); + }, + 'Matrix, Matrix, Array': function Matrix_Matrix_Array(A, B, C) { + return _sylvester(A, B, matrix(C)); + }, + 'Array, Array, Array': function Array_Array_Array(A, B, C) { + return _sylvester(matrix(A), matrix(B), matrix(C)).toArray(); + } + }); + function _sylvester(A, B, C) { + var n = B.size()[0]; + var m = A.size()[0]; + var sA = schur(A); + var F = sA.T; + var U = sA.U; + var sB = schur(multiply(-1, B)); + var G = sB.T; + var V = sB.U; + var D = multiply(multiply(transpose(U), C), V); + var all = range(0, m); + var y = []; + var hc = (a, b) => concat(a, b, 1); + var vc = (a, b) => concat(a, b, 0); + for (var k = 0; k < n; k++) { + if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) { + var RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1))); + for (var j = 0; j < k; j++) { + RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1))))); + } + var gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k)))); + var gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k)))); + var gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1)))); + var gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1)))); + var LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm))); + var yAux = lusolve(LHS, RHS); + y[k] = yAux.subset(index(range(0, m), 0)); + y[k + 1] = yAux.subset(index(range(m, 2 * m), 0)); + k++; + } else { + var _RHS = subset(D, index(all, k)); + for (var _j = 0; _j < k; _j++) { + _RHS = add(_RHS, multiply(y[_j], subset(G, index(_j, k)))); + } + var _gkk = subset(G, index(k, k)); + var _LHS = subtract(F, multiply(_gkk, identity(m))); + y[k] = lusolve(_LHS, _RHS); + } + } + var Y = matrix(matrixFromColumns(...y)); + var X = multiply(U, multiply(Y, transpose(V))); + return X; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js new file mode 100644 index 0000000..ad92304 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js @@ -0,0 +1,60 @@ +import { isConstantNode } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'symbolicEqual'; +var dependencies = ['parse', 'simplify', 'typed', 'OperatorNode']; +export var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + parse, + simplify, + typed, + OperatorNode + } = _ref; + /** + * Attempts to determine if two expressions are symbolically equal, i.e. + * one is the result of valid algebraic manipulations on the other. + * Currently, this simply checks if the difference of the two expressions + * simplifies down to 0. So there are two important caveats: + * 1. whether two expressions are symbolically equal depends on the + * manipulations allowed. Therefore, this function takes an optional + * third argument, which are the options that control the behavior + * as documented for the `simplify()` function. + * 2. it is in general intractable to find the minimal simplification of + * an arbitrarily complicated expression. So while a `true` value + * of `symbolicEqual` ensures that the two expressions can be manipulated + * to match each other, a `false` value does not absolutely rule this out. + * + * Syntax: + * + * math.symbolicEqual(expr1, expr2) + * math.symbolicEqual(expr1, expr2, options) + * + * Examples: + * + * math.symbolicEqual('x*y', 'y*x') // Returns true + * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false + * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true + * math.symbolicEqual('abs(x)','x') // Returns false + * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true + * + * See also: + * + * simplify, evaluate + * + * @param {Node|string} expr1 The first expression to compare + * @param {Node|string} expr2 The second expression to compare + * @param {Object} [options] Optional option object, passed to simplify + * @returns {boolean} + * Returns true if a valid manipulation making the expressions equal + * is found. + */ + function _symbolicEqual(e1, e2) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var diff = new OperatorNode('-', 'subtract', [e1, e2]); + var simplified = simplify(diff, {}, options); + return isConstantNode(simplified) && !simplified.value; + } + return typed(name, { + 'Node, Node': _symbolicEqual, + 'Node, Node, Object': _symbolicEqual + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/abs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/abs.js new file mode 100644 index 0000000..8a89a06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/abs.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { absNumber } from '../../plain/number/index.js'; +var name = 'abs'; +var dependencies = ['typed']; +export var createAbs = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the absolute value of a number. For matrices, the function is + * evaluated element wise. + * + * Syntax: + * + * math.abs(x) + * + * Examples: + * + * math.abs(3.5) // returns number 3.5 + * math.abs(-4.2) // returns number 4.2 + * + * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2] + * + * See also: + * + * sign + * + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x + * A number or matrix for which to get the absolute value + * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} + * Absolute value of `x` + */ + return typed(name, { + number: absNumber, + 'Complex | BigNumber | Fraction | Unit': x => x.abs(), + bigint: x => x < 0n ? -x : x, + // deep map collection, skip zeros since abs(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/add.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/add.js new file mode 100644 index 0000000..e3bce06 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/add.js @@ -0,0 +1,83 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'add'; +var dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat']; +export var createAdd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + addScalar, + equalScalar, + DenseMatrix, + SparseMatrix, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo04xSidSid = createMatAlgo04xSidSid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + /** + * Add two or more values, `x + y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.add(x, y) + * math.add(x, y, z, ...) + * + * Examples: + * + * math.add(2, 3) // returns number 5 + * math.add(2, 3, 4) // returns number 9 + * + * const a = math.complex(2, 3) + * const b = math.complex(-4, 1) + * math.add(a, b) // returns Complex -2 + 4i + * + * math.add([1, 2, 3], 4) // returns Array [5, 6, 7] + * + * const c = math.unit('5 cm') + * const d = math.unit('2.1 mm') + * math.add(c, d) // returns Unit 52.1 mm + * + * math.add("2.3", "4") // returns number 6.3 + * + * See also: + * + * subtract, sum + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y` + */ + return typed(name, { + 'any, any': addScalar, + 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => { + var result = self(x, y); + for (var i = 0; i < rest.length; i++) { + result = self(result, rest[i]); + } + return result; + }) + }, matrixAlgorithmSuite({ + elop: addScalar, + DS: matAlgo01xDSid, + SS: matAlgo04xSidSid, + Ss: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js new file mode 100644 index 0000000..490e90b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +import { addNumber } from '../../plain/number/index.js'; +var name = 'addScalar'; +var dependencies = ['typed']; +export var createAddScalar = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Add two scalar values, `x + y`. + * This function is meant for internal use: it is used by the public function + * `add` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y` + * @private + */ + return typed(name, { + 'number, number': addNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.add(y); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.plus(y); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x + y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return x.add(y); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (x.value === null || x.value === undefined) { + throw new Error('Parameter x contains a unit with undefined value'); + } + if (y.value === null || y.value === undefined) { + throw new Error('Parameter y contains a unit with undefined value'); + } + if (!x.equalBase(y)) throw new Error('Units do not match'); + var res = x.clone(); + res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value); + res.fixPrefix = false; + return res; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js new file mode 100644 index 0000000..1038b2b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js @@ -0,0 +1,131 @@ +import { factory } from '../../utils/factory.js'; +import { isBigNumber, isComplex, isFraction } from '../../utils/is.js'; +import { cbrtNumber } from '../../plain/number/index.js'; +var name = 'cbrt'; +var dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction']; +export var createCbrt = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + typed, + isNegative, + unaryMinus, + matrix, + Complex, + BigNumber, + Fraction + } = _ref; + /** + * Calculate the cubic root of a value. + * + * To avoid confusion with the matrix cube root, this function does not + * apply to matrices. For a matrix, to take the cube root elementwise, + * see the examples. + * + * Syntax: + * + * math.cbrt(x) + * math.cbrt(x, allRoots) + * + * Examples: + * + * math.cbrt(27) // returns 3 + * math.cube(3) // returns 27 + * math.cbrt(-64) // returns -4 + * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m + * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5] + * + * const x = math.complex('8i') + * math.cbrt(x) // returns Complex 1.7320508075689 + i + * math.cbrt(x, true) // returns Matrix [ + * // 1.7320508075689 + i + * // -1.7320508075689 + i + * // -2i + * // ] + * + * See also: + * + * square, sqrt, cube + * + * @param {number | BigNumber | Complex | Unit} x + * Value for which to calculate the cubic root. + * @param {boolean} [allRoots] Optional, false by default. Only applicable + * when `x` is a number or complex number. If true, all complex + * roots are returned, if false (default) the principal root is + * returned. + * @return {number | BigNumber | Complex | Unit} + * Returns the cubic root of `x` + */ + return typed(name, { + number: cbrtNumber, + // note: signature 'number, boolean' is also supported, + // created by typed as it knows how to convert number to Complex + + Complex: _cbrtComplex, + 'Complex, boolean': _cbrtComplex, + BigNumber: function BigNumber(x) { + return x.cbrt(); + }, + Unit: _cbrtUnit + }); + + /** + * Calculate the cubic root for a complex number + * @param {Complex} x + * @param {boolean} [allRoots] If true, the function will return an array + * with all three roots. If false or undefined, + * the principal root is returned. + * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x + * @private + */ + function _cbrtComplex(x, allRoots) { + // https://www.wikiwand.com/en/Cube_root#/Complex_numbers + + var arg3 = x.arg() / 3; + var abs = x.abs(); + + // principal root: + var principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp()); + if (allRoots) { + var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())]; + return config.matrix === 'Array' ? all : matrix(all); + } else { + return principal; + } + } + + /** + * Calculate the cubic root for a Unit + * @param {Unit} x + * @return {Unit} Returns the cubic root of x + * @private + */ + function _cbrtUnit(x) { + if (x.value && isComplex(x.value)) { + var result = x.clone(); + result.value = 1.0; + result = result.pow(1.0 / 3); // Compute the units + result.value = _cbrtComplex(x.value); // Compute the value + return result; + } else { + var negate = isNegative(x.value); + if (negate) { + x.value = unaryMinus(x.value); + } + + // TODO: create a helper function for this + var third; + if (isBigNumber(x.value)) { + third = new BigNumber(1).div(3); + } else if (isFraction(x.value)) { + third = new Fraction(1, 3); + } else { + third = 1 / 3; + } + var _result = x.pow(third); + if (negate) { + _result.value = unaryMinus(_result.value); + } + return _result; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js new file mode 100644 index 0000000..3eb1a0a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js @@ -0,0 +1,161 @@ +import Decimal from 'decimal.js'; +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +var name = 'ceil'; +var dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']; +export var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => { + var { + typed, + config, + round + } = _ref; + return typed(name, { + number: function number(x) { + if (nearlyEqual(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return Math.ceil(x); + } + }, + 'number, number': function number_number(x, n) { + if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + var [number, exponent] = "".concat(x, "e").split('e'); + var result = Math.ceil(Number("".concat(number, "e").concat(Number(exponent) + n))); + [number, exponent] = "".concat(result, "e").split('e'); + return Number("".concat(number, "e").concat(Number(exponent) - n)); + } + } + }); +}); +export var createCeil = /* #__PURE__ */factory(name, dependencies, _ref2 => { + var { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var ceilNumber = createCeilNumber({ + typed, + config, + round + }); + /** + * Round a value towards plus infinity + * If `x` is complex, both real and imaginary part are rounded towards plus infinity. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.ceil(x) + * math.ceil(x, n) + * + * Examples: + * + * math.ceil(3.2) // returns number 4 + * math.ceil(3.8) // returns number 4 + * math.ceil(-4.2) // returns number -4 + * math.ceil(-4.7) // returns number -4 + * + * math.ceil(3.212, 2) // returns number 3.22 + * math.ceil(3.288, 2) // returns number 3.29 + * math.ceil(-4.212, 2) // returns number -4.21 + * math.ceil(-4.782, 2) // returns number -4.78 + * + * const c = math.complex(3.24, -2.71) + * math.ceil(c) // returns Complex 4 - 2i + * math.ceil(c, 1) // returns Complex 3.3 - 2.7i + * + * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4] + * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7] + * + * See also: + * + * floor, fix, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('ceil', { + number: ceilNumber.signatures.number, + 'number,number': ceilNumber.signatures['number,number'], + Complex: function Complex(x) { + return x.ceil(); + }, + 'Complex, number': function Complex_number(x, n) { + return x.ceil(n); + }, + 'Complex, BigNumber': function Complex_BigNumber(x, n) { + return x.ceil(n.toNumber()); + }, + BigNumber: function BigNumber(x) { + if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return x.ceil(); + } + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) { + if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL); + } + }, + Fraction: function Fraction(x) { + return x.ceil(); + }, + 'Fraction, number': function Fraction_number(x, n) { + return x.ceil(n); + }, + 'Fraction, BigNumber': function Fraction_BigNumber(x, n) { + return x.ceil(n.toNumber()); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since ceil(0) = 0 + return deepMap(x, self, true); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since ceil(0) = 0 + return deepMap(x, i => self(i, n), true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cube.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cube.js new file mode 100644 index 0000000..71aad9e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/cube.js @@ -0,0 +1,52 @@ +import { factory } from '../../utils/factory.js'; +import { cubeNumber } from '../../plain/number/index.js'; +var name = 'cube'; +var dependencies = ['typed']; +export var createCube = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the cube of a value, `x * x * x`. + * To avoid confusion with `pow(M,3)`, this function does not apply to matrices. + * If you wish to cube every entry of a matrix, see the examples. + * + * Syntax: + * + * math.cube(x) + * + * Examples: + * + * math.cube(2) // returns number 8 + * math.pow(2, 3) // returns number 8 + * math.cube(4) // returns number 64 + * 4 * 4 * 4 // returns number 64 + * + * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64] + * + * See also: + * + * multiply, square, pow, cbrt + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x + */ + return typed(name, { + number: cubeNumber, + Complex: function Complex(x) { + return x.mul(x).mul(x); // Is faster than pow(x, 3) + }, + BigNumber: function BigNumber(x) { + return x.times(x).times(x); + }, + bigint: function bigint(x) { + return x * x * x; + }, + Fraction: function Fraction(x) { + return x.pow(3); // Is faster than mul()mul()mul() + }, + Unit: function Unit(x) { + return x.pow(3); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divide.js new file mode 100644 index 0000000..9c2001e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divide.js @@ -0,0 +1,79 @@ +import { factory } from '../../utils/factory.js'; +import { extend } from '../../utils/object.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +var name = 'divide'; +var dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv']; +export var createDivide = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + multiply, + equalScalar, + divideScalar, + inv + } = _ref; + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + + /** + * Divide two values, `x / y`. + * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`. + * + * Syntax: + * + * math.divide(x, y) + * + * Examples: + * + * math.divide(2, 3) // returns number 0.6666666666666666 + * + * const a = math.complex(5, 14) + * const b = math.complex(4, 1) + * math.divide(a, b) // returns Complex 2 + 3i + * + * const c = [[7, -6], [13, -4]] + * const d = [[1, 2], [4, 3]] + * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]] + * + * const e = math.unit('18 km') + * math.divide(e, 4.5) // returns Unit 4 km + * + * See also: + * + * multiply + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y` + */ + return typed('divide', extend({ + // we extend the signatures of divideScalar with signatures dealing with matrices + + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(x, y) { + // TODO: implement matrix right division using pseudo inverse + // https://www.mathworks.nl/help/matlab/ref/mrdivide.html + // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html + // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour + return multiply(x, inv(y)); + }, + 'DenseMatrix, any': function DenseMatrix_any(x, y) { + return matAlgo14xDs(x, y, divideScalar, false); + }, + 'SparseMatrix, any': function SparseMatrix_any(x, y) { + return matAlgo11xS0s(x, y, divideScalar, false); + }, + 'Array, any': function Array_any(x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf(); + }, + 'any, Array | Matrix': function any_Array__Matrix(x, y) { + return multiply(x, inv(y)); + } + }, divideScalar.signatures)); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js new file mode 100644 index 0000000..bec7bac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +var name = 'divideScalar'; +var dependencies = ['typed', 'numeric']; +export var createDivideScalar = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + numeric + } = _ref; + /** + * Divide two scalar values, `x / y`. + * This function is meant for internal use: it is used by the public functions + * `divide` and `inv`. + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator + * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y` + * @private + */ + return typed(name, { + 'number, number': function number_number(x, y) { + return x / y; + }, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.div(y); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.div(y); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x / y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return x.div(y); + }, + 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y), + 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js new file mode 100644 index 0000000..526c4f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js @@ -0,0 +1,78 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'dotDivide'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat']; +export var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + divideScalar, + DenseMatrix, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Divide two matrices element wise. The function accepts both matrices and + * scalar values. + * + * Syntax: + * + * math.dotDivide(x, y) + * + * Examples: + * + * math.dotDivide(2, 4) // returns 0.5 + * + * a = [[9, 5], [6, 1]] + * b = [[3, 2], [5, 2]] + * + * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]] + * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]] + * + * See also: + * + * divide, multiply, dotMultiply + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: divideScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js new file mode 100644 index 0000000..8e60c9a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js @@ -0,0 +1,66 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'dotMultiply'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat']; +export var createDotMultiply = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + multiplyScalar, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo09xS0Sf = createMatAlgo09xS0Sf({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Multiply two matrices element wise. The function accepts both matrices and + * scalar values. + * + * Syntax: + * + * math.dotMultiply(x, y) + * + * Examples: + * + * math.dotMultiply(2, 4) // returns 8 + * + * a = [[9, 5], [6, 1]] + * b = [[3, 2], [5, 2]] + * + * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]] + * math.multiply(a, b) // returns [[52, 28], [23, 14]] + * + * See also: + * + * multiply, divide, dotDivide + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: multiplyScalar, + SS: matAlgo09xS0Sf, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js new file mode 100644 index 0000000..9f4d3f7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js @@ -0,0 +1,78 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'dotPow'; +var dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat']; +export var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar, + matrix, + pow, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var powScalarSignatures = {}; + for (var signature in pow.signatures) { + if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) { + if (!signature.includes('Matrix') && !signature.includes('Array')) { + powScalarSignatures[signature] = pow.signatures[signature]; + } + } + } + var powScalar = typed(powScalarSignatures); + + /** + * Calculates the power of x to y element wise. + * + * Syntax: + * + * math.dotPow(x, y) + * + * Examples: + * + * math.dotPow(2, 3) // returns number 8 + * + * const a = [[1, 2], [4, 3]] + * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]] + * math.pow(a, 2) // returns Array [[9, 8], [16, 17]] + * + * See also: + * + * pow, sqrt, multiply + * + * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base + * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent + * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y` + */ + return typed(name, matrixAlgorithmSuite({ + elop: powScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/exp.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/exp.js new file mode 100644 index 0000000..50f3c6c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/exp.js @@ -0,0 +1,48 @@ +import { factory } from '../../utils/factory.js'; +import { expNumber } from '../../plain/number/index.js'; +var name = 'exp'; +var dependencies = ['typed']; +export var createExp = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the exponential of a value. + * For matrices, if you want the matrix exponential of square matrix, use + * the `expm` function; if you want to take the exponential of each element, + * see the examples. + * + * Syntax: + * + * math.exp(x) + * + * Examples: + * + * math.exp(2) // returns number 7.3890560989306495 + * math.pow(math.e, 2) // returns number 7.3890560989306495 + * math.log(math.exp(2)) // returns number 2 + * + * math.map([1, 2, 3], math.exp) + * // returns Array [ + * // 2.718281828459045, + * // 7.3890560989306495, + * // 20.085536923187668 + * // ] + * + * See also: + * + * expm1, expm, log, pow + * + * @param {number | BigNumber | Complex} x A number to exponentiate + * @return {number | BigNumber | Complex} Exponential of `x` + */ + return typed(name, { + number: expNumber, + Complex: function Complex(x) { + return x.exp(); + }, + BigNumber: function BigNumber(x) { + return x.exp(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js new file mode 100644 index 0000000..6515327 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js @@ -0,0 +1,53 @@ +import { factory } from '../../utils/factory.js'; +import { expm1Number } from '../../plain/number/index.js'; +var name = 'expm1'; +var dependencies = ['typed', 'Complex']; +export var createExpm1 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Complex: _Complex + } = _ref; + /** + * Calculate the value of subtracting 1 from the exponential value. + * This function is more accurate than `math.exp(x)-1` when `x` is near 0 + * To avoid ambiguity with the matrix exponential `expm`, this function + * does not operate on matrices; if you wish to apply it elementwise, see + * the examples. + * + * Syntax: + * + * math.expm1(x) + * + * Examples: + * + * math.expm1(2) // returns number 6.38905609893065 + * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495 + * math.expm1(1e-8) // returns number 1.0000000050000001e-8 + * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9 + * math.log(math.expm1(2) + 1) // returns number 2 + * + * math.map([1, 2, 3], math.expm1) + * // returns Array [ + * // 1.718281828459045, + * // 6.3890560989306495, + * // 19.085536923187668 + * // ] + * + * See also: + * + * exp, expm, log, pow + * + * @param {number | BigNumber | Complex} x The number to exponentiate + * @return {number | BigNumber | Complex} Exponential of `x`, minus one + */ + return typed(name, { + number: expm1Number, + Complex: function Complex(x) { + var r = Math.exp(x.re); + return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im)); + }, + BigNumber: function BigNumber(x) { + return x.exp().minus(1); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/fix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/fix.js new file mode 100644 index 0000000..648eacf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/fix.js @@ -0,0 +1,126 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +var name = 'fix'; +var dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix']; +export var createFixNumber = /* #__PURE__ */factory(name, ['typed', 'ceil', 'floor'], _ref => { + var { + typed, + ceil, + floor + } = _ref; + return typed(name, { + number: function number(x) { + return x > 0 ? floor(x) : ceil(x); + }, + 'number, number': function number_number(x, n) { + return x > 0 ? floor(x, n) : ceil(x, n); + } + }); +}); +export var createFix = /* #__PURE__ */factory(name, dependencies, _ref2 => { + var { + typed, + Complex: _Complex, + matrix, + ceil, + floor, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var fixNumber = createFixNumber({ + typed, + ceil, + floor + }); + /** + * Round a value towards zero. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.fix(x) + * math.fix(x,n) + * + * Examples: + * + * math.fix(3.2) // returns number 3 + * math.fix(3.8) // returns number 3 + * math.fix(-4.2) // returns number -4 + * math.fix(-4.7) // returns number -4 + * + * math.fix(3.12, 1) // returns number 3.1 + * math.fix(3.18, 1) // returns number 3.1 + * math.fix(-4.12, 1) // returns number -4.1 + * math.fix(-4.17, 1) // returns number -4.1 + * + * const c = math.complex(3.22, -2.78) + * math.fix(c) // returns Complex 3 - 2i + * math.fix(c, 1) // returns Complex 3.2 -2.7i + * + * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4] + * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7] + * + * See also: + * + * ceil, floor, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('fix', { + number: fixNumber.signatures.number, + 'number, number | BigNumber': fixNumber.signatures['number,number'], + Complex: function Complex(x) { + return new _Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im)); + }, + 'Complex, number': function Complex_number(x, n) { + return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n)); + }, + 'Complex, BigNumber': function Complex_BigNumber(x, bn) { + var n = bn.toNumber(); + return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n)); + }, + BigNumber: function BigNumber(x) { + return x.isNegative() ? ceil(x) : floor(x); + }, + 'BigNumber, number | BigNumber': function BigNumber_number__BigNumber(x, n) { + return x.isNegative() ? ceil(x, n) : floor(x, n); + }, + Fraction: function Fraction(x) { + return x.s < 0 ? x.ceil() : x.floor(); + }, + 'Fraction, number | BigNumber': function Fraction_number__BigNumber(x, n) { + return x.s < 0 ? ceil(x, n) : floor(x, n); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since fix(0) = 0 + return deepMap(x, self, true); + }), + 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since fix(0) = 0 + return deepMap(x, i => self(i, n), true); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/floor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/floor.js new file mode 100644 index 0000000..7c9b08e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/floor.js @@ -0,0 +1,164 @@ +import Decimal from 'decimal.js'; +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +var name = 'floor'; +var dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix']; +export var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => { + var { + typed, + config, + round + } = _ref; + return typed(name, { + number: function number(x) { + if (nearlyEqual(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return Math.floor(x); + } + }, + 'number, number': function number_number(x, n) { + if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + var [number, exponent] = "".concat(x, "e").split('e'); + var result = Math.floor(Number("".concat(number, "e").concat(Number(exponent) + n))); + [number, exponent] = "".concat(result, "e").split('e'); + return Number("".concat(number, "e").concat(Number(exponent) - n)); + } + } + }); +}); +export var createFloor = /* #__PURE__ */factory(name, dependencies, _ref2 => { + var { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + } = _ref2; + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var floorNumber = createFloorNumber({ + typed, + config, + round + }); + /** + * Round a value towards minus infinity. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.floor(x) + * math.floor(x, n) + * + * Examples: + * + * math.floor(3.2) // returns number 3 + * math.floor(3.8) // returns number 3 + * math.floor(-4.2) // returns number -5 + * math.floor(-4.7) // returns number -5 + * + * math.floor(3.212, 2) // returns number 3.21 + * math.floor(3.288, 2) // returns number 3.28 + * math.floor(-4.212, 2) // returns number -4.22 + * math.floor(-4.782, 2) // returns number -4.79 + * + * const c = math.complex(3.24, -2.71) + * math.floor(c) // returns Complex 3 - 3i + * math.floor(c, 1) // returns Complex 3.2 -2.8i + * + * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5] + * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8] + * + * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283] + * + * // Note that floor(array, array) currently not implemented. + * + * See also: + * + * ceil, fix, round + * + * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed('floor', { + number: floorNumber.signatures.number, + 'number,number': floorNumber.signatures['number,number'], + Complex: function Complex(x) { + return x.floor(); + }, + 'Complex, number': function Complex_number(x, n) { + return x.floor(n); + }, + 'Complex, BigNumber': function Complex_BigNumber(x, n) { + return x.floor(n.toNumber()); + }, + BigNumber: function BigNumber(x) { + if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) { + return round(x); + } else { + return x.floor(); + } + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) { + if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) { + return round(x, n); + } else { + return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR); + } + }, + Fraction: function Fraction(x) { + return x.floor(); + }, + 'Fraction, number': function Fraction_number(x, n) { + return x.floor(n); + }, + 'Fraction, BigNumber': function Fraction_BigNumber(x, n) { + return x.floor(n.toNumber()); + }, + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since floor(0) = 0 + return deepMap(x, self, true); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // deep map collection, skip zeros since ceil(0) = 0 + return deepMap(x, i => self(i, n), true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }), + 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }), + 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => { + if (equalScalar(x, 0)) return zeros(y.size(), y.storage()); + if (y.storage() === 'dense') { + return matAlgo14xDs(y, x, self, true); + } + return matAlgo12xSfs(y, x, self, true); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js new file mode 100644 index 0000000..6214af1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js @@ -0,0 +1,153 @@ +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMod } from './mod.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { ArgumentsError } from '../../error/ArgumentsError.js'; +var name = 'gcd'; +var dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat']; +var gcdTypes = 'number | BigNumber | Fraction | Matrix | Array'; +var gcdManyTypesSignature = "".concat(gcdTypes, ", ").concat(gcdTypes, ", ...").concat(gcdTypes); +function is1d(array) { + return !array.some(element => Array.isArray(element)); +} +export var createGcd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + config, + round, + equalScalar, + zeros, + BigNumber, + DenseMatrix, + concat + } = _ref; + var mod = createMod({ + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + }); + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo04xSidSid = createMatAlgo04xSidSid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Calculate the greatest common divisor for two or more values or arrays. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.gcd(a, b) + * math.gcd(a, b, c, ...) + * + * Examples: + * + * math.gcd(8, 12) // returns 4 + * math.gcd(-4, 6) // returns 2 + * math.gcd(25, 15, -10) // returns 5 + * + * math.gcd([8, -4], [12, 6]) // returns [4, 2] + * + * See also: + * + * lcm, xgcd + * + * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers + * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor + */ + return typed(name, { + 'number, number': _gcdNumber, + 'BigNumber, BigNumber': _gcdBigNumber, + 'Fraction, Fraction': (x, y) => x.gcd(y) + }, matrixAlgorithmSuite({ + SS: matAlgo04xSidSid, + DS: matAlgo01xDSid, + Ss: matAlgo10xSids + }), { + [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => { + var res = self(a, b); + for (var i = 0; i < args.length; i++) { + res = self(res, args[i]); + } + return res; + }), + Array: typed.referToSelf(self => array => { + if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) { + return self(...array[0]); + } + if (is1d(array)) { + return self(...array); + } + throw new ArgumentsError('gcd() supports only 1d matrices!'); + }), + Matrix: typed.referToSelf(self => matrix => { + return self(matrix.toArray()); + }) + }); + + /** + * Calculate gcd for numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the greatest common denominator of a and b + * @private + */ + function _gcdNumber(a, b) { + if (!isInteger(a) || !isInteger(b)) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + var r; + while (b !== 0) { + r = mod(a, b); + a = b; + b = r; + } + return a < 0 ? -a : a; + } + + /** + * Calculate gcd for BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @returns {BigNumber} Returns greatest common denominator of a and b + * @private + */ + function _gcdBigNumber(a, b) { + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + var zero = new BigNumber(0); + while (!b.isZero()) { + var r = mod(a, b); + a = b; + b = r; + } + return a.lt(zero) ? a.neg() : a; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js new file mode 100644 index 0000000..081ac3e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js @@ -0,0 +1,77 @@ +import { factory } from '../../utils/factory.js'; +import { flatten } from '../../utils/array.js'; +import { isComplex } from '../../utils/is.js'; +var name = 'hypot'; +var dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive']; +export var createHypot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + addScalar, + divideScalar, + multiplyScalar, + sqrt, + smaller, + isPositive + } = _ref; + /** + * Calculate the hypotenuse of a list with values. The hypotenuse is defined as: + * + * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) + * + * For matrix input, the hypotenuse is calculated for all values in the matrix. + * + * Syntax: + * + * math.hypot(a, b, ...) + * math.hypot([a, b, c, ...]) + * + * Examples: + * + * math.hypot(3, 4) // 5 + * math.hypot(3, 4, 5) // 7.0710678118654755 + * math.hypot([3, 4, 5]) // 7.0710678118654755 + * math.hypot(-2) // 2 + * + * See also: + * + * abs, norm + * + * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix. + * Matrix and Array input is flattened and returns a + * single number for the whole matrix. + * @return {number | BigNumber} Returns the hypothenusa of the input values. + */ + return typed(name, { + '... number | BigNumber': _hypot, + Array: _hypot, + Matrix: M => _hypot(flatten(M.toArray())) + }); + + /** + * Calculate the hypotenuse for an Array with values + * @param {Array.} args + * @return {number | BigNumber} Returns the result + * @private + */ + function _hypot(args) { + // code based on `hypot` from es6-shim: + // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633 + var result = 0; + var largest = 0; + for (var i = 0; i < args.length; i++) { + if (isComplex(args[i])) { + throw new TypeError('Unexpected type of argument to hypot'); + } + var value = abs(args[i]); + if (smaller(largest, value)) { + result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value))); + result = addScalar(result, 1); + largest = value; + } else { + result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value); + } + } + return multiplyScalar(largest, sqrt(result)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js new file mode 100644 index 0000000..18ba0c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js @@ -0,0 +1,55 @@ +import { factory } from '../../utils/factory.js'; +var name = 'invmod'; +var dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger']; +export var createInvmod = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + BigNumber, + xgcd, + equal, + smaller, + mod, + add, + isInteger + } = _ref; + /** + * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax ≣ 1 (mod b)` + * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse. + * + * Syntax: + * + * math.invmod(a, b) + * + * Examples: + * + * math.invmod(8, 12) // returns NaN + * math.invmod(7, 13) // returns 2 + * math.invmod(15151, 15122) // returns 10429 + * + * See also: + * + * gcd, xgcd + * + * @param {number | BigNumber} a An integer number + * @param {number | BigNumber} b An integer number + * @return {number | BigNumber } Returns an integer number + * where `invmod(a,b)*a ≣ 1 (mod b)` + */ + return typed(name, { + 'number, number': invmod, + 'BigNumber, BigNumber': invmod + }); + function invmod(a, b) { + if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers'); + a = mod(a, b); + if (equal(b, 0)) throw new Error('Divisor must be non zero'); + var res = xgcd(a, b); + res = res.valueOf(); + var [gcd, inv] = res; + if (!equal(gcd, BigNumber(1))) return NaN; + inv = mod(inv, b); + if (smaller(inv, BigNumber(0))) inv = add(inv, b); + return inv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js new file mode 100644 index 0000000..b82301a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js @@ -0,0 +1,110 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { lcmNumber } from '../../plain/number/index.js'; +var name = 'lcm'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'concat']; +export var createLcm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo06xS0S0 = createMatAlgo06xS0S0({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var lcmTypes = 'number | BigNumber | Fraction | Matrix | Array'; + var lcmManySignature = {}; + lcmManySignature["".concat(lcmTypes, ", ").concat(lcmTypes, ", ...").concat(lcmTypes)] = typed.referToSelf(self => (a, b, args) => { + var res = self(a, b); + for (var i = 0; i < args.length; i++) { + res = self(res, args[i]); + } + return res; + }); + + /** + * Calculate the least common multiple for two or more values or arrays. + * + * lcm is defined as: + * + * lcm(a, b) = abs(a * b) / gcd(a, b) + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.lcm(a, b) + * math.lcm(a, b, c, ...) + * + * Examples: + * + * math.lcm(4, 6) // returns 12 + * math.lcm(6, 21) // returns 42 + * math.lcm(6, 21, 5) // returns 210 + * + * math.lcm([4, 6], [6, 21]) // returns [12, 42] + * + * See also: + * + * gcd, xgcd + * + * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers + * @return {number | BigNumber | Array | Matrix} The least common multiple + */ + return typed(name, { + 'number, number': lcmNumber, + 'BigNumber, BigNumber': _lcmBigNumber, + 'Fraction, Fraction': (x, y) => x.lcm(y) + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + }), lcmManySignature); + + /** + * Calculate lcm for two BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @returns {BigNumber} Returns the least common multiple of a and b + * @private + */ + function _lcmBigNumber(a, b) { + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function lcm must be integer numbers'); + } + if (a.isZero()) { + return a; + } + if (b.isZero()) { + return b; + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + // evaluate lcm here inline to reduce overhead + var prod = a.times(b); + while (!b.isZero()) { + var t = b; + b = a.mod(t); + a = t; + } + return prod.div(a).abs(); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log.js new file mode 100644 index 0000000..7a0e9f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log.js @@ -0,0 +1,72 @@ +import { factory } from '../../utils/factory.js'; +import { logNumber } from '../../plain/number/index.js'; +var name = 'log'; +var dependencies = ['config', 'typed', 'divideScalar', 'Complex']; +export var createLog = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + divideScalar, + Complex + } = _ref; + /** + * Calculate the logarithm of a value. + * + * To avoid confusion with the matrix logarithm, this function does not + * apply to matrices. + * + * Syntax: + * + * math.log(x) + * math.log(x, base) + * + * Examples: + * + * math.log(3.5) // returns 1.252762968495368 + * math.exp(math.log(2.4)) // returns 2.4 + * + * math.pow(10, 4) // returns 10000 + * math.log(10000, 10) // returns 4 + * math.log(10000) / math.log(10) // returns 4 + * + * math.log(1024, 2) // returns 10 + * math.pow(2, 10) // returns 1024 + * + * See also: + * + * exp, log2, log10, log1p + * + * @param {number | BigNumber | Complex} x + * Value for which to calculate the logarithm. + * @param {number | BigNumber | Complex} [base=e] + * Optional base for the logarithm. If not provided, the natural + * logarithm of `x` is calculated. + * @return {number | BigNumber | Complex} + * Returns the logarithm of `x` + */ + return typed(name, { + number: function number(x) { + if (x >= 0 || config.predictable) { + return logNumber(x); + } else { + // negative value -> complex value computation + return new Complex(x, 0).log(); + } + }, + Complex: function Complex(x) { + return x.log(); + }, + BigNumber: function BigNumber(x) { + if (!x.isNegative() || config.predictable) { + return x.ln(); + } else { + // downgrade to number, return Complex valued result + return new Complex(x.toNumber(), 0).log(); + } + }, + 'any, any': typed.referToSelf(self => (x, base) => { + // calculate logarithm for a specified base, log(x, base) + return divideScalar(self(x), self(base)); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log10.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log10.js new file mode 100644 index 0000000..66bd62f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log10.js @@ -0,0 +1,59 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { log10Number } from '../../plain/number/index.js'; +var name = 'log10'; +var dependencies = ['typed', 'config', 'Complex']; +export var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex: _Complex + } = _ref; + /** + * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log10(x) + * + * Examples: + * + * math.log10(0.00001) // returns -5 + * math.log10(10000) // returns 4 + * math.log(10000) / math.log(10) // returns 4 + * math.pow(10, 4) // returns 10000 + * + * See also: + * + * exp, log, log1p, log2 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the 10-base logarithm of `x` + */ + return typed(name, { + number: function number(x) { + if (x >= 0 || config.predictable) { + return log10Number(x); + } else { + // negative value -> complex value computation + return new _Complex(x, 0).log().div(Math.LN10); + } + }, + Complex: function Complex(x) { + return new _Complex(x).log().div(Math.LN10); + }, + BigNumber: function BigNumber(x) { + if (!x.isNegative() || config.predictable) { + return x.log(); + } else { + // downgrade to number, return Complex valued result + return new _Complex(x.toNumber(), 0).log().div(Math.LN10); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js new file mode 100644 index 0000000..284d7f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js @@ -0,0 +1,81 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { log1p as _log1p } from '../../utils/number.js'; +var name = 'log1p'; +var dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex']; +export var createLog1p = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + divideScalar, + log, + Complex + } = _ref; + /** + * Calculate the logarithm of a `value+1`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log1p(x) + * math.log1p(x, base) + * + * Examples: + * + * math.log1p(2.5) // returns 1.252762968495368 + * math.exp(math.log1p(1.4)) // returns 2.4 + * + * math.pow(10, 4) // returns 10000 + * math.log1p(9999, 10) // returns 4 + * math.log1p(9999) / math.log(10) // returns 4 + * + * See also: + * + * exp, log, log2, log10 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm of `x+1`. + * @param {number | BigNumber | Complex} [base=e] + * Optional base for the logarithm. If not provided, the natural + * logarithm of `x+1` is calculated. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the logarithm of `x+1` + */ + return typed(name, { + number: function number(x) { + if (x >= -1 || config.predictable) { + return _log1p(x); + } else { + // negative value -> complex value computation + return _log1pComplex(new Complex(x, 0)); + } + }, + Complex: _log1pComplex, + BigNumber: function BigNumber(x) { + var y = x.plus(1); + if (!y.isNegative() || config.predictable) { + return y.ln(); + } else { + // downgrade to number, return Complex valued result + return _log1pComplex(new Complex(x.toNumber(), 0)); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)), + 'any, any': typed.referToSelf(self => (x, base) => { + // calculate logarithm for a specified base, log1p(x, base) + return divideScalar(self(x), log(base)); + }) + }); + + /** + * Calculate the natural logarithm of a complex number + 1 + * @param {Complex} x + * @returns {Complex} + * @private + */ + function _log1pComplex(x) { + var xRe1p = x.re + 1; + return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log2.js new file mode 100644 index 0000000..0264916 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/log2.js @@ -0,0 +1,68 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { log2Number } from '../../plain/number/index.js'; +var name = 'log2'; +var dependencies = ['typed', 'config', 'Complex']; +export var createLog2 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex + } = _ref; + /** + * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.log2(x) + * + * Examples: + * + * math.log2(0.03125) // returns -5 + * math.log2(16) // returns 4 + * math.log2(16) / math.log2(2) // returns 4 + * math.pow(2, 4) // returns 16 + * + * See also: + * + * exp, log, log1p, log10 + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the logarithm. + * @return {number | BigNumber | Complex | Array | Matrix} + * Returns the 2-base logarithm of `x` + */ + return typed(name, { + number: function number(x) { + if (x >= 0 || config.predictable) { + return log2Number(x); + } else { + // negative value -> complex value computation + return _log2Complex(new Complex(x, 0)); + } + }, + Complex: _log2Complex, + BigNumber: function BigNumber(x) { + if (!x.isNegative() || config.predictable) { + return x.log(2); + } else { + // downgrade to number, return Complex valued result + return _log2Complex(new Complex(x.toNumber(), 0)); + } + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); + + /** + * Calculate log2 for a complex value + * @param {Complex} x + * @returns {Complex} + * @private + */ + function _log2Complex(x) { + var newX = Math.sqrt(x.re * x.re + x.im * x.im); + return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/mod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/mod.js new file mode 100644 index 0000000..18953f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/mod.js @@ -0,0 +1,133 @@ +import { factory } from '../../utils/factory.js'; +import { createFloor } from './floor.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'mod'; +var dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +export var createMod = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + var floor = createFloor({ + typed, + config, + round, + matrix, + equalScalar, + zeros, + DenseMatrix + }); + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo05xSfSf = createMatAlgo05xSfSf({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Calculates the modulus, the remainder of an integer division. + * + * For matrices, the function is evaluated element wise. + * + * The modulus is defined as: + * + * x - y * floor(x / y) + * + * See https://en.wikipedia.org/wiki/Modulo_operation. + * + * Syntax: + * + * math.mod(x, y) + * + * Examples: + * + * math.mod(8, 3) // returns 2 + * math.mod(11, 2) // returns 1 + * + * function isOdd(x) { + * return math.mod(x, 2) != 0 + * } + * + * isOdd(2) // returns false + * isOdd(3) // returns true + * + * See also: + * + * divide + * + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor + * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`. + */ + return typed(name, { + 'number, number': _modNumber, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return y.isZero() ? x : x.sub(y.mul(floor(x.div(y)))); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + if (y === 0n) { + return x; + } + if (x < 0) { + var m = x % y; + return m === 0n ? m : m + y; + } + return x % y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y)))); + } + }, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); + + /** + * Calculate the modulus of two numbers + * @param {number} x + * @param {number} y + * @returns {number} res + * @private + */ + function _modNumber(x, y) { + // We don't use JavaScript's % operator here as this doesn't work + // correctly for x < 0 and x === 0 + // see https://en.wikipedia.org/wiki/Modulo_operation + + // We use mathjs floor to handle errors associated with + // precision float approximation + return y === 0 ? x : x - y * floor(x / y); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js new file mode 100644 index 0000000..ddcafc3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js @@ -0,0 +1,880 @@ +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +import { arraySize } from '../../utils/array.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +var name = 'multiply'; +var dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot']; +export var createMultiply = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + addScalar, + multiplyScalar, + equalScalar, + dot + } = _ref; + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + function _validateMatrixDimensions(size1, size2) { + // check left operand dimensions + switch (size1.length) { + case 1: + // check size2 + switch (size2.length) { + case 1: + // Vector x Vector + if (size1[0] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length'); + } + break; + case 2: + // Vector x Matrix + if (size1[0] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)'); + } + break; + case 2: + // check size2 + switch (size2.length) { + case 1: + // Matrix x Vector + if (size1[1] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')'); + } + break; + case 2: + // Matrix x Matrix + if (size1[1] !== size2[0]) { + // throw error + throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)'); + } + break; + default: + throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)'); + } + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (N) + * @param {Matrix} b Dense Vector (N) + * + * @return {number} Scalar value + */ + function _multiplyVectorVector(a, b, n) { + // check empty vector + if (n === 0) { + throw new Error('Cannot multiply two empty vectors'); + } + return dot(a, b); + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (M) + * @param {Matrix} b Matrix (MxN) + * + * @return {Matrix} Dense Vector (N) + */ + function _multiplyVectorMatrix(a, b) { + // process storage + if (b.storage() !== 'dense') { + throw new Error('Support for SparseMatrix not implemented'); + } + return _multiplyVectorDenseMatrix(a, b); + } + + /** + * C = A * B + * + * @param {Matrix} a Dense Vector (M) + * @param {Matrix} b Dense Matrix (MxN) + * + * @return {Matrix} Dense Vector (N) + */ + function _multiplyVectorDenseMatrix(a, b) { + // a dense + var adata = a._data; + var asize = a._size; + var adt = a._datatype || a.getDataType(); + // b dense + var bdata = b._data; + var bsize = b._size; + var bdt = b._datatype || b.getDataType(); + // rows & columns + var alength = asize[0]; + var bcolumns = bsize[1]; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + var c = []; + + // loop matrix columns + for (var j = 0; j < bcolumns; j++) { + // sum (do not initialize it with zero) + var sum = mf(adata[0], bdata[0][j]); + // loop vector + for (var i = 1; i < alength; i++) { + // multiply & accumulate + sum = af(sum, mf(adata[i], bdata[i][j])); + } + c[j] = sum; + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a Matrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} Dense Vector (M) + */ + var _multiplyMatrixVector = typed('_multiplyMatrixVector', { + 'DenseMatrix, any': _multiplyDenseMatrixVector, + 'SparseMatrix, any': _multiplySparseMatrixVector + }); + + /** + * C = A * B + * + * @param {Matrix} a Matrix (MxN) + * @param {Matrix} b Matrix (NxC) + * + * @return {Matrix} Matrix (MxC) + */ + var _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', { + 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix, + 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix, + 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix, + 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix + }); + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} Dense Vector (M) + */ + function _multiplyDenseMatrixVector(a, b) { + // a dense + var adata = a._data; + var asize = a._size; + var adt = a._datatype || a.getDataType(); + // b dense + var bdata = b._data; + var bdt = b._datatype || b.getDataType(); + // rows & columns + var arows = asize[0]; + var acolumns = asize[1]; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + var c = []; + + // loop matrix a rows + for (var i = 0; i < arows; i++) { + // current row + var row = adata[i]; + // sum (do not initialize it with zero) + var sum = mf(row[0], bdata[0]); + // loop matrix a columns + for (var j = 1; j < acolumns; j++) { + // multiply & accumulate + sum = af(sum, mf(row[j], bdata[j])); + } + c[i] = sum; + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [arows], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b DenseMatrix (NxC) + * + * @return {Matrix} DenseMatrix (MxC) + */ + function _multiplyDenseMatrixDenseMatrix(a, b) { + // getDataType() + // a dense + var adata = a._data; + var asize = a._size; + var adt = a._datatype || a.getDataType(); + // b dense + var bdata = b._data; + var bsize = b._size; + var bdt = b._datatype || b.getDataType(); + // rows & columns + var arows = asize[0]; + var acolumns = asize[1]; + var bcolumns = bsize[1]; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + var c = []; + + // loop matrix a rows + for (var i = 0; i < arows; i++) { + // current row + var row = adata[i]; + // initialize row array + c[i] = []; + // loop matrix b columns + for (var j = 0; j < bcolumns; j++) { + // sum (avoid initializing sum to zero) + var sum = mf(row[0], bdata[0][j]); + // loop matrix a columns + for (var x = 1; x < acolumns; x++) { + // multiply & accumulate + sum = af(sum, mf(row[x], bdata[x][j])); + } + c[i][j] = sum; + } + } + + // return matrix + return a.createDenseMatrix({ + data: c, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a DenseMatrix (MxN) + * @param {Matrix} b SparseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplyDenseMatrixSparseMatrix(a, b) { + // a dense + var adata = a._data; + var asize = a._size; + var adt = a._datatype || a.getDataType(); + // b sparse + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + // validate b matrix + if (!bvalues) { + throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix'); + } + // rows & columns + var arows = asize[0]; + var bcolumns = bsize[1]; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + // equalScalar signature to use + var eq = equalScalar; + // zero value + var zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // result + var cvalues = []; + var cindex = []; + var cptr = []; + // c matrix + var c = b.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // loop b columns + for (var jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // indeces in column jb + var kb0 = bptr[jb]; + var kb1 = bptr[jb + 1]; + // do not process column jb if no data exists + if (kb1 > kb0) { + // last row mark processed + var last = 0; + // loop a rows + for (var i = 0; i < arows; i++) { + // column mark + var mark = i + 1; + // C[i, jb] + var cij = void 0; + // values in b column j + for (var kb = kb0; kb < kb1; kb++) { + // row + var ib = bindex[kb]; + // check value has been initialized + if (last !== mark) { + // first value in column jb + cij = mf(adata[i][ib], bvalues[kb]); + // update mark + last = mark; + } else { + // accumulate value + cij = af(cij, mf(adata[i][ib], bvalues[kb])); + } + } + // check column has been processed and value != 0 + if (last === mark && !eq(cij, zero)) { + // push row & value + cindex.push(i); + cvalues.push(cij); + } + } + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b Dense Vector (N) + * + * @return {Matrix} SparseMatrix (M, 1) + */ + function _multiplySparseMatrixVector(a, b) { + // a sparse + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // validate a matrix + if (!avalues) { + throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix'); + } + // b dense + var bdata = b._data; + var bdt = b._datatype || b.getDataType(); + // rows & columns + var arows = a._size[0]; + var brows = b._size[0]; + // result + var cvalues = []; + var cindex = []; + var cptr = []; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + // equalScalar signature to use + var eq = equalScalar; + // zero value + var zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // workspace + var x = []; + // vector with marks indicating a value x[i] exists in a given column + var w = []; + + // update ptr + cptr[0] = 0; + // rows in b + for (var ib = 0; ib < brows; ib++) { + // b[ib] + var vbi = bdata[ib]; + // check b[ib] != 0, avoid loops + if (!eq(vbi, zero)) { + // A values & index in ib column + for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // a row + var ia = aindex[ka]; + // check value exists in current j + if (!w[ia]) { + // ia is new entry in j + w[ia] = true; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(vbi, avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(vbi, avalues[ka])); + } + } + } + } + // copy values from x to column jb of c + for (var p1 = cindex.length, p = 0; p < p1; p++) { + // row + var ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + // update ptr + cptr[1] = cindex.length; + + // matrix to return + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, 1], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b DenseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplySparseMatrixDenseMatrix(a, b) { + // a sparse + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // validate a matrix + if (!avalues) { + throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix'); + } + // b dense + var bdata = b._data; + var bdt = b._datatype || b.getDataType(); + // rows & columns + var arows = a._size[0]; + var brows = b._size[0]; + var bcolumns = b._size[1]; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + // equalScalar signature to use + var eq = equalScalar; + // zero value + var zero = 0; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + } + + // result + var cvalues = []; + var cindex = []; + var cptr = []; + // c matrix + var c = a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // workspace + var x = []; + // vector with marks indicating a value x[i] exists in a given column + var w = []; + + // loop b columns + for (var jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // mark in workspace for current column + var mark = jb + 1; + // rows in jb + for (var ib = 0; ib < brows; ib++) { + // b[ib, jb] + var vbij = bdata[ib][jb]; + // check b[ib, jb] != 0, avoid loops + if (!eq(vbij, zero)) { + // A values & index in ib column + for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // a row + var ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(vbij, avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(vbij, avalues[ka])); + } + } + } + } + // copy values from x to column jb of c + for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) { + // row + var ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * C = A * B + * + * @param {Matrix} a SparseMatrix (MxN) + * @param {Matrix} b SparseMatrix (NxC) + * + * @return {Matrix} SparseMatrix (MxC) + */ + function _multiplySparseMatrixSparseMatrix(a, b) { + // a sparse + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // b sparse + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // rows & columns + var arows = a._size[0]; + var bcolumns = b._size[1]; + // flag indicating both matrices (a & b) contain data + var values = avalues && bvalues; + + // datatype + var dt; + // addScalar signature to use + var af = addScalar; + // multiplyScalar signature to use + var mf = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + // datatype + dt = adt; + // find signatures that matches (dt, dt) + af = typed.find(addScalar, [dt, dt]); + mf = typed.find(multiplyScalar, [dt, dt]); + } + + // result + var cvalues = values ? [] : undefined; + var cindex = []; + var cptr = []; + // c matrix + var c = a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [arows, bcolumns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + + // workspace + var x = values ? [] : undefined; + // vector with marks indicating a value x[i] exists in a given column + var w = []; + // variables + var ka, ka0, ka1, kb, kb0, kb1, ia, ib; + // loop b columns + for (var jb = 0; jb < bcolumns; jb++) { + // update ptr + cptr[jb] = cindex.length; + // mark in workspace for current column + var mark = jb + 1; + // B values & index in j + for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) { + // b row + ib = bindex[kb]; + // check we need to process values + if (values) { + // loop values in a[:,ib] + for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // row + ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + // x(ia) = A + x[ia] = mf(bvalues[kb], avalues[ka]); + } else { + // i exists in C already + x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka])); + } + } + } else { + // loop values in a[:,ib] + for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) { + // row + ia = aindex[ka]; + // check value exists in current j + if (w[ia] !== mark) { + // ia is new entry in j + w[ia] = mark; + // add i to pattern of C + cindex.push(ia); + } + } + } + } + // check we need to process matrix values (pattern matrix) + if (values) { + // copy values from x to column jb of c + for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) { + // row + var ic = cindex[p]; + // copy value + cvalues[p] = x[ic]; + } + } + } + // update ptr + cptr[bcolumns] = cindex.length; + + // return sparse matrix + return c; + } + + /** + * Multiply two or more values, `x * y`. + * For matrices, the matrix product is calculated. + * + * Syntax: + * + * math.multiply(x, y) + * math.multiply(x, y, z, ...) + * + * Examples: + * + * math.multiply(4, 5.2) // returns number 20.8 + * math.multiply(2, 3, 4) // returns number 24 + * + * const a = math.complex(2, 3) + * const b = math.complex(4, 1) + * math.multiply(a, b) // returns Complex 5 + 14i + * + * const c = [[1, 2], [4, 3]] + * const d = [[1, 2, 3], [3, -4, 7]] + * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]] + * + * const e = math.unit('2.1 km') + * math.multiply(3, e) // returns Unit 6.3 km + * + * See also: + * + * divide, prod, cross, dot + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` + */ + return typed(name, multiplyScalar, { + // we extend the signatures of multiplyScalar with signatures dealing with matrices + + 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => { + // check dimensions + _validateMatrixDimensions(arraySize(x), arraySize(y)); + + // use dense matrix implementation + var m = selfMM(matrix(x), matrix(y)); + // return array or scalar + return isMatrix(m) ? m.valueOf() : m; + }), + 'Matrix, Matrix': function Matrix_Matrix(x, y) { + // dimensions + var xsize = x.size(); + var ysize = y.size(); + + // check dimensions + _validateMatrixDimensions(xsize, ysize); + + // process dimensions + if (xsize.length === 1) { + // process y dimensions + if (ysize.length === 1) { + // Vector * Vector + return _multiplyVectorVector(x, y, xsize[0]); + } + // Vector * Matrix + return _multiplyVectorMatrix(x, y); + } + // process y dimensions + if (ysize.length === 1) { + // Matrix * Vector + return _multiplyMatrixVector(x, y); + } + // Matrix * Matrix + return _multiplyMatrixMatrix(x, y); + }, + 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))), + 'Array, Matrix': typed.referToSelf(self => (x, y) => { + // use Matrix * Matrix implementation + return self(matrix(x, y.storage()), y); + }), + 'SparseMatrix, any': function SparseMatrix_any(x, y) { + return matAlgo11xS0s(x, y, multiplyScalar, false); + }, + 'DenseMatrix, any': function DenseMatrix_any(x, y) { + return matAlgo14xDs(x, y, multiplyScalar, false); + }, + 'any, SparseMatrix': function any_SparseMatrix(x, y) { + return matAlgo11xS0s(y, x, multiplyScalar, true); + }, + 'any, DenseMatrix': function any_DenseMatrix(x, y) { + return matAlgo14xDs(y, x, multiplyScalar, true); + }, + 'Array, any': function Array_any(x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf(); + }, + 'any, Array': function any_Array(x, y) { + // use matrix implementation + return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf(); + }, + 'any, any': multiplyScalar, + 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => { + var result = self(x, y); + for (var i = 0; i < rest.length; i++) { + result = self(result, rest[i]); + } + return result; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js new file mode 100644 index 0000000..f46b18f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js @@ -0,0 +1,38 @@ +import { factory } from '../../utils/factory.js'; +import { multiplyNumber } from '../../plain/number/index.js'; +var name = 'multiplyScalar'; +var dependencies = ['typed']; +export var createMultiplyScalar = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Multiply two scalar values, `x * y`. + * This function is meant for internal use: it is used by the public function + * `multiply` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y` + * @private + */ + return typed('multiplyScalar', { + 'number, number': multiplyNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.mul(y); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.times(y); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x * y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return x.mul(y); + }, + 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x), + 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/norm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/norm.js new file mode 100644 index 0000000..c307ca3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/norm.js @@ -0,0 +1,287 @@ +import { factory } from '../../utils/factory.js'; +var name = 'norm'; +var dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs']; +export var createNorm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + add, + pow, + conj, + sqrt, + multiply, + equalScalar, + larger, + smaller, + matrix, + ctranspose, + eigs + } = _ref; + /** + * Calculate the norm of a number, vector or matrix. + * + * The second parameter p is optional. If not provided, it defaults to 2. + * + * Syntax: + * + * math.norm(x) + * math.norm(x, p) + * + * Examples: + * + * math.abs(-3.5) // returns 3.5 + * math.norm(-3.5) // returns 3.5 + * + * math.norm(math.complex(3, -4)) // returns 5 + * + * math.norm([1, 2, -3], Infinity) // returns 3 + * math.norm([1, 2, -3], -Infinity) // returns 1 + * + * math.norm([3, 4], 2) // returns 5 + * + * math.norm([[1, 2], [3, 4]], 1) // returns 6 + * math.norm([[1, 2], [3, 4]], 'inf') // returns 7 + * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661 + * + * See also: + * + * abs, hypot + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * Value for which to calculate the norm + * @param {number | BigNumber | string} [p=2] + * Vector space. + * Supported numbers include Infinity and -Infinity. + * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) + * @return {number | BigNumber} the p-norm + */ + return typed(name, { + number: Math.abs, + Complex: function Complex(x) { + return x.abs(); + }, + BigNumber: function BigNumber(x) { + // norm(x) = abs(x) + return x.abs(); + }, + boolean: function boolean(x) { + // norm(x) = abs(x) + return Math.abs(x); + }, + Array: function Array(x) { + return _norm(matrix(x), 2); + }, + Matrix: function Matrix(x) { + return _norm(x, 2); + }, + 'Array, number | BigNumber | string': function Array_number__BigNumber__string(x, p) { + return _norm(matrix(x), p); + }, + 'Matrix, number | BigNumber | string': function Matrix_number__BigNumber__string(x, p) { + return _norm(x, p); + } + }); + + /** + * Calculate the plus infinity norm for a vector + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _vectorNormPlusInfinity(x) { + // norm(x, Infinity) = max(abs(x)) + var pinf = 0; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + var v = abs(value); + if (larger(v, pinf)) { + pinf = v; + } + }, true); + return pinf; + } + + /** + * Calculate the minus infinity norm for a vector + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _vectorNormMinusInfinity(x) { + // norm(x, -Infinity) = min(abs(x)) + var ninf; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + var v = abs(value); + if (!ninf || smaller(v, ninf)) { + ninf = v; + } + }, true); + return ninf || 0; + } + + /** + * Calculate the norm for a vector + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _vectorNorm(x, p) { + // check p + if (p === Number.POSITIVE_INFINITY || p === 'inf') { + return _vectorNormPlusInfinity(x); + } + if (p === Number.NEGATIVE_INFINITY || p === '-inf') { + return _vectorNormMinusInfinity(x); + } + if (p === 'fro') { + return _norm(x, 2); + } + if (typeof p === 'number' && !isNaN(p)) { + // check p != 0 + if (!equalScalar(p, 0)) { + // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p + var n = 0; + // skip zeros since abs(0) === 0 + x.forEach(function (value) { + n = add(pow(abs(value), p), n); + }, true); + return pow(n, 1 / p); + } + return Number.POSITIVE_INFINITY; + } + // invalid parameter value + throw new Error('Unsupported parameter value'); + } + + /** + * Calculate the Frobenius norm for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormFrobenius(x) { + // norm(x) = sqrt(sum(diag(x'x))) + var fro = 0; + x.forEach(function (value, index) { + fro = add(fro, multiply(value, conj(value))); + }); + return abs(sqrt(fro)); + } + + /** + * Calculate the norm L1 for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormOne(x) { + // norm(x) = the largest column sum + var c = []; + // result + var maxc = 0; + // skip zeros since abs(0) == 0 + x.forEach(function (value, index) { + var j = index[1]; + var cj = add(c[j] || 0, abs(value)); + if (larger(cj, maxc)) { + maxc = cj; + } + c[j] = cj; + }, true); + return maxc; + } + + /** + * Calculate the norm L2 for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormTwo(x) { + // norm(x) = sqrt( max eigenvalue of A*.A) + var sizeX = x.size(); + if (sizeX[0] !== sizeX[1]) { + throw new RangeError('Invalid matrix dimensions'); + } + var tx = ctranspose(x); + var squaredX = multiply(tx, x); + var eigenVals = eigs(squaredX).values.toArray(); + var rho = eigenVals[eigenVals.length - 1]; + return abs(sqrt(rho)); + } + + /** + * Calculate the infinity norm for a matrix + * @param {Matrix} x + * @returns {number} Returns the norm + * @private + */ + function _matrixNormInfinity(x) { + // norm(x) = the largest row sum + var r = []; + // result + var maxr = 0; + // skip zeros since abs(0) == 0 + x.forEach(function (value, index) { + var i = index[0]; + var ri = add(r[i] || 0, abs(value)); + if (larger(ri, maxr)) { + maxr = ri; + } + r[i] = ri; + }, true); + return maxr; + } + + /** + * Calculate the norm for a 2D Matrix (M*N) + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _matrixNorm(x, p) { + // check p + if (p === 1) { + return _matrixNormOne(x); + } + if (p === Number.POSITIVE_INFINITY || p === 'inf') { + return _matrixNormInfinity(x); + } + if (p === 'fro') { + return _matrixNormFrobenius(x); + } + if (p === 2) { + return _matrixNormTwo(x); + } // invalid parameter value + + throw new Error('Unsupported parameter value ' + p); + } + + /** + * Calculate the norm for an array + * @param {Matrix} x + * @param {number | string} p + * @returns {number} Returns the norm + * @private + */ + function _norm(x, p) { + // size + var sizeX = x.size(); + + // check if it is a vector + if (sizeX.length === 1) { + return _vectorNorm(x, p); + } + // MxN matrix + if (sizeX.length === 2) { + if (sizeX[0] && sizeX[1]) { + return _matrixNorm(x, p); + } else { + throw new RangeError('Invalid matrix dimensions'); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js new file mode 100644 index 0000000..505e18b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js @@ -0,0 +1,166 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { nthRootNumber } from '../../plain/number/index.js'; +var name = 'nthRoot'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat']; +export var createNthRoot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + BigNumber: _BigNumber, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo06xS0S0 = createMatAlgo06xS0S0({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Calculate the nth root of a value. + * The principal nth root of a positive real number A, is the positive real + * solution of the equation + * + * x^root = A + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.nthRoot(a) + * math.nthRoot(a, root) + * + * Examples: + * + * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9) + * math.sqrt(9) // returns 3 (since 3^2 == 9) + * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64) + * + * See also: + * + * sqrt, pow + * + * @param {number | BigNumber | Array | Matrix | Complex} a + * Value for which to calculate the nth root + * @param {number | BigNumber} [root=2] The root. + * @return {number | Complex | Array | Matrix} Returns the nth root of `a` + */ + function complexErr() { + throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.'); + } + return typed(name, { + number: nthRootNumber, + 'number, number': nthRootNumber, + BigNumber: x => _bigNthRoot(x, new _BigNumber(2)), + 'BigNumber, BigNumber': _bigNthRoot, + Complex: complexErr, + 'Complex, number': complexErr, + Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()), + DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)), + SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)), + 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // sparse + sparse + return matAlgo06xS0S0(x, y, self); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }), + 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // dense + sparse + return matAlgo01xDSid(x, y, self, false); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }), + 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // density must be one (no zeros in matrix) + if (y.density() === 1) { + // sparse - scalar + return matAlgo11xS0s(y, x, self, true); + } else { + // throw exception + throw new Error('Root must be non-zero'); + } + }) + }, matrixAlgorithmSuite({ + scalar: 'number | BigNumber', + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: false + })); + + /** + * Calculate the nth root of a for BigNumbers, solve x^root == a + * https://rosettacode.org/wiki/Nth_root#JavaScript + * @param {BigNumber} a + * @param {BigNumber} root + * @private + */ + function _bigNthRoot(a, root) { + var precision = _BigNumber.precision; + var Big = _BigNumber.clone({ + precision: precision + 2 + }); + var zero = new _BigNumber(0); + var one = new Big(1); + var inv = root.isNegative(); + if (inv) { + root = root.neg(); + } + if (root.isZero()) { + throw new Error('Root must be non-zero'); + } + if (a.isNegative() && !root.abs().mod(2).equals(1)) { + throw new Error('Root must be odd when a is negative.'); + } + + // edge cases zero and infinity + if (a.isZero()) { + return inv ? new Big(Infinity) : 0; + } + if (!a.isFinite()) { + return inv ? zero : a; + } + var x = a.abs().pow(one.div(root)); + // If a < 0, we require that root is an odd integer, + // so (-1) ^ (1/root) = -1 + x = a.isNeg() ? x.neg() : x; + return new _BigNumber((inv ? one.div(x) : x).toPrecision(precision)); + } +}); +export var createNthRootNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => { + var { + typed + } = _ref2; + return typed(name, { + number: nthRootNumber, + 'number, number': nthRootNumber + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js new file mode 100644 index 0000000..f84347b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js @@ -0,0 +1,111 @@ +import { factory } from '../../utils/factory.js'; +var name = 'nthRoots'; +var dependencies = ['config', 'typed', 'divideScalar', 'Complex']; +export var createNthRoots = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + divideScalar, + Complex + } = _ref; + /** + * Each function here returns a real multiple of i as a Complex value. + * @param {number} val + * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3 + */ + // This is used to fix float artifacts for zero-valued components. + var _calculateExactResult = [function realPos(val) { + return new Complex(val, 0); + }, function imagPos(val) { + return new Complex(0, val); + }, function realNeg(val) { + return new Complex(-val, 0); + }, function imagNeg(val) { + return new Complex(0, -val); + }]; + + /** + * Calculate the nth root of a Complex Number a using De Movire's Theorem. + * @param {Complex} a + * @param {number} root + * @return {Array} array of n Complex Roots + */ + function _nthComplexRoots(a, root) { + if (root < 0) throw new Error('Root must be greater than zero'); + if (root === 0) throw new Error('Root must be non-zero'); + if (root % 1 !== 0) throw new Error('Root must be an integer'); + if (a === 0 || a.abs() === 0) return [new Complex(0, 0)]; + var aIsNumeric = typeof a === 'number'; + var offset; + // determine the offset (argument of a)/(pi/2) + if (aIsNumeric || a.re === 0 || a.im === 0) { + if (aIsNumeric) { + offset = 2 * +(a < 0); // numeric value on the real axis + } else if (a.im === 0) { + offset = 2 * +(a.re < 0); // complex value on the real axis + } else { + offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis + } + } + var arg = a.arg(); + var abs = a.abs(); + var roots = []; + var r = Math.pow(abs, 1 / root); + for (var k = 0; k < root; k++) { + var halfPiFactor = (offset + 4 * k) / root; + /** + * If (offset + 4*k)/root is an integral multiple of pi/2 + * then we can produce a more exact result. + */ + if (halfPiFactor === Math.round(halfPiFactor)) { + roots.push(_calculateExactResult[halfPiFactor % 4](r)); + continue; + } + roots.push(new Complex({ + r, + phi: (arg + 2 * Math.PI * k) / root + })); + } + return roots; + } + + /** + * Calculate the nth roots of a value. + * An nth root of a positive real number A, + * is a positive real solution of the equation "x^root = A". + * This function returns an array of complex values. + * + * Syntax: + * + * math.nthRoots(x) + * math.nthRoots(x, root) + * + * Examples: + * + * math.nthRoots(1) + * // returns [ + * // {re: 1, im: 0}, + * // {re: -1, im: 0} + * // ] + * math.nthRoots(1, 3) + * // returns [ + * // { re: 1, im: 0 }, + * // { re: -0.4999999999999998, im: 0.8660254037844387 }, + * // { re: -0.5000000000000004, im: -0.8660254037844385 } + * // ] + * + * See also: + * + * nthRoot, pow, sqrt + * + * @param {number | BigNumber | Fraction | Complex} x Number to be rounded + * @param {number} [root=2] Optional root, default value is 2 + * @return {number | BigNumber | Fraction | Complex} Returns the nth roots + */ + return typed(name, { + Complex: function Complex(x) { + return _nthComplexRoots(x, 2); + }, + 'Complex, number': _nthComplexRoots + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/pow.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/pow.js new file mode 100644 index 0000000..5719de7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/pow.js @@ -0,0 +1,192 @@ +import { factory } from '../../utils/factory.js'; +import { isInteger } from '../../utils/number.js'; +import { arraySize as size } from '../../utils/array.js'; +import { powNumber } from '../../plain/number/index.js'; +var name = 'pow'; +var dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex']; +export var createPow = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + identity, + multiply, + matrix, + inv, + number, + fraction, + Complex + } = _ref; + /** + * Calculates the power of x to y, `x ^ y`. + * + * Matrix exponentiation is supported for square matrices `x` and integers `y`: + * when `y` is nonnegative, `x` may be any square matrix; and when `y` is + * negative, `x` must be invertible, and then this function returns + * inv(x)^(-y). + * + * For cubic roots of negative numbers, the function returns the principal + * root by default. In order to let the function return the real root, + * math.js can be configured with `math.config({predictable: true})`. + * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`. + * + * Syntax: + * + * math.pow(x, y) + * + * Examples: + * + * math.pow(2, 3) // returns number 8 + * + * const a = math.complex(2, 3) + * math.pow(a, 2) // returns Complex -5 + 12i + * + * const b = [[1, 2], [4, 3]] + * math.pow(b, 2) // returns Array [[9, 8], [16, 17]] + * + * const c = [[1, 2], [4, 3]] + * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]] + * + * See also: + * + * multiply, sqrt, cbrt, nthRoot + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base + * @param {number | BigNumber | bigint | Complex} y The exponent + * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y` + */ + return typed(name, { + 'number, number': _pow, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.pow(y); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + if (y.isInteger() || x >= 0 || config.predictable) { + return x.pow(y); + } else { + return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0); + } + }, + 'bigint, bigint': (x, y) => x ** y, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + var result = x.pow(y); + if (result != null) { + return result; + } + if (config.predictable) { + throw new Error('Result of pow is non-rational and cannot be expressed as a fraction'); + } else { + return _pow(x.valueOf(), y.valueOf()); + } + }, + 'Array, number': _powArray, + 'Array, BigNumber': function Array_BigNumber(x, y) { + return _powArray(x, y.toNumber()); + }, + 'Matrix, number': _powMatrix, + 'Matrix, BigNumber': function Matrix_BigNumber(x, y) { + return _powMatrix(x, y.toNumber()); + }, + 'Unit, number | BigNumber': function Unit_number__BigNumber(x, y) { + return x.pow(y); + } + }); + + /** + * Calculates the power of x to y, x^y, for two numbers. + * @param {number} x + * @param {number} y + * @return {number | Complex} res + * @private + */ + function _pow(x, y) { + // Alternatively could define a 'realmode' config option or something, but + // 'predictable' will work for now + if (config.predictable && !isInteger(y) && x < 0) { + // Check to see if y can be represented as a fraction + try { + var yFrac = fraction(y); + var yNum = number(yFrac); + if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) { + if (yFrac.d % 2 === 1) { + return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y); + } + } + } catch (ex) { + // fraction() throws an error if y is Infinity, etc. + } + + // Unable to express y as a fraction, so continue on + } + + // **for predictable mode** x^Infinity === NaN if x < -1 + // N.B. this behavour is different from `Math.pow` which gives + // (-2)^Infinity === Infinity + if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) { + return NaN; + } + if (isInteger(y) || x >= 0 || config.predictable) { + return powNumber(x, y); + } else { + // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow + + // x^Infinity === 0 if -1 < x < 1 + // A real number 0 is returned instead of complex(0) + if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) { + return 0; + } + return new Complex(x, 0).pow(y, 0); + } + } + + /** + * Calculate the power of a 2d array + * @param {Array} x must be a 2 dimensional, square matrix + * @param {number} y a integer value (positive if `x` is not invertible) + * @returns {Array} + * @private + */ + function _powArray(x, y) { + if (!isInteger(y)) { + throw new TypeError('For A^b, b must be an integer (value is ' + y + ')'); + } + // verify that A is a 2 dimensional square matrix + var s = size(x); + if (s.length !== 2) { + throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)'); + } + if (s[0] !== s[1]) { + throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')'); + } + if (y < 0) { + try { + return _powArray(inv(x), -y); + } catch (error) { + if (error.message === 'Cannot calculate inverse, determinant is zero') { + throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')'); + } + throw error; + } + } + var res = identity(s[0]).valueOf(); + var px = x; + while (y >= 1) { + if ((y & 1) === 1) { + res = multiply(px, res); + } + y >>= 1; + px = multiply(px, px); + } + return res; + } + + /** + * Calculate the power of a 2d matrix + * @param {Matrix} x must be a 2 dimensional, square matrix + * @param {number} y a positive, integer value + * @returns {Matrix} + * @private + */ + function _powMatrix(x, y) { + return matrix(_powArray(x.valueOf(), y)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/round.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/round.js new file mode 100644 index 0000000..91a9db2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/round.js @@ -0,0 +1,202 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { nearlyEqual, splitNumber } from '../../utils/number.js'; +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +import { roundNumber } from '../../plain/number/index.js'; +var NO_INT = 'Number of decimals in function round must be an integer'; +var name = 'round'; +var dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix']; +export var createRound = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + equalScalar, + zeros, + BigNumber: _BigNumber, + DenseMatrix + } = _ref; + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + function toExponent(epsilon) { + return Math.abs(splitNumber(epsilon).exponent); + } + + /** + * Round a value towards the nearest rounded value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.round(x) + * math.round(x, n) + * math.round(unit, valuelessUnit) + * math.round(unit, n, valuelessUnit) + * + * Examples: + * + * math.round(3.22) // returns number 3 + * math.round(3.82) // returns number 4 + * math.round(-4.2) // returns number -4 + * math.round(-4.7) // returns number -5 + * math.round(3.22, 1) // returns number 3.2 + * math.round(3.88, 1) // returns number 3.9 + * math.round(-4.21, 1) // returns number -4.2 + * math.round(-4.71, 1) // returns number -4.7 + * math.round(math.pi, 3) // returns number 3.142 + * math.round(123.45678, 2) // returns number 123.46 + * + * const c = math.complex(3.2, -2.7) + * math.round(c) // returns Complex 3 - 3i + * + * const unit = math.unit('3.241 cm') + * const cm = math.unit('cm') + * const mm = math.unit('mm') + * math.round(unit, 1, cm) // returns Unit 3.2 cm + * math.round(unit, 1, mm) // returns Unit 32.4 mm + * + * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5] + * + * See also: + * + * ceil, fix, floor + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded + * @param {number | BigNumber | Array} [n=0] Number of decimals + * @param {Unit} [valuelessUnit] A valueless unit + * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value + */ + return typed(name, { + number: function number(x) { + // Handle round off errors by first rounding to relTol precision + var xEpsilon = roundNumber(x, toExponent(config.relTol)); + var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return roundNumber(xSelected); + }, + 'number, number': function number_number(x, n) { + // Same as number: unless user specifies more decimals than relTol + var epsilonExponent = toExponent(config.relTol); + if (n >= epsilonExponent) { + return roundNumber(x, n); + } + var xEpsilon = roundNumber(x, epsilonExponent); + var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return roundNumber(xSelected, n); + }, + 'number, BigNumber': function number_BigNumber(x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + return new _BigNumber(x).toDecimalPlaces(n.toNumber()); + }, + Complex: function Complex(x) { + return x.round(); + }, + 'Complex, number': function Complex_number(x, n) { + if (n % 1) { + throw new TypeError(NO_INT); + } + return x.round(n); + }, + 'Complex, BigNumber': function Complex_BigNumber(x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + var _n = n.toNumber(); + return x.round(_n); + }, + BigNumber: function BigNumber(x) { + // Handle round off errors by first rounding to relTol precision + var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.relTol)); + var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return xSelected.toDecimalPlaces(0); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + + // Same as BigNumber: unless user specifies more decimals than relTol + var epsilonExponent = toExponent(config.relTol); + if (n >= epsilonExponent) { + return x.toDecimalPlaces(n.toNumber()); + } + var xEpsilon = x.toDecimalPlaces(epsilonExponent); + var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x; + return xSelected.toDecimalPlaces(n.toNumber()); + }, + Fraction: function Fraction(x) { + return x.round(); + }, + 'Fraction, number': function Fraction_number(x, n) { + if (n % 1) { + throw new TypeError(NO_INT); + } + return x.round(n); + }, + 'Fraction, BigNumber': function Fraction_BigNumber(x, n) { + if (!n.isInteger()) { + throw new TypeError(NO_INT); + } + return x.round(n.toNumber()); + }, + 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) { + var valueless = x.toNumeric(unit); + return unit.multiply(self(valueless, n)); + }), + 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)), + 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), + 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => { + // deep map collection, skip zeros since round(0) = 0 + return deepMap(x, value => self(value, n, unit), true); + }), + 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)), + 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), + 'Array | Matrix': typed.referToSelf(self => x => { + // deep map collection, skip zeros since round(0) = 0 + return deepMap(x, self, true); + }), + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + return matAlgo11xS0s(x, n, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => { + return matAlgo14xDs(x, n, self, false); + }), + 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => { + // use matrix implementation + return matAlgo14xDs(matrix(x), n, self, false).valueOf(); + }), + 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => { + // check scalar is zero + if (equalScalar(x, 0)) { + // do not execute algorithm, result will be a zero matrix + return zeros(n.size(), n.storage()); + } + return matAlgo12xSfs(n, x, self, true); + }), + 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => { + // check scalar is zero + if (equalScalar(x, 0)) { + // do not execute algorithm, result will be a zero matrix + return zeros(n.size(), n.storage()); + } + return matAlgo14xDs(n, x, self, true); + }), + 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => { + // use matrix implementation + return matAlgo14xDs(matrix(n), x, self, true).valueOf(); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sign.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sign.js new file mode 100644 index 0000000..80cce7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sign.js @@ -0,0 +1,66 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { signNumber } from '../../plain/number/index.js'; +var name = 'sign'; +var dependencies = ['typed', 'BigNumber', 'Fraction', 'complex']; +export var createSign = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber, + complex, + Fraction: _Fraction + } = _ref; + /** + * Compute the sign of a value. The sign of a value x is: + * + * - 1 when x > 0 + * - -1 when x < 0 + * - 0 when x == 0 + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.sign(x) + * + * Examples: + * + * math.sign(3.5) // returns 1 + * math.sign(-4.2) // returns -1 + * math.sign(0) // returns 0 + * + * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1] + * + * See also: + * + * abs + * + * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x + * The number for which to determine the sign + * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} + * The sign of `x` + */ + return typed(name, { + number: signNumber, + Complex: function Complex(x) { + return x.im === 0 ? complex(signNumber(x.re)) : x.sign(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(x.cmp(0)); + }, + bigint: function bigint(x) { + return x > 0n ? 1n : x < 0n ? -1n : 0n; + }, + Fraction: function Fraction(x) { + return new _Fraction(x.s, 1); + }, + // deep map collection, skip zeros since sign(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)), + Unit: typed.referToSelf(self => x => { + if (!x._isDerived() && x.units[0].unit.offset !== 0) { + throw new TypeError('sign is ambiguous for units with offset'); + } + return typed.find(self, x.valueType())(x.value); + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js new file mode 100644 index 0000000..af7a1c1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js @@ -0,0 +1,70 @@ +import { factory } from '../../utils/factory.js'; +var name = 'sqrt'; +var dependencies = ['config', 'typed', 'Complex']; +export var createSqrt = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + typed, + Complex + } = _ref; + /** + * Calculate the square root of a value. + * + * For matrices, if you want the matrix square root of a square matrix, + * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to + * a matrix M, use `math.map(M, math.sqrt)`. + * + * Syntax: + * + * math.sqrt(x) + * + * Examples: + * + * math.sqrt(25) // returns 5 + * math.square(5) // returns 25 + * math.sqrt(-4) // returns Complex 2i + * + * See also: + * + * square, multiply, cube, cbrt, sqrtm + * + * @param {number | BigNumber | Complex | Unit} x + * Value for which to calculate the square root. + * @return {number | BigNumber | Complex | Unit} + * Returns the square root of `x` + */ + return typed('sqrt', { + number: _sqrtNumber, + Complex: function Complex(x) { + return x.sqrt(); + }, + BigNumber: function BigNumber(x) { + if (!x.isNegative() || config.predictable) { + return x.sqrt(); + } else { + // negative value -> downgrade to number to do complex value computation + return _sqrtNumber(x.toNumber()); + } + }, + Unit: function Unit(x) { + // Someday will work for complex units when they are implemented + return x.pow(0.5); + } + }); + + /** + * Calculate sqrt for a number + * @param {number} x + * @returns {number | Complex} Returns the square root of x + * @private + */ + function _sqrtNumber(x) { + if (isNaN(x)) { + return NaN; + } else if (x >= 0 || config.predictable) { + return Math.sqrt(x); + } else { + return new Complex(x, 0).sqrt(); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/square.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/square.js new file mode 100644 index 0000000..373b11f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/square.js @@ -0,0 +1,55 @@ +import { factory } from '../../utils/factory.js'; +import { squareNumber } from '../../plain/number/index.js'; +var name = 'square'; +var dependencies = ['typed']; +export var createSquare = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the square of a value, `x * x`. + * To avoid confusion with multiplying a square matrix by itself, + * this function does not apply to matrices. If you wish to square + * every element of a matrix, see the examples. + * + * Syntax: + * + * math.square(x) + * + * Examples: + * + * math.square(2) // returns number 4 + * math.square(3) // returns number 9 + * math.pow(3, 2) // returns number 9 + * math.multiply(3, 3) // returns number 9 + * + * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16] + * + * See also: + * + * multiply, cube, sqrt, pow + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x + * Number for which to calculate the square + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} + * Squared value + */ + return typed(name, { + number: squareNumber, + Complex: function Complex(x) { + return x.mul(x); + }, + BigNumber: function BigNumber(x) { + return x.times(x); + }, + bigint: function bigint(x) { + return x * x; + }, + Fraction: function Fraction(x) { + return x.mul(x); + }, + Unit: function Unit(x) { + return x.pow(2); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js new file mode 100644 index 0000000..e5cee04 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js @@ -0,0 +1,86 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'subtract'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat']; +export var createSubtract = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + subtractScalar, + unaryMinus, + DenseMatrix, + concat + } = _ref; + // TODO: split function subtract in two: subtract and subtractScalar + + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo05xSfSf = createMatAlgo05xSfSf({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Subtract two values, `x - y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.subtract(x, y) + * + * Examples: + * + * math.subtract(5.3, 2) // returns number 3.3 + * + * const a = math.complex(2, 3) + * const b = math.complex(4, 1) + * math.subtract(a, b) // returns Complex -2 + 2i + * + * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0] + * + * const c = math.unit('2.1 km') + * const d = math.unit('500m') + * math.subtract(c, d) // returns Unit 1.6 km + * + * See also: + * + * add + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x` + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y` + */ + return typed(name, { + 'any, any': subtractScalar + }, matrixAlgorithmSuite({ + elop: subtractScalar, + SS: matAlgo05xSfSf, + DS: matAlgo01xDSid, + SD: matAlgo03xDSf, + Ss: matAlgo12xSfs, + sS: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js new file mode 100644 index 0000000..44b07c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +import { subtractNumber } from '../../plain/number/index.js'; +var name = 'subtractScalar'; +var dependencies = ['typed']; +export var createSubtractScalar = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Subtract two scalar values, `x - y`. + * This function is meant for internal use: it is used by the public function + * `subtract` + * + * This function does not support collections (Array or Matrix). + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value + * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x` + * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y` + * @private + */ + return typed(name, { + 'number, number': subtractNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.sub(y); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.minus(y); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x - y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return x.sub(y); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (x.value === null || x.value === undefined) { + throw new Error('Parameter x contains a unit with undefined value'); + } + if (y.value === null || y.value === undefined) { + throw new Error('Parameter y contains a unit with undefined value'); + } + if (!x.equalBase(y)) throw new Error('Units do not match'); + var res = x.clone(); + res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value); + res.fixPrefix = false; + return res; + }) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js new file mode 100644 index 0000000..696c665 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js @@ -0,0 +1,47 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { unaryMinusNumber } from '../../plain/number/index.js'; +var name = 'unaryMinus'; +var dependencies = ['typed']; +export var createUnaryMinus = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Inverse the sign of a value, apply a unary minus operation. + * + * For matrices, the function is evaluated element wise. Boolean values and + * strings will be converted to a number. For complex numbers, both real and + * complex value are inverted. + * + * Syntax: + * + * math.unaryMinus(x) + * + * Examples: + * + * math.unaryMinus(3.5) // returns -3.5 + * math.unaryMinus(-4.2) // returns 4.2 + * + * See also: + * + * add, subtract, unaryPlus + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted. + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign. + */ + return typed(name, { + number: unaryMinusNumber, + 'Complex | BigNumber | Fraction': x => x.neg(), + bigint: x => -x, + Unit: typed.referToSelf(self => x => { + var res = x.clone(); + res.value = typed.find(self, res.valueType())(x.value); + return res; + }), + // deep map collection, skip zeros since unaryMinus(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)) + + // TODO: add support for string + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js new file mode 100644 index 0000000..411b331 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js @@ -0,0 +1,63 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +import { unaryPlusNumber } from '../../plain/number/index.js'; +import { safeNumberType } from '../../utils/number.js'; +var name = 'unaryPlus'; +var dependencies = ['typed', 'config', 'numeric']; +export var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + numeric + } = _ref; + /** + * Unary plus operation. + * Boolean values and strings will be converted to a number, numeric values will be returned as is. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.unaryPlus(x) + * + * Examples: + * + * math.unaryPlus(3.5) // returns 3.5 + * math.unaryPlus(1) // returns 1 + * + * See also: + * + * unaryMinus, add, subtract + * + * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x + * Input value + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} + * Returns the input value when numeric, converts to a number when input is non-numeric. + */ + return typed(name, { + number: unaryPlusNumber, + Complex: function Complex(x) { + return x; // complex numbers are immutable + }, + BigNumber: function BigNumber(x) { + return x; // bignumbers are immutable + }, + bigint: function bigint(x) { + return x; + }, + Fraction: function Fraction(x) { + return x; // fractions are immutable + }, + Unit: function Unit(x) { + return x.clone(); + }, + // deep map collection, skip zeros since unaryPlus(0) = 0 + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)), + boolean: function boolean(x) { + return numeric(x ? 1 : 0, config.number); + }, + string: function string(x) { + return numeric(x, safeNumberType(x, config)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js new file mode 100644 index 0000000..5cabe42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js @@ -0,0 +1,91 @@ +import { factory } from '../../utils/factory.js'; +import { xgcdNumber } from '../../plain/number/index.js'; +var name = 'xgcd'; +var dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +export var createXgcd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Calculate the extended greatest common divisor for two values. + * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + * + * Syntax: + * + * math.xgcd(a, b) + * + * Examples: + * + * math.xgcd(8, 12) // returns [4, -1, 1] + * math.gcd(8, 12) // returns 4 + * math.xgcd(36163, 21199) // returns [1247, -7, 12] + * + * See also: + * + * gcd, lcm + * + * @param {number | BigNumber} a An integer number + * @param {number | BigNumber} b An integer number + * @return {Array} Returns an array containing 3 integers `[div, m, n]` + * where `div = gcd(a, b)` and `a*m + b*n = div` + */ + return typed(name, { + 'number, number': function number_number(a, b) { + var res = xgcdNumber(a, b); + return config.matrix === 'Array' ? res : matrix(res); + }, + 'BigNumber, BigNumber': _xgcdBigNumber + // TODO: implement support for Fraction + }); + + /** + * Calculate xgcd for two BigNumbers + * @param {BigNumber} a + * @param {BigNumber} b + * @return {BigNumber[]} result + * @private + */ + function _xgcdBigNumber(a, b) { + // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm + var + // used to swap two variables + t; + var + // quotient + q; + var + // remainder + r; + var zero = new BigNumber(0); + var one = new BigNumber(1); + var x = zero; + var lastx = one; + var y = one; + var lasty = zero; + if (!a.isInt() || !b.isInt()) { + throw new Error('Parameters in function xgcd must be integer numbers'); + } + while (!b.isZero()) { + q = a.div(b).floor(); + r = a.mod(b); + t = x; + x = lastx.minus(q.times(x)); + lastx = t; + t = y; + y = lasty.minus(q.times(y)); + lasty = t; + a = b; + b = r; + } + var res; + if (a.lt(zero)) { + res = [a.neg(), lastx.neg(), lasty.neg()]; + } else { + res = [a, !a.isZero() ? lastx : 0, lasty]; + } + return config.matrix === 'Array' ? res : matrix(res); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js new file mode 100644 index 0000000..e96ab8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js @@ -0,0 +1,66 @@ +import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { bitAndNumber } from '../../plain/number/index.js'; +var name = 'bitAnd'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'concat']; +export var createBitAnd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo06xS0S0 = createMatAlgo06xS0S0({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Bitwise AND two values, `x & y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.bitAnd(x, y) + * + * Examples: + * + * math.bitAnd(53, 131) // returns number 1 + * + * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10] + * + * See also: + * + * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to and + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and + * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y` + */ + return typed(name, { + 'number, number': bitAndNumber, + 'BigNumber, BigNumber': bitAndBigNumber, + 'bigint, bigint': (x, y) => x & y + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0, + Ss: matAlgo11xS0s + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js new file mode 100644 index 0000000..98b3bcd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js @@ -0,0 +1,39 @@ +import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js'; +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { bitNotNumber } from '../../plain/number/index.js'; +var name = 'bitNot'; +var dependencies = ['typed']; +export var createBitNot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Bitwise NOT value, `~x`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.bitNot(x) + * + * Examples: + * + * math.bitNot(1) // returns number -2 + * + * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5] + * + * See also: + * + * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to not + * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x` + */ + return typed(name, { + number: bitNotNumber, + BigNumber: bitNotBigNumber, + bigint: x => ~x, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js new file mode 100644 index 0000000..2b43619 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js @@ -0,0 +1,67 @@ +import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { bitOrNumber } from '../../plain/number/index.js'; +var name = 'bitOr'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +export var createBitOr = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo04xSidSid = createMatAlgo04xSidSid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Bitwise OR two values, `x | y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the lowest print base. + * + * Syntax: + * + * math.bitOr(x, y) + * + * Examples: + * + * math.bitOr(1, 2) // returns number 3 + * + * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7] + * + * See also: + * + * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to or + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or + * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y` + */ + return typed(name, { + 'number, number': bitOrNumber, + 'BigNumber, BigNumber': bitOrBigNumber, + 'bigint, bigint': (x, y) => x | y + }, matrixAlgorithmSuite({ + SS: matAlgo04xSidSid, + DS: matAlgo01xDSid, + Ss: matAlgo10xSids + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js new file mode 100644 index 0000000..903a1a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js @@ -0,0 +1,65 @@ +import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { bitXorNumber } from '../../plain/number/index.js'; +var name = 'bitXor'; +var dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat']; +export var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Bitwise XOR two values, `x ^ y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.bitXor(x, y) + * + * Examples: + * + * math.bitXor(1, 2) // returns number 3 + * + * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0] + * + * See also: + * + * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor + * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor + * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y` + */ + return typed(name, { + 'number, number': bitXorNumber, + 'BigNumber, BigNumber': bigBitXor, + 'bigint, bigint': (x, y) => x ^ y + }, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js new file mode 100644 index 0000000..bbcc6e0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js @@ -0,0 +1,115 @@ +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'; +import { leftShiftNumber } from '../../plain/number/index.js'; +import { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js'; +var name = 'leftShift'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +export var createLeftShift = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo08xS0Sid = createMatAlgo08xS0Sid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var useMatrixForArrayScalar = createUseMatrixForArrayScalar({ + typed, + matrix + }); + + /** + * Bitwise left logical shift of a value x by y number of bits, `x << y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.leftShift(x, y) + * + * Examples: + * + * math.leftShift(1, 2) // returns number 4 + * + * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64] + * + * See also: + * + * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted + * @param {number | BigNumber | bigint} y Amount of shifts + * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times + */ + return typed(name, { + 'number, number': leftShiftNumber, + 'BigNumber, BigNumber': leftShiftBigNumber, + 'bigint, bigint': (x, y) => x << y, + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js new file mode 100644 index 0000000..03eaacf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js @@ -0,0 +1,115 @@ +import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'; +import { rightArithShiftNumber } from '../../plain/number/index.js'; +var name = 'rightArithShift'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +export var createRightArithShift = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo08xS0Sid = createMatAlgo08xS0Sid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var useMatrixForArrayScalar = createUseMatrixForArrayScalar({ + typed, + matrix + }); + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.rightArithShift(x, y) + * + * Examples: + * + * math.rightArithShift(4, 2) // returns number 1 + * + * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4] + * + * See also: + * + * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted + * @param {number | BigNumber | bigint} y Amount of shifts + * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times + */ + return typed(name, { + 'number, number': rightArithShiftNumber, + 'BigNumber, BigNumber': rightArithShiftBigNumber, + 'bigint, bigint': (x, y) => x >> y, + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js new file mode 100644 index 0000000..b849509 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js @@ -0,0 +1,115 @@ +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +import { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js'; +import { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js'; +import { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { rightLogShiftNumber } from '../../plain/number/index.js'; +import { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js'; +var name = 'rightLogShift'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat']; +export var createRightLogShift = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + DenseMatrix, + concat + } = _ref; + var matAlgo01xDSid = createMatAlgo01xDSid({ + typed + }); + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo08xS0Sid = createMatAlgo08xS0Sid({ + typed, + equalScalar + }); + var matAlgo10xSids = createMatAlgo10xSids({ + typed, + DenseMatrix + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var useMatrixForArrayScalar = createUseMatrixForArrayScalar({ + typed, + matrix + }); + + /** + * Bitwise right logical shift of value x by y number of bits, `x >>> y`. + * For matrices, the function is evaluated element wise. + * For units, the function is evaluated on the best prefix base. + * + * Syntax: + * + * math.rightLogShift(x, y) + * + * Examples: + * + * math.rightLogShift(4, 2) // returns number 1 + * + * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4] + * + * See also: + * + * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift + * + * @param {number | Array | Matrix} x Value to be shifted + * @param {number} y Amount of shifts + * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times + */ + + return typed(name, { + 'number, number': rightLogShiftNumber, + // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift + + 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(y, 0)) { + return x.clone(); + } + return matAlgo14xDs(x, y, self, false); + }), + 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo10xSids(y, x, self, true); + }), + 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (equalScalar(x, 0)) { + return zeros(y.size(), y.storage()); + } + return matAlgo14xDs(y, x, self, true); + }) + }, useMatrixForArrayScalar, matrixAlgorithmSuite({ + SS: matAlgo08xS0Sid, + DS: matAlgo01xDSid, + SD: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js new file mode 100644 index 0000000..5cd79ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js @@ -0,0 +1,13 @@ +import { factory } from '../../utils/factory.js'; +export var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => { + var { + typed, + matrix + } = _ref; + return { + 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()), + 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()), + 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()), + 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf()) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js new file mode 100644 index 0000000..8b0b07d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js @@ -0,0 +1,47 @@ +import { factory } from '../../utils/factory.js'; +var name = 'bellNumbers'; +var dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2']; +export var createBellNumbers = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + isNegative, + isInteger, + stirlingS2 + } = _ref; + /** + * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. + * bellNumbers only takes integer arguments. + * The following condition must be enforced: n >= 0 + * + * Syntax: + * + * math.bellNumbers(n) + * + * Examples: + * + * math.bellNumbers(3) // returns 5 + * math.bellNumbers(8) // returns 4140 + * + * See also: + * + * stirlingS2 + * + * @param {Number | BigNumber} n Total number of objects in the set + * @return {Number | BigNumber} B(n) + */ + return typed(name, { + 'number | BigNumber': function number__BigNumber(n) { + if (!isInteger(n) || isNegative(n)) { + throw new TypeError('Non-negative integer value expected in function bellNumbers'); + } + + // Sum (k=0, n) S(n,k). + var result = 0; + for (var i = 0; i <= n; i++) { + result = addScalar(result, stirlingS2(n, i)); + } + return result; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js new file mode 100644 index 0000000..986d076 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js @@ -0,0 +1,43 @@ +import { factory } from '../../utils/factory.js'; +var name = 'catalan'; +var dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger']; +export var createCatalan = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + divideScalar, + multiplyScalar, + combinations, + isNegative, + isInteger + } = _ref; + /** + * The Catalan Numbers enumerate combinatorial structures of many different types. + * catalan only takes integer arguments. + * The following condition must be enforced: n >= 0 + * + * Syntax: + * + * math.catalan(n) + * + * Examples: + * + * math.catalan(3) // returns 5 + * math.catalan(8) // returns 1430 + * + * See also: + * + * bellNumbers + * + * @param {Number | BigNumber} n nth Catalan number + * @return {Number | BigNumber} Cn(n) + */ + return typed(name, { + 'number | BigNumber': function number__BigNumber(n) { + if (!isInteger(n) || isNegative(n)) { + throw new TypeError('Non-negative integer value expected in function catalan'); + } + return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/composition.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/composition.js new file mode 100644 index 0000000..a7ff05c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/composition.js @@ -0,0 +1,46 @@ +import { factory } from '../../utils/factory.js'; +var name = 'composition'; +var dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger']; +export var createComposition = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + combinations, + isPositive, + isNegative, + isInteger, + larger + } = _ref; + /** + * The composition counts of n into k parts. + * + * composition only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.composition(n, k) + * + * Examples: + * + * math.composition(5, 3) // returns 6 + * + * See also: + * + * combinations + * + * @param {Number | BigNumber} n Total number of objects in the set + * @param {Number | BigNumber} k Number of objects in the subset + * @return {Number | BigNumber} Returns the composition counts of n into k parts. + */ + return typed(name, { + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) { + if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) { + throw new TypeError('Positive integer value expected in function composition'); + } else if (larger(k, n)) { + throw new TypeError('k must be less than or equal to n in function composition'); + } + return combinations(addScalar(n, -1), addScalar(k, -1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js new file mode 100644 index 0000000..539bcac --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js @@ -0,0 +1,86 @@ +import { factory } from '../../utils/factory.js'; +import { isNumber } from '../../utils/is.js'; +var name = 'stirlingS2'; +var dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger']; +export var createStirlingS2 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + pow, + factorial, + combinations, + isNegative, + isInteger, + number, + bignumber, + larger + } = _ref; + var smallCache = []; + var bigCache = []; + /** + * The Stirling numbers of the second kind, counts the number of ways to partition + * a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * If n = k or k = 1 <= n, then s(n,k) = 1 + * If k = 0 < n, then s(n,k) = 0 + * + * Note that if either n or k is supplied as a BigNumber, the result will be + * as well. + * + * Syntax: + * + * math.stirlingS2(n, k) + * + * Examples: + * + * math.stirlingS2(5, 3) //returns 25 + * + * See also: + * + * bellNumbers + * + * @param {Number | BigNumber} n Total number of objects in the set + * @param {Number | BigNumber} k Number of objects in the subset + * @return {Number | BigNumber} S(n,k) + */ + return typed(name, { + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) { + if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) { + throw new TypeError('Non-negative integer value expected in function stirlingS2'); + } else if (larger(k, n)) { + throw new TypeError('k must be less than or equal to n in function stirlingS2'); + } + var big = !(isNumber(n) && isNumber(k)); + var cache = big ? bigCache : smallCache; + var make = big ? bignumber : number; + var nn = number(n); + var nk = number(k); + /* See if we already have the value: */ + if (cache[nn] && cache[nn].length > nk) { + return cache[nn][nk]; + } + /* Fill the cache */ + for (var m = 0; m <= nn; ++m) { + if (!cache[m]) { + cache[m] = [m === 0 ? make(1) : make(0)]; + } + if (m === 0) continue; + var row = cache[m]; + var prev = cache[m - 1]; + for (var i = row.length; i <= m && i <= nk; ++i) { + if (i === m) { + row[i] = 1; + } else { + row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]); + } + } + } + return cache[nn][nk]; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/arg.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/arg.js new file mode 100644 index 0000000..d3d10c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/arg.js @@ -0,0 +1,50 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +var name = 'arg'; +var dependencies = ['typed']; +export var createArg = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the argument of a complex value. + * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.arg(x) + * + * Examples: + * + * const a = math.complex(2, 2) + * math.arg(a) / math.pi // returns number 0.25 + * + * const b = math.complex('2 + 3i') + * math.arg(b) // returns number 0.982793723247329 + * math.atan2(3, 2) // returns number 0.982793723247329 + * + * See also: + * + * re, im, conj, abs + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The argument of x + */ + return typed(name, { + number: function number(x) { + return Math.atan2(0, x); + }, + BigNumber: function BigNumber(x) { + return x.constructor.atan2(0, x); + }, + Complex: function Complex(x) { + return x.arg(); + }, + // TODO: implement BigNumber support for function arg + + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/conj.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/conj.js new file mode 100644 index 0000000..e205d27 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/conj.js @@ -0,0 +1,39 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +var name = 'conj'; +var dependencies = ['typed']; +export var createConj = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the complex conjugate of a complex value. + * If `x = a+bi`, the complex conjugate of `x` is `a - bi`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.conj(x) + * + * Examples: + * + * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i + * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i + * math.conj(math.complex('-5.2i')) // returns Complex 5.2i + * + * See also: + * + * re, im, arg, abs + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Complex | Array | Matrix} + * The complex conjugate of x + */ + return typed(name, { + 'number | BigNumber | Fraction': x => x, + Complex: x => x.conjugate(), + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/im.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/im.js new file mode 100644 index 0000000..8501b57 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/im.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +var name = 'im'; +var dependencies = ['typed']; +export var createIm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Get the imaginary part of a complex number. + * For a complex number `a + bi`, the function returns `b`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.im(x) + * + * Examples: + * + * const a = math.complex(2, 3) + * math.re(a) // returns number 2 + * math.im(a) // returns number 3 + * + * math.re(math.complex('-5.2i')) // returns number -5.2 + * math.re(math.complex(2.4)) // returns number 0 + * + * See also: + * + * re, conj, abs, arg + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The imaginary part of x + */ + return typed(name, { + number: () => 0, + 'BigNumber | Fraction': x => x.mul(0), + Complex: x => x.im, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/re.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/re.js new file mode 100644 index 0000000..148f0c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/complex/re.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +import { deepMap } from '../../utils/collection.js'; +var name = 're'; +var dependencies = ['typed']; +export var createRe = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Get the real part of a complex number. + * For a complex number `a + bi`, the function returns `a`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.re(x) + * + * Examples: + * + * const a = math.complex(2, 3) + * math.re(a) // returns number 2 + * math.im(a) // returns number 3 + * + * math.re(math.complex('-5.2i')) // returns number 0 + * math.re(math.complex(2.4)) // returns number 2.4 + * + * See also: + * + * im, conj, abs, arg + * + * @param {number | BigNumber | Complex | Array | Matrix} x + * A complex number or array with complex numbers + * @return {number | BigNumber | Array | Matrix} The real part of x + */ + return typed(name, { + 'number | BigNumber | Fraction': x => x, + Complex: x => x.re, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/distance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/distance.js new file mode 100644 index 0000000..dc7d83c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/distance.js @@ -0,0 +1,305 @@ +import { isBigNumber } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'distance'; +var dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs']; +export var createDistance = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + deepEqual, + sqrt, + abs + } = _ref; + /** + * Calculates: + * The eucledian distance between two points in N-dimensional spaces. + * Distance between point and a line in 2 and 3 dimensional spaces. + * Pairwise distance between a set of 2D or 3D points + * NOTE: + * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c + * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) + * + * Syntax: + * + * math.distance([x1,y1], [x2,y2]) + * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY}) + * math.distance([x1,y1,z1], [x2,y2,z2]) + * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ}) + * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2]) + * math.distance([[x1,y1], [x2,y2], [x3,y3]]) + * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]]) + * math.distance([pointX,pointY], [a,b,c]) + * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY]) + * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY}) + * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c]) + * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c}) + * + * Examples: + * math.distance([0,0], [4,4]) // Returns 5.656854249492381 + * math.distance( + * {pointOneX: 0, pointOneY: 0}, + * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951 + * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413 + * math.distance( + * {pointOneX: 4, pointOneY: 5, pointOneZ: 8}, + * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3 + * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2 + * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1] + * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608] + * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387 + * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4 + * math.distance( + * {pointX: 0, pointY: 0}, + * {lineOnePtX: 3, lineOnePtY: 0}, + * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4 + * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857 + * math.distance( + * {pointX: 2, pointY: 3, pointZ: 1}, + * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857 + * + * @param {Array | Matrix | Object} x Co-ordinates of first point + * @param {Array | Matrix | Object} y Co-ordinates of second point + * @return {Number | BigNumber} Returns the distance from two/three points + */ + return typed(name, { + 'Array, Array, Array': function Array_Array_Array(x, y, z) { + // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2) + if (x.length === 2 && y.length === 2 && z.length === 2) { + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_2d(y)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument'); + } + if (!_2d(z)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument'); + } + if (deepEqual(y, z)) { + throw new TypeError('LinePoint1 should not be same with LinePoint2'); + } + var xCoeff = subtractScalar(z[1], y[1]); + var yCoeff = subtractScalar(y[0], z[0]); + var constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1])); + return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant); + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Object, Object, Object': function Object_Object_Object(x, y, z) { + if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) { + if (!_2d(x)) { + throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers'); + } + if (!_2d(y)) { + throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers'); + } + if (!_2d(z)) { + throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers'); + } + if (deepEqual(_objectToArray(y), _objectToArray(z))) { + throw new TypeError('LinePoint1 should not be same with LinePoint2'); + } + if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) { + var xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY); + var yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX); + var constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY)); + return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant); + } else { + throw new TypeError('Key names do not match'); + } + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Array, Array': function Array_Array(x, y) { + // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const]) + if (x.length === 2 && y.length === 3) { + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]); + } else if (x.length === 3 && y.length === 6) { + // Point to Line 3D + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_parametricLine(y)) { + throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument'); + } + return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]); + } else if (x.length === y.length && x.length > 0) { + // Point to Point N-dimensions + if (!_containsOnlyNumbers(x)) { + throw new TypeError('All values of an array should be numbers or BigNumbers'); + } + if (!_containsOnlyNumbers(y)) { + throw new TypeError('All values of an array should be numbers or BigNumbers'); + } + return _euclideanDistance(x, y); + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + 'Object, Object': function Object_Object(x, y) { + if (Object.keys(x).length === 2 && Object.keys(y).length === 3) { + if (!_2d(x)) { + throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers'); + } + if (!_3d(y)) { + throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers'); + } + if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) { + return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) { + // Point to Line 3D + if (!_3d(x)) { + throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers'); + } + if (!_parametricLine(y)) { + throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers'); + } + if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) { + return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) { + // Point to Point 2D + if (!_2d(x)) { + throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers'); + } + if (!_2d(y)) { + throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers'); + } + if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) { + return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]); + } else { + throw new TypeError('Key names do not match'); + } + } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) { + // Point to Point 3D + if (!_3d(x)) { + throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers'); + } + if (!_3d(y)) { + throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers'); + } + if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) { + return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]); + } else { + throw new TypeError('Key names do not match'); + } + } else { + throw new TypeError('Invalid Arguments: Try again'); + } + }, + Array: function Array(arr) { + if (!_pairwise(arr)) { + throw new TypeError('Incorrect array format entered for pairwise distance calculation'); + } + return _distancePairwise(arr); + } + }); + function _isNumber(a) { + // distance supports numbers and bignumbers + return typeof a === 'number' || isBigNumber(a); + } + function _2d(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]); + } + function _3d(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]); + } + function _containsOnlyNumbers(a) { + // checks if the number of arguments are correct in count and are valid (should be numbers) + if (!Array.isArray(a)) { + a = _objectToArray(a); + } + return a.every(_isNumber); + } + function _parametricLine(a) { + if (a.constructor !== Array) { + a = _objectToArray(a); + } + return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]); + } + function _objectToArray(o) { + var keys = Object.keys(o); + var a = []; + for (var i = 0; i < keys.length; i++) { + a.push(o[keys[i]]); + } + return a; + } + function _pairwise(a) { + // checks for valid arguments passed to _distancePairwise(Array) + if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) { + if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) { + return false; + } + } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) { + if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) { + return false; + } + } else { + return false; + } + return true; + } + function _distancePointLine2D(x, y, a, b, c) { + var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c)); + var den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b))); + return divideScalar(num, den); + } + function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) { + var num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))]; + num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2]))); + var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c))); + return divideScalar(num, den); + } + function _euclideanDistance(x, y) { + var vectorSize = x.length; + var result = 0; + var diff = 0; + for (var i = 0; i < vectorSize; i++) { + diff = subtractScalar(x[i], y[i]); + result = addScalar(multiplyScalar(diff, diff), result); + } + return sqrt(result); + } + function _distancePairwise(a) { + var result = []; + var pointA = []; + var pointB = []; + for (var i = 0; i < a.length - 1; i++) { + for (var j = i + 1; j < a.length; j++) { + if (a[0].length === 2) { + pointA = [a[i][0], a[i][1]]; + pointB = [a[j][0], a[j][1]]; + } else if (a[0].length === 3) { + pointA = [a[i][0], a[i][1], a[i][2]]; + pointB = [a[j][0], a[j][1], a[j][2]]; + } + result.push(_euclideanDistance(pointA, pointB)); + } + } + return result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/intersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/intersect.js new file mode 100644 index 0000000..6d6a772 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/geometry/intersect.js @@ -0,0 +1,200 @@ +import { factory } from '../../utils/factory.js'; +var name = 'intersect'; +var dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric']; +export var createIntersect = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + abs, + add, + addScalar, + matrix, + multiply, + multiplyScalar, + divideScalar, + subtract, + smaller, + equalScalar, + flatten, + isZero, + isNumeric + } = _ref; + /** + * Calculates the point of intersection of two lines in two or three dimensions + * and of a line and a plane in three dimensions. The inputs are in the form of + * arrays or 1 dimensional matrices. The line intersection functions return null + * if the lines do not meet. + * + * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`. + * + * Syntax: + * + * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2) + * math.intersect(endPoint1, endPoint2, planeCoefficients) + * + * Examples: + * + * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5] + * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0] + * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3] + * + * @param {Array | Matrix} w Co-ordinates of first end-point of first line + * @param {Array | Matrix} x Co-ordinates of second end-point of first line + * @param {Array | Matrix} y Co-ordinates of first end-point of second line + * OR Co-efficients of the plane's equation + * @param {Array | Matrix} z Co-ordinates of second end-point of second line + * OR undefined if the calculation is for line and plane + * @return {Array} Returns the point of intersection of lines/lines-planes + */ + return typed('intersect', { + 'Array, Array, Array': _AAA, + 'Array, Array, Array, Array': _AAAA, + 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(x, y, plane) { + var arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf()); + return arr === null ? null : matrix(arr); + }, + 'Matrix, Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix_Matrix(w, x, y, z) { + // TODO: output matrix type should match input matrix type + var arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf()); + return arr === null ? null : matrix(arr); + } + }); + function _AAA(x, y, plane) { + x = _coerceArr(x); + y = _coerceArr(y); + plane = _coerceArr(plane); + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + if (!_4d(plane)) { + throw new TypeError('Array with 4 numbers expected as third argument'); + } + return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]); + } + function _AAAA(w, x, y, z) { + w = _coerceArr(w); + x = _coerceArr(x); + y = _coerceArr(y); + z = _coerceArr(z); + if (w.length === 2) { + if (!_2d(w)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument'); + } + if (!_2d(x)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument'); + } + if (!_2d(y)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument'); + } + if (!_2d(z)) { + throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument'); + } + return _intersect2d(w, x, y, z); + } else if (w.length === 3) { + if (!_3d(w)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument'); + } + if (!_3d(x)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument'); + } + if (!_3d(y)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument'); + } + if (!_3d(z)) { + throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument'); + } + return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]); + } else { + throw new TypeError('Arrays with two or thee dimensional points expected'); + } + } + + /** Coerce row and column 2-dim arrays to 1-dim array */ + function _coerceArr(arr) { + // row matrix + if (arr.length === 1) return arr[0]; + + // column matrix + if (arr.length > 1 && Array.isArray(arr[0])) { + if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr); + } + return arr; + } + function _2d(x) { + return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]); + } + function _3d(x) { + return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]); + } + function _4d(x) { + return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]); + } + function _intersect2d(p1a, p1b, p2a, p2b) { + var o1 = p1a; + var o2 = p2a; + var d1 = subtract(o1, p1b); + var d2 = subtract(o2, p2b); + var det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1])); + if (isZero(det)) return null; + if (smaller(abs(det), config.relTol)) { + return null; + } + var d20o11 = multiplyScalar(d2[0], o1[1]); + var d21o10 = multiplyScalar(d2[1], o1[0]); + var d20o21 = multiplyScalar(d2[0], o2[1]); + var d21o20 = multiplyScalar(d2[1], o2[0]); + var t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det); + return add(multiply(d1, t), o1); + } + function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) { + // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l) + var add1 = multiplyScalar(subtract(a, b), subtract(c, d)); + var add2 = multiplyScalar(subtract(e, f), subtract(g, h)); + var add3 = multiplyScalar(subtract(i, j), subtract(k, l)); + return addScalar(addScalar(add1, add2), add3); + } + function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) { + var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3); + var d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1); + var d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1); + var d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3); + var d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1); + var numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343)); + var denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321)); + if (isZero(denominator)) return null; + var ta = divideScalar(numerator, denominator); + var tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343); + var pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1))); + var pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1))); + var paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1))); + var pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3))); + var pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3))); + var pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3))); + if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) { + return [pax, pay, paz]; + } else { + return null; + } + } + function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) { + var x1x = multiplyScalar(x1, x); + var x2x = multiplyScalar(x2, x); + var y1y = multiplyScalar(y1, y); + var y2y = multiplyScalar(y2, y); + var z1z = multiplyScalar(z1, z); + var z2z = multiplyScalar(z2, z); + var numerator = subtract(subtract(subtract(c, x1x), y1y), z1z); + var denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z); + var t = divideScalar(numerator, denominator); + var px = addScalar(x1, multiplyScalar(t, subtract(x2, x1))); + var py = addScalar(y1, multiplyScalar(t, subtract(y2, y1))); + var pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1))); + return [px, py, pz]; + // TODO: Add cases when line is parallel to the plane: + // (a) no intersection, + // (b) line contained in plane + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/and.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/and.js new file mode 100644 index 0000000..33c7f5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/and.js @@ -0,0 +1,122 @@ +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; +import { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { andNumber } from '../../plain/number/index.js'; +var name = 'and'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat']; +export var createAnd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + zeros, + not, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo06xS0S0 = createMatAlgo06xS0S0({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.and(x, y) + * + * Examples: + * + * math.and(2, 4) // returns true + * + * a = [2, 0, 0] + * b = [3, 7, 0] + * c = 0 + * + * math.and(a, b) // returns [true, false, false] + * math.and(a, c) // returns [false, false, false] + * + * See also: + * + * not, or, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when both inputs are defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': andNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN(); + }, + 'bigint, bigint': andNumber, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)), + 'SparseMatrix, any': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(y)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo11xS0s(x, y, self, false); + }), + 'DenseMatrix, any': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(y)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo14xDs(x, y, self, false); + }), + 'any, SparseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(x)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo11xS0s(y, x, self, true); + }), + 'any, DenseMatrix': typed.referToSelf(self => (x, y) => { + // check scalar + if (not(x)) { + // return zero matrix + return zeros(x.size(), x.storage()); + } + return matAlgo14xDs(y, x, self, true); + }), + 'Array, any': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return self(matrix(x), y).valueOf(); + }), + 'any, Array': typed.referToSelf(self => (x, y) => { + // use matrix implementation + return self(x, matrix(y)).valueOf(); + }) + }, matrixAlgorithmSuite({ + SS: matAlgo06xS0S0, + DS: matAlgo02xDS0 + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/not.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/not.js new file mode 100644 index 0000000..5e0ae17 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/not.js @@ -0,0 +1,48 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { notNumber } from '../../plain/number/index.js'; +var name = 'not'; +var dependencies = ['typed']; +export var createNot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Logical `not`. Flips boolean value of a given parameter. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.not(x) + * + * Examples: + * + * math.not(2) // returns false + * math.not(0) // returns true + * math.not(true) // returns false + * + * a = [2, -7, 0] + * math.not(a) // returns [false, false, true] + * + * See also: + * + * and, or, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @return {boolean | Array | Matrix} + * Returns true when input is a zero or empty value. + */ + return typed(name, { + 'null | undefined': () => true, + number: notNumber, + Complex: function Complex(x) { + return x.re === 0 && x.im === 0; + }, + BigNumber: function BigNumber(x) { + return x.isZero() || x.isNaN(); + }, + bigint: x => !x, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/or.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/or.js new file mode 100644 index 0000000..94fef72 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/or.js @@ -0,0 +1,77 @@ +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { orNumber } from '../../plain/number/index.js'; +var name = 'or'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +export var createOr = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo05xSfSf = createMatAlgo05xSfSf({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.or(x, y) + * + * Examples: + * + * math.or(2, 4) // returns true + * + * a = [2, 5, 0] + * b = [0, 22, 0] + * c = 0 + * + * math.or(a, b) // returns [true, true, false] + * math.or(b, c) // returns [false, true, false] + * + * See also: + * + * and, not, xor + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when one of the inputs is defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': orNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0; + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN(); + }, + 'bigint, bigint': orNumber, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)) + }, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/xor.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/xor.js new file mode 100644 index 0000000..dc5d772 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/logical/xor.js @@ -0,0 +1,76 @@ +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { xorNumber } from '../../plain/number/index.js'; +var name = 'xor'; +var dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat']; +export var createXor = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.xor(x, y) + * + * Examples: + * + * math.xor(2, 4) // returns false + * + * a = [2, 0, 0] + * b = [2, 7, 0] + * c = 0 + * + * math.xor(a, b) // returns [false, true, false] + * math.xor(a, c) // returns [true, false, false] + * + * See also: + * + * and, not, or + * + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check + * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check + * @return {boolean | Array | Matrix} + * Returns true when one and only one input is defined with a nonzero/nonempty value. + */ + return typed(name, { + 'number, number': xorNumber, + 'Complex, Complex': function Complex_Complex(x, y) { + return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0); + }, + 'bigint, bigint': xorNumber, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN()); + }, + 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)) + }, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/apply.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/apply.js new file mode 100644 index 0000000..f4badc7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/apply.js @@ -0,0 +1,111 @@ +import { factory } from '../../utils/factory.js'; +import { arraySize } from '../../utils/array.js'; +import { isMatrix } from '../../utils/is.js'; +import { IndexError } from '../../error/IndexError.js'; +var name = 'apply'; +var dependencies = ['typed', 'isInteger']; +export var createApply = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isInteger + } = _ref; + /** + * Apply a function that maps an array to a scalar + * along a given axis of a matrix or array. + * Returns a new matrix or array with one less dimension than the input. + * + * Syntax: + * + * math.apply(A, dim, callback) + * + * Where: + * + * - `dim: number` is a zero-based dimension over which to concatenate the matrices. + * + * Examples: + * + * const A = [[1, 2], [3, 4]] + * const sum = math.sum + * + * math.apply(A, 0, sum) // returns [4, 6] + * math.apply(A, 1, sum) // returns [3, 7] + * + * See also: + * + * map, filter, forEach + * + * @param {Array | Matrix} array The input Matrix + * @param {number} dim The dimension along which the callback is applied + * @param {Function} callback The callback function that is applied. This Function + * should take an array or 1-d matrix as an input and + * return a number. + * @return {Array | Matrix} res The residual matrix with the function applied over some dimension. + */ + return typed(name, { + 'Array | Matrix, number | BigNumber, function': function Array__Matrix_number__BigNumber_function(mat, dim, callback) { + if (!isInteger(dim)) { + throw new TypeError('Integer number expected for dimension'); + } + var size = Array.isArray(mat) ? arraySize(mat) : mat.size(); + if (dim < 0 || dim >= size.length) { + throw new IndexError(dim, size.length); + } + if (isMatrix(mat)) { + return mat.create(_apply(mat.valueOf(), dim, callback), mat.datatype()); + } else { + return _apply(mat, dim, callback); + } + } + }); +}); + +/** + * Recursively reduce a matrix + * @param {Array} mat + * @param {number} dim + * @param {Function} callback + * @returns {Array} ret + * @private + */ +function _apply(mat, dim, callback) { + var i, ret, tran; + if (dim <= 0) { + if (!Array.isArray(mat[0])) { + return callback(mat); + } else { + tran = _switch(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _apply(tran[i], dim - 1, callback); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _apply(mat[i], dim - 1, callback); + } + return ret; + } +} + +/** + * Transpose a matrix + * @param {Array} mat + * @returns {Array} ret + * @private + */ +function _switch(mat) { + var I = mat.length; + var J = mat[0].length; + var i, j; + var ret = []; + for (j = 0; j < J; j++) { + var tmp = []; + for (i = 0; i < I; i++) { + tmp.push(mat[i][j]); + } + ret.push(tmp); + } + return ret; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/column.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/column.js new file mode 100644 index 0000000..d0b4a24 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/column.js @@ -0,0 +1,59 @@ +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { validateIndex } from '../../utils/array.js'; +var name = 'column'; +var dependencies = ['typed', 'Index', 'matrix', 'range']; +export var createColumn = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Index, + matrix, + range + } = _ref; + /** + * Return a column from a Matrix. + * + * Syntax: + * + * math.column(value, index) + * + * Example: + * + * // get a column + * const d = [[1, 2], [3, 4]] + * math.column(d, 1) // returns [[2], [4]] + * + * See also: + * + * row + * + * @param {Array | Matrix } value An array or matrix + * @param {number} column The index of the column + * @return {Array | Matrix} The retrieved column + */ + return typed(name, { + 'Matrix, number': _column, + 'Array, number': function Array_number(value, column) { + return _column(matrix(clone(value)), column).valueOf(); + } + }); + + /** + * Retrieve a column of a matrix + * @param {Matrix } value A matrix + * @param {number} column The index of the column + * @return {Matrix} The retrieved column + */ + function _column(value, column) { + // check dimensions + if (value.size().length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + validateIndex(column, value.size()[1]); + var rowRange = range(0, value.size()[0]); + var index = new Index(rowRange, column); + var result = value.subset(index); + return isMatrix(result) ? result : matrix([[result]]); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/concat.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/concat.js new file mode 100644 index 0000000..4c8d793 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/concat.js @@ -0,0 +1,104 @@ +import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { arraySize, concat as _concat } from '../../utils/array.js'; +import { IndexError } from '../../error/IndexError.js'; +import { DimensionError } from '../../error/DimensionError.js'; +import { factory } from '../../utils/factory.js'; +var name = 'concat'; +var dependencies = ['typed', 'matrix', 'isInteger']; +export var createConcat = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + isInteger + } = _ref; + /** + * Concatenate two or more matrices. + * + * Syntax: + * + * math.concat(A, B, C, ...) + * math.concat(A, B, C, ..., dim) + * + * Where: + * + * - `dim: number` is a zero-based dimension over which to concatenate the matrices. + * By default the last dimension of the matrices. + * + * Examples: + * + * const A = [[1, 2], [5, 6]] + * const B = [[3, 4], [7, 8]] + * + * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]] + * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]] + * math.concat('hello', ' ', 'world') // returns 'hello world' + * + * See also: + * + * size, squeeze, subset, transpose + * + * @param {... Array | Matrix} args Two or more matrices + * @return {Array | Matrix} Concatenated matrix + */ + return typed(name, { + // TODO: change signature to '...Array | Matrix, dim?' when supported + '...Array | Matrix | number | BigNumber': function Array__Matrix__number__BigNumber(args) { + var i; + var len = args.length; + var dim = -1; // zero-based dimension + var prevDim; + var asMatrix = false; + var matrices = []; // contains multi dimensional arrays + + for (i = 0; i < len; i++) { + var arg = args[i]; + + // test whether we need to return a Matrix (if not we return an Array) + if (isMatrix(arg)) { + asMatrix = true; + } + if (isNumber(arg) || isBigNumber(arg)) { + if (i !== len - 1) { + throw new Error('Dimension must be specified as last argument'); + } + + // last argument contains the dimension on which to concatenate + prevDim = dim; + dim = arg.valueOf(); // change BigNumber to number + + if (!isInteger(dim)) { + throw new TypeError('Integer number expected for dimension'); + } + if (dim < 0 || i > 0 && dim > prevDim) { + // TODO: would be more clear when throwing a DimensionError here + throw new IndexError(dim, prevDim + 1); + } + } else { + // this is a matrix or array + var m = clone(arg).valueOf(); + var size = arraySize(m); + matrices[i] = m; + prevDim = dim; + dim = size.length - 1; + + // verify whether each of the matrices has the same number of dimensions + if (i > 0 && dim !== prevDim) { + throw new DimensionError(prevDim + 1, dim + 1); + } + } + } + if (matrices.length === 0) { + throw new SyntaxError('At least one matrix expected'); + } + var res = matrices.shift(); + while (matrices.length) { + res = _concat(res, matrices.shift(), dim); + } + return asMatrix ? matrix(res) : res; + }, + '...string': function string(args) { + return args.join(''); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/count.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/count.js new file mode 100644 index 0000000..c611970 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/count.js @@ -0,0 +1,39 @@ +import { factory } from '../../utils/factory.js'; +var name = 'count'; +var dependencies = ['typed', 'size', 'prod']; +export var createCount = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + prod + } = _ref; + /** + * Count the number of elements of a matrix, array or string. + * + * Syntax: + * + * math.count(x) + * + * Examples: + * + * math.count('hello world') // returns 11 + * const A = [[1, 2, 3], [4, 5, 6]] + * math.count(A) // returns 6 + * math.count(math.range(1,6)) // returns 5 + * + * See also: + * + * size + * + * @param {string | Array | Matrix} x A matrix or string + * @return {number} An integer with the elements in `x`. + */ + return typed(name, { + string: function string(x) { + return x.length; + }, + 'Matrix | Array': function Matrix__Array(x) { + return prod(size(x)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/cross.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/cross.js new file mode 100644 index 0000000..43647f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/cross.js @@ -0,0 +1,81 @@ +import { arraySize, squeeze } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'cross'; +var dependencies = ['typed', 'matrix', 'subtract', 'multiply']; +export var createCross = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + subtract, + multiply + } = _ref; + /** + * Calculate the cross product for two vectors in three dimensional space. + * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined + * as: + * + * cross(A, B) = [ + * a2 * b3 - a3 * b2, + * a3 * b1 - a1 * b3, + * a1 * b2 - a2 * b1 + * ] + * + * If one of the input vectors has a dimension greater than 1, the output + * vector will be a 1x3 (2-dimensional) matrix. + * + * Syntax: + * + * math.cross(x, y) + * + * Examples: + * + * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1] + * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39] + * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3] + * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]] + * + * See also: + * + * dot, multiply + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {Array | Matrix} Returns the cross product of `x` and `y` + */ + return typed(name, { + 'Matrix, Matrix': function Matrix_Matrix(x, y) { + return matrix(_cross(x.toArray(), y.toArray())); + }, + 'Matrix, Array': function Matrix_Array(x, y) { + return matrix(_cross(x.toArray(), y)); + }, + 'Array, Matrix': function Array_Matrix(x, y) { + return matrix(_cross(x, y.toArray())); + }, + 'Array, Array': _cross + }); + + /** + * Calculate the cross product for two arrays + * @param {Array} x First vector + * @param {Array} y Second vector + * @returns {Array} Returns the cross product of x and y + * @private + */ + function _cross(x, y) { + var highestDimension = Math.max(arraySize(x).length, arraySize(y).length); + x = squeeze(x); + y = squeeze(y); + var xSize = arraySize(x); + var ySize = arraySize(y); + if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) { + throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])'); + } + var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))]; + if (highestDimension > 1) { + return [product]; + } else { + return product; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js new file mode 100644 index 0000000..19836d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js @@ -0,0 +1,37 @@ +import { factory } from '../../utils/factory.js'; +var name = 'ctranspose'; +var dependencies = ['typed', 'transpose', 'conj']; +export var createCtranspose = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + transpose, + conj + } = _ref; + /** + * Transpose and complex conjugate a matrix. All values of the matrix are + * reflected over its main diagonal and then the complex conjugate is + * taken. This is equivalent to complex conjugation for scalars and + * vectors. + * + * Syntax: + * + * math.ctranspose(x) + * + * Examples: + * + * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]] + * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]] + * + * See also: + * + * transpose, diag, inv, subset, squeeze + * + * @param {Array | Matrix} x Matrix to be ctransposed + * @return {Array | Matrix} The ctransposed matrix + */ + return typed(name, { + any: function any(x) { + return conj(transpose(x)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/det.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/det.js new file mode 100644 index 0000000..a90df04 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/det.js @@ -0,0 +1,142 @@ +import { isMatrix } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { format } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +var name = 'det'; +var dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus']; +export var createDet = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + subtractScalar, + multiply, + divideScalar, + isZero, + unaryMinus + } = _ref; + /** + * Calculate the determinant of a matrix. + * + * Syntax: + * + * math.det(x) + * + * Examples: + * + * math.det([[1, 2], [3, 4]]) // returns -2 + * + * const A = [ + * [-2, 2, 3], + * [-1, 1, 3], + * [2, 0, -1] + * ] + * math.det(A) // returns 6 + * + * See also: + * + * inv + * + * @param {Array | Matrix} x A matrix + * @return {number} The determinant of `x` + */ + return typed(name, { + any: function any(x) { + return clone(x); + }, + 'Array | Matrix': function det(x) { + var size; + if (isMatrix(x)) { + size = x.size(); + } else if (Array.isArray(x)) { + x = matrix(x); + size = x.size(); + } else { + // a scalar + size = []; + } + switch (size.length) { + case 0: + // scalar + return clone(x); + case 1: + // vector + if (size[0] === 1) { + return clone(x.valueOf()[0]); + } + if (size[0] === 0) { + return 1; // det of an empty matrix is per definition 1 + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + case 2: + { + // two-dimensional array + var rows = size[0]; + var cols = size[1]; + if (rows === cols) { + return _det(x.clone().valueOf(), rows, cols); + } + if (cols === 0) { + return 1; // det of an empty matrix is per definition 1 + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')'); + } + } + }); + + /** + * Calculate the determinant of a matrix + * @param {Array[]} matrix A square, two dimensional matrix + * @param {number} rows Number of rows of the matrix (zero-based) + * @param {number} cols Number of columns of the matrix (zero-based) + * @returns {number} det + * @private + */ + function _det(matrix, rows, cols) { + if (rows === 1) { + // this is a 1 x 1 matrix + return clone(matrix[0][0]); + } else if (rows === 2) { + // this is a 2 x 2 matrix + // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12 + return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1])); + } else { + // Bareiss algorithm + // this algorithm have same complexity as LUP decomposition (O(n^3)) + // but it preserve precision of floating point more relative to the LUP decomposition + var negated = false; + var rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i + for (var k = 0; k < rows; k++) { + var k_ = rowIndices[k]; + if (isZero(matrix[k_][k])) { + var _k = void 0; + for (_k = k + 1; _k < rows; _k++) { + if (!isZero(matrix[rowIndices[_k]][k])) { + k_ = rowIndices[_k]; + rowIndices[_k] = rowIndices[k]; + rowIndices[k] = k_; + negated = !negated; + break; + } + } + if (_k === rows) return matrix[k_][k]; // some zero of the type + } + var piv = matrix[k_][k]; + var piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1]; + for (var i = k + 1; i < rows; i++) { + var i_ = rowIndices[i]; + for (var j = k + 1; j < rows; j++) { + matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_); + } + } + } + var det = matrix[rowIndices[rows - 1]][rows - 1]; + return negated ? unaryMinus(det) : det; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diag.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diag.js new file mode 100644 index 0000000..af27a95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diag.js @@ -0,0 +1,155 @@ +import { isMatrix } from '../../utils/is.js'; +import { arraySize } from '../../utils/array.js'; +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'diag'; +var dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix']; +export var createDiag = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a diagonal matrix or retrieve the diagonal of a matrix + * + * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned. + * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector. + * When k is positive, the values are placed on the super diagonal. + * When k is negative, the values are placed on the sub diagonal. + * + * Syntax: + * + * math.diag(X) + * math.diag(X, format) + * math.diag(X, k) + * math.diag(X, k, format) + * + * Examples: + * + * // create a diagonal matrix + * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]] + * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]] + * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]] + * + * // retrieve the diagonal from a matrix + * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] + * math.diag(a) // returns [1, 5, 9] + * + * See also: + * + * ones, zeros, identity + * + * @param {Matrix | Array} x A two dimensional matrix or a vector + * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled + * in or retrieved. + * @param {string} [format='dense'] The matrix storage format. + * + * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix. + */ + return typed(name, { + // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments + + Array: function Array(x) { + return _diag(x, 0, arraySize(x), null); + }, + 'Array, number': function Array_number(x, k) { + return _diag(x, k, arraySize(x), null); + }, + 'Array, BigNumber': function Array_BigNumber(x, k) { + return _diag(x, k.toNumber(), arraySize(x), null); + }, + 'Array, string': function Array_string(x, format) { + return _diag(x, 0, arraySize(x), format); + }, + 'Array, number, string': function Array_number_string(x, k, format) { + return _diag(x, k, arraySize(x), format); + }, + 'Array, BigNumber, string': function Array_BigNumber_string(x, k, format) { + return _diag(x, k.toNumber(), arraySize(x), format); + }, + Matrix: function Matrix(x) { + return _diag(x, 0, x.size(), x.storage()); + }, + 'Matrix, number': function Matrix_number(x, k) { + return _diag(x, k, x.size(), x.storage()); + }, + 'Matrix, BigNumber': function Matrix_BigNumber(x, k) { + return _diag(x, k.toNumber(), x.size(), x.storage()); + }, + 'Matrix, string': function Matrix_string(x, format) { + return _diag(x, 0, x.size(), format); + }, + 'Matrix, number, string': function Matrix_number_string(x, k, format) { + return _diag(x, k, x.size(), format); + }, + 'Matrix, BigNumber, string': function Matrix_BigNumber_string(x, k, format) { + return _diag(x, k.toNumber(), x.size(), format); + } + }); + + /** + * Creeate diagonal matrix from a vector or vice versa + * @param {Array | Matrix} x + * @param {number} k + * @param {string} format Storage format for matrix. If null, + * an Array is returned + * @returns {Array | Matrix} + * @private + */ + function _diag(x, k, size, format) { + if (!isInteger(k)) { + throw new TypeError('Second parameter in function diag must be an integer'); + } + var kSuper = k > 0 ? k : 0; + var kSub = k < 0 ? -k : 0; + + // check dimensions + switch (size.length) { + case 1: + return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper); + case 2: + return _getDiagonal(x, k, format, size, kSub, kSuper); + } + throw new RangeError('Matrix for function diag must be 2 dimensional'); + } + function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) { + // matrix size + var ms = [l + kSub, l + kSuper]; + if (format && format !== 'sparse' && format !== 'dense') { + throw new TypeError("Unknown matrix type ".concat(format, "\"")); + } + + // create diagonal matrix + var m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k); + // check we need to return a matrix + return format !== null ? m : m.valueOf(); + } + function _getDiagonal(x, k, format, s, kSub, kSuper) { + // check x is a Matrix + if (isMatrix(x)) { + // get diagonal matrix + var dm = x.diagonal(k); + // check we need to return a matrix + if (format !== null) { + // check we need to change matrix format + if (format !== dm.storage()) { + return matrix(dm, format); + } + return dm; + } + return dm.valueOf(); + } + // vector size + var n = Math.min(s[0] - kSub, s[1] - kSuper); + // diagonal values + var vector = []; + // loop diagonal + for (var i = 0; i < n; i++) { + vector[i] = x[i + kSub][i + kSuper]; + } + // check we need to return a matrix + return format !== null ? matrix(vector) : vector; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diff.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diff.js new file mode 100644 index 0000000..ca211d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/diff.js @@ -0,0 +1,163 @@ +import { factory } from '../../utils/factory.js'; +import { isInteger } from '../../utils/number.js'; +import { isMatrix } from '../../utils/is.js'; +var name = 'diff'; +var dependencies = ['typed', 'matrix', 'subtract', 'number']; +export var createDiff = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + subtract, + number + } = _ref; + /** + * Create a new matrix or array of the difference between elements of the given array + * The optional dim parameter lets you specify the dimension to evaluate the difference of + * If no dimension parameter is passed it is assumed as dimension 0 + * + * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber + * Arrays must be 'rectangular' meaning arrays like [1, 2] + * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays + * + * Syntax: + * + * math.diff(arr) + * math.diff(arr, dim) + * + * Examples: + * + * const arr = [1, 2, 4, 7, 0] + * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed) + * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7] + * + * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]] + * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * + * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3 + * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed + * + * // These will all produce the same result + * math.diff([[1, 2], [3, 4]]) + * math.diff([math.matrix([1, 2]), math.matrix([3, 4])]) + * math.diff([[1, 2], math.matrix([3, 4])]) + * math.diff([math.matrix([1, 2]), [3, 4]]) + * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix + * + * See Also: + * + * sum + * subtract + * partitionSelect + * + * @param {Array | Matrix} arr An array or matrix + * @param {number | BigNumber} dim Dimension + * @return {Array | Matrix} Difference between array elements in given dimension + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(arr) { + // No dimension specified => assume dimension 0 + if (isMatrix(arr)) { + return matrix(_diff(arr.toArray())); + } else { + return _diff(arr); + } + }, + 'Array | Matrix, number': function Array__Matrix_number(arr, dim) { + if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number'); + if (isMatrix(arr)) { + return matrix(_recursive(arr.toArray(), dim)); + } else { + return _recursive(arr, dim); + } + }, + 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))), + 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim))) + }); + + /** + * Recursively find the correct dimension in the array/matrix + * Then Apply _diff to that dimension + * + * @param {Array} arr The array + * @param {number} dim Dimension + * @return {Array} resulting array + */ + function _recursive(arr, dim) { + if (isMatrix(arr)) { + arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly + } + if (!Array.isArray(arr)) { + throw RangeError('Array/Matrix does not have that many dimensions'); + } + if (dim > 0) { + var result = []; + arr.forEach(element => { + result.push(_recursive(element, dim - 1)); + }); + return result; + } else if (dim === 0) { + return _diff(arr); + } else { + throw RangeError('Cannot have negative dimension'); + } + } + + /** + * Difference between elements in the array + * + * @param {Array} arr An array + * @return {Array} resulting array + */ + function _diff(arr) { + var result = []; + var size = arr.length; + for (var i = 1; i < size; i++) { + result.push(_ElementDiff(arr[i - 1], arr[i])); + } + return result; + } + + /** + * Difference between 2 objects + * + * @param {Object} obj1 First object + * @param {Object} obj2 Second object + * @return {Array} resulting array + */ + function _ElementDiff(obj1, obj2) { + // Convert matrices to arrays + if (isMatrix(obj1)) obj1 = obj1.toArray(); + if (isMatrix(obj2)) obj2 = obj2.toArray(); + var obj1IsArray = Array.isArray(obj1); + var obj2IsArray = Array.isArray(obj2); + if (obj1IsArray && obj2IsArray) { + return _ArrayDiff(obj1, obj2); + } + if (!obj1IsArray && !obj2IsArray) { + return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second) + } + throw TypeError('Cannot calculate difference between 1 array and 1 non-array'); + } + + /** + * Difference of elements in 2 arrays + * + * @param {Array} arr1 Array 1 + * @param {Array} arr2 Array 2 + * @return {Array} resulting array + */ + function _ArrayDiff(arr1, arr2) { + if (arr1.length !== arr2.length) { + throw RangeError('Not all sub-arrays have the same length'); + } + var result = []; + var size = arr1.length; + for (var i = 0; i < size; i++) { + result.push(_ElementDiff(arr1[i], arr2[i])); + } + return result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/dot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/dot.js new file mode 100644 index 0000000..8bc4793 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/dot.js @@ -0,0 +1,156 @@ +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +var name = 'dot'; +var dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size']; +export var createDot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + addScalar, + multiplyScalar, + conj, + size + } = _ref; + /** + * Calculate the dot product of two vectors. The dot product of + * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as: + * + * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn + * + * Syntax: + * + * math.dot(x, y) + * + * Examples: + * + * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15 + * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15 + * + * See also: + * + * multiply, cross + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {number} Returns the dot product of `x` and `y` + */ + return typed(name, { + 'Array | DenseMatrix, Array | DenseMatrix': _denseDot, + 'SparseMatrix, SparseMatrix': _sparseDot + }); + function _validateDim(x, y) { + var xSize = _size(x); + var ySize = _size(y); + var xLen, yLen; + if (xSize.length === 1) { + xLen = xSize[0]; + } else if (xSize.length === 2 && xSize[1] === 1) { + xLen = xSize[0]; + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')'); + } + if (ySize.length === 1) { + yLen = ySize[0]; + } else if (ySize.length === 2 && ySize[1] === 1) { + yLen = ySize[0]; + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')'); + } + if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')'); + if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors'); + return xLen; + } + function _denseDot(a, b) { + var N = _validateDim(a, b); + var adata = isMatrix(a) ? a._data : a; + var adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined; + var bdata = isMatrix(b) ? b._data : b; + var bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined; + + // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors) + var aIsColumn = _size(a).length === 2; + var bIsColumn = _size(b).length === 2; + var add = addScalar; + var mul = multiplyScalar; + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') { + var dt = adt; + // find signatures that matches (dt, dt) + add = typed.find(addScalar, [dt, dt]); + mul = typed.find(multiplyScalar, [dt, dt]); + } + + // both vectors 1-dimensional + if (!aIsColumn && !bIsColumn) { + var c = mul(conj(adata[0]), bdata[0]); + for (var i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i]), bdata[i])); + } + return c; + } + + // a is 1-dim, b is column + if (!aIsColumn && bIsColumn) { + var _c = mul(conj(adata[0]), bdata[0][0]); + for (var _i = 1; _i < N; _i++) { + _c = add(_c, mul(conj(adata[_i]), bdata[_i][0])); + } + return _c; + } + + // a is column, b is 1-dim + if (aIsColumn && !bIsColumn) { + var _c2 = mul(conj(adata[0][0]), bdata[0]); + for (var _i2 = 1; _i2 < N; _i2++) { + _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2])); + } + return _c2; + } + + // both vectors are column + if (aIsColumn && bIsColumn) { + var _c3 = mul(conj(adata[0][0]), bdata[0][0]); + for (var _i3 = 1; _i3 < N; _i3++) { + _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0])); + } + return _c3; + } + } + function _sparseDot(x, y) { + _validateDim(x, y); + var xindex = x._index; + var xvalues = x._values; + var yindex = y._index; + var yvalues = y._values; + + // TODO optimize add & mul using datatype + var c = 0; + var add = addScalar; + var mul = multiplyScalar; + var i = 0; + var j = 0; + while (i < xindex.length && j < yindex.length) { + var I = xindex[i]; + var J = yindex[j]; + if (I < J) { + i++; + continue; + } + if (I > J) { + j++; + continue; + } + if (I === J) { + c = add(c, mul(xvalues[i], yvalues[j])); + i++; + j++; + } + } + return c; + } + + // TODO remove this once #1771 is fixed + function _size(x) { + return isMatrix(x) ? x.size() : size(x); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs.js new file mode 100644 index 0000000..fdde565 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs.js @@ -0,0 +1,328 @@ +import _extends from "@babel/runtime/helpers/extends"; +import { factory } from '../../utils/factory.js'; +import { format } from '../../utils/string.js'; +import { createComplexEigs } from './eigs/complexEigs.js'; +import { createRealSymmetric } from './eigs/realSymmetric.js'; +import { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js'; +var name = 'eigs'; + +// The absolute state of math.js's dependency system: +var dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'divideScalar', 'inv', 'bignumber', 'multiply', 'add', 'larger', 'column', 'flatten', 'number', 'complex', 'sqrt', 'diag', 'size', 'reshape', 'qr', 'usolve', 'usolveAll', 'im', 're', 'smaller', 'matrixFromColumns', 'dot']; +export var createEigs = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + typed, + matrix, + addScalar, + subtract, + equal, + abs, + atan, + cos, + sin, + multiplyScalar, + divideScalar, + inv, + bignumber, + multiply, + add, + larger, + column, + flatten, + number, + complex, + sqrt, + diag, + size, + reshape, + qr, + usolve, + usolveAll, + im, + re, + smaller, + matrixFromColumns, + dot + } = _ref; + var doRealSymmetric = createRealSymmetric({ + config, + addScalar, + subtract, + column, + flatten, + equal, + abs, + atan, + cos, + sin, + multiplyScalar, + inv, + bignumber, + complex, + multiply, + add + }); + var doComplexEigs = createComplexEigs({ + config, + addScalar, + subtract, + multiply, + multiplyScalar, + flatten, + divideScalar, + sqrt, + abs, + bignumber, + diag, + size, + reshape, + qr, + inv, + usolve, + usolveAll, + equal, + complex, + larger, + smaller, + matrixFromColumns, + dot + }); + + /** + * Compute eigenvalues and optionally eigenvectors of a square matrix. + * The eigenvalues are sorted by their absolute value, ascending, and + * returned as a vector in the `values` property of the returned project. + * An eigenvalue with algebraic multiplicity k will be listed k times, so + * that the returned `values` vector always has length equal to the size + * of the input matrix. + * + * The `eigenvectors` property of the return value provides the eigenvectors. + * It is an array of plain objects: the `value` property of each gives the + * associated eigenvalue, and the `vector` property gives the eigenvector + * itself. Note that the same `value` property will occur as many times in + * the list provided by `eigenvectors` as the geometric multiplicity of + * that value. + * + * If the algorithm fails to converge, it will throw an error – + * in that case, however, you may still find useful information + * in `err.values` and `err.vectors`. + * + * Note that the 'precision' option does not directly specify the _accuracy_ + * of the returned eigenvalues. Rather, it determines how small an entry + * of the iterative approximations to an upper triangular matrix must be + * in order to be considered zero. The actual accuracy of the returned + * eigenvalues may be greater or less than the precision, depending on the + * conditioning of the matrix and how far apart or close the actual + * eigenvalues are. Note that currently, relatively simple, "traditional" + * methods of eigenvalue computation are being used; this is not a modern, + * high-precision eigenvalue computation. That said, it should typically + * produce fairly reasonable results. + * + * Syntax: + * + * math.eigs(x, [prec]) + * math.eigs(x, {options}) + * + * Examples: + * + * const { eigs, multiply, column, transpose, matrixFromColumns } = math + * const H = [[5, 2.3], [2.3, 1]] + * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...] + * const E = ans.values + * const V = ans.eigenvectors + * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector)) + * const U = matrixFromColumns(...V.map(obj => obj.vector)) + * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible + * E[0] == UTxHxU[0][0] // returns true always + * + * // Compute only approximate eigenvalues: + * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6}) + * + * See also: + * + * inv + * + * @param {Array | Matrix} x Matrix to be diagonalized + * + * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision. + * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested. + * + */ + return typed('eigs', { + // The conversion to matrix in the first two implementations, + // just to convert back to an array right away in + // computeValuesAndVectors, is unfortunate, and should perhaps be + // streamlined. It is done because the Matrix object carries some + // type information about its entries, and so constructing the matrix + // is a roundabout way of doing type detection. + Array: function Array(x) { + return doEigs(matrix(x)); + }, + 'Array, number|BigNumber': function Array_numberBigNumber(x, prec) { + return doEigs(matrix(x), { + precision: prec + }); + }, + 'Array, Object'(x, opts) { + return doEigs(matrix(x), opts); + }, + Matrix: function Matrix(mat) { + return doEigs(mat, { + matricize: true + }); + }, + 'Matrix, number|BigNumber': function Matrix_numberBigNumber(mat, prec) { + return doEigs(mat, { + precision: prec, + matricize: true + }); + }, + 'Matrix, Object': function Matrix_Object(mat, opts) { + var useOpts = { + matricize: true + }; + _extends(useOpts, opts); + return doEigs(mat, useOpts); + } + }); + function doEigs(mat) { + var _opts$precision; + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true; + var prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol; + var result = computeValuesAndVectors(mat, prec, computeVectors); + if (opts.matricize) { + result.values = matrix(result.values); + if (computeVectors) { + result.eigenvectors = result.eigenvectors.map(_ref2 => { + var { + value, + vector + } = _ref2; + return { + value, + vector: matrix(vector) + }; + }); + } + } + if (computeVectors) { + Object.defineProperty(result, 'vectors', { + enumerable: false, + // to make sure that the eigenvectors can still be + // converted to string. + get: () => { + throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors'); + } + }); + } + return result; + } + function computeValuesAndVectors(mat, prec, computeVectors) { + var arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased + // and so safe to modify in place + var asize = mat.size(); + if (asize.length !== 2 || asize[0] !== asize[1]) { + throw new RangeError("Matrix must be square (size: ".concat(format(asize), ")")); + } + var N = asize[0]; + if (isReal(arr, N, prec)) { + coerceReal(arr, N); // modifies arr by side effect + + if (isSymmetric(arr, N, prec)) { + var _type = coerceTypes(mat, arr, N); // modifies arr by side effect + return doRealSymmetric(arr, N, prec, _type, computeVectors); + } + } + var type = coerceTypes(mat, arr, N); // modifies arr by side effect + return doComplexEigs(arr, N, prec, type, computeVectors); + } + + /** @return {boolean} */ + function isSymmetric(arr, N, prec) { + for (var i = 0; i < N; i++) { + for (var j = i; j < N; j++) { + // TODO proper comparison of bignum and frac + if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) { + return false; + } + } + } + return true; + } + + /** @return {boolean} */ + function isReal(arr, N, prec) { + for (var i = 0; i < N; i++) { + for (var j = 0; j < N; j++) { + // TODO proper comparison of bignum and frac + if (larger(bignumber(abs(im(arr[i][j]))), prec)) { + return false; + } + } + } + return true; + } + function coerceReal(arr, N) { + for (var i = 0; i < N; i++) { + for (var j = 0; j < N; j++) { + arr[i][j] = re(arr[i][j]); + } + } + } + + /** @return {'number' | 'BigNumber' | 'Complex'} */ + function coerceTypes(mat, arr, N) { + /** @type {string} */ + var type = mat.datatype(); + if (type === 'number' || type === 'BigNumber' || type === 'Complex') { + return type; + } + var hasNumber = false; + var hasBig = false; + var hasComplex = false; + for (var i = 0; i < N; i++) { + for (var j = 0; j < N; j++) { + var el = arr[i][j]; + if (isNumber(el) || isFraction(el)) { + hasNumber = true; + } else if (isBigNumber(el)) { + hasBig = true; + } else if (isComplex(el)) { + hasComplex = true; + } else { + throw TypeError('Unsupported type in Matrix: ' + typeOf(el)); + } + } + } + if (hasBig && hasComplex) { + console.warn('Complex BigNumbers not supported, this operation will lose precission.'); + } + if (hasComplex) { + for (var _i = 0; _i < N; _i++) { + for (var _j = 0; _j < N; _j++) { + arr[_i][_j] = complex(arr[_i][_j]); + } + } + return 'Complex'; + } + if (hasBig) { + for (var _i2 = 0; _i2 < N; _i2++) { + for (var _j2 = 0; _j2 < N; _j2++) { + arr[_i2][_j2] = bignumber(arr[_i2][_j2]); + } + } + return 'BigNumber'; + } + if (hasNumber) { + for (var _i3 = 0; _i3 < N; _i3++) { + for (var _j3 = 0; _j3 < N; _j3++) { + arr[_i3][_j3] = number(arr[_i3][_j3]); + } + } + return 'number'; + } else { + throw TypeError('Matrix contains unsupported types only.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js new file mode 100644 index 0000000..2463c42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js @@ -0,0 +1,698 @@ +import { clone } from '../../../utils/object.js'; +export function createComplexEigs(_ref) { + var { + addScalar, + subtract, + flatten, + multiply, + multiplyScalar, + divideScalar, + sqrt, + abs, + bignumber, + diag, + size, + reshape, + inv, + qr, + usolve, + usolveAll, + equal, + complex, + larger, + smaller, + matrixFromColumns, + dot + } = _ref; + /** + * @param {number[][]} arr the matrix to find eigenvalues of + * @param {number} N size of the matrix + * @param {number|BigNumber} prec precision, anything lower will be considered zero + * @param {'number'|'BigNumber'|'Complex'} type + * @param {boolean} findVectors should we find eigenvectors? + * + * @returns {{ values: number[], vectors: number[][] }} + */ + function complexEigs(arr, N, prec, type) { + var findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + // TODO check if any row/col are zero except the diagonal + + // make sure corresponding rows and columns have similar magnitude + // important because of numerical stability + // MODIFIES arr by side effect! + var R = balance(arr, N, prec, type, findVectors); + + // R is the row transformation matrix + // arr = A' = R A R^-1, A is the original matrix + // (if findVectors is false, R is undefined) + // (And so to return to original matrix: A = R^-1 arr R) + + // TODO if magnitudes of elements vary over many orders, + // move greatest elements to the top left corner + + // using similarity transformations, reduce the matrix + // to Hessenberg form (upper triangular plus one subdiagonal row) + // updates the transformation matrix R with new row operationsq + // MODIFIES arr by side effect! + reduceToHessenberg(arr, N, prec, type, findVectors, R); + // still true that original A = R^-1 arr R) + + // find eigenvalues + var { + values, + C + } = iterateUntilTriangular(arr, N, prec, type, findVectors); + + // values is the list of eigenvalues, C is the column + // transformation matrix that transforms arr, the hessenberg + // matrix, to upper triangular + // (So U = C^-1 arr C and the relationship between current arr + // and original A is unchanged.) + + if (findVectors) { + var eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type); + return { + values, + eigenvectors + }; + } + return { + values + }; + } + + /** + * @param {number[][]} arr + * @param {number} N + * @param {number} prec + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {number[][]} + */ + function balance(arr, N, prec, type, findVectors) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var realzero = big ? bignumber(0) : 0; + var one = big ? bignumber(1) : cplx ? complex(1) : 1; + var realone = big ? bignumber(1) : 1; + + // base of the floating-point arithmetic + var radix = big ? bignumber(10) : 2; + var radixSq = multiplyScalar(radix, radix); + + // the diagonal transformation matrix R + var Rdiag; + if (findVectors) { + Rdiag = Array(N).fill(one); + } + + // this isn't the only time we loop thru the matrix... + var last = false; + while (!last) { + // ...haha I'm joking! unless... + last = true; + for (var i = 0; i < N; i++) { + // compute the taxicab norm of i-th column and row + // TODO optimize for complex numbers + var colNorm = realzero; + var rowNorm = realzero; + for (var j = 0; j < N; j++) { + if (i === j) continue; + colNorm = addScalar(colNorm, abs(arr[j][i])); + rowNorm = addScalar(rowNorm, abs(arr[i][j])); + } + if (!equal(colNorm, 0) && !equal(rowNorm, 0)) { + // find integer power closest to balancing the matrix + // (we want to scale only by integer powers of radix, + // so that we don't lose any precision due to round-off) + + var f = realone; + var c = colNorm; + var rowDivRadix = divideScalar(rowNorm, radix); + var rowMulRadix = multiplyScalar(rowNorm, radix); + while (smaller(c, rowDivRadix)) { + c = multiplyScalar(c, radixSq); + f = multiplyScalar(f, radix); + } + while (larger(c, rowMulRadix)) { + c = divideScalar(c, radixSq); + f = divideScalar(f, radix); + } + + // check whether balancing is needed + // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm) + var condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95)); + + // apply balancing similarity transformation + if (condition) { + // we should loop once again to check whether + // another rebalancing is needed + last = false; + var g = divideScalar(1, f); + for (var _j = 0; _j < N; _j++) { + if (i === _j) { + continue; + } + arr[i][_j] = multiplyScalar(arr[i][_j], g); + arr[_j][i] = multiplyScalar(arr[_j][i], f); + } + + // keep track of transformations + if (findVectors) { + Rdiag[i] = multiplyScalar(Rdiag[i], g); + } + } + } + } + } + + // return the diagonal row transformation matrix + return findVectors ? diag(Rdiag) : null; + } + + /** + * @param {number[][]} arr + * @param {number} N + * @param {number} prec + * @param {'number'|'BigNumber'|'Complex'} type + * @param {boolean} findVectors + * @param {number[][]} R the row transformation matrix that will be modified + */ + function reduceToHessenberg(arr, N, prec, type, findVectors, R) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var zero = big ? bignumber(0) : cplx ? complex(0) : 0; + if (big) { + prec = bignumber(prec); + } + for (var i = 0; i < N - 2; i++) { + // Find the largest subdiag element in the i-th col + + var maxIndex = 0; + var max = zero; + for (var j = i + 1; j < N; j++) { + var el = arr[j][i]; + if (smaller(abs(max), abs(el))) { + max = el; + maxIndex = j; + } + } + + // This col is pivoted, no need to do anything + if (smaller(abs(max), prec)) { + continue; + } + if (maxIndex !== i + 1) { + // Interchange maxIndex-th and (i+1)-th row + var tmp1 = arr[maxIndex]; + arr[maxIndex] = arr[i + 1]; + arr[i + 1] = tmp1; + + // Interchange maxIndex-th and (i+1)-th column + for (var _j2 = 0; _j2 < N; _j2++) { + var tmp2 = arr[_j2][maxIndex]; + arr[_j2][maxIndex] = arr[_j2][i + 1]; + arr[_j2][i + 1] = tmp2; + } + + // keep track of transformations + if (findVectors) { + var tmp3 = R[maxIndex]; + R[maxIndex] = R[i + 1]; + R[i + 1] = tmp3; + } + } + + // Reduce following rows and columns + for (var _j3 = i + 2; _j3 < N; _j3++) { + var n = divideScalar(arr[_j3][i], max); + if (n === 0) { + continue; + } + + // from j-th row subtract n-times (i+1)th row + for (var k = 0; k < N; k++) { + arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k])); + } + + // to (i+1)th column add n-times j-th column + for (var _k = 0; _k < N; _k++) { + arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3])); + } + + // keep track of transformations + if (findVectors) { + for (var _k2 = 0; _k2 < N; _k2++) { + R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2])); + } + } + } + } + return R; + } + + /** + * @returns {{values: values, C: Matrix}} + * @see Press, Wiliams: Numerical recipes in Fortran 77 + * @see https://en.wikipedia.org/wiki/QR_algorithm + */ + function iterateUntilTriangular(A, N, prec, type, findVectors) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var one = big ? bignumber(1) : cplx ? complex(1) : 1; + if (big) { + prec = bignumber(prec); + } + + // The Francis Algorithm + // The core idea of this algorithm is that doing successive + // A' = QtAQ transformations will eventually converge to block- + // upper-triangular with diagonal blocks either 1x1 or 2x2. + // The Q here is the one from the QR decomposition, A = QR. + // Since the eigenvalues of a block-upper-triangular matrix are + // the eigenvalues of its diagonal blocks and we know how to find + // eigenvalues of a 2x2 matrix, we know the eigenvalues of A. + + var arr = clone(A); + + // the list of converged eigenvalues + var lambdas = []; + + // size of arr, which will get smaller as eigenvalues converge + var n = N; + + // the diagonal of the block-diagonal matrix that turns + // converged 2x2 matrices into upper triangular matrices + var Sdiag = []; + + // N×N matrix describing the overall transformation done during the QR algorithm + var Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined; + + // nxn matrix describing the QR transformations done since last convergence + var Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined; + + // last eigenvalue converged before this many steps + var lastConvergenceBefore = 0; + while (lastConvergenceBefore <= 100) { + lastConvergenceBefore += 1; + + // TODO if the convergence is slow, do something clever + + // Perform the factorization + + var k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat + // old-fashioned choice; ideally set close to an eigenvalue, or + // perhaps better yet switch to the implicit QR version that is sometimes + // specifically called the "Francis algorithm" that is alluded to + // in the following TODO. (Or perhaps we switch to an independently + // optimized third-party package for the linear algebra operations...) + + for (var i = 0; i < n; i++) { + arr[i][i] = subtract(arr[i][i], k); + } + + // TODO do an implicit QR transformation + var { + Q, + R + } = qr(arr); + arr = multiply(R, Q); + for (var _i = 0; _i < n; _i++) { + arr[_i][_i] = addScalar(arr[_i][_i], k); + } + + // keep track of transformations + if (findVectors) { + Qpartial = multiply(Qpartial, Q); + } + + // The rightmost diagonal element converged to an eigenvalue + if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) { + lastConvergenceBefore = 0; + lambdas.push(arr[n - 1][n - 1]); + + // keep track of transformations + if (findVectors) { + Sdiag.unshift([[1]]); + inflateMatrix(Qpartial, N); + Qtotal = multiply(Qtotal, Qpartial); + if (n > 1) { + Qpartial = diag(Array(n - 1).fill(one)); + } + } + + // reduce the matrix size + n -= 1; + arr.pop(); + for (var _i2 = 0; _i2 < n; _i2++) { + arr[_i2].pop(); + } + + // The rightmost diagonal 2x2 block converged + } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) { + lastConvergenceBefore = 0; + var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]); + lambdas.push(...ll); + + // keep track of transformations + if (findVectors) { + Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type)); + inflateMatrix(Qpartial, N); + Qtotal = multiply(Qtotal, Qpartial); + if (n > 2) { + Qpartial = diag(Array(n - 2).fill(one)); + } + } + + // reduce the matrix size + n -= 2; + arr.pop(); + arr.pop(); + for (var _i3 = 0; _i3 < n; _i3++) { + arr[_i3].pop(); + arr[_i3].pop(); + } + } + if (n === 0) { + break; + } + } + + // standard sorting + lambdas.sort((a, b) => +subtract(abs(a), abs(b))); + + // the algorithm didn't converge + if (lastConvergenceBefore > 100) { + var err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', ')); + err.values = lambdas; + err.vectors = []; + throw err; + } + + // combine the overall QR transformation Qtotal with the subsequent + // transformation S that turns the diagonal 2x2 blocks to upper triangular + var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined; + return { + values: lambdas, + C + }; + } + + /** + * @param {Matrix} A hessenberg-form matrix + * @param {number} N size of A + * @param {Matrix} C column transformation matrix that turns A into upper triangular + * @param {Matrix} R similarity that turns original matrix into A + * @param {number[]} values array of eigenvalues of A + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {number[][]} eigenvalues + */ + function findEigenvectors(A, N, C, R, values, prec, type) { + var Cinv = inv(C); + var U = multiply(Cinv, A, C); + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var zero = big ? bignumber(0) : cplx ? complex(0) : 0; + var one = big ? bignumber(1) : cplx ? complex(1) : 1; + + // turn values into a kind of "multiset" + // this way it is easier to find eigenvectors + var uniqueValues = []; + var multiplicities = []; + for (var lambda of values) { + var i = indexOf(uniqueValues, lambda, equal); + if (i === -1) { + uniqueValues.push(lambda); + multiplicities.push(1); + } else { + multiplicities[i] += 1; + } + } + + // find eigenvectors by solving U − lambdaE = 0 + // TODO replace with an iterative eigenvector algorithm + // (this one might fail for imprecise eigenvalues) + + var vectors = []; + var len = uniqueValues.length; + var b = Array(N).fill(zero); + var E = diag(Array(N).fill(one)); + var _loop = function _loop() { + var lambda = uniqueValues[_i4]; + var S = subtract(U, multiply(lambda, E)); // the characteristic matrix + + var solutions = usolveAll(S, b); + solutions.shift(); // ignore the null vector + + // looks like we missed something, try inverse iteration + // But if that fails, just presume that the original matrix truly + // was defective. + while (solutions.length < multiplicities[_i4]) { + var approxVec = inverseIterate(S, N, solutions, prec, type); + if (approxVec === null) { + break; + } // no more vectors were found + solutions.push(approxVec); + } + + // Transform back into original array coordinates + var correction = multiply(inv(R), C); + solutions = solutions.map(v => multiply(correction, v)); + vectors.push(...solutions.map(v => ({ + value: lambda, + vector: flatten(v) + }))); + }; + for (var _i4 = 0; _i4 < len; _i4++) { + _loop(); + } + return vectors; + } + + /** + * Compute the eigenvalues of an 2x2 matrix + * @return {[number,number]} + */ + function eigenvalues2x2(a, b, c, d) { + // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA ) + var trA = addScalar(a, d); + var detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c)); + var x = multiplyScalar(trA, 0.5); + var y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5); + return [addScalar(x, y), subtract(x, y)]; + } + + /** + * For an 2x2 matrix compute the transformation matrix S, + * so that SAS^-1 is an upper triangular matrix + * @return {[[number,number],[number,number]]} + * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf + * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html + */ + function jordanBase2x2(a, b, c, d, l1, l2, prec, type) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var zero = big ? bignumber(0) : cplx ? complex(0) : 0; + var one = big ? bignumber(1) : cplx ? complex(1) : 1; + + // matrix is already upper triangular + // return an identity matrix + if (smaller(abs(c), prec)) { + return [[one, zero], [zero, one]]; + } + + // matrix is diagonalizable + // return its eigenvectors as columns + if (larger(abs(subtract(l1, l2)), prec)) { + return [[subtract(l1, d), subtract(l2, d)], [c, c]]; + } + + // matrix is not diagonalizable + // compute diagonal elements of N = A - lambdaI + var na = subtract(a, l1); + var nd = subtract(d, l1); + + // col(N,2) = 0 implies S = ( col(N,1), e_1 ) + // col(N,2) != 0 implies S = ( col(N,2), e_2 ) + + if (smaller(abs(b), prec) && smaller(abs(nd), prec)) { + return [[na, one], [c, zero]]; + } else { + return [[b, zero], [nd, one]]; + } + } + + /** + * Enlarge the matrix from nxn to NxN, setting the new + * elements to 1 on diagonal and 0 elsewhere + */ + function inflateMatrix(arr, N) { + // add columns + for (var i = 0; i < arr.length; i++) { + arr[i].push(...Array(N - arr[i].length).fill(0)); + } + + // add rows + for (var _i5 = arr.length; _i5 < N; _i5++) { + arr.push(Array(N).fill(0)); + arr[_i5][_i5] = 1; + } + return arr; + } + + /** + * Create a block-diagonal matrix with the given square matrices on the diagonal + * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal + * @param {number} N the size of the resulting matrix + */ + function blockDiag(arr, N) { + var M = []; + for (var i = 0; i < N; i++) { + M[i] = Array(N).fill(0); + } + var I = 0; + for (var sub of arr) { + var n = sub.length; + for (var _i6 = 0; _i6 < n; _i6++) { + for (var j = 0; j < n; j++) { + M[I + _i6][I + j] = sub[_i6][j]; + } + } + I += n; + } + return M; + } + + /** + * Finds the index of an element in an array using a custom equality function + * @template T + * @param {Array} arr array in which to search + * @param {T} el the element to find + * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el` + * @returns {number} the index of `el`, or -1 when it's not in `arr` + */ + function indexOf(arr, el, fn) { + for (var i = 0; i < arr.length; i++) { + if (fn(arr[i], el)) { + return i; + } + } + return -1; + } + + /** + * Provided a near-singular upper-triangular matrix A and a list of vectors, + * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal + * to each vector in the list + * @template T + * @param {T[][]} A near-singular square matrix + * @param {number} N dimension + * @param {T[][]} orthog list of vectors + * @param {number} prec epsilon + * @param {'number'|'BigNumber'|'Complex'} type + * @return {T[] | null} eigenvector + * + * @see Numerical Recipes for Fortran 77 – 11.7 Eigenvalues or Eigenvectors by Inverse Iteration + */ + function inverseIterate(A, N, orthog, prec, type) { + var largeNum = type === 'BigNumber' ? bignumber(1000) : 1000; + var b; // the vector + + // you better choose a random vector before I count to five + var i = 0; + for (; i < 5; ++i) { + b = randomOrthogonalVector(N, orthog, type); + try { + b = usolve(A, b); + } catch (_unused) { + // That direction didn't work, likely because the original matrix + // was defective. But still make the full number of tries... + continue; + } + if (larger(norm(b), largeNum)) { + break; + } + } + if (i >= 5) { + return null; // couldn't find any orthogonal vector in the image + } + + // you better converge before I count to ten + i = 0; + while (true) { + var c = usolve(A, b); + if (smaller(norm(orthogonalComplement(b, [c])), prec)) { + break; + } + if (++i >= 10) { + return null; + } + b = normalize(c); + } + return b; + } + + /** + * Generates a random unit vector of dimension N, orthogonal to each vector in the list + * @template T + * @param {number} N dimension + * @param {T[][]} orthog list of vectors + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {T[]} random vector + */ + function randomOrthogonalVector(N, orthog, type) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + + // generate random vector with the correct type + var v = Array(N).fill(0).map(_ => 2 * Math.random() - 1); + if (big) { + v = v.map(n => bignumber(n)); + } + if (cplx) { + v = v.map(n => complex(n)); + } + + // project to orthogonal complement + v = orthogonalComplement(v, orthog); + + // normalize + return normalize(v, type); + } + + /** + * Project vector v to the orthogonal complement of an array of vectors + */ + function orthogonalComplement(v, orthog) { + var vectorShape = size(v); + for (var w of orthog) { + w = reshape(w, vectorShape); // make sure this is just a vector computation + // v := v − (w, v)/|w|^2 w + v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w)); + } + return v; + } + + /** + * Calculate the norm of a vector. + * We can't use math.norm because factory can't handle circular dependency. + * Seriously, I'm really fed up with factory. + */ + function norm(v) { + return abs(sqrt(dot(v, v))); + } + + /** + * Normalize a vector + * @template T + * @param {T[]} v + * @param {'number'|'BigNumber'|'Complex'} type + * @returns {T[]} normalized vec + */ + function normalize(v, type) { + var big = type === 'BigNumber'; + var cplx = type === 'Complex'; + var one = big ? bignumber(1) : cplx ? complex(1) : 1; + return multiply(divideScalar(one, norm(v)), v); + } + return complexEigs; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js new file mode 100644 index 0000000..0b38087 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js @@ -0,0 +1,297 @@ +import { clone } from '../../../utils/object.js'; +export function createRealSymmetric(_ref) { + var { + config, + addScalar, + subtract, + abs, + atan, + cos, + sin, + multiplyScalar, + inv, + bignumber, + multiply, + add + } = _ref; + /** + * @param {number[] | BigNumber[]} arr + * @param {number} N + * @param {number} prec + * @param {'number' | 'BigNumber'} type + */ + function main(arr, N) { + var prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol; + var type = arguments.length > 3 ? arguments[3] : undefined; + var computeVectors = arguments.length > 4 ? arguments[4] : undefined; + if (type === 'number') { + return diag(arr, prec, computeVectors); + } + if (type === 'BigNumber') { + return diagBig(arr, prec, computeVectors); + } + throw TypeError('Unsupported data type: ' + type); + } + + // diagonalization implementation for number (efficient) + function diag(x, precision, computeVectors) { + var N = x.length; + var e0 = Math.abs(precision / N); + var psi; + var Sij; + if (computeVectors) { + Sij = new Array(N); + // Sij is Identity Matrix + for (var i = 0; i < N; i++) { + Sij[i] = Array(N).fill(0); + Sij[i][i] = 1.0; + } + } + // initial error + var Vab = getAij(x); + while (Math.abs(Vab[1]) >= Math.abs(e0)) { + var _i = Vab[0][0]; + var j = Vab[0][1]; + psi = getTheta(x[_i][_i], x[j][j], x[_i][j]); + x = x1(x, psi, _i, j); + if (computeVectors) Sij = Sij1(Sij, psi, _i, j); + Vab = getAij(x); + } + var Ei = Array(N).fill(0); // eigenvalues + for (var _i2 = 0; _i2 < N; _i2++) { + Ei[_i2] = x[_i2][_i2]; + } + return sorting(clone(Ei), Sij, computeVectors); + } + + // diagonalization implementation for bigNumber + function diagBig(x, precision, computeVectors) { + var N = x.length; + var e0 = abs(precision / N); + var psi; + var Sij; + if (computeVectors) { + Sij = new Array(N); + // Sij is Identity Matrix + for (var i = 0; i < N; i++) { + Sij[i] = Array(N).fill(0); + Sij[i][i] = 1.0; + } + } + // initial error + var Vab = getAijBig(x); + while (abs(Vab[1]) >= abs(e0)) { + var _i3 = Vab[0][0]; + var j = Vab[0][1]; + psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]); + x = x1Big(x, psi, _i3, j); + if (computeVectors) Sij = Sij1Big(Sij, psi, _i3, j); + Vab = getAijBig(x); + } + var Ei = Array(N).fill(0); // eigenvalues + for (var _i4 = 0; _i4 < N; _i4++) { + Ei[_i4] = x[_i4][_i4]; + } + // return [clone(Ei), clone(Sij)] + return sorting(clone(Ei), Sij, computeVectors); + } + + // get angle + function getTheta(aii, ajj, aij) { + var denom = ajj - aii; + if (Math.abs(denom) <= config.relTol) { + return Math.PI / 4.0; + } else { + return 0.5 * Math.atan(2.0 * aij / (ajj - aii)); + } + } + + // get angle + function getThetaBig(aii, ajj, aij) { + var denom = subtract(ajj, aii); + if (abs(denom) <= config.relTol) { + return bignumber(-1).acos().div(4); + } else { + return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom)))); + } + } + + // update eigvec + function Sij1(Sij, theta, i, j) { + var N = Sij.length; + var c = Math.cos(theta); + var s = Math.sin(theta); + var Ski = Array(N).fill(0); + var Skj = Array(N).fill(0); + for (var k = 0; k < N; k++) { + Ski[k] = c * Sij[k][i] - s * Sij[k][j]; + Skj[k] = s * Sij[k][i] + c * Sij[k][j]; + } + for (var _k = 0; _k < N; _k++) { + Sij[_k][i] = Ski[_k]; + Sij[_k][j] = Skj[_k]; + } + return Sij; + } + // update eigvec for overlap + function Sij1Big(Sij, theta, i, j) { + var N = Sij.length; + var c = cos(theta); + var s = sin(theta); + var Ski = Array(N).fill(bignumber(0)); + var Skj = Array(N).fill(bignumber(0)); + for (var k = 0; k < N; k++) { + Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j])); + Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j])); + } + for (var _k2 = 0; _k2 < N; _k2++) { + Sij[_k2][i] = Ski[_k2]; + Sij[_k2][j] = Skj[_k2]; + } + return Sij; + } + + // update matrix + function x1Big(Hij, theta, i, j) { + var N = Hij.length; + var c = bignumber(cos(theta)); + var s = bignumber(sin(theta)); + var c2 = multiplyScalar(c, c); + var s2 = multiplyScalar(s, s); + var Aki = Array(N).fill(bignumber(0)); + var Akj = Array(N).fill(bignumber(0)); + // 2cs Hij + var csHij = multiply(bignumber(2), c, s, Hij[i][j]); + // Aii + var Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j])); + var Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j])); + // 0 to i + for (var k = 0; k < N; k++) { + Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k])); + Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k])); + } + // Modify Hij + Hij[i][i] = Aii; + Hij[j][j] = Ajj; + Hij[i][j] = bignumber(0); + Hij[j][i] = bignumber(0); + // 0 to i + for (var _k3 = 0; _k3 < N; _k3++) { + if (_k3 !== i && _k3 !== j) { + Hij[i][_k3] = Aki[_k3]; + Hij[_k3][i] = Aki[_k3]; + Hij[j][_k3] = Akj[_k3]; + Hij[_k3][j] = Akj[_k3]; + } + } + return Hij; + } + + // update matrix + function x1(Hij, theta, i, j) { + var N = Hij.length; + var c = Math.cos(theta); + var s = Math.sin(theta); + var c2 = c * c; + var s2 = s * s; + var Aki = Array(N).fill(0); + var Akj = Array(N).fill(0); + // Aii + var Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j]; + var Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j]; + // 0 to i + for (var k = 0; k < N; k++) { + Aki[k] = c * Hij[i][k] - s * Hij[j][k]; + Akj[k] = s * Hij[i][k] + c * Hij[j][k]; + } + // Modify Hij + Hij[i][i] = Aii; + Hij[j][j] = Ajj; + Hij[i][j] = 0; + Hij[j][i] = 0; + // 0 to i + for (var _k4 = 0; _k4 < N; _k4++) { + if (_k4 !== i && _k4 !== j) { + Hij[i][_k4] = Aki[_k4]; + Hij[_k4][i] = Aki[_k4]; + Hij[j][_k4] = Akj[_k4]; + Hij[_k4][j] = Akj[_k4]; + } + } + return Hij; + } + + // get max off-diagonal value from Upper Diagonal + function getAij(Mij) { + var N = Mij.length; + var maxMij = 0; + var maxIJ = [0, 1]; + for (var i = 0; i < N; i++) { + for (var j = i + 1; j < N; j++) { + if (Math.abs(maxMij) < Math.abs(Mij[i][j])) { + maxMij = Math.abs(Mij[i][j]); + maxIJ = [i, j]; + } + } + } + return [maxIJ, maxMij]; + } + + // get max off-diagonal value from Upper Diagonal + function getAijBig(Mij) { + var N = Mij.length; + var maxMij = 0; + var maxIJ = [0, 1]; + for (var i = 0; i < N; i++) { + for (var j = i + 1; j < N; j++) { + if (abs(maxMij) < abs(Mij[i][j])) { + maxMij = abs(Mij[i][j]); + maxIJ = [i, j]; + } + } + } + return [maxIJ, maxMij]; + } + + // sort results + function sorting(E, S, computeVectors) { + var N = E.length; + var values = Array(N); + var vecs; + if (computeVectors) { + vecs = Array(N); + for (var k = 0; k < N; k++) { + vecs[k] = Array(N); + } + } + for (var i = 0; i < N; i++) { + var minID = 0; + var minE = E[0]; + for (var j = 0; j < E.length; j++) { + if (abs(E[j]) < abs(minE)) { + minID = j; + minE = E[minID]; + } + } + values[i] = E.splice(minID, 1)[0]; + if (computeVectors) { + for (var _k5 = 0; _k5 < N; _k5++) { + vecs[i][_k5] = S[_k5][minID]; + S[_k5].splice(minID, 1); + } + } + } + if (!computeVectors) return { + values + }; + var eigenvectors = vecs.map((vector, i) => ({ + value: values[i], + vector + })); + return { + values, + eigenvectors + }; + } + return main; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/expm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/expm.js new file mode 100644 index 0000000..23a2ce9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/expm.js @@ -0,0 +1,154 @@ +import { isSparseMatrix } from '../../utils/is.js'; +import { format } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +var name = 'expm'; +var dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply']; +export var createExpm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + add, + identity, + inv, + multiply + } = _ref; + /** + * Compute the matrix exponential, expm(A) = e^A. The matrix must be square. + * Not to be confused with exp(a), which performs element-wise + * exponentiation. + * + * The exponential is calculated using the Padé approximant with scaling and + * squaring; see "Nineteen Dubious Ways to Compute the Exponential of a + * Matrix," by Moler and Van Loan. + * + * Syntax: + * + * math.expm(x) + * + * Examples: + * + * const A = [[0,2],[0,0]] + * math.expm(A) // returns [[1,2],[0,1]] + * + * See also: + * + * exp + * + * @param {Matrix} x A square Matrix + * @return {Matrix} The exponential of x + */ + return typed(name, { + Matrix: function Matrix(A) { + // Check matrix size + var size = A.size(); + if (size.length !== 2 || size[0] !== size[1]) { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + var n = size[0]; + + // Desired accuracy of the approximant (The actual accuracy + // will be affected by round-off error) + var eps = 1e-15; + + // The Padé approximant is not so accurate when the values of A + // are "large", so scale A by powers of two. Then compute the + // exponential, and square the result repeatedly according to + // the identity e^A = (e^(A/m))^m + + // Compute infinity-norm of A, ||A||, to see how "big" it is + var infNorm = infinityNorm(A); + + // Find the optimal scaling factor and number of terms in the + // Padé approximant to reach the desired accuracy + var params = findParams(infNorm, eps); + var q = params.q; + var j = params.j; + + // The Pade approximation to e^A is: + // Rqq(A) = Dqq(A) ^ -1 * Nqq(A) + // where + // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i + // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i + + // Scale A by 1 / 2^j + var Apos = multiply(A, Math.pow(2, -j)); + + // The i=0 term is just the identity matrix + var N = identity(n); + var D = identity(n); + + // Initialization (i=0) + var factor = 1; + + // Initialization (i=1) + var AposToI = Apos; // Cloning not necessary + var alternate = -1; + for (var i = 1; i <= q; i++) { + if (i > 1) { + AposToI = multiply(AposToI, Apos); + alternate = -alternate; + } + factor = factor * (q - i + 1) / ((2 * q - i + 1) * i); + N = add(N, multiply(factor, AposToI)); + D = add(D, multiply(factor * alternate, AposToI)); + } + var R = multiply(inv(D), N); + + // Square j times + for (var _i = 0; _i < j; _i++) { + R = multiply(R, R); + } + return isSparseMatrix(A) ? A.createSparseMatrix(R) : R; + } + }); + function infinityNorm(A) { + var n = A.size()[0]; + var infNorm = 0; + for (var i = 0; i < n; i++) { + var rowSum = 0; + for (var j = 0; j < n; j++) { + rowSum += abs(A.get([i, j])); + } + infNorm = Math.max(rowSum, infNorm); + } + return infNorm; + } + + /** + * Find the best parameters for the Pade approximant given + * the matrix norm and desired accuracy. Returns the first acceptable + * combination in order of increasing computational load. + */ + function findParams(infNorm, eps) { + var maxSearchSize = 30; + for (var k = 0; k < maxSearchSize; k++) { + for (var q = 0; q <= k; q++) { + var j = k - q; + if (errorEstimate(infNorm, q, j) < eps) { + return { + q, + j + }; + } + } + } + throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)'); + } + + /** + * Returns the estimated error of the Pade approximant for the given + * parameters. + */ + function errorEstimate(infNorm, q, j) { + var qfac = 1; + for (var i = 2; i <= q; i++) { + qfac *= i; + } + var twoqfac = qfac; + for (var _i2 = q + 1; _i2 <= 2 * q; _i2++) { + twoqfac *= _i2; + } + var twoqp1fac = twoqfac * (2 * q + 1); + return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/fft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/fft.js new file mode 100644 index 0000000..3036178 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/fft.js @@ -0,0 +1,128 @@ +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'fft'; +var dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2']; +export var createFft = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + addScalar, + multiplyScalar, + divideScalar, + exp, + tau, + i: I, + dotDivide, + conj, + pow, + ceil, + log2 + } = _ref; + /** + * Calculate N-dimensional Fourier transform + * + * Syntax: + * + * math.fft(arr) + * + * Examples: + * + * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]] + * + * + * See Also: + * + * ifft + * + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + return typed(name, { + Array: _ndFft, + Matrix: function Matrix(matrix) { + return matrix.create(_ndFft(matrix.valueOf()), matrix.datatype()); + } + }); + + /** + * Perform an N-dimensional Fourier transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _ndFft(arr) { + var size = arraySize(arr); + if (size.length === 1) return _fft(arr, size[0]); + // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0 + return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0); + } + + /** + * Perform an 1-dimensional Fourier transform + * + * @param {Array} arr The array + * @param {number} dim dimension of the array to perform on + * @return {Array} resulting array + */ + function _1dFft(arr, dim) { + var size = arraySize(arr); + if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1)); + if (size.length === 1) return _fft(arr); + function _transpose(arr) { + // Swap first 2 dimensions + var size = arraySize(arr); + return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j])); + } + return _transpose(_1dFft(_transpose(arr), 1)); + } + /** + * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _czt(arr) { + var n = arr.length; + var w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n)); + var chirp = []; + for (var i = 1 - n; i < n; i++) { + chirp.push(pow(w, divideScalar(pow(i, 2), 2))); + } + var N2 = pow(2, ceil(log2(n + n - 1))); + var xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)]; + var ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)]; + var fftXp = _fft(xp); + var fftIchirp = _fft(ichirp); + var fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i])); + var ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2); + var ret = []; + for (var _i = n - 1; _i < n + n - 1; _i++) { + ret.push(multiplyScalar(ifftProduct[_i], chirp[_i])); + } + return ret; + } + /** + * Perform an 1-dimensional Fourier transform + * + * @param {Array} arr The array + * @return {Array} resulting array + */ + function _fft(arr) { + var len = arr.length; + if (len === 1) return [arr[0]]; + if (len % 2 === 0) { + var ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)]; + for (var k = 0; k < len / 2; k++) { + var p = ret[k]; + var q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len)))); + ret[k] = addScalar(p, q); + ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q)); + } + return ret; + } else { + // use chirp-z transform for non-power-of-2 FFT + return _czt(arr); + } + // throw new Error('Can only calculate FFT of power-of-two size') + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/filter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/filter.js new file mode 100644 index 0000000..b3344b8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/filter.js @@ -0,0 +1,64 @@ +import { optimizeCallback } from '../../utils/optimizeCallback.js'; +import { filter, filterRegExp } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'filter'; +var dependencies = ['typed']; +export var createFilter = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Filter the items in an array or one dimensional matrix. + * + * Syntax: + * + * math.filter(x, test) + * + * Examples: + * + * function isPositive (x) { + * return x > 0 + * } + * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3] + * + * math.filter(["23", "foo", "100", "55", "bar"], /[0-9]+/) // returns ["23", "100", "55"] + * + * See also: + * + * forEach, map, sort + * + * @param {Matrix | Array} x A one dimensional matrix or array to filter + * @param {Function | RegExp} test + * A function or regular expression to test items. + * All entries for which `test` returns true are returned. + * When `test` is a function, it is invoked with three parameters: + * the value of the element, the index of the element, and the + * matrix/array being traversed. The function must return a boolean. + * @return {Matrix | Array} Returns the filtered matrix. + */ + return typed('filter', { + 'Array, function': _filterCallback, + 'Matrix, function': function Matrix_function(x, test) { + return x.create(_filterCallback(x.valueOf(), test), x.datatype()); + }, + 'Array, RegExp': filterRegExp, + 'Matrix, RegExp': function Matrix_RegExp(x, test) { + return x.create(filterRegExp(x.valueOf(), test), x.datatype()); + } + }); +}); + +/** + * Filter values in a callback given a callback function + * @param {Array} x + * @param {Function} callback + * @return {Array} Returns the filtered array + * @private + */ +function _filterCallback(x, callback) { + var fastCallback = optimizeCallback(callback, x, 'filter'); + return filter(x, function (value, index, array) { + // invoke the callback function with the right number of arguments + return fastCallback(value, [index], array); + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/flatten.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/flatten.js new file mode 100644 index 0000000..4c3689d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/flatten.js @@ -0,0 +1,38 @@ +import { flatten as flattenArray } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'flatten'; +var dependencies = ['typed']; +export var createFlatten = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Flatten a multidimensional matrix into a single dimensional matrix. + * A new matrix is returned, the original matrix is left untouched. + * + * Syntax: + * + * math.flatten(x) + * + * Examples: + * + * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4] + * + * See also: + * + * concat, resize, size, squeeze + * + * @param {Matrix | Array} x Matrix to be flattened + * @return {Matrix | Array} Returns the flattened matrix + */ + return typed(name, { + Array: function Array(x) { + return flattenArray(x); + }, + Matrix: function Matrix(x) { + // Return the same matrix type as x (Dense or Sparse Matrix) + // Return the same data type as x + return x.create(flattenArray(x.toArray()), x.datatype()); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/forEach.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/forEach.js new file mode 100644 index 0000000..1b939f0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/forEach.js @@ -0,0 +1,49 @@ +import { optimizeCallback } from '../../utils/optimizeCallback.js'; +import { factory } from '../../utils/factory.js'; +import { recurse } from '../../utils/array.js'; +var name = 'forEach'; +var dependencies = ['typed']; +export var createForEach = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Iterate over all elements of a matrix/array, and executes the given callback function. + * + * Syntax: + * + * math.forEach(x, callback) + * + * Examples: + * + * math.forEach([1, 2, 3], function(value) { + * console.log(value) + * }) + * // outputs 1, 2, 3 + * + * See also: + * + * filter, map, sort + * + * @param {Matrix | Array} x The matrix to iterate on. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix/array being traversed. + */ + return typed(name, { + 'Array, function': _forEach, + 'Matrix, function': function Matrix_function(x, callback) { + x.forEach(callback); + } + }); +}); + +/** + * forEach for a multidimensional array + * @param {Array} array + * @param {Function} callback + * @private + */ +function _forEach(array, callback) { + recurse(array, [], array, optimizeCallback(callback, array, name)); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js new file mode 100644 index 0000000..5bc7862 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js @@ -0,0 +1,52 @@ +import { factory } from '../../utils/factory.js'; +import { getArrayDataType } from '../../utils/array.js'; +import { typeOf } from '../../utils/is.js'; +var name = 'getMatrixDataType'; +var dependencies = ['typed']; +export var createGetMatrixDataType = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Find the data type of all elements in a matrix or array, + * for example 'number' if all items are a number and 'Complex' if all values + * are complex numbers. + * If a matrix contains more than one data type, it will return 'mixed'. + * + * Syntax: + * + * math.getMatrixDataType(x) + * + * Examples: + * + * const x = [ [1, 2, 3], [4, 5, 6] ] + * const mixedX = [ [1, true], [2, 3] ] + * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ] + * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ] + * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ] + * const sparse = math.sparse(x) + * const dense = math.matrix(x) + * math.getMatrixDataType(x) // returns 'number' + * math.getMatrixDataType(sparse) // returns 'number' + * math.getMatrixDataType(dense) // returns 'number' + * math.getMatrixDataType(mixedX) // returns 'mixed' + * math.getMatrixDataType(fractionX) // returns 'Fraction' + * math.getMatrixDataType(unitX) // returns 'Unit' + * math.getMatrixDataType(bigNumberX) // return 'BigNumber' + * + * See also: + * SparseMatrix, DenseMatrix + * + * @param {...Matrix | Array} x The Matrix with values. + * + * @return {string} A string representation of the matrix type + */ + return typed(name, { + Array: function Array(x) { + return getArrayDataType(x, typeOf); + }, + Matrix: function Matrix(x) { + return x.getDataType(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/identity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/identity.js new file mode 100644 index 0000000..8211793 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/identity.js @@ -0,0 +1,136 @@ +import { isBigNumber } from '../../utils/is.js'; +import { resize } from '../../utils/array.js'; +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'identity'; +var dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix']; +export var createIdentity = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + BigNumber, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a 2-dimensional identity matrix with size m x n or n x n. + * The matrix has ones on the diagonal and zeros elsewhere. + * + * Syntax: + * + * math.identity(n) + * math.identity(n, format) + * math.identity(m, n) + * math.identity(m, n, format) + * math.identity([m, n]) + * math.identity([m, n], format) + * + * Examples: + * + * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]] + * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]] + * + * See also: + * + * diag, ones, zeros, size, range + * + * @param {...number | Matrix | Array} size The size for the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Matrix | Array | number} A matrix with ones on the diagonal. + */ + return typed(name, { + '': function _() { + return config.matrix === 'Matrix' ? matrix([]) : []; + }, + string: function string(format) { + return matrix(format); + }, + 'number | BigNumber': function number__BigNumber(rows) { + return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber, string': function number__BigNumber_string(rows, format) { + return _identity(rows, rows, format); + }, + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(rows, cols) { + return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber, number | BigNumber, string': function number__BigNumber_number__BigNumber_string(rows, cols, format) { + return _identity(rows, cols, format); + }, + Array: function Array(size) { + return _identityVector(size); + }, + 'Array, string': function Array_string(size, format) { + return _identityVector(size, format); + }, + Matrix: function Matrix(size) { + return _identityVector(size.valueOf(), size.storage()); + }, + 'Matrix, string': function Matrix_string(size, format) { + return _identityVector(size.valueOf(), format); + } + }); + function _identityVector(size, format) { + switch (size.length) { + case 0: + return format ? matrix(format) : []; + case 1: + return _identity(size[0], size[0], format); + case 2: + return _identity(size[0], size[1], format); + default: + throw new Error('Vector containing two values expected'); + } + } + + /** + * Create an identity matrix + * @param {number | BigNumber} rows + * @param {number | BigNumber} cols + * @param {string} [format] + * @returns {Matrix} + * @private + */ + function _identity(rows, cols, format) { + // BigNumber constructor with the right precision + var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null; + if (isBigNumber(rows)) rows = rows.toNumber(); + if (isBigNumber(cols)) cols = cols.toNumber(); + if (!isInteger(rows) || rows < 1) { + throw new Error('Parameters in function identity must be positive integers'); + } + if (!isInteger(cols) || cols < 1) { + throw new Error('Parameters in function identity must be positive integers'); + } + var one = Big ? new BigNumber(1) : 1; + var defaultValue = Big ? new Big(0) : 0; + var size = [rows, cols]; + + // check we need to return a matrix + if (format) { + // create diagonal matrix (use optimized implementation for storage format) + if (format === 'sparse') { + return SparseMatrix.diagonal(size, one, 0, defaultValue); + } + if (format === 'dense') { + return DenseMatrix.diagonal(size, one, 0, defaultValue); + } + throw new TypeError("Unknown matrix type \"".concat(format, "\"")); + } + + // create and resize array + var res = resize([], size, defaultValue); + // fill in ones on the diagonal + var minimum = rows < cols ? rows : cols; + // fill diagonal + for (var d = 0; d < minimum; d++) { + res[d][d] = one; + } + return res; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ifft.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ifft.js new file mode 100644 index 0000000..b5c8101 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ifft.js @@ -0,0 +1,37 @@ +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +var name = 'ifft'; +var dependencies = ['typed', 'fft', 'dotDivide', 'conj']; +export var createIfft = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + fft, + dotDivide, + conj + } = _ref; + /** + * Calculate N-dimensional inverse Fourier transform + * + * Syntax: + * + * math.ifft(arr) + * + * Examples: + * + * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]] + * + * See Also: + * + * fft + * + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(arr) { + var size = isMatrix(arr) ? arr.size() : arraySize(arr); + return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/inv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/inv.js new file mode 100644 index 0000000..9aab431 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/inv.js @@ -0,0 +1,184 @@ +import { isMatrix } from '../../utils/is.js'; +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { format } from '../../utils/string.js'; +var name = 'inv'; +var dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs']; +export var createInv = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divideScalar, + addScalar, + multiply, + unaryMinus, + det, + identity, + abs + } = _ref; + /** + * Calculate the inverse of a square matrix. + * + * Syntax: + * + * math.inv(x) + * + * Examples: + * + * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]] + * math.inv(4) // returns 0.25 + * 1 / 4 // returns 0.25 + * + * See also: + * + * det, transpose + * + * @param {number | Complex | Array | Matrix} x Matrix to be inversed + * @return {number | Complex | Array | Matrix} The inverse of `x`. + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(x) { + var size = isMatrix(x) ? x.size() : arraySize(x); + switch (size.length) { + case 1: + // vector + if (size[0] === 1) { + if (isMatrix(x)) { + return matrix([divideScalar(1, x.valueOf()[0])]); + } else { + return [divideScalar(1, x[0])]; + } + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + case 2: + // two dimensional array + { + var rows = size[0]; + var cols = size[1]; + if (rows === cols) { + if (isMatrix(x)) { + return matrix(_inv(x.valueOf(), rows, cols), x.storage()); + } else { + // return an Array + return _inv(x, rows, cols); + } + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')'); + } + }, + any: function any(x) { + // scalar + return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers + } + }); + + /** + * Calculate the inverse of a square matrix + * @param {Array[]} mat A square matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns, must equal rows + * @return {Array[]} inv Inverse matrix + * @private + */ + function _inv(mat, rows, cols) { + var r, s, f, value, temp; + if (rows === 1) { + // this is a 1 x 1 matrix + value = mat[0][0]; + if (value === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + return [[divideScalar(1, value)]]; + } else if (rows === 2) { + // this is a 2 x 2 matrix + var d = det(mat); + if (d === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]]; + } else { + // this is a matrix of 3 x 3 or larger + // calculate inverse using gauss-jordan elimination + // https://en.wikipedia.org/wiki/Gaussian_elimination + // http://mathworld.wolfram.com/MatrixInverse.html + // http://math.uww.edu/~mcfarlat/inverse.htm + + // make a copy of the matrix (only the arrays, not of the elements) + var A = mat.concat(); + for (r = 0; r < rows; r++) { + A[r] = A[r].concat(); + } + + // create an identity matrix which in the end will contain the + // matrix inverse + var B = identity(rows).valueOf(); + + // loop over all columns, and perform row reductions + for (var c = 0; c < cols; c++) { + // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c] + var ABig = abs(A[c][c]); + var rBig = c; + r = c + 1; + while (r < rows) { + if (abs(A[r][c]) > ABig) { + ABig = abs(A[r][c]); + rBig = r; + } + r++; + } + if (ABig === 0) { + throw Error('Cannot calculate inverse, determinant is zero'); + } + r = rBig; + if (r !== c) { + temp = A[c]; + A[c] = A[r]; + A[r] = temp; + temp = B[c]; + B[c] = B[r]; + B[r] = temp; + } + + // eliminate non-zero values on the other rows at column c + var Ac = A[c]; + var Bc = B[c]; + for (r = 0; r < rows; r++) { + var Ar = A[r]; + var Br = B[r]; + if (r !== c) { + // eliminate value at column c and row r + if (Ar[c] !== 0) { + f = divideScalar(unaryMinus(Ar[c]), Ac[c]); + + // add (f * row c) to row r to eliminate the value + // at column c + for (s = c; s < cols; s++) { + Ar[s] = addScalar(Ar[s], multiply(f, Ac[s])); + } + for (s = 0; s < cols; s++) { + Br[s] = addScalar(Br[s], multiply(f, Bc[s])); + } + } + } else { + // normalize value at Acc to 1, + // divide each value on row r with the value at Acc + f = Ac[c]; + for (s = c; s < cols; s++) { + Ar[s] = divideScalar(Ar[s], f); + } + for (s = 0; s < cols; s++) { + Br[s] = divideScalar(Br[s], f); + } + } + } + } + return B; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/kron.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/kron.js new file mode 100644 index 0000000..6e7ae27 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/kron.js @@ -0,0 +1,85 @@ +import { arraySize as size } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'kron'; +var dependencies = ['typed', 'matrix', 'multiplyScalar']; +export var createKron = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + multiplyScalar + } = _ref; + /** + * Calculates the Kronecker product of 2 matrices or vectors. + * + * NOTE: If a one dimensional vector / matrix is given, it will be + * wrapped so its two dimensions. + * See the examples. + * + * Syntax: + * + * math.kron(x, y) + * + * Examples: + * + * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]]) + * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ] + * + * math.kron([1,1], [2,3,4]) + * // returns [ [ 2, 3, 4, 2, 3, 4 ] ] + * + * See also: + * + * multiply, dot, cross + * + * @param {Array | Matrix} x First vector + * @param {Array | Matrix} y Second vector + * @return {Array | Matrix} Returns the Kronecker product of `x` and `y` + */ + return typed(name, { + 'Matrix, Matrix': function Matrix_Matrix(x, y) { + return matrix(_kron(x.toArray(), y.toArray())); + }, + 'Matrix, Array': function Matrix_Array(x, y) { + return matrix(_kron(x.toArray(), y)); + }, + 'Array, Matrix': function Array_Matrix(x, y) { + return matrix(_kron(x, y.toArray())); + }, + 'Array, Array': _kron + }); + + /** + * Calculate the Kronecker product of two matrices / vectors + * @param {Array} a First vector + * @param {Array} b Second vector + * @returns {Array} Returns the Kronecker product of x and y + * @private + */ + function _kron(a, b) { + // Deal with the dimensions of the matricies. + if (size(a).length === 1) { + // Wrap it in a 2D Matrix + a = [a]; + } + if (size(b).length === 1) { + // Wrap it in a 2D Matrix + b = [b]; + } + if (size(a).length > 2 || size(b).length > 2) { + throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')'); + } + var t = []; + var r = []; + return a.map(function (a) { + return b.map(function (b) { + r = []; + t.push(r); + return a.map(function (y) { + return b.map(function (x) { + return r.push(multiplyScalar(y, x)); + }); + }); + }); + }) && t; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/map.js new file mode 100644 index 0000000..cafd03c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/map.js @@ -0,0 +1,142 @@ +import { optimizeCallback } from '../../utils/optimizeCallback.js'; +import { arraySize, broadcastSizes, broadcastTo, get, recurse } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'map'; +var dependencies = ['typed']; +export var createMap = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Create a new matrix or array with the results of a callback function executed on + * each entry of a given matrix/array. + * + * For each entry of the input, + * + * the callback is invoked with 2N + 1 arguments: + * the N values of the entry, the index at which that entry occurs, and the N full + * broadcasted matrix/array being traversed where N is the number of matrices being traversed. + * Note that because the matrix/array might be + * multidimensional, the "index" argument is always an array of numbers giving + * the index in each dimension. This is true even for vectors: the "index" + * argument is an array of length 1, rather than simply a number. + * + * Syntax: + * + * math.map(x, callback) + * math.map(x, y, ..., callback) + * + * Examples: + * + * math.map([1, 2, 3], function(value) { + * return value * value + * }) // returns [1, 4, 9] + * math.map([1, 2], [3, 4], function(a, b) { + * return a + b + * }) // returns [4, 6] + * + * // The callback is normally called with three arguments: + * // callback(value, index, Array) + * // If you want to call with only one argument, use: + * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3'] + * // It can also be called with 2N + 1 arguments: for N arrays + * // callback(value1, value2, index, BroadcastedArray1, BroadcastedArray2) + * + * See also: + * + * filter, forEach, sort + * + * @param {Matrix | Array} x The input to iterate on. + * @param {Function} callback + * The function to call (as described above) on each entry of the input + * @return {Matrix | array} + * Transformed map of x; always has the same type and shape as x + */ + return typed(name, { + 'Array, function': _mapArray, + 'Matrix, function': function Matrix_function(x, callback) { + return x.map(callback); + }, + 'Array|Matrix, Array|Matrix, ...Array|Matrix|function': (A, B, rest) => _mapMultiple([A, B, ...rest.slice(0, rest.length - 1)], rest[rest.length - 1]) + }); + + /** + * Maps over multiple arrays or matrices. + * + * @param {Array} Arrays - An array of arrays or matrices to map over. + * @param {function} multiCallback - The callback function to apply to each element. + * @throws {Error} If the last argument is not a callback function. + * @returns {Array|Matrix} A new array or matrix with each element being the result of the callback function. + * + * @example + * _mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9] + */ + function _mapMultiple(Arrays, multiCallback) { + if (typeof multiCallback !== 'function') { + throw new Error('Last argument must be a callback function'); + } + var firstArrayIsMatrix = Arrays[0].isMatrix; + var newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M))); + var _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : get; + var broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create(broadcastTo(M.toArray(), newSize), M.datatype()) : Arrays[0].create(broadcastTo(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? broadcastTo(M.toArray(), newSize) : broadcastTo(M, newSize)); + var callback; + if (typed.isTypedFunction(multiCallback)) { + var firstIndex = newSize.map(() => 0); + var firstValues = broadcastedArrays.map(array => _get(array, firstIndex)); + var callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays); + callback = _getLimitedCallback(callbackCase); + } else { + var numberOfArrays = Arrays.length; + var _callbackCase = _getCallbackCase(multiCallback, numberOfArrays); + callback = _getLimitedCallback(_callbackCase); + } + var broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))], idx); + if (firstArrayIsMatrix) { + return broadcastedArrays[0].map(broadcastedArraysCallback); + } else { + return _mapArray(broadcastedArrays[0], broadcastedArraysCallback); + } + function _getLimitedCallback(callbackCase) { + switch (callbackCase) { + case 0: + return x => multiCallback(...x); + case 1: + return (x, idx) => multiCallback(...x, idx); + case 2: + return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays); + } + } + function _getCallbackCase(callback, numberOfArrays) { + if (callback.length > numberOfArrays + 1) { + return 2; + } + if (callback.length === numberOfArrays + 1) { + return 1; + } + return 0; + } + function _getTypedCallbackCase(callback, values, idx, arrays) { + if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) { + return 2; + } + if (typed.resolve(callback, [...values, idx]) !== null) { + return 1; + } + if (typed.resolve(callback, values) !== null) { + return 0; + } + // this should never happen + return 0; + } + } + /** + * Map for a multi dimensional array + * @param {Array} array + * @param {Function} callback + * @return {Array} + * @private + */ + function _mapArray(array, callback) { + return recurse(array, [], array, optimizeCallback(callback, array, name)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js new file mode 100644 index 0000000..8a0e9ea --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js @@ -0,0 +1,88 @@ +import { factory } from '../../utils/factory.js'; +var name = 'matrixFromColumns'; +var dependencies = ['typed', 'matrix', 'flatten', 'size']; +export var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + flatten, + size + } = _ref; + /** + * Create a dense matrix from vectors as individual columns. + * If you pass row vectors, they will be transposed (but not conjugated!) + * + * Syntax: + * + * math.matrixFromColumns(...arr) + * math.matrixFromColumns(col1, col2) + * math.matrixFromColumns(col1, col2, col3) + * + * Examples: + * + * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]]) + * math.matrixFromColumns(...vectors) + * + * See also: + * + * matrix, matrixFromRows, matrixFromFunction, zeros + * + * @param {... Array | Matrix} cols Multiple columns + * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned + */ + return typed(name, { + '...Array': function Array(arr) { + return _createArray(arr); + }, + '...Matrix': function Matrix(arr) { + return matrix(_createArray(arr.map(m => m.toArray()))); + } + + // TODO implement this properly for SparseMatrix + }); + function _createArray(arr) { + if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.'); + var N = checkVectorTypeAndReturnLength(arr[0]); + + // create an array with empty rows + var result = []; + for (var i = 0; i < N; i++) { + result[i] = []; + } + + // loop columns + for (var col of arr) { + var colLength = checkVectorTypeAndReturnLength(col); + if (colLength !== N) { + throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (colLength | 0)); + } + var f = flatten(col); + + // push a value to each row + for (var _i = 0; _i < N; _i++) { + result[_i].push(f[_i]); + } + } + return result; + } + function checkVectorTypeAndReturnLength(vec) { + var s = size(vec); + if (s.length === 1) { + // 1D vector + return s[0]; + } else if (s.length === 2) { + // 2D vector + if (s[0] === 1) { + // row vector + return s[1]; + } else if (s[1] === 1) { + // col vector + return s[0]; + } else { + throw new TypeError('At least one of the arguments is not a vector.'); + } + } else { + throw new TypeError('Only one- or two-dimensional vectors are supported.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js new file mode 100644 index 0000000..349301d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js @@ -0,0 +1,74 @@ +import { factory } from '../../utils/factory.js'; +var name = 'matrixFromFunction'; +var dependencies = ['typed', 'matrix', 'isZero']; +export var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + isZero + } = _ref; + /** + * Create a matrix by evaluating a generating function at each index. + * The simplest overload returns a multi-dimensional array as long as `size` is an array. + * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix. + * + * Syntax: + * + * math.matrixFromFunction(size, fn) + * math.matrixFromFunction(size, fn, format) + * math.matrixFromFunction(size, fn, format, datatype) + * math.matrixFromFunction(size, format, fn) + * math.matrixFromFunction(size, format, datatype, fn) + * + * Examples: + * + * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix + * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix + * math.matrixFromFunction([5], i => math.random()) // a random vector + * + * See also: + * + * matrix, zeros + * + * @param {Array | Matrix} size The size of the matrix to be created + * @param {function} fn Callback function invoked for every entry in the matrix + * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'` + * @param {string} [datatype] Type of the values + * @return {Array | Matrix} Returns the created matrix + */ + return typed(name, { + 'Array | Matrix, function, string, string': function Array__Matrix_function_string_string(size, fn, format, datatype) { + return _create(size, fn, format, datatype); + }, + 'Array | Matrix, function, string': function Array__Matrix_function_string(size, fn, format) { + return _create(size, fn, format); + }, + 'Matrix, function': function Matrix_function(size, fn) { + return _create(size, fn, 'dense'); + }, + 'Array, function': function Array_function(size, fn) { + return _create(size, fn, 'dense').toArray(); + }, + 'Array | Matrix, string, function': function Array__Matrix_string_function(size, format, fn) { + return _create(size, fn, format); + }, + 'Array | Matrix, string, string, function': function Array__Matrix_string_string_function(size, format, datatype, fn) { + return _create(size, fn, format, datatype); + } + }); + function _create(size, fn, format, datatype) { + var m; + if (datatype !== undefined) { + m = matrix(format, datatype); + } else { + m = matrix(format); + } + m.resize(size); + m.forEach(function (_, index) { + var val = fn(index); + if (isZero(val)) return; + m.set(index, val); + }); + return m; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js new file mode 100644 index 0000000..33e9b97 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js @@ -0,0 +1,76 @@ +import { factory } from '../../utils/factory.js'; +var name = 'matrixFromRows'; +var dependencies = ['typed', 'matrix', 'flatten', 'size']; +export var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + flatten, + size + } = _ref; + /** + * Create a dense matrix from vectors as individual rows. + * If you pass column vectors, they will be transposed (but not conjugated!) + * + * Syntax: + * + * math.matrixFromRows(...arr) + * math.matrixFromRows(row1, row2) + * math.matrixFromRows(row1, row2, row3) + * + * Examples: + * + * math.matrixFromRows([1, 2, 3], [[4],[5],[6]]) + * math.matrixFromRows(...vectors) + * + * See also: + * + * matrix, matrixFromColumns, matrixFromFunction, zeros + * + * @param {... Array | Matrix} rows Multiple rows + * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned + */ + return typed(name, { + '...Array': function Array(arr) { + return _createArray(arr); + }, + '...Matrix': function Matrix(arr) { + return matrix(_createArray(arr.map(m => m.toArray()))); + } + + // TODO implement this properly for SparseMatrix + }); + function _createArray(arr) { + if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.'); + var N = checkVectorTypeAndReturnLength(arr[0]); + var result = []; + for (var row of arr) { + var rowLength = checkVectorTypeAndReturnLength(row); + if (rowLength !== N) { + throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (rowLength | 0)); + } + result.push(flatten(row)); + } + return result; + } + function checkVectorTypeAndReturnLength(vec) { + var s = size(vec); + if (s.length === 1) { + // 1D vector + return s[0]; + } else if (s.length === 2) { + // 2D vector + if (s[0] === 1) { + // row vector + return s[1]; + } else if (s[1] === 1) { + // col vector + return s[0]; + } else { + throw new TypeError('At least one of the arguments is not a vector.'); + } + } else { + throw new TypeError('Only one- or two-dimensional vectors are supported.'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ones.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ones.js new file mode 100644 index 0000000..c836440 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/ones.js @@ -0,0 +1,123 @@ +import { isBigNumber } from '../../utils/is.js'; +import { isInteger } from '../../utils/number.js'; +import { resize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'ones'; +var dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +export var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Create a matrix filled with ones. The created matrix can have one or + * multiple dimensions. + * + * Syntax: + * + * math.ones(m) + * math.ones(m, format) + * math.ones(m, n) + * math.ones(m, n, format) + * math.ones([m, n]) + * math.ones([m, n], format) + * math.ones([m, n, p, ...]) + * math.ones([m, n, p, ...], format) + * + * Examples: + * + * math.ones() // returns [] + * math.ones(3) // returns [1, 1, 1] + * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]] + * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]] + * + * See also: + * + * zeros, identity, size, range + * + * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Array | Matrix | number} A matrix filled with ones + */ + return typed('ones', { + '': function _() { + return config.matrix === 'Array' ? _ones([]) : _ones([], 'default'); + }, + // math.ones(m, n, p, ..., format) + // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this + '...number | BigNumber | string': function number__BigNumber__string(size) { + var last = size[size.length - 1]; + if (typeof last === 'string') { + var format = size.pop(); + return _ones(size, format); + } else if (config.matrix === 'Array') { + return _ones(size); + } else { + return _ones(size, 'default'); + } + }, + Array: _ones, + Matrix: function Matrix(size) { + var format = size.storage(); + return _ones(size.valueOf(), format); + }, + 'Array | Matrix, string': function Array__Matrix_string(size, format) { + return _ones(size.valueOf(), format); + } + }); + + /** + * Create an Array or Matrix with ones + * @param {Array} size + * @param {string} [format='default'] + * @return {Array | Matrix} + * @private + */ + function _ones(size, format) { + var hasBigNumbers = _normalize(size); + var defaultValue = hasBigNumbers ? new BigNumber(1) : 1; + _validate(size); + if (format) { + // return a matrix + var m = matrix(format); + if (size.length > 0) { + return m.resize(size, defaultValue); + } + return m; + } else { + // return an Array + var arr = []; + if (size.length > 0) { + return resize(arr, size, defaultValue); + } + return arr; + } + } + + // replace BigNumbers with numbers, returns true if size contained BigNumbers + function _normalize(size) { + var hasBigNumbers = false; + size.forEach(function (value, index, arr) { + if (isBigNumber(value)) { + hasBigNumbers = true; + arr[index] = value.toNumber(); + } + }); + return hasBigNumbers; + } + + // validate arguments + function _validate(size) { + size.forEach(function (value) { + if (typeof value !== 'number' || !isInteger(value) || value < 0) { + throw new Error('Parameters in function ones must be positive integers'); + } + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js new file mode 100644 index 0000000..d7ecf86 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js @@ -0,0 +1,143 @@ +import { isMatrix } from '../../utils/is.js'; +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'partitionSelect'; +var dependencies = ['typed', 'isNumeric', 'isNaN', 'compare']; +export var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isNumeric, + isNaN, + compare + } = _ref; + var asc = compare; + var desc = (a, b) => -compare(a, b); + + /** + * Partition-based selection of an array or 1D matrix. + * Will find the kth smallest value, and mutates the input array. + * Uses Quickselect. + * + * Syntax: + * + * math.partitionSelect(x, k) + * math.partitionSelect(x, k, compare) + * + * Examples: + * + * math.partitionSelect([5, 10, 1], 2) // returns 10 + * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B' + * + * function sortByLength (a, b) { + * return a.length - b.length + * } + * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon' + * + * // the input array is mutated + * arr = [5, 2, 1] + * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5] + * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1] + * + * See also: + * + * sort + * + * @param {Matrix | Array} x A one dimensional matrix or array to sort + * @param {Number} k The kth smallest value to be retrieved zero-based index + * @param {Function | 'asc' | 'desc'} [compare='asc'] + * An optional comparator function. The function is called as + * `compare(a, b)`, and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. + * @return {*} Returns the kth lowest value. + */ + return typed(name, { + 'Array | Matrix, number': function Array__Matrix_number(x, k) { + return _partitionSelect(x, k, asc); + }, + 'Array | Matrix, number, string': function Array__Matrix_number_string(x, k, compare) { + if (compare === 'asc') { + return _partitionSelect(x, k, asc); + } else if (compare === 'desc') { + return _partitionSelect(x, k, desc); + } else { + throw new Error('Compare string must be "asc" or "desc"'); + } + }, + 'Array | Matrix, number, function': _partitionSelect + }); + function _partitionSelect(x, k, compare) { + if (!isInteger(k) || k < 0) { + throw new Error('k must be a non-negative integer'); + } + if (isMatrix(x)) { + var size = x.size(); + if (size.length > 1) { + throw new Error('Only one dimensional matrices supported'); + } + return quickSelect(x.valueOf(), k, compare); + } + if (Array.isArray(x)) { + return quickSelect(x, k, compare); + } + } + + /** + * Quickselect algorithm. + * Code adapted from: + * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html + * + * @param {Array} arr + * @param {Number} k + * @param {Function} compare + * @private + */ + function quickSelect(arr, k, compare) { + if (k >= arr.length) { + throw new Error('k out of bounds'); + } + + // check for NaN values since these can cause an infinite while loop + for (var i = 0; i < arr.length; i++) { + if (isNumeric(arr[i]) && isNaN(arr[i])) { + return arr[i]; // return NaN + } + } + var from = 0; + var to = arr.length - 1; + + // if from == to we reached the kth element + while (from < to) { + var r = from; + var w = to; + var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]; + + // stop if the reader and writer meets + while (r < w) { + // arr[r] >= pivot + if (compare(arr[r], pivot) >= 0) { + // put the large values at the end + var tmp = arr[w]; + arr[w] = arr[r]; + arr[r] = tmp; + --w; + } else { + // the value is smaller than the pivot, skip + ++r; + } + } + + // if we stepped up (r++) we need to step one down (arr[r] > pivot) + if (compare(arr[r], pivot) > 0) { + --r; + } + + // the r pointer is on the end of the first k elements + if (k <= r) { + to = r; + } else { + from = r + 1; + } + } + return arr[k]; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/pinv.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/pinv.js new file mode 100644 index 0000000..de4b3b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/pinv.js @@ -0,0 +1,179 @@ +import { isMatrix } from '../../utils/is.js'; +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { format } from '../../utils/string.js'; +import { clone } from '../../utils/object.js'; +var name = 'pinv'; +var dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex']; +export var createPinv = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + inv, + deepEqual, + equal, + dotDivide, + dot, + ctranspose, + divideScalar, + multiply, + add, + Complex + } = _ref; + /** + * Calculate the Moore–Penrose inverse of a matrix. + * + * Syntax: + * + * math.pinv(x) + * + * Examples: + * + * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]] + * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]] + * math.pinv(4) // returns 0.25 + * + * See also: + * + * inv + * + * @param {number | Complex | Array | Matrix} x Matrix to be inversed + * @return {number | Complex | Array | Matrix} The inverse of `x`. + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(x) { + var size = isMatrix(x) ? x.size() : arraySize(x); + switch (size.length) { + case 1: + // vector + if (_isZeros(x)) return ctranspose(x); // null vector + if (size[0] === 1) { + return inv(x); // invertible matrix + } else { + return dotDivide(ctranspose(x), dot(x, x)); + } + case 2: + // two dimensional array + { + if (_isZeros(x)) return ctranspose(x); // zero matrixx + var rows = size[0]; + var cols = size[1]; + if (rows === cols) { + try { + return inv(x); // invertible matrix + } catch (err) { + if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) { + // Expected + } else { + throw err; + } + } + } + if (isMatrix(x)) { + return matrix(_pinv(x.valueOf(), rows, cols), x.storage()); + } else { + // return an Array + return _pinv(x, rows, cols); + } + } + default: + // multi dimensional array + throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')'); + } + }, + any: function any(x) { + // scalar + if (equal(x, 0)) return clone(x); // zero + return divideScalar(1, x); + } + }); + + /** + * Calculate the Moore–Penrose inverse of a matrix + * @param {Array[]} mat A matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {Array[]} pinv Pseudoinverse matrix + * @private + */ + function _pinv(mat, rows, cols) { + var { + C, + F + } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision) + var Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C)); + var Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F)))); + return multiply(Fpinv, Cpinv); + } + + /** + * Calculate the reduced row echelon form of a matrix + * + * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form + * + * @param {Array[]} mat A matrix + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {Array[]} Reduced row echelon form + * @private + */ + function _rref(mat, rows, cols) { + var M = clone(mat); + var lead = 0; + for (var r = 0; r < rows; r++) { + if (cols <= lead) { + return M; + } + var i = r; + while (_isZero(M[i][lead])) { + i++; + if (rows === i) { + i = r; + lead++; + if (cols === lead) { + return M; + } + } + } + [M[i], M[r]] = [M[r], M[i]]; + var val = M[r][lead]; + for (var j = 0; j < cols; j++) { + M[r][j] = dotDivide(M[r][j], val); + } + for (var _i = 0; _i < rows; _i++) { + if (_i === r) continue; + val = M[_i][lead]; + for (var _j = 0; _j < cols; _j++) { + M[_i][_j] = add(M[_i][_j], multiply(-1, multiply(val, M[r][_j]))); + } + } + lead++; + } + return M; + } + + /** + * Calculate the rank factorization of a matrix + * + * @param {Array[]} mat A matrix (M) + * @param {number} rows Number of rows + * @param {number} cols Number of columns + * @return {{C: Array, F: Array}} rank factorization where M = C F + * @private + */ + function _rankFact(mat, rows, cols) { + var rref = _rref(mat, rows, cols); + var C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j])))); + var F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i]))); + return { + C, + F + }; + } + function _isZero(x) { + return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1))); + } + function _isZeros(arr) { + return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1))); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/range.js new file mode 100644 index 0000000..06e6eb5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/range.js @@ -0,0 +1,182 @@ +import { factory } from '../../utils/factory.js'; +import { noBignumber, noMatrix } from '../../utils/noop.js'; +var name = 'range'; +var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive']; +export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + bignumber, + smaller, + smallerEq, + larger, + largerEq, + add, + isPositive + } = _ref; + /** + * Create an array from a range. + * By default, the range end is excluded. This can be customized by providing + * an extra parameter `includeEnd`. + * + * Syntax: + * + * math.range(str [, includeEnd]) // Create a range from a string, + * // where the string contains the + * // start, optional step, and end, + * // separated by a colon. + * math.range(start, end [, includeEnd]) // Create a range with start and + * // end and a step size of 1. + * math.range(start, end, step [, includeEnd]) // Create a range with start, step, + * // and end. + * + * Where: + * + * - `str: string` + * A string 'start:end' or 'start:step:end' + * - `start: {number | BigNumber | Unit}` + * Start of the range + * - `end: number | BigNumber | Unit` + * End of the range, excluded by default, included when parameter includeEnd=true + * - `step: number | BigNumber | Unit` + * Step size. Default value is 1. + * - `includeEnd: boolean` + * Option to specify whether to include the end or not. False by default. + * + * Examples: + * + * math.range(2, 6) // [2, 3, 4, 5] + * math.range(2, -3, -1) // [2, 1, 0, -1, -2] + * math.range('2:1:6') // [2, 3, 4, 5] + * math.range(2, 6, true) // [2, 3, 4, 5, 6] + * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m] + * + * See also: + * + * ones, zeros, size, subset + * + * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`. + * @return {Array | Matrix} range + */ + return typed(name, { + // TODO: simplify signatures when typed-function supports default values and optional arguments + + // TODO: a number or boolean should not be converted to string here + string: _strRange, + 'string, boolean': _strRange, + 'number, number': function number_number(start, end) { + return _out(_range(start, end, 1, false)); + }, + 'number, number, number': function number_number_number(start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'number, number, boolean': function number_number_boolean(start, end, includeEnd) { + return _out(_range(start, end, 1, includeEnd)); + }, + 'number, number, number, boolean': function number_number_number_boolean(start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(start, end) { + var BigNumber = start.constructor; + return _out(_range(start, end, new BigNumber(1), false)); + }, + 'BigNumber, BigNumber, BigNumber': function BigNumber_BigNumber_BigNumber(start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'BigNumber, BigNumber, boolean': function BigNumber_BigNumber_boolean(start, end, includeEnd) { + var BigNumber = start.constructor; + return _out(_range(start, end, new BigNumber(1), includeEnd)); + }, + 'BigNumber, BigNumber, BigNumber, boolean': function BigNumber_BigNumber_BigNumber_boolean(start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + }, + 'Unit, Unit, Unit': function Unit_Unit_Unit(start, end, step) { + return _out(_range(start, end, step, false)); + }, + 'Unit, Unit, Unit, boolean': function Unit_Unit_Unit_boolean(start, end, step, includeEnd) { + return _out(_range(start, end, step, includeEnd)); + } + }); + function _out(arr) { + if (config.matrix === 'Matrix') { + return matrix ? matrix(arr) : noMatrix(); + } + return arr; + } + function _strRange(str, includeEnd) { + var r = _parse(str); + if (!r) { + throw new SyntaxError('String "' + str + '" is no valid range'); + } + if (config.number === 'BigNumber') { + if (bignumber === undefined) { + noBignumber(); + } + return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd); + } else { + return _out(_range(r.start, r.end, r.step, includeEnd)); + } + } + + /** + * Create a range with numbers or BigNumbers + * @param {number | BigNumber | Unit} start + * @param {number | BigNumber | Unit} end + * @param {number | BigNumber | Unit} step + * @param {boolean} includeEnd + * @returns {Array} range + * @private + */ + function _range(start, end, step, includeEnd) { + var array = []; + var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger; + var x = start; + while (ongoing(x, end)) { + array.push(x); + x = add(x, step); + } + return array; + } + + /** + * Parse a string into a range, + * The string contains the start, optional step, and end, separated by a colon. + * If the string does not contain a valid range, null is returned. + * For example str='0:2:11'. + * @param {string} str + * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step + * @private + */ + function _parse(str) { + var args = str.split(':'); + + // number + var nums = args.map(function (arg) { + // use Number and not parseFloat as Number returns NaN on invalid garbage in the string + return Number(arg); + }); + var invalid = nums.some(function (num) { + return isNaN(num); + }); + if (invalid) { + return null; + } + switch (nums.length) { + case 2: + return { + start: nums[0], + end: nums[1], + step: 1 + }; + case 3: + return { + start: nums[0], + end: nums[2], + step: nums[1] + }; + default: + return null; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/reshape.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/reshape.js new file mode 100644 index 0000000..5ffb0fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/reshape.js @@ -0,0 +1,63 @@ +import { reshape as arrayReshape } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'reshape'; +var dependencies = ['typed', 'isInteger', 'matrix']; +export var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isInteger + } = _ref; + /** + * Reshape a multi dimensional array to fit the specified dimensions + * + * Syntax: + * + * math.reshape(x, sizes) + * + * Examples: + * + * math.reshape([1, 2, 3, 4, 5, 6], [2, 3]) + * // returns Array [[1, 2, 3], [4, 5, 6]] + * + * math.reshape([[1, 2], [3, 4]], [1, 4]) + * // returns Array [[1, 2, 3, 4]] + * + * math.reshape([[1, 2], [3, 4]], [4]) + * // returns Array [1, 2, 3, 4] + * + * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8]) + * math.reshape(x, [2, 2, 2]) + * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] + * + * math.reshape([1, 2, 3, 4], [-1, 2]) + * // returns Matrix [[1, 2], [3, 4]] + * + * See also: + * + * size, squeeze, resize + * + * @param {Array | Matrix | *} x Matrix to be reshaped + * @param {number[]} sizes One dimensional array with integral sizes for + * each dimension. One -1 is allowed as wildcard, + * which calculates this dimension automatically. + * + * @return {* | Array | Matrix} A reshaped clone of matrix `x` + * + * @throws {TypeError} If `sizes` does not contain solely integers + * @throws {DimensionError} If the product of the new dimension sizes does + * not equal that of the old ones + */ + return typed(name, { + 'Matrix, Array': function Matrix_Array(x, sizes) { + return x.reshape(sizes, true); + }, + 'Array, Array': function Array_Array(x, sizes) { + sizes.forEach(function (size) { + if (!isInteger(size)) { + throw new TypeError('Invalid size for dimension: ' + size); + } + }); + return arrayReshape(x, sizes); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/resize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/resize.js new file mode 100644 index 0000000..754da28 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/resize.js @@ -0,0 +1,120 @@ +import { isBigNumber, isMatrix } from '../../utils/is.js'; +import { DimensionError } from '../../error/DimensionError.js'; +import { ArgumentsError } from '../../error/ArgumentsError.js'; +import { isInteger } from '../../utils/number.js'; +import { format } from '../../utils/string.js'; +import { clone } from '../../utils/object.js'; +import { resize as arrayResize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'resize'; +var dependencies = ['config', 'matrix']; +export var createResize = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + config, + matrix + } = _ref; + /** + * Resize a matrix + * + * Syntax: + * + * math.resize(x, size) + * math.resize(x, size, defaultValue) + * + * Examples: + * + * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3] + * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0] + * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]] + * math.resize("hello", [8], "!") // returns string 'hello!!!' + * + * See also: + * + * size, squeeze, subset, reshape + * + * @param {Array | Matrix | *} x Matrix to be resized + * @param {Array | Matrix} size One dimensional array with numbers + * @param {number | string} [defaultValue=0] Zero by default, except in + * case of a string, in that case + * defaultValue = ' ' + * @return {* | Array | Matrix} A resized clone of matrix `x` + */ + // TODO: rework resize to a typed-function + return function resize(x, size, defaultValue) { + if (arguments.length !== 2 && arguments.length !== 3) { + throw new ArgumentsError('resize', arguments.length, 2, 3); + } + if (isMatrix(size)) { + size = size.valueOf(); // get Array + } + if (isBigNumber(size[0])) { + // convert bignumbers to numbers + size = size.map(function (value) { + return !isBigNumber(value) ? value : value.toNumber(); + }); + } + + // check x is a Matrix + if (isMatrix(x)) { + // use optimized matrix implementation, return copy + return x.resize(size, defaultValue, true); + } + if (typeof x === 'string') { + // resize string + return _resizeString(x, size, defaultValue); + } + + // check result should be a matrix + var asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array'; + if (size.length === 0) { + // output a scalar + while (Array.isArray(x)) { + x = x[0]; + } + return clone(x); + } else { + // output an array/matrix + if (!Array.isArray(x)) { + x = [x]; + } + x = clone(x); + var res = arrayResize(x, size, defaultValue); + return asMatrix ? matrix(res) : res; + } + }; + + /** + * Resize a string + * @param {string} str + * @param {number[]} size + * @param {string} [defaultChar=' '] + * @private + */ + function _resizeString(str, size, defaultChar) { + if (defaultChar !== undefined) { + if (typeof defaultChar !== 'string' || defaultChar.length !== 1) { + throw new TypeError('Single character expected as defaultValue'); + } + } else { + defaultChar = ' '; + } + if (size.length !== 1) { + throw new DimensionError(size.length, 1); + } + var len = size[0]; + if (typeof len !== 'number' || !isInteger(len)) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')'); + } + if (str.length > len) { + return str.substring(0, len); + } else if (str.length < len) { + var res = str; + for (var i = 0, ii = len - str.length; i < ii; i++) { + res += defaultChar; + } + return res; + } else { + return str; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotate.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotate.js new file mode 100644 index 0000000..72f0ef8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotate.js @@ -0,0 +1,71 @@ +import { factory } from '../../utils/factory.js'; +import { arraySize } from '../../utils/array.js'; +var name = 'rotate'; +var dependencies = ['typed', 'multiply', 'rotationMatrix']; +export var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + multiply, + rotationMatrix + } = _ref; + /** + * Rotate a vector of size 1x2 counter-clockwise by a given angle + * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis + * + * Syntax: + * + * math.rotate(w, theta) + * math.rotate(w, theta, v) + * + * Examples: + * + * math.rotate([11, 12], math.pi / 2) // returns [-12, 11] + * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11] + * + * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0] + * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0] + * + * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)] + * + * See also: + * + * matrix, rotationMatrix + * + * @param {Array | Matrix} w Vector to rotate + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @return {Array | Matrix} Multiplication of the rotation matrix and w + */ + return typed(name, { + 'Array , number | BigNumber | Complex | Unit': function Array__number__BigNumber__Complex__Unit(w, theta) { + _validateSize(w, 2); + var matrixRes = multiply(rotationMatrix(theta), w); + return matrixRes.toArray(); + }, + 'Matrix , number | BigNumber | Complex | Unit': function Matrix__number__BigNumber__Complex__Unit(w, theta) { + _validateSize(w, 2); + return multiply(rotationMatrix(theta), w); + }, + 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function Array_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) { + _validateSize(w, 3); + var matrixRes = multiply(rotationMatrix(theta, v), w); + return matrixRes; + }, + 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function Matrix_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) { + _validateSize(w, 3); + return multiply(rotationMatrix(theta, v), w); + } + }); + function _validateSize(v, expectedSize) { + var actualSize = Array.isArray(v) ? arraySize(v) : v.size(); + if (actualSize.length > 2) { + throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize)); + } + if (actualSize.length === 2 && actualSize[1] !== 1) { + throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize)); + } + if (actualSize[0] !== expectedSize) { + throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize)); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js new file mode 100644 index 0000000..1d91610 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js @@ -0,0 +1,160 @@ +import { isBigNumber } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'rotationMatrix'; +var dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin']; +export var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + multiplyScalar, + addScalar, + unaryMinus, + norm, + BigNumber, + matrix, + DenseMatrix, + SparseMatrix, + cos, + sin + } = _ref; + /** + * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians). + * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3). + * + * Syntax: + * + * math.rotationMatrix(theta) + * math.rotationMatrix(theta, format) + * math.rotationMatrix(theta, [v]) + * math.rotationMatrix(theta, [v], format) + * + * Examples: + * + * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]] + * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]] + * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]] + * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]] + * + * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]] + * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]) + * + * + * See also: + * + * matrix, cos, sin + * + * + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @param {string} [format] Result Matrix storage format + * @return {Array | Matrix} Rotation matrix + */ + + return typed(name, { + '': function _() { + return config.matrix === 'Matrix' ? matrix([]) : []; + }, + string: function string(format) { + return matrix(format); + }, + 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(theta) { + return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined); + }, + 'number | BigNumber | Complex | Unit, string': function number__BigNumber__Complex__Unit_string(theta, format) { + return _rotationMatrix2x2(theta, format); + }, + 'number | BigNumber | Complex | Unit, Array': function number__BigNumber__Complex__Unit_Array(theta, v) { + var matrixV = matrix(v); + _validateVector(matrixV); + return _rotationMatrix3x3(theta, matrixV, undefined); + }, + 'number | BigNumber | Complex | Unit, Matrix': function number__BigNumber__Complex__Unit_Matrix(theta, v) { + _validateVector(v); + var storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined); + return _rotationMatrix3x3(theta, v, storageType); + }, + 'number | BigNumber | Complex | Unit, Array, string': function number__BigNumber__Complex__Unit_Array_string(theta, v, format) { + var matrixV = matrix(v); + _validateVector(matrixV); + return _rotationMatrix3x3(theta, matrixV, format); + }, + 'number | BigNumber | Complex | Unit, Matrix, string': function number__BigNumber__Complex__Unit_Matrix_string(theta, v, format) { + _validateVector(v); + return _rotationMatrix3x3(theta, v, format); + } + }); + + /** + * Returns 2x2 matrix of 2D rotation of angle theta + * + * @param {number | BigNumber | Complex | Unit} theta The rotation angle + * @param {string} format The result Matrix storage format + * @returns {Matrix} + * @private + */ + function _rotationMatrix2x2(theta, format) { + var Big = isBigNumber(theta); + var minusOne = Big ? new BigNumber(-1) : -1; + var cosTheta = cos(theta); + var sinTheta = sin(theta); + var data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]]; + return _convertToFormat(data, format); + } + function _validateVector(v) { + var size = v.size(); + if (size.length < 1 || size[0] !== 3) { + throw new RangeError('Vector must be of dimensions 1x3'); + } + } + function _mul(array) { + return array.reduce((p, curr) => multiplyScalar(p, curr)); + } + function _convertToFormat(data, format) { + if (format) { + if (format === 'sparse') { + return new SparseMatrix(data); + } + if (format === 'dense') { + return new DenseMatrix(data); + } + throw new TypeError("Unknown matrix type \"".concat(format, "\"")); + } + return data; + } + + /** + * Returns a 3x3 matrix of rotation of angle theta around vector v + * + * @param {number | BigNumber | Complex | Unit} theta The rotation angle + * @param {Matrix} v The rotation axis vector + * @param {string} format The storage format of the resulting matrix + * @returns {Matrix} + * @private + */ + function _rotationMatrix3x3(theta, v, format) { + var normV = norm(v); + if (normV === 0) { + throw new RangeError('Rotation around zero vector'); + } + var Big = isBigNumber(theta) ? BigNumber : null; + var one = Big ? new Big(1) : 1; + var minusOne = Big ? new Big(-1) : -1; + var vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV; + var vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV; + var vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV; + var c = cos(theta); + var oneMinusC = addScalar(one, unaryMinus(c)); + var s = sin(theta); + var r11 = addScalar(c, _mul([vx, vx, oneMinusC])); + var r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s])); + var r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s])); + var r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s])); + var r22 = addScalar(c, _mul([vy, vy, oneMinusC])); + var r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s])); + var r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s])); + var r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s])); + var r33 = addScalar(c, _mul([vz, vz, oneMinusC])); + var data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]]; + return _convertToFormat(data, format); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/row.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/row.js new file mode 100644 index 0000000..cdfed13 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/row.js @@ -0,0 +1,59 @@ +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { validateIndex } from '../../utils/array.js'; +var name = 'row'; +var dependencies = ['typed', 'Index', 'matrix', 'range']; +export var createRow = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Index, + matrix, + range + } = _ref; + /** + * Return a row from a Matrix. + * + * Syntax: + * + * math.row(value, index) + * + * Example: + * + * // get a row + * const d = [[1, 2], [3, 4]] + * math.row(d, 1) // returns [[3, 4]] + * + * See also: + * + * column + * + * @param {Array | Matrix } value An array or matrix + * @param {number} row The index of the row + * @return {Array | Matrix} The retrieved row + */ + return typed(name, { + 'Matrix, number': _row, + 'Array, number': function Array_number(value, row) { + return _row(matrix(clone(value)), row).valueOf(); + } + }); + + /** + * Retrieve a row of a matrix + * @param {Matrix } value A matrix + * @param {number} row The index of the row + * @return {Matrix} The retrieved row + */ + function _row(value, row) { + // check dimensions + if (value.size().length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + validateIndex(row, value.size()[0]); + var columnRange = range(0, value.size()[1]); + var index = new Index(row, columnRange); + var result = value.subset(index); + return isMatrix(result) ? result : matrix([[result]]); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/size.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/size.js new file mode 100644 index 0000000..50355c5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/size.js @@ -0,0 +1,48 @@ +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { noMatrix } from '../../utils/noop.js'; +var name = 'size'; +var dependencies = ['typed', 'config', '?matrix']; +export var createSize = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix + } = _ref; + /** + * Calculate the size of a matrix or scalar. + * + * Syntax: + * + * math.size(x) + * + * Examples: + * + * math.size(2.3) // returns [] + * math.size('hello world') // returns [11] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.size(A) // returns [2, 3] + * math.size(math.range(1,6).toArray()) // returns [5] + * + * See also: + * + * count, resize, squeeze, subset + * + * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix + * @return {Array | Matrix} A vector with size of `x`. + */ + return typed(name, { + Matrix: function Matrix(x) { + return x.create(x.size(), 'number'); + }, + Array: arraySize, + string: function string(x) { + return config.matrix === 'Array' ? [x.length] : matrix([x.length], 'dense', 'number'); + }, + 'number | Complex | BigNumber | Unit | boolean | null': function number__Complex__BigNumber__Unit__boolean__null(x) { + // scalar + return config.matrix === 'Array' ? [] : matrix ? matrix([], 'dense', 'number') : noMatrix(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sort.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sort.js new file mode 100644 index 0000000..48c7f29 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sort.js @@ -0,0 +1,113 @@ +import { arraySize as size } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'sort'; +var dependencies = ['typed', 'matrix', 'compare', 'compareNatural']; +export var createSort = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + compare, + compareNatural + } = _ref; + var compareAsc = compare; + var compareDesc = (a, b) => -compare(a, b); + + /** + * Sort the items in a matrix. + * + * Syntax: + * + * math.sort(x) + * math.sort(x, compare) + * + * Examples: + * + * math.sort([5, 10, 1]) // returns [1, 5, 10] + * math.sort(['C', 'B', 'A', 'D'], math.compareNatural) + * // returns ['A', 'B', 'C', 'D'] + * + * function sortByLength (a, b) { + * return a.length - b.length + * } + * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength) + * // returns ['Tom', 'Sara', 'Langdon'] + * + * See also: + * + * filter, forEach, map, compare, compareNatural + * + * @param {Matrix | Array} x A one dimensional matrix or array to sort + * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc'] + * An optional _comparator function or name. The function is called as + * `compare(a, b)`, and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. + * @return {Matrix | Array} Returns the sorted matrix. + */ + return typed(name, { + Array: function Array(x) { + _arrayIsVector(x); + return x.sort(compareAsc); + }, + Matrix: function Matrix(x) { + _matrixIsVector(x); + return matrix(x.toArray().sort(compareAsc), x.storage()); + }, + 'Array, function': function Array_function(x, _comparator) { + _arrayIsVector(x); + return x.sort(_comparator); + }, + 'Matrix, function': function Matrix_function(x, _comparator) { + _matrixIsVector(x); + return matrix(x.toArray().sort(_comparator), x.storage()); + }, + 'Array, string': function Array_string(x, order) { + _arrayIsVector(x); + return x.sort(_comparator(order)); + }, + 'Matrix, string': function Matrix_string(x, order) { + _matrixIsVector(x); + return matrix(x.toArray().sort(_comparator(order)), x.storage()); + } + }); + + /** + * Get the comparator for given order ('asc', 'desc', 'natural') + * @param {'asc' | 'desc' | 'natural'} order + * @return {Function} Returns a _comparator function + */ + function _comparator(order) { + if (order === 'asc') { + return compareAsc; + } else if (order === 'desc') { + return compareDesc; + } else if (order === 'natural') { + return compareNatural; + } else { + throw new Error('String "asc", "desc", or "natural" expected'); + } + } + + /** + * Validate whether an array is one dimensional + * Throws an error when this is not the case + * @param {Array} array + * @private + */ + function _arrayIsVector(array) { + if (size(array).length !== 1) { + throw new Error('One dimensional array expected'); + } + } + + /** + * Validate whether a matrix is one dimensional + * Throws an error when this is not the case + * @param {Matrix} matrix + * @private + */ + function _matrixIsVector(matrix) { + if (matrix.size().length !== 1) { + throw new Error('One dimensional matrix expected'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js new file mode 100644 index 0000000..8c5aa94 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js @@ -0,0 +1,99 @@ +import { isMatrix } from '../../utils/is.js'; +import { format } from '../../utils/string.js'; +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'sqrtm'; +var dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity']; +export var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + add, + multiply, + map, + sqrt, + subtract, + inv, + size, + max, + identity + } = _ref; + var _maxIterations = 1e3; + var _tolerance = 1e-6; + + /** + * Calculate the principal square root matrix using the Denman–Beavers iterative method + * + * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman–Beavers_iteration + * + * @param {Array | Matrix} A The square matrix `A` + * @return {Array | Matrix} The principal square root of matrix `A` + * @private + */ + function _denmanBeavers(A) { + var error; + var iterations = 0; + var Y = A; + var Z = identity(size(A)); + do { + var Yk = Y; + Y = multiply(0.5, add(Yk, inv(Z))); + Z = multiply(0.5, add(Z, inv(Yk))); + error = max(abs(subtract(Y, Yk))); + if (error > _tolerance && ++iterations > _maxIterations) { + throw new Error('computing square root of matrix: iterative method could not converge'); + } + } while (error > _tolerance); + return Y; + } + + /** + * Calculate the principal square root of a square matrix. + * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`. + * + * https://en.wikipedia.org/wiki/Square_root_of_a_matrix + * + * Syntax: + * + * math.sqrtm(A) + * + * Examples: + * + * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]] + * + * See also: + * + * sqrt, pow + * + * @param {Array | Matrix} A The square matrix `A` + * @return {Array | Matrix} The principal square root of matrix `A` + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(A) { + var size = isMatrix(A) ? A.size() : arraySize(A); + switch (size.length) { + case 1: + // Single element Array | Matrix + if (size[0] === 1) { + return map(A, sqrt); + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + case 2: + { + // Two-dimensional Array | Matrix + var rows = size[0]; + var cols = size[1]; + if (rows === cols) { + return _denmanBeavers(A); + } else { + throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')'); + } + } + default: + // Multi dimensional array + throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + format(size) + ')'); + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/squeeze.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/squeeze.js new file mode 100644 index 0000000..c40e713 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/squeeze.js @@ -0,0 +1,53 @@ +import { clone } from '../../utils/object.js'; +import { squeeze as arraySqueeze } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'squeeze'; +var dependencies = ['typed']; +export var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. + * + * Syntax: + * + * math.squeeze(x) + * + * Examples: + * + * math.squeeze([3]) // returns 3 + * math.squeeze([[3]]) // returns 3 + * + * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1) + * math.squeeze(A) // returns [0, 0, 0] (size 3) + * + * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3) + * math.squeeze(B) // returns [0, 0, 0] (size 3) + * + * // only inner and outer dimensions are removed + * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3) + * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3) + * + * See also: + * + * subset + * + * @param {Matrix | Array} x Matrix to be squeezed + * @return {Matrix | Array} Squeezed matrix + */ + return typed(name, { + Array: function Array(x) { + return arraySqueeze(clone(x)); + }, + Matrix: function Matrix(x) { + var res = arraySqueeze(x.toArray()); + // FIXME: return the same type of matrix as the input + return Array.isArray(res) ? x.create(res, x.datatype()) : res; + }, + any: function any(x) { + // scalar + return clone(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/subset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/subset.js new file mode 100644 index 0000000..df44b6d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/subset.js @@ -0,0 +1,273 @@ +import { isIndex } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js'; +import { getSafeProperty, setSafeProperty } from '../../utils/customs.js'; +import { DimensionError } from '../../error/DimensionError.js'; +import { factory } from '../../utils/factory.js'; +var name = 'subset'; +var dependencies = ['typed', 'matrix', 'zeros', 'add']; +export var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + zeros, + add + } = _ref; + /** + * Get or set a subset of a matrix or string. + * + * Syntax: + * math.subset(value, index) // retrieve a subset + * math.subset(value, index, replacement [, defaultValue]) // replace a subset + * + * Examples: + * + * // get a subset + * const d = [[1, 2], [3, 4]] + * math.subset(d, math.index(1, 0)) // returns 3 + * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]] + * math.subset(d, math.index([false, true], 0)) // returns [[3]] + * + * // replace a subset + * const e = [] + * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]] + * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]] + * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]] + * + * // get submatrix using ranges + * const M = [ + * [1,2,3], + * [4,5,6], + * [7,8,9] + * ] + * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]] + * + * See also: + * + * size, resize, squeeze, index + * + * @param {Array | Matrix | string} matrix An array, matrix, or string + * @param {Index} index + * For each dimension of the target, specifies an index or a list of + * indices to fetch or set. `subset` uses the cartesian product of + * the indices specified in each dimension. + * @param {*} [replacement] An array, matrix, or scalar. + * If provided, the subset is replaced with replacement. + * If not provided, the subset is returned + * @param {*} [defaultValue=undefined] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * math.matrix elements will be left undefined. + * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix. + */ + + return typed(name, { + // get subset + 'Matrix, Index': function Matrix_Index(value, index) { + if (isEmptyIndex(index)) { + return matrix(); + } + validateIndexSourceSize(value, index); + return value.subset(index); + }, + 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) { + return function (value, index) { + var subsetResult = subsetRef(matrix(value), index); + return index.isScalar() ? subsetResult : subsetResult.valueOf(); + }; + }), + 'Object, Index': _getObjectProperty, + 'string, Index': _getSubstring, + // set subset + 'Matrix, Index, any, any': function Matrix_Index_any_any(value, index, replacement, defaultValue) { + if (isEmptyIndex(index)) { + return value; + } + validateIndexSourceSize(value, index); + return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue); + }, + 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement, defaultValue) { + var subsetResult = subsetRef(matrix(value), index, replacement, defaultValue); + return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult; + }; + }), + 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement) { + return subsetRef(matrix(value), index, replacement, undefined).valueOf(); + }; + }), + 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) { + return function (value, index, replacement) { + return subsetRef(value, index, replacement, undefined); + }; + }), + 'string, Index, string': _setSubstring, + 'string, Index, string, string': _setSubstring, + 'Object, Index, any': _setObjectProperty + }); + + /** + * Broadcasts a replacment value to be the same size as index + * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast + * @param {*} index Index value + * @returns broadcasted replacement that matches the size of index + */ + + function _broadcastReplacement(replacement, index) { + if (typeof replacement === 'string') { + throw new Error('can\'t boradcast a string'); + } + if (index._isScalar) { + return replacement; + } + var indexSize = index.size(); + if (indexSize.every(d => d > 0)) { + try { + return add(replacement, zeros(indexSize)); + } catch (error) { + return replacement; + } + } else { + return replacement; + } + } +}); + +/** + * Retrieve a subset of a string + * @param {string} str string from which to get a substring + * @param {Index} index An index or list of indices (character positions) + * @returns {string} substring + * @private + */ +function _getSubstring(str, index) { + if (!isIndex(index)) { + // TODO: better error message + throw new TypeError('Index expected'); + } + if (isEmptyIndex(index)) { + return ''; + } + validateIndexSourceSize(Array.from(str), index); + if (index.size().length !== 1) { + throw new DimensionError(index.size().length, 1); + } + + // validate whether the range is out of range + var strLen = str.length; + validateIndex(index.min()[0], strLen); + validateIndex(index.max()[0], strLen); + var range = index.dimension(0); + var substr = ''; + range.forEach(function (v) { + substr += str.charAt(v); + }); + return substr; +} + +/** + * Replace a substring in a string + * @param {string} str string to be replaced + * @param {Index} index An index or list of indices (character positions) + * @param {string} replacement Replacement string + * @param {string} [defaultValue] Default value to be used when resizing + * the string. is ' ' by default + * @returns {string} result + * @private + */ +function _setSubstring(str, index, replacement, defaultValue) { + if (!index || index.isIndex !== true) { + // TODO: better error message + throw new TypeError('Index expected'); + } + if (isEmptyIndex(index)) { + return str; + } + validateIndexSourceSize(Array.from(str), index); + if (index.size().length !== 1) { + throw new DimensionError(index.size().length, 1); + } + if (defaultValue !== undefined) { + if (typeof defaultValue !== 'string' || defaultValue.length !== 1) { + throw new TypeError('Single character expected as defaultValue'); + } + } else { + defaultValue = ' '; + } + var range = index.dimension(0); + var len = range.size()[0]; + if (len !== replacement.length) { + throw new DimensionError(range.size()[0], replacement.length); + } + + // validate whether the range is out of range + var strLen = str.length; + validateIndex(index.min()[0]); + validateIndex(index.max()[0]); + + // copy the string into an array with characters + var chars = []; + for (var i = 0; i < strLen; i++) { + chars[i] = str.charAt(i); + } + range.forEach(function (v, i) { + chars[v] = replacement.charAt(i[0]); + }); + + // initialize undefined characters with a space + if (chars.length > strLen) { + for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) { + if (!chars[_i]) { + chars[_i] = defaultValue; + } + } + } + return chars.join(''); +} + +/** + * Retrieve a property from an object + * @param {Object} object + * @param {Index} index + * @return {*} Returns the value of the property + * @private + */ +function _getObjectProperty(object, index) { + if (isEmptyIndex(index)) { + return undefined; + } + if (index.size().length !== 1) { + throw new DimensionError(index.size(), 1); + } + var key = index.dimension(0); + if (typeof key !== 'string') { + throw new TypeError('String expected as index to retrieve an object property'); + } + return getSafeProperty(object, key); +} + +/** + * Set a property on an object + * @param {Object} object + * @param {Index} index + * @param {*} replacement + * @return {*} Returns the updated object + * @private + */ +function _setObjectProperty(object, index, replacement) { + if (isEmptyIndex(index)) { + return object; + } + if (index.size().length !== 1) { + throw new DimensionError(index.size(), 1); + } + var key = index.dimension(0); + if (typeof key !== 'string') { + throw new TypeError('String expected as index to retrieve an object property'); + } + + // clone the object, and apply the property to the clone + var updated = clone(object); + setSafeProperty(updated, key, replacement); + return updated; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/trace.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/trace.js new file mode 100644 index 0000000..1d94b48 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/trace.js @@ -0,0 +1,128 @@ +import { clone } from '../../utils/object.js'; +import { format } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +var name = 'trace'; +var dependencies = ['typed', 'matrix', 'add']; +export var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + add + } = _ref; + /** + * Calculate the trace of a matrix: the sum of the elements on the main + * diagonal of a square matrix. + * + * Syntax: + * + * math.trace(x) + * + * Examples: + * + * math.trace([[1, 2], [3, 4]]) // returns 5 + * + * const A = [ + * [1, 2, 3], + * [-1, 2, 3], + * [2, 0, 3] + * ] + * math.trace(A) // returns 6 + * + * See also: + * + * diag + * + * @param {Array | Matrix} x A matrix + * + * @return {number} The trace of `x` + */ + return typed('trace', { + Array: function _arrayTrace(x) { + // use dense matrix implementation + return _denseTrace(matrix(x)); + }, + SparseMatrix: _sparseTrace, + DenseMatrix: _denseTrace, + any: clone + }); + function _denseTrace(m) { + // matrix size & data + var size = m._size; + var data = m._data; + + // process dimensions + switch (size.length) { + case 1: + // vector + if (size[0] === 1) { + // return data[0] + return clone(data[0]); + } + throw new RangeError('Matrix must be square (size: ' + format(size) + ')'); + case 2: + { + // two dimensional + var rows = size[0]; + var cols = size[1]; + if (rows === cols) { + // calulate sum + var sum = 0; + // loop diagonal + for (var i = 0; i < rows; i++) { + sum = add(sum, data[i][i]); + } + // return trace + return sum; + } else { + throw new RangeError('Matrix must be square (size: ' + format(size) + ')'); + } + } + default: + // multi dimensional + throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')'); + } + } + function _sparseTrace(m) { + // matrix arrays + var values = m._values; + var index = m._index; + var ptr = m._ptr; + var size = m._size; + // check dimensions + var rows = size[0]; + var columns = size[1]; + // matrix must be square + if (rows === columns) { + // calulate sum + var sum = 0; + // check we have data (avoid looping columns) + if (values.length > 0) { + // loop columns + for (var j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = ptr[j]; + var k1 = ptr[j + 1]; + // loop k within [k0, k1[ + for (var k = k0; k < k1; k++) { + // row index + var i = index[k]; + // check row + if (i === j) { + // accumulate value + sum = add(sum, values[k]); + // exit loop + break; + } + if (i > j) { + // exit loop, no value on the diagonal for column j + break; + } + } + } + } + // return trace + return sum; + } + throw new RangeError('Matrix must be square (size: ' + format(size) + ')'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/transpose.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/transpose.js new file mode 100644 index 0000000..c786b67 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/transpose.js @@ -0,0 +1,160 @@ +import { clone } from '../../utils/object.js'; +import { format } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +var name = 'transpose'; +var dependencies = ['typed', 'matrix']; +export var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix + } = _ref; + /** + * Transpose a matrix. All values of the matrix are reflected over its + * main diagonal. Only applicable to two dimensional matrices containing + * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional + * vectors and scalars return the input unchanged. + * + * Syntax: + * + * math.transpose(x) + * + * Examples: + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]] + * + * See also: + * + * diag, inv, subset, squeeze + * + * @param {Array | Matrix} x Matrix to be transposed + * @return {Array | Matrix} The transposed matrix + */ + return typed(name, { + Array: x => transposeMatrix(matrix(x)).valueOf(), + Matrix: transposeMatrix, + any: clone // scalars + }); + function transposeMatrix(x) { + // matrix size + var size = x.size(); + + // result + var c; + + // process dimensions + switch (size.length) { + case 1: + // vector + c = x.clone(); + break; + case 2: + { + // rows and columns + var rows = size[0]; + var columns = size[1]; + + // check columns + if (columns === 0) { + // throw exception + throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')'); + } + + // process storage format + switch (x.storage()) { + case 'dense': + c = _denseTranspose(x, rows, columns); + break; + case 'sparse': + c = _sparseTranspose(x, rows, columns); + break; + } + } + break; + default: + // multi dimensional + throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')'); + } + return c; + } + function _denseTranspose(m, rows, columns) { + // matrix array + var data = m._data; + // transposed matrix data + var transposed = []; + var transposedRow; + // loop columns + for (var j = 0; j < columns; j++) { + // initialize row + transposedRow = transposed[j] = []; + // loop rows + for (var i = 0; i < rows; i++) { + // set data + transposedRow[i] = clone(data[i][j]); + } + } + // return matrix + return m.createDenseMatrix({ + data: transposed, + size: [columns, rows], + datatype: m._datatype + }); + } + function _sparseTranspose(m, rows, columns) { + // matrix arrays + var values = m._values; + var index = m._index; + var ptr = m._ptr; + // result matrices + var cvalues = values ? [] : undefined; + var cindex = []; + var cptr = []; + // row counts + var w = []; + for (var x = 0; x < rows; x++) { + w[x] = 0; + } + // vars + var p, l, j; + // loop values in matrix + for (p = 0, l = index.length; p < l; p++) { + // number of values in row + w[index[p]]++; + } + // cumulative sum + var sum = 0; + // initialize cptr with the cummulative sum of row counts + for (var i = 0; i < rows; i++) { + // update cptr + cptr.push(sum); + // update sum + sum += w[i]; + // update w + w[i] = cptr[i]; + } + // update cptr + cptr.push(sum); + // loop columns + for (j = 0; j < columns; j++) { + // values & index in column + for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) { + // C values & index + var q = w[index[k]]++; + // C[j, i] = A[i, j] + cindex[q] = j; + // check we need to process values (pattern matrix) + if (values) { + cvalues[q] = clone(values[k]); + } + } + } + // return matrix + return m.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [columns, rows], + datatype: m._datatype + }); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/zeros.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/zeros.js new file mode 100644 index 0000000..5c19506 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/matrix/zeros.js @@ -0,0 +1,123 @@ +import { isBigNumber } from '../../utils/is.js'; +import { isInteger } from '../../utils/number.js'; +import { resize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'zeros'; +var dependencies = ['typed', 'config', 'matrix', 'BigNumber']; +export var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + BigNumber + } = _ref; + /** + * Create a matrix filled with zeros. The created matrix can have one or + * multiple dimensions. + * + * Syntax: + * + * math.zeros(m) + * math.zeros(m, format) + * math.zeros(m, n) + * math.zeros(m, n, format) + * math.zeros([m, n]) + * math.zeros([m, n], format) + * + * Examples: + * + * math.zeros() // returns [] + * math.zeros(3) // returns [0, 0, 0] + * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]] + * math.zeros(3, 'dense') // returns [0, 0, 0] + * + * const A = [[1, 2, 3], [4, 5, 6]] + * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]] + * + * See also: + * + * ones, identity, size, range + * + * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix + * @param {string} [format] The Matrix storage format + * + * @return {Array | Matrix} A matrix filled with zeros + */ + return typed(name, { + '': function _() { + return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default'); + }, + // math.zeros(m, n, p, ..., format) + // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this + '...number | BigNumber | string': function number__BigNumber__string(size) { + var last = size[size.length - 1]; + if (typeof last === 'string') { + var format = size.pop(); + return _zeros(size, format); + } else if (config.matrix === 'Array') { + return _zeros(size); + } else { + return _zeros(size, 'default'); + } + }, + Array: _zeros, + Matrix: function Matrix(size) { + var format = size.storage(); + return _zeros(size.valueOf(), format); + }, + 'Array | Matrix, string': function Array__Matrix_string(size, format) { + return _zeros(size.valueOf(), format); + } + }); + + /** + * Create an Array or Matrix with zeros + * @param {Array} size + * @param {string} [format='default'] + * @return {Array | Matrix} + * @private + */ + function _zeros(size, format) { + var hasBigNumbers = _normalize(size); + var defaultValue = hasBigNumbers ? new BigNumber(0) : 0; + _validate(size); + if (format) { + // return a matrix + var m = matrix(format); + if (size.length > 0) { + return m.resize(size, defaultValue); + } + return m; + } else { + // return an Array + var arr = []; + if (size.length > 0) { + return resize(arr, size, defaultValue); + } + return arr; + } + } + + // replace BigNumbers with numbers, returns true if size contained BigNumbers + function _normalize(size) { + var hasBigNumbers = false; + size.forEach(function (value, index, arr) { + if (isBigNumber(value)) { + hasBigNumbers = true; + arr[index] = value.toNumber(); + } + }); + return hasBigNumbers; + } + + // validate arguments + function _validate(size) { + size.forEach(function (value) { + if (typeof value !== 'number' || !isInteger(value) || value < 0) { + throw new Error('Parameters in function zeros must be positive integers'); + } + }); + } +}); + +// TODO: zeros contains almost the same code as ones. Reuse this? \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/numeric/solveODE.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/numeric/solveODE.js new file mode 100644 index 0000000..367c42e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/numeric/solveODE.js @@ -0,0 +1,284 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +import { isUnit, isNumber, isBigNumber } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'solveODE'; +var dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus']; +export var createSolveODE = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + subtract, + multiply, + divide, + max, + map, + abs, + isPositive, + isNegative, + larger, + smaller, + matrix, + bignumber, + unaryMinus + } = _ref; + /** + * Numerical Integration of Ordinary Differential Equations + * + * Two variable step methods are provided: + * - "RK23": Bogacki–Shampine method + * - "RK45": Dormand-Prince method RK5(4)7M (default) + * + * The arguments are expected as follows. + * + * - `func` should be the forcing function `f(t, y)` + * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]` + * - `y0` the initial state values, should be a scalar or a flat array + * - `options` should be an object with the following information: + * - `method` ('RK45'): ['RK23', 'RK45'] + * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value + * - `firstStep`: Initial step size + * - `minStep`: minimum step size of the method + * - `maxStep`: maximum step size of the method + * - `minDelta` (0.2): minimum ratio of change for the step + * - `maxDelta` (5): maximum ratio of change for the step + * - `maxIter` (1e4): maximum number of iterations + * + * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`: + * - `t` an array of size `[n]` + * - `y` the states array can be in two ways + * - **if `y0` is a scalar:** returns an array-like of size `[n]` + * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]` + * + * Syntax: + * + * math.solveODE(func, tspan, y0) + * math.solveODE(func, tspan, y0, options) + * + * Examples: + * + * function func(t, y) {return y} + * const tspan = [0, 4] + * const y0 = 1 + * math.solveODE(func, tspan, y0) + * math.solveODE(func, tspan, [1, 2]) + * math.solveODE(func, tspan, y0, { method:"RK23", maxStep:0.1 }) + * + * See also: + * + * derivative, simplifyCore + * + * @param {function} func The forcing function f(t,y) + * @param {Array | Matrix} tspan The time span + * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value + * @param {Object} [options] Optional configuration options + * @return {Object} Return an object with t and y values as arrays + */ + + function _rk(butcherTableau) { + // generates an adaptive runge kutta method from it's butcher tableau + + return function (f, tspan, y0, options) { + // adaptive runge kutta methods + var wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(isUnit))); + if (wrongTSpan) { + throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]'); + } + var t0 = tspan[0]; // initial time + var tf = tspan[1]; // final time + var isForwards = larger(tf, t0); + var firstStep = options.firstStep; + if (firstStep !== undefined && !isPositive(firstStep)) { + throw new Error('"firstStep" must be positive'); + } + var maxStep = options.maxStep; + if (maxStep !== undefined && !isPositive(maxStep)) { + throw new Error('"maxStep" must be positive'); + } + var minStep = options.minStep; + if (minStep && isNegative(minStep)) { + throw new Error('"minStep" must be positive or zero'); + } + var timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined); + if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) { + throw new Error('Inconsistent type of "t" dependant variables'); + } + var steps = 1; // divide time in this number of steps + var tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option) + var minDelta = options.minDelta ? options.minDelta : 0.2; + var maxDelta = options.maxDelta ? options.maxDelta : 5; + var maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong + var hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber); + var [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp]; + var h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size + var t = [t0]; // start the time array + var y = [y0]; // start the solution array + + var deltaB = subtract(b, bp); // b - bp + + var n = 0; + var iter = 0; + var ongoing = _createOngoing(isForwards); + var trimStep = _createTrimStep(isForwards); + // iterate unitil it reaches either the final time or maximum iterations + while (ongoing(t[n], tf)) { + var k = []; + + // trim the time step so that it doesn't overshoot + h = trimStep(t[n], tf, h); + + // calculate the first value of k + k.push(f(t[n], y[n])); + + // calculate the rest of the values of k + for (var i = 1; i < c.length; ++i) { + k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k)))); + } + + // estimate the error by comparing solutions of different orders + var TE = max(abs(map(multiply(deltaB, k), X => isUnit(X) ? X.value : X))); + if (TE < tol && tol / TE > 1 / 4) { + // push solution if within tol + t.push(add(t[n], h)); + y.push(add(y[n], multiply(h, b, k))); + n++; + } + + // estimate the delta value that will affect the step size + var delta = 0.84 * (tol / TE) ** (1 / 5); + if (smaller(delta, minDelta)) { + delta = minDelta; + } else if (larger(delta, maxDelta)) { + delta = maxDelta; + } + delta = hasBigNumbers ? bignumber(delta) : delta; + h = multiply(h, delta); + if (maxStep && larger(abs(h), maxStep)) { + h = isForwards ? maxStep : unaryMinus(maxStep); + } else if (minStep && smaller(abs(h), minStep)) { + h = isForwards ? minStep : unaryMinus(minStep); + } + iter++; + if (iter > maxIter) { + throw new Error('Maximum number of iterations reached, try changing options'); + } + } + return { + t, + y + }; + }; + } + function _rk23(f, tspan, y0, options) { + // Bogacki–Shampine method + + // Define the butcher table + var a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]]; + var c = [null, 1 / 2, 3 / 4, 1]; + var b = [2 / 9, 1 / 3, 4 / 9, 0]; + var bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8]; + var butcherTableau = { + a, + c, + b, + bp + }; + + // Solve an adaptive step size rk method + return _rk(butcherTableau)(f, tspan, y0, options); + } + function _rk45(f, tspan, y0, options) { + // Dormand Prince method + + // Define the butcher tableau + var a = [[], [1 / 5], [3 / 40, 9 / 40], [44 / 45, -56 / 15, 32 / 9], [19372 / 6561, -25360 / 2187, 64448 / 6561, -212 / 729], [9017 / 3168, -355 / 33, 46732 / 5247, 49 / 176, -5103 / 18656], [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84]]; + var c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1]; + var b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0]; + var bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40]; + var butcherTableau = { + a, + c, + b, + bp + }; + + // Solve an adaptive step size rk method + return _rk(butcherTableau)(f, tspan, y0, options); + } + function _solveODE(f, tspan, y0, opt) { + var method = opt.method ? opt.method : 'RK45'; + var methods = { + RK23: _rk23, + RK45: _rk45 + }; + if (method.toUpperCase() in methods) { + var methodOptions = _objectSpread({}, opt); // clone the options object + delete methodOptions.method; // delete the method as it won't be needed + return methods[method.toUpperCase()](f, tspan, y0, methodOptions); + } else { + // throw an error indicating there is no such method + var methodsWithQuotes = Object.keys(methods).map(x => "\"".concat(x, "\"")); + // generates a string of methods like: "BDF", "RK23" and "RK45" + var availableMethodsString = "".concat(methodsWithQuotes.slice(0, -1).join(', '), " and ").concat(methodsWithQuotes.slice(-1)); + throw new Error("Unavailable method \"".concat(method, "\". Available methods are ").concat(availableMethodsString)); + } + } + function _createOngoing(isForwards) { + // returns the correct function to test if it's still iterating + return isForwards ? smaller : larger; + } + function _createTrimStep(isForwards) { + var outOfBounds = isForwards ? larger : smaller; + return function (t, tf, h) { + var next = add(t, h); + return outOfBounds(next, tf) ? subtract(tf, t) : h; + }; + } + function isNumOrBig(x) { + // checks if it's a number or bignumber + return isBigNumber(x) || isNumber(x); + } + function _matrixSolveODE(f, T, y0, options) { + // receives matrices and returns matrices + var sol = _solveODE(f, T.toArray(), y0.toArray(), options); + return { + t: matrix(sol.t), + y: matrix(sol.y) + }; + } + return typed('solveODE', { + 'function, Array, Array, Object': _solveODE, + 'function, Matrix, Matrix, Object': _matrixSolveODE, + 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}), + 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}), + 'function, Array, number | BigNumber | Unit': (f, T, y0) => { + var sol = _solveODE(f, T, [y0], {}); + return { + t: sol.t, + y: sol.y.map(Y => Y[0]) + }; + }, + 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => { + var sol = _solveODE(f, T.toArray(), [y0], {}); + return { + t: matrix(sol.t), + y: matrix(sol.y.map(Y => Y[0])) + }; + }, + 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => { + var sol = _solveODE(f, T, [y0], options); + return { + t: sol.t, + y: sol.y.map(Y => Y[0]) + }; + }, + 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => { + var sol = _solveODE(f, T.toArray(), [y0], options); + return { + t: matrix(sol.t), + y: matrix(sol.y.map(Y => Y[0])) + }; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinations.js new file mode 100644 index 0000000..cb3ac43 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinations.js @@ -0,0 +1,69 @@ +import { factory } from '../../utils/factory.js'; +import { combinationsNumber } from '../../plain/number/combinations.js'; +var name = 'combinations'; +var dependencies = ['typed']; +export var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the number of ways of picking `k` unordered outcomes from `n` + * possibilities. + * + * Combinations only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.combinations(n, k) + * + * Examples: + * + * math.combinations(7, 5) // returns 21 + * + * See also: + * + * combinationsWithRep, permutations, factorial + * + * @param {number | BigNumber} n Total number of objects in the set + * @param {number | BigNumber} k Number of objects in the subset + * @return {number | BigNumber} Number of possible combinations. + */ + return typed(name, { + 'number, number': combinationsNumber, + 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) { + var BigNumber = n.constructor; + var result, i; + var nMinusk = n.minus(k); + var one = new BigNumber(1); + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (k.gt(n)) { + throw new TypeError('k must be less than n in function combinations'); + } + result = one; + if (k.lt(nMinusk)) { + for (i = one; i.lte(nMinusk); i = i.plus(one)) { + result = result.times(k.plus(i)).dividedBy(i); + } + } else { + for (i = one; i.lte(k); i = i.plus(one)) { + result = result.times(nMinusk.plus(i)).dividedBy(i); + } + } + return result; + } + + // TODO: implement support for collection in combinations + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js new file mode 100644 index 0000000..e6ab046 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js @@ -0,0 +1,84 @@ +import { factory } from '../../utils/factory.js'; +import { isInteger } from '../../utils/number.js'; +import { product } from '../../utils/product.js'; +var name = 'combinationsWithRep'; +var dependencies = ['typed']; +export var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the number of ways of picking `k` unordered outcomes from `n` + * possibilities, allowing individual outcomes to be repeated more than once. + * + * CombinationsWithRep only takes integer arguments. + * The following condition must be enforced: k <= n + k -1. + * + * Syntax: + * + * math.combinationsWithRep(n, k) + * + * Examples: + * + * math.combinationsWithRep(7, 5) // returns 462 + * + * See also: + * + * combinations, permutations, factorial + * + * @param {number | BigNumber} n Total number of objects in the set + * @param {number | BigNumber} k Number of objects in the subset + * @return {number | BigNumber} Number of possible combinations with replacement. + */ + return typed(name, { + 'number, number': function number_number(n, k) { + if (!isInteger(n) || n < 0) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (!isInteger(k) || k < 0) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (n < 1) { + throw new TypeError('k must be less than or equal to n + k - 1'); + } + if (k < n - 1) { + var _prodrange = product(n, n + k - 1); + return _prodrange / product(1, k); + } + var prodrange = product(k + 1, n + k - 1); + return prodrange / product(1, n - 1); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) { + var BigNumber = n.constructor; + var result, i; + var one = new BigNumber(1); + var nMinusOne = n.minus(one); + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function combinationsWithRep'); + } + if (n.lt(one)) { + throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep'); + } + result = one; + if (k.lt(nMinusOne)) { + for (i = one; i.lte(nMinusOne); i = i.plus(one)) { + result = result.times(k.plus(i)).dividedBy(i); + } + } else { + for (i = one; i.lte(k); i = i.plus(one)) { + result = result.times(nMinusOne.plus(i)).dividedBy(i); + } + } + return result; + } + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/factorial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/factorial.js new file mode 100644 index 0000000..3cfd21d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/factorial.js @@ -0,0 +1,47 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'factorial'; +var dependencies = ['typed', 'gamma']; +export var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + gamma + } = _ref; + /** + * Compute the factorial of a value + * + * Factorial only supports an integer value as argument. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.factorial(n) + * + * Examples: + * + * math.factorial(5) // returns 120 + * math.factorial(3) // returns 6 + * + * See also: + * + * combinations, combinationsWithRep, gamma, permutations + * + * @param {number | BigNumber | Array | Matrix} n An integer number + * @return {number | BigNumber | Array | Matrix} The factorial of `n` + */ + return typed(name, { + number: function number(n) { + if (n < 0) { + throw new Error('Value must be non-negative'); + } + return gamma(n + 1); + }, + BigNumber: function BigNumber(n) { + if (n.isNegative()) { + throw new Error('Value must be non-negative'); + } + return gamma(n.plus(1)); + }, + 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/gamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/gamma.js new file mode 100644 index 0000000..dce043b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/gamma.js @@ -0,0 +1,120 @@ +import { factory } from '../../utils/factory.js'; +import { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js'; +var name = 'gamma'; +var dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex']; +export var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + multiplyScalar, + pow, + BigNumber: _BigNumber, + Complex + } = _ref; + /** + * Compute the gamma function of a value using Lanczos approximation for + * small values, and an extended Stirling approximation for large values. + * + * To avoid confusion with the matrix Gamma function, this function does + * not apply to matrices. + * + * Syntax: + * + * math.gamma(n) + * + * Examples: + * + * math.gamma(5) // returns 24 + * math.gamma(-0.5) // returns -3.5449077018110335 + * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i + * + * See also: + * + * combinations, factorial, permutations + * + * @param {number | BigNumber | Complex} n A real or complex number + * @return {number | BigNumber | Complex} The gamma of `n` + */ + + function gammaComplex(n) { + if (n.im === 0) { + return gammaNumber(n.re); + } + + // Lanczos approximation doesn't work well with real part lower than 0.5 + // So reflection formula is required + if (n.re < 0.5) { + // Euler's reflection formula + // gamma(1-z) * gamma(z) = PI / sin(PI * z) + // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined] + // thanks to imperfect sin implementation sin(PI * n) != 0 + // we can safely use it anyway + var _t = new Complex(1 - n.re, -n.im); + var r = new Complex(Math.PI * n.re, Math.PI * n.im); + return new Complex(Math.PI).div(r.sin()).div(gammaComplex(_t)); + } + + // Lanczos approximation + // z -= 1 + n = new Complex(n.re - 1, n.im); + + // x = gammaPval[0] + var x = new Complex(gammaP[0], 0); + // for (i, gammaPval) in enumerate(gammaP): + for (var i = 1; i < gammaP.length; ++i) { + // x += gammaPval / (z + i) + var gammaPval = new Complex(gammaP[i], 0); + x = x.add(gammaPval.div(n.add(i))); + } + // t = z + gammaG + 0.5 + var t = new Complex(n.re + gammaG + 0.5, n.im); + + // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x + var twoPiSqrt = Math.sqrt(2 * Math.PI); + var tpow = t.pow(n.add(0.5)); + var expt = t.neg().exp(); + + // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)] + return x.mul(twoPiSqrt).mul(tpow).mul(expt); + } + return typed(name, { + number: gammaNumber, + Complex: gammaComplex, + BigNumber: function BigNumber(n) { + if (n.isInteger()) { + return n.isNegative() || n.isZero() ? new _BigNumber(Infinity) : bigFactorial(n.minus(1)); + } + if (!n.isFinite()) { + return new _BigNumber(n.isNegative() ? NaN : Infinity); + } + throw new Error('Integer BigNumber expected'); + } + }); + + /** + * Calculate factorial for a BigNumber + * @param {BigNumber} n + * @returns {BigNumber} Returns the factorial of n + */ + function bigFactorial(n) { + if (n < 8) { + return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]); + } + var precision = config.precision + (Math.log(n.toNumber()) | 0); + var Big = _BigNumber.clone({ + precision + }); + if (n % 2 === 1) { + return n.times(bigFactorial(new _BigNumber(n - 1))); + } + var p = n; + var prod = new Big(n); + var sum = n.toNumber(); + while (p > 2) { + p -= 2; + sum += p; + prod = prod.times(sum); + } + return new _BigNumber(prod.toPrecision(_BigNumber.precision)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/kldivergence.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/kldivergence.js new file mode 100644 index 0000000..ed4c4de --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/kldivergence.js @@ -0,0 +1,77 @@ +import { factory } from '../../utils/factory.js'; +var name = 'kldivergence'; +var dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric']; +export var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + divide, + sum, + multiply, + map, + dotDivide, + log, + isNumeric + } = _ref; + /** + * Calculate the Kullback-Leibler (KL) divergence between two distributions + * + * Syntax: + * + * math.kldivergence(x, y) + * + * Examples: + * + * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153 + * + * + * @param {Array | Matrix} q First vector + * @param {Array | Matrix} p Second vector + * @return {number} Returns distance between q and p + */ + return typed(name, { + 'Array, Array': function Array_Array(q, p) { + return _kldiv(matrix(q), matrix(p)); + }, + 'Matrix, Array': function Matrix_Array(q, p) { + return _kldiv(q, matrix(p)); + }, + 'Array, Matrix': function Array_Matrix(q, p) { + return _kldiv(matrix(q), p); + }, + 'Matrix, Matrix': function Matrix_Matrix(q, p) { + return _kldiv(q, p); + } + }); + function _kldiv(q, p) { + var plength = p.size().length; + var qlength = q.size().length; + if (plength > 1) { + throw new Error('first object must be one dimensional'); + } + if (qlength > 1) { + throw new Error('second object must be one dimensional'); + } + if (plength !== qlength) { + throw new Error('Length of two vectors must be equal'); + } + + // Before calculation, apply normalization + var sumq = sum(q); + if (sumq === 0) { + throw new Error('Sum of elements in first object must be non zero'); + } + var sump = sum(p); + if (sump === 0) { + throw new Error('Sum of elements in second object must be non zero'); + } + var qnorm = divide(q, sum(q)); + var pnorm = divide(p, sum(p)); + var result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x)))); + if (isNumeric(result)) { + return result; + } else { + return Number.NaN; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/lgamma.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/lgamma.js new file mode 100644 index 0000000..4d45914 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/lgamma.js @@ -0,0 +1,137 @@ +/* eslint-disable no-loss-of-precision */ + +// References +// ---------- +// [1] Hare, "Computing the Principal Branch of log-Gamma", Journal of Algorithms, 1997. +// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments + +import { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js'; +import { factory } from '../../utils/factory.js'; +import { copysign } from '../../utils/number.js'; +var name = 'lgamma'; +var dependencies = ['Complex', 'typed']; +export var createLgamma = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Complex, + typed + } = _ref; + // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get + // sufficient accuracy. + // + // These two values are copied from Scipy implementation: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37 + var SMALL_RE = 7; + var SMALL_IM = 7; + + /** + * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1]. + * + * If you cannot access the paper, can also get these values from the formula in [2]. + * + * 1 / 12 = 0.00833333333333333333333333333333 + * 1 / 360 = 0.00277777777777777777777777777778 + * ... + * 3617 / 133400 = 0.02955065359477124183006535947712 + */ + var coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2]; + + /** + * Logarithm of the gamma function for real, positive numbers and complex numbers, + * using Lanczos approximation for numbers and Stirling series for complex numbers. + * + * Syntax: + * + * math.lgamma(n) + * + * Examples: + * + * math.lgamma(5) // returns 3.178053830347945 + * math.lgamma(0) // returns Infinity + * math.lgamma(-0.5) // returns NaN + * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i + * + * See also: + * + * gamma + * + * @param {number | Complex} n A real or complex number + * @return {number | Complex} The log gamma of `n` + */ + return typed(name, { + number: lgammaNumber, + Complex: lgammaComplex, + BigNumber: function BigNumber() { + throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber"); + } + }); + function lgammaComplex(n) { + var TWOPI = 6.2831853071795864769252842; // 2*pi + var LOGPI = 1.1447298858494001741434262; // log(pi) + + var REFLECTION = 0.1; + if (n.isNaN()) { + return new Complex(NaN, NaN); + } else if (n.im === 0) { + return new Complex(lgammaNumber(n.re), 0); + } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) { + return lgammaStirling(n); + } else if (n.re <= REFLECTION) { + // Reflection formula. see Proposition 3.1 in [1] + var tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25); + var a = n.mul(Math.PI).sin().log(); + var b = lgammaComplex(new Complex(1 - n.re, -n.im)); + return new Complex(LOGPI, tmp).sub(a).sub(b); + } else if (n.im >= 0) { + return lgammaRecurrence(n); + } else { + return lgammaRecurrence(n.conjugate()).conjugate(); + } + } + function lgammaStirling(z) { + // formula ref in [2] + // computation ref: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101 + + // left part + + // x (log(x) - 1) + 1/2 (log(2PI) - log(x)) + // => (x - 0.5) * log(x) - x + log(2PI) / 2 + var leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI); + + // right part + + var rz = new Complex(1, 0).div(z); + var rzz = rz.div(z); + var a = coeffs[0]; + var b = coeffs[1]; + var r = 2 * rzz.re; + var s = rzz.re * rzz.re + rzz.im * rzz.im; + for (var i = 2; i < 8; i++) { + var tmp = b; + b = -s * a + coeffs[i]; + a = r * a + tmp; + } + var rightPart = rz.mul(rzz.mul(a).add(b)); + + // plus left and right + + return leftPart.add(rightPart); + } + function lgammaRecurrence(z) { + // computation ref: + // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78 + + var signflips = 0; + var sb = 0; + var shiftprod = z; + z = z.add(1); + while (z.re <= SMALL_RE) { + shiftprod = shiftprod.mul(z); + var nsb = shiftprod.im < 0 ? 1 : 0; + if (nsb !== 0 && sb === 0) signflips++; + sb = nsb; + z = z.add(1); + } + return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/multinomial.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/multinomial.js new file mode 100644 index 0000000..76f2ae5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/multinomial.js @@ -0,0 +1,50 @@ +import { deepForEach } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'multinomial'; +var dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive']; +export var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + divide, + multiply, + factorial, + isInteger, + isPositive + } = _ref; + /** + * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. + * + * multinomial takes one array of integers as an argument. + * The following condition must be enforced: every ai <= 0 + * + * Syntax: + * + * math.multinomial(a) // a is an array type + * + * Examples: + * + * math.multinomial([1,2,1]) // returns 12 + * + * See also: + * + * combinations, factorial + * + * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset + * @return {Number | BigNumber} Multinomial coefficient. + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(a) { + var sum = 0; + var denom = 1; + deepForEach(a, function (ai) { + if (!isInteger(ai) || !isPositive(ai)) { + throw new TypeError('Positive integer value expected in function multinomial'); + } + sum = add(sum, ai); + denom = multiply(denom, factorial(ai)); + }); + return divide(factorial(sum), denom); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/permutations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/permutations.js new file mode 100644 index 0000000..8373396 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/permutations.js @@ -0,0 +1,78 @@ +import { isInteger } from '../../utils/number.js'; +import { product } from '../../utils/product.js'; +import { factory } from '../../utils/factory.js'; +var name = 'permutations'; +var dependencies = ['typed', 'factorial']; +export var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + factorial + } = _ref; + /** + * Compute the number of ways of obtaining an ordered subset of `k` elements + * from a set of `n` elements. + * + * Permutations only takes integer arguments. + * The following condition must be enforced: k <= n. + * + * Syntax: + * + * math.permutations(n) + * math.permutations(n, k) + * + * Examples: + * + * math.permutations(5) // 120 + * math.permutations(5, 3) // 60 + * + * See also: + * + * combinations, combinationsWithRep, factorial + * + * @param {number | BigNumber} n The number of objects in total + * @param {number | BigNumber} [k] The number of objects in the subset + * @return {number | BigNumber} The number of permutations + */ + return typed(name, { + 'number | BigNumber': factorial, + 'number, number': function number_number(n, k) { + if (!isInteger(n) || n < 0) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (!isInteger(k) || k < 0) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (k > n) { + throw new TypeError('second argument k must be less than or equal to first argument n'); + } + // Permute n objects, k at a time + return product(n - k + 1, n); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) { + var result, i; + if (!isPositiveInteger(n) || !isPositiveInteger(k)) { + throw new TypeError('Positive integer value expected in function permutations'); + } + if (k.gt(n)) { + throw new TypeError('second argument k must be less than or equal to first argument n'); + } + var one = n.mul(0).add(1); + result = one; + for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) { + result = result.times(i); + } + return result; + } + + // TODO: implement support for collection in permutations + }); +}); + +/** + * Test whether BigNumber n is a positive integer + * @param {BigNumber} n + * @returns {boolean} isPositiveInteger + */ +function isPositiveInteger(n) { + return n.isInteger() && n.gte(0); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/pickRandom.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/pickRandom.js new file mode 100644 index 0000000..b11c95c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/pickRandom.js @@ -0,0 +1,150 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { isMatrix, isNumber } from '../../utils/is.js'; +import { createRng } from './util/seededRNG.js'; +var name = 'pickRandom'; +var dependencies = ['typed', 'config', '?on']; +export var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + var rng = createRng(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = createRng(curr.randomSeed); + } + }); + } + + /** + * Random pick one or more values from a one dimensional array. + * Array elements are picked using a random function with uniform or weighted distribution. + * + * Syntax: + * + * math.pickRandom(array) + * math.pickRandom(array, number) + * math.pickRandom(array, weights) + * math.pickRandom(array, number, weights) + * math.pickRandom(array, weights, number) + * math.pickRandom(array, { weights, number, elementWise }) + * + * Examples: + * + * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array + * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array + * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array + * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution + * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution + * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution + * + * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false }) + * // returns one of the items in the array + * + * See also: + * + * random, randomInt + * + * @param {Array | Matrix} array A one dimensional array + * @param {Int} number An int or float + * @param {Array | Matrix} weights An array of ints or floats + * @return {number | Array} Returns a single random value from array when number is undefined. + * Returns an array with the configured number of elements when number is defined. + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(possibles) { + return _pickRandom(possibles, {}); + }, + 'Array | Matrix, Object': function Array__Matrix_Object(possibles, options) { + return _pickRandom(possibles, options); + }, + 'Array | Matrix, number': function Array__Matrix_number(possibles, number) { + return _pickRandom(possibles, { + number + }); + }, + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(possibles, weights) { + return _pickRandom(possibles, { + weights + }); + }, + 'Array | Matrix, Array | Matrix, number': function Array__Matrix_Array__Matrix_number(possibles, weights, number) { + return _pickRandom(possibles, { + number, + weights + }); + }, + 'Array | Matrix, number, Array | Matrix': function Array__Matrix_number_Array__Matrix(possibles, number, weights) { + return _pickRandom(possibles, { + number, + weights + }); + } + }); + + /** + * @param {Array | Matrix} possibles + * @param {{ + * number?: number, + * weights?: Array | Matrix, + * elementWise: boolean + * }} options + * @returns {number | Array} + * @private + */ + function _pickRandom(possibles, _ref2) { + var { + number, + weights, + elementWise = true + } = _ref2; + var single = typeof number === 'undefined'; + if (single) { + number = 1; + } + var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null; + possibles = possibles.valueOf(); // get Array + if (weights) { + weights = weights.valueOf(); // get Array + } + if (elementWise === true) { + possibles = flatten(possibles); + weights = flatten(weights); + } + var totalWeights = 0; + if (typeof weights !== 'undefined') { + if (weights.length !== possibles.length) { + throw new Error('Weights must have the same length as possibles'); + } + for (var i = 0, len = weights.length; i < len; i++) { + if (!isNumber(weights[i]) || weights[i] < 0) { + throw new Error('Weights must be an array of positive numbers'); + } + totalWeights += weights[i]; + } + } + var length = possibles.length; + var result = []; + var pick; + while (result.length < number) { + if (typeof weights === 'undefined') { + pick = possibles[Math.floor(rng() * length)]; + } else { + var randKey = rng() * totalWeights; + for (var _i = 0, _len = possibles.length; _i < _len; _i++) { + randKey -= weights[_i]; + if (randKey < 0) { + pick = possibles[_i]; + break; + } + } + } + result.push(pick); + } + return single ? result[0] : createMatrix ? createMatrix(result) : result; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/random.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/random.js new file mode 100644 index 0000000..dc2b5ff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/random.js @@ -0,0 +1,96 @@ +import { factory } from '../../utils/factory.js'; +import { isMatrix } from '../../utils/is.js'; +import { createRng } from './util/seededRNG.js'; +import { randomMatrix } from './util/randomMatrix.js'; +var name = 'random'; +var dependencies = ['typed', 'config', '?on']; +export var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + var rng = createRng(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = createRng(curr.randomSeed); + } + }); + } + + /** + * Return a random number larger or equal to `min` and smaller than `max` + * using a uniform distribution. + * + * Syntax: + * + * math.random() // generate a random number between 0 and 1 + * math.random(max) // generate a random number between 0 and max + * math.random(min, max) // generate a random number between min and max + * math.random(size) // generate a matrix with random numbers between 0 and 1 + * math.random(size, max) // generate a matrix with random numbers between 0 and max + * math.random(size, min, max) // generate a matrix with random numbers between min and max + * + * Examples: + * + * math.random() // returns a random number between 0 and 1 + * math.random(100) // returns a random number between 0 and 100 + * math.random(30, 40) // returns a random number between 30 and 40 + * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1 + * + * See also: + * + * randomInt, pickRandom + * + * @param {Array | Matrix} [size] If provided, an array or matrix with given + * size and filled with random values is returned + * @param {number} [min] Minimum boundary for the random value, included + * @param {number} [max] Maximum boundary for the random value, excluded + * @return {number | Array | Matrix} A random number + */ + return typed(name, { + '': () => _random(0, 1), + number: max => _random(0, max), + 'number, number': (min, max) => _random(min, max), + 'Array | Matrix': size => _randomMatrix(size, 0, 1), + 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max), + 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max) + }); + function _randomMatrix(size, min, max) { + var res = randomMatrix(size.valueOf(), () => _random(min, max)); + return isMatrix(size) ? size.create(res, 'number') : res; + } + function _random(min, max) { + return min + rng() * (max - min); + } +}); + +// number only implementation of random, no matrix support +// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that? +export var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => { + var { + typed, + config, + on, + matrix + } = _ref2; + // seeded pseudo random number generator1 + var rng = createRng(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = createRng(curr.randomSeed); + } + }); + } + return typed(name, { + '': () => _random(0, 1), + number: max => _random(0, max), + 'number, number': (min, max) => _random(min, max) + }); + function _random(min, max) { + return min + rng() * (max - min); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/randomInt.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/randomInt.js new file mode 100644 index 0000000..7e83618 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/randomInt.js @@ -0,0 +1,67 @@ +import { factory } from '../../utils/factory.js'; +import { randomMatrix } from './util/randomMatrix.js'; +import { createRng } from './util/seededRNG.js'; +import { isMatrix } from '../../utils/is.js'; +var name = 'randomInt'; +var dependencies = ['typed', 'config', '?on']; +export var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + on + } = _ref; + // seeded pseudo random number generator + var rng = createRng(config.randomSeed); + if (on) { + on('config', function (curr, prev) { + if (curr.randomSeed !== prev.randomSeed) { + rng = createRng(curr.randomSeed); + } + }); + } + + /** + * Return a random integer number larger or equal to `min` and smaller than `max` + * using a uniform distribution. + * + * Syntax: + * + * math.randomInt() // generate a random integer between 0 and 1 + * math.randomInt(max) // generate a random integer between 0 and max + * math.randomInt(min, max) // generate a random integer between min and max + * math.randomInt(size) // generate a matrix with random integer between 0 and 1 + * math.randomInt(size, max) // generate a matrix with random integer between 0 and max + * math.randomInt(size, min, max) // generate a matrix with random integer between min and max + * + * Examples: + * + * math.randomInt(100) // returns a random integer between 0 and 100 + * math.randomInt(30, 40) // returns a random integer between 30 and 40 + * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1 + * + * See also: + * + * random, pickRandom + * + * @param {Array | Matrix} [size] If provided, an array or matrix with given + * size and filled with random values is returned + * @param {number} [min] Minimum boundary for the random value, included + * @param {number} [max] Maximum boundary for the random value, excluded + * @return {number | Array | Matrix} A random integer value + */ + return typed(name, { + '': () => _randomInt(0, 1), + number: max => _randomInt(0, max), + 'number, number': (min, max) => _randomInt(min, max), + 'Array | Matrix': size => _randomIntMatrix(size, 0, 1), + 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max), + 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max) + }); + function _randomIntMatrix(size, min, max) { + var res = randomMatrix(size.valueOf(), () => _randomInt(min, max)); + return isMatrix(size) ? size.create(res, 'number') : res; + } + function _randomInt(min, max) { + return Math.floor(min + rng() * (max - min)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js new file mode 100644 index 0000000..385f991 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js @@ -0,0 +1,20 @@ +/** + * This is a util function for generating a random matrix recursively. + * @param {number[]} size + * @param {function} random + * @returns {Array} + */ +export function randomMatrix(size, random) { + var data = []; + size = size.slice(0); + if (size.length > 1) { + for (var i = 0, length = size.shift(); i < length; i++) { + data.push(randomMatrix(size, random)); + } + } else { + for (var _i = 0, _length = size.shift(); _i < _length; _i++) { + data.push(random()); + } + } + return data; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js new file mode 100644 index 0000000..9da3f78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js @@ -0,0 +1,19 @@ +import seedrandom from 'seedrandom'; +var singletonRandom = /* #__PURE__ */seedrandom(Date.now()); +export function createRng(randomSeed) { + var random; + + // create a new random generator with given seed + function setSeed(seed) { + random = seed === null ? singletonRandom : seedrandom(String(seed)); + } + + // initialize a seeded pseudo random number generator with config's random seed + setSeed(randomSeed); + + // wrapper function so the rng can be updated via generator + function rng() { + return random(); + } + return rng; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compare.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compare.js new file mode 100644 index 0000000..f579a8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compare.js @@ -0,0 +1,114 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'compare'; +var dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat']; +export var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + equalScalar, + matrix, + BigNumber, + Fraction, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo05xSfSf = createMatAlgo05xSfSf({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * + * x and y are considered equal when the relative difference between x and y + * is smaller than the configured absTol and relTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.compare(x, y) + * + * Examples: + * + * math.compare(6, 1) // returns 1 + * math.compare(2, 3) // returns -1 + * math.compare(7, 7) // returns 0 + * math.compare('10', '2') // returns 1 + * math.compare('1000', '1e3') // returns 0 + * + * const a = math.unit('5 cm') + * const b = math.unit('40 mm') + * math.compare(a, b) // returns 1 + * + * math.compare(2, [1, 2, 3]) // returns [1, 0, -1] + * + * See also: + * + * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText + * + * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare + * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, createCompareNumber({ + typed, + config + }), { + 'boolean, boolean': function boolean_boolean(x, y) { + return x === y ? 0 : x > y ? 1 : -1; + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y)); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x === y ? 0n : x > y ? 1n : -1n; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return new Fraction(x.compare(y)); + }, + 'Complex, Complex': function Complex_Complex() { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo05xSfSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareNatural.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareNatural.js new file mode 100644 index 0000000..04394fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareNatural.js @@ -0,0 +1,274 @@ +import naturalSort from 'javascript-natural-sort'; +import { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'compareNatural'; +var dependencies = ['typed', 'compare']; +export var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + compare + } = _ref; + var compareBooleans = compare.signatures['boolean,boolean']; + + /** + * Compare two values of any type in a deterministic, natural way. + * + * For numeric values, the function works the same as `math.compare`. + * For types of values that can't be compared mathematically, + * the function compares in a natural way. + * + * For numeric values, x and y are considered equal when the relative + * difference between x and y is smaller than the configured relTol and absTol. + * The function cannot be used to compare values smaller than + * approximately 2.22e-16. + * + * For Complex numbers, first the real parts are compared. If equal, + * the imaginary parts are compared. + * + * Strings are compared with a natural sorting algorithm, which + * orders strings in a "logic" way following some heuristics. + * This differs from the function `compare`, which converts the string + * into a numeric value and compares that. The function `compareText` + * on the other hand compares text lexically. + * + * Arrays and Matrices are compared value by value until there is an + * unequal pair of values encountered. Objects are compared by sorted + * keys until the keys or their values are unequal. + * + * Syntax: + * + * math.compareNatural(x, y) + * + * Examples: + * + * math.compareNatural(6, 1) // returns 1 + * math.compareNatural(2, 3) // returns -1 + * math.compareNatural(7, 7) // returns 0 + * + * math.compareNatural('10', '2') // returns 1 + * math.compareText('10', '2') // returns -1 + * math.compare('10', '2') // returns 1 + * + * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1 + * math.compareText('Answer: 10', 'Answer: 2') // returns -1 + * math.compare('Answer: 10', 'Answer: 2') + * // Error: Cannot convert "Answer: 10" to a number + * + * const a = math.unit('5 cm') + * const b = math.unit('40 mm') + * math.compareNatural(a, b) // returns 1 + * + * const c = math.complex('2 + 3i') + * const d = math.complex('2 + 4i') + * math.compareNatural(c, d) // returns -1 + * + * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1 + * math.compareNatural([1, 2, 3], [1, 2]) // returns 1 + * math.compareNatural([1, 5], [1, 2, 3]) // returns 1 + * math.compareNatural([1, 2], [1, 2]) // returns 0 + * + * math.compareNatural({a: 2}, {a: 4}) // returns -1 + * + * See also: + * + * compare, compareText + * + * @param {*} x First value to compare + * @param {*} y Second value to compare + * @return {number} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, { + 'any, any': _compareNatural + }); // just to check # args + + function _compareNatural(x, y) { + var typeX = typeOf(x); + var typeY = typeOf(y); + var c; + + // numeric types + if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) { + c = compare(x, y); + if (c.toString() !== '0') { + // c can be number, BigNumber, or Fraction + return c > 0 ? 1 : -1; // return a number + } else { + return naturalSort(typeX, typeY); + } + } + + // matrix types + var matTypes = ['Array', 'DenseMatrix', 'SparseMatrix']; + if (matTypes.includes(typeX) || matTypes.includes(typeY)) { + c = compareMatricesAndArrays(_compareNatural, x, y); + if (c !== 0) { + return c; + } else { + return naturalSort(typeX, typeY); + } + } + + // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex' + if (typeX !== typeY) { + return naturalSort(typeX, typeY); + } + if (typeX === 'Complex') { + return compareComplexNumbers(x, y); + } + if (typeX === 'Unit') { + if (x.equalBase(y)) { + return _compareNatural(x.value, y.value); + } + + // compare by units + return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits()); + } + if (typeX === 'boolean') { + return compareBooleans(x, y); + } + if (typeX === 'string') { + return naturalSort(x, y); + } + if (typeX === 'Object') { + return compareObjects(_compareNatural, x, y); + } + if (typeX === 'null') { + return 0; + } + if (typeX === 'undefined') { + return 0; + } + + // this should not occur... + throw new TypeError('Unsupported type of value "' + typeX + '"'); + } + + /** + * Compare mixed matrix/array types, by converting to same-shaped array. + * This comparator is non-deterministic regarding input types. + * @param {Array | SparseMatrix | DenseMatrix | *} x + * @param {Array | SparseMatrix | DenseMatrix | *} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareMatricesAndArrays(compareNatural, x, y) { + if (isSparseMatrix(x) && isSparseMatrix(y)) { + return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values); + } + if (isSparseMatrix(x)) { + // note: convert to array is expensive + return compareMatricesAndArrays(compareNatural, x.toArray(), y); + } + if (isSparseMatrix(y)) { + // note: convert to array is expensive + return compareMatricesAndArrays(compareNatural, x, y.toArray()); + } + + // convert DenseArray into Array + if (isDenseMatrix(x)) { + return compareMatricesAndArrays(compareNatural, x.toJSON().data, y); + } + if (isDenseMatrix(y)) { + return compareMatricesAndArrays(compareNatural, x, y.toJSON().data); + } + + // convert scalars to array + if (!Array.isArray(x)) { + return compareMatricesAndArrays(compareNatural, [x], y); + } + if (!Array.isArray(y)) { + return compareMatricesAndArrays(compareNatural, x, [y]); + } + return compareArrays(compareNatural, x, y); + } + + /** + * Compare two Arrays + * + * - First, compares value by value + * - Next, if all corresponding values are equal, + * look at the length: longest array will be considered largest + * + * @param {Array} x + * @param {Array} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareArrays(compareNatural, x, y) { + // compare each value + for (var i = 0, ii = Math.min(x.length, y.length); i < ii; i++) { + var v = compareNatural(x[i], y[i]); + if (v !== 0) { + return v; + } + } + + // compare the size of the arrays + if (x.length > y.length) { + return 1; + } + if (x.length < y.length) { + return -1; + } + + // both Arrays have equal size and content + return 0; + } + + /** + * Compare two objects + * + * - First, compare sorted property names + * - Next, compare the property values + * + * @param {Object} x + * @param {Object} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + function compareObjects(compareNatural, x, y) { + var keysX = Object.keys(x); + var keysY = Object.keys(y); + + // compare keys + keysX.sort(naturalSort); + keysY.sort(naturalSort); + var c = compareArrays(compareNatural, keysX, keysY); + if (c !== 0) { + return c; + } + + // compare values + for (var i = 0; i < keysX.length; i++) { + var v = compareNatural(x[keysX[i]], y[keysY[i]]); + if (v !== 0) { + return v; + } + } + return 0; + } +}); + +/** + * Compare two complex numbers, `x` and `y`: + * + * - First, compare the real values of `x` and `y` + * - If equal, compare the imaginary values of `x` and `y` + * + * @params {Complex} x + * @params {Complex} y + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ +function compareComplexNumbers(x, y) { + if (x.re > y.re) { + return 1; + } + if (x.re < y.re) { + return -1; + } + if (x.im > y.im) { + return 1; + } + if (x.im < y.im) { + return -1; + } + return 0; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareText.js new file mode 100644 index 0000000..4f25378 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareText.js @@ -0,0 +1,57 @@ +import { compareText as _compareText } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'compareText'; +var dependencies = ['typed', 'matrix', 'concat']; +_compareText.signature = 'any, any'; +export var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + concat + } = _ref; + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Compare two strings lexically. Comparison is case sensitive. + * Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.compareText(x, y) + * + * Examples: + * + * math.compareText('B', 'A') // returns 1 + * math.compareText('2', '10') // returns 1 + * math.compare('2', '10') // returns -1 + * math.compareNatural('2', '10') // returns -1 + * + * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1] + * + * See also: + * + * equal, equalText, compare, compareNatural + * + * @param {string | Array | DenseMatrix} x First string to compare + * @param {string | Array | DenseMatrix} y Second string to compare + * @return {number | Array | DenseMatrix} Returns the result of the comparison: + * 1 when x > y, -1 when x < y, and 0 when x == y. + */ + return typed(name, _compareText, matrixAlgorithmSuite({ + elop: _compareText, + Ds: true + })); +}); +export var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => { + var { + typed + } = _ref2; + return typed(name, _compareText); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareUnits.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareUnits.js new file mode 100644 index 0000000..b3f2dda --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/compareUnits.js @@ -0,0 +1,14 @@ +import { factory } from '../../utils/factory.js'; +export var createCompareUnits = /* #__PURE__ */factory('compareUnits', ['typed'], _ref => { + var { + typed + } = _ref; + return { + 'Unit, Unit': typed.referToSelf(self => (x, y) => { + if (!x.equalBase(y)) { + throw new Error('Cannot compare units with different base'); + } + return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value); + }) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/deepEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/deepEqual.js new file mode 100644 index 0000000..36f1db1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/deepEqual.js @@ -0,0 +1,74 @@ +import { factory } from '../../utils/factory.js'; +var name = 'deepEqual'; +var dependencies = ['typed', 'equal']; +export var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equal + } = _ref; + /** + * Test element wise whether two matrices are equal. + * The function accepts both matrices and scalar values. + * + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.deepEqual(x, y) + * + * Examples: + * + * math.deepEqual(2, 4) // returns false + * + * a = [2, 5, 1] + * b = [2, 7, 1] + * + * math.deepEqual(a, b) // returns false + * math.equal(a, b) // returns [true, false, true] + * + * See also: + * + * equal, unequal + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} + * Returns true when the input matrices have the same size and each of their elements is equal. + */ + return typed(name, { + 'any, any': function any_any(x, y) { + return _deepEqual(x.valueOf(), y.valueOf()); + } + }); + + /** + * Test whether two arrays have the same size and all elements are equal + * @param {Array | *} x + * @param {Array | *} y + * @return {boolean} Returns true if both arrays are deep equal + */ + function _deepEqual(x, y) { + if (Array.isArray(x)) { + if (Array.isArray(y)) { + var len = x.length; + if (len !== y.length) { + return false; + } + for (var i = 0; i < len; i++) { + if (!_deepEqual(x[i], y[i])) { + return false; + } + } + return true; + } else { + return false; + } + } else { + if (Array.isArray(y)) { + return false; + } else { + return equal(x, y); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equal.js new file mode 100644 index 0000000..f0b7211 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equal.js @@ -0,0 +1,110 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'equal'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat']; +export var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is + * smaller than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. + * + * Values `null` and `undefined` are compared strictly, thus `null` is only + * equal to `null` and nothing else, and `undefined` is only equal to + * `undefined` and nothing else. Strings are compared by their numerical value. + * + * Syntax: + * + * math.equal(x, y) + * + * Examples: + * + * math.equal(2 + 2, 3) // returns false + * math.equal(2 + 2, 4) // returns true + * + * const a = math.unit('50 cm') + * const b = math.unit('5 m') + * math.equal(a, b) // returns true + * + * const c = [2, 5, 1] + * const d = [2, 7, 1] + * + * math.equal(c, d) // returns [true, false, true] + * math.deepEqual(c, d) // returns false + * + * math.equal("1000", "1e3") // returns true + * math.equal(0, null) // returns false + * + * See also: + * + * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText + * + * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false + */ + return typed(name, createEqualNumber({ + typed, + equalScalar + }), matrixAlgorithmSuite({ + elop: equalScalar, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => { + var { + typed, + equalScalar + } = _ref2; + return typed(name, { + 'any, any': function any_any(x, y) { + // strict equality for null and undefined? + if (x === null) { + return y === null; + } + if (y === null) { + return x === null; + } + if (x === undefined) { + return y === undefined; + } + if (y === undefined) { + return x === undefined; + } + return equalScalar(x, y); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalScalar.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalScalar.js new file mode 100644 index 0000000..4d545d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalScalar.js @@ -0,0 +1,56 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { complexEquals } from '../../utils/complex.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'equalScalar'; +var dependencies = ['typed', 'config']; +export var createEqualScalar = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config + } = _ref; + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Test whether two scalar values are nearly equal. + * + * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare + * @return {boolean} Returns true when the compared values are equal, else returns false + * @private + */ + return typed(name, { + 'boolean, boolean': function boolean_boolean(x, y) { + return x === y; + }, + 'number, number': function number_number(x, y) { + return nearlyEqual(x, y, config.relTol, config.absTol); + }, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x === y; + }, + 'Fraction, Fraction': function Fraction_Fraction(x, y) { + return x.equals(y); + }, + 'Complex, Complex': function Complex_Complex(x, y) { + return complexEquals(x, y, config.relTol, config.absTol); + } + }, compareUnits); +}); +export var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return nearlyEqual(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalText.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalText.js new file mode 100644 index 0000000..56f8206 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/equalText.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +var name = 'equalText'; +var dependencies = ['typed', 'compareText', 'isZero']; +export var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + compareText, + isZero + } = _ref; + /** + * Check equality of two strings. Comparison is case sensitive. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.equalText(x, y) + * + * Examples: + * + * math.equalText('Hello', 'Hello') // returns true + * math.equalText('a', 'A') // returns false + * math.equal('2e3', '2000') // returns true + * math.equalText('2e3', '2000') // returns false + * + * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false] + * + * See also: + * + * equal, compareText, compare, compareNatural + * + * @param {string | Array | DenseMatrix} x First string to compare + * @param {string | Array | DenseMatrix} y Second string to compare + * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not. + */ + return typed(name, { + 'any, any': function any_any(x, y) { + return isZero(compareText(x, y)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/larger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/larger.js new file mode 100644 index 0000000..d9ff020 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/larger.js @@ -0,0 +1,99 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'larger'; +var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +export var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Test whether value x is larger than y. + * + * The function returns true when x is larger than y and the relative + * difference between x and y is larger than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.larger(x, y) + * + * Examples: + * + * math.larger(2, 3) // returns false + * math.larger(5, 2 + 2) // returns true + * + * const a = math.unit('5 cm') + * const b = math.unit('2 inch') + * math.larger(a, b) // returns false + * + * See also: + * + * equal, unequal, smaller, smallerEq, largerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false + */ + return typed(name, createLargerNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x > y, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x > y, + 'Fraction, Fraction': (x, y) => x.compare(y) === 1, + 'Complex, Complex': function Complex_Complex() { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return x > y && !nearlyEqual(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/largerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/largerEq.js new file mode 100644 index 0000000..b2105e6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/largerEq.js @@ -0,0 +1,97 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'largerEq'; +var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +export var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Test whether value x is larger or equal to y. + * + * The function returns true when x is larger than y or the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.largerEq(x, y) + * + * Examples: + * + * math.larger(2, 1 + 1) // returns false + * math.largerEq(2, 1 + 1) // returns true + * + * See also: + * + * equal, unequal, smaller, smallerEq, larger, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false + */ + return typed(name, createLargerEqNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x >= y, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': function bigint_bigint(x, y) { + return x >= y; + }, + 'Fraction, Fraction': (x, y) => x.compare(y) !== -1, + 'Complex, Complex': function Complex_Complex() { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return x >= y || nearlyEqual(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smaller.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smaller.js new file mode 100644 index 0000000..22227bc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smaller.js @@ -0,0 +1,99 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'smaller'; +var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +export var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Test whether value x is smaller than y. + * + * The function returns true when x is smaller than y and the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.smaller(x, y) + * + * Examples: + * + * math.smaller(2, 3) // returns true + * math.smaller(5, 2 * 2) // returns false + * + * const a = math.unit('5 cm') + * const b = math.unit('2 inch') + * math.smaller(a, b) // returns true + * + * See also: + * + * equal, unequal, smallerEq, smaller, smallerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false + */ + return typed(name, createSmallerNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x < y, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x < y, + 'Fraction, Fraction': (x, y) => x.compare(y) === -1, + 'Complex, Complex': function Complex_Complex(x, y) { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return x < y && !nearlyEqual(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smallerEq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smallerEq.js new file mode 100644 index 0000000..bc049c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/smallerEq.js @@ -0,0 +1,95 @@ +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +import { createCompareUnits } from './compareUnits.js'; +var name = 'smallerEq'; +var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat']; +export var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + var compareUnits = createCompareUnits({ + typed + }); + + /** + * Test whether value x is smaller or equal to y. + * + * The function returns true when x is smaller than y or the relative + * difference between x and y is smaller than the configured relTol and absTol. The + * function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * Strings are compared by their numerical value. + * + * Syntax: + * + * math.smallerEq(x, y) + * + * Examples: + * + * math.smaller(1 + 2, 3) // returns false + * math.smallerEq(1 + 2, 3) // returns true + * + * See also: + * + * equal, unequal, smaller, larger, largerEq, compare + * + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare + * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false + */ + return typed(name, createSmallerEqNumber({ + typed, + config + }), { + 'boolean, boolean': (x, y) => x <= y, + 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) { + return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol); + }, + 'bigint, bigint': (x, y) => x <= y, + 'Fraction, Fraction': (x, y) => x.compare(y) !== 1, + 'Complex, Complex': function Complex_Complex() { + throw new TypeError('No ordering relation is defined for complex numbers'); + } + }, compareUnits, matrixAlgorithmSuite({ + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); +}); +export var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => { + var { + typed, + config + } = _ref2; + return typed(name, { + 'number, number': function number_number(x, y) { + return x <= y || nearlyEqual(x, y, config.relTol, config.absTol); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/unequal.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/unequal.js new file mode 100644 index 0000000..271146d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/relational/unequal.js @@ -0,0 +1,113 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'unequal'; +var dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat']; +export var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + equalScalar, + matrix, + DenseMatrix, + concat + } = _ref; + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo07xSSf = createMatAlgo07xSSf({ + typed, + DenseMatrix + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Test whether two values are unequal. + * + * The function tests whether the relative difference between x and y is + * larger than the configured relTol and absTol. The function cannot be used to compare + * values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. + * Strings are compared by their numerical value. + * + * Values `null` and `undefined` are compared strictly, thus `null` is unequal + * with everything except `null`, and `undefined` is unequal with everything + * except `undefined`. + * + * Syntax: + * + * math.unequal(x, y) + * + * Examples: + * + * math.unequal(2 + 2, 3) // returns true + * math.unequal(2 + 2, 4) // returns false + * + * const a = math.unit('50 cm') + * const b = math.unit('5 m') + * math.unequal(a, b) // returns false + * + * const c = [2, 5, 1] + * const d = [2, 7, 1] + * + * math.unequal(c, d) // returns [false, true, false] + * math.deepEqual(c, d) // returns false + * + * math.unequal(0, null) // returns true + * See also: + * + * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare + * + * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare + * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare + * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false + */ + return typed(name, createUnequalNumber({ + typed, + equalScalar + }), matrixAlgorithmSuite({ + elop: _unequal, + SS: matAlgo07xSSf, + DS: matAlgo03xDSf, + Ss: matAlgo12xSfs + })); + function _unequal(x, y) { + return !equalScalar(x, y); + } +}); +export var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 => { + var { + typed, + equalScalar + } = _ref2; + return typed(name, { + 'any, any': function any_any(x, y) { + // strict equality for null and undefined? + if (x === null) { + return y !== null; + } + if (y === null) { + return x !== null; + } + if (x === undefined) { + return y !== undefined; + } + if (y === undefined) { + return x !== undefined; + } + return !equalScalar(x, y); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setCartesian.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setCartesian.js new file mode 100644 index 0000000..275d0d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setCartesian.js @@ -0,0 +1,58 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setCartesian'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +export var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the cartesian product of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays + * and the values will be sorted in ascending order before the operation. + * + * Syntax: + * + * math.setCartesian(set1, set2) + * + * Examples: + * + * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]] + * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]] + * + * See also: + * + * setUnion, setIntersect, setDifference, setPowerset + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The cartesian product of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + var result = []; + if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) { + // if any of them is empty, return empty + var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural); + var b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural); + result = []; + for (var i = 0; i < b1.length; i++) { + for (var j = 0; j < b2.length; j++) { + result.push([b1[i], b2[j]]); + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return result; + } + // return a matrix otherwise + return new DenseMatrix(result); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDifference.js new file mode 100644 index 0000000..94688d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDifference.js @@ -0,0 +1,71 @@ +import { flatten, generalize, identify } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setDifference'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +export var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the difference of two (multi)sets: every element of set1, that is not the element of set2. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setDifference(set1, set2) + * + * Examples: + * + * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2] + * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2] + * + * See also: + * + * setUnion, setIntersect, setSymDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The difference of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + var result; + if (subset(size(a1), new Index(0)) === 0) { + // empty-anything=empty + result = []; + } else if (subset(size(a2), new Index(0)) === 0) { + // anything-empty=anything + return flatten(a1.toArray()); + } else { + var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + result = []; + var inb2; + for (var i = 0; i < b1.length; i++) { + inb2 = false; + for (var j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + inb2 = true; + break; + } + } + if (!inb2) { + result.push(b1[i]); + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return generalize(result); + } + // return a matrix otherwise + return new DenseMatrix(generalize(result)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDistinct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDistinct.js new file mode 100644 index 0000000..a4f9abd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setDistinct.js @@ -0,0 +1,57 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setDistinct'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +export var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Collect the distinct elements of a multiset. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setDistinct(set) + * + * Examples: + * + * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3] + * + * See also: + * + * setMultiplicity + * + * @param {Array | Matrix} a A multiset + * @return {Array | Matrix} A set containing the distinc elements of the multiset + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(a) { + var result; + if (subset(size(a), new Index(0)) === 0) { + // if empty, return empty + result = []; + } else { + var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + result = []; + result.push(b[0]); + for (var i = 1; i < b.length; i++) { + if (compareNatural(b[i], b[i - 1]) !== 0) { + result.push(b[i]); + } + } + } + // return an array, if the input was an array + if (Array.isArray(a)) { + return result; + } + // return a matrix otherwise + return new DenseMatrix(result); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIntersect.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIntersect.js new file mode 100644 index 0000000..f88e1a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIntersect.js @@ -0,0 +1,63 @@ +import { flatten, generalize, identify } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setIntersect'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix']; +export var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index, + DenseMatrix + } = _ref; + /** + * Create the intersection of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setIntersect(set1, set2) + * + * Examples: + * + * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4] + * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4] + * + * See also: + * + * setUnion, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The intersection of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + var result; + if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) { + // of any of them is empty, return empty + result = []; + } else { + var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + result = []; + for (var i = 0; i < b1.length; i++) { + for (var j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + result.push(b1[i]); + break; + } + } + } + } + // return an array, if both inputs were arrays + if (Array.isArray(a1) && Array.isArray(a2)) { + return generalize(result); + } + // return a matrix otherwise + return new DenseMatrix(generalize(result)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIsSubset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIsSubset.js new file mode 100644 index 0000000..a1b353e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setIsSubset.js @@ -0,0 +1,62 @@ +import { flatten, identify } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setIsSubset'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +export var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.) + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setIsSubset(set1, set2) + * + * Examples: + * + * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false + * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + if (subset(size(a1), new Index(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 + return false; + } + var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)); + var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)); + var inb2; + for (var i = 0; i < b1.length; i++) { + inb2 = false; + for (var j = 0; j < b2.length; j++) { + if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) { + // the identifier is always a decimal int + inb2 = true; + break; + } + } + if (inb2 === false) { + return false; + } + } + return true; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js new file mode 100644 index 0000000..57dc237 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js @@ -0,0 +1,50 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setMultiplicity'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +export var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Count the multiplicity of an element in a multiset. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setMultiplicity(element, set) + * + * Examples: + * + * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1 + * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2 + * + * See also: + * + * setDistinct, setSize + * + * @param {number | BigNumber | Fraction | Complex} e An element in the multiset + * @param {Array | Matrix} a A multiset + * @return {number} The number of how many times the multiset contains the element + */ + return typed(name, { + 'number | BigNumber | Fraction | Complex, Array | Matrix': function number__BigNumber__Fraction__Complex_Array__Matrix(e, a) { + if (subset(size(a), new Index(0)) === 0) { + // if empty, return 0 + return 0; + } + var b = flatten(Array.isArray(a) ? a : a.toArray()); + var count = 0; + for (var i = 0; i < b.length; i++) { + if (compareNatural(b[i], e) === 0) { + count++; + } + } + return count; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setPowerset.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setPowerset.js new file mode 100644 index 0000000..0cdfd83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setPowerset.js @@ -0,0 +1,75 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setPowerset'; +var dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index']; +export var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + subset, + compareNatural, + Index + } = _ref; + /** + * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.) + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setPowerset(set) + * + * Examples: + * + * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]] + * + * See also: + * + * setCartesian + * + * @param {Array | Matrix} a A (multi)set + * @return {Array} The powerset of the (multi)set + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(a) { + if (subset(size(a), new Index(0)) === 0) { + // if empty, return empty + return []; + } + var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + var result = []; + var number = 0; + while (number.toString(2).length <= b.length) { + result.push(_subset(b, number.toString(2).split('').reverse())); + number++; + } + // can not return a matrix, because of the different size of the subarrays + return _sort(result); + } + }); + + // create subset + function _subset(array, bitarray) { + var result = []; + for (var i = 0; i < bitarray.length; i++) { + if (bitarray[i] === '1') { + result.push(array[i]); + } + } + return result; + } + + // sort subsests by length + function _sort(array) { + var temp = []; + for (var i = array.length - 1; i > 0; i--) { + for (var j = 0; j < i; j++) { + if (array[j].length > array[j + 1].length) { + temp = array[j]; + array[j] = array[j + 1]; + array[j + 1] = temp; + } + } + } + return array; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSize.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSize.js new file mode 100644 index 0000000..3d374eb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSize.js @@ -0,0 +1,51 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setSize'; +var dependencies = ['typed', 'compareNatural']; +export var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + compareNatural + } = _ref; + /** + * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values. + * A multi-dimension array will be converted to a single-dimension array before the operation. + * + * Syntax: + * + * math.setSize(set) + * math.setSize(set, unique) + * + * Examples: + * + * math.setSize([1, 2, 2, 4]) // returns 4 + * math.setSize([1, 2, 2, 4], true) // returns 3 + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a A multiset + * @param {boolean} [unique] If true, only the unique values are counted. False by default + * @return {number} The number of elements of the (multi)set + */ + return typed(name, { + 'Array | Matrix': function Array__Matrix(a) { + return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length; + }, + 'Array | Matrix, boolean': function Array__Matrix_boolean(a, unique) { + if (unique === false || a.length === 0) { + return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length; + } else { + var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural); + var count = 1; + for (var i = 1; i < b.length; i++) { + if (compareNatural(b[i], b[i - 1]) !== 0) { + count++; + } + } + return count; + } + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSymDifference.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSymDifference.js new file mode 100644 index 0000000..4c8fa96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setSymDifference.js @@ -0,0 +1,48 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setSymDifference'; +var dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index']; +export var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + concat, + subset, + setDifference, + Index + } = _ref; + /** + * Create the symmetric difference of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setSymDifference(set1, set2) + * + * Examples: + * + * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6] + * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6] + * + * See also: + * + * setUnion, setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The symmetric difference of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + if (subset(size(a1), new Index(0)) === 0) { + // if any of them is empty, return the other one + return flatten(a2); + } else if (subset(size(a2), new Index(0)) === 0) { + return flatten(a1); + } + var b1 = flatten(a1); + var b2 = flatten(a2); + return concat(setDifference(b1, b2), setDifference(b2, b1)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setUnion.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setUnion.js new file mode 100644 index 0000000..d069770 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/set/setUnion.js @@ -0,0 +1,49 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'setUnion'; +var dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index']; +export var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + size, + concat, + subset, + setIntersect, + setSymDifference, + Index + } = _ref; + /** + * Create the union of two (multi)sets. + * Multi-dimension arrays will be converted to single-dimension arrays before the operation. + * + * Syntax: + * + * math.setUnion(set1, set2) + * + * Examples: + * + * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6] + * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6] + * + * See also: + * + * setIntersect, setDifference + * + * @param {Array | Matrix} a1 A (multi)set + * @param {Array | Matrix} a2 A (multi)set + * @return {Array | Matrix} The union of two (multi)sets + */ + return typed(name, { + 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) { + if (subset(size(a1), new Index(0)) === 0) { + // if any of them is empty, return the other one + return flatten(a2); + } else if (subset(size(a2), new Index(0)) === 0) { + return flatten(a1); + } + var b1 = flatten(a1); + var b2 = flatten(a2); + return concat(setSymDifference(b1, b2), setIntersect(b1, b2)); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/freqz.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/freqz.js new file mode 100644 index 0000000..0e58161 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/freqz.js @@ -0,0 +1,115 @@ +import { factory } from '../../utils/factory.js'; +var name = 'freqz'; +var dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix']; +export var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + multiply, + Complex, + divide, + matrix + } = _ref; + /** + * Calculates the frequency response of a filter given its numerator and denominator coefficients. + * + * Syntax: + * math.freqz(b, a) + * math.freqz(b, a, w) + * + * Examples: + * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] } + * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] } + * + * See also: + * zpk2tf + * + * @param {Array.} b The numerator coefficients of the filter. + * @param {Array.} a The denominator coefficients of the filter. + * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points) + * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed. + * + * + */ + return typed(name, { + 'Array, Array': function Array_Array(b, a) { + var w = createBins(512); + return _freqz(b, a, w); + }, + 'Array, Array, Array': function Array_Array_Array(b, a, w) { + return _freqz(b, a, w); + }, + 'Array, Array, number': function Array_Array_number(b, a, w) { + if (w < 0) { + throw new Error('w must be a positive number'); + } + var w2 = createBins(w); + return _freqz(b, a, w2); + }, + 'Matrix, Matrix': function Matrix_Matrix(b, a) { + // console.log('here') + var _w = createBins(512); + var { + w, + h + } = _freqz(b.valueOf(), a.valueOf(), _w); + return { + w: matrix(w), + h: matrix(h) + }; + }, + 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(b, a, w) { + var { + h + } = _freqz(b.valueOf(), a.valueOf(), w.valueOf()); + return { + h: matrix(h), + w: matrix(w) + }; + }, + 'Matrix, Matrix, number': function Matrix_Matrix_number(b, a, w) { + if (w < 0) { + throw new Error('w must be a positive number'); + } + var _w = createBins(w); + var { + h + } = _freqz(b.valueOf(), a.valueOf(), _w); + return { + h: matrix(h), + w: matrix(_w) + }; + } + }); + function _freqz(b, a, w) { + var num = []; + var den = []; + for (var i = 0; i < w.length; i++) { + var sumNum = Complex(0, 0); + var sumDen = Complex(0, 0); + for (var j = 0; j < b.length; j++) { + sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i])))); + } + for (var _j = 0; _j < a.length; _j++) { + sumDen = add(sumDen, multiply(a[_j], Complex(Math.cos(-_j * w[i]), Math.sin(-_j * w[i])))); + } + num.push(sumNum); + den.push(sumDen); + } + var h = []; + for (var _i = 0; _i < num.length; _i++) { + h.push(divide(num[_i], den[_i])); + } + return { + h, + w + }; + } + function createBins(n) { + var bins = []; + for (var i = 0; i < n; i++) { + bins.push(i / n * Math.PI); + } + return bins; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js new file mode 100644 index 0000000..e378c83 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js @@ -0,0 +1,82 @@ +import { factory } from '../../utils/factory.js'; +var name = 'zpk2tf'; +var dependencies = ['typed', 'add', 'multiply', 'Complex', 'number']; +export var createZpk2tf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + multiply, + Complex, + number + } = _ref; + /** + * Compute the transfer function of a zero-pole-gain model. + * + * Syntax: + * math.zpk2tf(z, p, k) + * + * Examples: + * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]] + * + * See also: + * freqz + * + * @param {Array} z Array of zeros values + * @param {Array} p Array of poles values + * @param {number} k Gain value + * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials + * + */ + return typed(name, { + 'Array,Array,number': function ArrayArrayNumber(z, p, k) { + return _zpk2tf(z, p, k); + }, + 'Array,Array': function ArrayArray(z, p) { + return _zpk2tf(z, p, 1); + }, + 'Matrix,Matrix,number': function MatrixMatrixNumber(z, p, k) { + return _zpk2tf(z.valueOf(), p.valueOf(), k); + }, + 'Matrix,Matrix': function MatrixMatrix(z, p) { + return _zpk2tf(z.valueOf(), p.valueOf(), 1); + } + }); + function _zpk2tf(z, p, k) { + // if z is bignumber, convert it to number + if (z.some(el => el.type === 'BigNumber')) { + z = z.map(el => number(el)); + } + // if p is bignumber, convert it to number + if (p.some(el => el.type === 'BigNumber')) { + p = p.map(el => number(el)); + } + var num = [Complex(1, 0)]; + var den = [Complex(1, 0)]; + for (var i = 0; i < z.length; i++) { + var zero = z[i]; + if (typeof zero === 'number') zero = Complex(zero, 0); + num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]); + } + for (var _i = 0; _i < p.length; _i++) { + var pole = p[_i]; + if (typeof pole === 'number') pole = Complex(pole, 0); + den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]); + } + for (var _i2 = 0; _i2 < num.length; _i2++) { + num[_i2] = multiply(num[_i2], k); + } + return [num, den]; + } + function _multiply(a, b) { + var c = []; + for (var i = 0; i < a.length + b.length - 1; i++) { + c[i] = Complex(0, 0); + for (var j = 0; j < a.length; j++) { + if (i - j >= 0 && i - j < b.length) { + c[i] = add(c[i], multiply(a[j], b[i - j])); + } + } + } + return c; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/erf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/erf.js new file mode 100644 index 0000000..194a879 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/erf.js @@ -0,0 +1,155 @@ +/* eslint-disable no-loss-of-precision */ + +import { deepMap } from '../../utils/collection.js'; +import { sign } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'erf'; +var dependencies = ['typed']; +export var createErf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Compute the erf function of a value using a rational Chebyshev + * approximations for different intervals of x. + * + * This is a translation of W. J. Cody's Fortran implementation from 1987 + * ( https://www.netlib.org/specfun/erf ). See the AMS publication + * "Rational Chebyshev Approximations for the Error Function" by W. J. Cody + * for an explanation of this process. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.erf(x) + * + * Examples: + * + * math.erf(0.2) // returns 0.22270258921047847 + * math.erf(-0.5) // returns -0.5204998778130465 + * math.erf(4) // returns 0.9999999845827421 + * + * See also: + * zeta + * + * @param {number | Array | Matrix} x A real number + * @return {number | Array | Matrix} The erf of `x` + */ + return typed('name', { + number: function number(x) { + var y = Math.abs(x); + if (y >= MAX_NUM) { + return sign(x); + } + if (y <= THRESH) { + return sign(x) * erf1(y); + } + if (y <= 4.0) { + return sign(x) * (1 - erfc2(y)); + } + return sign(x) * (1 - erfc3(y)); + }, + 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self)) + + // TODO: For complex numbers, use the approximation for the Faddeeva function + // from "More Efficient Computation of the Complex Error Function" (AMS) + }); + + /** + * Approximates the error function erf() for x <= 0.46875 using this function: + * n + * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j)) + * j=0 + */ + function erf1(y) { + var ysq = y * y; + var xnum = P[0][4] * ysq; + var xden = ysq; + var i; + for (i = 0; i < 3; i += 1) { + xnum = (xnum + P[0][i]) * ysq; + xden = (xden + Q[0][i]) * ysq; + } + return y * (xnum + P[0][3]) / (xden + Q[0][3]); + } + + /** + * Approximates the complement of the error function erfc() for + * 0.46875 <= x <= 4.0 using this function: + * n + * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j) + * j=0 + */ + function erfc2(y) { + var xnum = P[1][8] * y; + var xden = y; + var i; + for (i = 0; i < 7; i += 1) { + xnum = (xnum + P[1][i]) * y; + xden = (xden + Q[1][i]) * y; + } + var result = (xnum + P[1][7]) / (xden + Q[1][7]); + var ysq = parseInt(y * 16) / 16; + var del = (y - ysq) * (y + ysq); + return Math.exp(-ysq * ysq) * Math.exp(-del) * result; + } + + /** + * Approximates the complement of the error function erfc() for x > 4.0 using + * this function: + * + * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) + + * n + * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ] + * j=0 + */ + function erfc3(y) { + var ysq = 1 / (y * y); + var xnum = P[2][5] * ysq; + var xden = ysq; + var i; + for (i = 0; i < 4; i += 1) { + xnum = (xnum + P[2][i]) * ysq; + xden = (xden + Q[2][i]) * ysq; + } + var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]); + result = (SQRPI - result) / y; + ysq = parseInt(y * 16) / 16; + var del = (y - ysq) * (y + ysq); + return Math.exp(-ysq * ysq) * Math.exp(-del) * result; + } +}); + +/** + * Upper bound for the first approximation interval, 0 <= x <= THRESH + * @constant + */ +var THRESH = 0.46875; + +/** + * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi) + * @constant + */ +var SQRPI = 5.6418958354775628695e-1; + +/** + * Coefficients for each term of the numerator sum (p_j) for each approximation + * interval (see W. J. Cody's paper for more details) + * @constant + */ +var P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]]; + +/** + * Coefficients for each term of the denominator sum (q_j) for each approximation + * interval (see W. J. Cody's paper for more details) + * @constant + */ +var Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]]; + +/** + * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is + * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will + * return 1 + */ +var MAX_NUM = Math.pow(2, 53); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/zeta.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/zeta.js new file mode 100644 index 0000000..59562d3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/special/zeta.js @@ -0,0 +1,148 @@ +import { factory } from '../../utils/factory.js'; +var name = 'zeta'; +var dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi']; +export var createZeta = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + multiply, + pow, + divide, + factorial, + equal, + smallerEq, + isNegative, + gamma, + sin, + subtract, + add, + Complex, + BigNumber: _BigNumber, + pi + } = _ref; + /** + * Compute the Riemann Zeta function of a value using an infinite series for + * all of the complex plane using Riemann's Functional equation. + * + * Based off the paper by Xavier Gourdon and Pascal Sebah + * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf ) + * + * Implementation and slight modification by Anik Patel + * + * Note: the implementation is accurate up to about 6 digits. + * + * Syntax: + * + * math.zeta(n) + * + * Examples: + * + * math.zeta(5) // returns 1.0369277551433895 + * math.zeta(-0.5) // returns -0.2078862249773449 + * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i + * + * See also: + * erf + * + * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function + * @return {number | Complex | BigNumber} The Riemann Zeta of `s` + */ + return typed(name, { + number: s => zetaNumeric(s, value => value, () => 20), + BigNumber: s => zetaNumeric(s, value => new _BigNumber(value), () => { + // relTol is for example 1e-12. Extract the positive exponent 12 from that + return Math.abs(Math.log10(config.relTol)); + }), + Complex: zetaComplex + }); + + /** + * @param {number | BigNumber} s + * @param {(value: number) => number | BigNumber} createValue + * @param {(value: number | BigNumber | Complex) => number} determineDigits + * @returns {number | BigNumber} + */ + function zetaNumeric(s, createValue, determineDigits) { + if (equal(s, 0)) { + return createValue(-0.5); + } + if (equal(s, 1)) { + return createValue(NaN); + } + if (!isFinite(s)) { + return isNegative(s) ? createValue(NaN) : createValue(1); + } + return zeta(s, createValue, determineDigits, s => s); + } + + /** + * @param {Complex} s + * @returns {Complex} + */ + function zetaComplex(s) { + if (s.re === 0 && s.im === 0) { + return new Complex(-0.5); + } + if (s.re === 1) { + return new Complex(NaN, NaN); + } + if (s.re === Infinity && s.im === 0) { + return new Complex(1); + } + if (s.im === Infinity || s.re === -Infinity) { + return new Complex(NaN, NaN); + } + return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re); + } + + /** + * @param {number | BigNumber | Complex} s + * @param {(value: number) => number | BigNumber | Complex} createValue + * @param {(value: number | BigNumber | Complex) => number} determineDigits + * @param {(value: number | BigNumber | Complex) => number} getRe + * @returns {*|number} + */ + function zeta(s, createValue, determineDigits, getRe) { + var n = determineDigits(s); + if (getRe(s) > -(n - 1) / 2) { + return f(s, createValue(n), createValue); + } else { + // Function Equation for reflection to x < 1 + var c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1))); + c = multiply(c, sin(multiply(divide(createValue(pi), 2), s))); + c = multiply(c, gamma(subtract(1, s))); + return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe)); + } + } + + /** + * Calculate a portion of the sum + * @param {number | BigNumber} k a positive integer + * @param {number | BigNumber} n a positive integer + * @return {number} the portion of the sum + **/ + function d(k, n) { + var S = k; + for (var j = k; smallerEq(j, n); j = add(j, 1)) { + var factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j)))); + S = add(S, factor); + } + return multiply(n, S); + } + + /** + * Calculate the positive Riemann Zeta function + * @param {number} s a real or complex number with s.re > 1 + * @param {number} n a positive integer + * @param {(number) => number | BigNumber | Complex} createValue + * @return {number} Riemann Zeta of s + **/ + function f(s, n, createValue) { + var c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s))))); + var S = createValue(0); + for (var k = createValue(1); smallerEq(k, n); k = add(k, 1)) { + S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s))); + } + return multiply(c, S); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/corr.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/corr.js new file mode 100644 index 0000000..0d03357 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/corr.js @@ -0,0 +1,84 @@ +import { factory } from '../../utils/factory.js'; +var name = 'corr'; +var dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide']; +export var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + sqrt, + sum, + add, + subtract, + multiply, + pow, + divide + } = _ref; + /** + * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated. + * + * Syntax: + * + * math.corr(A, B) + * + * Examples: + * + * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1 + * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644 + * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1] + * + * See also: + * + * median, mean, min, max, sum, prod, std, variance + * + * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient + * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient + * @return {*} The correlation coefficient + */ + return typed(name, { + 'Array, Array': function Array_Array(A, B) { + return _corr(A, B); + }, + 'Matrix, Matrix': function Matrix_Matrix(A, B) { + var res = _corr(A.toArray(), B.toArray()); + return Array.isArray(res) ? matrix(res) : res; + } + }); + /** + * Calculate the correlation coefficient between two arrays or matrices. + * @param {Array | Matrix} A + * @param {Array | Matrix} B + * @return {*} correlation coefficient + * @private + */ + function _corr(A, B) { + var correlations = []; + if (Array.isArray(A[0]) && Array.isArray(B[0])) { + if (A.length !== B.length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.'); + } + for (var i = 0; i < A.length; i++) { + if (A[i].length !== B[i].length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.'); + } + correlations.push(correlation(A[i], B[i])); + } + return correlations; + } else { + if (A.length !== B.length) { + throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.'); + } + return correlation(A, B); + } + } + function correlation(A, B) { + var n = A.length; + var sumX = sum(A); + var sumY = sum(B); + var sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0); + var sumXSquare = sum(A.map(x => pow(x, 2))); + var sumYSquare = sum(B.map(y => pow(y, 2))); + var numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY)); + var denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2)))); + return divide(numerator, denominator); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/cumsum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/cumsum.js new file mode 100644 index 0000000..1e7cc36 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/cumsum.js @@ -0,0 +1,123 @@ +import { containsCollections } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { _switch } from '../../utils/switch.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +import { arraySize } from '../../utils/array.js'; +import { IndexError } from '../../error/IndexError.js'; +var name = 'cumsum'; +var dependencies = ['typed', 'add', 'unaryPlus']; +export var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + unaryPlus + } = _ref; + /** + * Compute the cumulative sum of a matrix or a list with values. + * In case of a (multi dimensional) array or matrix, the cumulative sums + * along a specified dimension (defaulting to the first) will be calculated. + * + * Syntax: + * + * math.cumsum(a, b, c, ...) + * math.cumsum(A) + * + * Examples: + * + * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10] + * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10] + * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]] + * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]] + * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]] + * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]] + * + * See also: + * + * mean, median, min, max, prod, std, variance, sum + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The cumulative sum of all values + */ + return typed(name, { + // sum([a, b, c, d, ...]) + Array: _cumsum, + Matrix: function Matrix(matrix) { + return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype())); + }, + // sum([a, b, c, d, ...], dim) + 'Array, number | BigNumber': _ncumSumDim, + 'Matrix, number | BigNumber': function Matrix_number__BigNumber(matrix, dim) { + return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype()); + }, + // cumsum(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('All values expected to be scalar in function cumsum'); + } + return _cumsum(args); + } + }); + + /** + * Recursively calculate the cumulative sum of an n-dimensional array + * @param {Array} array + * @return {number} cumsum + * @private + */ + function _cumsum(array) { + try { + return _cumsummap(array); + } catch (err) { + throw improveErrorMessage(err, name); + } + } + function _cumsummap(array) { + if (array.length === 0) { + return []; + } + var sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be + for (var i = 1; i < array.length; ++i) { + // Must use add below and not addScalar for the case of summing a + // 2+-dimensional array along the 0th dimension (the row vectors, + // or higher-d analogues, are literally added to each other). + sums.push(add(sums[i - 1], array[i])); + } + return sums; + } + function _ncumSumDim(array, dim) { + var size = arraySize(array); + if (dim < 0 || dim >= size.length) { + // TODO: would be more clear when throwing a DimensionError here + throw new IndexError(dim, size.length); + } + try { + return _cumsumDimensional(array, dim); + } catch (err) { + throw improveErrorMessage(err, name); + } + } + + /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */ + function _cumsumDimensional(mat, dim) { + var i, ret, tran; + if (dim <= 0) { + var initialValue = mat[0][0]; + if (!Array.isArray(initialValue)) { + return _cumsummap(mat); + } else { + tran = _switch(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _cumsumDimensional(tran[i], dim - 1); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _cumsumDimensional(mat[i], dim - 1); + } + return ret; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mad.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mad.js new file mode 100644 index 0000000..96e096a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mad.js @@ -0,0 +1,64 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'mad'; +var dependencies = ['typed', 'abs', 'map', 'median', 'subtract']; +export var createMad = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + abs, + map, + median, + subtract + } = _ref; + /** + * Compute the median absolute deviation of a matrix or a list with values. + * The median absolute deviation is defined as the median of the absolute + * deviations from the median. + * + * Syntax: + * + * math.mad(a, b, c, ...) + * math.mad(A) + * + * Examples: + * + * math.mad(10, 20, 30) // returns 10 + * math.mad([1, 2, 3]) // returns 1 + * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5 + * + * See also: + * + * median, mean, std, abs + * + * @param {Array | Matrix} array + * A single matrix or multiple scalar values. + * @return {*} The median absolute deviation. + */ + return typed(name, { + // mad([a, b, c, d, ...]) + 'Array | Matrix': _mad, + // mad(a, b, c, d, ...) + '...': function _(args) { + return _mad(args); + } + }); + function _mad(array) { + array = flatten(array.valueOf()); + if (array.length === 0) { + throw new Error('Cannot calculate median absolute deviation (mad) of an empty array'); + } + try { + var med = median(array); + return median(map(array, function (value) { + return abs(subtract(value, med)); + })); + } catch (err) { + if (err instanceof TypeError && err.message.includes('median')) { + throw new TypeError(err.message.replace('median', 'mad')); + } else { + throw improveErrorMessage(err, 'mad'); + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/max.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/max.js new file mode 100644 index 0000000..45514d7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/max.js @@ -0,0 +1,105 @@ +import { deepForEach, reduce, containsCollections } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'max'; +var dependencies = ['typed', 'config', 'numeric', 'larger']; +export var createMax = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + numeric, + larger + } = _ref; + /** + * Compute the maximum value of a matrix or a list with values. + * In case of a multidimensional array, the maximum of the flattened array + * will be calculated. When `dim` is provided, the maximum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.max(a, b, c, ...) + * math.max(A) + * math.max(A, dimension) + * + * Examples: + * + * math.max(2, 1, 4, 3) // returns 4 + * math.max([2, 1, 4, 3]) // returns 4 + * + * // maximum over a specified dimension (zero-based) + * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7] + * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7] + * + * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 + * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5 + * + * See also: + * + * mean, median, min, prod, std, sum, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The maximum value + */ + return typed(name, { + // max([a, b, c, d, ...]) + 'Array | Matrix': _max, + // max([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) { + return reduce(array, dim.valueOf(), _largest); + }, + // max(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function max'); + } + return _max(args); + } + }); + + /** + * Return the largest of two values + * @param {*} x + * @param {*} y + * @returns {*} Returns x when x is largest, or y when y is largest + * @private + */ + function _largest(x, y) { + try { + return larger(x, y) ? x : y; + } catch (err) { + throw improveErrorMessage(err, 'max', y); + } + } + + /** + * Recursively calculate the maximum value in an n-dimensional array + * @param {Array} array + * @return {number} max + * @private + */ + function _max(array) { + var res; + deepForEach(array, function (value) { + try { + if (isNaN(value) && typeof value === 'number') { + res = NaN; + } else if (res === undefined || larger(value, res)) { + res = value; + } + } catch (err) { + throw improveErrorMessage(err, 'max', value); + } + }); + if (res === undefined) { + throw new Error('Cannot calculate max of an empty array'); + } + + // make sure returning numeric value: parse a string into a numeric value + if (typeof res === 'string') { + res = numeric(res, safeNumberType(res, config)); + } + return res; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mean.js new file mode 100644 index 0000000..62d910f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mean.js @@ -0,0 +1,94 @@ +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'; +import { arraySize } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'mean'; +var dependencies = ['typed', 'add', 'divide']; +export var createMean = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + divide + } = _ref; + /** + * Compute the mean value of matrix or a list with values. + * In case of a multidimensional array, the mean of the flattened array + * will be calculated. When `dim` is provided, the maximum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.mean(a, b, c, ...) + * math.mean(A) + * math.mean(A, dimension) + * + * Examples: + * + * math.mean(2, 1, 4, 3) // returns 2.5 + * math.mean([1, 2.7, 3.2, 4]) // returns 2.725 + * + * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5] + * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4] + * + * See also: + * + * median, min, max, sum, prod, std, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The mean of all values + */ + return typed(name, { + // mean([a, b, c, d, ...]) + 'Array | Matrix': _mean, + // mean([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': _nmeanDim, + // mean(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function mean'); + } + return _mean(args); + } + }); + + /** + * Calculate the mean value in an n-dimensional array, returning a + * n-1 dimensional array + * @param {Array} array + * @param {number} dim + * @return {number} mean + * @private + */ + function _nmeanDim(array, dim) { + try { + var sum = reduce(array, dim, add); + var s = Array.isArray(array) ? arraySize(array) : array.size(); + return divide(sum, s[dim]); + } catch (err) { + throw improveErrorMessage(err, 'mean'); + } + } + + /** + * Recursively calculate the mean value in an n-dimensional array + * @param {Array} array + * @return {number} mean + * @private + */ + function _mean(array) { + var sum; + var num = 0; + deepForEach(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + num++; + } catch (err) { + throw improveErrorMessage(err, 'mean', value); + } + }); + if (num === 0) { + throw new Error('Cannot calculate the mean of an empty array'); + } + return divide(sum, num); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/median.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/median.js new file mode 100644 index 0000000..12e65a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/median.js @@ -0,0 +1,108 @@ +import { containsCollections } from '../../utils/collection.js'; +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'median'; +var dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect']; +export var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + divide, + compare, + partitionSelect + } = _ref; + /** + * Recursively calculate the median of an n-dimensional array + * @param {Array} array + * @return {Number} median + * @private + */ + function _median(array) { + try { + array = flatten(array.valueOf()); + var num = array.length; + if (num === 0) { + throw new Error('Cannot calculate median of an empty array'); + } + if (num % 2 === 0) { + // even: return the average of the two middle values + var mid = num / 2 - 1; + var right = partitionSelect(array, mid + 1); + + // array now partitioned at mid + 1, take max of left part + var left = array[mid]; + for (var i = 0; i < mid; ++i) { + if (compare(array[i], left) > 0) { + left = array[i]; + } + } + return middle2(left, right); + } else { + // odd: return the middle value + var m = partitionSelect(array, (num - 1) / 2); + return middle(m); + } + } catch (err) { + throw improveErrorMessage(err, 'median'); + } + } + + // helper function to type check the middle value of the array + var middle = typed({ + 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(value) { + return value; + } + }); + + // helper function to type check the two middle value of the array + var middle2 = typed({ + 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit_number__BigNumber__Complex__Unit(left, right) { + return divide(add(left, right), 2); + } + }); + + /** + * Compute the median of a matrix or a list with values. The values are + * sorted and the middle value is returned. In case of an even number of + * values, the average of the two middle values is returned. + * Supported types of values are: Number, BigNumber, Unit + * + * In case of a (multi dimensional) array or matrix, the median of all + * elements will be calculated. + * + * Syntax: + * + * math.median(a, b, c, ...) + * math.median(A) + * + * Examples: + * + * math.median(5, 2, 7) // returns 5 + * math.median([3, -1, 5, 7]) // returns 4 + * + * See also: + * + * mean, min, max, sum, prod, std, variance, quantileSeq + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The median + */ + return typed(name, { + // median([a, b, c, d, ...]) + 'Array | Matrix': _median, + // median([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) { + // TODO: implement median(A, dim) + throw new Error('median(A, dim) is not yet supported'); + // return reduce(arguments[0], arguments[1], ...) + }, + // median(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function median'); + } + return _median(args); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/min.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/min.js new file mode 100644 index 0000000..27c255c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/min.js @@ -0,0 +1,105 @@ +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'min'; +var dependencies = ['typed', 'config', 'numeric', 'smaller']; +export var createMin = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + numeric, + smaller + } = _ref; + /** + * Compute the minimum value of a matrix or a list of values. + * In case of a multidimensional array, the minimum of the flattened array + * will be calculated. When `dim` is provided, the minimum over the selected + * dimension will be calculated. Parameter `dim` is zero-based. + * + * Syntax: + * + * math.min(a, b, c, ...) + * math.min(A) + * math.min(A, dimension) + * + * Examples: + * + * math.min(2, 1, 4, 3) // returns 1 + * math.min([2, 1, 4, 3]) // returns 1 + * + * // minimum over a specified dimension (zero-based) + * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3] + * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1] + * + * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 + * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5 + * + * See also: + * + * mean, median, max, prod, std, sum, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The minimum value + */ + return typed(name, { + // min([a, b, c, d, ...]) + 'Array | Matrix': _min, + // min([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) { + return reduce(array, dim.valueOf(), _smallest); + }, + // min(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function min'); + } + return _min(args); + } + }); + + /** + * Return the smallest of two values + * @param {*} x + * @param {*} y + * @returns {*} Returns x when x is smallest, or y when y is smallest + * @private + */ + function _smallest(x, y) { + try { + return smaller(x, y) ? x : y; + } catch (err) { + throw improveErrorMessage(err, 'min', y); + } + } + + /** + * Recursively calculate the minimum value in an n-dimensional array + * @param {Array} array + * @return {number} min + * @private + */ + function _min(array) { + var min; + deepForEach(array, function (value) { + try { + if (isNaN(value) && typeof value === 'number') { + min = NaN; + } else if (min === undefined || smaller(value, min)) { + min = value; + } + } catch (err) { + throw improveErrorMessage(err, 'min', value); + } + }); + if (min === undefined) { + throw new Error('Cannot calculate min of an empty array'); + } + + // make sure returning numeric value: parse a string into a numeric value + if (typeof min === 'string') { + min = numeric(min, safeNumberType(min, config)); + } + return min; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mode.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mode.js new file mode 100644 index 0000000..00c433a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/mode.js @@ -0,0 +1,76 @@ +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +var name = 'mode'; +var dependencies = ['typed', 'isNaN', 'isNumeric']; +export var createMode = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isNaN, + isNumeric + } = _ref; + /** + * Computes the mode of a set of numbers or a list with values(numbers or characters). + * If there are multiple modes, it returns a list of those values. + * + * Syntax: + * + * math.mode(a, b, c, ...) + * math.mode(A) + * + * Examples: + * + * math.mode(2, 1, 4, 3, 1) // returns [1] + * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7] + * math.mode(1, 4, 6, 1, 6) // returns [1, 6] + * math.mode('a','a','b','c') // returns ["a"] + * math.mode(1, 1.5, 'abc') // returns [1, 1.5, "abc"] + * + * See also: + * + * median, + * mean + * + * @param {... *} args A single matrix + * @return {*} The mode of all values + */ + return typed(name, { + 'Array | Matrix': _mode, + '...': function _(args) { + return _mode(args); + } + }); + + /** + * Calculates the mode in an 1-dimensional array + * @param {Array} values + * @return {Array} mode + * @private + */ + function _mode(values) { + values = flatten(values.valueOf()); + var num = values.length; + if (num === 0) { + throw new Error('Cannot calculate mode of an empty array'); + } + var count = {}; + var mode = []; + var max = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + if (isNumeric(value) && isNaN(value)) { + throw new Error('Cannot calculate mode of an array containing NaN values'); + } + if (!(value in count)) { + count[value] = 0; + } + count[value]++; + if (count[value] === max) { + mode.push(value); + } else if (count[value] > max) { + max = count[value]; + mode = [value]; + } + } + return mode; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/prod.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/prod.js new file mode 100644 index 0000000..208357f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/prod.js @@ -0,0 +1,79 @@ +import { deepForEach } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'prod'; +var dependencies = ['typed', 'config', 'multiplyScalar', 'numeric']; +export var createProd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + multiplyScalar, + numeric + } = _ref; + /** + * Compute the product of a matrix or a list with values. + * In case of a multidimensional array or matrix, the sum of all + * elements will be calculated. + * + * Syntax: + * + * math.prod(a, b, c, ...) + * math.prod(A) + * + * Examples: + * + * math.multiply(2, 3) // returns 6 + * math.prod(2, 3) // returns 6 + * math.prod(2, 3, 4) // returns 24 + * math.prod([2, 3, 4]) // returns 24 + * math.prod([[2, 5], [4, 3]]) // returns 120 + * + * See also: + * + * mean, median, min, max, sum, std, variance + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The product of all values + */ + return typed(name, { + // prod([a, b, c, d, ...]) + 'Array | Matrix': _prod, + // prod([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) { + // TODO: implement prod(A, dim) + throw new Error('prod(A, dim) is not yet supported'); + // return reduce(arguments[0], arguments[1], math.prod) + }, + // prod(a, b, c, d, ...) + '...': function _(args) { + return _prod(args); + } + }); + + /** + * Recursively calculate the product of an n-dimensional array + * @param {Array} array + * @return {number} prod + * @private + */ + function _prod(array) { + var prod; + deepForEach(array, function (value) { + try { + prod = prod === undefined ? value : multiplyScalar(prod, value); + } catch (err) { + throw improveErrorMessage(err, 'prod', value); + } + }); + + // make sure returning numeric value: parse a string into a numeric value + if (typeof prod === 'string') { + prod = numeric(prod, safeNumberType(prod, config)); + } + if (prod === undefined) { + throw new Error('Cannot calculate prod of an empty array'); + } + return prod; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js new file mode 100644 index 0000000..86e102f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js @@ -0,0 +1,166 @@ +import { isNumber } from '../../utils/is.js'; +import { flatten } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { createApply } from '../matrix/apply.js'; +var name = 'quantileSeq'; +var dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger']; +export var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + bignumber, + add, + subtract, + divide, + multiply, + partitionSelect, + compare, + isInteger, + smaller, + smallerEq, + larger + } = _ref; + var apply = createApply({ + typed, + isInteger + }); + + /** + * Compute the prob order quantile of a matrix or a list with values. + * The sequence is sorted and the middle value is returned. + * Supported types of sequence values are: Number, BigNumber, Unit + * Supported types of probability are: Number, BigNumber + * + * In case of a multidimensional array or matrix, the prob order quantile + * of all elements will be calculated. + * + * Syntax: + * + * math.quantileSeq(A, prob[, sorted]) + * math.quantileSeq(A, [prob1, prob2, ...][, sorted]) + * math.quantileSeq(A, N[, sorted]) + * + * Examples: + * + * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4 + * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5] + * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5] + * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4 + * + * See also: + * + * median, mean, min, max, sum, prod, std, variance + * + * @param {Array, Matrix} data A single matrix or Array + * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is + * the amount of evenly distributed steps of + * probabilities; only one of these options can + * be provided + * @param {Boolean} sorted=false is data sorted in ascending order + * @return {Number, BigNumber, Unit, Array} Quantile(s) + */ + return typed(name, { + 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false), + 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber), + 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber, + 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber), + 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false), + 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection), + 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection, + 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection) + }); + function _quantileSeqDim(data, prob, sorted, dim, fn) { + return apply(data, dim, x => fn(x, prob, sorted)); + } + function _quantileSeqProbNumber(data, probOrN, sorted) { + var probArr; + var dataArr = data.valueOf(); + if (smaller(probOrN, 0)) { + throw new Error('N/prob must be non-negative'); + } + if (smallerEq(probOrN, 1)) { + // quantileSeq([a, b, c, d, ...], prob[,sorted]) + return isNumber(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted)); + } + if (larger(probOrN, 1)) { + // quantileSeq([a, b, c, d, ...], N[,sorted]) + if (!isInteger(probOrN)) { + throw new Error('N must be a positive integer'); + } + + // largest possible Array length is 2^32-1 + // 2^32 < 10^15, thus safe conversion guaranteed + if (larger(probOrN, 4294967295)) { + throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array'); + } + var nPlusOne = add(probOrN, 1); + probArr = []; + for (var i = 0; smaller(i, probOrN); i++) { + var prob = divide(i + 1, nPlusOne); + probArr.push(_quantileSeq(dataArr, prob, sorted)); + } + return isNumber(probOrN) ? probArr : bignumber(probArr); + } + } + + /** + * Calculate the prob order quantile of an n-dimensional array. + * + * @param {Array, Matrix} array + * @param {Array, Matrix} prob + * @param {Boolean} sorted + * @return {Number, BigNumber, Unit} prob order quantile + * @private + */ + + function _quantileSeqProbCollection(data, probOrN, sorted) { + var dataArr = data.valueOf(); + // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted]) + var probOrNArr = probOrN.valueOf(); + var probArr = []; + for (var i = 0; i < probOrNArr.length; ++i) { + probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted)); + } + return probArr; + } + + /** + * Calculate the prob order quantile of an n-dimensional array. + * + * @param {Array} array + * @param {Number, BigNumber} prob + * @param {Boolean} sorted + * @return {Number, BigNumber, Unit} prob order quantile + * @private + */ + function _quantileSeq(array, prob, sorted) { + var flat = flatten(array); + var len = flat.length; + if (len === 0) { + throw new Error('Cannot calculate quantile of an empty sequence'); + } + var index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1); + var integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber(); + var fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart); + if (isInteger(index)) { + return sorted ? flat[index] : partitionSelect(flat, isNumber(prob) ? index : index.valueOf()); + } + var left; + var right; + if (sorted) { + left = flat[integerPart]; + right = flat[integerPart + 1]; + } else { + right = partitionSelect(flat, integerPart + 1); + + // max of partition is kth largest + left = flat[integerPart]; + for (var i = 0; i < integerPart; ++i) { + if (compare(flat[i], left) > 0) { + left = flat[i]; + } + } + } + // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1] + return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart)); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/std.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/std.js new file mode 100644 index 0000000..25c6536 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/std.js @@ -0,0 +1,97 @@ +import { factory } from '../../utils/factory.js'; +import { isCollection } from '../../utils/is.js'; +var name = 'std'; +var dependencies = ['typed', 'map', 'sqrt', 'variance']; +export var createStd = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + map, + sqrt, + variance + } = _ref; + /** + * Compute the standard deviation of a matrix or a list with values. + * The standard deviations is defined as the square root of the variance: + * `std(A) = sqrt(variance(A))`. + * In case of a (multi dimensional) array or matrix, the standard deviation + * over all elements will be calculated by default, unless an axis is specified + * in which case the standard deviation will be computed along that axis. + * + * Additionally, it is possible to compute the standard deviation along the rows + * or columns of a matrix by specifying the dimension as the second argument. + * + * Optionally, the type of normalization can be specified as the final + * parameter. The parameter `normalization` can be one of the following values: + * + * - 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * + * + * Syntax: + * + * math.std(a, b, c, ...) + * math.std(A) + * math.std(A, normalization) + * math.std(A, dimension) + * math.std(A, dimension, normalization) + * + * Examples: + * + * math.std(2, 4, 6) // returns 2 + * math.std([2, 4, 6, 8]) // returns 2.581988897471611 + * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979 + * math.std([2, 4, 6, 8], 'biased') // returns 2 + * + * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707 + * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378] + * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2] + * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951] + * + * See also: + * + * mean, median, max, min, prod, sum, variance + * + * @param {Array | Matrix} array + * A single matrix or or multiple scalar values + * @param {string} [normalization='unbiased'] + * Determines how to normalize the variance. + * Choose 'unbiased' (default), 'uncorrected', or 'biased'. + * @param dimension {number | BigNumber} + * Determines the axis to compute the standard deviation for a matrix + * @return {*} The standard deviation + */ + return typed(name, { + // std([a, b, c, d, ...]) + 'Array | Matrix': _std, + // std([a, b, c, d, ...], normalization) + 'Array | Matrix, string': _std, + // std([a, b, c, c, ...], dim) + 'Array | Matrix, number | BigNumber': _std, + // std([a, b, c, c, ...], dim, normalization) + 'Array | Matrix, number | BigNumber, string': _std, + // std(a, b, c, d, ...) + '...': function _(args) { + return _std(args); + } + }); + function _std(array, normalization) { + if (array.length === 0) { + throw new SyntaxError('Function std requires one or more parameters (0 provided)'); + } + try { + var v = variance.apply(null, arguments); + if (isCollection(v)) { + return map(v, sqrt); + } else { + return sqrt(v); + } + } catch (err) { + if (err instanceof TypeError && err.message.includes(' variance')) { + throw new TypeError(err.message.replace(' variance', ' std')); + } else { + throw err; + } + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/sum.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/sum.js new file mode 100644 index 0000000..661e373 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/sum.js @@ -0,0 +1,85 @@ +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { safeNumberType } from '../../utils/number.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var name = 'sum'; +var dependencies = ['typed', 'config', 'add', 'numeric']; +export var createSum = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + add, + numeric + } = _ref; + /** + * Compute the sum of a matrix or a list with values. + * In case of a multidimensional array or matrix, the sum of all + * elements will be calculated. + * + * Syntax: + * + * math.sum(a, b, c, ...) + * math.sum(A) + * math.sum(A, dimension) + * + * Examples: + * + * math.sum(2, 1, 4, 3) // returns 10 + * math.sum([2, 1, 4, 3]) // returns 10 + * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22 + * + * See also: + * + * mean, median, min, max, prod, std, variance, cumsum + * + * @param {... *} args A single matrix or multiple scalar values + * @return {*} The sum of all values + */ + return typed(name, { + // sum([a, b, c, d, ...]) + 'Array | Matrix': _sum, + // sum([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': _nsumDim, + // sum(a, b, c, d, ...) + '...': function _(args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function sum'); + } + return _sum(args); + } + }); + + /** + * Recursively calculate the sum of an n-dimensional array + * @param {Array | Matrix} array + * @return {number} sum + * @private + */ + function _sum(array) { + var sum; + deepForEach(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + } catch (err) { + throw improveErrorMessage(err, 'sum', value); + } + }); + + // make sure returning numeric value: parse a string into a numeric value + if (sum === undefined) { + sum = numeric(0, config.number); + } + if (typeof sum === 'string') { + sum = numeric(sum, safeNumberType(sum, config)); + } + return sum; + } + function _nsumDim(array, dim) { + try { + var sum = reduce(array, dim, add); + return sum; + } catch (err) { + throw improveErrorMessage(err, 'sum'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js new file mode 100644 index 0000000..9ef8737 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js @@ -0,0 +1,25 @@ +import { typeOf } from '../../../utils/is.js'; + +/** + * Improve error messages for statistics functions. Errors are typically + * thrown in an internally used function like larger, causing the error + * not to mention the function (like max) which is actually used by the user. + * + * @param {Error} err + * @param {String} fnName + * @param {*} [value] + * @return {Error} + */ +export function improveErrorMessage(err, fnName, value) { + // TODO: add information with the index (also needs transform in expression parser) + var details; + if (String(err).includes('Unexpected type')) { + details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')'; + return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details); + } + if (String(err).includes('complex numbers')) { + details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ''; + return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details); + } + return err; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/variance.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/variance.js new file mode 100644 index 0000000..14c6ed2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/statistics/variance.js @@ -0,0 +1,153 @@ +import { deepForEach } from '../../utils/collection.js'; +import { isBigNumber } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { improveErrorMessage } from './utils/improveErrorMessage.js'; +var DEFAULT_NORMALIZATION = 'unbiased'; +var name = 'variance'; +var dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN']; +export var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + add, + subtract, + multiply, + divide, + apply, + isNaN + } = _ref; + /** + * Compute the variance of a matrix or a list with values. + * In case of a multidimensional array or matrix, the variance over all + * elements will be calculated. + * + * Additionally, it is possible to compute the variance along the rows + * or columns of a matrix by specifying the dimension as the second argument. + * + * Optionally, the type of normalization can be specified as the final + * parameter. The parameter `normalization` can be one of the following values: + * + * - 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * + * + * Note that older browser may not like the variable name `var`. In that + * case, the function can be called as `math['var'](...)` instead of + * `math.var(...)`. + * + * Syntax: + * + * math.variance(a, b, c, ...) + * math.variance(A) + * math.variance(A, normalization) + * math.variance(A, dimension) + * math.variance(A, dimension, normalization) + * + * Examples: + * + * math.variance(2, 4, 6) // returns 4 + * math.variance([2, 4, 6, 8]) // returns 6.666666666666667 + * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5 + * math.variance([2, 4, 6, 8], 'biased') // returns 4 + * + * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5 + * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5] + * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4] + * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2] + * + * See also: + * + * mean, median, max, min, prod, std, sum + * + * @param {Array | Matrix} array + * A single matrix or or multiple scalar values + * @param {string} [normalization='unbiased'] + * Determines how to normalize the variance. + * Choose 'unbiased' (default), 'uncorrected', or 'biased'. + * @param dimension {number | BigNumber} + * Determines the axis to compute the variance for a matrix + * @return {*} The variance + */ + return typed(name, { + // variance([a, b, c, d, ...]) + 'Array | Matrix': function Array__Matrix(array) { + return _var(array, DEFAULT_NORMALIZATION); + }, + // variance([a, b, c, d, ...], normalization) + 'Array | Matrix, string': _var, + // variance([a, b, c, c, ...], dim) + 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) { + return _varDim(array, dim, DEFAULT_NORMALIZATION); + }, + // variance([a, b, c, c, ...], dim, normalization) + 'Array | Matrix, number | BigNumber, string': _varDim, + // variance(a, b, c, d, ...) + '...': function _(args) { + return _var(args, DEFAULT_NORMALIZATION); + } + }); + + /** + * Recursively calculate the variance of an n-dimensional array + * @param {Array} array + * @param {string} normalization + * Determines how to normalize the variance: + * - 'unbiased' The sum of squared errors is divided by (n - 1) + * - 'uncorrected' The sum of squared errors is divided by n + * - 'biased' The sum of squared errors is divided by (n + 1) + * @return {number | BigNumber} variance + * @private + */ + function _var(array, normalization) { + var sum; + var num = 0; + if (array.length === 0) { + throw new SyntaxError('Function variance requires one or more parameters (0 provided)'); + } + + // calculate the mean and number of elements + deepForEach(array, function (value) { + try { + sum = sum === undefined ? value : add(sum, value); + num++; + } catch (err) { + throw improveErrorMessage(err, 'variance', value); + } + }); + if (num === 0) throw new Error('Cannot calculate variance of an empty array'); + var mean = divide(sum, num); + + // calculate the variance + sum = undefined; + deepForEach(array, function (value) { + var diff = subtract(value, mean); + sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff)); + }); + if (isNaN(sum)) { + return sum; + } + switch (normalization) { + case 'uncorrected': + return divide(sum, num); + case 'biased': + return divide(sum, num + 1); + case 'unbiased': + { + var zero = isBigNumber(sum) ? sum.mul(0) : 0; + return num === 1 ? zero : divide(sum, num - 1); + } + default: + throw new Error('Unknown normalization "' + normalization + '". ' + 'Choose "unbiased" (default), "uncorrected", or "biased".'); + } + } + function _varDim(array, dim, normalization) { + try { + if (array.length === 0) { + throw new SyntaxError('Function variance requires one or more parameters (0 provided)'); + } + return apply(array, dim, x => _var(x, normalization)); + } catch (err) { + throw improveErrorMessage(err, 'variance'); + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/bin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/bin.js new file mode 100644 index 0000000..3a7ced1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/bin.js @@ -0,0 +1,44 @@ +import { factory } from '../../utils/factory.js'; +var name = 'bin'; +var dependencies = ['typed', 'format']; + +/** + * Format a number as binary. + * + * Syntax: + * + * math.bin(value) + * + * Examples: + * + * //the following outputs "0b10" + * math.bin(2) + * + * See also: + * + * oct + * hex + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ +export var createBin = factory(name, dependencies, _ref => { + var { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function number__BigNumber(n) { + return format(n, { + notation: 'bin' + }); + }, + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) { + return format(n, { + notation: 'bin', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/format.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/format.js new file mode 100644 index 0000000..8ee59cc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/format.js @@ -0,0 +1,131 @@ +import { format as formatString } from '../../utils/string.js'; +import { factory } from '../../utils/factory.js'; +var name = 'format'; +var dependencies = ['typed']; +export var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Format a value of any type into a string. + * + * Syntax: + * + * math.format(value) + * math.format(value, options) + * math.format(value, precision) + * math.format(value, callback) + * + * Where: + * + * - `value: *` + * The value to be formatted + * - `options: Object` + * An object with formatting options. Available options: + * - `notation: string` + * Number notation. Choose from: + * - `'fixed'` + * Always use regular number notation. + * For example `'123.40'` and `'14000000'` + * - `'exponential'` + * Always use exponential notation. + * For example `'1.234e+2'` and `'1.4e+7'` + * - `'engineering'` + * Always use engineering notation: always have exponential notation, + * and select the exponent to be a multiple of `3`. + * For example `'123.4e+0'` and `'14.0e+6'` + * - `'auto'` (default) + * Regular number notation for numbers having an absolute value between + * `lower` and `upper` bounds, and uses exponential notation elsewhere. + * Lower bound is included, upper bound is excluded. + * For example `'123.4'` and `'1.4e7'`. + * - `'bin'`, `'oct'`, or `'hex'` + * Format the number using binary, octal, or hexadecimal notation. + * For example `'0b1101'` and `'0x10fe'`. + * - `wordSize: number | BigNumber` + * The word size in bits to use for formatting in binary, octal, or + * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'` + * values for `notation` option. When this option is defined the value + * is formatted as a signed twos complement integer of the given word + * size and the size suffix is appended to the output. + * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`. + * Default value is undefined. + * - `precision: number | BigNumber` + * Limit the number of digits of the formatted value. + * For regular numbers, must be a number between `0` and `16`. + * For bignumbers, the maximum depends on the configured precision, + * see function `config()`. + * In case of notations `'exponential'`, `'engineering'`, and `'auto'`, + * `precision` defines the total number of significant digits returned. + * In case of notation `'fixed'`, `precision` defines the number of + * significant digits after the decimal point. + * `precision` is undefined by default. + * - `lowerExp: number` + * Exponent determining the lower boundary for formatting a value with + * an exponent when `notation='auto'`. Default value is `-3`. + * - `upperExp: number` + * Exponent determining the upper boundary for formatting a value with + * an exponent when `notation='auto'`. Default value is `5`. + * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`. + * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'` + * is configured, and will output `'0.(3)'` when `'decimal'` is configured. + * - `truncate: number`. Specifies the maximum allowed length of the + * returned string. If it had been longer, the excess characters + * are deleted and replaced with `'...'`. + * - `callback: function` + * A custom formatting function, invoked for all numeric elements in `value`, + * for example all elements of a matrix, or the real and imaginary + * parts of a complex number. This callback can be used to override the + * built-in numeric notation with any type of formatting. Function `callback` + * is called with `value` as parameter and must return a string. + * + * When `value` is an Object: + * + * - When the object contains a property `format` being a function, this function + * is invoked as `value.format(options)` and the result is returned. + * - When the object has its own `toString` method, this method is invoked + * and the result is returned. + * - In other cases the function will loop over all object properties and + * return JSON object notation like '{"a": 2, "b": 3}'. + * + * When value is a function: + * + * - When the function has a property `syntax`, it returns this + * syntax description. + * - In other cases, a string `'function'` is returned. + * + * Examples: + * + * math.format(6.4) // returns '6.4' + * math.format(1240000) // returns '1.24e+6' + * math.format(1/3) // returns '0.3333333333333333' + * math.format(1/3, 3) // returns '0.333' + * math.format(21385, 2) // returns '21000' + * math.format(12e8, {notation: 'fixed'}) // returns '1200000000' + * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000' + * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1' + * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3' + * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3' + * + * function formatCurrency(value) { + * // return currency notation with two digits: + * return '$' + value.toFixed(2) + * + * // you could also use math.format inside the callback: + * // return '$' + math.format(value, {notation: 'fixed', precision: 2}) + * } + * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]' + * + * See also: + * + * print + * + * @param {*} value Value to be stringified + * @param {Object | Function | number} [options] Formatting options + * @return {string} The formatted value + */ + return typed(name, { + any: formatString, + 'any, Object | function | number | BigNumber': formatString + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/hex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/hex.js new file mode 100644 index 0000000..67e8c78 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/hex.js @@ -0,0 +1,43 @@ +import { factory } from '../../utils/factory.js'; +var name = 'hex'; +var dependencies = ['typed', 'format']; + +/** + * Format a number as hexadecimal. + * + * Syntax: + * + * math.hex(value) + * + * Examples: + * + * math.hex(240) // returns "0xF0" + * + * See also: + * + * oct + * bin + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ +export var createHex = factory(name, dependencies, _ref => { + var { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function number__BigNumber(n) { + return format(n, { + notation: 'hex' + }); + }, + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) { + return format(n, { + notation: 'hex', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/oct.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/oct.js new file mode 100644 index 0000000..673fd50 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/oct.js @@ -0,0 +1,45 @@ +import { factory } from '../../utils/factory.js'; +var name = 'oct'; +var dependencies = ['typed', 'format']; + +/** + * Format a number as octal. + * + * Syntax: + * + * math.oct(value) + * + * Examples: + * + * //the following outputs "0o70" + * math.oct(56) + * + * See also: + * + * bin + * hex + * + * @param {number | BigNumber} value Value to be stringified + * @param {number | BigNumber} wordSize Optional word size (see `format`) + * @return {string} The formatted value + */ + +export var createOct = factory(name, dependencies, _ref => { + var { + typed, + format + } = _ref; + return typed(name, { + 'number | BigNumber': function number__BigNumber(n) { + return format(n, { + notation: 'oct' + }); + }, + 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) { + return format(n, { + notation: 'oct', + wordSize + }); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/print.js new file mode 100644 index 0000000..1f452e3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/string/print.js @@ -0,0 +1,90 @@ +import { format } from '../../utils/string.js'; +import { isString } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { printTemplate } from '../../utils/print.js'; +var name = 'print'; +var dependencies = ['typed']; +export var createPrint = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Interpolate values into a string template. + * + * Syntax: + * + * math.print(template, values) + * math.print(template, values, precision) + * math.print(template, values, options) + * + * Example usage: + * + * // the following outputs: 'Lucy is 5 years old' + * math.print('Lucy is $age years old', {age: 5}) + * + * // the following outputs: 'The value of pi is 3.141592654' + * math.print('The value of pi is $pi', {pi: math.pi}, 10) + * + * // the following outputs: 'hello Mary! The date is 2013-03-23' + * math.print('Hello $user.name! The date is $date', { + * user: { + * name: 'Mary', + * }, + * date: new Date(2013, 2, 23).toISOString().substring(0, 10) + * }) + * + * // the following outputs: 'My favorite fruits are apples and bananas !' + * math.print('My favorite fruits are $0 and $1 !', [ + * 'apples', + * 'bananas' + * ]) + * + * See also: + * + * format + * + * @param {string} template A string containing variable placeholders. + * @param {Object | Array | Matrix} values An object or array containing variables + * which will be filled in in the template. + * @param {number | Object} [options] Formatting options, + * or the number of digits to format numbers. + * See function math.format for a description + * of all options. + * @return {string} Interpolated string + */ + return typed(name, { + // note: Matrix will be converted automatically to an Array + 'string, Object | Array': _print, + 'string, Object | Array, number | Object': _print + }); +}); + +/** + * Interpolate values into a string template. + * @param {string} template + * @param {Object} values + * @param {number | Object} [options] + * @returns {string} Interpolated string + * @private + */ +function _print(template, values, options) { + return template.replace(printTemplate, function (original, key) { + var keys = key.split('.'); + var value = values[keys.shift()]; + if (value !== undefined && value.isMatrix) { + value = value.toArray(); + } + while (keys.length && value !== undefined) { + var k = keys.shift(); + value = k ? value[k] : value + '.'; + } + if (value !== undefined) { + if (!isString(value)) { + return format(value, options); + } else { + return value; + } + } + return original; + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acos.js new file mode 100644 index 0000000..e54c0ae --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acos.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +var name = 'acos'; +var dependencies = ['typed', 'config', 'Complex']; +export var createAcos = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex + } = _ref; + /** + * Calculate the inverse cosine of a value. + * + * To avoid confusion with the matrix arccosine, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acos(x) + * + * Examples: + * + * math.acos(0.5) // returns number 1.0471975511965979 + * math.acos(math.cos(1.5)) // returns number 1.5 + * + * math.acos(2) // returns Complex 0 + 1.3169578969248166 i + * + * See also: + * + * cos, atan, asin + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc cosine of x + */ + return typed(name, { + number: function number(x) { + if (x >= -1 && x <= 1 || config.predictable) { + return Math.acos(x); + } else { + return new Complex(x, 0).acos(); + } + }, + Complex: function Complex(x) { + return x.acos(); + }, + BigNumber: function BigNumber(x) { + return x.acos(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js new file mode 100644 index 0000000..11887a0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +import { acoshNumber } from '../../plain/number/index.js'; +var name = 'acosh'; +var dependencies = ['typed', 'config', 'Complex']; +export var createAcosh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex + } = _ref; + /** + * Calculate the hyperbolic arccos of a value, + * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.acosh(x) + * + * Examples: + * + * math.acosh(1.5) // returns 0.9624236501192069 + * + * See also: + * + * cosh, asinh, atanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccosine of x + */ + return typed(name, { + number: function number(x) { + if (x >= 1 || config.predictable) { + return acoshNumber(x); + } + if (x <= -1) { + return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI); + } + return new Complex(x, 0).acosh(); + }, + Complex: function Complex(x) { + return x.acosh(); + }, + BigNumber: function BigNumber(x) { + return x.acosh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acot.js new file mode 100644 index 0000000..7f1a03b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acot.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +import { acotNumber } from '../../plain/number/index.js'; +var name = 'acot'; +var dependencies = ['typed', 'BigNumber']; +export var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`. + * + * To avoid confusion with the matrix arccotanget, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acot(x) + * + * Examples: + * + * math.acot(0.5) // returns number 1.1071487177940904 + * math.acot(2) // returns number 0.4636476090008061 + * math.acot(math.cot(1.5)) // returns number 1.5 + * + * See also: + * + * cot, atan + * + * @param {number | BigNumber| Complex} x Function input + * @return {number | BigNumber| Complex} The arc cotangent of x + */ + return typed(name, { + number: acotNumber, + Complex: function Complex(x) { + return x.acot(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).atan(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js new file mode 100644 index 0000000..08461c0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js @@ -0,0 +1,48 @@ +import { factory } from '../../utils/factory.js'; +import { acothNumber } from '../../plain/number/index.js'; +var name = 'acoth'; +var dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +export var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the inverse hyperbolic tangent of a value, + * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`. + * + * To avoid confusion with the matrix inverse hyperbolic tangent, this + * function does not apply to matrices. + * + * Syntax: + * + * math.acoth(x) + * + * Examples: + * + * math.acoth(0.5) // returns 0.8047189562170503 + * + * See also: + * + * acsch, asech + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x + */ + return typed(name, { + number: function number(x) { + if (x >= 1 || x <= -1 || config.predictable) { + return acothNumber(x); + } + return new Complex(x, 0).acoth(); + }, + Complex: function Complex(x) { + return x.acoth(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).atanh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js new file mode 100644 index 0000000..b2c09a2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +import { acscNumber } from '../../plain/number/index.js'; +var name = 'acsc'; +var dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +export var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`. + * + * To avoid confusion with the matrix arccosecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.acsc(x) + * + * Examples: + * + * math.acsc(2) // returns 0.5235987755982989 + * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i + * math.acsc(math.csc(1.5)) // returns number ~1.5 + * + * See also: + * + * csc, asin, asec + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc cosecant of x + */ + return typed(name, { + number: function number(x) { + if (x <= -1 || x >= 1 || config.predictable) { + return acscNumber(x); + } + return new Complex(x, 0).acsc(); + }, + Complex: function Complex(x) { + return x.acsc(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).asin(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js new file mode 100644 index 0000000..8e97e4a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +import { acschNumber } from '../../plain/number/index.js'; +var name = 'acsch'; +var dependencies = ['typed', 'BigNumber']; +export var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the inverse hyperbolic cosecant of a value, + * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`. + * + * To avoid confusion with the matrix inverse hyperbolic cosecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.acsch(x) + * + * Examples: + * + * math.acsch(0.5) // returns 1.4436354751788103 + * + * See also: + * + * asech, acoth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x + */ + return typed(name, { + number: acschNumber, + Complex: function Complex(x) { + return x.acsch(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).asinh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asec.js new file mode 100644 index 0000000..09c0857 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asec.js @@ -0,0 +1,50 @@ +import { factory } from '../../utils/factory.js'; +import { asecNumber } from '../../plain/number/index.js'; +var name = 'asec'; +var dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +export var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`. + * + * To avoid confusion with the matrix arcsecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.asec(x) + * + * Examples: + * + * math.asec(2) // returns 1.0471975511965979 + * math.asec(math.sec(1.5)) // returns 1.5 + * + * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i + * + * See also: + * + * acos, acot, acsc + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc secant of x + */ + return typed(name, { + number: function number(x) { + if (x <= -1 || x >= 1 || config.predictable) { + return asecNumber(x); + } + return new Complex(x, 0).asec(); + }, + Complex: function Complex(x) { + return x.asec(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).acos(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asech.js new file mode 100644 index 0000000..0141b7f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asech.js @@ -0,0 +1,53 @@ +import { factory } from '../../utils/factory.js'; +import { asechNumber } from '../../plain/number/index.js'; +var name = 'asech'; +var dependencies = ['typed', 'config', 'Complex', 'BigNumber']; +export var createAsech = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the hyperbolic arcsecant of a value, + * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`. + * + * To avoid confusion with the matrix hyperbolic arcsecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.asech(x) + * + * Examples: + * + * math.asech(0.5) // returns 1.3169578969248166 + * + * See also: + * + * acsch, acoth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x + */ + return typed(name, { + number: function number(x) { + if (x <= 1 && x >= -1 || config.predictable) { + var xInv = 1 / x; + if (xInv > 0 || config.predictable) { + return asechNumber(x); + } + var ret = Math.sqrt(xInv * xInv - 1); + return new Complex(Math.log(ret - xInv), Math.PI); + } + return new Complex(x, 0).asech(); + }, + Complex: function Complex(x) { + return x.asech(); + }, + BigNumber: function BigNumber(x) { + return new _BigNumber(1).div(x).acosh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asin.js new file mode 100644 index 0000000..bc2c5b0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asin.js @@ -0,0 +1,49 @@ +import { factory } from '../../utils/factory.js'; +var name = 'asin'; +var dependencies = ['typed', 'config', 'Complex']; +export var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex + } = _ref; + /** + * Calculate the inverse sine of a value. + * + * To avoid confusion with the matric arcsine, this function does not apply + * to matrices. + * + * Syntax: + * + * math.asin(x) + * + * Examples: + * + * math.asin(0.5) // returns number 0.5235987755982989 + * math.asin(math.sin(1.5)) // returns number ~1.5 + * + * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i + * + * See also: + * + * sin, atan, acos + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc sine of x + */ + return typed(name, { + number: function number(x) { + if (x >= -1 && x <= 1 || config.predictable) { + return Math.asin(x); + } else { + return new Complex(x, 0).asin(); + } + }, + Complex: function Complex(x) { + return x.asin(); + }, + BigNumber: function BigNumber(x) { + return x.asin(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js new file mode 100644 index 0000000..0f88069 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js @@ -0,0 +1,40 @@ +import { factory } from '../../utils/factory.js'; +import { asinhNumber } from '../../plain/number/index.js'; +var name = 'asinh'; +var dependencies = ['typed']; +export var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the hyperbolic arcsine of a value, + * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`. + * + * To avoid confusion with the matrix hyperbolic arcsine, this function + * does not apply to matrices. + * + * Syntax: + * + * math.asinh(x) + * + * Examples: + * + * math.asinh(0.5) // returns 0.48121182505960347 + * + * See also: + * + * acosh, atanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arcsine of x + */ + return typed('asinh', { + number: asinhNumber, + Complex: function Complex(x) { + return x.asinh(); + }, + BigNumber: function BigNumber(x) { + return x.asinh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan.js new file mode 100644 index 0000000..bf11823 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +var name = 'atan'; +var dependencies = ['typed']; +export var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the inverse tangent of a value. + * + * To avoid confusion with matrix arctangent, this function does not apply + * to matrices. + * + * Syntax: + * + * math.atan(x) + * + * Examples: + * + * math.atan(0.5) // returns number 0.4636476090008061 + * math.atan(2) // returns number 1.1071487177940904 + * math.atan(math.tan(1.5)) // returns number 1.5 + * + * See also: + * + * tan, asin, acos + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} The arc tangent of x + */ + return typed('atan', { + number: function number(x) { + return Math.atan(x); + }, + Complex: function Complex(x) { + return x.atan(); + }, + BigNumber: function BigNumber(x) { + return x.atan(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js new file mode 100644 index 0000000..41a4c87 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js @@ -0,0 +1,89 @@ +import { factory } from '../../utils/factory.js'; +import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js'; +import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; +import { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js'; +import { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js'; +import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'atan2'; +var dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat']; +export var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + equalScalar, + BigNumber, + DenseMatrix, + concat + } = _ref; + var matAlgo02xDS0 = createMatAlgo02xDS0({ + typed, + equalScalar + }); + var matAlgo03xDSf = createMatAlgo03xDSf({ + typed + }); + var matAlgo09xS0Sf = createMatAlgo09xS0Sf({ + typed, + equalScalar + }); + var matAlgo11xS0s = createMatAlgo11xS0s({ + typed, + equalScalar + }); + var matAlgo12xSfs = createMatAlgo12xSfs({ + typed, + DenseMatrix + }); + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Calculate the inverse tangent function with two arguments, y/x. + * By providing two arguments, the right quadrant of the computed angle can be + * determined. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.atan2(y, x) + * + * Examples: + * + * math.atan2(2, 2) / math.pi // returns number 0.25 + * + * const angle = math.unit(60, 'deg') // returns Unit 60 deg + * const x = math.cos(angle) + * const y = math.sin(angle) + * + * math.atan(2) // returns number 1.1071487177940904 + * + * See also: + * + * tan, atan, sin, cos + * + * @param {number | Array | Matrix} y Second dimension + * @param {number | Array | Matrix} x First dimension + * @return {number | Array | Matrix} Four-quadrant inverse tangent + */ + return typed(name, { + 'number, number': Math.atan2, + // Complex numbers doesn't seem to have a reasonable implementation of + // atan2(). Even Matlab removed the support, after they only calculated + // the atan only on base of the real part of the numbers and ignored + // the imaginary. + + 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x) + }, matrixAlgorithmSuite({ + scalar: 'number | BigNumber', + SS: matAlgo09xS0Sf, + DS: matAlgo03xDSf, + SD: matAlgo02xDS0, + Ss: matAlgo11xS0s, + sS: matAlgo12xSfs + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js new file mode 100644 index 0000000..ce7624a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js @@ -0,0 +1,47 @@ +import { factory } from '../../utils/factory.js'; +import { atanhNumber } from '../../plain/number/index.js'; +var name = 'atanh'; +var dependencies = ['typed', 'config', 'Complex']; +export var createAtanh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config, + Complex + } = _ref; + /** + * Calculate the hyperbolic arctangent of a value, + * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`. + * + * To avoid confusion with the matrix hyperbolic arctangent, this function + * does not apply to matrices. + * + * Syntax: + * + * math.atanh(x) + * + * Examples: + * + * math.atanh(0.5) // returns 0.5493061443340549 + * + * See also: + * + * acosh, asinh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic arctangent of x + */ + return typed(name, { + number: function number(x) { + if (x <= 1 && x >= -1 || config.predictable) { + return atanhNumber(x); + } + return new Complex(x, 0).atanh(); + }, + Complex: function Complex(x) { + return x.atanh(); + }, + BigNumber: function BigNumber(x) { + return x.atanh(); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cos.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cos.js new file mode 100644 index 0000000..d027a6a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cos.js @@ -0,0 +1,44 @@ +import { factory } from '../../utils/factory.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'cos'; +var dependencies = ['typed']; +export var createCos = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the cosine of a value. + * + * To avoid confusion with the matrix cosine, this function does not + * apply to matrices. + * + * Syntax: + * + * math.cos(x) + * + * Examples: + * + * math.cos(2) // returns number -0.4161468365471422 + * math.cos(math.pi / 4) // returns number 0.7071067811865475 + * math.cos(math.unit(180, 'deg')) // returns number -1 + * math.cos(math.unit(60, 'deg')) // returns number 0.5 + * + * const angle = 0.2 + * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1 + * + * See also: + * + * cos, tan + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Cosine of x + */ + return typed(name, { + number: Math.cos, + 'Complex | BigNumber': x => x.cos() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js new file mode 100644 index 0000000..831409f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js @@ -0,0 +1,35 @@ +import { factory } from '../../utils/factory.js'; +import { cosh as coshNumber } from '../../utils/number.js'; +var name = 'cosh'; +var dependencies = ['typed']; +export var createCosh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the hyperbolic cosine of a value, + * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`. + * + * To avoid confusion with the matrix hyperbolic cosine, this function does + * not apply to matrices. + * + * Syntax: + * + * math.cosh(x) + * + * Examples: + * + * math.cosh(0.5) // returns number 1.1276259652063807 + * + * See also: + * + * sinh, tanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cosine of x + */ + return typed(name, { + number: coshNumber, + 'Complex | BigNumber': x => x.cosh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cot.js new file mode 100644 index 0000000..c597776 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/cot.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +import { cotNumber } from '../../plain/number/index.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'cot'; +var dependencies = ['typed', 'BigNumber']; +export var createCot = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`. + * + * To avoid confusion with the matrix cotangent, this function does not + * apply to matrices. + * + * Syntax: + * + * math.cot(x) + * + * Examples: + * + * math.cot(2) // returns number -0.45765755436028577 + * 1 / math.tan(2) // returns number -0.45765755436028577 + * + * See also: + * + * tan, sec, csc + * + * @param {number | Complex | Unit | Array | Matrix} x Function input + * @return {number | Complex | Array | Matrix} Cotangent of x + */ + return typed(name, { + number: cotNumber, + Complex: x => x.cot(), + BigNumber: x => new _BigNumber(1).div(x.tan()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/coth.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/coth.js new file mode 100644 index 0000000..0ec6b42 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/coth.js @@ -0,0 +1,39 @@ +import { factory } from '../../utils/factory.js'; +import { cothNumber } from '../../plain/number/index.js'; +var name = 'coth'; +var dependencies = ['typed', 'BigNumber']; +export var createCoth = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the hyperbolic cotangent of a value, + * defined as `coth(x) = 1 / tanh(x)`. + * + * To avoid confusion with the matrix hyperbolic cotangent, this function + * does not apply to matrices. + * + * Syntax: + * + * math.coth(x) + * + * Examples: + * + * // coth(x) = 1 / tanh(x) + * math.coth(2) // returns 1.0373147207275482 + * 1 / math.tanh(2) // returns 1.0373147207275482 + * + * See also: + * + * sinh, tanh, cosh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cotangent of x + */ + return typed(name, { + number: cothNumber, + Complex: x => x.coth(), + BigNumber: x => new _BigNumber(1).div(x.tanh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csc.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csc.js new file mode 100644 index 0000000..295f377 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csc.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +import { cscNumber } from '../../plain/number/index.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'csc'; +var dependencies = ['typed', 'BigNumber']; +export var createCsc = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`. + * + * To avoid confusion with the matrix cosecant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.csc(x) + * + * Examples: + * + * math.csc(2) // returns number 1.099750170294617 + * 1 / math.sin(2) // returns number 1.099750170294617 + * + * See also: + * + * sin, sec, cot + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Cosecant of x + */ + return typed(name, { + number: cscNumber, + Complex: x => x.csc(), + BigNumber: x => new _BigNumber(1).div(x.sin()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csch.js new file mode 100644 index 0000000..869a32e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/csch.js @@ -0,0 +1,39 @@ +import { factory } from '../../utils/factory.js'; +import { cschNumber } from '../../plain/number/index.js'; +var name = 'csch'; +var dependencies = ['typed', 'BigNumber']; +export var createCsch = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the hyperbolic cosecant of a value, + * defined as `csch(x) = 1 / sinh(x)`. + * + * To avoid confusion with the matrix hyperbolic cosecant, this function + * does not apply to matrices. + * + * Syntax: + * + * math.csch(x) + * + * Examples: + * + * // csch(x) = 1/ sinh(x) + * math.csch(0.5) // returns 1.9190347513349437 + * 1 / math.sinh(0.5) // returns 1.9190347513349437 + * + * See also: + * + * sinh, sech, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic cosecant of x + */ + return typed(name, { + number: cschNumber, + Complex: x => x.csch(), + BigNumber: x => new _BigNumber(1).div(x.sinh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sec.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sec.js new file mode 100644 index 0000000..e8f5376 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sec.js @@ -0,0 +1,42 @@ +import { factory } from '../../utils/factory.js'; +import { secNumber } from '../../plain/number/index.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'sec'; +var dependencies = ['typed', 'BigNumber']; +export var createSec = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`. + * + * To avoid confusion with the matrix secant, this function does not + * apply to matrices. + * + * Syntax: + * + * math.sec(x) + * + * Examples: + * + * math.sec(2) // returns number -2.4029979617223822 + * 1 / math.cos(2) // returns number -2.4029979617223822 + * + * See also: + * + * cos, csc, cot + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Secant of x + */ + return typed(name, { + number: secNumber, + Complex: x => x.sec(), + BigNumber: x => new _BigNumber(1).div(x.cos()) + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sech.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sech.js new file mode 100644 index 0000000..8caa808 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sech.js @@ -0,0 +1,39 @@ +import { factory } from '../../utils/factory.js'; +import { sechNumber } from '../../plain/number/index.js'; +var name = 'sech'; +var dependencies = ['typed', 'BigNumber']; +export var createSech = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber: _BigNumber + } = _ref; + /** + * Calculate the hyperbolic secant of a value, + * defined as `sech(x) = 1 / cosh(x)`. + * + * To avoid confusion with the matrix hyperbolic secant, this function does + * not apply to matrices. + * + * Syntax: + * + * math.sech(x) + * + * Examples: + * + * // sech(x) = 1/ cosh(x) + * math.sech(0.5) // returns 0.886818883970074 + * 1 / math.cosh(0.5) // returns 0.886818883970074 + * + * See also: + * + * cosh, csch, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic secant of x + */ + return typed(name, { + number: sechNumber, + Complex: x => x.sech(), + BigNumber: x => new _BigNumber(1).div(x.cosh()) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sin.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sin.js new file mode 100644 index 0000000..890d266 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sin.js @@ -0,0 +1,44 @@ +import { factory } from '../../utils/factory.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'sin'; +var dependencies = ['typed']; +export var createSin = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the sine of a value. + * + * To avoid confusion with the matrix sine, this function does not apply + * to matrices. + * + * Syntax: + * + * math.sin(x) + * + * Examples: + * + * math.sin(2) // returns number 0.9092974268256813 + * math.sin(math.pi / 4) // returns number 0.7071067811865475 + * math.sin(math.unit(90, 'deg')) // returns number 1 + * math.sin(math.unit(30, 'deg')) // returns number 0.5 + * + * const angle = 0.2 + * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1 + * + * See also: + * + * cos, tan + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Sine of x + */ + return typed(name, { + number: Math.sin, + 'Complex | BigNumber': x => x.sin() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js new file mode 100644 index 0000000..8b2c08c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js @@ -0,0 +1,35 @@ +import { factory } from '../../utils/factory.js'; +import { sinhNumber } from '../../plain/number/index.js'; +var name = 'sinh'; +var dependencies = ['typed']; +export var createSinh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the hyperbolic sine of a value, + * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`. + * + * To avoid confusion with the matrix hyperbolic sine, this function does + * not apply to matrices. + * + * Syntax: + * + * math.sinh(x) + * + * Examples: + * + * math.sinh(0.5) // returns number 0.5210953054937474 + * + * See also: + * + * cosh, tanh + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic sine of x + */ + return typed(name, { + number: sinhNumber, + 'Complex | BigNumber': x => x.sinh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tan.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tan.js new file mode 100644 index 0000000..7419e95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tan.js @@ -0,0 +1,41 @@ +import { factory } from '../../utils/factory.js'; +import { createTrigUnit } from './trigUnit.js'; +var name = 'tan'; +var dependencies = ['typed']; +export var createTan = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + var trigUnit = createTrigUnit({ + typed + }); + + /** + * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`. + * + * To avoid confusion with the matrix tangent, this function does not apply + * to matrices. + * + * Syntax: + * + * math.tan(x) + * + * Examples: + * + * math.tan(0.5) // returns number 0.5463024898437905 + * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905 + * math.tan(math.pi / 4) // returns number 1 + * math.tan(math.unit(45, 'deg')) // returns number 1 + * + * See also: + * + * atan, sin, cos + * + * @param {number | BigNumber | Complex | Unit} x Function input + * @return {number | BigNumber | Complex} Tangent of x + */ + return typed(name, { + number: Math.tan, + 'Complex | BigNumber': x => x.tan() + }, trigUnit); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js new file mode 100644 index 0000000..d73aa80 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js @@ -0,0 +1,38 @@ +import { factory } from '../../utils/factory.js'; +import { tanh as _tanh } from '../../utils/number.js'; +var name = 'tanh'; +var dependencies = ['typed']; +export var createTanh = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Calculate the hyperbolic tangent of a value, + * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`. + * + * To avoid confusion with matrix hyperbolic tangent, this function does + * not apply to matrices. + * + * Syntax: + * + * math.tanh(x) + * + * Examples: + * + * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x) + * math.tanh(0.5) // returns 0.46211715726000974 + * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974 + * 1 / math.coth(0.5) // returns 0.46211715726000974 + * + * See also: + * + * sinh, cosh, coth + * + * @param {number | BigNumber | Complex} x Function input + * @return {number | BigNumber | Complex} Hyperbolic tangent of x + */ + return typed('tanh', { + number: _tanh, + 'Complex | BigNumber': x => x.tanh() + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js new file mode 100644 index 0000000..ebb5411 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js @@ -0,0 +1,14 @@ +import { factory } from '../../utils/factory.js'; +export var createTrigUnit = /* #__PURE__ */factory('trigUnit', ['typed'], _ref => { + var { + typed + } = _ref; + return { + Unit: typed.referToSelf(self => x => { + if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { + throw new TypeError('Unit in function cot is no angle'); + } + return typed.find(self, x.valueType())(x.value); + }) + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/unit/to.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/unit/to.js new file mode 100644 index 0000000..f11a865 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/unit/to.js @@ -0,0 +1,46 @@ +import { factory } from '../../utils/factory.js'; +import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js'; +var name = 'to'; +var dependencies = ['typed', 'matrix', 'concat']; +export var createTo = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix, + concat + } = _ref; + var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ + typed, + matrix, + concat + }); + + /** + * Change the unit of a value. + * + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.to(x, unit) + * + * Examples: + * + * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm + * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm + * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits + * + * See also: + * + * unit + * + * @param {Unit | Array | Matrix} x The unit to be converted. + * @param {Unit | Array | Matrix} unit New unit. Can be a string like "cm" + * or a unit without value. + * @return {Unit | Array | Matrix} value with changed, fixed unit. + */ + return typed(name, { + 'Unit, Unit | string': (x, unit) => x.to(unit) + }, matrixAlgorithmSuite({ + Ds: true + })); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/clone.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/clone.js new file mode 100644 index 0000000..db81566 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/clone.js @@ -0,0 +1,30 @@ +import { clone as objectClone } from '../../utils/object.js'; +import { factory } from '../../utils/factory.js'; +var name = 'clone'; +var dependencies = ['typed']; +export var createClone = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Clone an object. Will make a deep copy of the data. + * + * Syntax: + * + * math.clone(x) + * + * Examples: + * + * math.clone(3.5) // returns number 3.5 + * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i + * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg + * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]] + * math.clone("hello world") // returns string "hello world" + * + * @param {*} x Object to be cloned + * @return {*} A clone of object x + */ + return typed(name, { + any: objectClone + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js new file mode 100644 index 0000000..99d7fb7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js @@ -0,0 +1,50 @@ +import { factory } from '../../utils/factory.js'; +var name = 'hasNumericValue'; +var dependencies = ['typed', 'isNumeric']; +export var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + isNumeric + } = _ref; + /** + * Test whether a value is an numeric value. + * + * In case of a string, true is returned if the string contains a numeric value. + * + * Syntax: + * + * math.hasNumericValue(x) + * + * Examples: + * + * math.hasNumericValue(2) // returns true + * math.hasNumericValue('2') // returns true + * math.isNumeric('2') // returns false + * math.hasNumericValue(0) // returns true + * math.hasNumericValue(math.bignumber('500')) // returns true + * math.hasNumericValue(math.bigint('42')) // returns true + * math.hasNumericValue(42n) // returns true + * math.hasNumericValue(math.fraction(4)) // returns true + * math.hasNumericValue(math.complex('2-4i')) // returns false + * math.hasNumericValue(false) // returns true + * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true] + * + * See also: + * + * isZero, isPositive, isNegative, isInteger, isNumeric + * + * @param {*} x Value to be tested + * @return {boolean} Returns true when `x` is a `number`, `BigNumber`, + * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types. + * Throws an error in case of unknown types. + */ + return typed(name, { + boolean: () => true, + string: function string(x) { + return x.trim().length > 0 && !isNaN(Number(x)); + }, + any: function any(x) { + return isNumeric(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isInteger.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isInteger.js new file mode 100644 index 0000000..239fafd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isInteger.js @@ -0,0 +1,54 @@ +import { deepMap } from '../../utils/collection.js'; +import { isInteger as isIntegerNumber } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'isInteger'; +var dependencies = ['typed']; +export var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Test whether a value is an integer number. + * The function supports `number`, `BigNumber`, and `Fraction`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isInteger(x) + * + * Examples: + * + * math.isInteger(2) // returns true + * math.isInteger(0) // returns true + * math.isInteger(0.5) // returns false + * math.isInteger(math.bignumber(500)) // returns true + * math.isInteger(math.fraction(4)) // returns true + * math.isInteger('3') // returns true + * math.isInteger([3, 0.5, -2]) // returns [true, false, true] + * math.isInteger(math.complex('2-4i')) // throws an error + * + * See also: + * + * isNumeric, isPositive, isNegative, isZero + * + * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` contains a numeric, integer value. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: isIntegerNumber, + // TODO: what to do with isInteger(add(0.1, 0.2)) ? + + BigNumber: function BigNumber(x) { + return x.isInt(); + }, + bigint: function bigint(x) { + return true; + }, + Fraction: function Fraction(x) { + return x.d === 1 && isFinite(x.n); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNaN.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNaN.js new file mode 100644 index 0000000..30935d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNaN.js @@ -0,0 +1,58 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { isNaNNumber } from '../../plain/number/index.js'; +var name = 'isNaN'; +var dependencies = ['typed']; +export var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Test whether a value is NaN (not a number). + * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNaN(x) + * + * Examples: + * + * math.isNaN(3) // returns false + * math.isNaN(NaN) // returns true + * math.isNaN(0) // returns false + * math.isNaN(math.bignumber(NaN)) // returns true + * math.isNaN(math.bignumber(0)) // returns false + * math.isNaN(math.fraction(-2, 5)) // returns false + * math.isNaN('-2') // returns false + * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true] + * + * See also: + * + * isNumeric, isNegative, isPositive, isZero, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is NaN. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: isNaNNumber, + BigNumber: function BigNumber(x) { + return x.isNaN(); + }, + bigint: function bigint(x) { + return false; + }, + Fraction: function Fraction(x) { + return false; + }, + Complex: function Complex(x) { + return x.isNaN(); + }, + Unit: function Unit(x) { + return Number.isNaN(x.value); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNegative.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNegative.js new file mode 100644 index 0000000..692b361 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNegative.js @@ -0,0 +1,52 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { isNegativeNumber } from '../../plain/number/index.js'; +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +var name = 'isNegative'; +var dependencies = ['typed', 'config']; +export var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config + } = _ref; + /** + * Test whether a value is negative: smaller than zero. + * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNegative(x) + * + * Examples: + * + * math.isNegative(3) // returns false + * math.isNegative(-2) // returns true + * math.isNegative(0) // returns false + * math.isNegative(-0) // returns false + * math.isNegative(math.bignumber(2)) // returns false + * math.isNegative(math.fraction(-2, 5)) // returns true + * math.isNegative('-2') // returns true + * math.isNegative([2, 0, -3]) // returns [false, false, true] + * + * See also: + * + * isNumeric, isPositive, isZero, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x), + BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(), + bigint: x => x < 0n, + Fraction: x => x.s < 0, + // It's enough to decide on the sign + + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNumeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNumeric.js new file mode 100644 index 0000000..8e99aff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isNumeric.js @@ -0,0 +1,44 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'isNumeric'; +var dependencies = ['typed']; +export var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Test whether a value is an numeric value. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isNumeric(x) + * + * Examples: + * + * math.isNumeric(2) // returns true + * math.isNumeric('2') // returns false + * math.hasNumericValue('2') // returns true + * math.isNumeric(0) // returns true + * math.isNumeric(math.bignumber('42')) // returns true + * math.isNumeric(math.bigint('42')) // returns true + * math.isNumeric(math.fraction(4)) // returns true + * math.isNumeric(math.complex('2-4i')) // returns false + * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true] + * + * See also: + * + * isZero, isPositive, isNegative, isInteger, hasNumericValue + * + * @param {*} x Value to be tested + * @return {boolean} Returns true when `x` is a `number`, `BigNumber`, + * `Fraction`, or `boolean`. Returns false for other types. + * Throws an error in case of unknown types. + */ + return typed(name, { + 'number | BigNumber | bigint | Fraction | boolean': () => true, + 'Complex | Unit | string | null | undefined | Node': () => false, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPositive.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPositive.js new file mode 100644 index 0000000..443a2a8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPositive.js @@ -0,0 +1,52 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +import { isPositiveNumber } from '../../plain/number/index.js'; +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'; +import { nearlyEqual } from '../../utils/number.js'; +var name = 'isPositive'; +var dependencies = ['typed', 'config']; +export var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + config + } = _ref; + /** + * Test whether a value is positive: larger than zero. + * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isPositive(x) + * + * Examples: + * + * math.isPositive(3) // returns true + * math.isPositive(-2) // returns false + * math.isPositive(0) // returns false + * math.isPositive(-0) // returns false + * math.isPositive(0.5) // returns true + * math.isPositive(math.bignumber(2)) // returns true + * math.isPositive(math.fraction(-2, 5)) // returns false + * math.isPositive(math.fraction(1, 3)) // returns true + * math.isPositive('2') // returns true + * math.isPositive([2, 0, -3]) // returns [true, false, false] + * + * See also: + * + * isNumeric, isZero, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x), + BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(), + bigint: x => x > 0n, + Fraction: x => x.s > 0 && x.n > 0, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPrime.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPrime.js new file mode 100644 index 0000000..04b92f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isPrime.js @@ -0,0 +1,130 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'isPrime'; +var dependencies = ['typed']; +export var createIsPrime = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Test whether a value is prime: has no divisors other than itself and one. + * The function supports type `number`, `bignumber`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isPrime(x) + * + * Examples: + * + * math.isPrime(3) // returns true + * math.isPrime(-2) // returns false + * math.isPrime(0) // returns false + * math.isPrime(-0) // returns false + * math.isPrime(0.5) // returns false + * math.isPrime('2') // returns true + * math.isPrime([2, 17, 100]) // returns [true, true, false] + * + * See also: + * + * isNumeric, isZero, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is larger than zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + number: function number(x) { + if (x <= 3) { + return x > 1; + } + if (x % 2 === 0 || x % 3 === 0) { + return false; + } + for (var i = 5; i * i <= x; i += 6) { + if (x % i === 0 || x % (i + 2) === 0) { + return false; + } + } + return true; + }, + bigint: function bigint(x) { + if (x <= 3n) { + return x > 1n; + } + if (x % 2n === 0n || x % 3n === 0n) { + return false; + } + for (var i = 5n; i * i <= x; i += 6n) { + if (x % i === 0n || x % (i + 2n) === 0n) { + return false; + } + } + return true; + }, + BigNumber: function BigNumber(n) { + if (n.lte(3)) return n.gt(1); + if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false; + if (n.lt(Math.pow(2, 32))) { + var x = n.toNumber(); + for (var i = 5; i * i <= x; i += 6) { + if (x % i === 0 || x % (i + 2) === 0) { + return false; + } + } + return true; + } + function modPow(base, exponent, modulus) { + // exponent can be huge, use non-recursive variant + var accumulator = 1; + while (!exponent.eq(0)) { + if (exponent.mod(2).eq(0)) { + exponent = exponent.div(2); + base = base.mul(base).mod(modulus); + } else { + exponent = exponent.sub(1); + accumulator = base.mul(accumulator).mod(modulus); + } + } + return accumulator; + } + + // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants + var Decimal = n.constructor.clone({ + precision: n.toFixed(0).length * 2 + }); + n = new Decimal(n); + var r = 0; + var d = n.sub(1); + while (d.mod(2).eq(0)) { + d = d.div(2); + r += 1; + } + var bases = null; + // https://en.wikipedia.org/wiki/Miller–Rabin_primality_test#Testing_against_small_sets_of_bases + if (n.lt('3317044064679887385961981')) { + bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n); + } else { + var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2))); + bases = []; + for (var _i = 2; _i <= max; _i += 1) { + bases.push(max); + } + } + for (var _i2 = 0; _i2 < bases.length; _i2 += 1) { + var a = bases[_i2]; + var adn = modPow(n.sub(n).add(a), d, n); + if (!adn.eq(1)) { + for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) { + if (_i3 === r - 1) { + return false; + } + } + } + } + return true; + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isZero.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isZero.js new file mode 100644 index 0000000..726ea7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/isZero.js @@ -0,0 +1,49 @@ +import { deepMap } from '../../utils/collection.js'; +import { factory } from '../../utils/factory.js'; +var name = 'isZero'; +var dependencies = ['typed', 'equalScalar']; +export var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Test whether a value is zero. + * The function can check for zero for types `number`, `BigNumber`, `Fraction`, + * `Complex`, and `Unit`. + * + * The function is evaluated element-wise in case of Array or Matrix input. + * + * Syntax: + * + * math.isZero(x) + * + * Examples: + * + * math.isZero(0) // returns true + * math.isZero(2) // returns false + * math.isZero(0.5) // returns false + * math.isZero(math.bignumber(0)) // returns true + * math.isZero(math.fraction(0)) // returns true + * math.isZero(math.fraction(1,3)) // returns false + * math.isZero(math.complex('2 - 4i')) // returns false + * math.isZero(math.complex('0i')) // returns true + * math.isZero('0') // returns true + * math.isZero('2') // returns false + * math.isZero([2, 0, -3]) // returns [false, true, false] + * + * See also: + * + * isNumeric, isPositive, isNegative, isInteger + * + * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested + * @return {boolean} Returns true when `x` is zero. + * Throws an error in case of an unknown data type. + */ + return typed(name, { + 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0), + bigint: x => x === 0n, + Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)), + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/numeric.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/numeric.js new file mode 100644 index 0000000..3ffaa81 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/numeric.js @@ -0,0 +1,75 @@ +import { typeOf } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { noBignumber, noFraction } from '../../utils/noop.js'; +var name = 'numeric'; +var dependencies = ['number', '?bignumber', '?fraction']; +export var createNumeric = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + number: _number, + bignumber, + fraction + } = _ref; + var validInputTypes = { + string: true, + number: true, + BigNumber: true, + Fraction: true + }; + + // Load the conversion functions for each output type + var validOutputTypes = { + number: x => _number(x), + BigNumber: bignumber ? x => bignumber(x) : noBignumber, + bigint: x => BigInt(x), + Fraction: fraction ? x => fraction(x) : noFraction + }; + + /** + * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction. + * + * Syntax: + * + * math.numeric(x) + * + * Examples: + * + * math.numeric('4') // returns 4 + * math.numeric('4', 'number') // returns 4 + * math.numeric('4', 'bigint') // returns 4n + * math.numeric('4', 'BigNumber') // returns BigNumber 4 + * math.numeric('4', 'Fraction') // returns Fraction 4 + * math.numeric(4, 'Fraction') // returns Fraction 4 + * math.numeric(math.fraction(2, 5), 'number') // returns 0.4 + * + * See also: + * + * number, fraction, bignumber, bigint, string, format + * + * @param {string | number | BigNumber | bigint | Fraction } value + * A numeric value or a string containing a numeric value + * @param {string} outputType + * Desired numeric output type. + * Available values: 'number', 'BigNumber', or 'Fraction' + * @return {number | BigNumber | bigint | Fraction} + * Returns an instance of the numeric in the requested type + */ + return function numeric(value) { + var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number'; + var check = arguments.length > 2 ? arguments[2] : undefined; + if (check !== undefined) { + throw new SyntaxError('numeric() takes one or two arguments'); + } + var inputType = typeOf(value); + if (!(inputType in validInputTypes)) { + throw new TypeError('Cannot convert ' + value + ' of type "' + inputType + '"; valid input types are ' + Object.keys(validInputTypes).join(', ')); + } + if (!(outputType in validOutputTypes)) { + throw new TypeError('Cannot convert ' + value + ' to type "' + outputType + '"; valid output types are ' + Object.keys(validOutputTypes).join(', ')); + } + if (outputType === inputType) { + return value; + } else { + return validOutputTypes[outputType](value); + } + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/typeOf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/typeOf.js new file mode 100644 index 0000000..c20d278 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/function/utils/typeOf.js @@ -0,0 +1,65 @@ +import { factory } from '../../utils/factory.js'; +import { typeOf as _typeOf } from '../../utils/is.js'; +var name = 'typeOf'; +var dependencies = ['typed']; +export var createTypeOf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Determine the type of an entity. + * + * Syntax: + * + * math.typeOf(x) + * + * Examples: + * + * // This list is intended to include all relevant types, for testing + * // purposes: + * math.typeOf(3.5) // returns 'number' + * math.typeOf(42n) // returns 'bigint' + * math.typeOf(math.complex('2-4i')) // returns 'Complex' + * math.typeOf(math.unit('45 deg')) // returns 'Unit' + * math.typeOf('hello world') // returns 'string' + * math.typeOf(null) // returns 'null' + * math.typeOf(true) // returns 'boolean' + * math.typeOf([1, 2, 3]) // returns 'Array' + * math.typeOf(new Date()) // returns 'Date' + * math.typeOf(function () {}) // returns 'function' + * math.typeOf({a: 2, b: 3}) // returns 'Object' + * math.typeOf(/a regexp/) // returns 'RegExp' + * math.typeOf(undefined) // returns 'undefined' + * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber' + * math.typeOf(math.chain(2)) // returns 'Chain' + * math.typeOf(math.fraction(1, 3)) // returns 'Fraction' + * math.typeOf(math.help('sqrt')) // returns 'Help' + * math.typeOf(math.index(1, 3)) // returns 'Index' + * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix' + * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix' + * math.typeOf(new math.Range(0, 10)) // returns 'Range' + * math.typeOf(math.evaluate('a=2\na')) // returns 'ResultSet' + * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode' + * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode' + * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode' + * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode' + * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode' + * math.typeOf(math.parse('2.3')) // returns 'ConstantNode' + * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode' + * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode' + * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode' + * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode' + * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode' + * math.typeOf(math.parse('1:10')) // returns 'RangeNode' + * math.typeOf(math.parse('a + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/index.js new file mode 100644 index 0000000..7e74c6c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/index.js @@ -0,0 +1 @@ +export * from './entry/mainAny.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/replacer.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/replacer.js new file mode 100644 index 0000000..2bed9f3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/replacer.js @@ -0,0 +1,33 @@ +import { factory } from '../utils/factory.js'; +var name = 'replacer'; +var dependencies = []; +export var createReplacer = /* #__PURE__ */factory(name, dependencies, () => { + /** + * Stringify data types into their JSON representation. + * Most data types can be serialized using their `.toJSON` method, + * but not all, for example the number `Infinity`. For these cases you have + * to use the replacer. Example usage: + * + * JSON.stringify([2, Infinity], math.replacer) + * + * @param {string} key + * @param {*} value + * @returns {*} Returns the replaced object + */ + return function replacer(key, value) { + // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON + if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) { + return { + mathjs: 'number', + value: String(value) + }; + } + if (typeof value === 'bigint') { + return { + mathjs: 'bigint', + value: String(value) + }; + } + return value; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/reviver.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/reviver.js new file mode 100644 index 0000000..982218a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/json/reviver.js @@ -0,0 +1,21 @@ +import { factory } from '../utils/factory.js'; +var name = 'reviver'; +var dependencies = ['classes']; +export var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + classes + } = _ref; + /** + * Instantiate mathjs data types from their JSON representation + * @param {string} key + * @param {*} value + * @returns {*} Returns the revived object + */ + return function reviver(key, value) { + var constructor = classes[value && value.mathjs]; + if (constructor && typeof constructor.fromJSON === 'function') { + return constructor.fromJSON(value); + } + return value; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/number.js new file mode 100644 index 0000000..5181f6c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/number.js @@ -0,0 +1 @@ +export * from './entry/mainNumber.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js new file mode 100644 index 0000000..2cf9080 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js @@ -0,0 +1,22 @@ +var signature1 = 'BigNumber'; +var signature2 = 'BigNumber, BigNumber'; +export function absBigNumber(a) { + return a.abs(); +} +absBigNumber.signature = signature1; +export function addBigNumber(a, b) { + return a.add(b); +} +addBigNumber.signature = signature2; +export function subtractBigNumber(a, b) { + return a.sub(b); +} +subtractBigNumber.signature = signature2; +export function multiplyBigNumber(a, b) { + return a.mul(b); +} +multiplyBigNumber.signature = signature2; +export function divideBigNumber(a, b) { + return a.div(b); +} +divideBigNumber.signature = signature2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/index.js new file mode 100644 index 0000000..a60ccf4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/bignumber/index.js @@ -0,0 +1,9 @@ +import Decimal from 'decimal.js'; +export * from './arithmetic.js'; + +// TODO: this is ugly. Instead, be able to pass your own isBigNumber function to typed? +var BigNumber = Decimal.clone(); +BigNumber.prototype.isBigNumber = true; +export function bignumber(x) { + return new BigNumber(x); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/arithmetic.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/arithmetic.js new file mode 100644 index 0000000..d47fd95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/arithmetic.js @@ -0,0 +1,303 @@ +import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js'; +var n1 = 'number'; +var n2 = 'number, number'; +export function absNumber(a) { + return Math.abs(a); +} +absNumber.signature = n1; +export function addNumber(a, b) { + return a + b; +} +addNumber.signature = n2; +export function subtractNumber(a, b) { + return a - b; +} +subtractNumber.signature = n2; +export function multiplyNumber(a, b) { + return a * b; +} +multiplyNumber.signature = n2; +export function divideNumber(a, b) { + return a / b; +} +divideNumber.signature = n2; +export function unaryMinusNumber(x) { + return -x; +} +unaryMinusNumber.signature = n1; +export function unaryPlusNumber(x) { + return x; +} +unaryPlusNumber.signature = n1; +export function cbrtNumber(x) { + return cbrt(x); +} +cbrtNumber.signature = n1; +export function cubeNumber(x) { + return x * x * x; +} +cubeNumber.signature = n1; +export function expNumber(x) { + return Math.exp(x); +} +expNumber.signature = n1; +export function expm1Number(x) { + return expm1(x); +} +expm1Number.signature = n1; + +/** + * Calculate gcd for numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the greatest common denominator of a and b + */ +export function gcdNumber(a, b) { + if (!isInteger(a) || !isInteger(b)) { + throw new Error('Parameters in function gcd must be integer numbers'); + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + var r; + while (b !== 0) { + r = a % b; + a = b; + b = r; + } + return a < 0 ? -a : a; +} +gcdNumber.signature = n2; + +/** + * Calculate lcm for two numbers + * @param {number} a + * @param {number} b + * @returns {number} Returns the least common multiple of a and b + */ +export function lcmNumber(a, b) { + if (!isInteger(a) || !isInteger(b)) { + throw new Error('Parameters in function lcm must be integer numbers'); + } + if (a === 0 || b === 0) { + return 0; + } + + // https://en.wikipedia.org/wiki/Euclidean_algorithm + // evaluate lcm here inline to reduce overhead + var t; + var prod = a * b; + while (b !== 0) { + t = b; + b = a % t; + a = t; + } + return Math.abs(prod / a); +} +lcmNumber.signature = n2; + +/** + * Calculate the logarithm of a value, optionally to a given base. + * @param {number} x + * @param {number | null | undefined} base + * @return {number} + */ +export function logNumber(x, y) { + if (y) { + return Math.log(x) / Math.log(y); + } + return Math.log(x); +} + +/** + * Calculate the 10-base logarithm of a number + * @param {number} x + * @return {number} + */ +export function log10Number(x) { + return log10(x); +} +log10Number.signature = n1; + +/** + * Calculate the 2-base logarithm of a number + * @param {number} x + * @return {number} + */ +export function log2Number(x) { + return log2(x); +} +log2Number.signature = n1; + +/** + * Calculate the natural logarithm of a `number+1` + * @param {number} x + * @returns {number} + */ +export function log1pNumber(x) { + return log1p(x); +} +log1pNumber.signature = n1; + +/** + * Calculate the modulus of two numbers + * @param {number} x + * @param {number} y + * @returns {number} res + * @private + */ +export function modNumber(x, y) { + // We don't use JavaScript's % operator here as this doesn't work + // correctly for x < 0 and x === 0 + // see https://en.wikipedia.org/wiki/Modulo_operation + return y === 0 ? x : x - y * Math.floor(x / y); +} +modNumber.signature = n2; + +/** + * Calculate the nth root of a, solve x^root == a + * http://rosettacode.org/wiki/Nth_root#JavaScript + * @param {number} a + * @param {number} [2] root + * @private + */ +export function nthRootNumber(a) { + var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; + var inv = root < 0; + if (inv) { + root = -root; + } + if (root === 0) { + throw new Error('Root must be non-zero'); + } + if (a < 0 && Math.abs(root) % 2 !== 1) { + throw new Error('Root must be odd when a is negative.'); + } + + // edge cases zero and infinity + if (a === 0) { + return inv ? Infinity : 0; + } + if (!isFinite(a)) { + return inv ? 0 : a; + } + var x = Math.pow(Math.abs(a), 1 / root); + // If a < 0, we require that root is an odd integer, + // so (-1) ^ (1/root) = -1 + x = a < 0 ? -x : x; + return inv ? 1 / x : x; + + // Very nice algorithm, but fails with nthRoot(-2, 3). + // Newton's method has some well-known problems at times: + // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis + /* + let x = 1 // Initial guess + let xPrev = 1 + let i = 0 + const iMax = 10000 + do { + const delta = (a / Math.pow(x, root - 1) - x) / root + xPrev = x + x = x + delta + i++ + } + while (xPrev !== x && i < iMax) + if (xPrev !== x) { + throw new Error('Function nthRoot failed to converge') + } + return inv ? 1 / x : x + */ +} +export function signNumber(x) { + return sign(x); +} +signNumber.signature = n1; +export function sqrtNumber(x) { + return Math.sqrt(x); +} +sqrtNumber.signature = n1; +export function squareNumber(x) { + return x * x; +} +squareNumber.signature = n1; + +/** + * Calculate xgcd for two numbers + * @param {number} a + * @param {number} b + * @return {number} result + * @private + */ +export function xgcdNumber(a, b) { + // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm + var t; // used to swap two variables + var q; // quotient + var r; // remainder + var x = 0; + var lastx = 1; + var y = 1; + var lasty = 0; + if (!isInteger(a) || !isInteger(b)) { + throw new Error('Parameters in function xgcd must be integer numbers'); + } + while (b) { + q = Math.floor(a / b); + r = a - q * b; + t = x; + x = lastx - q * x; + lastx = t; + t = y; + y = lasty - q * y; + lasty = t; + a = b; + b = r; + } + var res; + if (a < 0) { + res = [-a, -lastx, -lasty]; + } else { + res = [a, a ? lastx : 0, lasty]; + } + return res; +} +xgcdNumber.signature = n2; + +/** + * Calculates the power of x to y, x^y, for two numbers. + * @param {number} x + * @param {number} y + * @return {number} res + */ +export function powNumber(x, y) { + // x^Infinity === 0 if -1 < x < 1 + // A real number 0 is returned instead of complex(0) + if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) { + return 0; + } + return Math.pow(x, y); +} +powNumber.signature = n2; + +/** + * round a number to the given number of decimals, or to zero if decimals is + * not provided + * @param {number} value + * @param {number} decimals number of decimals, between 0 and 15 (0 by default) + * @return {number} roundedValue + */ +export function roundNumber(value) { + var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + if (!isInteger(decimals) || decimals < 0 || decimals > 15) { + throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive'); + } + return parseFloat(toFixed(value, decimals)); +} + +/** + * Calculate the norm of a number, the absolute value. + * @param {number} x + * @return {number} + */ +export function normNumber(x) { + return Math.abs(x); +} +normNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/bitwise.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/bitwise.js new file mode 100644 index 0000000..0d21693 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/bitwise.js @@ -0,0 +1,52 @@ +import { isInteger } from '../../utils/number.js'; +var n1 = 'number'; +var n2 = 'number, number'; +export function bitAndNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function bitAnd'); + } + return x & y; +} +bitAndNumber.signature = n2; +export function bitNotNumber(x) { + if (!isInteger(x)) { + throw new Error('Integer expected in function bitNot'); + } + return ~x; +} +bitNotNumber.signature = n1; +export function bitOrNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function bitOr'); + } + return x | y; +} +bitOrNumber.signature = n2; +export function bitXorNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function bitXor'); + } + return x ^ y; +} +bitXorNumber.signature = n2; +export function leftShiftNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function leftShift'); + } + return x << y; +} +leftShiftNumber.signature = n2; +export function rightArithShiftNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function rightArithShift'); + } + return x >> y; +} +rightArithShiftNumber.signature = n2; +export function rightLogShiftNumber(x, y) { + if (!isInteger(x) || !isInteger(y)) { + throw new Error('Integers expected in function rightLogShift'); + } + return x >>> y; +} +rightLogShiftNumber.signature = n2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/combinations.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/combinations.js new file mode 100644 index 0000000..a102eed --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/combinations.js @@ -0,0 +1,33 @@ +import { isInteger } from '../../utils/number.js'; +import { product } from '../../utils/product.js'; +export function combinationsNumber(n, k) { + if (!isInteger(n) || n < 0) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (!isInteger(k) || k < 0) { + throw new TypeError('Positive integer value expected in function combinations'); + } + if (k > n) { + throw new TypeError('k must be less than or equal to n'); + } + var nMinusk = n - k; + var answer = 1; + var firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1; + var nextdivisor = 2; + var lastdivisor = k < nMinusk ? k : nMinusk; + // balance multiplications and divisions to try to keep intermediate values + // in exact-integer range as long as possible + for (var nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) { + answer *= nextnumerator; + while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) { + answer /= nextdivisor; + ++nextdivisor; + } + } + // for big n, k, floating point may have caused weirdness in remainder + if (nextdivisor <= lastdivisor) { + answer /= product(nextdivisor, lastdivisor); + } + return answer; +} +combinationsNumber.signature = 'number, number'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/constants.js new file mode 100644 index 0000000..a544965 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/constants.js @@ -0,0 +1,4 @@ +export var pi = Math.PI; +export var tau = 2 * Math.PI; +export var e = Math.E; +export var phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/index.js new file mode 100644 index 0000000..769d9fc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/index.js @@ -0,0 +1,9 @@ +export * from './arithmetic.js'; +export * from './bitwise.js'; +export * from './combinations.js'; +export * from './constants.js'; +export * from './logical.js'; +export * from './relational.js'; +export * from './probability.js'; +export * from './trigonometry.js'; +export * from './utils.js'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/logical.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/logical.js new file mode 100644 index 0000000..61f2d60 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/logical.js @@ -0,0 +1,18 @@ +var n1 = 'number'; +var n2 = 'number, number'; +export function notNumber(x) { + return !x; +} +notNumber.signature = n1; +export function orNumber(x, y) { + return !!(x || y); +} +orNumber.signature = n2; +export function xorNumber(x, y) { + return !!x !== !!y; +} +xorNumber.signature = n2; +export function andNumber(x, y) { + return !!(x && y); +} +andNumber.signature = n2; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/probability.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/probability.js new file mode 100644 index 0000000..16a8be0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/probability.js @@ -0,0 +1,75 @@ +/* eslint-disable no-loss-of-precision */ + +import { isInteger } from '../../utils/number.js'; +import { product } from '../../utils/product.js'; +export function gammaNumber(n) { + var x; + if (isInteger(n)) { + if (n <= 0) { + return isFinite(n) ? Infinity : NaN; + } + if (n > 171) { + return Infinity; // Will overflow + } + return product(1, n - 1); + } + if (n < 0.5) { + return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n)); + } + if (n >= 171.35) { + return Infinity; // will overflow + } + if (n > 85.0) { + // Extended Stirling Approx + var twoN = n * n; + var threeN = twoN * n; + var fourN = threeN * n; + var fiveN = fourN * n; + return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n)); + } + --n; + x = gammaP[0]; + for (var i = 1; i < gammaP.length; ++i) { + x += gammaP[i] / (n + i); + } + var t = n + gammaG + 0.5; + return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x; +} +gammaNumber.signature = 'number'; + +// TODO: comment on the variables g and p + +export var gammaG = 4.7421875; +export var gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5]; + +// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code + +// log(2 * pi) / 2 +export var lnSqrt2PI = 0.91893853320467274178; +export var lgammaG = 5; // Lanczos parameter "g" +export var lgammaN = 7; // Range of coefficients "n" + +export var lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5]; +export function lgammaNumber(n) { + if (n < 0) return NaN; + if (n === 0) return Infinity; + if (!isFinite(n)) return n; + if (n < 0.5) { + // Use Euler's reflection formula: + // gamma(z) = PI / (sin(PI * z) * gamma(1 - z)) + return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n); + } + + // Compute the logarithm of the Gamma function using the Lanczos method + + n = n - 1; + var base = n + lgammaG + 0.5; // Base of the Lanczos exponential + var sum = lgammaSeries[0]; + + // We start with the terms that have the smallest coefficients and largest denominator + for (var i = lgammaN - 1; i >= 1; i--) { + sum += lgammaSeries[i] / (n + i); + } + return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum); +} +lgammaNumber.signature = 'number'; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/relational.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/relational.js new file mode 100644 index 0000000..e69de29 diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/trigonometry.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/trigonometry.js new file mode 100644 index 0000000..6a49a62 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/trigonometry.js @@ -0,0 +1,112 @@ +import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js'; +var n1 = 'number'; +var n2 = 'number, number'; +export function acosNumber(x) { + return Math.acos(x); +} +acosNumber.signature = n1; +export function acoshNumber(x) { + return acosh(x); +} +acoshNumber.signature = n1; +export function acotNumber(x) { + return Math.atan(1 / x); +} +acotNumber.signature = n1; +export function acothNumber(x) { + return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0; +} +acothNumber.signature = n1; +export function acscNumber(x) { + return Math.asin(1 / x); +} +acscNumber.signature = n1; +export function acschNumber(x) { + var xInv = 1 / x; + return Math.log(xInv + Math.sqrt(xInv * xInv + 1)); +} +acschNumber.signature = n1; +export function asecNumber(x) { + return Math.acos(1 / x); +} +asecNumber.signature = n1; +export function asechNumber(x) { + var xInv = 1 / x; + var ret = Math.sqrt(xInv * xInv - 1); + return Math.log(ret + xInv); +} +asechNumber.signature = n1; +export function asinNumber(x) { + return Math.asin(x); +} +asinNumber.signature = n1; +export function asinhNumber(x) { + return asinh(x); +} +asinhNumber.signature = n1; +export function atanNumber(x) { + return Math.atan(x); +} +atanNumber.signature = n1; +export function atan2Number(y, x) { + return Math.atan2(y, x); +} +atan2Number.signature = n2; +export function atanhNumber(x) { + return atanh(x); +} +atanhNumber.signature = n1; +export function cosNumber(x) { + return Math.cos(x); +} +cosNumber.signature = n1; +export function coshNumber(x) { + return cosh(x); +} +coshNumber.signature = n1; +export function cotNumber(x) { + return 1 / Math.tan(x); +} +cotNumber.signature = n1; +export function cothNumber(x) { + var e = Math.exp(2 * x); + return (e + 1) / (e - 1); +} +cothNumber.signature = n1; +export function cscNumber(x) { + return 1 / Math.sin(x); +} +cscNumber.signature = n1; +export function cschNumber(x) { + // consider values close to zero (+/-) + if (x === 0) { + return Number.POSITIVE_INFINITY; + } else { + return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x); + } +} +cschNumber.signature = n1; +export function secNumber(x) { + return 1 / Math.cos(x); +} +secNumber.signature = n1; +export function sechNumber(x) { + return 2 / (Math.exp(x) + Math.exp(-x)); +} +sechNumber.signature = n1; +export function sinNumber(x) { + return Math.sin(x); +} +sinNumber.signature = n1; +export function sinhNumber(x) { + return sinh(x); +} +sinhNumber.signature = n1; +export function tanNumber(x) { + return Math.tan(x); +} +tanNumber.signature = n1; +export function tanhNumber(x) { + return tanh(x); +} +tanhNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/utils.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/utils.js new file mode 100644 index 0000000..fec97d5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/plain/number/utils.js @@ -0,0 +1,22 @@ +import { isInteger } from '../../utils/number.js'; +var n1 = 'number'; +export function isIntegerNumber(x) { + return isInteger(x); +} +isIntegerNumber.signature = n1; +export function isNegativeNumber(x) { + return x < 0; +} +isNegativeNumber.signature = n1; +export function isPositiveNumber(x) { + return x > 0; +} +isPositiveNumber.signature = n1; +export function isZeroNumber(x) { + return x === 0; +} +isZeroNumber.signature = n1; +export function isNaNNumber(x) { + return Number.isNaN(x); +} +isNaNNumber.signature = n1; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bigint.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bigint.js new file mode 100644 index 0000000..1432a5a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bigint.js @@ -0,0 +1,65 @@ +import { factory } from '../utils/factory.js'; +import { deepMap } from '../utils/collection.js'; +var name = 'bigint'; +var dependencies = ['typed']; +export var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Create a bigint or convert a string, boolean, or unit to a bigint. + * When value is a matrix, all elements will be converted to bigint. + * + * Syntax: + * + * math.bigint(value) + * + * Examples: + * + * math.bigint(2) // returns 2n + * math.bigint('123') // returns 123n + * math.bigint(true) // returns 1n + * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n] + * + * See also: + * + * number, bignumber, boolean, complex, index, matrix, string, unit + * + * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted + * @return {bigint | Array | Matrix} The created bigint + */ + var bigint = typed('bigint', { + '': function _() { + return 0n; + }, + bigint: function bigint(x) { + return x; + }, + number: function number(x) { + return BigInt(x.toFixed()); + }, + BigNumber: function BigNumber(x) { + return BigInt(x.round().toString()); + }, + Fraction: function Fraction(x) { + return BigInt(x.valueOf().toFixed()); + }, + 'string | boolean': function string__boolean(x) { + return BigInt(x); + }, + null: function _null(x) { + return 0n; + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); + + // reviver function to parse a JSON object like: + // + // {"mathjs":"bigint","value":"123"} + // + // into a bigint 123n + bigint.fromJSON = function (json) { + return BigInt(json.value); + }; + return bigint; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js new file mode 100644 index 0000000..4465c8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js @@ -0,0 +1,57 @@ +import Decimal from 'decimal.js'; +import { factory } from '../../utils/factory.js'; +var name = 'BigNumber'; +var dependencies = ['?on', 'config']; +export var createBigNumberClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + on, + config + } = _ref; + var BigNumber = Decimal.clone({ + precision: config.precision, + modulo: Decimal.EUCLID + }); + BigNumber.prototype = Object.create(BigNumber.prototype); + + /** + * Attach type information + */ + BigNumber.prototype.type = 'BigNumber'; + BigNumber.prototype.isBigNumber = true; + + /** + * Get a JSON representation of a BigNumber containing + * type information + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "BigNumber", "value": "0.2"}` + */ + BigNumber.prototype.toJSON = function () { + return { + mathjs: 'BigNumber', + value: this.toString() + }; + }; + + /** + * Instantiate a BigNumber from a JSON object + * @param {Object} json a JSON object structured as: + * `{"mathjs": "BigNumber", "value": "0.2"}` + * @return {BigNumber} + */ + BigNumber.fromJSON = function (json) { + return new BigNumber(json.value); + }; + if (on) { + // listen for changed in the configuration, automatically apply changed precision + on('config', function (curr, prev) { + if (curr.precision !== prev.precision) { + BigNumber.config({ + precision: curr.precision + }); + } + }); + } + return BigNumber; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js new file mode 100644 index 0000000..7c36f8e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js @@ -0,0 +1,82 @@ +import { factory } from '../../../utils/factory.js'; +import { deepMap } from '../../../utils/collection.js'; +var name = 'bignumber'; +var dependencies = ['typed', 'BigNumber']; +export var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + BigNumber + } = _ref; + /** + * Create a BigNumber, which can store numbers with arbitrary precision. + * When a matrix is provided, all elements will be converted to BigNumber. + * + * Syntax: + * + * math.bignumber(x) + * + * Examples: + * + * 0.1 + 0.2 // returns number 0.30000000000000004 + * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3 + * + * + * 7.2e500 // returns number Infinity + * math.bignumber('7.2e500') // returns BigNumber 7.2e500 + * + * See also: + * + * number, bigint, boolean, complex, index, matrix, string, unit + * + * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number, + * 0 by default. + * @returns {BigNumber} The created bignumber + */ + return typed('bignumber', { + '': function _() { + return new BigNumber(0); + }, + number: function number(x) { + // convert to string to prevent errors in case of >15 digits + return new BigNumber(x + ''); + }, + string: function string(x) { + var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/); + if (wordSizeSuffixMatch) { + // x has a word size suffix + var size = wordSizeSuffixMatch[2]; + var n = BigNumber(wordSizeSuffixMatch[1]); + var twoPowSize = new BigNumber(2).pow(Number(size)); + if (n.gt(twoPowSize.sub(1))) { + throw new SyntaxError("String \"".concat(x, "\" is out of range")); + } + var twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1); + if (n.gte(twoPowSizeSubOne)) { + return n.sub(twoPowSize); + } else { + return n; + } + } + return new BigNumber(x); + }, + BigNumber: function BigNumber(x) { + // we assume a BigNumber is immutable + return x; + }, + bigint: function bigint(x) { + return new BigNumber(x.toString()); + }, + Unit: typed.referToSelf(self => x => { + var clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + Fraction: function Fraction(x) { + return new BigNumber(x.n).div(x.d).times(x.s); + }, + null: function _null(x) { + return new BigNumber(0); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/boolean.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/boolean.js new file mode 100644 index 0000000..7f18b21 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/boolean.js @@ -0,0 +1,70 @@ +import { factory } from '../utils/factory.js'; +import { deepMap } from '../utils/collection.js'; +var name = 'boolean'; +var dependencies = ['typed']; +export var createBoolean = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Create a boolean or convert a string or number to a boolean. + * In case of a number, `true` is returned for non-zero numbers, and `false` in + * case of zero. + * Strings can be `'true'` or `'false'`, or can contain a number. + * When value is a matrix, all elements will be converted to boolean. + * + * Syntax: + * + * math.boolean(x) + * + * Examples: + * + * math.boolean(0) // returns false + * math.boolean(1) // returns true + * math.boolean(-3) // returns true + * math.boolean('true') // returns true + * math.boolean('false') // returns false + * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true] + * + * See also: + * + * bignumber, complex, index, matrix, string, unit + * + * @param {string | number | boolean | Array | Matrix | null} value A value of any type + * @return {boolean | Array | Matrix} The boolean value + */ + return typed(name, { + '': function _() { + return false; + }, + boolean: function boolean(x) { + return x; + }, + number: function number(x) { + return !!x; + }, + null: function _null(x) { + return false; + }, + BigNumber: function BigNumber(x) { + return !x.isZero(); + }, + string: function string(x) { + // try case insensitive + var lcase = x.toLowerCase(); + if (lcase === 'true') { + return true; + } else if (lcase === 'false') { + return false; + } + + // test whether value is a valid number + var num = Number(x); + if (x !== '' && !isNaN(num)) { + return !!num; + } + throw new Error('Cannot convert "' + x + '" to a boolean'); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/Chain.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/Chain.js new file mode 100644 index 0000000..1f27638 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/Chain.js @@ -0,0 +1,213 @@ +import { isChain } from '../../utils/is.js'; +import { format } from '../../utils/string.js'; +import { hasOwnProperty, lazy } from '../../utils/object.js'; +import { factory } from '../../utils/factory.js'; +var name = 'Chain'; +var dependencies = ['?on', 'math', 'typed']; +export var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + on, + math, + typed + } = _ref; + /** + * @constructor Chain + * Wrap any value in a chain, allowing to perform chained operations on + * the value. + * + * All methods available in the math.js library can be called upon the chain, + * and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing chain.done(), which will return + * the final value. + * + * The Chain has a number of special functions: + * - done() Finalize the chained operation and return the + * chain's value. + * - valueOf() The same as done() + * - toString() Returns a string representation of the chain's value. + * + * @param {*} [value] + */ + function Chain(value) { + if (!(this instanceof Chain)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (isChain(value)) { + this.value = value.value; + } else { + this.value = value; + } + } + + /** + * Attach type information + */ + Chain.prototype.type = 'Chain'; + Chain.prototype.isChain = true; + + /** + * Close the chain. Returns the final value. + * Does the same as method valueOf() + * @returns {*} value + */ + Chain.prototype.done = function () { + return this.value; + }; + + /** + * Close the chain. Returns the final value. + * Does the same as method done() + * @returns {*} value + */ + Chain.prototype.valueOf = function () { + return this.value; + }; + + /** + * Get a string representation of the value in the chain + * @returns {string} + */ + Chain.prototype.toString = function () { + return format(this.value); + }; + + /** + * Get a JSON representation of the chain + * @returns {Object} + */ + Chain.prototype.toJSON = function () { + return { + mathjs: 'Chain', + value: this.value + }; + }; + + /** + * Instantiate a Chain from its JSON representation + * @param {Object} json An object structured like + * `{"mathjs": "Chain", value: ...}`, + * where mathjs is optional + * @returns {Chain} + */ + Chain.fromJSON = function (json) { + return new Chain(json.value); + }; + + /** + * Create a proxy method for the chain + * @param {string} name + * @param {Function} fn The function to be proxied + * If fn is no function, it is silently ignored. + * @private + */ + function createProxy(name, fn) { + if (typeof fn === 'function') { + Chain.prototype[name] = chainify(fn); + } + } + + /** + * Create a proxy method for the chain + * @param {string} name + * @param {function} resolver The function resolving with the + * function to be proxied + * @private + */ + function createLazyProxy(name, resolver) { + lazy(Chain.prototype, name, function outerResolver() { + var fn = resolver(); + if (typeof fn === 'function') { + return chainify(fn); + } + return undefined; // if not a function, ignore + }); + } + + /** + * Make a function chainable + * @param {function} fn + * @return {Function} chain function + * @private + */ + function chainify(fn) { + return function () { + // Here, `this` will be the context of a Chain instance + if (arguments.length === 0) { + return new Chain(fn(this.value)); + } + var args = [this.value]; + for (var i = 0; i < arguments.length; i++) { + args[i + 1] = arguments[i]; + } + if (typed.isTypedFunction(fn)) { + var sigObject = typed.resolve(fn, args); + // We want to detect if a rest parameter has matched across the + // value in the chain and the current arguments of this call. + // That is the case if and only if the matching signature has + // exactly one parameter (which then must be a rest parameter + // as it is matching at least two actual arguments). + if (sigObject.params.length === 1) { + throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.'); + } + return new Chain(sigObject.implementation.apply(fn, args)); + } + return new Chain(fn.apply(fn, args)); + }; + } + + /** + * Create a proxy for a single method, or an object with multiple methods. + * Example usage: + * + * Chain.createProxy('add', function add (x, y) {...}) + * Chain.createProxy({ + * add: function add (x, y) {...}, + * subtract: function subtract (x, y) {...} + * } + * + * @param {string | Object} arg0 A name (string), or an object with + * functions + * @param {*} [arg1] A function, when arg0 is a name + */ + Chain.createProxy = function (arg0, arg1) { + if (typeof arg0 === 'string') { + // createProxy(name, value) + createProxy(arg0, arg1); + } else { + var _loop = function _loop(_name) { + if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) { + createLazyProxy(_name, () => arg0[_name]); + } + }; + // createProxy(values) + for (var _name in arg0) { + _loop(_name); + } + } + }; + var excludedNames = { + expression: true, + docs: true, + type: true, + classes: true, + json: true, + error: true, + isChain: true // conflicts with the property isChain of a Chain instance + }; + + // create proxy for everything that is in math.js + Chain.createProxy(math); + + // register on the import event, automatically add a proxy for every imported function. + if (on) { + on('import', function (name, resolver, path) { + if (!path) { + // an imported function (not a data type or something special) + createLazyProxy(name, resolver); + } + }); + } + return Chain; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/function/chain.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/function/chain.js new file mode 100644 index 0000000..50e5e2f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/chain/function/chain.js @@ -0,0 +1,52 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'chain'; +var dependencies = ['typed', 'Chain']; +export var createChain = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Chain + } = _ref; + /** + * Wrap any value in a chain, allowing to perform chained operations on + * the value. + * + * All methods available in the math.js library can be called upon the chain, + * and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing `chain.done()`, which returns + * the final value. + * + * The chain has a number of special functions: + * + * - `done()` Finalize the chain and return the chain's value. + * - `valueOf()` The same as `done()` + * - `toString()` Executes `math.format()` onto the chain's value, returning + * a string representation of the value. + * + * Syntax: + * + * math.chain(value) + * + * Examples: + * + * math.chain(3) + * .add(4) + * .subtract(2) + * .done() // 5 + * + * math.chain( [[1, 2], [3, 4]] ) + * .subset(math.index(0, 0), 8) + * .multiply(3) + * .done() // [[24, 6], [9, 12]] + * + * @param {*} [value] A value of any type on which to start a chained operation. + * @return {math.Chain} The created chain + */ + return typed(name, { + '': function _() { + return new Chain(); + }, + any: function any(value) { + return new Chain(value); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/Complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/Complex.js new file mode 100644 index 0000000..4346872 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/Complex.js @@ -0,0 +1,194 @@ +import Complex from 'complex.js'; +import { format } from '../../utils/number.js'; +import { isNumber, isUnit } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +var name = 'Complex'; +var dependencies = []; +export var createComplexClass = /* #__PURE__ */factory(name, dependencies, () => { + /** + * Attach type information + */ + Object.defineProperty(Complex, 'name', { + value: 'Complex' + }); + Complex.prototype.constructor = Complex; + Complex.prototype.type = 'Complex'; + Complex.prototype.isComplex = true; + + /** + * Get a JSON representation of the complex number + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Complex", "re": 2, "im": 3}` + */ + Complex.prototype.toJSON = function () { + return { + mathjs: 'Complex', + re: this.re, + im: this.im + }; + }; + + /* + * Return the value of the complex number in polar notation + * The angle phi will be set in the interval of [-pi, pi]. + * @return {{r: number, phi: number}} Returns and object with properties r and phi. + */ + Complex.prototype.toPolar = function () { + return { + r: this.abs(), + phi: this.arg() + }; + }; + + /** + * Get a string representation of the complex number, + * with optional formatting options. + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @return {string} str + */ + Complex.prototype.format = function (options) { + var str = ''; + var im = this.im; + var re = this.re; + var strRe = format(this.re, options); + var strIm = format(this.im, options); + + // round either re or im when smaller than the configured precision + var precision = isNumber(options) ? options : options ? options.precision : null; + if (precision !== null) { + var epsilon = Math.pow(10, -precision); + if (Math.abs(re / im) < epsilon) { + re = 0; + } + if (Math.abs(im / re) < epsilon) { + im = 0; + } + } + if (im === 0) { + // real value + str = strRe; + } else if (re === 0) { + // purely complex value + if (im === 1) { + str = 'i'; + } else if (im === -1) { + str = '-i'; + } else { + str = strIm + 'i'; + } + } else { + // complex value + if (im < 0) { + if (im === -1) { + str = strRe + ' - i'; + } else { + str = strRe + ' - ' + strIm.substring(1) + 'i'; + } + } else { + if (im === 1) { + str = strRe + ' + i'; + } else { + str = strRe + ' + ' + strIm + 'i'; + } + } + } + return str; + }; + + /** + * Create a complex number from polar coordinates + * + * Usage: + * + * Complex.fromPolar(r: number, phi: number) : Complex + * Complex.fromPolar({r: number, phi: number}) : Complex + * + * @param {*} args... + * @return {Complex} + */ + Complex.fromPolar = function (args) { + switch (arguments.length) { + case 1: + { + var arg = arguments[0]; + if (typeof arg === 'object') { + return Complex(arg); + } else { + throw new TypeError('Input has to be an object with r and phi keys.'); + } + } + case 2: + { + var r = arguments[0]; + var phi = arguments[1]; + if (isNumber(r)) { + if (isUnit(phi) && phi.hasBase('ANGLE')) { + // convert unit to a number in radians + phi = phi.toNumber('rad'); + } + if (isNumber(phi)) { + return new Complex({ + r, + phi + }); + } + throw new TypeError('Phi is not a number nor an angle unit.'); + } else { + throw new TypeError('Radius r is not a number.'); + } + } + default: + throw new SyntaxError('Wrong number of arguments in function fromPolar'); + } + }; + Complex.prototype.valueOf = Complex.prototype.toString; + + /** + * Create a Complex number from a JSON object + * @param {Object} json A JSON Object structured as + * {"mathjs": "Complex", "re": 2, "im": 3} + * All properties are optional, default values + * for `re` and `im` are 0. + * @return {Complex} Returns a new Complex number + */ + Complex.fromJSON = function (json) { + return new Complex(json); + }; + + /** + * Compare two complex numbers, `a` and `b`: + * + * - Returns 1 when the real part of `a` is larger than the real part of `b` + * - Returns -1 when the real part of `a` is smaller than the real part of `b` + * - Returns 1 when the real parts are equal + * and the imaginary part of `a` is larger than the imaginary part of `b` + * - Returns -1 when the real parts are equal + * and the imaginary part of `a` is smaller than the imaginary part of `b` + * - Returns 0 when both real and imaginary parts are equal. + * + * @params {Complex} a + * @params {Complex} b + * @returns {number} Returns the comparison result: -1, 0, or 1 + */ + Complex.compare = function (a, b) { + if (a.re > b.re) { + return 1; + } + if (a.re < b.re) { + return -1; + } + if (a.im > b.im) { + return 1; + } + if (a.im < b.im) { + return -1; + } + return 0; + }; + return Complex; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/function/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/function/complex.js new file mode 100644 index 0000000..feb10bd --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/complex/function/complex.js @@ -0,0 +1,85 @@ +import { factory } from '../../../utils/factory.js'; +import { deepMap } from '../../../utils/collection.js'; +var name = 'complex'; +var dependencies = ['typed', 'Complex']; +export var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Complex + } = _ref; + /** + * Create a complex value or convert a value to a complex value. + * + * Syntax: + * + * math.complex() // creates a complex value with zero + * // as real and imaginary part. + * math.complex(re : number, im : string) // creates a complex value with provided + * // values for real and imaginary part. + * math.complex(re : number) // creates a complex value with provided + * // real value and zero imaginary part. + * math.complex(complex : Complex) // clones the provided complex value. + * math.complex(arg : string) // parses a string into a complex value. + * math.complex(array : Array) // converts the elements of the array + * // or matrix element wise into a + * // complex value. + * math.complex({re: number, im: number}) // creates a complex value with provided + * // values for real an imaginary part. + * math.complex({r: number, phi: number}) // creates a complex value with provided + * // polar coordinates + * + * Examples: + * + * const a = math.complex(3, -4) // a = Complex 3 - 4i + * a.re = 5 // a = Complex 5 - 4i + * const i = a.im // Number -4 + * const b = math.complex('2 + 6i') // Complex 2 + 6i + * const c = math.complex() // Complex 0 + 0i + * const d = math.add(a, b) // Complex 5 + 2i + * + * See also: + * + * bignumber, boolean, index, matrix, number, string, unit + * + * @param {* | Array | Matrix} [args] + * Arguments specifying the real and imaginary part of the complex number + * @return {Complex | Array | Matrix} Returns a complex value + */ + return typed('complex', { + '': function _() { + return Complex.ZERO; + }, + number: function number(x) { + return new Complex(x, 0); + }, + 'number, number': function number_number(re, im) { + return new Complex(re, im); + }, + // TODO: this signature should be redundant + 'BigNumber, BigNumber': function BigNumber_BigNumber(re, im) { + return new Complex(re.toNumber(), im.toNumber()); + }, + Fraction: function Fraction(x) { + return new Complex(x.valueOf(), 0); + }, + Complex: function Complex(x) { + return x.clone(); + }, + string: function string(x) { + return Complex(x); // for example '2 + 3i' + }, + null: function _null(x) { + return Complex(0); + }, + Object: function Object(x) { + if ('re' in x && 'im' in x) { + return new Complex(x.re, x.im); + } + if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) { + return new Complex(x); + } + throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)'); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/Fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/Fraction.js new file mode 100644 index 0000000..b8bad96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/Fraction.js @@ -0,0 +1,41 @@ +import Fraction from 'fraction.js'; +import { factory } from '../../utils/factory.js'; +var name = 'Fraction'; +var dependencies = []; +export var createFractionClass = /* #__PURE__ */factory(name, dependencies, () => { + /** + * Attach type information + */ + Object.defineProperty(Fraction, 'name', { + value: 'Fraction' + }); + Fraction.prototype.constructor = Fraction; + Fraction.prototype.type = 'Fraction'; + Fraction.prototype.isFraction = true; + + /** + * Get a JSON representation of a Fraction containing type information + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Fraction", "n": 3, "d": 8}` + */ + Fraction.prototype.toJSON = function () { + return { + mathjs: 'Fraction', + n: this.s * this.n, + d: this.d + }; + }; + + /** + * Instantiate a Fraction from a JSON object + * @param {Object} json a JSON object structured as: + * `{"mathjs": "Fraction", "n": 3, "d": 8}` + * @return {BigNumber} + */ + Fraction.fromJSON = function (json) { + return new Fraction(json); + }; + return Fraction; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js new file mode 100644 index 0000000..a5c36c8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js @@ -0,0 +1,82 @@ +import { factory } from '../../../utils/factory.js'; +import { deepMap } from '../../../utils/collection.js'; +var name = 'fraction'; +var dependencies = ['typed', 'Fraction']; +export var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Fraction + } = _ref; + /** + * Create a fraction or convert a value to a fraction. + * + * With one numeric argument, produces the closest rational approximation to the + * input. + * With two arguments, the first is the numerator and the second is the denominator, + * and creates the corresponding fraction. Both numerator and denominator must be + * integers. + * With one object argument, looks for the integer numerator as the value of property + * 'n' and the integer denominator as the value of property 'd'. + * With a matrix argument, creates a matrix of the same shape with entries + * converted into fractions. + * + * Syntax: + * math.fraction(value) + * math.fraction(numerator, denominator) + * math.fraction({n: numerator, d: denominator}) + * math.fraction(matrix: Array | Matrix) + * + * Examples: + * + * math.fraction(6.283) // returns Fraction 6283/1000 + * math.fraction(1, 3) // returns Fraction 1/3 + * math.fraction('2/3') // returns Fraction 2/3 + * math.fraction({n: 2, d: 3}) // returns Fraction 2/3 + * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4] + * math.fraction(4, 5.1) // throws Error: Parameters must be integer + * + * See also: + * + * bignumber, number, string, unit + * + * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args] + * Arguments specifying the value, or numerator and denominator of + * the fraction + * @return {Fraction | Array | Matrix} Returns a fraction + */ + return typed('fraction', { + number: function number(x) { + if (!isFinite(x) || isNaN(x)) { + throw new Error(x + ' cannot be represented as a fraction'); + } + return new Fraction(x); + }, + string: function string(x) { + return new Fraction(x); + }, + 'number, number': function number_number(numerator, denominator) { + return new Fraction(numerator, denominator); + }, + null: function _null(x) { + return new Fraction(0); + }, + BigNumber: function BigNumber(x) { + return new Fraction(x.toString()); + }, + bigint: function bigint(x) { + return new Fraction(x.toString()); + }, + Fraction: function Fraction(x) { + return x; // fractions are immutable + }, + Unit: typed.referToSelf(self => x => { + var clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + Object: function Object(x) { + return new Fraction(x); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js new file mode 100644 index 0000000..2124007 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js @@ -0,0 +1,971 @@ +// deno-lint-ignore-file no-this-alias +import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js'; +import { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo, get } from '../../utils/array.js'; +import { format } from '../../utils/string.js'; +import { isInteger } from '../../utils/number.js'; +import { clone, deepStrictEqual } from '../../utils/object.js'; +import { DimensionError } from '../../error/DimensionError.js'; +import { factory } from '../../utils/factory.js'; +import { optimizeCallback } from '../../utils/optimizeCallback.js'; +var name = 'DenseMatrix'; +var dependencies = ['Matrix']; +export var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + Matrix + } = _ref; + /** + * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type. + * @class DenseMatrix + * @enum {{ value, index: number[] }} + */ + function DenseMatrix(data, datatype) { + if (!(this instanceof DenseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !isString(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if (isMatrix(data)) { + // check data is a DenseMatrix + if (data.type === 'DenseMatrix') { + // clone data & size + this._data = clone(data._data); + this._size = clone(data._size); + this._datatype = datatype || data._datatype; + } else { + // build data from existing matrix + this._data = data.toArray(); + this._size = data.size(); + this._datatype = datatype || data._datatype; + } + } else if (data && isArray(data.data) && isArray(data.size)) { + // initialize fields from JSON representation + this._data = data.data; + this._size = data.size; + // verify the dimensions of the array + validate(this._data, this._size); + this._datatype = datatype || data.datatype; + } else if (isArray(data)) { + // replace nested Matrices with Arrays + this._data = preprocess(data); + // get the dimensions of the array + this._size = arraySize(this._data); + // verify the dimensions of the array, TODO: compute size while processing array + validate(this._data, this._size); + // data type unknown + this._datatype = datatype; + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + typeOf(data) + ')'); + } else { + // nothing provided + this._data = []; + this._size = [0]; + this._datatype = datatype; + } + } + DenseMatrix.prototype = new Matrix(); + + /** + * Create a new DenseMatrix + */ + DenseMatrix.prototype.createDenseMatrix = function (data, datatype) { + return new DenseMatrix(data, datatype); + }; + + /** + * Attach type information + */ + Object.defineProperty(DenseMatrix, 'name', { + value: 'DenseMatrix' + }); + DenseMatrix.prototype.constructor = DenseMatrix; + DenseMatrix.prototype.type = 'DenseMatrix'; + DenseMatrix.prototype.isDenseMatrix = true; + + /** + * Get the matrix type + * + * Usage: + * const matrixType = matrix.getDataType() // retrieves the matrix type + * + * @memberOf DenseMatrix + * @return {string} type information; if multiple types are found from the Matrix, it will return "mixed" + */ + DenseMatrix.prototype.getDataType = function () { + return getArrayDataType(this._data, typeOf); + }; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @memberof DenseMatrix + * @return {string} The storage format. + */ + DenseMatrix.prototype.storage = function () { + return 'dense'; + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @memberof DenseMatrix + * @return {string} The datatype. + */ + DenseMatrix.prototype.datatype = function () { + return this._datatype; + }; + + /** + * Create a new DenseMatrix + * @memberof DenseMatrix + * @param {Array} data + * @param {string} [datatype] + */ + DenseMatrix.prototype.create = function (data, datatype) { + return new DenseMatrix(data, datatype); + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @memberof DenseMatrix + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + DenseMatrix.prototype.subset = function (index, replacement, defaultValue) { + switch (arguments.length) { + case 1: + return _get(this, index); + + // intentional fall through + case 2: + case 3: + return _set(this, index, replacement, defaultValue); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + + /** + * Get a single element from the matrix. + * @memberof DenseMatrix + * @param {number[]} index Zero-based index + * @return {*} value + */ + DenseMatrix.prototype.get = function (index) { + return get(this._data, index); + }; + + /** + * Replace a single element in the matrix. + * @memberof DenseMatrix + * @param {number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {DenseMatrix} self + */ + DenseMatrix.prototype.set = function (index, value, defaultValue) { + if (!isArray(index)) { + throw new TypeError('Array expected'); + } + if (index.length < this._size.length) { + throw new DimensionError(index.length, this._size.length, '<'); + } + var i, ii, indexI; + + // enlarge matrix when needed + var size = index.map(function (i) { + return i + 1; + }); + _fit(this, size, defaultValue); + + // traverse over the dimensions + var data = this._data; + for (i = 0, ii = index.length - 1; i < ii; i++) { + indexI = index[i]; + validateIndex(indexI, data.length); + data = data[indexI]; + } + + // set new value + indexI = index[index.length - 1]; + validateIndex(indexI, data.length); + data[indexI] = value; + return this; + }; + + /** + * Get a submatrix of this matrix + * @memberof DenseMatrix + * @param {DenseMatrix} matrix + * @param {Index} index Zero-based index + * @private + */ + function _get(matrix, index) { + if (!isIndex(index)) { + throw new TypeError('Invalid index'); + } + var isScalar = index.isScalar(); + if (isScalar) { + // return a scalar + return matrix.get(index.min()); + } else { + // validate dimensions + var size = index.size(); + if (size.length !== matrix._size.length) { + throw new DimensionError(size.length, matrix._size.length); + } + + // validate if any of the ranges in the index is out of range + var min = index.min(); + var max = index.max(); + for (var i = 0, ii = matrix._size.length; i < ii; i++) { + validateIndex(min[i], matrix._size[i]); + validateIndex(max[i], matrix._size[i]); + } + + // retrieve submatrix + // TODO: more efficient when creating an empty matrix and setting _data and _size manually + return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype); + } + } + + /** + * Recursively get a submatrix of a multi dimensional matrix. + * Index is not checked for correct number or length of dimensions. + * @memberof DenseMatrix + * @param {Array} data + * @param {Index} index + * @param {number} dims Total number of dimensions + * @param {number} dim Current dimension + * @return {Array} submatrix + * @private + */ + function _getSubmatrix(data, index, dims, dim) { + var last = dim === dims - 1; + var range = index.dimension(dim); + if (last) { + return range.map(function (i) { + validateIndex(i, data.length); + return data[i]; + }).valueOf(); + } else { + return range.map(function (i) { + validateIndex(i, data.length); + var child = data[i]; + return _getSubmatrix(child, index, dims, dim + 1); + }).valueOf(); + } + } + + /** + * Replace a submatrix in this matrix + * Indexes are zero-based. + * @memberof DenseMatrix + * @param {DenseMatrix} matrix + * @param {Index} index + * @param {DenseMatrix | Array | *} submatrix + * @param {*} defaultValue Default value, filled in on new entries when + * the matrix is resized. + * @return {DenseMatrix} matrix + * @private + */ + function _set(matrix, index, submatrix, defaultValue) { + if (!index || index.isIndex !== true) { + throw new TypeError('Invalid index'); + } + + // get index size and check whether the index contains a single value + var iSize = index.size(); + var isScalar = index.isScalar(); + + // calculate the size of the submatrix, and convert it into an Array if needed + var sSize; + if (isMatrix(submatrix)) { + sSize = submatrix.size(); + submatrix = submatrix.valueOf(); + } else { + sSize = arraySize(submatrix); + } + if (isScalar) { + // set a scalar + + // check whether submatrix is a scalar + if (sSize.length !== 0) { + throw new TypeError('Scalar expected'); + } + matrix.set(index.min(), submatrix, defaultValue); + } else { + // set a submatrix + + // broadcast submatrix + if (!deepStrictEqual(sSize, iSize)) { + try { + if (sSize.length === 0) { + submatrix = broadcastTo([submatrix], iSize); + } else { + submatrix = broadcastTo(submatrix, iSize); + } + sSize = arraySize(submatrix); + } catch (_unused) {} + } + + // validate dimensions + if (iSize.length < matrix._size.length) { + throw new DimensionError(iSize.length, matrix._size.length, '<'); + } + if (sSize.length < iSize.length) { + // calculate number of missing outer dimensions + var i = 0; + var outer = 0; + while (iSize[i] === 1 && sSize[i] === 1) { + i++; + } + while (iSize[i] === 1) { + outer++; + i++; + } + + // unsqueeze both outer and inner dimensions + submatrix = unsqueeze(submatrix, iSize.length, outer, sSize); + } + + // check whether the size of the submatrix matches the index size + if (!deepStrictEqual(iSize, sSize)) { + throw new DimensionError(iSize, sSize, '>'); + } + + // enlarge matrix when needed + var size = index.max().map(function (i) { + return i + 1; + }); + _fit(matrix, size, defaultValue); + + // insert the sub matrix + var dims = iSize.length; + var dim = 0; + _setSubmatrix(matrix._data, index, submatrix, dims, dim); + } + return matrix; + } + + /** + * Replace a submatrix of a multi dimensional matrix. + * @memberof DenseMatrix + * @param {Array} data + * @param {Index} index + * @param {Array} submatrix + * @param {number} dims Total number of dimensions + * @param {number} dim + * @private + */ + function _setSubmatrix(data, index, submatrix, dims, dim) { + var last = dim === dims - 1; + var range = index.dimension(dim); + if (last) { + range.forEach(function (dataIndex, subIndex) { + validateIndex(dataIndex); + data[dataIndex] = submatrix[subIndex[0]]; + }); + } else { + range.forEach(function (dataIndex, subIndex) { + validateIndex(dataIndex); + _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1); + }); + } + } + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @memberof DenseMatrix + * @param {number[] || Matrix} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + DenseMatrix.prototype.resize = function (size, defaultValue, copy) { + // validate arguments + if (!isCollection(size)) { + throw new TypeError('Array or Matrix expected'); + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + var sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 ? value[0] : value; + }); + + // matrix to resize + var m = copy ? this.clone() : this; + // resize matrix + return _resize(m, sizeArray, defaultValue); + }; + function _resize(matrix, size, defaultValue) { + // check size + if (size.length === 0) { + // first value in matrix + var v = matrix._data; + // go deep + while (isArray(v)) { + v = v[0]; + } + return v; + } + // resize matrix + matrix._size = size.slice(0); // copy the array + matrix._data = resize(matrix._data, matrix._size, defaultValue); + // return matrix + return matrix; + } + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * NOTE: This might be better suited to copy by default, instead of modifying + * in place. For now, it operates in place to remain consistent with + * resize(). + * + * @memberof DenseMatrix + * @param {number[]} size The new size the matrix should have. + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + DenseMatrix.prototype.reshape = function (size, copy) { + var m = copy ? this.clone() : this; + m._data = reshape(m._data, size); + var currentLength = m._size.reduce((length, size) => length * size); + m._size = processSizesWildcard(size, currentLength); + return m; + }; + + /** + * Enlarge the matrix when it is smaller than given size. + * If the matrix is larger or equal sized, nothing is done. + * @memberof DenseMatrix + * @param {DenseMatrix} matrix The matrix to be resized + * @param {number[]} size + * @param {*} defaultValue Default value, filled in on new entries. + * @private + */ + function _fit(matrix, size, defaultValue) { + var + // copy the array + newSize = matrix._size.slice(0); + var changed = false; + + // add dimensions when needed + while (newSize.length < size.length) { + newSize.push(0); + changed = true; + } + + // enlarge size when needed + for (var i = 0, ii = size.length; i < ii; i++) { + if (size[i] > newSize[i]) { + newSize[i] = size[i]; + changed = true; + } + } + if (changed) { + // resize only when size is changed + _resize(matrix, newSize, defaultValue); + } + } + + /** + * Create a clone of the matrix + * @memberof DenseMatrix + * @return {DenseMatrix} clone + */ + DenseMatrix.prototype.clone = function () { + var m = new DenseMatrix({ + data: clone(this._data), + size: clone(this._size), + datatype: this._datatype + }); + return m; + }; + + /** + * Retrieve the size of the matrix. + * @memberof DenseMatrix + * @returns {number[]} size + */ + DenseMatrix.prototype.size = function () { + return this._size.slice(0); // return a clone of _size + }; + + /** + * Applies a callback function to a reference to each element of the matrix + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: an array, an integer index to that + * array, and the Matrix being traversed. + */ + DenseMatrix.prototype._forEach = function (callback) { + // matrix instance + var me = this; + var s = me.size(); + + // if there is only one dimension, just loop through it + if (s.length === 1) { + for (var i = 0; i < s[0]; i++) { + callback(me._data, i, [i]); + } + return; + } + + // keep track of the current index permutation + var index = Array(s.length).fill(0); + + // store a reference of each dimension of the matrix for faster access + var data = Array(s.length - 1); + var last = data.length - 1; + data[0] = me._data[0]; + for (var _i = 0; _i < last; _i++) { + data[_i + 1] = data[_i][0]; + } + index[last] = -1; + while (true) { + var _i2 = void 0; + for (_i2 = last; _i2 >= 0; _i2--) { + // march index to the next permutation + index[_i2]++; + if (index[_i2] === s[_i2]) { + index[_i2] = 0; + continue; + } + + // update references to matrix dimensions + data[_i2] = _i2 === 0 ? me._data[index[_i2]] : data[_i2 - 1][index[_i2]]; + for (var j = _i2; j < last; j++) { + data[j + 1] = data[j][0]; + } + + // loop through the last dimension and map each value + for (var _j = 0; _j < s[data.length]; _j++) { + index[data.length] = _j; + callback(data[last], _j, index.slice(0)); + } + break; + } + if (_i2 === -1) { + break; + } + } + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * + * @return {DenseMatrix} matrix + */ + DenseMatrix.prototype.map = function (callback) { + var me = this; + var result = new DenseMatrix(me); + var fastCallback = optimizeCallback(callback, me._data, 'map'); + result._forEach(function (arr, i, index) { + arr[i] = fastCallback(arr[i], index, me); + }); + return result; + }; + + /** + * Execute a callback function on each entry of the matrix. + * @memberof DenseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + */ + DenseMatrix.prototype.forEach = function (callback) { + var me = this; + var fastCallback = optimizeCallback(callback, me._data, 'map'); + me._forEach(function (arr, i, index) { + fastCallback(arr[i], index, me); + }); + }; + + /** + * Iterate over the matrix elements + * @return {Iterable<{ value, index: number[] }>} + */ + DenseMatrix.prototype[Symbol.iterator] = function* () { + var _recurse = function* recurse(value, index) { + if (isArray(value)) { + for (var i = 0; i < value.length; i++) { + yield* _recurse(value[i], index.concat(i)); + } + } else { + yield { + value, + index + }; + } + }; + yield* _recurse(this._data, []); + }; + + /** + * Returns an array containing the rows of a 2D matrix + * @returns {Array} + */ + DenseMatrix.prototype.rows = function () { + var result = []; + var s = this.size(); + if (s.length !== 2) { + throw new TypeError('Rows can only be returned for a 2D matrix.'); + } + var data = this._data; + for (var row of data) { + result.push(new DenseMatrix([row], this._datatype)); + } + return result; + }; + + /** + * Returns an array containing the columns of a 2D matrix + * @returns {Array} + */ + DenseMatrix.prototype.columns = function () { + var _this = this; + var result = []; + var s = this.size(); + if (s.length !== 2) { + throw new TypeError('Rows can only be returned for a 2D matrix.'); + } + var data = this._data; + var _loop = function _loop(i) { + var col = data.map(row => [row[i]]); + result.push(new DenseMatrix(col, _this._datatype)); + }; + for (var i = 0; i < s[1]; i++) { + _loop(i); + } + return result; + }; + + /** + * Create an Array with a copy of the data of the DenseMatrix + * @memberof DenseMatrix + * @returns {Array} array + */ + DenseMatrix.prototype.toArray = function () { + return clone(this._data); + }; + + /** + * Get the primitive value of the DenseMatrix: a multidimensional array + * @memberof DenseMatrix + * @returns {Array} array + */ + DenseMatrix.prototype.valueOf = function () { + return this._data; + }; + + /** + * Get a string representation of the matrix, with optional formatting options. + * @memberof DenseMatrix + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + DenseMatrix.prototype.format = function (options) { + return format(this._data, options); + }; + + /** + * Get a string representation of the matrix + * @memberof DenseMatrix + * @returns {string} str + */ + DenseMatrix.prototype.toString = function () { + return format(this._data); + }; + + /** + * Get a JSON representation of the matrix + * @memberof DenseMatrix + * @returns {Object} + */ + DenseMatrix.prototype.toJSON = function () { + return { + mathjs: 'DenseMatrix', + data: this._data, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Get the kth Matrix diagonal. + * + * @memberof DenseMatrix + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved. + * + * @returns {Matrix} The matrix with the diagonal values. + */ + DenseMatrix.prototype.diagonal = function (k) { + // validate k if any + if (k) { + // convert BigNumber to a number + if (isBigNumber(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!isNumber(k) || !isInteger(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + var kSuper = k > 0 ? k : 0; + var kSub = k < 0 ? -k : 0; + + // rows & columns + var rows = this._size[0]; + var columns = this._size[1]; + + // number diagonal values + var n = Math.min(rows - kSub, columns - kSuper); + + // x is a matrix get diagonal from matrix + var data = []; + + // loop rows + for (var i = 0; i < n; i++) { + data[i] = this._data[i + kSub][i + kSuper]; + } + + // create DenseMatrix + return new DenseMatrix({ + data, + size: [n], + datatype: this._datatype + }); + }; + + /** + * Create a diagonal matrix. + * + * @memberof DenseMatrix + * @param {Array} size The matrix size. + * @param {number | Matrix | Array } value The values for the diagonal. + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in. + * @param {number} [defaultValue] The default value for non-diagonal + * @param {string} [datatype] The datatype for the diagonal + * + * @returns {DenseMatrix} + */ + DenseMatrix.diagonal = function (size, value, k, defaultValue) { + if (!isArray(size)) { + throw new TypeError('Array expected, size parameter'); + } + if (size.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // map size & validate + size = size.map(function (s) { + // check it is a big number + if (isBigNumber(s)) { + // convert it + s = s.toNumber(); + } + // validate arguments + if (!isNumber(s) || !isInteger(s) || s < 1) { + throw new Error('Size values must be positive integers'); + } + return s; + }); + + // validate k if any + if (k) { + // convert BigNumber to a number + if (isBigNumber(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!isNumber(k) || !isInteger(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + var kSuper = k > 0 ? k : 0; + var kSub = k < 0 ? -k : 0; + + // rows and columns + var rows = size[0]; + var columns = size[1]; + + // number of non-zero items + var n = Math.min(rows - kSub, columns - kSuper); + + // value extraction function + var _value; + + // check value + if (isArray(value)) { + // validate array + if (value.length !== n) { + // number of values in array must be n + throw new Error('Invalid value array length'); + } + // define function + _value = function _value(i) { + // return value @ i + return value[i]; + }; + } else if (isMatrix(value)) { + // matrix size + var ms = value.size(); + // validate matrix + if (ms.length !== 1 || ms[0] !== n) { + // number of values in array must be n + throw new Error('Invalid matrix length'); + } + // define function + _value = function _value(i) { + // return value @ i + return value.get([i]); + }; + } else { + // define function + _value = function _value() { + // return value + return value; + }; + } + + // discover default value if needed + if (!defaultValue) { + // check first value in array + defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero + : 0; + } + + // empty array + var data = []; + + // check we need to resize array + if (size.length > 0) { + // resize array + data = resize(data, size, defaultValue); + // fill diagonal + for (var d = 0; d < n; d++) { + data[d + kSub][d + kSuper] = _value(d); + } + } + + // create DenseMatrix + return new DenseMatrix({ + data, + size: [rows, columns] + }); + }; + + /** + * Generate a matrix from a JSON object + * @memberof DenseMatrix + * @param {Object} json An object structured like + * `{"mathjs": "DenseMatrix", data: [], size: []}`, + * where mathjs is optional + * @returns {DenseMatrix} + */ + DenseMatrix.fromJSON = function (json) { + return new DenseMatrix(json); + }; + + /** + * Swap rows i and j in Matrix. + * + * @memberof DenseMatrix + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + DenseMatrix.prototype.swapRows = function (i, j) { + // check index + if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) { + throw new Error('Row index must be positive integers'); + } + // check dimensions + if (this._size.length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + // validate index + validateIndex(i, this._size[0]); + validateIndex(j, this._size[0]); + + // swap rows + DenseMatrix._swapRows(i, j, this._data); + // return current instance + return this; + }; + + /** + * Swap rows i and j in Dense Matrix data structure. + * + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * @param {Array} data Matrix data + */ + DenseMatrix._swapRows = function (i, j, data) { + // swap values i <-> j + var vi = data[i]; + data[i] = data[j]; + data[j] = vi; + }; + + /** + * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and + * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays + * @memberof DenseMatrix + * @param {Array | Matrix} data + * @return {Array} data + */ + function preprocess(data) { + if (isMatrix(data)) { + return preprocess(data.valueOf()); + } + if (isArray(data)) { + return data.map(preprocess); + } + return data; + } + return DenseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js new file mode 100644 index 0000000..b1c2f71 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js @@ -0,0 +1,351 @@ +import { factory } from '../../utils/factory.js'; +var name = 'FibonacciHeap'; +var dependencies = ['smaller', 'larger']; +export var createFibonacciHeapClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + smaller, + larger + } = _ref; + var oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0); + + /** + * Fibonacci Heap implementation, used interally for Matrix math. + * @class FibonacciHeap + * @constructor FibonacciHeap + */ + function FibonacciHeap() { + if (!(this instanceof FibonacciHeap)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + + // initialize fields + this._minimum = null; + this._size = 0; + } + + /** + * Attach type information + */ + FibonacciHeap.prototype.type = 'FibonacciHeap'; + FibonacciHeap.prototype.isFibonacciHeap = true; + + /** + * Inserts a new data element into the heap. No heap consolidation is + * performed at this time, the new node is simply inserted into the root + * list of this heap. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.insert = function (key, value) { + // create node + var node = { + key, + value, + degree: 0 + }; + // check we have a node in the minimum + if (this._minimum) { + // minimum node + var minimum = this._minimum; + // update left & right of node + node.left = minimum; + node.right = minimum.right; + minimum.right = node; + node.right.left = node; + // update minimum node in heap if needed + if (smaller(key, minimum.key)) { + // node has a smaller key, use it as minimum + this._minimum = node; + } + } else { + // set left & right + node.left = node; + node.right = node; + // this is the first node + this._minimum = node; + } + // increment number of nodes in heap + this._size++; + // return node + return node; + }; + + /** + * Returns the number of nodes in heap. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.size = function () { + return this._size; + }; + + /** + * Removes all elements from this heap. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.clear = function () { + this._minimum = null; + this._size = 0; + }; + + /** + * Returns true if the heap is empty, otherwise false. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.isEmpty = function () { + return this._size === 0; + }; + + /** + * Extracts the node with minimum key from heap. Amortized running + * time: O(log n). + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.extractMinimum = function () { + // node to remove + var node = this._minimum; + // check we have a minimum + if (node === null) { + return node; + } + // current minimum + var minimum = this._minimum; + // get number of children + var numberOfChildren = node.degree; + // pointer to the first child + var x = node.child; + // for each child of node do... + while (numberOfChildren > 0) { + // store node in right side + var tempRight = x.right; + // remove x from child list + x.left.right = x.right; + x.right.left = x.left; + // add x to root list of heap + x.left = minimum; + x.right = minimum.right; + minimum.right = x; + x.right.left = x; + // set Parent[x] to null + x.parent = null; + x = tempRight; + numberOfChildren--; + } + // remove node from root list of heap + node.left.right = node.right; + node.right.left = node.left; + // update minimum + if (node === node.right) { + // empty + minimum = null; + } else { + // update minimum + minimum = node.right; + // we need to update the pointer to the root with minimum key + minimum = _findMinimumNode(minimum, this._size); + } + // decrement size of heap + this._size--; + // update minimum + this._minimum = minimum; + // return node + return node; + }; + + /** + * Removes a node from the heap given the reference to the node. The trees + * in the heap will be consolidated, if necessary. This operation may fail + * to remove the correct element if there are nodes with key value -Infinity. + * Running time: O(log n) amortized. + * @memberof FibonacciHeap + */ + FibonacciHeap.prototype.remove = function (node) { + // decrease key value + this._minimum = _decreaseKey(this._minimum, node, -1); + // remove the smallest + this.extractMinimum(); + }; + + /** + * Decreases the key value for a heap node, given the new value to take on. + * The structure of the heap may be changed and will not be consolidated. + * Running time: O(1) amortized. + * @memberof FibonacciHeap + */ + function _decreaseKey(minimum, node, key) { + // set node key + node.key = key; + // get parent node + var parent = node.parent; + if (parent && smaller(node.key, parent.key)) { + // remove node from parent + _cut(minimum, node, parent); + // remove all nodes from parent to the root parent + _cascadingCut(minimum, parent); + } + // update minimum node if needed + if (smaller(node.key, minimum.key)) { + minimum = node; + } + // return minimum + return minimum; + } + + /** + * The reverse of the link operation: removes node from the child list of parent. + * This method assumes that min is non-null. Running time: O(1). + * @memberof FibonacciHeap + */ + function _cut(minimum, node, parent) { + // remove node from parent children and decrement Degree[parent] + node.left.right = node.right; + node.right.left = node.left; + parent.degree--; + // reset y.child if necessary + if (parent.child === node) { + parent.child = node.right; + } + // remove child if degree is 0 + if (parent.degree === 0) { + parent.child = null; + } + // add node to root list of heap + node.left = minimum; + node.right = minimum.right; + minimum.right = node; + node.right.left = node; + // set parent[node] to null + node.parent = null; + // set mark[node] to false + node.mark = false; + } + + /** + * Performs a cascading cut operation. This cuts node from its parent and then + * does the same for its parent, and so on up the tree. + * Running time: O(log n); O(1) excluding the recursion. + * @memberof FibonacciHeap + */ + function _cascadingCut(minimum, node) { + // store parent node + var parent = node.parent; + // if there's a parent... + if (!parent) { + return; + } + // if node is unmarked, set it marked + if (!node.mark) { + node.mark = true; + } else { + // it's marked, cut it from parent + _cut(minimum, node, parent); + // cut its parent as well + _cascadingCut(parent); + } + } + + /** + * Make the first node a child of the second one. Running time: O(1) actual. + * @memberof FibonacciHeap + */ + var _linkNodes = function _linkNodes(node, parent) { + // remove node from root list of heap + node.left.right = node.right; + node.right.left = node.left; + // make node a Child of parent + node.parent = parent; + if (!parent.child) { + parent.child = node; + node.right = node; + node.left = node; + } else { + node.left = parent.child; + node.right = parent.child.right; + parent.child.right = node; + node.right.left = node; + } + // increase degree[parent] + parent.degree++; + // set mark[node] false + node.mark = false; + }; + function _findMinimumNode(minimum, size) { + // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree + var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1; + // create list with initial capacity + var array = new Array(arraySize); + // find the number of root nodes. + var numRoots = 0; + var x = minimum; + if (x) { + numRoots++; + x = x.right; + while (x !== minimum) { + numRoots++; + x = x.right; + } + } + // vars + var y; + // For each node in root list do... + while (numRoots > 0) { + // access this node's degree.. + var d = x.degree; + // get next node + var next = x.right; + // check if there is a node already in array with the same degree + while (true) { + // get node with the same degree is any + y = array[d]; + if (!y) { + break; + } + // make one node with the same degree a child of the other, do this based on the key value. + if (larger(x.key, y.key)) { + var temp = y; + y = x; + x = temp; + } + // make y a child of x + _linkNodes(y, x); + // we have handled this degree, go to next one. + array[d] = null; + d++; + } + // save this node for later when we might encounter another of the same degree. + array[d] = x; + // move forward through list. + x = next; + numRoots--; + } + // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[]. + minimum = null; + // loop nodes in array + for (var i = 0; i < arraySize; i++) { + // get current node + y = array[i]; + if (!y) { + continue; + } + // check if we have a linked list + if (minimum) { + // First remove node from root list. + y.left.right = y.right; + y.right.left = y.left; + // now add to root list, again. + y.left = minimum; + y.right = minimum.right; + minimum.right = y; + y.right.left = y; + // check if this is a new min. + if (smaller(y.key, minimum.key)) { + minimum = y; + } + } else { + minimum = y; + } + } + return minimum; + } + return FibonacciHeap; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js new file mode 100644 index 0000000..d12b9bf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js @@ -0,0 +1,221 @@ +import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { factory } from '../../utils/factory.js'; +var name = 'ImmutableDenseMatrix'; +var dependencies = ['smaller', 'DenseMatrix']; +export var createImmutableDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + smaller, + DenseMatrix + } = _ref; + function ImmutableDenseMatrix(data, datatype) { + if (!(this instanceof ImmutableDenseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !isString(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if (isMatrix(data) || isArray(data)) { + // use DenseMatrix implementation + var matrix = new DenseMatrix(data, datatype); + // internal structures + this._data = matrix._data; + this._size = matrix._size; + this._datatype = matrix._datatype; + this._min = null; + this._max = null; + } else if (data && isArray(data.data) && isArray(data.size)) { + // initialize fields from JSON representation + this._data = data.data; + this._size = data.size; + this._datatype = data.datatype; + this._min = typeof data.min !== 'undefined' ? data.min : null; + this._max = typeof data.max !== 'undefined' ? data.max : null; + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + typeOf(data) + ')'); + } else { + // nothing provided + this._data = []; + this._size = [0]; + this._datatype = datatype; + this._min = null; + this._max = null; + } + } + ImmutableDenseMatrix.prototype = new DenseMatrix(); + + /** + * Attach type information + */ + ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix'; + ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @param {Index} index + * @param {Array | ImmutableDenseMatrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + ImmutableDenseMatrix.prototype.subset = function (index) { + switch (arguments.length) { + case 1: + { + // use base implementation + var m = DenseMatrix.prototype.subset.call(this, index); + // check result is a matrix + if (isMatrix(m)) { + // return immutable matrix + return new ImmutableDenseMatrix({ + data: m._data, + size: m._size, + datatype: m._datatype + }); + } + return m; + } + // intentional fall through + case 2: + case 3: + throw new Error('Cannot invoke set subset on an Immutable Matrix instance'); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + + /** + * Replace a single element in the matrix. + * @param {Number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {ImmutableDenseMatrix} self + */ + ImmutableDenseMatrix.prototype.set = function () { + throw new Error('Cannot invoke set on an Immutable Matrix instance'); + }; + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @param {Number[]} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + ImmutableDenseMatrix.prototype.resize = function () { + throw new Error('Cannot invoke resize on an Immutable Matrix instance'); + }; + + /** + * Disallows reshaping in favor of immutability. + * + * @throws {Error} Operation not allowed + */ + ImmutableDenseMatrix.prototype.reshape = function () { + throw new Error('Cannot invoke reshape on an Immutable Matrix instance'); + }; + + /** + * Create a clone of the matrix + * @return {ImmutableDenseMatrix} clone + */ + ImmutableDenseMatrix.prototype.clone = function () { + return new ImmutableDenseMatrix({ + data: clone(this._data), + size: clone(this._size), + datatype: this._datatype + }); + }; + + /** + * Get a JSON representation of the matrix + * @returns {Object} + */ + ImmutableDenseMatrix.prototype.toJSON = function () { + return { + mathjs: 'ImmutableDenseMatrix', + data: this._data, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Generate a matrix from a JSON object + * @param {Object} json An object structured like + * `{"mathjs": "ImmutableDenseMatrix", data: [], size: []}`, + * where mathjs is optional + * @returns {ImmutableDenseMatrix} + */ + ImmutableDenseMatrix.fromJSON = function (json) { + return new ImmutableDenseMatrix(json); + }; + + /** + * Swap rows i and j in Matrix. + * + * @param {Number} i Matrix row index 1 + * @param {Number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + ImmutableDenseMatrix.prototype.swapRows = function () { + throw new Error('Cannot invoke swapRows on an Immutable Matrix instance'); + }; + + /** + * Calculate the minimum value in the set + * @return {Number | undefined} min + */ + ImmutableDenseMatrix.prototype.min = function () { + // check min has been calculated before + if (this._min === null) { + // minimum + var m = null; + // compute min + this.forEach(function (v) { + if (m === null || smaller(v, m)) { + m = v; + } + }); + this._min = m !== null ? m : undefined; + } + return this._min; + }; + + /** + * Calculate the maximum value in the set + * @return {Number | undefined} max + */ + ImmutableDenseMatrix.prototype.max = function () { + // check max has been calculated before + if (this._max === null) { + // maximum + var m = null; + // compute max + this.forEach(function (v) { + if (m === null || smaller(m, v)) { + m = v; + } + }); + this._max = m !== null ? m : undefined; + } + return this._max; + }; + return ImmutableDenseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Matrix.js new file mode 100644 index 0000000..055b4c9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Matrix.js @@ -0,0 +1,242 @@ +import { factory } from '../../utils/factory.js'; +var name = 'Matrix'; +var dependencies = []; +export var createMatrixClass = /* #__PURE__ */factory(name, dependencies, () => { + /** + * @constructor Matrix + * + * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional + * array. A matrix can be constructed as: + * + * let matrix = math.matrix(data) + * + * Matrix contains the functions to resize, get and set values, get the size, + * clone the matrix and to convert the matrix to a vector, array, or scalar. + * Furthermore, one can iterate over the matrix using map and forEach. + * The internal Array of the Matrix can be accessed using the function valueOf. + * + * Example usage: + * + * let matrix = math.matrix([[1, 2], [3, 4]]) + * matix.size() // [2, 2] + * matrix.resize([3, 2], 5) + * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]] + * matrix.subset([1,2]) // 3 (indexes are zero-based) + * + */ + function Matrix() { + if (!(this instanceof Matrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + } + + /** + * Attach type information + */ + Matrix.prototype.type = 'Matrix'; + Matrix.prototype.isMatrix = true; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @return {string} The storage format. + */ + Matrix.prototype.storage = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke storage on a Matrix interface'); + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @return {string} The datatype. + */ + Matrix.prototype.datatype = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke datatype on a Matrix interface'); + }; + + /** + * Create a new Matrix With the type of the current matrix instance + * @param {Array | Object} data + * @param {string} [datatype] + */ + Matrix.prototype.create = function (data, datatype) { + throw new Error('Cannot invoke create on a Matrix interface'); + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + Matrix.prototype.subset = function (index, replacement, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke subset on a Matrix interface'); + }; + + /** + * Get a single element from the matrix. + * @param {number[]} index Zero-based index + * @return {*} value + */ + Matrix.prototype.get = function (index) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke get on a Matrix interface'); + }; + + /** + * Replace a single element in the matrix. + * @param {number[]} index Zero-based index + * @param {*} value + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be left undefined. + * @return {Matrix} self + */ + Matrix.prototype.set = function (index, value, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke set on a Matrix interface'); + }; + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @param {number[]} size The new size the matrix should have. + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + Matrix.prototype.resize = function (size, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke resize on a Matrix interface'); + }; + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * @param {number[]} size The new size the matrix should have. + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + Matrix.prototype.reshape = function (size, defaultValue) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke reshape on a Matrix interface'); + }; + + /** + * Create a clone of the matrix + * @return {Matrix} clone + */ + Matrix.prototype.clone = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke clone on a Matrix interface'); + }; + + /** + * Retrieve the size of the matrix. + * @returns {number[]} size + */ + Matrix.prototype.size = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke size on a Matrix interface'); + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {Matrix} matrix + */ + Matrix.prototype.map = function (callback, skipZeros) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke map on a Matrix interface'); + }; + + /** + * Execute a callback function on each entry of the matrix. + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + */ + Matrix.prototype.forEach = function (callback) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke forEach on a Matrix interface'); + }; + + /** + * Iterate over the matrix elements + * @return {Iterable<{ value, index: number[] }>} + */ + Matrix.prototype[Symbol.iterator] = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot iterate a Matrix interface'); + }; + + /** + * Create an Array with a copy of the data of the Matrix + * @returns {Array} array + */ + Matrix.prototype.toArray = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke toArray on a Matrix interface'); + }; + + /** + * Get the primitive value of the Matrix: a multidimensional array + * @returns {Array} array + */ + Matrix.prototype.valueOf = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke valueOf on a Matrix interface'); + }; + + /** + * Get a string representation of the matrix, with optional formatting options. + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + Matrix.prototype.format = function (options) { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke format on a Matrix interface'); + }; + + /** + * Get a string representation of the matrix + * @returns {string} str + */ + Matrix.prototype.toString = function () { + // must be implemented by each of the Matrix implementations + throw new Error('Cannot invoke toString on a Matrix interface'); + }; + return Matrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js new file mode 100644 index 0000000..a2ca88a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js @@ -0,0 +1,298 @@ +import { isArray, isMatrix, isRange } from '../../utils/is.js'; +import { clone } from '../../utils/object.js'; +import { isInteger } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'Index'; +var dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType']; +export var createIndexClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + ImmutableDenseMatrix, + getMatrixDataType + } = _ref; + /** + * Create an index. An Index can store ranges and sets for multiple dimensions. + * Matrix.get, Matrix.set, and math.subset accept an Index as input. + * + * Usage: + * const index = new Index(range1, range2, matrix1, array1, ...) + * + * Where each parameter can be any of: + * A number + * A string (containing a name of an object property) + * An instance of Range + * An Array with the Set values + * An Array with Booleans + * A Matrix with the Set values + * A Matrix with Booleans + * + * The parameters start, end, and step must be integer numbers. + * + * @class Index + * @Constructor Index + * @param {...*} ranges + */ + function Index(ranges) { + if (!(this instanceof Index)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this._dimensions = []; + this._sourceSize = []; + this._isScalar = true; + for (var i = 0, ii = arguments.length; i < ii; i++) { + var arg = arguments[i]; + var argIsArray = isArray(arg); + var argIsMatrix = isMatrix(arg); + var sourceSize = null; + if (isRange(arg)) { + this._dimensions.push(arg); + this._isScalar = false; + } else if (argIsArray || argIsMatrix) { + // create matrix + var m = void 0; + if (getMatrixDataType(arg) === 'boolean') { + if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf()); + if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf()); + sourceSize = arg.valueOf().length; + } else { + m = _createImmutableMatrix(arg.valueOf()); + } + this._dimensions.push(m); + // size + var size = m.size(); + // scalar + if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) { + this._isScalar = false; + } + } else if (typeof arg === 'number') { + this._dimensions.push(_createImmutableMatrix([arg])); + } else if (typeof arg === 'string') { + // object property (arguments.count should be 1) + this._dimensions.push(arg); + } else { + throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range'); + } + this._sourceSize.push(sourceSize); + // TODO: implement support for wildcard '*' + } + } + + /** + * Attach type information + */ + Index.prototype.type = 'Index'; + Index.prototype.isIndex = true; + function _createImmutableMatrix(arg) { + // loop array elements + for (var i = 0, l = arg.length; i < l; i++) { + if (typeof arg[i] !== 'number' || !isInteger(arg[i])) { + throw new TypeError('Index parameters must be positive integer numbers'); + } + } + // create matrix + return new ImmutableDenseMatrix(arg); + } + + /** + * Create a clone of the index + * @memberof Index + * @return {Index} clone + */ + Index.prototype.clone = function () { + var index = new Index(); + index._dimensions = clone(this._dimensions); + index._isScalar = this._isScalar; + index._sourceSize = this._sourceSize; + return index; + }; + + /** + * Create an index from an array with ranges/numbers + * @memberof Index + * @param {Array.} ranges + * @return {Index} index + * @private + */ + Index.create = function (ranges) { + var index = new Index(); + Index.apply(index, ranges); + return index; + }; + + /** + * Retrieve the size of the index, the number of elements for each dimension. + * @memberof Index + * @returns {number[]} size + */ + Index.prototype.size = function () { + var size = []; + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + var d = this._dimensions[i]; + size[i] = typeof d === 'string' ? 1 : d.size()[0]; + } + return size; + }; + + /** + * Get the maximum value for each of the indexes ranges. + * @memberof Index + * @returns {number[]} max + */ + Index.prototype.max = function () { + var values = []; + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + var range = this._dimensions[i]; + values[i] = typeof range === 'string' ? range : range.max(); + } + return values; + }; + + /** + * Get the minimum value for each of the indexes ranges. + * @memberof Index + * @returns {number[]} min + */ + Index.prototype.min = function () { + var values = []; + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + var range = this._dimensions[i]; + values[i] = typeof range === 'string' ? range : range.min(); + } + return values; + }; + + /** + * Loop over each of the ranges of the index + * @memberof Index + * @param {Function} callback Called for each range with a Range as first + * argument, the dimension as second, and the + * index object as third. + */ + Index.prototype.forEach = function (callback) { + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + callback(this._dimensions[i], i, this); + } + }; + + /** + * Retrieve the dimension for the given index + * @memberof Index + * @param {Number} dim Number of the dimension + * @returns {Range | null} range + */ + Index.prototype.dimension = function (dim) { + return this._dimensions[dim] || null; + }; + + /** + * Test whether this index contains an object property + * @returns {boolean} Returns true if the index is an object property + */ + Index.prototype.isObjectProperty = function () { + return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string'; + }; + + /** + * Returns the object property name when the Index holds a single object property, + * else returns null + * @returns {string | null} + */ + Index.prototype.getObjectProperty = function () { + return this.isObjectProperty() ? this._dimensions[0] : null; + }; + + /** + * Test whether this index contains only a single value. + * + * This is the case when the index is created with only scalar values as ranges, + * not for ranges resolving into a single value. + * @memberof Index + * @return {boolean} isScalar + */ + Index.prototype.isScalar = function () { + return this._isScalar; + }; + + /** + * Expand the Index into an array. + * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]] + * @memberof Index + * @returns {Array} array + */ + Index.prototype.toArray = function () { + var array = []; + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + var dimension = this._dimensions[i]; + array.push(typeof dimension === 'string' ? dimension : dimension.toArray()); + } + return array; + }; + + /** + * Get the primitive value of the Index, a two dimensional array. + * Equivalent to Index.toArray(). + * @memberof Index + * @returns {Array} array + */ + Index.prototype.valueOf = Index.prototype.toArray; + + /** + * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]' + * @memberof Index + * @returns {String} str + */ + Index.prototype.toString = function () { + var strings = []; + for (var i = 0, ii = this._dimensions.length; i < ii; i++) { + var dimension = this._dimensions[i]; + if (typeof dimension === 'string') { + strings.push(JSON.stringify(dimension)); + } else { + strings.push(dimension.toString()); + } + } + return '[' + strings.join(', ') + ']'; + }; + + /** + * Get a JSON representation of the Index + * @memberof Index + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Index", "ranges": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}` + */ + Index.prototype.toJSON = function () { + return { + mathjs: 'Index', + dimensions: this._dimensions + }; + }; + + /** + * Instantiate an Index from a JSON object + * @memberof Index + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Index", "dimensions": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}` + * @return {Index} + */ + Index.fromJSON = function (json) { + return Index.create(json.dimensions); + }; + return Index; +}, { + isClass: true +}); + +/** + * Receives an array of booleans and returns an array of Numbers for Index + * @param {Array} booleanArrayIndex An array of booleans + * @return {Array} A set of numbers ready for index + */ +function _booleansArrayToNumbersForIndex(booleanArrayIndex) { + // gets an array of booleans and returns an array of numbers + var indexOfNumbers = []; + booleanArrayIndex.forEach((bool, idx) => { + if (bool) { + indexOfNumbers.push(idx); + } + }); + return indexOfNumbers; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Range.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Range.js new file mode 100644 index 0000000..967d367 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Range.js @@ -0,0 +1,304 @@ +import { isBigNumber } from '../../utils/is.js'; +import { format, sign } from '../../utils/number.js'; +import { factory } from '../../utils/factory.js'; +var name = 'Range'; +var dependencies = []; +export var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => { + /** + * Create a range. A range has a start, step, and end, and contains functions + * to iterate over the range. + * + * A range can be constructed as: + * + * const range = new Range(start, end) + * const range = new Range(start, end, step) + * + * To get the result of the range: + * range.forEach(function (x) { + * console.log(x) + * }) + * range.map(function (x) { + * return math.sin(x) + * }) + * range.toArray() + * + * Example usage: + * + * const c = new Range(2, 6) // 2:1:5 + * c.toArray() // [2, 3, 4, 5] + * const d = new Range(2, -3, -1) // 2:-1:-2 + * d.toArray() // [2, 1, 0, -1, -2] + * + * @class Range + * @constructor Range + * @param {number} start included lower bound + * @param {number} end excluded upper bound + * @param {number} [step] step size, default value is 1 + */ + function Range(start, end, step) { + if (!(this instanceof Range)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + var hasStart = start !== null && start !== undefined; + var hasEnd = end !== null && end !== undefined; + var hasStep = step !== null && step !== undefined; + if (hasStart) { + if (isBigNumber(start)) { + start = start.toNumber(); + } else if (typeof start !== 'number') { + throw new TypeError('Parameter start must be a number'); + } + } + if (hasEnd) { + if (isBigNumber(end)) { + end = end.toNumber(); + } else if (typeof end !== 'number') { + throw new TypeError('Parameter end must be a number'); + } + } + if (hasStep) { + if (isBigNumber(step)) { + step = step.toNumber(); + } else if (typeof step !== 'number') { + throw new TypeError('Parameter step must be a number'); + } + } + this.start = hasStart ? parseFloat(start) : 0; + this.end = hasEnd ? parseFloat(end) : 0; + this.step = hasStep ? parseFloat(step) : 1; + } + + /** + * Attach type information + */ + Range.prototype.type = 'Range'; + Range.prototype.isRange = true; + + /** + * Parse a string into a range, + * The string contains the start, optional step, and end, separated by a colon. + * If the string does not contain a valid range, null is returned. + * For example str='0:2:11'. + * @memberof Range + * @param {string} str + * @return {Range | null} range + */ + Range.parse = function (str) { + if (typeof str !== 'string') { + return null; + } + var args = str.split(':'); + var nums = args.map(function (arg) { + return parseFloat(arg); + }); + var invalid = nums.some(function (num) { + return isNaN(num); + }); + if (invalid) { + return null; + } + switch (nums.length) { + case 2: + return new Range(nums[0], nums[1]); + case 3: + return new Range(nums[0], nums[2], nums[1]); + default: + return null; + } + }; + + /** + * Create a clone of the range + * @return {Range} clone + */ + Range.prototype.clone = function () { + return new Range(this.start, this.end, this.step); + }; + + /** + * Retrieve the size of the range. + * Returns an array containing one number, the number of elements in the range. + * @memberof Range + * @returns {number[]} size + */ + Range.prototype.size = function () { + var len = 0; + var start = this.start; + var step = this.step; + var end = this.end; + var diff = end - start; + if (sign(step) === sign(diff)) { + len = Math.ceil(diff / step); + } else if (diff === 0) { + len = 0; + } + if (isNaN(len)) { + len = 0; + } + return [len]; + }; + + /** + * Calculate the minimum value in the range + * @memberof Range + * @return {number | undefined} min + */ + Range.prototype.min = function () { + var size = this.size()[0]; + if (size > 0) { + if (this.step > 0) { + // positive step + return this.start; + } else { + // negative step + return this.start + (size - 1) * this.step; + } + } else { + return undefined; + } + }; + + /** + * Calculate the maximum value in the range + * @memberof Range + * @return {number | undefined} max + */ + Range.prototype.max = function () { + var size = this.size()[0]; + if (size > 0) { + if (this.step > 0) { + // positive step + return this.start + (size - 1) * this.step; + } else { + // negative step + return this.start; + } + } else { + return undefined; + } + }; + + /** + * Execute a callback function for each value in the range. + * @memberof Range + * @param {function} callback The callback method is invoked with three + * parameters: the value of the element, the index + * of the element, and the Range being traversed. + */ + Range.prototype.forEach = function (callback) { + var x = this.start; + var step = this.step; + var end = this.end; + var i = 0; + if (step > 0) { + while (x < end) { + callback(x, [i], this); + x += step; + i++; + } + } else if (step < 0) { + while (x > end) { + callback(x, [i], this); + x += step; + i++; + } + } + }; + + /** + * Execute a callback function for each value in the Range, and return the + * results as an array + * @memberof Range + * @param {function} callback The callback method is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @returns {Array} array + */ + Range.prototype.map = function (callback) { + var array = []; + this.forEach(function (value, index, obj) { + array[index[0]] = callback(value, index, obj); + }); + return array; + }; + + /** + * Create an Array with a copy of the Ranges data + * @memberof Range + * @returns {Array} array + */ + Range.prototype.toArray = function () { + var array = []; + this.forEach(function (value, index) { + array[index[0]] = value; + }); + return array; + }; + + /** + * Get the primitive value of the Range, a one dimensional array + * @memberof Range + * @returns {Array} array + */ + Range.prototype.valueOf = function () { + // TODO: implement a caching mechanism for range.valueOf() + return this.toArray(); + }; + + /** + * Get a string representation of the range, with optional formatting options. + * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11' + * @memberof Range + * @param {Object | number | function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + Range.prototype.format = function (options) { + var str = format(this.start, options); + if (this.step !== 1) { + str += ':' + format(this.step, options); + } + str += ':' + format(this.end, options); + return str; + }; + + /** + * Get a string representation of the range. + * @memberof Range + * @returns {string} + */ + Range.prototype.toString = function () { + return this.format(); + }; + + /** + * Get a JSON representation of the range + * @memberof Range + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` + */ + Range.prototype.toJSON = function () { + return { + mathjs: 'Range', + start: this.start, + end: this.end, + step: this.step + }; + }; + + /** + * Instantiate a Range from a JSON object + * @memberof Range + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` + * @return {Range} + */ + Range.fromJSON = function (json) { + return new Range(json.start, json.end, json.step); + }; + return Range; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Spa.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Spa.js new file mode 100644 index 0000000..20f2750 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/Spa.js @@ -0,0 +1,136 @@ +import { factory } from '../../utils/factory.js'; +var name = 'Spa'; +var dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap']; +export var createSpaClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + addScalar, + equalScalar, + FibonacciHeap + } = _ref; + /** + * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array + * of the vector elements and an ordered list of non-zero elements. + */ + function Spa() { + if (!(this instanceof Spa)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + + // allocate vector, TODO use typed arrays + this._values = []; + this._heap = new FibonacciHeap(); + } + + /** + * Attach type information + */ + Spa.prototype.type = 'Spa'; + Spa.prototype.isSpa = true; + + /** + * Set the value for index i. + * + * @param {number} i The index + * @param {number | BigNumber | Complex} The value at index i + */ + Spa.prototype.set = function (i, v) { + // check we have a value @ i + if (!this._values[i]) { + // insert in heap + var node = this._heap.insert(i, v); + // set the value @ i + this._values[i] = node; + } else { + // update the value @ i + this._values[i].value = v; + } + }; + Spa.prototype.get = function (i) { + var node = this._values[i]; + if (node) { + return node.value; + } + return 0; + }; + Spa.prototype.accumulate = function (i, v) { + // node @ i + var node = this._values[i]; + if (!node) { + // insert in heap + node = this._heap.insert(i, v); + // initialize value + this._values[i] = node; + } else { + // accumulate value + node.value = addScalar(node.value, v); + } + }; + Spa.prototype.forEach = function (from, to, callback) { + // references + var heap = this._heap; + var values = this._values; + // nodes + var nodes = []; + // node with minimum key, save it + var node = heap.extractMinimum(); + if (node) { + nodes.push(node); + } + // extract nodes from heap (ordered) + while (node && node.key <= to) { + // check it is in range + if (node.key >= from) { + // check value is not zero + if (!equalScalar(node.value, 0)) { + // invoke callback + callback(node.key, node.value, this); + } + } + // extract next node, save it + node = heap.extractMinimum(); + if (node) { + nodes.push(node); + } + } + // reinsert all nodes in heap + for (var i = 0; i < nodes.length; i++) { + // current node + var n = nodes[i]; + // insert node in heap + node = heap.insert(n.key, n.value); + // update values + values[node.key] = node; + } + }; + Spa.prototype.swap = function (i, j) { + // node @ i and j + var nodei = this._values[i]; + var nodej = this._values[j]; + // check we need to insert indeces + if (!nodei && nodej) { + // insert in heap + nodei = this._heap.insert(i, nodej.value); + // remove from heap + this._heap.remove(nodej); + // set values + this._values[i] = nodei; + this._values[j] = undefined; + } else if (nodei && !nodej) { + // insert in heap + nodej = this._heap.insert(j, nodei.value); + // remove from heap + this._heap.remove(nodei); + // set values + this._values[j] = nodej; + this._values[i] = undefined; + } else if (nodei && nodej) { + // swap values + var v = nodei.value; + nodei.value = nodej.value; + nodej.value = v; + } + }; + return Spa; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js new file mode 100644 index 0000000..d7233f4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js @@ -0,0 +1,1486 @@ +import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js'; +import { isInteger } from '../../utils/number.js'; +import { format } from '../../utils/string.js'; +import { clone, deepStrictEqual } from '../../utils/object.js'; +import { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js'; +import { factory } from '../../utils/factory.js'; +import { DimensionError } from '../../error/DimensionError.js'; +import { optimizeCallback } from '../../utils/optimizeCallback.js'; +var name = 'SparseMatrix'; +var dependencies = ['typed', 'equalScalar', 'Matrix']; +export var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar, + Matrix + } = _ref; + /** + * Sparse Matrix implementation. This type implements + * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS)) + * format for two-dimensional sparse matrices. + * @class SparseMatrix + */ + function SparseMatrix(data, datatype) { + if (!(this instanceof SparseMatrix)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (datatype && !isString(datatype)) { + throw new Error('Invalid datatype: ' + datatype); + } + if (isMatrix(data)) { + // create from matrix + _createFromMatrix(this, data, datatype); + } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) { + // initialize fields + this._values = data.values; + this._index = data.index; + this._ptr = data.ptr; + this._size = data.size; + this._datatype = datatype || data.datatype; + } else if (isArray(data)) { + // create from array + _createFromArray(this, data, datatype); + } else if (data) { + // unsupported type + throw new TypeError('Unsupported type of data (' + typeOf(data) + ')'); + } else { + // nothing provided + this._values = []; + this._index = []; + this._ptr = [0]; + this._size = [0, 0]; + this._datatype = datatype; + } + } + function _createFromMatrix(matrix, source, datatype) { + // check matrix type + if (source.type === 'SparseMatrix') { + // clone arrays + matrix._values = source._values ? clone(source._values) : undefined; + matrix._index = clone(source._index); + matrix._ptr = clone(source._ptr); + matrix._size = clone(source._size); + matrix._datatype = datatype || source._datatype; + } else { + // build from matrix data + _createFromArray(matrix, source.valueOf(), datatype || source._datatype); + } + } + function _createFromArray(matrix, data, datatype) { + // initialize fields + matrix._values = []; + matrix._index = []; + matrix._ptr = []; + matrix._datatype = datatype; + // discover rows & columns, do not use math.size() to avoid looping array twice + var rows = data.length; + var columns = 0; + + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + if (isString(datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, datatype); + } + + // check we have rows (empty array) + if (rows > 0) { + // column index + var j = 0; + do { + // store pointer to values index + matrix._ptr.push(matrix._index.length); + // loop rows + for (var i = 0; i < rows; i++) { + // current row + var row = data[i]; + // check row is an array + if (isArray(row)) { + // update columns if needed (only on first column) + if (j === 0 && columns < row.length) { + columns = row.length; + } + // check row has column + if (j < row.length) { + // value + var v = row[j]; + // check value != 0 + if (!eq(v, zero)) { + // store value + matrix._values.push(v); + // index + matrix._index.push(i); + } + } + } else { + // update columns if needed (only on first column) + if (j === 0 && columns < 1) { + columns = 1; + } + // check value != 0 (row is a scalar) + if (!eq(row, zero)) { + // store value + matrix._values.push(row); + // index + matrix._index.push(i); + } + } + } + // increment index + j++; + } while (j < columns); + } + // store number of values in ptr + matrix._ptr.push(matrix._index.length); + // size + matrix._size = [rows, columns]; + } + SparseMatrix.prototype = new Matrix(); + + /** + * Create a new SparseMatrix + */ + SparseMatrix.prototype.createSparseMatrix = function (data, datatype) { + return new SparseMatrix(data, datatype); + }; + + /** + * Attach type information + */ + Object.defineProperty(SparseMatrix, 'name', { + value: 'SparseMatrix' + }); + SparseMatrix.prototype.constructor = SparseMatrix; + SparseMatrix.prototype.type = 'SparseMatrix'; + SparseMatrix.prototype.isSparseMatrix = true; + + /** + * Get the matrix type + * + * Usage: + * const matrixType = matrix.getDataType() // retrieves the matrix type + * + * @memberOf SparseMatrix + * @return {string} type information; if multiple types are found from the Matrix, it will return "mixed" + */ + SparseMatrix.prototype.getDataType = function () { + return getArrayDataType(this._values, typeOf); + }; + + /** + * Get the storage format used by the matrix. + * + * Usage: + * const format = matrix.storage() // retrieve storage format + * + * @memberof SparseMatrix + * @return {string} The storage format. + */ + SparseMatrix.prototype.storage = function () { + return 'sparse'; + }; + + /** + * Get the datatype of the data stored in the matrix. + * + * Usage: + * const format = matrix.datatype() // retrieve matrix datatype + * + * @memberof SparseMatrix + * @return {string} The datatype. + */ + SparseMatrix.prototype.datatype = function () { + return this._datatype; + }; + + /** + * Create a new SparseMatrix + * @memberof SparseMatrix + * @param {Array} data + * @param {string} [datatype] + */ + SparseMatrix.prototype.create = function (data, datatype) { + return new SparseMatrix(data, datatype); + }; + + /** + * Get the matrix density. + * + * Usage: + * const density = matrix.density() // retrieve matrix density + * + * @memberof SparseMatrix + * @return {number} The matrix density. + */ + SparseMatrix.prototype.density = function () { + // rows & columns + var rows = this._size[0]; + var columns = this._size[1]; + // calculate density + return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0; + }; + + /** + * Get a subset of the matrix, or replace a subset of the matrix. + * + * Usage: + * const subset = matrix.subset(index) // retrieve subset + * const value = matrix.subset(index, replacement) // replace subset + * + * @memberof SparseMatrix + * @param {Index} index + * @param {Array | Matrix | *} [replacement] + * @param {*} [defaultValue=0] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be filled with zeros. + */ + SparseMatrix.prototype.subset = function (index, replacement, defaultValue) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke subset on a Pattern only matrix'); + } + + // check arguments + switch (arguments.length) { + case 1: + return _getsubset(this, index); + + // intentional fall through + case 2: + case 3: + return _setsubset(this, index, replacement, defaultValue); + default: + throw new SyntaxError('Wrong number of arguments'); + } + }; + function _getsubset(matrix, idx) { + // check idx + if (!isIndex(idx)) { + throw new TypeError('Invalid index'); + } + var isScalar = idx.isScalar(); + if (isScalar) { + // return a scalar + return matrix.get(idx.min()); + } + // validate dimensions + var size = idx.size(); + if (size.length !== matrix._size.length) { + throw new DimensionError(size.length, matrix._size.length); + } + + // vars + var i, ii, k, kk; + + // validate if any of the ranges in the index is out of range + var min = idx.min(); + var max = idx.max(); + for (i = 0, ii = matrix._size.length; i < ii; i++) { + validateIndex(min[i], matrix._size[i]); + validateIndex(max[i], matrix._size[i]); + } + + // matrix arrays + var mvalues = matrix._values; + var mindex = matrix._index; + var mptr = matrix._ptr; + + // rows & columns dimensions for result matrix + var rows = idx.dimension(0); + var columns = idx.dimension(1); + + // workspace & permutation vector + var w = []; + var pv = []; + + // loop rows in resulting matrix + rows.forEach(function (i, r) { + // update permutation vector + pv[i] = r[0]; + // mark i in workspace + w[i] = true; + }); + + // result matrix arrays + var values = mvalues ? [] : undefined; + var index = []; + var ptr = []; + + // loop columns in result matrix + columns.forEach(function (j) { + // update ptr + ptr.push(index.length); + // loop values in column j + for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) { + // row + i = mindex[k]; + // check row is in result matrix + if (w[i] === true) { + // push index + index.push(pv[i]); + // check we need to process values + if (values) { + values.push(mvalues[k]); + } + } + } + }); + // update ptr + ptr.push(index.length); + + // return matrix + return new SparseMatrix({ + values, + index, + ptr, + size, + datatype: matrix._datatype + }); + } + function _setsubset(matrix, index, submatrix, defaultValue) { + // check index + if (!index || index.isIndex !== true) { + throw new TypeError('Invalid index'); + } + + // get index size and check whether the index contains a single value + var iSize = index.size(); + var isScalar = index.isScalar(); + + // calculate the size of the submatrix, and convert it into an Array if needed + var sSize; + if (isMatrix(submatrix)) { + // submatrix size + sSize = submatrix.size(); + // use array representation + submatrix = submatrix.toArray(); + } else { + // get submatrix size (array, scalar) + sSize = arraySize(submatrix); + } + + // check index is a scalar + if (isScalar) { + // verify submatrix is a scalar + if (sSize.length !== 0) { + throw new TypeError('Scalar expected'); + } + // set value + matrix.set(index.min(), submatrix, defaultValue); + } else { + // validate dimensions, index size must be one or two dimensions + if (iSize.length !== 1 && iSize.length !== 2) { + throw new DimensionError(iSize.length, matrix._size.length, '<'); + } + + // check submatrix and index have the same dimensions + if (sSize.length < iSize.length) { + // calculate number of missing outer dimensions + var i = 0; + var outer = 0; + while (iSize[i] === 1 && sSize[i] === 1) { + i++; + } + while (iSize[i] === 1) { + outer++; + i++; + } + // unsqueeze both outer and inner dimensions + submatrix = unsqueeze(submatrix, iSize.length, outer, sSize); + } + + // check whether the size of the submatrix matches the index size + if (!deepStrictEqual(iSize, sSize)) { + throw new DimensionError(iSize, sSize, '>'); + } + + // insert the sub matrix + if (iSize.length === 1) { + // if the replacement index only has 1 dimension, go trough each one and set its value + var range = index.dimension(0); + range.forEach(function (dataIndex, subIndex) { + validateIndex(dataIndex); + matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue); + }); + } else { + // if the replacement index has 2 dimensions, go through each one and set the value in the correct index + var firstDimensionRange = index.dimension(0); + var secondDimensionRange = index.dimension(1); + firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) { + validateIndex(firstDataIndex); + secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) { + validateIndex(secondDataIndex); + matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue); + }); + }); + } + } + return matrix; + } + + /** + * Get a single element from the matrix. + * @memberof SparseMatrix + * @param {number[]} index Zero-based index + * @return {*} value + */ + SparseMatrix.prototype.get = function (index) { + if (!isArray(index)) { + throw new TypeError('Array expected'); + } + if (index.length !== this._size.length) { + throw new DimensionError(index.length, this._size.length); + } + + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke get on a Pattern only matrix'); + } + + // row and column + var i = index[0]; + var j = index[1]; + + // check i, j are valid + validateIndex(i, this._size[0]); + validateIndex(j, this._size[1]); + + // find value index + var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index); + // check k is prior to next column k and it is in the correct row + if (k < this._ptr[j + 1] && this._index[k] === i) { + return this._values[k]; + } + return 0; + }; + + /** + * Replace a single element in the matrix. + * @memberof SparseMatrix + * @param {number[]} index Zero-based index + * @param {*} v + * @param {*} [defaultValue] Default value, filled in on new entries when + * the matrix is resized. If not provided, + * new matrix elements will be set to zero. + * @return {SparseMatrix} self + */ + SparseMatrix.prototype.set = function (index, v, defaultValue) { + if (!isArray(index)) { + throw new TypeError('Array expected'); + } + if (index.length !== this._size.length) { + throw new DimensionError(index.length, this._size.length); + } + + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke set on a Pattern only matrix'); + } + + // row and column + var i = index[0]; + var j = index[1]; + + // rows & columns + var rows = this._size[0]; + var columns = this._size[1]; + + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + if (isString(this._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, this._datatype); + } + + // check we need to resize matrix + if (i > rows - 1 || j > columns - 1) { + // resize matrix + _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue); + // update rows & columns + rows = this._size[0]; + columns = this._size[1]; + } + + // check i, j are valid + validateIndex(i, rows); + validateIndex(j, columns); + + // find value index + var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index); + // check k is prior to next column k and it is in the correct row + if (k < this._ptr[j + 1] && this._index[k] === i) { + // check value != 0 + if (!eq(v, zero)) { + // update value + this._values[k] = v; + } else { + // remove value from matrix + _remove(k, j, this._values, this._index, this._ptr); + } + } else { + if (!eq(v, zero)) { + // insert value @ (i, j) + _insert(k, i, j, v, this._values, this._index, this._ptr); + } + } + return this; + }; + function _getValueIndex(i, top, bottom, index) { + // check row is on the bottom side + if (bottom - top === 0) { + return bottom; + } + // loop rows [top, bottom[ + for (var r = top; r < bottom; r++) { + // check we found value index + if (index[r] === i) { + return r; + } + } + // we did not find row + return top; + } + function _remove(k, j, values, index, ptr) { + // remove value @ k + values.splice(k, 1); + index.splice(k, 1); + // update pointers + for (var x = j + 1; x < ptr.length; x++) { + ptr[x]--; + } + } + function _insert(k, i, j, v, values, index, ptr) { + // insert value + values.splice(k, 0, v); + // update row for k + index.splice(k, 0, i); + // update column pointers + for (var x = j + 1; x < ptr.length; x++) { + ptr[x]++; + } + } + + /** + * Resize the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (resize in place). + * + * @memberof SparseMatrix + * @param {number[] | Matrix} size The new size the matrix should have. + * Since sparse matrices are always two-dimensional, + * size must be two numbers in either an array or a matrix + * @param {*} [defaultValue=0] Default value, filled in on new entries. + * If not provided, the matrix elements will + * be filled with zeros. + * @param {boolean} [copy] Return a resized copy of the matrix + * + * @return {Matrix} The resized matrix + */ + SparseMatrix.prototype.resize = function (size, defaultValue, copy) { + // validate arguments + if (!isCollection(size)) { + throw new TypeError('Array or Matrix expected'); + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + var sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 ? value[0] : value; + }); + if (sizeArray.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // check sizes + sizeArray.forEach(function (value) { + if (!isNumber(value) || !isInteger(value) || value < 0) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(sizeArray) + ')'); + } + }); + + // matrix to resize + var m = copy ? this.clone() : this; + // resize matrix + return _resize(m, sizeArray[0], sizeArray[1], defaultValue); + }; + function _resize(matrix, rows, columns, defaultValue) { + // value to insert at the time of growing matrix + var value = defaultValue || 0; + + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + if (isString(matrix._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, matrix._datatype); + // convert value to the same datatype + value = typed.convert(value, matrix._datatype); + } + + // should we insert the value? + var ins = !eq(value, zero); + + // old columns and rows + var r = matrix._size[0]; + var c = matrix._size[1]; + var i, j, k; + + // check we need to increase columns + if (columns > c) { + // loop new columns + for (j = c; j < columns; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._values.length; + // check we need to insert matrix._values + if (ins) { + // loop rows + for (i = 0; i < r; i++) { + // add new matrix._values + matrix._values.push(value); + // update matrix._index + matrix._index.push(i); + } + } + } + // store number of matrix._values in matrix._ptr + matrix._ptr[columns] = matrix._values.length; + } else if (columns < c) { + // truncate matrix._ptr + matrix._ptr.splice(columns + 1, c - columns); + // truncate matrix._values and matrix._index + matrix._values.splice(matrix._ptr[columns], matrix._values.length); + matrix._index.splice(matrix._ptr[columns], matrix._index.length); + } + // update columns + c = columns; + + // check we need to increase rows + if (rows > r) { + // check we have to insert values + if (ins) { + // inserts + var n = 0; + // loop columns + for (j = 0; j < c; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._ptr[j] + n; + // where to insert matrix._values + k = matrix._ptr[j + 1] + n; + // pointer + var p = 0; + // loop new rows, initialize pointer + for (i = r; i < rows; i++, p++) { + // add value + matrix._values.splice(k + p, 0, value); + // update matrix._index + matrix._index.splice(k + p, 0, i); + // increment inserts + n++; + } + } + // store number of matrix._values in matrix._ptr + matrix._ptr[c] = matrix._values.length; + } + } else if (rows < r) { + // deletes + var d = 0; + // loop columns + for (j = 0; j < c; j++) { + // update matrix._ptr for current column + matrix._ptr[j] = matrix._ptr[j] - d; + // where matrix._values start for next column + var k0 = matrix._ptr[j]; + var k1 = matrix._ptr[j + 1] - d; + // loop matrix._index + for (k = k0; k < k1; k++) { + // row + i = matrix._index[k]; + // check we need to delete value and matrix._index + if (i > rows - 1) { + // remove value + matrix._values.splice(k, 1); + // remove item from matrix._index + matrix._index.splice(k, 1); + // increase deletes + d++; + } + } + } + // update matrix._ptr for current column + matrix._ptr[j] = matrix._values.length; + } + // update matrix._size + matrix._size[0] = rows; + matrix._size[1] = columns; + // return matrix + return matrix; + } + + /** + * Reshape the matrix to the given size. Returns a copy of the matrix when + * `copy=true`, otherwise return the matrix itself (reshape in place). + * + * NOTE: This might be better suited to copy by default, instead of modifying + * in place. For now, it operates in place to remain consistent with + * resize(). + * + * @memberof SparseMatrix + * @param {number[]} sizes The new size the matrix should have. + * Since sparse matrices are always two-dimensional, + * size must be two numbers in either an array or a matrix + * @param {boolean} [copy] Return a reshaped copy of the matrix + * + * @return {Matrix} The reshaped matrix + */ + SparseMatrix.prototype.reshape = function (sizes, copy) { + // validate arguments + if (!isArray(sizes)) { + throw new TypeError('Array expected'); + } + if (sizes.length !== 2) { + throw new Error('Sparse matrices can only be reshaped in two dimensions'); + } + + // check sizes + sizes.forEach(function (value) { + if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) { + throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + format(sizes) + ')'); + } + }); + var currentLength = this._size[0] * this._size[1]; + sizes = processSizesWildcard(sizes, currentLength); + var newLength = sizes[0] * sizes[1]; + + // m * n must not change + if (currentLength !== newLength) { + throw new Error('Reshaping sparse matrix will result in the wrong number of elements'); + } + + // matrix to reshape + var m = copy ? this.clone() : this; + + // return unchanged if the same shape + if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) { + return m; + } + + // Convert to COO format (generate a column index) + var colIndex = []; + for (var i = 0; i < m._ptr.length; i++) { + for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) { + colIndex.push(i); + } + } + + // Clone the values array + var values = m._values.slice(); + + // Clone the row index array + var rowIndex = m._index.slice(); + + // Transform the (row, column) indices + for (var _i = 0; _i < m._index.length; _i++) { + var r1 = rowIndex[_i]; + var c1 = colIndex[_i]; + var flat = r1 * m._size[1] + c1; + colIndex[_i] = flat % sizes[1]; + rowIndex[_i] = Math.floor(flat / sizes[1]); + } + + // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored + // in column-major order, so we have to reorder the value array now. One option is to use a multisort, + // sorting several arrays based on some other array. + + // OR, we could easily just: + + // 1. Remove all values from the matrix + m._values.length = 0; + m._index.length = 0; + m._ptr.length = sizes[1] + 1; + m._size = sizes.slice(); + for (var _i2 = 0; _i2 < m._ptr.length; _i2++) { + m._ptr[_i2] = 0; + } + + // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set) + // This step is probably the most time-consuming + for (var h = 0; h < values.length; h++) { + var _i3 = rowIndex[h]; + var _j = colIndex[h]; + var v = values[h]; + var k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index); + _insert(k, _i3, _j, v, m._values, m._index, m._ptr); + } + + // The value indices are inserted out of order, but apparently that's... still OK? + + return m; + }; + + /** + * Create a clone of the matrix + * @memberof SparseMatrix + * @return {SparseMatrix} clone + */ + SparseMatrix.prototype.clone = function () { + var m = new SparseMatrix({ + values: this._values ? clone(this._values) : undefined, + index: clone(this._index), + ptr: clone(this._ptr), + size: clone(this._size), + datatype: this._datatype + }); + return m; + }; + + /** + * Retrieve the size of the matrix. + * @memberof SparseMatrix + * @returns {number[]} size + */ + SparseMatrix.prototype.size = function () { + return this._size.slice(0); // copy the Array + }; + + /** + * Create a new matrix with the results of the callback function executed on + * each entry of the matrix. + * @memberof SparseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {SparseMatrix} matrix + */ + SparseMatrix.prototype.map = function (callback, skipZeros) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke map on a Pattern only matrix'); + } + // matrix instance + var me = this; + // rows and columns + var rows = this._size[0]; + var columns = this._size[1]; + var fastCallback = optimizeCallback(callback, me, 'map'); + // invoke callback + var invoke = function invoke(v, i, j) { + // invoke callback + return fastCallback(v, [i, j], me); + }; + // invoke _map + return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros); + }; + + /** + * Create a new matrix with the results of the callback function executed on the interval + * [minRow..maxRow, minColumn..maxColumn]. + */ + function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) { + // result arrays + var values = []; + var index = []; + var ptr = []; + + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + if (isString(matrix._datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, matrix._datatype); + } + + // invoke callback + var invoke = function invoke(v, x, y) { + // invoke callback + var value = callback(v, x, y); + // check value != 0 + if (!eq(value, zero)) { + // store value + values.push(value); + // index + index.push(x); + } + }; + // loop columns + for (var j = minColumn; j <= maxColumn; j++) { + // store pointer to values index + ptr.push(values.length); + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = matrix._ptr[j]; + var k1 = matrix._ptr[j + 1]; + if (skipZeros) { + // loop k within [k0, k1[ + for (var k = k0; k < k1; k++) { + // row index + var i = matrix._index[k]; + // check i is in range + if (i >= minRow && i <= maxRow) { + // value @ k + invoke(matrix._values[k], i - minRow, j - minColumn); + } + } + } else { + // create a cache holding all defined values + var _values = {}; + for (var _k = k0; _k < k1; _k++) { + var _i4 = matrix._index[_k]; + _values[_i4] = matrix._values[_k]; + } + + // loop over all rows (indexes can be unordered so we can't use that), + // and either read the value or zero + for (var _i5 = minRow; _i5 <= maxRow; _i5++) { + var value = _i5 in _values ? _values[_i5] : 0; + invoke(value, _i5 - minRow, j - minColumn); + } + } + } + + // store number of values in ptr + ptr.push(values.length); + // return sparse matrix + return new SparseMatrix({ + values, + index, + ptr, + size: [maxRow - minRow + 1, maxColumn - minColumn + 1] + }); + } + + /** + * Execute a callback function on each entry of the matrix. + * @memberof SparseMatrix + * @param {Function} callback The callback function is invoked with three + * parameters: the value of the element, the index + * of the element, and the Matrix being traversed. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * If false, the indices are guaranteed to be in order, + * if true, the indices can be unordered. + */ + SparseMatrix.prototype.forEach = function (callback, skipZeros) { + // check it is a pattern matrix + if (!this._values) { + throw new Error('Cannot invoke forEach on a Pattern only matrix'); + } + // matrix instance + var me = this; + // rows and columns + var rows = this._size[0]; + var columns = this._size[1]; + var fastCallback = optimizeCallback(callback, me, 'forEach'); + // loop columns + for (var j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = this._ptr[j]; + var k1 = this._ptr[j + 1]; + if (skipZeros) { + // loop k within [k0, k1[ + for (var k = k0; k < k1; k++) { + // row index + var i = this._index[k]; + + // value @ k + fastCallback(this._values[k], [i, j], me); + } + } else { + // create a cache holding all defined values + var values = {}; + for (var _k2 = k0; _k2 < k1; _k2++) { + var _i6 = this._index[_k2]; + values[_i6] = this._values[_k2]; + } + + // loop over all rows (indexes can be unordered so we can't use that), + // and either read the value or zero + for (var _i7 = 0; _i7 < rows; _i7++) { + var value = _i7 in values ? values[_i7] : 0; + fastCallback(value, [_i7, j], me); + } + } + } + }; + + /** + * Iterate over the matrix elements, skipping zeros + * @return {Iterable<{ value, index: number[] }>} + */ + SparseMatrix.prototype[Symbol.iterator] = function* () { + if (!this._values) { + throw new Error('Cannot iterate a Pattern only matrix'); + } + var columns = this._size[1]; + for (var j = 0; j < columns; j++) { + var k0 = this._ptr[j]; + var k1 = this._ptr[j + 1]; + for (var k = k0; k < k1; k++) { + // row index + var i = this._index[k]; + yield { + value: this._values[k], + index: [i, j] + }; + } + } + }; + + /** + * Create an Array with a copy of the data of the SparseMatrix + * @memberof SparseMatrix + * @returns {Array} array + */ + SparseMatrix.prototype.toArray = function () { + return _toArray(this._values, this._index, this._ptr, this._size, true); + }; + + /** + * Get the primitive value of the SparseMatrix: a two dimensions array + * @memberof SparseMatrix + * @returns {Array} array + */ + SparseMatrix.prototype.valueOf = function () { + return _toArray(this._values, this._index, this._ptr, this._size, false); + }; + function _toArray(values, index, ptr, size, copy) { + // rows and columns + var rows = size[0]; + var columns = size[1]; + // result + var a = []; + // vars + var i, j; + // initialize array + for (i = 0; i < rows; i++) { + a[i] = []; + for (j = 0; j < columns; j++) { + a[i][j] = 0; + } + } + + // loop columns + for (j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = ptr[j]; + var k1 = ptr[j + 1]; + // loop k within [k0, k1[ + for (var k = k0; k < k1; k++) { + // row index + i = index[k]; + // set value (use one for pattern matrix) + a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1; + } + } + return a; + } + + /** + * Get a string representation of the matrix, with optional formatting options. + * @memberof SparseMatrix + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ + SparseMatrix.prototype.format = function (options) { + // rows and columns + var rows = this._size[0]; + var columns = this._size[1]; + // density + var density = this.density(); + // rows & columns + var str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\n'; + // loop columns + for (var j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = this._ptr[j]; + var k1 = this._ptr[j + 1]; + // loop k within [k0, k1[ + for (var k = k0; k < k1; k++) { + // row index + var i = this._index[k]; + // append value + str += '\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X'); + } + } + return str; + }; + + /** + * Get a string representation of the matrix + * @memberof SparseMatrix + * @returns {string} str + */ + SparseMatrix.prototype.toString = function () { + return format(this.toArray()); + }; + + /** + * Get a JSON representation of the matrix + * @memberof SparseMatrix + * @returns {Object} + */ + SparseMatrix.prototype.toJSON = function () { + return { + mathjs: 'SparseMatrix', + values: this._values, + index: this._index, + ptr: this._ptr, + size: this._size, + datatype: this._datatype + }; + }; + + /** + * Get the kth Matrix diagonal. + * + * @memberof SparseMatrix + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved. + * + * @returns {Matrix} The matrix vector with the diagonal values. + */ + SparseMatrix.prototype.diagonal = function (k) { + // validate k if any + if (k) { + // convert BigNumber to a number + if (isBigNumber(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!isNumber(k) || !isInteger(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + var kSuper = k > 0 ? k : 0; + var kSub = k < 0 ? -k : 0; + + // rows & columns + var rows = this._size[0]; + var columns = this._size[1]; + + // number diagonal values + var n = Math.min(rows - kSub, columns - kSuper); + + // diagonal arrays + var values = []; + var index = []; + var ptr = []; + // initial ptr value + ptr[0] = 0; + // loop columns + for (var j = kSuper; j < columns && values.length < n; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = this._ptr[j]; + var k1 = this._ptr[j + 1]; + // loop x within [k0, k1[ + for (var x = k0; x < k1; x++) { + // row index + var i = this._index[x]; + // check row + if (i === j - kSuper + kSub) { + // value on this column + values.push(this._values[x]); + // store row + index[values.length - 1] = i - kSub; + // exit loop + break; + } + } + } + // close ptr + ptr.push(values.length); + // return matrix + return new SparseMatrix({ + values, + index, + ptr, + size: [n, 1] + }); + }; + + /** + * Generate a matrix from a JSON object + * @memberof SparseMatrix + * @param {Object} json An object structured like + * `{"mathjs": "SparseMatrix", "values": [], "index": [], "ptr": [], "size": []}`, + * where mathjs is optional + * @returns {SparseMatrix} + */ + SparseMatrix.fromJSON = function (json) { + return new SparseMatrix(json); + }; + + /** + * Create a diagonal matrix. + * + * @memberof SparseMatrix + * @param {Array} size The matrix size. + * @param {number | Array | Matrix } value The values for the diagonal. + * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in. + * @param {number} [defaultValue] The default value for non-diagonal + * @param {string} [datatype] The Matrix datatype, values must be of this datatype. + * + * @returns {SparseMatrix} + */ + SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) { + if (!isArray(size)) { + throw new TypeError('Array expected, size parameter'); + } + if (size.length !== 2) { + throw new Error('Only two dimensions matrix are supported'); + } + + // map size & validate + size = size.map(function (s) { + // check it is a big number + if (isBigNumber(s)) { + // convert it + s = s.toNumber(); + } + // validate arguments + if (!isNumber(s) || !isInteger(s) || s < 1) { + throw new Error('Size values must be positive integers'); + } + return s; + }); + + // validate k if any + if (k) { + // convert BigNumber to a number + if (isBigNumber(k)) { + k = k.toNumber(); + } + // is must be an integer + if (!isNumber(k) || !isInteger(k)) { + throw new TypeError('The parameter k must be an integer number'); + } + } else { + // default value + k = 0; + } + + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + if (isString(datatype)) { + // find signature that matches (datatype, datatype) + eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar; + // convert 0 to the same datatype + zero = typed.convert(0, datatype); + } + var kSuper = k > 0 ? k : 0; + var kSub = k < 0 ? -k : 0; + + // rows and columns + var rows = size[0]; + var columns = size[1]; + + // number of non-zero items + var n = Math.min(rows - kSub, columns - kSuper); + + // value extraction function + var _value; + + // check value + if (isArray(value)) { + // validate array + if (value.length !== n) { + // number of values in array must be n + throw new Error('Invalid value array length'); + } + // define function + _value = function _value(i) { + // return value @ i + return value[i]; + }; + } else if (isMatrix(value)) { + // matrix size + var ms = value.size(); + // validate matrix + if (ms.length !== 1 || ms[0] !== n) { + // number of values in array must be n + throw new Error('Invalid matrix length'); + } + // define function + _value = function _value(i) { + // return value @ i + return value.get([i]); + }; + } else { + // define function + _value = function _value() { + // return value + return value; + }; + } + + // create arrays + var values = []; + var index = []; + var ptr = []; + + // loop items + for (var j = 0; j < columns; j++) { + // number of rows with value + ptr.push(values.length); + // diagonal index + var i = j - kSuper; + // check we need to set diagonal value + if (i >= 0 && i < n) { + // get value @ i + var v = _value(i); + // check for zero + if (!eq(v, zero)) { + // column + index.push(i + kSub); + // add value + values.push(v); + } + } + } + // last value should be number of values + ptr.push(values.length); + // create SparseMatrix + return new SparseMatrix({ + values, + index, + ptr, + size: [rows, columns] + }); + }; + + /** + * Swap rows i and j in Matrix. + * + * @memberof SparseMatrix + * @param {number} i Matrix row index 1 + * @param {number} j Matrix row index 2 + * + * @return {Matrix} The matrix reference + */ + SparseMatrix.prototype.swapRows = function (i, j) { + // check index + if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) { + throw new Error('Row index must be positive integers'); + } + // check dimensions + if (this._size.length !== 2) { + throw new Error('Only two dimensional matrix is supported'); + } + // validate index + validateIndex(i, this._size[0]); + validateIndex(j, this._size[0]); + + // swap rows + SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr); + // return current instance + return this; + }; + + /** + * Loop rows with data in column j. + * + * @param {number} j Column + * @param {Array} values Matrix values + * @param {Array} index Matrix row indeces + * @param {Array} ptr Matrix column pointers + * @param {Function} callback Callback function invoked for every row in column j + */ + SparseMatrix._forEachRow = function (j, values, index, ptr, callback) { + // indeces for column j + var k0 = ptr[j]; + var k1 = ptr[j + 1]; + + // loop + for (var k = k0; k < k1; k++) { + // invoke callback + callback(index[k], values[k]); + } + }; + + /** + * Swap rows x and y in Sparse Matrix data structures. + * + * @param {number} x Matrix row index 1 + * @param {number} y Matrix row index 2 + * @param {number} columns Number of columns in matrix + * @param {Array} values Matrix values + * @param {Array} index Matrix row indeces + * @param {Array} ptr Matrix column pointers + */ + SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) { + // loop columns + for (var j = 0; j < columns; j++) { + // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1] + var k0 = ptr[j]; + var k1 = ptr[j + 1]; + // find value index @ x + var kx = _getValueIndex(x, k0, k1, index); + // find value index @ x + var ky = _getValueIndex(y, k0, k1, index); + // check both rows exist in matrix + if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) { + // swap values (check for pattern matrix) + if (values) { + var v = values[kx]; + values[kx] = values[ky]; + values[ky] = v; + } + // next column + continue; + } + // check x row exist & no y row + if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) { + // value @ x (check for pattern matrix) + var vx = values ? values[kx] : undefined; + // insert value @ y + index.splice(ky, 0, y); + if (values) { + values.splice(ky, 0, vx); + } + // remove value @ x (adjust array index if needed) + index.splice(ky <= kx ? kx + 1 : kx, 1); + if (values) { + values.splice(ky <= kx ? kx + 1 : kx, 1); + } + // next column + continue; + } + // check y row exist & no x row + if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) { + // value @ y (check for pattern matrix) + var vy = values ? values[ky] : undefined; + // insert value @ x + index.splice(kx, 0, x); + if (values) { + values.splice(kx, 0, vy); + } + // remove value @ y (adjust array index if needed) + index.splice(kx <= ky ? ky + 1 : ky, 1); + if (values) { + values.splice(kx <= ky ? ky + 1 : ky, 1); + } + } + } + }; + return SparseMatrix; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/index.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/index.js new file mode 100644 index 0000000..3630756 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/index.js @@ -0,0 +1,64 @@ +import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js'; +import { factory } from '../../../utils/factory.js'; +var name = 'index'; +var dependencies = ['typed', 'Index']; +export var createIndex = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Index + } = _ref; + /** + * Create an index. An Index can store ranges having start, step, and end + * for multiple dimensions. + * Matrix.get, Matrix.set, and math.subset accept an Index as input. + * + * Syntax: + * + * math.index(range1, range2, ...) + * + * Where each range can be any of: + * + * - A number + * - A string for getting/setting an object property + * - An instance of `Range` + * - A one-dimensional Array or a Matrix with numbers or booleans + * + * Indexes must be zero-based, integer numbers. + * + * Examples: + * + * const b = [1, 2, 3, 4, 5] + * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4] + * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4] + * + * const a = math.matrix([[1, 2], [3, 4]]) + * a.subset(math.index(0, 1)) // returns 2 + * a.subset(math.index(0, [false, true])) // returns 2 + * + * See also: + * + * bignumber, boolean, complex, matrix, number, string, unit + * + * @param {...*} ranges Zero or more ranges or numbers. + * @return {Index} Returns the created index + */ + return typed(name, { + '...number | string | BigNumber | Range | Array | Matrix': function number__string__BigNumber__Range__Array__Matrix(args) { + var ranges = args.map(function (arg) { + if (isBigNumber(arg)) { + return arg.toNumber(); // convert BigNumber to Number + } else if (isArray(arg) || isMatrix(arg)) { + return arg.map(function (elem) { + // convert BigNumber to Number + return isBigNumber(elem) ? elem.toNumber() : elem; + }); + } else { + return arg; + } + }); + var res = new Index(); + Index.apply(res, ranges); + return res; + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js new file mode 100644 index 0000000..c234c7a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js @@ -0,0 +1,82 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'matrix'; +var dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix']; +export var createMatrix = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Matrix, + DenseMatrix, + SparseMatrix + } = _ref; + /** + * Create a Matrix. The function creates a new `math.Matrix` object from + * an `Array`. A Matrix has utility functions to manipulate the data in the + * matrix, like getting the size and getting or setting values in the matrix. + * Supported storage formats are 'dense' and 'sparse'. + * + * Syntax: + * + * math.matrix() // creates an empty matrix using default storage format (dense). + * math.matrix(data) // creates a matrix with initial data using default storage format (dense). + * math.matrix('dense') // creates an empty matrix using the given storage format. + * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format. + * math.matrix(data, 'sparse') // creates a sparse matrix with initial data. + * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type. + * + * Examples: + * + * let m = math.matrix([[1, 2], [3, 4]]) + * m.size() // Array [2, 2] + * m.resize([3, 2], 5) + * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]] + * m.get([1, 0]) // number 3 + * + * See also: + * + * bignumber, boolean, complex, index, number, string, unit, sparse + * + * @param {Array | Matrix} [data] A multi dimensional array + * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'` + * @param {string} [datatype] Type of the values + * + * @return {Matrix} The created matrix + */ + return typed(name, { + '': function _() { + return _create([]); + }, + string: function string(format) { + return _create([], format); + }, + 'string, string': function string_string(format, datatype) { + return _create([], format, datatype); + }, + Array: function Array(data) { + return _create(data); + }, + Matrix: function Matrix(data) { + return _create(data, data.storage()); + }, + 'Array | Matrix, string': _create, + 'Array | Matrix, string, string': _create + }); + + /** + * Create a new Matrix with given storage format + * @param {Array} data + * @param {string} [format] + * @param {string} [datatype] + * @returns {Matrix} Returns a new Matrix + * @private + */ + function _create(data, format, datatype) { + // get storage format constructor + if (format === 'dense' || format === 'default' || format === undefined) { + return new DenseMatrix(data, datatype); + } + if (format === 'sparse') { + return new SparseMatrix(data, datatype); + } + throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.'); + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js new file mode 100644 index 0000000..8fa3bc0 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js @@ -0,0 +1,56 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'sparse'; +var dependencies = ['typed', 'SparseMatrix']; +export var createSparse = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + SparseMatrix + } = _ref; + /** + * Create a Sparse Matrix. The function creates a new `math.Matrix` object from + * an `Array`. A Matrix has utility functions to manipulate the data in the + * matrix, like getting the size and getting or setting values in the matrix. + * Note that a Sparse Matrix is always 2-dimensional, so for example if + * you create one from a plain array of _n_ numbers, you get an _n_ by 1 + * Sparse "column vector". + * + * Syntax: + * + * math.sparse() // creates an empty sparse matrix. + * math.sparse(data) // creates a sparse matrix with initial data. + * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype. + * + * Examples: + * + * let m = math.sparse([[1, 2], [3, 4]]) + * m.size() // Array [2, 2] + * m.resize([3, 2], 5) + * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]] + * m.get([1, 0]) // number 3 + * let v = math.sparse([0, 0, 1]) + * v.size() // Array [3, 1] + * v.get([2, 0]) // number 1 + * + * See also: + * + * bignumber, boolean, complex, index, number, string, unit, matrix + * + * @param {Array | Matrix} [data] A two dimensional array + * + * @return {Matrix} The created matrix + */ + return typed(name, { + '': function _() { + return new SparseMatrix([]); + }, + string: function string(datatype) { + return new SparseMatrix([], datatype); + }, + 'Array | Matrix': function Array__Matrix(data) { + return new SparseMatrix(data); + }, + 'Array | Matrix, string': function Array__Matrix_string(data, datatype) { + return new SparseMatrix(data, datatype); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js new file mode 100644 index 0000000..4afb20e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js @@ -0,0 +1,40 @@ +import { broadcastSizes, broadcastTo } from '../../../utils/array.js'; +import { deepStrictEqual } from '../../../utils/object.js'; + +/** +* Broadcasts two matrices, and return both in an array +* It checks if it's possible with broadcasting rules +* +* @param {Matrix} A First Matrix +* @param {Matrix} B Second Matrix +* +* @return {Matrix[]} [ broadcastedA, broadcastedB ] +*/ + +export function broadcast(A, B) { + if (deepStrictEqual(A.size(), B.size())) { + // If matrices have the same size return them + return [A, B]; + } + + // calculate the broadcasted sizes + var newSize = broadcastSizes(A.size(), B.size()); + + // return the array with the two broadcasted matrices + return [A, B].map(M => _broadcastTo(M, newSize)); +} + +/** + * Broadcasts a matrix to the given size. + * + * @param {Matrix} M - The matrix to be broadcasted. + * @param {number[]} size - The desired size of the broadcasted matrix. + * @returns {Matrix} The broadcasted matrix. + * @throws {Error} If the size parameter is not an array of numbers. + */ +function _broadcastTo(M, size) { + if (deepStrictEqual(M.size(), size)) { + return M; + } + return M.create(broadcastTo(M.valueOf(), size), M.datatype()); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js new file mode 100644 index 0000000..327948c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js @@ -0,0 +1,112 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo01xDSid'; +var dependencies = ['typed']; +export var createMatAlgo01xDSid = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij). + * Callback function invoked NNZ times (number of nonzero items in SparseMatrix). + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ Dij ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (S) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + var adata = denseMatrix._data; + var asize = denseMatrix._size; + var adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + var bvalues = sparseMatrix._values; + var bindex = sparseMatrix._index; + var bptr = sparseMatrix._ptr; + var bsize = sparseMatrix._size; + var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // process data types + var dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined; + // callback function + var cf = dt ? typed.find(callback, [dt, dt]) : callback; + + // vars + var i, j; + + // result (DenseMatrix) + var cdata = []; + // initialize c + for (i = 0; i < rows; i++) { + cdata[i] = []; + } + + // workspace + var x = []; + // marks indicating we have a value in x for a given column + var w = []; + + // loop columns in b + for (j = 0; j < columns; j++) { + // column mark + var mark = j + 1; + // values in column j + for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // update workspace + x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + // mark i as updated + w[i] = mark; + } + // loop rows + for (i = 0; i < rows; i++) { + // check row is in workspace + if (w[i] === mark) { + // c[i][j] was already calculated + cdata[i][j] = x[i]; + } else { + // item does not exist in S + cdata[i][j] = adata[i][j]; + } + } + } + + // return dense matrix + return denseMatrix.createDenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js new file mode 100644 index 0000000..82e4042 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js @@ -0,0 +1,116 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo02xDS0'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo02xDS0 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij). + * Callback function invoked NNZ times (number of nonzero items in SparseMatrix). + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (S) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + var adata = denseMatrix._data; + var asize = denseMatrix._size; + var adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + var bvalues = sparseMatrix._values; + var bindex = sparseMatrix._index; + var bptr = sparseMatrix._ptr; + var bsize = sparseMatrix._size; + var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result (SparseMatrix) + var cvalues = []; + var cindex = []; + var cptr = []; + + // loop columns in b + for (var j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // values in column j + for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + var i = bindex[k]; + // update C(i,j) + var cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + // check for nonzero + if (!eq(cij, zero)) { + // push i & v + cindex.push(i); + cvalues.push(cij); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return sparseMatrix.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js new file mode 100644 index 0000000..b06d8b7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js @@ -0,0 +1,122 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo03xDSf'; +var dependencies = ['typed']; +export var createMatAlgo03xDSf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij). + * Callback function invoked M*N times. + * + * + * ┌ f(Dij, Sij) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ f(Dij, 0) ; otherwise + * + * + * @param {Matrix} denseMatrix The DenseMatrix instance (D) + * @param {Matrix} sparseMatrix The SparseMatrix instance (C) + * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j) + * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij) + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571 + */ + return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) { + // dense matrix arrays + var adata = denseMatrix._data; + var asize = denseMatrix._size; + var adt = denseMatrix._datatype || denseMatrix.getDataType(); + // sparse matrix arrays + var bvalues = sparseMatrix._values; + var bindex = sparseMatrix._index; + var bptr = sparseMatrix._ptr; + var bsize = sparseMatrix._size; + var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!bvalues) { + throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result (DenseMatrix) + var cdata = []; + + // initialize dense matrix + for (var z = 0; z < rows; z++) { + // initialize row + cdata[z] = []; + } + + // workspace + var x = []; + // marks indicating we have a value in x for a given column + var w = []; + + // loop columns in b + for (var j = 0; j < columns; j++) { + // column mark + var mark = j + 1; + // values in column j + for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + var i = bindex[k]; + // update workspace + x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]); + w[i] = mark; + } + // process workspace + for (var y = 0; y < rows; y++) { + // check we have a calculated value for current row + if (w[y] === mark) { + // use calculated value + cdata[y][j] = x[y]; + } else { + // calculate value + cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero); + } + } + } + + // return dense matrix + return denseMatrix.createDenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js new file mode 100644 index 0000000..ee1ce13 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js @@ -0,0 +1,179 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo04xSidSid'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo04xSidSid = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0 + * └ B(i,j) ; A(i,j) === 0 + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo04xSidSid(a, b, callback) { + // sparse matrix arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = avalues && bvalues ? [] : undefined; + var cindex = []; + var cptr = []; + + // workspace + var xa = avalues && bvalues ? [] : undefined; + var xb = avalues && bvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + var wa = []; + var wb = []; + + // vars + var i, j, k, k0, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + var mark = j + 1; + // loop A(:,j) + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // update c + cindex.push(i); + // update workspace + wa[i] = mark; + // check we need to process values + if (xa) { + xa[i] = avalues[k]; + } + } + // loop B(:,j) + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // check row exists in A + if (wa[i] === mark) { + // update record in xa @ i + if (xa) { + // invoke callback + var v = cf(xa[i], bvalues[k]); + // check for zero + if (!eq(v, zero)) { + // update workspace + xa[i] = v; + } else { + // remove mark (index will be removed later) + wa[i] = null; + } + } + } else { + // update c + cindex.push(i); + // update workspace + wb[i] = mark; + // check we need to process values + if (xb) { + xb[i] = bvalues[k]; + } + } + } + // check we need to process values (non pattern matrix) + if (xa && xb) { + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // check workspace has value @ i + if (wa[i] === mark) { + // push value (Aij != 0 || (Aij != 0 && Bij != 0)) + cvalues[k] = xa[i]; + // increment pointer + k++; + } else if (wb[i] === mark) { + // push value (bij != 0) + cvalues[k] = xb[i]; + // increment pointer + k++; + } else { + // remove index @ k + cindex.splice(k, 1); + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js new file mode 100644 index 0000000..e28e182 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js @@ -0,0 +1,171 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo05xSfSf'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo05xSfSf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo05xSfSf(a, b, callback) { + // sparse matrix arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = avalues && bvalues ? [] : undefined; + var cindex = []; + var cptr = []; + + // workspaces + var xa = cvalues ? [] : undefined; + var xb = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + var wa = []; + var wb = []; + + // vars + var i, j, k, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + var mark = j + 1; + // loop values A(:,j) + for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) { + // row + i = aindex[k]; + // push index + cindex.push(i); + // update workspace + wa[i] = mark; + // check we need to process values + if (xa) { + xa[i] = avalues[k]; + } + } + // loop values B(:,j) + for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) { + // row + i = bindex[k]; + // check row existed in A + if (wa[i] !== mark) { + // push index + cindex.push(i); + } + // update workspace + wb[i] = mark; + // check we need to process values + if (xb) { + xb[i] = bvalues[k]; + } + } + // check we need to process values (non pattern matrix) + if (cvalues) { + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // marks + var wai = wa[i]; + var wbi = wb[i]; + // check Aij or Bij are nonzero + if (wai === mark || wbi === mark) { + // matrix values @ i,j + var va = wai === mark ? xa[i] : zero; + var vb = wbi === mark ? xb[i] : zero; + // Cij + var vc = cf(va, vb); + // check for zero + if (!eq(vc, zero)) { + // push value + cvalues.push(vc); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js new file mode 100644 index 0000000..974ec52 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js @@ -0,0 +1,153 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +import { scatter } from '../../../utils/collection.js'; +var name = 'matAlgo06xS0S0'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo06xS0S0 = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices. + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo06xS0S0(a, b, callback) { + // sparse matrix arrays + var avalues = a._values; + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bvalues = b._values; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = avalues && bvalues ? [] : undefined; + var cindex = []; + var cptr = []; + + // workspaces + var x = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + var w = []; + // marks indicating value in a given row has been updated + var u = []; + + // loop columns + for (var j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + var mark = j + 1; + // scatter the values of A(:,j) into workspace + scatter(a, j, w, x, u, mark, cindex, cf); + // scatter the values of B(:,j) into workspace + scatter(b, j, w, x, u, mark, cindex, cf); + // check we need to process values (non pattern matrix) + if (x) { + // initialize first index in j + var k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + var i = cindex[k]; + // check function was invoked on current row (Aij !=0 && Bij != 0) + if (u[i] === mark) { + // value @ i + var v = x[i]; + // check for zero value + if (!eq(v, zero)) { + // push value + cvalues.push(v); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } else { + // initialize first index in j + var p = cptr[j]; + // loop index in j + while (p < cindex.length) { + // row + var r = cindex[p]; + // check function was invoked on current row (Aij !=0 && Bij != 0) + if (u[r] !== mark) { + // remove value @ i, do not increment pointer + cindex.splice(p, 1); + } else { + // increment pointer + p++; + } + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js new file mode 100644 index 0000000..71d12b1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js @@ -0,0 +1,119 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo07xSSf'; +var dependencies = ['typed', 'DenseMatrix']; +export var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij). + * Callback function invoked MxN times. + * + * C(i,j) = f(Aij, Bij) + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} DenseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo07xSSf(a, b, callback) { + // sparse matrix arrays + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // vars + var i, j; + + // result arrays + var cdata = []; + // initialize c + for (i = 0; i < rows; i++) { + cdata[i] = []; + } + + // workspaces + var xa = []; + var xb = []; + // marks indicating we have a value in x for a given column + var wa = []; + var wb = []; + + // loop columns + for (j = 0; j < columns; j++) { + // columns mark + var mark = j + 1; + // scatter the values of A(:,j) into workspace + _scatter(a, j, wa, xa, mark); + // scatter the values of B(:,j) into workspace + _scatter(b, j, wb, xb, mark); + // loop rows + for (i = 0; i < rows; i++) { + // matrix values @ i,j + var va = wa[i] === mark ? xa[i] : zero; + var vb = wb[i] === mark ? xb[i] : zero; + // invoke callback + cdata[i][j] = cf(va, vb); + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; + function _scatter(m, j, w, x, mark) { + // a arrays + var values = m._values; + var index = m._index; + var ptr = m._ptr; + // loop values in column j + for (var k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) { + // row + var i = index[k]; + // update workspace + w[i] = mark; + x[i] = values[k]; + } + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js new file mode 100644 index 0000000..4fb4909 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js @@ -0,0 +1,154 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo08xS0Sid'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo08xS0Sid = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij). + * Callback function invoked MAX(NNZA, NNZB) times + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0 + * C(i,j) = ┤ A(i,j) ; A(i,j) !== 0 && B(i,j) === 0 + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo08xS0Sid(a, b, callback) { + // sparse matrix arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // sparse matrix cannot be a Pattern matrix + if (!avalues || !bvalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrices'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = []; + var cindex = []; + var cptr = []; + + // workspace + var x = []; + // marks indicating we have a value in x for a given column + var w = []; + + // vars + var k, k0, k1, i; + + // loop columns + for (var j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // columns mark + var mark = j + 1; + // loop values in a + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // mark workspace + w[i] = mark; + // set value + x[i] = avalues[k]; + // add index + cindex.push(i); + } + // loop values in b + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // check value exists in workspace + if (w[i] === mark) { + // evaluate callback + x[i] = cf(x[i], bvalues[k]); + } + } + // initialize first index in j + k = cptr[j]; + // loop index in j + while (k < cindex.length) { + // row + i = cindex[k]; + // value @ i + var v = x[i]; + // check for zero value + if (!eq(v, zero)) { + // push value + cvalues.push(v); + // increment pointer + k++; + } else { + // remove value @ i, do not increment pointer + cindex.splice(k, 1); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js new file mode 100644 index 0000000..0677453 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js @@ -0,0 +1,142 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo09xS0Sf'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo09xS0Sf = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij). + * Callback function invoked NZA times, number of nonzero elements in A. + * + * + * ┌ f(Aij, Bij) ; A(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} a The SparseMatrix instance (A) + * @param {Matrix} b The SparseMatrix instance (B) + * @param {Function} callback The f(Aij,Bij) operation to invoke + * + * @return {Matrix} SparseMatrix (C) + * + * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294 + */ + return function matAlgo09xS0Sf(a, b, callback) { + // sparse matrix arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + var asize = a._size; + var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType(); + // sparse matrix arrays + var bvalues = b._values; + var bindex = b._index; + var bptr = b._ptr; + var bsize = b._size; + var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType(); + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // check rows & columns + if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = avalues && bvalues ? [] : undefined; + var cindex = []; + var cptr = []; + + // workspaces + var x = cvalues ? [] : undefined; + // marks indicating we have a value in x for a given column + var w = []; + + // vars + var i, j, k, k0, k1; + + // loop columns + for (j = 0; j < columns; j++) { + // update cptr + cptr[j] = cindex.length; + // column mark + var mark = j + 1; + // check we need to process values + if (x) { + // loop B(:,j) + for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) { + // row + i = bindex[k]; + // update workspace + w[i] = mark; + x[i] = bvalues[k]; + } + } + // loop A(:,j) + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check we need to process values + if (x) { + // b value @ i,j + var vb = w[i] === mark ? x[i] : zero; + // invoke f + var vc = cf(avalues[k], vb); + // check zero value + if (!eq(vc, zero)) { + // push index + cindex.push(i); + // push value + cvalues.push(vc); + } + } else { + // push index + cindex.push(i); + } + } + } + // update cptr + cptr[columns] = cindex.length; + + // return sparse matrix + return a.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js new file mode 100644 index 0000000..0c6a632 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js @@ -0,0 +1,105 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'matAlgo10xSids'; +var dependencies = ['typed', 'DenseMatrix']; +export var createMatAlgo10xSids = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked NZ times (number of nonzero items in S). + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ b ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo10xSids(s, b, callback, inverse) { + // sparse matrix arrays + var avalues = s._values; + var aindex = s._index; + var aptr = s._ptr; + var asize = s._size; + var adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cdata = []; + + // workspaces + var x = []; + // marks indicating we have a value in x for a given column + var w = []; + + // loop columns + for (var j = 0; j < columns; j++) { + // columns mark + var mark = j + 1; + // values in j + for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + var r = aindex[k]; + // update workspace + x[r] = avalues[k]; + w[r] = mark; + } + // loop rows + for (var i = 0; i < rows; i++) { + // initialize C on first column + if (j === 0) { + // create row array + cdata[i] = []; + } + // check sparse matrix has a value @ i,j + if (w[i] === mark) { + // invoke callback, update C + cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b); + } else { + // dense matrix value @ i, j + cdata[i][j] = b; + } + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js new file mode 100644 index 0000000..08b0997 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js @@ -0,0 +1,103 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'matAlgo11xS0s'; +var dependencies = ['typed', 'equalScalar']; +export var createMatAlgo11xS0s = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + equalScalar + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked NZ times (number of nonzero items in S). + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ 0 ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} SparseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo11xS0s(s, b, callback, inverse) { + // sparse matrix arrays + var avalues = s._values; + var aindex = s._index; + var aptr = s._ptr; + var asize = s._size; + var adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // equal signature to use + var eq = equalScalar; + // zero value + var zero = 0; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // find signature that matches (dt, dt) + eq = typed.find(equalScalar, [dt, dt]); + // convert 0 to the same datatype + zero = typed.convert(0, dt); + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cvalues = []; + var cindex = []; + var cptr = []; + + // loop columns + for (var j = 0; j < columns; j++) { + // initialize ptr + cptr[j] = cindex.length; + // values in j + for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + var i = aindex[k]; + // invoke callback + var v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b); + // check value is zero + if (!eq(v, zero)) { + // push index & value + cindex.push(i); + cvalues.push(v); + } + } + } + // update ptr + cptr[columns] = cindex.length; + + // return sparse matrix + return s.createSparseMatrix({ + values: cvalues, + index: cindex, + ptr: cptr, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js new file mode 100644 index 0000000..d702faa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js @@ -0,0 +1,105 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'matAlgo12xSfs'; +var dependencies = ['typed', 'DenseMatrix']; +export var createMatAlgo12xSfs = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + DenseMatrix + } = _ref; + /** + * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b). + * Callback function invoked MxN times. + * + * + * ┌ f(Sij, b) ; S(i,j) !== 0 + * C(i,j) = ┤ + * └ f(0, b) ; otherwise + * + * + * @param {Matrix} s The SparseMatrix instance (S) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813 + */ + return function matAlgo12xSfs(s, b, callback, inverse) { + // sparse matrix arrays + var avalues = s._values; + var aindex = s._index; + var aptr = s._ptr; + var asize = s._size; + var adt = s._datatype; + + // sparse matrix cannot be a Pattern matrix + if (!avalues) { + throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value'); + } + + // rows & columns + var rows = asize[0]; + var columns = asize[1]; + + // datatype + var dt; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // result arrays + var cdata = []; + + // workspaces + var x = []; + // marks indicating we have a value in x for a given column + var w = []; + + // loop columns + for (var j = 0; j < columns; j++) { + // columns mark + var mark = j + 1; + // values in j + for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + var r = aindex[k]; + // update workspace + x[r] = avalues[k]; + w[r] = mark; + } + // loop rows + for (var i = 0; i < rows; i++) { + // initialize C on first column + if (j === 0) { + // create row array + cdata[i] = []; + } + // check sparse matrix has a value @ i,j + if (w[i] === mark) { + // invoke callback, update C + cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b); + } else { + // dense matrix value @ i, j + cdata[i][j] = inverse ? cf(b, 0) : cf(0, b); + } + } + } + + // return dense matrix + return new DenseMatrix({ + data: cdata, + size: [rows, columns], + datatype: dt + }); + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js new file mode 100644 index 0000000..afd55fa --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js @@ -0,0 +1,94 @@ +import { factory } from '../../../utils/factory.js'; +import { DimensionError } from '../../../error/DimensionError.js'; +var name = 'matAlgo13xDD'; +var dependencies = ['typed']; +export var createMatAlgo13xDD = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z). + * Callback function invoked MxN times. + * + * C(i,j,...z) = f(Aij..z, Bij..z) + * + * @param {Matrix} a The DenseMatrix instance (A) + * @param {Matrix} b The DenseMatrix instance (B) + * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658 + */ + return function matAlgo13xDD(a, b, callback) { + // a arrays + var adata = a._data; + var asize = a._size; + var adt = a._datatype; + // b arrays + var bdata = b._data; + var bsize = b._size; + var bdt = b._datatype; + // c arrays + var csize = []; + + // validate dimensions + if (asize.length !== bsize.length) { + throw new DimensionError(asize.length, bsize.length); + } + + // validate each one of the dimension sizes + for (var s = 0; s < asize.length; s++) { + // must match + if (asize[s] !== bsize[s]) { + throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')'); + } + // update dimension in c + csize[s] = asize[s]; + } + + // datatype + var dt; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string' && adt === bdt) { + // datatype + dt = adt; + // callback + cf = typed.find(callback, [dt, dt]); + } + + // populate cdata, iterate through dimensions + var cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : []; + + // c matrix + return a.createDenseMatrix({ + data: cdata, + size: csize, + datatype: dt + }); + }; + + // recursive function + function _iterate(f, level, s, n, av, bv) { + // initialize array for this level + var cv = []; + // check we reach the last level + if (level === s.length - 1) { + // loop arrays in last level + for (var i = 0; i < n; i++) { + // invoke callback and store value + cv[i] = f(av[i], bv[i]); + } + } else { + // iterate current level + for (var j = 0; j < n; j++) { + // iterate next level + cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]); + } + } + return cv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js new file mode 100644 index 0000000..7c54e55 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js @@ -0,0 +1,76 @@ +import { factory } from '../../../utils/factory.js'; +import { clone } from '../../../utils/object.js'; +var name = 'matAlgo14xDs'; +var dependencies = ['typed']; +export var createMatAlgo14xDs = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b). + * Callback function invoked MxN times. + * + * C(i,j,...z) = f(Aij..z, b) + * + * @param {Matrix} a The DenseMatrix instance (A) + * @param {Scalar} b The Scalar value + * @param {Function} callback The f(Aij..z,b) operation to invoke + * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z) + * + * @return {Matrix} DenseMatrix (C) + * + * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042 + */ + return function matAlgo14xDs(a, b, callback, inverse) { + // a arrays + var adata = a._data; + var asize = a._size; + var adt = a._datatype; + + // datatype + var dt; + // callback signature to use + var cf = callback; + + // process data types + if (typeof adt === 'string') { + // datatype + dt = adt; + // convert b to the same datatype + b = typed.convert(b, dt); + // callback + cf = typed.find(callback, [dt, dt]); + } + + // populate cdata, iterate through dimensions + var cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : []; + + // c matrix + return a.createDenseMatrix({ + data: cdata, + size: clone(asize), + datatype: dt + }); + }; + + // recursive function + function _iterate(f, level, s, n, av, bv, inverse) { + // initialize array for this level + var cv = []; + // check we reach the last level + if (level === s.length - 1) { + // loop arrays in last level + for (var i = 0; i < n; i++) { + // invoke callback and store value + cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv); + } + } else { + // iterate current level + for (var j = 0; j < n; j++) { + // iterate next level + cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse); + } + } + return cv; + } +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js new file mode 100644 index 0000000..1814a79 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js @@ -0,0 +1,152 @@ +import { factory } from '../../../utils/factory.js'; +import { extend } from '../../../utils/object.js'; +import { createMatAlgo13xDD } from './matAlgo13xDD.js'; +import { createMatAlgo14xDs } from './matAlgo14xDs.js'; +import { broadcast } from './broadcast.js'; +var name = 'matrixAlgorithmSuite'; +var dependencies = ['typed', 'matrix']; +export var createMatrixAlgorithmSuite = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + matrix + } = _ref; + var matAlgo13xDD = createMatAlgo13xDD({ + typed + }); + var matAlgo14xDs = createMatAlgo14xDs({ + typed + }); + + /** + * Return a signatures object with the usual boilerplate of + * matrix algorithms, based on a plain options object with the + * following properties: + * elop: function -- the elementwise operation to use, defaults to self + * SS: function -- the algorithm to apply for two sparse matrices + * DS: function -- the algorithm to apply for a dense and a sparse matrix + * SD: function -- algo for a sparse and a dense; defaults to SD flipped + * Ss: function -- the algorithm to apply for a sparse matrix and scalar + * sS: function -- algo for scalar and sparse; defaults to Ss flipped + * scalar: string -- typed-function type for scalars, defaults to 'any' + * + * If Ss is not specified, no matrix-scalar signatures are generated. + * + * @param {object} options + * @return {Object} signatures + */ + return function matrixAlgorithmSuite(options) { + var elop = options.elop; + var SD = options.SD || options.DS; + var matrixSignatures; + if (elop) { + // First the dense ones + matrixSignatures = { + 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop), + 'Array, Array': (x, y) => matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(), + 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop), + 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop) + }; + // Now incorporate sparse matrices + if (options.SS) { + matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...broadcast(x, y), elop, false); + } + if (options.DS) { + matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...broadcast(x, y), elop, false); + matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...broadcast(matrix(x), y), elop, false); + } + if (SD) { + matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...broadcast(y, x), elop, true); + matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...broadcast(matrix(y), x), elop, true); + } + } else { + // No elop, use this + // First the dense ones + matrixSignatures = { + 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...broadcast(x, y), self); + }), + 'Array, Array': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf(); + }), + 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...broadcast(matrix(x), y), self); + }), + 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => { + return matAlgo13xDD(...broadcast(x, matrix(y)), self); + }) + }; + // Now incorporate sparse matrices + if (options.SS) { + matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.SS(...broadcast(x, y), self, false); + }); + } + if (options.DS) { + matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.DS(...broadcast(x, y), self, false); + }); + matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return options.DS(...broadcast(matrix(x), y), self, false); + }); + } + if (SD) { + matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => { + return SD(...broadcast(y, x), self, true); + }); + matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => { + return SD(...broadcast(matrix(y), x), self, true); + }); + } + } + + // Now add the scalars + var scalar = options.scalar || 'any'; + var Ds = options.Ds || options.Ss; + if (Ds) { + if (elop) { + matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false); + matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true); + matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf(); + matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf(); + } else { + matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(x, y, self, false); + }); + matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(y, x, self, true); + }); + matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(matrix(x), y, self, false).valueOf(); + }); + matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => { + return matAlgo14xDs(matrix(y), x, self, true).valueOf(); + }); + } + } + var sS = options.sS !== undefined ? options.sS : options.Ss; + if (elop) { + if (options.Ss) { + matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false); + } + if (sS) { + matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true); + } + } else { + if (options.Ss) { + matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => { + return options.Ss(x, y, self, false); + }); + } + if (sS) { + matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => { + return sS(y, x, self, true); + }); + } + } + // Also pull in the scalar signatures if the operator is a typed function + if (elop && elop.signatures) { + extend(matrixSignatures, elop.signatures); + } + return matrixSignatures; + }; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/number.js new file mode 100644 index 0000000..b45212f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/number.js @@ -0,0 +1,150 @@ +import { factory } from '../utils/factory.js'; +import { deepMap } from '../utils/collection.js'; +var name = 'number'; +var dependencies = ['typed']; + +/** + * Separates the radix, integer part, and fractional part of a non decimal number string + * @param {string} input string to parse + * @returns {object} the parts of the string or null if not a valid input + */ +function getNonDecimalNumberParts(input) { + var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/); + if (nonDecimalWithRadixMatch) { + var radix = { + '0b': 2, + '0o': 8, + '0x': 16 + }[nonDecimalWithRadixMatch[1]]; + var integerPart = nonDecimalWithRadixMatch[2]; + var fractionalPart = nonDecimalWithRadixMatch[3]; + return { + input, + radix, + integerPart, + fractionalPart + }; + } else { + return null; + } +} + +/** + * Makes a number from a radix, and integer part, and a fractional part + * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts) + * @returns {number} the number + */ +function makeNumberFromNonDecimalParts(parts) { + var n = parseInt(parts.integerPart, parts.radix); + var f = 0; + for (var i = 0; i < parts.fractionalPart.length; i++) { + var digitValue = parseInt(parts.fractionalPart[i], parts.radix); + f += digitValue / Math.pow(parts.radix, i + 1); + } + var result = n + f; + if (isNaN(result)) { + throw new SyntaxError('String "' + parts.input + '" is not a valid number'); + } + return result; +} +export var createNumber = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Create a number or convert a string, boolean, or unit to a number. + * When value is a matrix, all elements will be converted to number. + * + * Syntax: + * + * math.number(value) + * math.number(unit, valuelessUnit) + * + * Examples: + * + * math.number(2) // returns number 2 + * math.number('7.2') // returns number 7.2 + * math.number(true) // returns number 1 + * math.number([true, false, true, true]) // returns [1, 0, 1, 1] + * math.number(math.unit('52cm'), 'm') // returns 0.52 + * + * See also: + * + * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit + * + * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted + * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number + * @return {number | Array | Matrix} The created number + */ + var number = typed('number', { + '': function _() { + return 0; + }, + number: function number(x) { + return x; + }, + string: function string(x) { + if (x === 'NaN') return NaN; + var nonDecimalNumberParts = getNonDecimalNumberParts(x); + if (nonDecimalNumberParts) { + return makeNumberFromNonDecimalParts(nonDecimalNumberParts); + } + var size = 0; + var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/); + if (wordSizeSuffixMatch) { + // x includes a size suffix like 0xffffi32, so we extract + // the suffix and remove it from x + size = Number(wordSizeSuffixMatch[2]); + x = wordSizeSuffixMatch[1]; + } + var num = Number(x); + if (isNaN(num)) { + throw new SyntaxError('String "' + x + '" is not a valid number'); + } + if (wordSizeSuffixMatch) { + // x is a signed bin, oct, or hex literal + // num is the value of string x if x is interpreted as unsigned + if (num > 2 ** size - 1) { + // literal is too large for size suffix + throw new SyntaxError("String \"".concat(x, "\" is out of range")); + } + // check if the bit at index size - 1 is set and if so do the twos complement + if (num >= 2 ** (size - 1)) { + num = num - 2 ** size; + } + } + return num; + }, + BigNumber: function BigNumber(x) { + return x.toNumber(); + }, + bigint: function bigint(x) { + return Number(x); + }, + Fraction: function Fraction(x) { + return x.valueOf(); + }, + Unit: typed.referToSelf(self => x => { + var clone = x.clone(); + clone.value = self(x.value); + return clone; + }), + null: function _null(x) { + return 0; + }, + 'Unit, string | Unit': function Unit_string__Unit(unit, valuelessUnit) { + return unit.toNumber(valuelessUnit); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); + + // reviver function to parse a JSON object like: + // + // {"mathjs":"number","value":"2.3"} + // + // into a number 2.3 + number.fromJSON = function (json) { + return parseFloat(json.value); + }; + return number; +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js new file mode 100644 index 0000000..d693aa6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js @@ -0,0 +1,68 @@ +import { factory } from '../../utils/factory.js'; +var name = 'ResultSet'; +var dependencies = []; +export var createResultSet = /* #__PURE__ */factory(name, dependencies, () => { + /** + * A ResultSet contains a list or results + * @class ResultSet + * @param {Array} entries + * @constructor ResultSet + */ + function ResultSet(entries) { + if (!(this instanceof ResultSet)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + this.entries = entries || []; + } + + /** + * Attach type information + */ + ResultSet.prototype.type = 'ResultSet'; + ResultSet.prototype.isResultSet = true; + + /** + * Returns the array with results hold by this ResultSet + * @memberof ResultSet + * @returns {Array} entries + */ + ResultSet.prototype.valueOf = function () { + return this.entries; + }; + + /** + * Returns the stringified results of the ResultSet + * @memberof ResultSet + * @returns {string} string + */ + ResultSet.prototype.toString = function () { + return '[' + this.entries.join(', ') + ']'; + }; + + /** + * Get a JSON representation of the ResultSet + * @memberof ResultSet + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "ResultSet", "entries": [...]}` + */ + ResultSet.prototype.toJSON = function () { + return { + mathjs: 'ResultSet', + entries: this.entries + }; + }; + + /** + * Instantiate a ResultSet from a JSON object + * @memberof ResultSet + * @param {Object} json A JSON object structured as: + * `{"mathjs": "ResultSet", "entries": [...]}` + * @return {ResultSet} + */ + ResultSet.fromJSON = function (json) { + return new ResultSet(json.entries); + }; + return ResultSet; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/string.js new file mode 100644 index 0000000..05e8564 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/string.js @@ -0,0 +1,54 @@ +import { factory } from '../utils/factory.js'; +import { deepMap } from '../utils/collection.js'; +import { format } from '../utils/number.js'; +var name = 'string'; +var dependencies = ['typed']; +export var createString = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Create a string or convert any object into a string. + * Elements of Arrays and Matrices are processed element wise. + * + * Syntax: + * + * math.string(value) + * + * Examples: + * + * math.string(4.2) // returns string '4.2' + * math.string(math.complex(3, 2) // returns string '3 + 2i' + * + * const u = math.unit(5, 'km') + * math.string(u.to('m')) // returns string '5000 m' + * + * math.string([true, false]) // returns ['true', 'false'] + * + * See also: + * + * bignumber, boolean, complex, index, matrix, number, unit + * + * @param {* | Array | Matrix | null} [value] A value to convert to a string + * @return {string | Array | Matrix} The created string + */ + return typed(name, { + '': function _() { + return ''; + }, + number: format, + null: function _null(x) { + return 'null'; + }, + boolean: function boolean(x) { + return x + ''; + }, + string: function string(x) { + return x; + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)), + any: function any(x) { + return String(x); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/Unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/Unit.js new file mode 100644 index 0000000..a40487a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/Unit.js @@ -0,0 +1,3881 @@ +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +import _extends from "@babel/runtime/helpers/extends"; +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +import { isComplex, isUnit, typeOf } from '../../utils/is.js'; +import { factory } from '../../utils/factory.js'; +import { memoize } from '../../utils/function.js'; +import { endsWith } from '../../utils/string.js'; +import { clone, hasOwnProperty } from '../../utils/object.js'; +import { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js'; +var name = 'Unit'; +var dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction']; +export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + on, + config, + addScalar, + subtractScalar, + multiplyScalar, + divideScalar, + pow, + abs, + fix, + round, + equal, + isNumeric, + format, + number: _number, + Complex, + BigNumber: _BigNumber, + Fraction: _Fraction + } = _ref; + var toNumber = _number; + /** + * A unit can be constructed in the following ways: + * + * const a = new Unit(value, valuelessUnit) + * const b = new Unit(null, valuelessUnit) + * const c = Unit.parse(str) + * + * Example usage: + * + * const a = new Unit(5, 'cm') // 50 mm + * const b = Unit.parse('23 kg') // 23 kg + * const c = math.in(a, new Unit(null, 'm') // 0.05 m + * const d = new Unit(9.81, "m/s^2") // 9.81 m/s^2 + * + * @class Unit + * @constructor Unit + * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2 + * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like "cm" + */ + function Unit(value, valuelessUnit) { + if (!(this instanceof Unit)) { + throw new Error('Constructor must be called with the new operator'); + } + if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) { + throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined'); + } + this.fixPrefix = false; // if true, function format will not search for the + // best prefix but leave it as initially provided. + // fixPrefix is set true by the method Unit.to + + // The justification behind this is that if the constructor is explicitly called, + // the caller wishes the units to be returned exactly as supplied. + this.skipAutomaticSimplification = true; + if (valuelessUnit === undefined) { + this.units = []; + this.dimensions = BASE_DIMENSIONS.map(x => 0); + } else if (typeof valuelessUnit === 'string') { + var u = Unit.parse(valuelessUnit); + this.units = u.units; + this.dimensions = u.dimensions; + } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) { + // clone from valuelessUnit + this.fixPrefix = valuelessUnit.fixPrefix; + this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification; + this.dimensions = valuelessUnit.dimensions.slice(0); + this.units = valuelessUnit.units.map(u => _extends({}, u)); + } else { + throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit'); + } + this.value = this._normalize(value); + } + + /** + * Attach type information + */ + Object.defineProperty(Unit, 'name', { + value: 'Unit' + }); + Unit.prototype.constructor = Unit; + Unit.prototype.type = 'Unit'; + Unit.prototype.isUnit = true; + + // private variables and functions for the Unit parser + var text, index, c; + function skipWhitespace() { + while (c === ' ' || c === '\t') { + next(); + } + } + function isDigitDot(c) { + return c >= '0' && c <= '9' || c === '.'; + } + function isDigit(c) { + return c >= '0' && c <= '9'; + } + function next() { + index++; + c = text.charAt(index); + } + function revert(oldIndex) { + index = oldIndex; + c = text.charAt(index); + } + function parseNumber() { + var number = ''; + var oldIndex = index; + if (c === '+') { + next(); + } else if (c === '-') { + number += c; + next(); + } + if (!isDigitDot(c)) { + // a + or - must be followed by a digit + revert(oldIndex); + return null; + } + + // get number, can have a single dot + if (c === '.') { + number += c; + next(); + if (!isDigit(c)) { + // this is no legal number, it is just a dot + revert(oldIndex); + return null; + } + } else { + while (isDigit(c)) { + number += c; + next(); + } + if (c === '.') { + number += c; + next(); + } + } + while (isDigit(c)) { + number += c; + next(); + } + + // check for exponential notation like "2.3e-4" or "1.23e50" + if (c === 'E' || c === 'e') { + // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as "4exabytes" + + var tentativeNumber = ''; + var tentativeIndex = index; + tentativeNumber += c; + next(); + if (c === '+' || c === '-') { + tentativeNumber += c; + next(); + } + + // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation) + if (!isDigit(c)) { + // The e or E must belong to something else, so return the number without the e or E. + revert(tentativeIndex); + return number; + } + + // We can now safely say that this is scientific notation. + number = number + tentativeNumber; + while (isDigit(c)) { + number += c; + next(); + } + } + return number; + } + function parseUnit() { + var unitName = ''; + + // Alphanumeric characters only; matches [a-zA-Z0-9] + while (isDigit(c) || Unit.isValidAlpha(c)) { + unitName += c; + next(); + } + + // Must begin with [a-zA-Z] + var firstC = unitName.charAt(0); + if (Unit.isValidAlpha(firstC)) { + return unitName; + } else { + return null; + } + } + function parseCharacter(toFind) { + if (c === toFind) { + next(); + return toFind; + } else { + return null; + } + } + + /** + * Parse a string into a unit. The value of the unit is parsed as number, + * BigNumber, or Fraction depending on the math.js config setting `number`. + * + * Throws an exception if the provided string does not contain a valid unit or + * cannot be parsed. + * @memberof Unit + * @param {string} str A string like "5.2 inch", "4e2 cm/s^2" + * @return {Unit} unit + */ + Unit.parse = function (str, options) { + options = options || {}; + text = str; + index = -1; + c = ''; + if (typeof text !== 'string') { + throw new TypeError('Invalid argument in Unit.parse, string expected'); + } + var unit = new Unit(); + unit.units = []; + var powerMultiplierCurrent = 1; + var expectingUnit = false; + + // A unit should follow this pattern: + // [number] ...[ [*/] unit[^number] ] + // unit[^number] ... [ [*/] unit[^number] ] + + // Rules: + // number is any floating point number. + // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number! + // The string may optionally begin with a number. + // Each unit may optionally be followed by ^number. + // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable: + // 2m^2kg/s^2 + // it is not good form. If a unit starts with e, then it could be confused as a floating point number: + // 4erg + + next(); + skipWhitespace(); + + // Optional number at the start of the string + var valueStr = parseNumber(); + var value = null; + if (valueStr) { + if (config.number === 'BigNumber') { + value = new _BigNumber(valueStr); + } else if (config.number === 'Fraction') { + try { + // not all numbers can be turned in Fractions, for example very small numbers not + value = new _Fraction(valueStr); + } catch (err) { + value = parseFloat(valueStr); + } + } else { + // number + value = parseFloat(valueStr); + } + skipWhitespace(); // Whitespace is not required here + + // handle multiplication or division right after the value, like '1/s' + if (parseCharacter('*')) { + powerMultiplierCurrent = 1; + expectingUnit = true; + } else if (parseCharacter('/')) { + powerMultiplierCurrent = -1; + expectingUnit = true; + } + } + + // Stack to keep track of powerMultipliers applied to each parentheses group + var powerMultiplierStack = []; + + // Running product of all elements in powerMultiplierStack + var powerMultiplierStackProduct = 1; + while (true) { + skipWhitespace(); + + // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack + // A '(' will always appear directly before a unit. + while (c === '(') { + powerMultiplierStack.push(powerMultiplierCurrent); + powerMultiplierStackProduct *= powerMultiplierCurrent; + powerMultiplierCurrent = 1; + next(); + skipWhitespace(); + } + + // Is there something here? + var uStr = void 0; + if (c) { + var oldC = c; + uStr = parseUnit(); + if (uStr === null) { + throw new SyntaxError('Unexpected "' + oldC + '" in "' + text + '" at index ' + index.toString()); + } + } else { + // End of input. + break; + } + + // Verify the unit exists and get the prefix (if any) + var res = _findUnit(uStr); + if (res === null) { + // Unit not found. + throw new SyntaxError('Unit "' + uStr + '" not found.'); + } + var power = powerMultiplierCurrent * powerMultiplierStackProduct; + // Is there a "^ number"? + skipWhitespace(); + if (parseCharacter('^')) { + skipWhitespace(); + var p = parseNumber(); + if (p === null) { + // No valid number found for the power! + throw new SyntaxError('In "' + str + '", "^" must be followed by a floating-point number'); + } + power *= p; + } + + // Add the unit to the list + unit.units.push({ + unit: res.unit, + prefix: res.prefix, + power + }); + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power; + } + + // Check for and consume closing parentheses, popping from the stack. + // A ')' will always follow a unit. + skipWhitespace(); + while (c === ')') { + if (powerMultiplierStack.length === 0) { + throw new SyntaxError('Unmatched ")" in "' + text + '" at index ' + index.toString()); + } + powerMultiplierStackProduct /= powerMultiplierStack.pop(); + next(); + skipWhitespace(); + } + + // "*" and "/" should mean we are expecting something to come next. + // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator. + expectingUnit = false; + if (parseCharacter('*')) { + // explicit multiplication + powerMultiplierCurrent = 1; + expectingUnit = true; + } else if (parseCharacter('/')) { + // division + powerMultiplierCurrent = -1; + expectingUnit = true; + } else { + // implicit multiplication + powerMultiplierCurrent = 1; + } + + // Replace the unit into the auto unit system + if (res.unit.base) { + var baseDim = res.unit.base.key; + UNIT_SYSTEMS.auto[baseDim] = { + unit: res.unit, + prefix: res.prefix + }; + } + } + + // Has the string been entirely consumed? + skipWhitespace(); + if (c) { + throw new SyntaxError('Could not parse: "' + str + '"'); + } + + // Is there a trailing slash? + if (expectingUnit) { + throw new SyntaxError('Trailing characters: "' + str + '"'); + } + + // Is the parentheses stack empty? + if (powerMultiplierStack.length !== 0) { + throw new SyntaxError('Unmatched "(" in "' + text + '"'); + } + + // Are there any units at all? + if (unit.units.length === 0 && !options.allowNoUnits) { + throw new SyntaxError('"' + str + '" contains no units'); + } + unit.value = value !== undefined ? unit._normalize(value) : null; + return unit; + }; + + /** + * create a copy of this unit + * @memberof Unit + * @return {Unit} Returns a cloned version of the unit + */ + Unit.prototype.clone = function () { + var unit = new Unit(); + unit.fixPrefix = this.fixPrefix; + unit.skipAutomaticSimplification = this.skipAutomaticSimplification; + unit.value = clone(this.value); + unit.dimensions = this.dimensions.slice(0); + unit.units = []; + for (var i = 0; i < this.units.length; i++) { + unit.units[i] = {}; + for (var p in this.units[i]) { + if (hasOwnProperty(this.units[i], p)) { + unit.units[i][p] = this.units[i][p]; + } + } + } + return unit; + }; + + /** + * Return the type of the value of this unit + * + * @memberof Unit + * @return {string} type of the value of the unit + */ + Unit.prototype.valueType = function () { + return typeOf(this.value); + }; + + /** + * Return whether the unit is derived (such as m/s, or cm^2, but not N) + * @memberof Unit + * @return {boolean} True if the unit is derived + * @private + */ + Unit.prototype._isDerived = function () { + if (this.units.length === 0) { + return false; + } + return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15; + }; + + /** + * Normalize a value, based on its currently set unit(s) + * @memberof Unit + * @param {number | BigNumber | Fraction | boolean} value + * @return {number | BigNumber | Fraction | boolean} normalized value + * @private + */ + Unit.prototype._normalize = function (value) { + if (value === null || value === undefined || this.units.length === 0) { + return value; + } + var res = value; + var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed + + for (var i = 0; i < this.units.length; i++) { + var unitValue = convert(this.units[i].unit.value); + var unitPrefixValue = convert(this.units[i].prefix.value); + var unitPower = convert(this.units[i].power); + res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower)); + } + return res; + }; + + /** + * Denormalize a value, based on its currently set unit(s) + * @memberof Unit + * @param {number} value + * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit) + * @return {number} denormalized value + * @private + */ + Unit.prototype._denormalize = function (value, prefixValue) { + if (value === null || value === undefined || this.units.length === 0) { + return value; + } + var res = value; + var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed + + for (var i = 0; i < this.units.length; i++) { + var unitValue = convert(this.units[i].unit.value); + var unitPrefixValue = convert(this.units[i].prefix.value); + var unitPower = convert(this.units[i].power); + res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower)); + } + return res; + }; + + /** + * Find a unit from a string + * @memberof Unit + * @param {string} str A string like 'cm' or 'inch' + * @returns {Object | null} result When found, an object with fields unit and + * prefix is returned. Else, null is returned. + * @private + */ + var _findUnit = memoize(str => { + // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit. + if (hasOwnProperty(UNITS, str)) { + var unit = UNITS[str]; + var prefix = unit.prefixes['']; + return { + unit, + prefix + }; + } + for (var _name in UNITS) { + if (hasOwnProperty(UNITS, _name)) { + if (endsWith(str, _name)) { + var _unit = UNITS[_name]; + var prefixLen = str.length - _name.length; + var prefixName = str.substring(0, prefixLen); + var _prefix = hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : undefined; + if (_prefix !== undefined) { + // store unit, prefix, and value + return { + unit: _unit, + prefix: _prefix + }; + } + } + } + } + return null; + }, { + hasher: args => args[0], + limit: 100 + }); + + /** + * Test if the given expression is a unit. + * The unit can have a prefix but cannot have a value. + * @memberof Unit + * @param {string} name A string to be tested whether it is a value less unit. + * The unit can have prefix, like "cm" + * @return {boolean} true if the given string is a unit + */ + Unit.isValuelessUnit = function (name) { + return _findUnit(name) !== null; + }; + + /** + * check if this unit has given base unit + * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived. + * @memberof Unit + * @param {BASE_UNIT | string | undefined} base + */ + Unit.prototype.hasBase = function (base) { + if (typeof base === 'string') { + base = BASE_UNITS[base]; + } + if (!base) { + return false; + } + + // All dimensions must be the same + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) { + return false; + } + } + return true; + }; + + /** + * Check if this unit has a base or bases equal to another base or bases + * For derived units, the exponent on each base also must match + * @memberof Unit + * @param {Unit} other + * @return {boolean} true if equal base + */ + Unit.prototype.equalBase = function (other) { + // All dimensions must be the same + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) { + return false; + } + } + return true; + }; + + /** + * Check if this unit equals another unit + * @memberof Unit + * @param {Unit} other + * @return {boolean} true if both units are equal + */ + Unit.prototype.equals = function (other) { + return this.equalBase(other) && equal(this.value, other.value); + }; + + /** + * Multiply this unit with another one or with a scalar + * @memberof Unit + * @param {Unit} other + * @return {Unit} product of this unit and the other unit + */ + Unit.prototype.multiply = function (_other) { + var res = this.clone(); + var other = isUnit(_other) ? _other : new Unit(_other); + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0); + } + + // Append other's units list onto res + for (var _i = 0; _i < other.units.length; _i++) { + // Make a shallow copy of every unit + var inverted = _objectSpread({}, other.units[_i]); + res.units.push(inverted); + } + + // If at least one operand has a value, then the result should also have a value + if (this.value !== null || other.value !== null) { + var valThis = this.value === null ? this._normalize(1) : this.value; + var valOther = other.value === null ? other._normalize(1) : other.value; + res.value = multiplyScalar(valThis, valOther); + } else { + res.value = null; + } + if (isUnit(_other)) { + res.skipAutomaticSimplification = false; + } + return getNumericIfUnitless(res); + }; + + /** + * Divide a number by this unit + * + * @memberof Unit + * @param {numeric} numerator + * @param {unit} result of dividing numerator by this unit + */ + Unit.prototype.divideInto = function (numerator) { + return new Unit(numerator).divide(this); + }; + + /** + * Divide this unit by another one + * @memberof Unit + * @param {Unit | numeric} other + * @return {Unit} result of dividing this unit by the other unit + */ + Unit.prototype.divide = function (_other) { + var res = this.clone(); + var other = isUnit(_other) ? _other : new Unit(_other); + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0); + } + + // Invert and append other's units list onto res + for (var _i2 = 0; _i2 < other.units.length; _i2++) { + // Make a shallow copy of every unit + var inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, { + power: -other.units[_i2].power + }); + res.units.push(inverted); + } + + // If at least one operand has a value, the result should have a value + if (this.value !== null || other.value !== null) { + var valThis = this.value === null ? this._normalize(1) : this.value; + var valOther = other.value === null ? other._normalize(1) : other.value; + res.value = divideScalar(valThis, valOther); + } else { + res.value = null; + } + if (isUnit(_other)) { + res.skipAutomaticSimplification = false; + } + return getNumericIfUnitless(res); + }; + + /** + * Calculate the power of a unit + * @memberof Unit + * @param {number | Fraction | BigNumber} p + * @returns {Unit} The result: this^p + */ + Unit.prototype.pow = function (p) { + var res = this.clone(); + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + // Dimensions arrays may be of different lengths. Default to 0. + res.dimensions[i] = (this.dimensions[i] || 0) * p; + } + + // Adjust the power of each unit in the list + for (var _i3 = 0; _i3 < res.units.length; _i3++) { + res.units[_i3].power *= p; + } + if (res.value !== null) { + res.value = pow(res.value, p); + + // only allow numeric output, we don't want to return a Complex number + // if (!isNumeric(res.value)) { + // res.value = NaN + // } + // Update: Complex supported now + } else { + res.value = null; + } + res.skipAutomaticSimplification = false; + return getNumericIfUnitless(res); + }; + + /** + * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise + * @param {Unit} unit + * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise + */ + function getNumericIfUnitless(unit) { + if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) { + return unit.value; + } else { + return unit; + } + } + + /** + * Calculate the absolute value of a unit + * @memberof Unit + * @param {number | Fraction | BigNumber} x + * @returns {Unit} The result: |x|, absolute value of x + */ + Unit.prototype.abs = function () { + var ret = this.clone(); + if (ret.value !== null) { + if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) { + ret.value = abs(ret.value); + } else { + // To give the correct, but unexpected, results for units with an offset. + // For example, abs(-283.15 degC) = -263.15 degC !!! + // We must take the offset into consideration here + var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed + var unitValue = convert(ret.units[0].unit.value); + var nominalOffset = convert(ret.units[0].unit.offset); + var unitOffset = multiplyScalar(unitValue, nominalOffset); + ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset); + } + } + for (var i in ret.units) { + if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') { + ret.units[i].unit = UNITS.W; + } + } + return ret; + }; + + /** + * Convert the unit to a specific unit name. + * @memberof Unit + * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like "cm" + * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit. + */ + Unit.prototype.to = function (valuelessUnit) { + var value = this.value === null ? this._normalize(1) : this.value; + var other; + if (typeof valuelessUnit === 'string') { + other = Unit.parse(valuelessUnit); + } else if (isUnit(valuelessUnit)) { + other = valuelessUnit.clone(); + } else { + throw new Error('String or Unit expected as parameter'); + } + if (!this.equalBase(other)) { + throw new Error("Units do not match ('".concat(other.toString(), "' != '").concat(this.toString(), "')")); + } + if (other.value !== null) { + throw new Error('Cannot convert to a unit with a value'); + } + if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) { + other.value = clone(value); + } else { + /* Need to adjust value by difference in offset to convert */ + var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed + + var thisUnitValue = this.units[0].unit.value; + var thisNominalOffset = this.units[0].unit.offset; + var thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset); + var otherUnitValue = other.units[0].unit.value; + var otherNominalOffset = other.units[0].unit.offset; + var otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset); + other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset))); + } + other.fixPrefix = true; + other.skipAutomaticSimplification = true; + return other; + }; + + /** + * Return the value of the unit when represented with given valueless unit + * @memberof Unit + * @param {string | Unit} valuelessUnit For example 'cm' or 'inch' + * @return {number} Returns the unit value as number. + */ + // TODO: deprecate Unit.toNumber? It's always better to use toNumeric + Unit.prototype.toNumber = function (valuelessUnit) { + return toNumber(this.toNumeric(valuelessUnit)); + }; + + /** + * Return the value of the unit in the original numeric type + * @memberof Unit + * @param {string | Unit} valuelessUnit For example 'cm' or 'inch' + * @return {number | BigNumber | Fraction} Returns the unit value + */ + Unit.prototype.toNumeric = function (valuelessUnit) { + var other; + if (valuelessUnit) { + // Allow getting the numeric value without converting to a different unit + other = this.to(valuelessUnit); + } else { + other = this.clone(); + } + if (other._isDerived() || other.units.length === 0) { + return other._denormalize(other.value); + } else { + return other._denormalize(other.value, other.units[0].prefix.value); + } + }; + + /** + * Get a string representation of the unit. + * @memberof Unit + * @return {string} + */ + Unit.prototype.toString = function () { + return this.format(); + }; + + /** + * Get a JSON representation of the unit + * @memberof Unit + * @returns {Object} Returns a JSON object structured as: + * `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` + */ + Unit.prototype.toJSON = function () { + return { + mathjs: 'Unit', + value: this._denormalize(this.value), + unit: this.units.length > 0 ? this.formatUnits() : null, + fixPrefix: this.fixPrefix + }; + }; + + /** + * Instantiate a Unit from a JSON object + * @memberof Unit + * @param {Object} json A JSON object structured as: + * `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` + * @return {Unit} + */ + Unit.fromJSON = function (json) { + var _json$unit; + var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined); + unit.fixPrefix = json.fixPrefix || false; + return unit; + }; + + /** + * Returns the string representation of the unit. + * @memberof Unit + * @return {string} + */ + Unit.prototype.valueOf = Unit.prototype.toString; + + /** + * Simplify this Unit's unit list and return a new Unit with the simplified list. + * The returned Unit will contain a list of the "best" units for formatting. + */ + Unit.prototype.simplify = function () { + var ret = this.clone(); + var proposedUnitList = []; + + // Search for a matching base + var matchingBase; + for (var key in currentUnitSystem) { + if (hasOwnProperty(currentUnitSystem, key)) { + if (ret.hasBase(BASE_UNITS[key])) { + matchingBase = key; + break; + } + } + } + if (matchingBase === 'NONE') { + ret.units = []; + } else { + var matchingUnit; + if (matchingBase) { + // Does the unit system have a matching unit? + if (hasOwnProperty(currentUnitSystem, matchingBase)) { + matchingUnit = currentUnitSystem[matchingBase]; + } + } + if (matchingUnit) { + ret.units = [{ + unit: matchingUnit.unit, + prefix: matchingUnit.prefix, + power: 1.0 + }]; + } else { + // Multiple units or units with powers are formatted like this: + // 5 (kg m^2) / (s^3 mol) + // Build an representation from the base units of the current unit system + var missingBaseDim = false; + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + var baseDim = BASE_DIMENSIONS[i]; + if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { + if (hasOwnProperty(currentUnitSystem, baseDim)) { + proposedUnitList.push({ + unit: currentUnitSystem[baseDim].unit, + prefix: currentUnitSystem[baseDim].prefix, + power: ret.dimensions[i] || 0 + }); + } else { + missingBaseDim = true; + } + } + } + + // Is the proposed unit list "simpler" than the existing one? + if (proposedUnitList.length < ret.units.length && !missingBaseDim) { + // Replace this unit list with the proposed list + ret.units = proposedUnitList; + } + } + } + return ret; + }; + + /** + * Returns a new Unit in the SI system with the same value as this one + */ + Unit.prototype.toSI = function () { + var ret = this.clone(); + var proposedUnitList = []; + + // Multiple units or units with powers are formatted like this: + // 5 (kg m^2) / (s^3 mol) + // Build an representation from the base units of the SI unit system + for (var i = 0; i < BASE_DIMENSIONS.length; i++) { + var baseDim = BASE_DIMENSIONS[i]; + if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { + if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) { + proposedUnitList.push({ + unit: UNIT_SYSTEMS.si[baseDim].unit, + prefix: UNIT_SYSTEMS.si[baseDim].prefix, + power: ret.dimensions[i] || 0 + }); + } else { + throw new Error('Cannot express custom unit ' + baseDim + ' in SI units'); + } + } + } + + // Replace this unit list with the proposed list + ret.units = proposedUnitList; + ret.fixPrefix = true; + ret.skipAutomaticSimplification = true; + if (this.value !== null) { + ret.value = null; + return this.to(ret); + } + return ret; + }; + + /** + * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified. + * @memberof Unit + * @return {string} + */ + Unit.prototype.formatUnits = function () { + var strNum = ''; + var strDen = ''; + var nNum = 0; + var nDen = 0; + for (var i = 0; i < this.units.length; i++) { + if (this.units[i].power > 0) { + nNum++; + strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name; + if (Math.abs(this.units[i].power - 1.0) > 1e-15) { + strNum += '^' + this.units[i].power; + } + } else if (this.units[i].power < 0) { + nDen++; + } + } + if (nDen > 0) { + for (var _i4 = 0; _i4 < this.units.length; _i4++) { + if (this.units[_i4].power < 0) { + if (nNum > 0) { + strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name; + if (Math.abs(this.units[_i4].power + 1.0) > 1e-15) { + strDen += '^' + -this.units[_i4].power; + } + } else { + strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name; + strDen += '^' + this.units[_i4].power; + } + } + } + } + // Remove leading " " + strNum = strNum.substr(1); + strDen = strDen.substr(1); + + // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting + if (nNum > 1 && nDen > 0) { + strNum = '(' + strNum + ')'; + } + if (nDen > 1 && nNum > 0) { + strDen = '(' + strDen + ')'; + } + var str = strNum; + if (nNum > 0 && nDen > 0) { + str += ' / '; + } + str += strDen; + return str; + }; + + /** + * Get a string representation of the Unit, with optional formatting options. + * @memberof Unit + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @return {string} + */ + Unit.prototype.format = function (options) { + // Simplfy the unit list, unless it is valueless or was created directly in the + // constructor or as the result of to or toSI + var simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify(); + + // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one. + var isImaginary = false; + if (typeof simp.value !== 'undefined' && simp.value !== null && isComplex(simp.value)) { + // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute + isImaginary = Math.abs(simp.value.re) < 1e-14; + } + for (var i in simp.units) { + if (hasOwnProperty(simp.units, i)) { + if (simp.units[i].unit) { + if (simp.units[i].unit.name === 'VA' && isImaginary) { + simp.units[i].unit = UNITS.VAR; + } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) { + simp.units[i].unit = UNITS.VA; + } + } + } + } + + // Now apply the best prefix + // Units must have only one unit and not have the fixPrefix flag set + if (simp.units.length === 1 && !simp.fixPrefix) { + // Units must have integer powers, otherwise the prefix will change the + // outputted value by not-an-integer-power-of-ten + if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) { + // Apply the best prefix + simp.units[0].prefix = simp._bestPrefix(); + } + } + var value = simp._denormalize(simp.value); + var str = simp.value !== null ? format(value, options || {}) : ''; + var unitStr = simp.formatUnits(); + if (simp.value && isComplex(simp.value)) { + str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing + } + if (unitStr.length > 0 && str.length > 0) { + str += ' '; + } + str += unitStr; + return str; + }; + + /** + * Calculate the best prefix using current value. + * @memberof Unit + * @returns {Object} prefix + * @private + */ + Unit.prototype._bestPrefix = function () { + if (this.units.length !== 1) { + throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!'); + } + if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) { + throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!'); + } + + // find the best prefix value (resulting in the value of which + // the absolute value of the log10 is closest to zero, + // though with a little offset of 1.2 for nicer values: you get a + // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ... + + // Note: the units value can be any numeric type, but to find the best + // prefix it's enough to work with limited precision of a regular number + // Update: using mathjs abs since we also allow complex numbers + var absValue = this.value !== null ? abs(this.value) : 0; + var absUnitValue = abs(this.units[0].unit.value); + var bestPrefix = this.units[0].prefix; + if (absValue === 0) { + return bestPrefix; + } + var power = this.units[0].power; + var bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2; + if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix + bestDiff = Math.abs(bestDiff); + var prefixes = this.units[0].unit.prefixes; + for (var p in prefixes) { + if (hasOwnProperty(prefixes, p)) { + var prefix = prefixes[p]; + if (prefix.scientific) { + var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2); + if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) { + // choose the prefix with the smallest diff, or if equal, choose the one + // with the shortest name (can happen with SHORTLONG for example) + bestPrefix = prefix; + bestDiff = diff; + } + } + } + } + return bestPrefix; + }; + + /** + * Returns an array of units whose sum is equal to this unit + * @memberof Unit + * @param {Array} [parts] An array of strings or valueless units. + * + * Example: + * + * const u = new Unit(1, 'm') + * u.splitUnit(['feet', 'inch']) + * [ 3 feet, 3.3700787401575 inch ] + * + * @return {Array} An array of units. + */ + Unit.prototype.splitUnit = function (parts) { + var x = this.clone(); + var ret = []; + for (var i = 0; i < parts.length; i++) { + // Convert x to the requested unit + x = x.to(parts[i]); + if (i === parts.length - 1) break; + + // Get the numeric value of this unit + var xNumeric = x.toNumeric(); + + // Check to see if xNumeric is nearly equal to an integer, + // since fix can incorrectly round down if there is round-off error + var xRounded = round(xNumeric); + var xFixed = void 0; + var isNearlyEqual = equal(xRounded, xNumeric); + if (isNearlyEqual) { + xFixed = xRounded; + } else { + xFixed = fix(x.toNumeric()); + } + var y = new Unit(xFixed, parts[i].toString()); + ret.push(y); + x = subtractScalar(x, y); + } + + // This little bit fixes a bug where the remainder should be 0 but is a little bit off. + // But instead of comparing x, the remainder, with zero--we will compare the sum of + // all the parts so far with the original value. If they are nearly equal, + // we set the remainder to 0. + var testSum = 0; + for (var _i5 = 0; _i5 < ret.length; _i5++) { + testSum = addScalar(testSum, ret[_i5].value); + } + if (equal(testSum, this.value)) { + x.value = 0; + } + ret.push(x); + return ret; + }; + var PREFIXES = { + NONE: { + '': { + name: '', + value: 1, + scientific: true + } + }, + SHORT: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e1, + scientific: false + }, + h: { + name: 'h', + value: 1e2, + scientific: false + }, + k: { + name: 'k', + value: 1e3, + scientific: true + }, + M: { + name: 'M', + value: 1e6, + scientific: true + }, + G: { + name: 'G', + value: 1e9, + scientific: true + }, + T: { + name: 'T', + value: 1e12, + scientific: true + }, + P: { + name: 'P', + value: 1e15, + scientific: true + }, + E: { + name: 'E', + value: 1e18, + scientific: true + }, + Z: { + name: 'Z', + value: 1e21, + scientific: true + }, + Y: { + name: 'Y', + value: 1e24, + scientific: true + }, + R: { + name: 'R', + value: 1e27, + scientific: true + }, + Q: { + name: 'Q', + value: 1e30, + scientific: true + }, + d: { + name: 'd', + value: 1e-1, + scientific: false + }, + c: { + name: 'c', + value: 1e-2, + scientific: false + }, + m: { + name: 'm', + value: 1e-3, + scientific: true + }, + u: { + name: 'u', + value: 1e-6, + scientific: true + }, + n: { + name: 'n', + value: 1e-9, + scientific: true + }, + p: { + name: 'p', + value: 1e-12, + scientific: true + }, + f: { + name: 'f', + value: 1e-15, + scientific: true + }, + a: { + name: 'a', + value: 1e-18, + scientific: true + }, + z: { + name: 'z', + value: 1e-21, + scientific: true + }, + y: { + name: 'y', + value: 1e-24, + scientific: true + }, + r: { + name: 'r', + value: 1e-27, + scientific: true + }, + q: { + name: 'q', + value: 1e-30, + scientific: true + } + }, + LONG: { + '': { + name: '', + value: 1, + scientific: true + }, + deca: { + name: 'deca', + value: 1e1, + scientific: false + }, + hecto: { + name: 'hecto', + value: 1e2, + scientific: false + }, + kilo: { + name: 'kilo', + value: 1e3, + scientific: true + }, + mega: { + name: 'mega', + value: 1e6, + scientific: true + }, + giga: { + name: 'giga', + value: 1e9, + scientific: true + }, + tera: { + name: 'tera', + value: 1e12, + scientific: true + }, + peta: { + name: 'peta', + value: 1e15, + scientific: true + }, + exa: { + name: 'exa', + value: 1e18, + scientific: true + }, + zetta: { + name: 'zetta', + value: 1e21, + scientific: true + }, + yotta: { + name: 'yotta', + value: 1e24, + scientific: true + }, + ronna: { + name: 'ronna', + value: 1e27, + scientific: true + }, + quetta: { + name: 'quetta', + value: 1e30, + scientific: true + }, + deci: { + name: 'deci', + value: 1e-1, + scientific: false + }, + centi: { + name: 'centi', + value: 1e-2, + scientific: false + }, + milli: { + name: 'milli', + value: 1e-3, + scientific: true + }, + micro: { + name: 'micro', + value: 1e-6, + scientific: true + }, + nano: { + name: 'nano', + value: 1e-9, + scientific: true + }, + pico: { + name: 'pico', + value: 1e-12, + scientific: true + }, + femto: { + name: 'femto', + value: 1e-15, + scientific: true + }, + atto: { + name: 'atto', + value: 1e-18, + scientific: true + }, + zepto: { + name: 'zepto', + value: 1e-21, + scientific: true + }, + yocto: { + name: 'yocto', + value: 1e-24, + scientific: true + }, + ronto: { + name: 'ronto', + value: 1e-27, + scientific: true + }, + quecto: { + name: 'quecto', + value: 1e-30, + scientific: true + } + }, + SQUARED: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e2, + scientific: false + }, + h: { + name: 'h', + value: 1e4, + scientific: false + }, + k: { + name: 'k', + value: 1e6, + scientific: true + }, + M: { + name: 'M', + value: 1e12, + scientific: true + }, + G: { + name: 'G', + value: 1e18, + scientific: true + }, + T: { + name: 'T', + value: 1e24, + scientific: true + }, + P: { + name: 'P', + value: 1e30, + scientific: true + }, + E: { + name: 'E', + value: 1e36, + scientific: true + }, + Z: { + name: 'Z', + value: 1e42, + scientific: true + }, + Y: { + name: 'Y', + value: 1e48, + scientific: true + }, + R: { + name: 'R', + value: 1e54, + scientific: true + }, + Q: { + name: 'Q', + value: 1e60, + scientific: true + }, + d: { + name: 'd', + value: 1e-2, + scientific: false + }, + c: { + name: 'c', + value: 1e-4, + scientific: false + }, + m: { + name: 'm', + value: 1e-6, + scientific: true + }, + u: { + name: 'u', + value: 1e-12, + scientific: true + }, + n: { + name: 'n', + value: 1e-18, + scientific: true + }, + p: { + name: 'p', + value: 1e-24, + scientific: true + }, + f: { + name: 'f', + value: 1e-30, + scientific: true + }, + a: { + name: 'a', + value: 1e-36, + scientific: true + }, + z: { + name: 'z', + value: 1e-42, + scientific: true + }, + y: { + name: 'y', + value: 1e-48, + scientific: true + }, + r: { + name: 'r', + value: 1e-54, + scientific: true + }, + q: { + name: 'q', + value: 1e-60, + scientific: true + } + }, + CUBIC: { + '': { + name: '', + value: 1, + scientific: true + }, + da: { + name: 'da', + value: 1e3, + scientific: false + }, + h: { + name: 'h', + value: 1e6, + scientific: false + }, + k: { + name: 'k', + value: 1e9, + scientific: true + }, + M: { + name: 'M', + value: 1e18, + scientific: true + }, + G: { + name: 'G', + value: 1e27, + scientific: true + }, + T: { + name: 'T', + value: 1e36, + scientific: true + }, + P: { + name: 'P', + value: 1e45, + scientific: true + }, + E: { + name: 'E', + value: 1e54, + scientific: true + }, + Z: { + name: 'Z', + value: 1e63, + scientific: true + }, + Y: { + name: 'Y', + value: 1e72, + scientific: true + }, + R: { + name: 'R', + value: 1e81, + scientific: true + }, + Q: { + name: 'Q', + value: 1e90, + scientific: true + }, + d: { + name: 'd', + value: 1e-3, + scientific: false + }, + c: { + name: 'c', + value: 1e-6, + scientific: false + }, + m: { + name: 'm', + value: 1e-9, + scientific: true + }, + u: { + name: 'u', + value: 1e-18, + scientific: true + }, + n: { + name: 'n', + value: 1e-27, + scientific: true + }, + p: { + name: 'p', + value: 1e-36, + scientific: true + }, + f: { + name: 'f', + value: 1e-45, + scientific: true + }, + a: { + name: 'a', + value: 1e-54, + scientific: true + }, + z: { + name: 'z', + value: 1e-63, + scientific: true + }, + y: { + name: 'y', + value: 1e-72, + scientific: true + }, + r: { + name: 'r', + value: 1e-81, + scientific: true + }, + q: { + name: 'q', + value: 1e-90, + scientific: true + } + }, + BINARY_SHORT_SI: { + '': { + name: '', + value: 1, + scientific: true + }, + k: { + name: 'k', + value: 1e3, + scientific: true + }, + M: { + name: 'M', + value: 1e6, + scientific: true + }, + G: { + name: 'G', + value: 1e9, + scientific: true + }, + T: { + name: 'T', + value: 1e12, + scientific: true + }, + P: { + name: 'P', + value: 1e15, + scientific: true + }, + E: { + name: 'E', + value: 1e18, + scientific: true + }, + Z: { + name: 'Z', + value: 1e21, + scientific: true + }, + Y: { + name: 'Y', + value: 1e24, + scientific: true + } + }, + BINARY_SHORT_IEC: { + '': { + name: '', + value: 1, + scientific: true + }, + Ki: { + name: 'Ki', + value: 1024, + scientific: true + }, + Mi: { + name: 'Mi', + value: Math.pow(1024, 2), + scientific: true + }, + Gi: { + name: 'Gi', + value: Math.pow(1024, 3), + scientific: true + }, + Ti: { + name: 'Ti', + value: Math.pow(1024, 4), + scientific: true + }, + Pi: { + name: 'Pi', + value: Math.pow(1024, 5), + scientific: true + }, + Ei: { + name: 'Ei', + value: Math.pow(1024, 6), + scientific: true + }, + Zi: { + name: 'Zi', + value: Math.pow(1024, 7), + scientific: true + }, + Yi: { + name: 'Yi', + value: Math.pow(1024, 8), + scientific: true + } + }, + BINARY_LONG_SI: { + '': { + name: '', + value: 1, + scientific: true + }, + kilo: { + name: 'kilo', + value: 1e3, + scientific: true + }, + mega: { + name: 'mega', + value: 1e6, + scientific: true + }, + giga: { + name: 'giga', + value: 1e9, + scientific: true + }, + tera: { + name: 'tera', + value: 1e12, + scientific: true + }, + peta: { + name: 'peta', + value: 1e15, + scientific: true + }, + exa: { + name: 'exa', + value: 1e18, + scientific: true + }, + zetta: { + name: 'zetta', + value: 1e21, + scientific: true + }, + yotta: { + name: 'yotta', + value: 1e24, + scientific: true + } + }, + BINARY_LONG_IEC: { + '': { + name: '', + value: 1, + scientific: true + }, + kibi: { + name: 'kibi', + value: 1024, + scientific: true + }, + mebi: { + name: 'mebi', + value: Math.pow(1024, 2), + scientific: true + }, + gibi: { + name: 'gibi', + value: Math.pow(1024, 3), + scientific: true + }, + tebi: { + name: 'tebi', + value: Math.pow(1024, 4), + scientific: true + }, + pebi: { + name: 'pebi', + value: Math.pow(1024, 5), + scientific: true + }, + exi: { + name: 'exi', + value: Math.pow(1024, 6), + scientific: true + }, + zebi: { + name: 'zebi', + value: Math.pow(1024, 7), + scientific: true + }, + yobi: { + name: 'yobi', + value: Math.pow(1024, 8), + scientific: true + } + }, + BTU: { + '': { + name: '', + value: 1, + scientific: true + }, + MM: { + name: 'MM', + value: 1e6, + scientific: true + } + } + }; + PREFIXES.SHORTLONG = _extends({}, PREFIXES.SHORT, PREFIXES.LONG); + PREFIXES.BINARY_SHORT = _extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC); + PREFIXES.BINARY_LONG = _extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC); + + /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning: + * Index Dimension + * ----- --------- + * 0 Length + * 1 Mass + * 2 Time + * 3 Current + * 4 Temperature + * 5 Luminous intensity + * 6 Amount of substance + * 7 Angle + * 8 Bit (digital) + * For example, the unit "298.15 K" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit "1 cal / (gm °C)" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0]. + * + */ + + var BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT']; + var BASE_UNITS = { + NONE: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0] + }, + MASS: { + dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0] + }, + LENGTH: { + dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0] + }, + TIME: { + dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0] + }, + CURRENT: { + dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0] + }, + TEMPERATURE: { + dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0] + }, + LUMINOUS_INTENSITY: { + dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0] + }, + AMOUNT_OF_SUBSTANCE: { + dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0] + }, + FORCE: { + dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0] + }, + SURFACE: { + dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0] + }, + VOLUME: { + dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0] + }, + ENERGY: { + dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0] + }, + POWER: { + dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0] + }, + PRESSURE: { + dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0] + }, + ELECTRIC_CHARGE: { + dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0] + }, + ELECTRIC_CAPACITANCE: { + dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0] + }, + ELECTRIC_POTENTIAL: { + dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0] + }, + ELECTRIC_RESISTANCE: { + dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0] + }, + ELECTRIC_INDUCTANCE: { + dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0] + }, + ELECTRIC_CONDUCTANCE: { + dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0] + }, + MAGNETIC_FLUX: { + dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0] + }, + MAGNETIC_FLUX_DENSITY: { + dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0] + }, + FREQUENCY: { + dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0] + }, + ANGLE: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0] + }, + BIT: { + dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1] + } + }; + for (var key in BASE_UNITS) { + if (hasOwnProperty(BASE_UNITS, key)) { + BASE_UNITS[key].key = key; + } + } + var BASE_UNIT_NONE = {}; + var UNIT_NONE = { + name: '', + base: BASE_UNIT_NONE, + value: 1, + offset: 0, + dimensions: BASE_DIMENSIONS.map(x => 0) + }; + var UNITS = { + // length + meter: { + name: 'meter', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + inch: { + name: 'inch', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0254, + offset: 0 + }, + foot: { + name: 'foot', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.3048, + offset: 0 + }, + yard: { + name: 'yard', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.9144, + offset: 0 + }, + mile: { + name: 'mile', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1609.344, + offset: 0 + }, + link: { + name: 'link', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.201168, + offset: 0 + }, + rod: { + name: 'rod', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 5.0292, + offset: 0 + }, + chain: { + name: 'chain', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 20.1168, + offset: 0 + }, + angstrom: { + name: 'angstrom', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1e-10, + offset: 0 + }, + m: { + name: 'm', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + in: { + name: 'in', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0254, + offset: 0 + }, + ft: { + name: 'ft', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.3048, + offset: 0 + }, + yd: { + name: 'yd', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.9144, + offset: 0 + }, + mi: { + name: 'mi', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 1609.344, + offset: 0 + }, + li: { + name: 'li', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.201168, + offset: 0 + }, + rd: { + name: 'rd', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 5.029210, + offset: 0 + }, + ch: { + name: 'ch', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 20.1168, + offset: 0 + }, + mil: { + name: 'mil', + base: BASE_UNITS.LENGTH, + prefixes: PREFIXES.NONE, + value: 0.0000254, + offset: 0 + }, + // 1/1000 inch + + // Surface + m2: { + name: 'm2', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.SQUARED, + value: 1, + offset: 0 + }, + sqin: { + name: 'sqin', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.00064516, + offset: 0 + }, + // 645.16 mm2 + sqft: { + name: 'sqft', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.09290304, + offset: 0 + }, + // 0.09290304 m2 + sqyd: { + name: 'sqyd', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 0.83612736, + offset: 0 + }, + // 0.83612736 m2 + sqmi: { + name: 'sqmi', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 2589988.110336, + offset: 0 + }, + // 2.589988110336 km2 + sqrd: { + name: 'sqrd', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 25.29295, + offset: 0 + }, + // 25.29295 m2 + sqch: { + name: 'sqch', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 404.6873, + offset: 0 + }, + // 404.6873 m2 + sqmil: { + name: 'sqmil', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 6.4516e-10, + offset: 0 + }, + // 6.4516 * 10^-10 m2 + acre: { + name: 'acre', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 4046.86, + offset: 0 + }, + // 4046.86 m2 + hectare: { + name: 'hectare', + base: BASE_UNITS.SURFACE, + prefixes: PREFIXES.NONE, + value: 10000, + offset: 0 + }, + // 10000 m2 + + // Volume + m3: { + name: 'm3', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.CUBIC, + value: 1, + offset: 0 + }, + L: { + name: 'L', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + // litre + l: { + name: 'l', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + // litre + litre: { + name: 'litre', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.LONG, + value: 0.001, + offset: 0 + }, + cuin: { + name: 'cuin', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 1.6387064e-5, + offset: 0 + }, + // 1.6387064e-5 m3 + cuft: { + name: 'cuft', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.028316846592, + offset: 0 + }, + // 28.316 846 592 L + cuyd: { + name: 'cuyd', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.764554857984, + offset: 0 + }, + // 764.554 857 984 L + teaspoon: { + name: 'teaspoon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000005, + offset: 0 + }, + // 5 mL + tablespoon: { + name: 'tablespoon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000015, + offset: 0 + }, + // 15 mL + // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup + drop: { + name: 'drop', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 5e-8, + offset: 0 + }, + // 0.05 mL = 5e-8 m3 + gtt: { + name: 'gtt', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 5e-8, + offset: 0 + }, + // 0.05 mL = 5e-8 m3 + + // Liquid volume + minim: { + name: 'minim', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000000061611519921875, + offset: 0 + }, + // 1/61440 gallons + fluiddram: { + name: 'fluiddram', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0000036966911953125, + offset: 0 + }, + // 1/1024 gallons + fluidounce: { + name: 'fluidounce', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0000295735295625, + offset: 0 + }, + // 1/128 gallons + gill: { + name: 'gill', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.00011829411825, + offset: 0 + }, + // 1/32 gallons + cc: { + name: 'cc', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 1e-6, + offset: 0 + }, + // 1e-6 L + cup: { + name: 'cup', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.0002365882365, + offset: 0 + }, + // 1/16 gallons + pint: { + name: 'pint', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000473176473, + offset: 0 + }, + // 1/8 gallons + quart: { + name: 'quart', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.000946352946, + offset: 0 + }, + // 1/4 gallons + gallon: { + name: 'gallon', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.003785411784, + offset: 0 + }, + // 3.785411784 L + beerbarrel: { + name: 'beerbarrel', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.117347765304, + offset: 0 + }, + // 31 gallons + oilbarrel: { + name: 'oilbarrel', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.158987294928, + offset: 0 + }, + // 42 gallons + hogshead: { + name: 'hogshead', + base: BASE_UNITS.VOLUME, + prefixes: PREFIXES.NONE, + value: 0.238480942392, + offset: 0 + }, + // 63 gallons + + // Mass + g: { + name: 'g', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 0.001, + offset: 0 + }, + gram: { + name: 'gram', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.LONG, + value: 0.001, + offset: 0 + }, + ton: { + name: 'ton', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 907.18474, + offset: 0 + }, + t: { + name: 't', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.SHORT, + value: 1000, + offset: 0 + }, + tonne: { + name: 'tonne', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.LONG, + value: 1000, + offset: 0 + }, + grain: { + name: 'grain', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 64.79891e-6, + offset: 0 + }, + dram: { + name: 'dram', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 1.7718451953125e-3, + offset: 0 + }, + ounce: { + name: 'ounce', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 28.349523125e-3, + offset: 0 + }, + poundmass: { + name: 'poundmass', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 453.59237e-3, + offset: 0 + }, + hundredweight: { + name: 'hundredweight', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 45.359237, + offset: 0 + }, + stick: { + name: 'stick', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 115e-3, + offset: 0 + }, + stone: { + name: 'stone', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 6.35029318, + offset: 0 + }, + gr: { + name: 'gr', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 64.79891e-6, + offset: 0 + }, + dr: { + name: 'dr', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 1.7718451953125e-3, + offset: 0 + }, + oz: { + name: 'oz', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 28.349523125e-3, + offset: 0 + }, + lbm: { + name: 'lbm', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 453.59237e-3, + offset: 0 + }, + cwt: { + name: 'cwt', + base: BASE_UNITS.MASS, + prefixes: PREFIXES.NONE, + value: 45.359237, + offset: 0 + }, + // Time + s: { + name: 's', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + min: { + name: 'min', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 60, + offset: 0 + }, + h: { + name: 'h', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3600, + offset: 0 + }, + second: { + name: 'second', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + sec: { + name: 'sec', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + minute: { + name: 'minute', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 60, + offset: 0 + }, + hour: { + name: 'hour', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3600, + offset: 0 + }, + day: { + name: 'day', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 86400, + offset: 0 + }, + week: { + name: 'week', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 7 * 86400, + offset: 0 + }, + month: { + name: 'month', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 2629800, + // 1/12th of Julian year + offset: 0 + }, + year: { + name: 'year', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 31557600, + // Julian year + offset: 0 + }, + decade: { + name: 'decade', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 315576000, + // Julian decade + offset: 0 + }, + century: { + name: 'century', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 3155760000, + // Julian century + offset: 0 + }, + millennium: { + name: 'millennium', + base: BASE_UNITS.TIME, + prefixes: PREFIXES.NONE, + value: 31557600000, + // Julian millennium + offset: 0 + }, + // Frequency + hertz: { + name: 'Hertz', + base: BASE_UNITS.FREQUENCY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0, + reciprocal: true + }, + Hz: { + name: 'Hz', + base: BASE_UNITS.FREQUENCY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0, + reciprocal: true + }, + // Angle + rad: { + name: 'rad', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + radian: { + name: 'radian', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888 + deg: { + name: 'deg', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + degree: { + name: 'degree', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399 + grad: { + name: 'grad', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.SHORT, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + gradian: { + name: 'gradian', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.LONG, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793 + cycle: { + name: 'cycle', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795 + arcsec: { + name: 'arcsec', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477 + arcmin: { + name: 'arcmin', + base: BASE_UNITS.ANGLE, + prefixes: PREFIXES.NONE, + value: null, + // will be filled in by calculateAngleValues() + offset: 0 + }, + // Electric current + A: { + name: 'A', + base: BASE_UNITS.CURRENT, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + ampere: { + name: 'ampere', + base: BASE_UNITS.CURRENT, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // Temperature + // K(C) = °C + 273.15 + // K(F) = (°F + 459.67) * (5 / 9) + // K(R) = °R * (5 / 9) + K: { + name: 'K', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + degC: { + name: 'degC', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 273.15 + }, + degF: { + name: 'degF', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: new _Fraction(5, 9), + offset: 459.67 + }, + degR: { + name: 'degR', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.SHORT, + value: new _Fraction(5, 9), + offset: 0 + }, + kelvin: { + name: 'kelvin', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + celsius: { + name: 'celsius', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 273.15 + }, + fahrenheit: { + name: 'fahrenheit', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: new _Fraction(5, 9), + offset: 459.67 + }, + rankine: { + name: 'rankine', + base: BASE_UNITS.TEMPERATURE, + prefixes: PREFIXES.LONG, + value: new _Fraction(5, 9), + offset: 0 + }, + // amount of substance + mol: { + name: 'mol', + base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + mole: { + name: 'mole', + base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // luminous intensity + cd: { + name: 'cd', + base: BASE_UNITS.LUMINOUS_INTENSITY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + candela: { + name: 'candela', + base: BASE_UNITS.LUMINOUS_INTENSITY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + // TODO: units STERADIAN + // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0}, + // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0}, + + // Force + N: { + name: 'N', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + newton: { + name: 'newton', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + dyn: { + name: 'dyn', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.SHORT, + value: 0.00001, + offset: 0 + }, + dyne: { + name: 'dyne', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 0.00001, + offset: 0 + }, + lbf: { + name: 'lbf', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 4.4482216152605, + offset: 0 + }, + poundforce: { + name: 'poundforce', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 4.4482216152605, + offset: 0 + }, + kip: { + name: 'kip', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.LONG, + value: 4448.2216, + offset: 0 + }, + kilogramforce: { + name: 'kilogramforce', + base: BASE_UNITS.FORCE, + prefixes: PREFIXES.NONE, + value: 9.80665, + offset: 0 + }, + // Energy + J: { + name: 'J', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + joule: { + name: 'joule', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + erg: { + name: 'erg', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORTLONG, + // Both kiloerg and kerg are acceptable + value: 1e-7, + offset: 0 + }, + Wh: { + name: 'Wh', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 3600, + offset: 0 + }, + BTU: { + name: 'BTU', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.BTU, + value: 1055.05585262, + offset: 0 + }, + eV: { + name: 'eV', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.SHORT, + value: 1.602176565e-19, + offset: 0 + }, + electronvolt: { + name: 'electronvolt', + base: BASE_UNITS.ENERGY, + prefixes: PREFIXES.LONG, + value: 1.602176565e-19, + offset: 0 + }, + // Power + W: { + name: 'W', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + watt: { + name: 'watt', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + hp: { + name: 'hp', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.NONE, + value: 745.6998715386, + offset: 0 + }, + // Electrical power units + VAR: { + name: 'VAR', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: Complex.I, + offset: 0 + }, + VA: { + name: 'VA', + base: BASE_UNITS.POWER, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Pressure + Pa: { + name: 'Pa', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + psi: { + name: 'psi', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 6894.75729276459, + offset: 0 + }, + atm: { + name: 'atm', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 101325, + offset: 0 + }, + bar: { + name: 'bar', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.SHORTLONG, + value: 100000, + offset: 0 + }, + torr: { + name: 'torr', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 133.322, + offset: 0 + }, + mmHg: { + name: 'mmHg', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 133.322, + offset: 0 + }, + mmH2O: { + name: 'mmH2O', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 9.80665, + offset: 0 + }, + cmH2O: { + name: 'cmH2O', + base: BASE_UNITS.PRESSURE, + prefixes: PREFIXES.NONE, + value: 98.0665, + offset: 0 + }, + // Electric charge + coulomb: { + name: 'coulomb', + base: BASE_UNITS.ELECTRIC_CHARGE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + C: { + name: 'C', + base: BASE_UNITS.ELECTRIC_CHARGE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric capacitance + farad: { + name: 'farad', + base: BASE_UNITS.ELECTRIC_CAPACITANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + F: { + name: 'F', + base: BASE_UNITS.ELECTRIC_CAPACITANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric potential + volt: { + name: 'volt', + base: BASE_UNITS.ELECTRIC_POTENTIAL, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + V: { + name: 'V', + base: BASE_UNITS.ELECTRIC_POTENTIAL, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric resistance + ohm: { + name: 'ohm', + base: BASE_UNITS.ELECTRIC_RESISTANCE, + prefixes: PREFIXES.SHORTLONG, + // Both Mohm and megaohm are acceptable + value: 1, + offset: 0 + }, + /* + * Unicode breaks in browsers if charset is not specified + Ω: { + name: 'Ω', + base: BASE_UNITS.ELECTRIC_RESISTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + */ + // Electric inductance + henry: { + name: 'henry', + base: BASE_UNITS.ELECTRIC_INDUCTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + H: { + name: 'H', + base: BASE_UNITS.ELECTRIC_INDUCTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Electric conductance + siemens: { + name: 'siemens', + base: BASE_UNITS.ELECTRIC_CONDUCTANCE, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + S: { + name: 'S', + base: BASE_UNITS.ELECTRIC_CONDUCTANCE, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Magnetic flux + weber: { + name: 'weber', + base: BASE_UNITS.MAGNETIC_FLUX, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + Wb: { + name: 'Wb', + base: BASE_UNITS.MAGNETIC_FLUX, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Magnetic flux density + tesla: { + name: 'tesla', + base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, + prefixes: PREFIXES.LONG, + value: 1, + offset: 0 + }, + T: { + name: 'T', + base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, + prefixes: PREFIXES.SHORT, + value: 1, + offset: 0 + }, + // Binary + b: { + name: 'b', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_SHORT, + value: 1, + offset: 0 + }, + bits: { + name: 'bits', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_LONG, + value: 1, + offset: 0 + }, + B: { + name: 'B', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_SHORT, + value: 8, + offset: 0 + }, + bytes: { + name: 'bytes', + base: BASE_UNITS.BIT, + prefixes: PREFIXES.BINARY_LONG, + value: 8, + offset: 0 + } + }; + + // aliases (formerly plurals) + // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units + var ALIASES = { + meters: 'meter', + inches: 'inch', + feet: 'foot', + yards: 'yard', + miles: 'mile', + links: 'link', + rods: 'rod', + chains: 'chain', + angstroms: 'angstrom', + lt: 'l', + litres: 'litre', + liter: 'litre', + liters: 'litre', + teaspoons: 'teaspoon', + tablespoons: 'tablespoon', + minims: 'minim', + fldr: 'fluiddram', + fluiddrams: 'fluiddram', + floz: 'fluidounce', + fluidounces: 'fluidounce', + gi: 'gill', + gills: 'gill', + cp: 'cup', + cups: 'cup', + pt: 'pint', + pints: 'pint', + qt: 'quart', + quarts: 'quart', + gal: 'gallon', + gallons: 'gallon', + bbl: 'beerbarrel', + beerbarrels: 'beerbarrel', + obl: 'oilbarrel', + oilbarrels: 'oilbarrel', + hogsheads: 'hogshead', + gtts: 'gtt', + grams: 'gram', + tons: 'ton', + tonnes: 'tonne', + grains: 'grain', + drams: 'dram', + ounces: 'ounce', + poundmasses: 'poundmass', + hundredweights: 'hundredweight', + sticks: 'stick', + lb: 'lbm', + lbs: 'lbm', + kips: 'kip', + kgf: 'kilogramforce', + acres: 'acre', + hectares: 'hectare', + sqfeet: 'sqft', + sqyard: 'sqyd', + sqmile: 'sqmi', + sqmiles: 'sqmi', + mmhg: 'mmHg', + mmh2o: 'mmH2O', + cmh2o: 'cmH2O', + seconds: 'second', + secs: 'second', + minutes: 'minute', + mins: 'minute', + hours: 'hour', + hr: 'hour', + hrs: 'hour', + days: 'day', + weeks: 'week', + months: 'month', + years: 'year', + decades: 'decade', + centuries: 'century', + millennia: 'millennium', + hertz: 'hertz', + radians: 'radian', + degrees: 'degree', + gradians: 'gradian', + cycles: 'cycle', + arcsecond: 'arcsec', + arcseconds: 'arcsec', + arcminute: 'arcmin', + arcminutes: 'arcmin', + BTUs: 'BTU', + watts: 'watt', + joules: 'joule', + amperes: 'ampere', + amps: 'ampere', + amp: 'ampere', + coulombs: 'coulomb', + volts: 'volt', + ohms: 'ohm', + farads: 'farad', + webers: 'weber', + teslas: 'tesla', + electronvolts: 'electronvolt', + moles: 'mole', + bit: 'bits', + byte: 'bytes' + }; + + /** + * Calculate the values for the angle units. + * Value is calculated as number or BigNumber depending on the configuration + * @param {{number: 'number' | 'BigNumber'}} config + */ + function calculateAngleValues(config) { + if (config.number === 'BigNumber') { + var pi = createPi(_BigNumber); + UNITS.rad.value = new _BigNumber(1); + UNITS.deg.value = pi.div(180); // 2 * pi / 360 + UNITS.grad.value = pi.div(200); // 2 * pi / 400 + UNITS.cycle.value = pi.times(2); // 2 * pi + UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600 + UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60 + } else { + // number + UNITS.rad.value = 1; + UNITS.deg.value = Math.PI / 180; // 2 * pi / 360 + UNITS.grad.value = Math.PI / 200; // 2 * pi / 400 + UNITS.cycle.value = Math.PI * 2; // 2 * pi + UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600 + UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60 + } + + // copy to the full names of the angles + UNITS.radian.value = UNITS.rad.value; + UNITS.degree.value = UNITS.deg.value; + UNITS.gradian.value = UNITS.grad.value; + } + + // apply the angle values now + calculateAngleValues(config); + if (on) { + // recalculate the values on change of configuration + on('config', function (curr, prev) { + if (curr.number !== prev.number) { + calculateAngleValues(curr); + } + }); + } + + /** + * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system. + * A user perhaps could issue a command to select a preferred unit system, or use the default (see below). + * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies. + */ + var UNIT_SYSTEMS = { + si: { + // Base units + NONE: { + unit: UNIT_NONE, + prefix: PREFIXES.NONE[''] + }, + LENGTH: { + unit: UNITS.m, + prefix: PREFIXES.SHORT[''] + }, + MASS: { + unit: UNITS.g, + prefix: PREFIXES.SHORT.k + }, + TIME: { + unit: UNITS.s, + prefix: PREFIXES.SHORT[''] + }, + CURRENT: { + unit: UNITS.A, + prefix: PREFIXES.SHORT[''] + }, + TEMPERATURE: { + unit: UNITS.K, + prefix: PREFIXES.SHORT[''] + }, + LUMINOUS_INTENSITY: { + unit: UNITS.cd, + prefix: PREFIXES.SHORT[''] + }, + AMOUNT_OF_SUBSTANCE: { + unit: UNITS.mol, + prefix: PREFIXES.SHORT[''] + }, + ANGLE: { + unit: UNITS.rad, + prefix: PREFIXES.SHORT[''] + }, + BIT: { + unit: UNITS.bits, + prefix: PREFIXES.SHORT[''] + }, + // Derived units + FORCE: { + unit: UNITS.N, + prefix: PREFIXES.SHORT[''] + }, + ENERGY: { + unit: UNITS.J, + prefix: PREFIXES.SHORT[''] + }, + POWER: { + unit: UNITS.W, + prefix: PREFIXES.SHORT[''] + }, + PRESSURE: { + unit: UNITS.Pa, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CHARGE: { + unit: UNITS.C, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CAPACITANCE: { + unit: UNITS.F, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_POTENTIAL: { + unit: UNITS.V, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_RESISTANCE: { + unit: UNITS.ohm, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_INDUCTANCE: { + unit: UNITS.H, + prefix: PREFIXES.SHORT[''] + }, + ELECTRIC_CONDUCTANCE: { + unit: UNITS.S, + prefix: PREFIXES.SHORT[''] + }, + MAGNETIC_FLUX: { + unit: UNITS.Wb, + prefix: PREFIXES.SHORT[''] + }, + MAGNETIC_FLUX_DENSITY: { + unit: UNITS.T, + prefix: PREFIXES.SHORT[''] + }, + FREQUENCY: { + unit: UNITS.Hz, + prefix: PREFIXES.SHORT[''] + } + } + }; + + // Clone to create the other unit systems + UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + UNIT_SYSTEMS.cgs.LENGTH = { + unit: UNITS.m, + prefix: PREFIXES.SHORT.c + }; + UNIT_SYSTEMS.cgs.MASS = { + unit: UNITS.g, + prefix: PREFIXES.SHORT[''] + }; + UNIT_SYSTEMS.cgs.FORCE = { + unit: UNITS.dyn, + prefix: PREFIXES.SHORT[''] + }; + UNIT_SYSTEMS.cgs.ENERGY = { + unit: UNITS.erg, + prefix: PREFIXES.NONE[''] + }; + // there are wholly 4 unique cgs systems for electricity and magnetism, + // so let's not worry about it unless somebody complains + + UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + UNIT_SYSTEMS.us.LENGTH = { + unit: UNITS.ft, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.MASS = { + unit: UNITS.lbm, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.TEMPERATURE = { + unit: UNITS.degF, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.FORCE = { + unit: UNITS.lbf, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.ENERGY = { + unit: UNITS.BTU, + prefix: PREFIXES.BTU[''] + }; + UNIT_SYSTEMS.us.POWER = { + unit: UNITS.hp, + prefix: PREFIXES.NONE[''] + }; + UNIT_SYSTEMS.us.PRESSURE = { + unit: UNITS.psi, + prefix: PREFIXES.NONE[''] + }; + + // Add additional unit systems here. + + // Choose a unit system to seed the auto unit system. + UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)); + + // Set the current unit system + var currentUnitSystem = UNIT_SYSTEMS.auto; + + /** + * Set a unit system for formatting derived units. + * @memberof Unit + * @param {string} [name] The name of the unit system. + */ + Unit.setUnitSystem = function (name) { + if (hasOwnProperty(UNIT_SYSTEMS, name)) { + currentUnitSystem = UNIT_SYSTEMS[name]; + } else { + throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', ')); + } + }; + + /** + * Return the current unit system. + * @memberof Unit + * @return {string} The current unit system. + */ + Unit.getUnitSystem = function () { + for (var _key in UNIT_SYSTEMS) { + if (hasOwnProperty(UNIT_SYSTEMS, _key)) { + if (UNIT_SYSTEMS[_key] === currentUnitSystem) { + return _key; + } + } + } + }; + + /** + * Converters to convert from number to an other numeric type like BigNumber + * or Fraction + */ + Unit.typeConverters = { + BigNumber: function BigNumber(x) { + if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s); + return new _BigNumber(x + ''); // stringify to prevent constructor error + }, + Fraction: function Fraction(x) { + return new _Fraction(x); + }, + Complex: function Complex(x) { + return x; + }, + number: function number(x) { + if (x !== null && x !== void 0 && x.isFraction) return _number(x); + return x; + } + }; + + /** + * Retrieve the right converter function corresponding with this unit's + * value + * + * @memberof Unit + * @return {Function} + */ + Unit.prototype._numberConverter = function () { + var convert = Unit.typeConverters[this.valueType()]; + if (convert) { + return convert; + } + throw new TypeError('Unsupported Unit value type "' + this.valueType() + '"'); + }; + + /** + * Retrieve the right convertor function corresponding with the type + * of provided exampleValue. + * + * @param {string} type A string 'number', 'BigNumber', or 'Fraction' + * In case of an unknown type, + * @return {Function} + */ + Unit._getNumberConverter = function (type) { + if (!Unit.typeConverters[type]) { + throw new TypeError('Unsupported type "' + type + '"'); + } + return Unit.typeConverters[type]; + }; + + // Add dimensions to each built-in unit + for (var _key2 in UNITS) { + if (hasOwnProperty(UNITS, _key2)) { + var unit = UNITS[_key2]; + unit.dimensions = unit.base.dimensions; + } + } + + // Create aliases + for (var _name2 in ALIASES) { + if (hasOwnProperty(ALIASES, _name2)) { + var _unit2 = UNITS[ALIASES[_name2]]; + var alias = {}; + for (var _key3 in _unit2) { + if (hasOwnProperty(_unit2, _key3)) { + alias[_key3] = _unit2[_key3]; + } + } + alias.name = _name2; + UNITS[_name2] = alias; + } + } + + /** + * Checks if a character is a valid latin letter (upper or lower case). + * Note that this function can be overridden, for example to allow support of other alphabets. + * @memberof Unit + * @param {string} c Tested character + * @return {boolean} true if the character is a latin letter + */ + Unit.isValidAlpha = function isValidAlpha(c) { + return /^[a-zA-Z]$/.test(c); + }; + function assertUnitNameIsValid(name) { + for (var i = 0; i < name.length; i++) { + c = name.charAt(i); + if (i === 0 && !Unit.isValidAlpha(c)) { + throw new Error('Invalid unit name (must begin with alpha character): "' + name + '"'); + } + if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) { + throw new Error('Invalid unit name (only alphanumeric characters are allowed): "' + name + '"'); + } + } + } + + /** + * Wrapper around createUnitSingle. + * Example: + * createUnit( { + * foo: { + * prefixes: 'long', + * baseName: 'essence-of-foo' + * }, + * bar: '40 foo', + * baz: { + * definition: '1 bar/hour', + * prefixes: 'long' + * } + * }, + * { + * override: true + * }) + * @memberof Unit + * @param {object} obj Object map. Each key becomes a unit which is defined by its value. + * @param {object} options + * @return {Unit} the last created unit + */ + Unit.createUnit = function (obj, options) { + if (typeof obj !== 'object') { + throw new TypeError("createUnit expects first parameter to be of type 'Object'"); + } + + // Remove all units and aliases we are overriding + if (options && options.override) { + for (var _key4 in obj) { + if (hasOwnProperty(obj, _key4)) { + Unit.deleteUnit(_key4); + } + if (obj[_key4].aliases) { + for (var i = 0; i < obj[_key4].aliases.length; i++) { + Unit.deleteUnit(obj[_key4].aliases[i]); + } + } + } + } + + // TODO: traverse multiple times until all units have been added + var lastUnit; + for (var _key5 in obj) { + if (hasOwnProperty(obj, _key5)) { + lastUnit = Unit.createUnitSingle(_key5, obj[_key5]); + } + } + return lastUnit; + }; + + /** + * Create a user-defined unit and register it with the Unit type. + * Example: + * createUnitSingle('knot', '0.514444444 m/s') + * + * @memberof Unit + * @param {string} name The name of the new unit. Must be unique. Example: 'knot' + * @param {string | Unit | object} definition Definition of the unit in terms + * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string, + * or an Object. If an Object, may have the following properties: + * - definition {string | Unit} The definition of this unit. + * - prefixes {string} "none", "short", "long", "binary_short", or "binary_long". + * The default is "none". + * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts'] + * - offset {Numeric} An offset to apply when converting from the unit. For + * example, the offset for celsius is 273.15 and the offset for farhenheit + * is 459.67. Default is 0. + * - baseName {string} If the unit's dimension does not match that of any other + * base unit, the name of the newly create base unit. Otherwise, this property + * has no effect. + * + * @return {Unit} + */ + Unit.createUnitSingle = function (name, obj) { + if (typeof obj === 'undefined' || obj === null) { + obj = {}; + } + if (typeof name !== 'string') { + throw new TypeError("createUnitSingle expects first parameter to be of type 'string'"); + } + + // Check collisions with existing units + if (hasOwnProperty(UNITS, name)) { + throw new Error('Cannot create unit "' + name + '": a unit with that name already exists'); + } + + // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator. + + assertUnitNameIsValid(name); + var defUnit = null; // The Unit from which the new unit will be created. + var aliases = []; + var offset = 0; + var definition; + var prefixes; + var baseName; + if (obj && obj.type === 'Unit') { + defUnit = obj.clone(); + } else if (typeof obj === 'string') { + if (obj !== '') { + definition = obj; + } + } else if (typeof obj === 'object') { + definition = obj.definition; + prefixes = obj.prefixes; + offset = obj.offset; + baseName = obj.baseName; + if (obj.aliases) { + aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array + } + } else { + throw new TypeError('Cannot create unit "' + name + '" from "' + obj.toString() + '": expecting "string" or "Unit" or "Object"'); + } + if (aliases) { + for (var i = 0; i < aliases.length; i++) { + if (hasOwnProperty(UNITS, aliases[i])) { + throw new Error('Cannot create alias "' + aliases[i] + '": a unit with that name already exists'); + } + } + } + if (definition && typeof definition === 'string' && !defUnit) { + try { + defUnit = Unit.parse(definition, { + allowNoUnits: true + }); + } catch (ex) { + ex.message = 'Could not create unit "' + name + '" from "' + definition + '": ' + ex.message; + throw ex; + } + } else if (definition && definition.type === 'Unit') { + defUnit = definition.clone(); + } + aliases = aliases || []; + offset = offset || 0; + if (prefixes && prefixes.toUpperCase) { + prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE; + } else { + prefixes = PREFIXES.NONE; + } + + // If defUnit is null, it is because the user did not + // specify a defintion. So create a new base dimension. + var newUnit = {}; + if (!defUnit) { + // Add a new base dimension + baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo + if (BASE_DIMENSIONS.indexOf(baseName) >= 0) { + throw new Error('Cannot create new base unit "' + name + '": a base unit with that name already exists (and cannot be overridden)'); + } + BASE_DIMENSIONS.push(baseName); + + // Push 0 onto existing base units + for (var b in BASE_UNITS) { + if (hasOwnProperty(BASE_UNITS, b)) { + BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0; + } + } + + // Add the new base unit + var newBaseUnit = { + dimensions: [] + }; + for (var _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) { + newBaseUnit.dimensions[_i6] = 0; + } + newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1; + newBaseUnit.key = baseName; + BASE_UNITS[baseName] = newBaseUnit; + newUnit = { + name, + value: 1, + dimensions: BASE_UNITS[baseName].dimensions.slice(0), + prefixes, + offset, + base: BASE_UNITS[baseName] + }; + currentUnitSystem[baseName] = { + unit: newUnit, + prefix: PREFIXES.NONE[''] + }; + } else { + newUnit = { + name, + value: defUnit.value, + dimensions: defUnit.dimensions.slice(0), + prefixes, + offset + }; + + // Create a new base if no matching base exists + var anyMatch = false; + for (var _i7 in BASE_UNITS) { + if (hasOwnProperty(BASE_UNITS, _i7)) { + var match = true; + for (var j = 0; j < BASE_DIMENSIONS.length; j++) { + if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0)) > 1e-12) { + match = false; + break; + } + } + if (match) { + anyMatch = true; + newUnit.base = BASE_UNITS[_i7]; + break; + } + } + } + if (!anyMatch) { + baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo + // Add the new base unit + var _newBaseUnit = { + dimensions: defUnit.dimensions.slice(0) + }; + _newBaseUnit.key = baseName; + BASE_UNITS[baseName] = _newBaseUnit; + currentUnitSystem[baseName] = { + unit: newUnit, + prefix: PREFIXES.NONE[''] + }; + newUnit.base = BASE_UNITS[baseName]; + } + } + Unit.UNITS[name] = newUnit; + for (var _i8 = 0; _i8 < aliases.length; _i8++) { + var aliasName = aliases[_i8]; + var _alias = {}; + for (var _key6 in newUnit) { + if (hasOwnProperty(newUnit, _key6)) { + _alias[_key6] = newUnit[_key6]; + } + } + _alias.name = aliasName; + Unit.UNITS[aliasName] = _alias; + } + + // delete the memoization cache because we created a new unit + delete _findUnit.cache; + return new Unit(null, name); + }; + Unit.deleteUnit = function (name) { + delete Unit.UNITS[name]; + + // delete the memoization cache because we deleted a unit + delete _findUnit.cache; + }; + + // expose arrays with prefixes, dimensions, units, systems + Unit.PREFIXES = PREFIXES; + Unit.BASE_DIMENSIONS = BASE_DIMENSIONS; + Unit.BASE_UNITS = BASE_UNITS; + Unit.UNIT_SYSTEMS = UNIT_SYSTEMS; + Unit.UNITS = UNITS; + return Unit; +}, { + isClass: true +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js new file mode 100644 index 0000000..5c4624f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js @@ -0,0 +1,79 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'createUnit'; +var dependencies = ['typed', 'Unit']; +export var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Unit + } = _ref; + /** + * Create a user-defined unit and register it with the Unit type. + * + * Syntax: + * + * math.createUnit({ + * baseUnit1: { + * aliases: [string, ...] + * prefixes: object + * }, + * unit2: { + * definition: string, + * aliases: [string, ...] + * prefixes: object, + * offset: number + * }, + * unit3: string // Shortcut + * }) + * + * // Another shortcut: + * math.createUnit(string, unit : string, [object]) + * + * Examples: + * + * math.createUnit('foo') + * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']}) + * math.createUnit('mph', '1 mile/hour') + * math.createUnit('km', math.unit(1000, 'm')) + * + * @param {string} name The name of the new unit. Must be unique. Example: 'knot' + * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'. + * @param {Object} options (optional) An object containing any of the following properties: + * - `prefixes {string}` "none", "short", "long", "binary_short", or "binary_long". The default is "none". + * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts'] + * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0. + * + * See also: + * + * unit + * + * @return {Unit} The new unit + */ + return typed(name, { + // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options. + 'Object, Object': function Object_Object(obj, options) { + return Unit.createUnit(obj, options); + }, + // Same as above but without the options. + Object: function Object(obj) { + return Unit.createUnit(obj, {}); + }, + // Shortcut method for creating one unit. + 'string, Unit | string | Object, Object': function string_Unit__string__Object_Object(name, def, options) { + var obj = {}; + obj[name] = def; + return Unit.createUnit(obj, options); + }, + // Same as above but without the options. + 'string, Unit | string | Object': function string_Unit__string__Object(name, def) { + var obj = {}; + obj[name] = def; + return Unit.createUnit(obj, {}); + }, + // Without a definition, creates a base unit. + string: function string(name) { + var obj = {}; + obj[name] = {}; + return Unit.createUnit(obj, {}); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js new file mode 100644 index 0000000..f89e59e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js @@ -0,0 +1,32 @@ +import { factory } from '../../../utils/factory.js'; +var name = 'splitUnit'; +var dependencies = ['typed']; +export var createSplitUnit = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed + } = _ref; + /** + * Split a unit in an array of units whose sum is equal to the original unit. + * + * Syntax: + * + * math.splitUnit(unit: Unit, parts: Array.) + * + * Example: + * + * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch']) + * // [ 3 feet, 3.3700787401575 inch ] + * + * See also: + * + * unit + * + * @param {Array} [parts] An array of strings or valueless units. + * @return {Array} An array of units. + */ + return typed(name, { + 'Unit, Array': function Unit_Array(unit, parts) { + return unit.splitUnit(parts); + } + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/unit.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/unit.js new file mode 100644 index 0000000..612d68a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/function/unit.js @@ -0,0 +1,60 @@ +import { factory } from '../../../utils/factory.js'; +import { deepMap } from '../../../utils/collection.js'; +var name = 'unit'; +var dependencies = ['typed', 'Unit']; + +// This function is named createUnitFunction to prevent a naming conflict with createUnit +export var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref => { + var { + typed, + Unit + } = _ref; + /** + * Create a unit. Depending on the passed arguments, the function + * will create and return a new math.Unit object. + * When a matrix is provided, all elements will be converted to units. + * + * Syntax: + * + * math.unit(unit : string) + * math.unit(value : number, valuelessUnit : Unit) + * math.unit(value : number, valuelessUnit : string) + * + * Examples: + * + * const kph = math.unit('km/h') // returns Unit km/h (valueless) + * const v = math.unit(25, kph) // returns Unit 25 km/h + * const a = math.unit(5, 'cm') // returns Unit 50 mm + * const b = math.unit('23 kg') // returns Unit 23 kg + * a.to('m') // returns Unit 0.05 m + * + * See also: + * + * bignumber, boolean, complex, index, matrix, number, string, createUnit + * + * @param {* | Array | Matrix} args A number and unit. + * @return {Unit | Array | Matrix} The created unit + */ + + return typed(name, { + Unit: function Unit(x) { + return x.clone(); + }, + string: function string(x) { + if (Unit.isValuelessUnit(x)) { + return new Unit(null, x); // a pure unit + } + return Unit.parse(x, { + allowNoUnits: true + }); // a unit with value, like '5cm' + }, + 'number | BigNumber | Fraction | Complex, string | Unit': function number__BigNumber__Fraction__Complex_string__Unit(value, unit) { + return new Unit(value, unit); + }, + 'number | BigNumber | Fraction': function number__BigNumber__Fraction(value) { + // dimensionless + return new Unit(value); + }, + 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) + }); +}); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js new file mode 100644 index 0000000..6e65b38 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js @@ -0,0 +1,101 @@ +import { factory } from '../../utils/factory.js'; + +// Source: https://en.wikipedia.org/wiki/Physical_constant + +// Universal constants +export var createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1'); +export var createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2'); +export var createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s'); +export var createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s'); + +// Electromagnetic constants +export var createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2'); +export var createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1'); +export var createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm'); +export var createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2'); +export var createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C'); +export var createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1'); +export var createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S'); +export var createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm'); +export var createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb'); +export var createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1'); +export var createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm'); +export var createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed + +// Atomic and nuclear constants +export var createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm'); +export var createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm'); +export var createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg'); +export var createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2'); +export var createFineStructure = numberFactory('fineStructure', 7.2973525693e-3); +export var createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J'); +export var createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg'); +export var createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg'); +export var createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg'); +export var createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1'); +export var createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1'); +export var createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2'); +export var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290); +export var createEfimovFactor = numberFactory('efimovFactor', 22.7); + +// Physico-chemical constants +export var createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg'); +export var createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1'); +export var createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1'); +export var createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1'); +export var createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2'); +// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1 +export var createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3'); +export var createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1'); +export var createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1'); +export var createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1'); +export var createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358); +export var createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K'); +export var createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4'); +export var createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K'); + +// Adopted values +export var createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1'); +export var createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1'); +export var createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2'); +// atm is defined in Unit.js + +// Natural units +export var createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm'); +export var createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg'); +export var createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's'); +export var createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C'); +export var createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K'); + +// helper function to create a factory function which creates a physical constant, +// a Unit with either a number value or a BigNumber value depending on the configuration +function unitFactory(name, valueStr, unitStr) { + var dependencies = ['config', 'Unit', 'BigNumber']; + return factory(name, dependencies, _ref => { + var { + config, + Unit, + BigNumber + } = _ref; + // Note that we can parse into number or BigNumber. + // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values + // Therefore we dont use Unit.parse() + var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr); + var unit = new Unit(value, unitStr); + unit.fixPrefix = true; + return unit; + }); +} + +// helper function to create a factory function which creates a numeric constant, +// either a number or BigNumber depending on the configuration +function numberFactory(name, value) { + var dependencies = ['config', 'BigNumber']; + return factory(name, dependencies, _ref2 => { + var { + config, + BigNumber + } = _ref2; + return config.number === 'BigNumber' ? new BigNumber(value) : value; + }); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/array.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/array.js new file mode 100644 index 0000000..106f25f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/array.js @@ -0,0 +1,837 @@ +import _extends from "@babel/runtime/helpers/extends"; +import { isInteger } from './number.js'; +import { isNumber, isBigNumber, isArray, isString } from './is.js'; +import { format } from './string.js'; +import { DimensionError } from '../error/DimensionError.js'; +import { IndexError } from '../error/IndexError.js'; +import { deepStrictEqual } from './object.js'; + +/** + * Calculate the size of a multi dimensional array. + * This function checks the size of the first entry, it does not validate + * whether all dimensions match. (use function `validate` for that) + * @param {Array} x + * @Return {Number[]} size + */ +export function arraySize(x) { + var s = []; + while (Array.isArray(x)) { + s.push(x.length); + x = x[0]; + } + return s; +} + +/** + * Recursively validate whether each element in a multi dimensional array + * has a size corresponding to the provided size array. + * @param {Array} array Array to be validated + * @param {number[]} size Array with the size of each dimension + * @param {number} dim Current dimension + * @throws DimensionError + * @private + */ +function _validate(array, size, dim) { + var i; + var len = array.length; + if (len !== size[dim]) { + throw new DimensionError(len, size[dim]); + } + if (dim < size.length - 1) { + // recursively validate each child array + var dimNext = dim + 1; + for (i = 0; i < len; i++) { + var child = array[i]; + if (!Array.isArray(child)) { + throw new DimensionError(size.length - 1, size.length, '<'); + } + _validate(array[i], size, dimNext); + } + } else { + // last dimension. none of the childs may be an array + for (i = 0; i < len; i++) { + if (Array.isArray(array[i])) { + throw new DimensionError(size.length + 1, size.length, '>'); + } + } + } +} + +/** + * Validate whether each element in a multi dimensional array has + * a size corresponding to the provided size array. + * @param {Array} array Array to be validated + * @param {number[]} size Array with the size of each dimension + * @throws DimensionError + */ +export function validate(array, size) { + var isScalar = size.length === 0; + if (isScalar) { + // scalar + if (Array.isArray(array)) { + throw new DimensionError(array.length, 0); + } + } else { + // array + _validate(array, size, 0); + } +} + +/** + * Validate whether the source of the index matches the size of the Array + * @param {Array | Matrix} array Array to be validated + * @param {Index} index Index with the source information to validate + * @throws DimensionError + */ +export function validateIndexSourceSize(value, index) { + var valueSize = value.isMatrix ? value._size : arraySize(value); + var sourceSize = index._sourceSize; + // checks if the source size is not null and matches the valueSize + sourceSize.forEach((sourceDim, i) => { + if (sourceDim !== null && sourceDim !== valueSize[i]) { + throw new DimensionError(sourceDim, valueSize[i]); + } + }); +} + +/** + * Test whether index is an integer number with index >= 0 and index < length + * when length is provided + * @param {number} index Zero-based index + * @param {number} [length] Length of the array + */ +export function validateIndex(index, length) { + if (index !== undefined) { + if (!isNumber(index) || !isInteger(index)) { + throw new TypeError('Index must be an integer (value: ' + index + ')'); + } + if (index < 0 || typeof length === 'number' && index >= length) { + throw new IndexError(index, length); + } + } +} + +/** + * Test if and index has empty values + * @param {number} index Zero-based index + */ +export function isEmptyIndex(index) { + for (var i = 0; i < index._dimensions.length; ++i) { + var dimension = index._dimensions[i]; + if (dimension._data && isArray(dimension._data)) { + if (dimension._size[0] === 0) { + return true; + } + } else if (dimension.isRange) { + if (dimension.start === dimension.end) { + return true; + } + } else if (isString(dimension)) { + if (dimension.length === 0) { + return true; + } + } + } + return false; +} + +/** + * Resize a multi dimensional array. The resized array is returned. + * @param {Array | number} array Array to be resized + * @param {number[]} size Array with the size of each dimension + * @param {*} [defaultValue=0] Value to be filled in in new entries, + * zero by default. Specify for example `null`, + * to clearly see entries that are not explicitly + * set. + * @return {Array} array The resized array + */ +export function resize(array, size, defaultValue) { + // check the type of the arguments + if (!Array.isArray(size)) { + throw new TypeError('Array expected'); + } + if (size.length === 0) { + throw new Error('Resizing to scalar is not supported'); + } + + // check whether size contains positive integers + size.forEach(function (value) { + if (!isNumber(value) || !isInteger(value) || value < 0) { + throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')'); + } + }); + + // convert number to an array + if (isNumber(array) || isBigNumber(array)) { + array = [array]; + } + + // recursively resize the array + var _defaultValue = defaultValue !== undefined ? defaultValue : 0; + _resize(array, size, 0, _defaultValue); + return array; +} + +/** + * Recursively resize a multi dimensional array + * @param {Array} array Array to be resized + * @param {number[]} size Array with the size of each dimension + * @param {number} dim Current dimension + * @param {*} [defaultValue] Value to be filled in in new entries, + * undefined by default. + * @private + */ +function _resize(array, size, dim, defaultValue) { + var i; + var elem; + var oldLen = array.length; + var newLen = size[dim]; + var minLen = Math.min(oldLen, newLen); + + // apply new length + array.length = newLen; + if (dim < size.length - 1) { + // non-last dimension + var dimNext = dim + 1; + + // resize existing child arrays + for (i = 0; i < minLen; i++) { + // resize child array + elem = array[i]; + if (!Array.isArray(elem)) { + elem = [elem]; // add a dimension + array[i] = elem; + } + _resize(elem, size, dimNext, defaultValue); + } + + // create new child arrays + for (i = minLen; i < newLen; i++) { + // get child array + elem = []; + array[i] = elem; + + // resize new child array + _resize(elem, size, dimNext, defaultValue); + } + } else { + // last dimension + + // remove dimensions of existing values + for (i = 0; i < minLen; i++) { + while (Array.isArray(array[i])) { + array[i] = array[i][0]; + } + } + + // fill new elements with the default value + for (i = minLen; i < newLen; i++) { + array[i] = defaultValue; + } + } +} + +/** + * Re-shape a multi dimensional array to fit the specified dimensions + * @param {Array} array Array to be reshaped + * @param {number[]} sizes List of sizes for each dimension + * @returns {Array} Array whose data has been formatted to fit the + * specified dimensions + * + * @throws {DimensionError} If the product of the new dimension sizes does + * not equal that of the old ones + */ +export function reshape(array, sizes) { + var flatArray = flatten(array); + var currentLength = flatArray.length; + if (!Array.isArray(array) || !Array.isArray(sizes)) { + throw new TypeError('Array expected'); + } + if (sizes.length === 0) { + throw new DimensionError(0, currentLength, '!='); + } + sizes = processSizesWildcard(sizes, currentLength); + var newLength = product(sizes); + if (currentLength !== newLength) { + throw new DimensionError(newLength, currentLength, '!='); + } + try { + return _reshape(flatArray, sizes); + } catch (e) { + if (e instanceof DimensionError) { + throw new DimensionError(newLength, currentLength, '!='); + } + throw e; + } +} + +/** + * Replaces the wildcard -1 in the sizes array. + * @param {number[]} sizes List of sizes for each dimension. At most on wildcard. + * @param {number} currentLength Number of elements in the array. + * @throws {Error} If more than one wildcard or unable to replace it. + * @returns {number[]} The sizes array with wildcard replaced. + */ +export function processSizesWildcard(sizes, currentLength) { + var newLength = product(sizes); + var processedSizes = sizes.slice(); + var WILDCARD = -1; + var wildCardIndex = sizes.indexOf(WILDCARD); + var isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0; + if (isMoreThanOneWildcard) { + throw new Error('More than one wildcard in sizes'); + } + var hasWildcard = wildCardIndex >= 0; + var canReplaceWildcard = currentLength % newLength === 0; + if (hasWildcard) { + if (canReplaceWildcard) { + processedSizes[wildCardIndex] = -currentLength / newLength; + } else { + throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength); + } + } + return processedSizes; +} + +/** + * Computes the product of all array elements. + * @param {number[]} array Array of factors + * @returns {number} Product of all elements + */ +function product(array) { + return array.reduce((prev, curr) => prev * curr, 1); +} + +/** + * Iteratively re-shape a multi dimensional array to fit the specified dimensions + * @param {Array} array Array to be reshaped + * @param {number[]} sizes List of sizes for each dimension + * @returns {Array} Array whose data has been formatted to fit the + * specified dimensions + */ + +function _reshape(array, sizes) { + // testing if there are enough elements for the requested shape + var tmpArray = array; + var tmpArray2; + // for each dimensions starting by the last one and ignoring the first one + for (var sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) { + var size = sizes[sizeIndex]; + tmpArray2 = []; + + // aggregate the elements of the current tmpArray in elements of the requested size + var length = tmpArray.length / size; + for (var i = 0; i < length; i++) { + tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size)); + } + // set it as the new tmpArray for the next loop turn or for return + tmpArray = tmpArray2; + } + return tmpArray; +} + +/** + * Squeeze a multi dimensional array + * @param {Array} array + * @param {Array} [size] + * @returns {Array} returns the array itself + */ +export function squeeze(array, size) { + var s = size || arraySize(array); + + // squeeze outer dimensions + while (Array.isArray(array) && array.length === 1) { + array = array[0]; + s.shift(); + } + + // find the first dimension to be squeezed + var dims = s.length; + while (s[dims - 1] === 1) { + dims--; + } + + // squeeze inner dimensions + if (dims < s.length) { + array = _squeeze(array, dims, 0); + s.length = dims; + } + return array; +} + +/** + * Recursively squeeze a multi dimensional array + * @param {Array} array + * @param {number} dims Required number of dimensions + * @param {number} dim Current dimension + * @returns {Array | *} Returns the squeezed array + * @private + */ +function _squeeze(array, dims, dim) { + var i, ii; + if (dim < dims) { + var next = dim + 1; + for (i = 0, ii = array.length; i < ii; i++) { + array[i] = _squeeze(array[i], dims, next); + } + } else { + while (Array.isArray(array)) { + array = array[0]; + } + } + return array; +} + +/** + * Unsqueeze a multi dimensional array: add dimensions when missing + * + * Paramter `size` will be mutated to match the new, unqueezed matrix size. + * + * @param {Array} array + * @param {number} dims Desired number of dimensions of the array + * @param {number} [outer] Number of outer dimensions to be added + * @param {Array} [size] Current size of array. + * @returns {Array} returns the array itself + * @private + */ +export function unsqueeze(array, dims, outer, size) { + var s = size || arraySize(array); + + // unsqueeze outer dimensions + if (outer) { + for (var i = 0; i < outer; i++) { + array = [array]; + s.unshift(1); + } + } + + // unsqueeze inner dimensions + array = _unsqueeze(array, dims, 0); + while (s.length < dims) { + s.push(1); + } + return array; +} + +/** + * Recursively unsqueeze a multi dimensional array + * @param {Array} array + * @param {number} dims Required number of dimensions + * @param {number} dim Current dimension + * @returns {Array | *} Returns the squeezed array + * @private + */ +function _unsqueeze(array, dims, dim) { + var i, ii; + if (Array.isArray(array)) { + var next = dim + 1; + for (i = 0, ii = array.length; i < ii; i++) { + array[i] = _unsqueeze(array[i], dims, next); + } + } else { + for (var d = dim; d < dims; d++) { + array = [array]; + } + } + return array; +} +/** + * Flatten a multi dimensional array, put all elements in a one dimensional + * array + * @param {Array} array A multi dimensional array + * @return {Array} The flattened array (1 dimensional) + */ +export function flatten(array) { + if (!Array.isArray(array)) { + // if not an array, return as is + return array; + } + var flat = []; + array.forEach(function callback(value) { + if (Array.isArray(value)) { + value.forEach(callback); // traverse through sub-arrays recursively + } else { + flat.push(value); + } + }); + return flat; +} + +/** + * A safe map + * @param {Array} array + * @param {function} callback + */ +export function map(array, callback) { + return Array.prototype.map.call(array, callback); +} + +/** + * A safe forEach + * @param {Array} array + * @param {function} callback + */ +export function forEach(array, callback) { + Array.prototype.forEach.call(array, callback); +} + +/** + * A safe filter + * @param {Array} array + * @param {function} callback + */ +export function filter(array, callback) { + if (arraySize(array).length !== 1) { + throw new Error('Only one dimensional matrices supported'); + } + return Array.prototype.filter.call(array, callback); +} + +/** + * Filter values in a callback given a regular expression + * @param {Array} array + * @param {RegExp} regexp + * @return {Array} Returns the filtered array + * @private + */ +export function filterRegExp(array, regexp) { + if (arraySize(array).length !== 1) { + throw new Error('Only one dimensional matrices supported'); + } + return Array.prototype.filter.call(array, entry => regexp.test(entry)); +} + +/** + * A safe join + * @param {Array} array + * @param {string} separator + */ +export function join(array, separator) { + return Array.prototype.join.call(array, separator); +} + +/** + * Assign a numeric identifier to every element of a sorted array + * @param {Array} a An array + * @return {Array} An array of objects containing the original value and its identifier + */ +export function identify(a) { + if (!Array.isArray(a)) { + throw new TypeError('Array input expected'); + } + if (a.length === 0) { + return a; + } + var b = []; + var count = 0; + b[0] = { + value: a[0], + identifier: 0 + }; + for (var i = 1; i < a.length; i++) { + if (a[i] === a[i - 1]) { + count++; + } else { + count = 0; + } + b.push({ + value: a[i], + identifier: count + }); + } + return b; +} + +/** + * Remove the numeric identifier from the elements + * @param {array} a An array + * @return {array} An array of values without identifiers + */ +export function generalize(a) { + if (!Array.isArray(a)) { + throw new TypeError('Array input expected'); + } + if (a.length === 0) { + return a; + } + var b = []; + for (var i = 0; i < a.length; i++) { + b.push(a[i].value); + } + return b; +} + +/** + * Check the datatype of a given object + * This is a low level implementation that should only be used by + * parent Matrix classes such as SparseMatrix or DenseMatrix + * This method does not validate Array Matrix shape + * @param {Array} array + * @param {function} typeOf Callback function to use to determine the type of a value + * @return {string} + */ +export function getArrayDataType(array, typeOf) { + var type; // to hold type info + var length = 0; // to hold length value to ensure it has consistent sizes + + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var _isArray = Array.isArray(item); + + // Saving the target matrix row size + if (i === 0 && _isArray) { + length = item.length; + } + + // If the current item is an array but the length does not equal the targetVectorSize + if (_isArray && item.length !== length) { + return undefined; + } + var itemType = _isArray ? getArrayDataType(item, typeOf) // recurse into a nested array + : typeOf(item); + if (type === undefined) { + type = itemType; // first item + } else if (type !== itemType) { + return 'mixed'; + } else { + // we're good, everything has the same type so far + } + } + return type; +} + +/** + * Return the last item from an array + * @param {array} + * @returns {*} + */ +export function last(array) { + return array[array.length - 1]; +} + +/** + * Get all but the last element of array. + * @param {array} + * @returns {*} + */ +export function initial(array) { + return array.slice(0, array.length - 1); +} + +/** + * Recursively concatenate two matrices. + * The contents of the matrices is not cloned. + * @param {Array} a Multi dimensional array + * @param {Array} b Multi dimensional array + * @param {number} concatDim The dimension on which to concatenate (zero-based) + * @param {number} dim The current dim (zero-based) + * @return {Array} c The concatenated matrix + * @private + */ +function concatRecursive(a, b, concatDim, dim) { + if (dim < concatDim) { + // recurse into next dimension + if (a.length !== b.length) { + throw new DimensionError(a.length, b.length); + } + var c = []; + for (var i = 0; i < a.length; i++) { + c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1); + } + return c; + } else { + // concatenate this dimension + return a.concat(b); + } +} + +/** + * Concatenates many arrays in the specified direction + * @param {...Array} arrays All the arrays to concatenate + * @param {number} concatDim The dimension on which to concatenate (zero-based) + * @returns +*/ +export function concat() { + var arrays = Array.prototype.slice.call(arguments, 0, -1); + var concatDim = Array.prototype.slice.call(arguments, -1); + if (arrays.length === 1) { + return arrays[0]; + } + if (arrays.length > 1) { + return arrays.slice(1).reduce(function (A, B) { + return concatRecursive(A, B, concatDim, 0); + }, arrays[0]); + } else { + throw new Error('Wrong number of arguments in function concat'); + } +} + +/** + * Receives two or more sizes and get's the broadcasted size for both. + * @param {...number[]} sizes Sizes to broadcast together + * @returns + */ +export function broadcastSizes() { + for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) { + sizes[_key] = arguments[_key]; + } + var dimensions = sizes.map(s => s.length); + var N = Math.max(...dimensions); + var sizeMax = new Array(N).fill(null); + // check for every size + for (var i = 0; i < sizes.length; i++) { + var size = sizes[i]; + var dim = dimensions[i]; + for (var j = 0; j < dim; j++) { + var n = N - dim + j; + if (size[j] > sizeMax[n]) { + sizeMax[n] = size[j]; + } + } + } + for (var _i = 0; _i < sizes.length; _i++) { + checkBroadcastingRules(sizes[_i], sizeMax); + } + return sizeMax; +} + +/** + * Checks if it's possible to broadcast a size to another size + * @param {number[]} size The size of the array to check + * @param {number[]} toSize The size of the array to validate if it can be broadcasted to + */ +export function checkBroadcastingRules(size, toSize) { + var N = toSize.length; + var dim = size.length; + for (var j = 0; j < dim; j++) { + var n = N - dim + j; + if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) { + throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(size, ") not possible to broadcast dimension ").concat(dim, " with size ").concat(size[j], " to size ").concat(toSize[n])); + } + } +} + +/** + * Broadcasts a single array to a certain size + * @param {array} array Array to be broadcasted + * @param {number[]} toSize Size to broadcast the array + * @returns The broadcasted array + */ +export function broadcastTo(array, toSize) { + var Asize = arraySize(array); + if (deepStrictEqual(Asize, toSize)) { + return array; + } + checkBroadcastingRules(Asize, toSize); + var broadcastedSize = broadcastSizes(Asize, toSize); + var N = broadcastedSize.length; + var paddedSize = [...Array(N - Asize.length).fill(1), ...Asize]; + var A = clone(array); + // reshape A if needed to make it ready for concat + if (Asize.length < N) { + A = reshape(A, paddedSize); + Asize = arraySize(A); + } + + // stretches the array on each dimension to make it the same size as index + for (var dim = 0; dim < N; dim++) { + if (Asize[dim] < broadcastedSize[dim]) { + A = stretch(A, broadcastedSize[dim], dim); + Asize = arraySize(A); + } + } + return A; +} + +/** + * Broadcasts arrays and returns the broadcasted arrays in an array + * @param {...Array | any} arrays + * @returns + */ +export function broadcastArrays() { + for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + arrays[_key2] = arguments[_key2]; + } + if (arrays.length === 0) { + throw new Error('Insuficient number of argumnets in function broadcastArrays'); + } + if (arrays.length === 1) { + return arrays[0]; + } + var sizes = arrays.map(function (array) { + return arraySize(array); + }); + var broadcastedSize = broadcastSizes(...sizes); + var broadcastedArrays = []; + arrays.forEach(function (array) { + broadcastedArrays.push(broadcastTo(array, broadcastedSize)); + }); + return broadcastedArrays; +} + +/** + * stretches a matrix up to a certain size in a certain dimension + * @param {Array} arrayToStretch + * @param {number[]} sizeToStretch + * @param {number} dimToStretch + * @returns + */ +export function stretch(arrayToStretch, sizeToStretch, dimToStretch) { + return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch); +} + +/** +* Retrieves a single element from an array given an index. +* +* @param {Array} array - The array from which to retrieve the value. +* @param {Array} idx - An array of indices specifying the position of the desired element in each dimension. +* @returns {*} - The value at the specified position in the array. +* +* @example +* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]; +* const index = [1, 0, 1]; +* console.log(getValue(arr, index)); // 6 +*/ +export function get(array, index) { + if (!Array.isArray(array)) { + throw new Error('Array expected'); + } + var size = arraySize(array); + if (index.length !== size.length) { + throw new DimensionError(index.length, size.length); + } + for (var x = 0; x < index.length; x++) { + validateIndex(index[x], size[x]); + } + return index.reduce((acc, curr) => acc[curr], array); +} + +/** + * Recursive function to map a multi-dimensional array. + * + * @param {*} value - The current value being processed in the array. + * @param {Array} index - The index of the current value being processed in the array. + * @param {Array} array - The array being processed. + * @param {Function} callback - Function that produces the element of the new Array, taking three arguments: the value of the element, the index of the element, and the Array being processed. + * @returns {*} The new array with each element being the result of the callback function. + */ +export function recurse(value, index, array, callback) { + if (Array.isArray(value)) { + return value.map(function (child, i) { + // we create a copy of the index array and append the new index value + return recurse(child, index.concat(i), array, callback); + }); + } else { + // invoke the callback function with the right number of arguments + return callback(value, index, array); + } +} + +/** + * Deep clones a multidimensional array + * @param {Array} array + * @returns cloned array + */ +export function clone(array) { + return _extends([], array); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js new file mode 100644 index 0000000..dbcc60c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js @@ -0,0 +1,399 @@ +/** + * Bitwise and for Bignumbers + * + * Special Cases: + * N & n = N + * n & 0 = 0 + * n & -1 = n + * n & n = n + * I & I = I + * -I & -I = -I + * I & -I = 0 + * I & n = n + * I & -n = I + * -I & n = 0 + * -I & -n = -I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` & `y`, is fully precise + * @private + */ +export function bitAndBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitAnd'); + } + var BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.eq(-1) || x.eq(y)) { + return x; + } + if (y.isZero() || x.eq(-1)) { + return y; + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !y.isFinite()) { + if (x.isNegative() === y.isNegative()) { + return x; + } + return new BigNumber(0); + } + if (!x.isFinite()) { + if (y.isNegative()) { + return x; + } + if (x.isNegative()) { + return new BigNumber(0); + } + return y; + } + if (!y.isFinite()) { + if (x.isNegative()) { + return y; + } + if (y.isNegative()) { + return new BigNumber(0); + } + return x; + } + } + return bitwise(x, y, function (a, b) { + return a & b; + }); +} + +/** + * Bitwise not + * @param {BigNumber} x + * @return {BigNumber} Result of ~`x`, fully precise + * + */ +export function bitNotBigNumber(x) { + if (x.isFinite() && !x.isInteger()) { + throw new Error('Integer expected in function bitNot'); + } + var BigNumber = x.constructor; + var prevPrec = BigNumber.precision; + BigNumber.config({ + precision: 1E9 + }); + var result = x.plus(new BigNumber(1)); + result.s = -result.s || null; + BigNumber.config({ + precision: prevPrec + }); + return result; +} + +/** + * Bitwise OR for BigNumbers + * + * Special Cases: + * N | n = N + * n | 0 = n + * n | -1 = -1 + * n | n = n + * I | I = I + * -I | -I = -I + * I | -n = -1 + * I | -I = -1 + * I | n = I + * -I | n = -I + * -I | -n = -n + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` | `y`, fully precise + */ +export function bitOrBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitOr'); + } + var BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + var negOne = new BigNumber(-1); + if (x.isZero() || y.eq(negOne) || x.eq(y)) { + return y; + } + if (y.isZero() || x.eq(negOne)) { + return x; + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) { + return negOne; + } + if (x.isNegative() && y.isNegative()) { + return x.isFinite() ? x : y; + } + return x.isFinite() ? y : x; + } + return bitwise(x, y, function (a, b) { + return a | b; + }); +} + +/** + * Applies bitwise function to numbers + * @param {BigNumber} x + * @param {BigNumber} y + * @param {function (a, b)} func + * @return {BigNumber} + */ +export function bitwise(x, y, func) { + var BigNumber = x.constructor; + var xBits, yBits; + var xSign = +(x.s < 0); + var ySign = +(y.s < 0); + if (xSign) { + xBits = decCoefficientToBinaryString(bitNotBigNumber(x)); + for (var i = 0; i < xBits.length; ++i) { + xBits[i] ^= 1; + } + } else { + xBits = decCoefficientToBinaryString(x); + } + if (ySign) { + yBits = decCoefficientToBinaryString(bitNotBigNumber(y)); + for (var _i = 0; _i < yBits.length; ++_i) { + yBits[_i] ^= 1; + } + } else { + yBits = decCoefficientToBinaryString(y); + } + var minBits, maxBits, minSign; + if (xBits.length <= yBits.length) { + minBits = xBits; + maxBits = yBits; + minSign = xSign; + } else { + minBits = yBits; + maxBits = xBits; + minSign = ySign; + } + var shortLen = minBits.length; + var longLen = maxBits.length; + var expFuncVal = func(xSign, ySign) ^ 1; + var outVal = new BigNumber(expFuncVal ^ 1); + var twoPower = new BigNumber(1); + var two = new BigNumber(2); + var prevPrec = BigNumber.precision; + BigNumber.config({ + precision: 1E9 + }); + while (shortLen > 0) { + if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) { + outVal = outVal.plus(twoPower); + } + twoPower = twoPower.times(two); + } + while (longLen > 0) { + if (func(minSign, maxBits[--longLen]) === expFuncVal) { + outVal = outVal.plus(twoPower); + } + twoPower = twoPower.times(two); + } + BigNumber.config({ + precision: prevPrec + }); + if (expFuncVal === 0) { + outVal.s = -outVal.s; + } + return outVal; +} + +/* Extracted from decimal.js, and edited to specialize. */ +function decCoefficientToBinaryString(x) { + // Convert to string + var a = x.d; // array with digits + var r = a[0] + ''; + for (var i = 1; i < a.length; ++i) { + var s = a[i] + ''; + for (var z = 7 - s.length; z--;) { + s = '0' + s; + } + r += s; + } + var j = r.length; + while (r.charAt(j) === '0') { + j--; + } + var xe = x.e; + var str = r.slice(0, j + 1 || 1); + var strL = str.length; + if (xe > 0) { + if (++xe > strL) { + // Append zeros. + xe -= strL; + while (xe--) { + str += '0'; + } + } else if (xe < strL) { + str = str.slice(0, xe) + '.' + str.slice(xe); + } + } + + // Convert from base 10 (decimal) to base 2 + var arr = [0]; + for (var _i2 = 0; _i2 < str.length;) { + var arrL = arr.length; + while (arrL--) { + arr[arrL] *= 10; + } + arr[0] += parseInt(str.charAt(_i2++)); // convert to int + for (var _j = 0; _j < arr.length; ++_j) { + if (arr[_j] > 1) { + if (arr[_j + 1] === null || arr[_j + 1] === undefined) { + arr[_j + 1] = 0; + } + arr[_j + 1] += arr[_j] >> 1; + arr[_j] &= 1; + } + } + } + return arr.reverse(); +} + +/** + * Bitwise XOR for BigNumbers + * + * Special Cases: + * N ^ n = N + * n ^ 0 = n + * n ^ n = 0 + * n ^ -1 = ~n + * I ^ n = I + * I ^ -n = -I + * I ^ -I = -1 + * -I ^ n = -I + * -I ^ -n = I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` ^ `y`, fully precise + * + */ +export function bitXor(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function bitXor'); + } + var BigNumber = x.constructor; + if (x.isNaN() || y.isNaN()) { + return new BigNumber(NaN); + } + if (x.isZero()) { + return y; + } + if (y.isZero()) { + return x; + } + if (x.eq(y)) { + return new BigNumber(0); + } + var negOne = new BigNumber(-1); + if (x.eq(negOne)) { + return bitNotBigNumber(y); + } + if (y.eq(negOne)) { + return bitNotBigNumber(x); + } + if (!x.isFinite() || !y.isFinite()) { + if (!x.isFinite() && !y.isFinite()) { + return negOne; + } + return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity); + } + return bitwise(x, y, function (a, b) { + return a ^ b; + }); +} + +/** + * Bitwise left shift + * + * Special Cases: + * n << -n = N + * n << N = N + * N << n = N + * n << 0 = n + * 0 << n = 0 + * I << I = N + * I << n = I + * n << I = I + * + * @param {BigNumber} x + * @param {BigNumber} y + * @return {BigNumber} Result of `x` << `y` + * + */ +export function leftShiftBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function leftShift'); + } + var BigNumber = x.constructor; + if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.isZero()) { + return x; + } + if (!x.isFinite() && !y.isFinite()) { + return new BigNumber(NaN); + } + + // Math.pow(2, y) is fully precise for y < 55, and fast + if (y.lt(55)) { + return x.times(Math.pow(2, y.toNumber()) + ''); + } + return x.times(new BigNumber(2).pow(y)); +} + +/* + * Special Cases: + * n >> -n = N + * n >> N = N + * N >> n = N + * I >> I = N + * n >> 0 = n + * I >> n = I + * -I >> n = -I + * -I >> I = -I + * n >> I = I + * -n >> I = -1 + * 0 >> n = 0 + * + * @param {BigNumber} value + * @param {BigNumber} value + * @return {BigNumber} Result of `x` >> `y` + * + */ +export function rightArithShiftBigNumber(x, y) { + if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) { + throw new Error('Integers expected in function rightArithShift'); + } + var BigNumber = x.constructor; + if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) { + return new BigNumber(NaN); + } + if (x.isZero() || y.isZero()) { + return x; + } + if (!y.isFinite()) { + if (x.isNegative()) { + return new BigNumber(-1); + } + if (!x.isFinite()) { + return new BigNumber(NaN); + } + return new BigNumber(0); + } + + // Math.pow(2, y) is fully precise for y < 55, and fast + if (y.lt(55)) { + return x.div(Math.pow(2, y.toNumber()) + '').floor(); + } + return x.div(new BigNumber(2).pow(y)).floor(); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/constants.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/constants.js new file mode 100644 index 0000000..aa69b29 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/constants.js @@ -0,0 +1,57 @@ +import { memoize } from '../function.js'; + +/** + * Calculate BigNumber e + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns e + */ +export var createBigNumberE = memoize(function (BigNumber) { + return new BigNumber(1).exp(); +}, { + hasher +}); + +/** + * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2 + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns phi + */ +export var createBigNumberPhi = memoize(function (BigNumber) { + return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2); +}, { + hasher +}); + +/** + * Calculate BigNumber pi. + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns pi + */ +export var createBigNumberPi = memoize(function (BigNumber) { + return BigNumber.acos(-1); +}, { + hasher +}); + +/** + * Calculate BigNumber tau, tau = 2 * pi + * @param {function} BigNumber BigNumber constructor + * @returns {BigNumber} Returns tau + */ +export var createBigNumberTau = memoize(function (BigNumber) { + return createBigNumberPi(BigNumber).times(2); +}, { + hasher +}); + +/** + * Create a hash for a BigNumber constructor function. The created has is + * the configured precision + * @param {Array} args Supposed to contain a single entry with + * a BigNumber constructor + * @return {number} precision + * @private + */ +function hasher(args) { + return args[0].precision; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js new file mode 100644 index 0000000..d7d3adf --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js @@ -0,0 +1,243 @@ +import { isBigNumber, isNumber } from '../is.js'; +import { isInteger, normalizeFormatOptions } from '../number.js'; + +/** + * Formats a BigNumber in a given base + * @param {BigNumber} n + * @param {number} base + * @param {number} size + * @returns {string} + */ +function formatBigNumberToBase(n, base, size) { + var BigNumberCtor = n.constructor; + var big2 = new BigNumberCtor(2); + var suffix = ''; + if (size) { + if (size < 1) { + throw new Error('size must be in greater than 0'); + } + if (!isInteger(size)) { + throw new Error('size must be an integer'); + } + if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) { + throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]")); + } + if (!n.isInteger()) { + throw new Error('Value must be an integer'); + } + if (n.lessThan(0)) { + n = n.add(big2.pow(size)); + } + suffix = "i".concat(size); + } + switch (base) { + case 2: + return "".concat(n.toBinary()).concat(suffix); + case 8: + return "".concat(n.toOctal()).concat(suffix); + case 16: + return "".concat(n.toHexadecimal()).concat(suffix); + default: + throw new Error("Base ".concat(base, " not supported ")); + } +} + +/** + * Convert a BigNumber to a formatted string representation. + * + * Syntax: + * + * format(value) + * format(value, options) + * format(value, precision) + * format(value, fn) + * + * Where: + * + * {number} value The value to be formatted + * {Object} options An object with formatting options. Available options: + * {string} notation + * Number notation. Choose from: + * 'fixed' Always use regular number notation. + * For example '123.40' and '14000000' + * 'exponential' Always use exponential notation. + * For example '1.234e+2' and '1.4e+7' + * 'auto' (default) Regular number notation for numbers + * having an absolute value between + * `lower` and `upper` bounds, and uses + * exponential notation elsewhere. + * Lower bound is included, upper bound + * is excluded. + * For example '123.4' and '1.4e7'. + * 'bin', 'oct, or + * 'hex' Format the number using binary, octal, + * or hexadecimal notation. + * For example '0b1101' and '0x10fe'. + * {number} wordSize The word size in bits to use for formatting + * in binary, octal, or hexadecimal notation. + * To be used only with 'bin', 'oct', or 'hex' + * values for 'notation' option. When this option + * is defined the value is formatted as a signed + * twos complement integer of the given word size + * and the size suffix is appended to the output. + * For example + * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'. + * Default value is undefined. + * {number} precision A number between 0 and 16 to round + * the digits of the number. + * In case of notations 'exponential', + * 'engineering', and 'auto', + * `precision` defines the total + * number of significant digits returned. + * In case of notation 'fixed', + * `precision` defines the number of + * significant digits after the decimal + * point. + * `precision` is undefined by default. + * {number} lowerExp Exponent determining the lower boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `-3`. + * {number} upperExp Exponent determining the upper boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `5`. + * {Function} fn A custom formatting function. Can be used to override the + * built-in notations. Function `fn` is called with `value` as + * parameter and must return a string. Is useful for example to + * format all values inside a matrix in a particular way. + * + * Examples: + * + * format(6.4) // '6.4' + * format(1240000) // '1.24e6' + * format(1/3) // '0.3333333333333333' + * format(1/3, 3) // '0.333' + * format(21385, 2) // '21000' + * format(12e8, {notation: 'fixed'}) // returns '1200000000' + * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000' + * format(52.8, {notation: 'exponential'}) // returns '5.28e+1' + * format(12400, {notation: 'engineering'}) // returns '12.400e+3' + * + * @param {BigNumber} value + * @param {Object | Function | number | BigNumber} [options] + * @return {string} str The formatted value + */ +export function format(value, options) { + if (typeof options === 'function') { + // handle format(value, fn) + return options(value); + } + + // handle special cases + if (!value.isFinite()) { + return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity'; + } + var { + notation, + precision, + wordSize + } = normalizeFormatOptions(options); + + // handle the various notations + switch (notation) { + case 'fixed': + return toFixed(value, precision); + case 'exponential': + return toExponential(value, precision); + case 'engineering': + return toEngineering(value, precision); + case 'bin': + return formatBigNumberToBase(value, 2, wordSize); + case 'oct': + return formatBigNumberToBase(value, 8, wordSize); + case 'hex': + return formatBigNumberToBase(value, 16, wordSize); + case 'auto': + { + // determine lower and upper bound for exponential notation. + // TODO: implement support for upper and lower to be BigNumbers themselves + var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3); + var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5); + + // handle special case zero + if (value.isZero()) return '0'; + + // determine whether or not to output exponential notation + var str; + var rounded = value.toSignificantDigits(precision); + var exp = rounded.e; + if (exp >= lowerExp && exp < upperExp) { + // normal number notation + str = rounded.toFixed(); + } else { + // exponential notation + str = toExponential(value, precision); + } + + // remove trailing zeros after the decimal point + return str.replace(/((\.\d*?)(0+))($|e)/, function () { + var digits = arguments[2]; + var e = arguments[4]; + return digits !== '.' ? digits + e : e; + }); + } + default: + throw new Error('Unknown notation "' + notation + '". ' + 'Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.'); + } +} + +/** + * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3' + * @param {BigNumber} value + * @param {number} [precision] Optional number of significant figures to return. + */ +export function toEngineering(value, precision) { + // find nearest lower multiple of 3 for exponent + var e = value.e; + var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3; + + // find difference in exponents, and calculate the value without exponent + var valueWithoutExp = value.mul(Math.pow(10, -newExp)); + var valueStr = valueWithoutExp.toPrecision(precision); + if (valueStr.includes('e')) { + var BigNumber = value.constructor; + valueStr = new BigNumber(valueStr).toFixed(); + } + return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString(); +} + +/** + * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3' + * @param {BigNumber} value + * @param {number} [precision] Number of digits in formatted output. + * If not provided, the maximum available digits + * is used. + * @returns {string} str + */ +export function toExponential(value, precision) { + if (precision !== undefined) { + return value.toExponential(precision - 1); // Note the offset of one + } else { + return value.toExponential(); + } +} + +/** + * Format a number with fixed notation. + * @param {BigNumber} value + * @param {number} [precision=undefined] Optional number of decimals after the + * decimal point. Undefined by default. + */ +export function toFixed(value, precision) { + return value.toFixed(precision); +} +function _toNumberOrDefault(value, defaultValue) { + if (isNumber(value)) { + return value; + } else if (isBigNumber(value)) { + return value.toNumber(); + } else { + return defaultValue; + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js new file mode 100644 index 0000000..8e4a455 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js @@ -0,0 +1,39 @@ +/** + * Compares two BigNumbers. + * @param {BigNumber} a - First value to compare + * @param {BigNumber} b - Second value to compare + * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0. + * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0. + * @returns {boolean} whether the two numbers are nearly equal + * @throws {Error} If `relTol` is less than or equal to 0. + * @throws {Error} If `absTol` is less than 0. + * + * @example + * nearlyEqual(1.000000001, 1.0, 1e-9); // true + * nearlyEqual(1.000000002, 1.0, 0); // false + * nearlyEqual(1.0, 1.009, undefined, 0.02); // true + * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true + */ +export function nearlyEqual(a, b) { + var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9; + var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (relTol <= 0) { + throw new Error('Relative tolerance must be greater than 0'); + } + if (absTol < 0) { + throw new Error('Absolute tolerance must be at least 0'); + } + // NaN + if (a.isNaN() || b.isNaN()) { + return false; + } + if (!a.isFinite() || !b.isFinite()) { + return a.eq(b); + } + // use "==" operator, handles infinities + if (a.eq(b)) { + return true; + } + // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol) + return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol)); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/collection.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/collection.js new file mode 100644 index 0000000..040c8c3 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/collection.js @@ -0,0 +1,177 @@ +import { isCollection, isMatrix } from './is.js'; +import { IndexError } from '../error/IndexError.js'; +import { arraySize } from './array.js'; +import { _switch } from './switch.js'; + +/** + * Test whether an array contains collections + * @param {Array} array + * @returns {boolean} Returns true when the array contains one or multiple + * collections (Arrays or Matrices). Returns false otherwise. + */ +export function containsCollections(array) { + for (var i = 0; i < array.length; i++) { + if (isCollection(array[i])) { + return true; + } + } + return false; +} + +/** + * Recursively loop over all elements in a given multi dimensional array + * and invoke the callback on each of the elements. + * @param {Array | Matrix} array + * @param {Function} callback The callback method is invoked with one + * parameter: the current element in the array + */ +export function deepForEach(array, callback) { + if (isMatrix(array)) { + array = array.valueOf(); + } + for (var i = 0, ii = array.length; i < ii; i++) { + var value = array[i]; + if (Array.isArray(value)) { + deepForEach(value, callback); + } else { + callback(value); + } + } +} + +/** + * Execute the callback function element wise for each element in array and any + * nested array + * Returns an array with the results + * @param {Array | Matrix} array + * @param {Function} callback The callback is called with two parameters: + * value1 and value2, which contain the current + * element of both arrays. + * @param {boolean} [skipZeros] Invoke callback function for non-zero values only. + * + * @return {Array | Matrix} res + */ +export function deepMap(array, callback, skipZeros) { + if (array && typeof array.map === 'function') { + // TODO: replace array.map with a for loop to improve performance + return array.map(function (x) { + return deepMap(x, callback, skipZeros); + }); + } else { + return callback(array); + } +} + +/** + * Reduce a given matrix or array to a new matrix or + * array with one less dimension, applying the given + * callback in the selected dimension. + * @param {Array | Matrix} mat + * @param {number} dim + * @param {Function} callback + * @return {Array | Matrix} res + */ +export function reduce(mat, dim, callback) { + var size = Array.isArray(mat) ? arraySize(mat) : mat.size(); + if (dim < 0 || dim >= size.length) { + // TODO: would be more clear when throwing a DimensionError here + throw new IndexError(dim, size.length); + } + if (isMatrix(mat)) { + return mat.create(_reduce(mat.valueOf(), dim, callback), mat.datatype()); + } else { + return _reduce(mat, dim, callback); + } +} + +/** + * Recursively reduce a matrix + * @param {Array} mat + * @param {number} dim + * @param {Function} callback + * @returns {Array} ret + * @private + */ +function _reduce(mat, dim, callback) { + var i, ret, val, tran; + if (dim <= 0) { + if (!Array.isArray(mat[0])) { + val = mat[0]; + for (i = 1; i < mat.length; i++) { + val = callback(val, mat[i]); + } + return val; + } else { + tran = _switch(mat); + ret = []; + for (i = 0; i < tran.length; i++) { + ret[i] = _reduce(tran[i], dim - 1, callback); + } + return ret; + } + } else { + ret = []; + for (i = 0; i < mat.length; i++) { + ret[i] = _reduce(mat[i], dim - 1, callback); + } + return ret; + } +} + +// TODO: document function scatter +export function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) { + // a arrays + var avalues = a._values; + var aindex = a._index; + var aptr = a._ptr; + + // vars + var k, k0, k1, i; + + // check we need to process values (pattern matrix) + if (x) { + // values in j + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check value exists in current j + if (w[i] !== mark) { + // i is new entry in j + w[i] = mark; + // add i to pattern of C + cindex.push(i); + // x(i) = A, check we need to call function this time + if (update) { + // copy value to workspace calling callback function + x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]); + // function was called on current row + u[i] = mark; + } else { + // copy value to workspace + x[i] = avalues[k]; + } + } else { + // i exists in C already + x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]); + // function was called on current row + u[i] = mark; + } + } + } else { + // values in j + for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) { + // row + i = aindex[k]; + // check value exists in current j + if (w[i] !== mark) { + // i is new entry in j + w[i] = mark; + // add i to pattern of C + cindex.push(i); + } else { + // indicate function was called on current row + u[i] = mark; + } + } + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/complex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/complex.js new file mode 100644 index 0000000..301c521 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/complex.js @@ -0,0 +1,14 @@ +import { nearlyEqual } from './number.js'; + +/** + * Test whether two complex values are equal provided a given relTol and absTol. + * Does not use or change the global Complex.EPSILON setting + * @param {Complex} x - The first complex number for comparison. + * @param {Complex} y - The second complex number for comparison. + * @param {number} relTol - The relative tolerance for comparison. + * @param {number} absTol - The absolute tolerance for comparison. + * @returns {boolean} - Returns true if the two complex numbers are equal within the given tolerances, otherwise returns false. + */ +export function complexEquals(x, y, relTol, absTol) { + return nearlyEqual(x.re, y.re, relTol, absTol) && nearlyEqual(x.im, y.im, relTol, absTol); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/customs.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/customs.js new file mode 100644 index 0000000..40d18c6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/customs.js @@ -0,0 +1,147 @@ +import { hasOwnProperty } from './object.js'; + +/** + * Get a property of a plain object + * Throws an error in case the object is not a plain object or the + * property is not defined on the object itself + * @param {Object} object + * @param {string} prop + * @return {*} Returns the property value when safe + */ +function getSafeProperty(object, prop) { + // only allow getting safe properties of a plain object + if (isSafeProperty(object, prop)) { + return object[prop]; + } + if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) { + throw new Error('Cannot access method "' + prop + '" as a property'); + } + throw new Error('No access to property "' + prop + '"'); +} + +/** + * Set a property on a plain object. + * Throws an error in case the object is not a plain object or the + * property would override an inherited property like .constructor or .toString + * @param {Object} object + * @param {string} prop + * @param {*} value + * @return {*} Returns the value + */ +// TODO: merge this function into access.js? +function setSafeProperty(object, prop, value) { + // only allow setting safe properties of a plain object + if (isSafeProperty(object, prop)) { + object[prop] = value; + return value; + } + throw new Error('No access to property "' + prop + '"'); +} + +/** + * Test whether a property is safe to use on an object or Array. + * For example .toString and .constructor are not safe + * @param {Object | Array} object + * @param {string} prop + * @return {boolean} Returns true when safe + */ +function isSafeProperty(object, prop) { + if (!isPlainObject(object) && !Array.isArray(object)) { + return false; + } + // SAFE: whitelisted + // e.g length + if (hasOwnProperty(safeNativeProperties, prop)) { + return true; + } + // UNSAFE: inherited from Object prototype + // e.g constructor + if (prop in Object.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Object.prototype is a root object + return false; + } + // UNSAFE: inherited from Function prototype + // e.g call, apply + if (prop in Function.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Function.prototype is a root object + return false; + } + return true; +} + +/** + * Validate whether a method is safe. + * Throws an error when that's not the case. + * @param {Object} object + * @param {string} method + * @return {function} Returns the method when valid + */ +function getSafeMethod(object, method) { + if (!isSafeMethod(object, method)) { + throw new Error('No access to method "' + method + '"'); + } + return object[method]; +} + +/** + * Check whether a method is safe. + * Throws an error when that's not the case (for example for `constructor`). + * @param {Object} object + * @param {string} method + * @return {boolean} Returns true when safe, false otherwise + */ +function isSafeMethod(object, method) { + if (object === null || object === undefined || typeof object[method] !== 'function') { + return false; + } + // UNSAFE: ghosted + // e.g overridden toString + // Note that IE10 doesn't support __proto__ and we can't do this check there. + if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) { + return false; + } + // SAFE: whitelisted + // e.g toString + if (hasOwnProperty(safeNativeMethods, method)) { + return true; + } + // UNSAFE: inherited from Object prototype + // e.g constructor + if (method in Object.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Object.prototype is a root object + return false; + } + // UNSAFE: inherited from Function prototype + // e.g call, apply + if (method in Function.prototype) { + // 'in' is used instead of hasOwnProperty for nodejs v0.10 + // which is inconsistent on root prototypes. It is safe + // here because Function.prototype is a root object + return false; + } + return true; +} +function isPlainObject(object) { + return typeof object === 'object' && object && object.constructor === Object; +} +var safeNativeProperties = { + length: true, + name: true +}; +var safeNativeMethods = { + toString: true, + valueOf: true, + toLocaleString: true +}; +export { getSafeProperty }; +export { setSafeProperty }; +export { isSafeProperty }; +export { getSafeMethod }; +export { isSafeMethod }; +export { isPlainObject }; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/emitter.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/emitter.js new file mode 100644 index 0000000..d9c1fca --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/emitter.js @@ -0,0 +1,18 @@ +import Emitter from 'tiny-emitter'; + +/** + * Extend given object with emitter functions `on`, `off`, `once`, `emit` + * @param {Object} obj + * @return {Object} obj + */ +export function mixin(obj) { + // create event emitter + var emitter = new Emitter(); + + // bind methods to obj (we don't want to expose the emitter.e Array...) + obj.on = emitter.on.bind(emitter); + obj.off = emitter.off.bind(emitter); + obj.once = emitter.once.bind(emitter); + obj.emit = emitter.emit.bind(emitter); + return obj; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/factory.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/factory.js new file mode 100644 index 0000000..0e0a25c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/factory.js @@ -0,0 +1,126 @@ +import { pickShallow } from './object.js'; + +/** + * Create a factory function, which can be used to inject dependencies. + * + * The created functions are memoized, a consecutive call of the factory + * with the exact same inputs will return the same function instance. + * The memoized cache is exposed on `factory.cache` and can be cleared + * if needed. + * + * Example: + * + * const name = 'log' + * const dependencies = ['config', 'typed', 'divideScalar', 'Complex'] + * + * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => { + * // ... create the function log here and return it + * } + * + * @param {string} name Name of the function to be created + * @param {string[]} dependencies The names of all required dependencies + * @param {function} create Callback function called with an object with all dependencies + * @param {Object} [meta] Optional object with meta information that will be attached + * to the created factory function as property `meta`. + * @returns {function} + */ +export function factory(name, dependencies, create, meta) { + function assertAndCreate(scope) { + // we only pass the requested dependencies to the factory function + // to prevent functions to rely on dependencies that are not explicitly + // requested. + var deps = pickShallow(scope, dependencies.map(stripOptionalNotation)); + assertDependencies(name, dependencies, scope); + return create(deps); + } + assertAndCreate.isFactory = true; + assertAndCreate.fn = name; + assertAndCreate.dependencies = dependencies.slice().sort(); + if (meta) { + assertAndCreate.meta = meta; + } + return assertAndCreate; +} + +/** + * Sort all factories such that when loading in order, the dependencies are resolved. + * + * @param {Array} factories + * @returns {Array} Returns a new array with the sorted factories. + */ +export function sortFactories(factories) { + var factoriesByName = {}; + factories.forEach(factory => { + factoriesByName[factory.fn] = factory; + }); + function containsDependency(factory, dependency) { + // TODO: detect circular references + if (isFactory(factory)) { + if (factory.dependencies.includes(dependency.fn || dependency.name)) { + return true; + } + if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) { + return true; + } + } + return false; + } + var sorted = []; + function addFactory(factory) { + var index = 0; + while (index < sorted.length && !containsDependency(sorted[index], factory)) { + index++; + } + sorted.splice(index, 0, factory); + } + + // sort regular factory functions + factories.filter(isFactory).forEach(addFactory); + + // sort legacy factory functions AFTER the regular factory functions + factories.filter(factory => !isFactory(factory)).forEach(addFactory); + return sorted; +} + +// TODO: comment or cleanup if unused in the end +export function create(factories) { + var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + sortFactories(factories).forEach(factory => factory(scope)); + return scope; +} + +/** + * Test whether an object is a factory. This is the case when it has + * properties name, dependencies, and a function create. + * @param {*} obj + * @returns {boolean} + */ +export function isFactory(obj) { + return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies); +} + +/** + * Assert that all dependencies of a list with dependencies are available in the provided scope. + * + * Will throw an exception when there are dependencies missing. + * + * @param {string} name Name for the function to be created. Used to generate a useful error message + * @param {string[]} dependencies + * @param {Object} scope + */ +export function assertDependencies(name, dependencies, scope) { + var allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals + .every(dependency => scope[dependency] !== undefined); + if (!allDefined) { + var missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined); + + // TODO: create a custom error class for this, a MathjsError or something like that + throw new Error("Cannot create function \"".concat(name, "\", ") + "some dependencies are missing: ".concat(missingDependencies.map(d => "\"".concat(d, "\"")).join(', '), ".")); + } +} +export function isOptionalDependency(dependency) { + return dependency && dependency[0] === '?'; +} +export function stripOptionalNotation(dependency) { + return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/function.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/function.js new file mode 100644 index 0000000..c217b49 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/function.js @@ -0,0 +1,86 @@ +// function utils + +import { lruQueue } from './lruQueue.js'; + +/** + * Memoize a given function by caching the computed result. + * The cache of a memoized function can be cleared by deleting the `cache` + * property of the function. + * + * @param {function} fn The function to be memoized. + * Must be a pure function. + * @param {Object} [options] + * @param {function(args: Array): string} [options.hasher] + * A custom hash builder. Is JSON.stringify by default. + * @param {number | undefined} [options.limit] + * Maximum number of values that may be cached. Undefined indicates + * unlimited (default) + * @return {function} Returns the memoized function + */ +export function memoize(fn) { + var { + hasher, + limit + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + limit = limit == null ? Number.POSITIVE_INFINITY : limit; + hasher = hasher == null ? JSON.stringify : hasher; + return function memoize() { + if (typeof memoize.cache !== 'object') { + memoize.cache = { + values: new Map(), + lru: lruQueue(limit || Number.POSITIVE_INFINITY) + }; + } + var args = []; + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + var hash = hasher(args); + if (memoize.cache.values.has(hash)) { + memoize.cache.lru.hit(hash); + return memoize.cache.values.get(hash); + } + var newVal = fn.apply(fn, args); + memoize.cache.values.set(hash, newVal); + memoize.cache.values.delete(memoize.cache.lru.hit(hash)); + return newVal; + }; +} + +/** + * Memoize a given function by caching all results and the arguments, + * and comparing against the arguments of previous results before + * executing again. + * This is less performant than `memoize` which calculates a hash, + * which is very fast to compare. Use `memoizeCompare` only when it is + * not possible to create a unique serializable hash from the function + * arguments. + * The isEqual function must compare two sets of arguments + * and return true when equal (can be a deep equality check for example). + * @param {function} fn + * @param {function(a: *, b: *) : boolean} isEqual + * @returns {function} + */ +export function memoizeCompare(fn, isEqual) { + var memoize = function memoize() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + for (var c = 0; c < memoize.cache.length; c++) { + var cached = memoize.cache[c]; + if (isEqual(args, cached.args)) { + // TODO: move this cache entry to the top so recently used entries move up? + return cached.res; + } + } + var res = fn.apply(fn, args); + memoize.cache.unshift({ + args, + res + }); + return res; + }; + memoize.cache = []; + return memoize; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/is.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/is.js new file mode 100644 index 0000000..b0ac39b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/is.js @@ -0,0 +1,195 @@ +// type checks for all known types +// +// note that: +// +// - check by duck-typing on a property like `isUnit`, instead of checking instanceof. +// instanceof cannot be used because that would not allow to pass data from +// one instance of math.js to another since each has it's own instance of Unit. +// - check the `isUnit` property via the constructor, so there will be no +// matches for "fake" instances like plain objects with a property `isUnit`. +// That is important for security reasons. +// - It must not be possible to override the type checks used internally, +// for security reasons, so these functions are not exposed in the expression +// parser. + +import { ObjectWrappingMap } from './map.js'; +export function isNumber(x) { + return typeof x === 'number'; +} +export function isBigNumber(x) { + if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') { + return false; + } + if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) { + return true; + } + if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) { + return true; + } + return false; +} +export function isBigInt(x) { + return typeof x === 'bigint'; +} +export function isComplex(x) { + return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false; +} +export function isFraction(x) { + return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false; +} +export function isUnit(x) { + return x && x.constructor.prototype.isUnit === true || false; +} +export function isString(x) { + return typeof x === 'string'; +} +export var isArray = Array.isArray; +export function isMatrix(x) { + return x && x.constructor.prototype.isMatrix === true || false; +} + +/** + * Test whether a value is a collection: an Array or Matrix + * @param {*} x + * @returns {boolean} isCollection + */ +export function isCollection(x) { + return Array.isArray(x) || isMatrix(x); +} +export function isDenseMatrix(x) { + return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false; +} +export function isSparseMatrix(x) { + return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false; +} +export function isRange(x) { + return x && x.constructor.prototype.isRange === true || false; +} +export function isIndex(x) { + return x && x.constructor.prototype.isIndex === true || false; +} +export function isBoolean(x) { + return typeof x === 'boolean'; +} +export function isResultSet(x) { + return x && x.constructor.prototype.isResultSet === true || false; +} +export function isHelp(x) { + return x && x.constructor.prototype.isHelp === true || false; +} +export function isFunction(x) { + return typeof x === 'function'; +} +export function isDate(x) { + return x instanceof Date; +} +export function isRegExp(x) { + return x instanceof RegExp; +} +export function isObject(x) { + return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x)); +} + +/** + * Returns `true` if the passed object appears to be a Map (i.e. duck typing). + * + * Methods looked for are `get`, `set`, `keys` and `has`. + * + * @param {Map | object} object + * @returns + */ +export function isMap(object) { + // We can use the fast instanceof, or a slower duck typing check. + // The duck typing method needs to cover enough methods to not be confused with DenseMatrix. + if (!object) { + return false; + } + return object instanceof Map || object instanceof ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function'; +} +export function isPartitionedMap(object) { + return isMap(object) && isMap(object.a) && isMap(object.b); +} +export function isObjectWrappingMap(object) { + return isMap(object) && isObject(object.wrappedObject); +} +export function isNull(x) { + return x === null; +} +export function isUndefined(x) { + return x === undefined; +} +export function isAccessorNode(x) { + return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false; +} +export function isArrayNode(x) { + return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false; +} +export function isAssignmentNode(x) { + return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false; +} +export function isBlockNode(x) { + return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false; +} +export function isConditionalNode(x) { + return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false; +} +export function isConstantNode(x) { + return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false; +} + +/* Very specialized: returns true for those nodes which in the numerator of + a fraction means that the division in that fraction has precedence over implicit + multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but + 6!/8 x parses as 6! / (8x). It is located here because it is shared between + parse.js and OperatorNode.js (for parsing and printing, respectively). + + This should *not* be exported from mathjs, unlike most of the tests here. + Its name does not start with 'is' to prevent utils/snapshot.js from thinking + it should be exported. +*/ +export function rule2Node(node) { + return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op); +} +export function isFunctionAssignmentNode(x) { + return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false; +} +export function isFunctionNode(x) { + return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false; +} +export function isIndexNode(x) { + return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false; +} +export function isNode(x) { + return x && x.isNode === true && x.constructor.prototype.isNode === true || false; +} +export function isObjectNode(x) { + return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false; +} +export function isOperatorNode(x) { + return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false; +} +export function isParenthesisNode(x) { + return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false; +} +export function isRangeNode(x) { + return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false; +} +export function isRelationalNode(x) { + return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false; +} +export function isSymbolNode(x) { + return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false; +} +export function isChain(x) { + return x && x.constructor.prototype.isChain === true || false; +} +export function typeOf(x) { + var t = typeof x; + if (t === 'object') { + if (x === null) return 'null'; + if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal + if (x.constructor && x.constructor.name) return x.constructor.name; + return 'Object'; // just in case + } + return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ... +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/latex.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/latex.js new file mode 100644 index 0000000..7a9b302 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/latex.js @@ -0,0 +1,487 @@ +/* eslint no-template-curly-in-string: "off" */ + +import escapeLatexLib from 'escape-latex'; +import { hasOwnProperty } from './object.js'; +export var latexSymbols = { + // GREEK LETTERS + Alpha: 'A', + alpha: '\\alpha', + Beta: 'B', + beta: '\\beta', + Gamma: '\\Gamma', + gamma: '\\gamma', + Delta: '\\Delta', + delta: '\\delta', + Epsilon: 'E', + epsilon: '\\epsilon', + varepsilon: '\\varepsilon', + Zeta: 'Z', + zeta: '\\zeta', + Eta: 'H', + eta: '\\eta', + Theta: '\\Theta', + theta: '\\theta', + vartheta: '\\vartheta', + Iota: 'I', + iota: '\\iota', + Kappa: 'K', + kappa: '\\kappa', + varkappa: '\\varkappa', + Lambda: '\\Lambda', + lambda: '\\lambda', + Mu: 'M', + mu: '\\mu', + Nu: 'N', + nu: '\\nu', + Xi: '\\Xi', + xi: '\\xi', + Omicron: 'O', + omicron: 'o', + Pi: '\\Pi', + pi: '\\pi', + varpi: '\\varpi', + Rho: 'P', + rho: '\\rho', + varrho: '\\varrho', + Sigma: '\\Sigma', + sigma: '\\sigma', + varsigma: '\\varsigma', + Tau: 'T', + tau: '\\tau', + Upsilon: '\\Upsilon', + upsilon: '\\upsilon', + Phi: '\\Phi', + phi: '\\phi', + varphi: '\\varphi', + Chi: 'X', + chi: '\\chi', + Psi: '\\Psi', + psi: '\\psi', + Omega: '\\Omega', + omega: '\\omega', + // logic + true: '\\mathrm{True}', + false: '\\mathrm{False}', + // other + i: 'i', + // TODO use \i ?? + inf: '\\infty', + Inf: '\\infty', + infinity: '\\infty', + Infinity: '\\infty', + oo: '\\infty', + lim: '\\lim', + undefined: '\\mathbf{?}' +}; +export var latexOperators = { + transpose: '^\\top', + ctranspose: '^H', + factorial: '!', + pow: '^', + dotPow: '.^\\wedge', + // TODO find ideal solution + unaryPlus: '+', + unaryMinus: '-', + bitNot: '\\~', + // TODO find ideal solution + not: '\\neg', + multiply: '\\cdot', + divide: '\\frac', + // TODO how to handle that properly? + dotMultiply: '.\\cdot', + // TODO find ideal solution + dotDivide: '.:', + // TODO find ideal solution + mod: '\\mod', + add: '+', + subtract: '-', + to: '\\rightarrow', + leftShift: '<<', + rightArithShift: '>>', + rightLogShift: '>>>', + equal: '=', + unequal: '\\neq', + smaller: '<', + larger: '>', + smallerEq: '\\leq', + largerEq: '\\geq', + bitAnd: '\\&', + bitXor: '\\underline{|}', + bitOr: '|', + and: '\\wedge', + xor: '\\veebar', + or: '\\vee' +}; +export var latexFunctions = { + // arithmetic + abs: { + 1: '\\left|${args[0]}\\right|' + }, + add: { + 2: "\\left(${args[0]}".concat(latexOperators.add, "${args[1]}\\right)") + }, + cbrt: { + 1: '\\sqrt[3]{${args[0]}}' + }, + ceil: { + 1: '\\left\\lceil${args[0]}\\right\\rceil' + }, + cube: { + 1: '\\left(${args[0]}\\right)^3' + }, + divide: { + 2: '\\frac{${args[0]}}{${args[1]}}' + }, + dotDivide: { + 2: "\\left(${args[0]}".concat(latexOperators.dotDivide, "${args[1]}\\right)") + }, + dotMultiply: { + 2: "\\left(${args[0]}".concat(latexOperators.dotMultiply, "${args[1]}\\right)") + }, + dotPow: { + 2: "\\left(${args[0]}".concat(latexOperators.dotPow, "${args[1]}\\right)") + }, + exp: { + 1: '\\exp\\left(${args[0]}\\right)' + }, + expm1: "\\left(e".concat(latexOperators.pow, "{${args[0]}}-1\\right)"), + fix: { + 1: '\\mathrm{${name}}\\left(${args[0]}\\right)' + }, + floor: { + 1: '\\left\\lfloor${args[0]}\\right\\rfloor' + }, + gcd: '\\gcd\\left(${args}\\right)', + hypot: '\\hypot\\left(${args}\\right)', + log: { + 1: '\\ln\\left(${args[0]}\\right)', + 2: '\\log_{${args[1]}}\\left(${args[0]}\\right)' + }, + log10: { + 1: '\\log_{10}\\left(${args[0]}\\right)' + }, + log1p: { + 1: '\\ln\\left(${args[0]}+1\\right)', + 2: '\\log_{${args[1]}}\\left(${args[0]}+1\\right)' + }, + log2: '\\log_{2}\\left(${args[0]}\\right)', + mod: { + 2: "\\left(${args[0]}".concat(latexOperators.mod, "${args[1]}\\right)") + }, + multiply: { + 2: "\\left(${args[0]}".concat(latexOperators.multiply, "${args[1]}\\right)") + }, + norm: { + 1: '\\left\\|${args[0]}\\right\\|', + 2: undefined // use default template + }, + nthRoot: { + 2: '\\sqrt[${args[1]}]{${args[0]}}' + }, + nthRoots: { + 2: '\\{y : $y^{args[1]} = {${args[0]}}\\}' + }, + pow: { + 2: "\\left(${args[0]}\\right)".concat(latexOperators.pow, "{${args[1]}}") + }, + round: { + 1: '\\left\\lfloor${args[0]}\\right\\rceil', + 2: undefined // use default template + }, + sign: { + 1: '\\mathrm{${name}}\\left(${args[0]}\\right)' + }, + sqrt: { + 1: '\\sqrt{${args[0]}}' + }, + square: { + 1: '\\left(${args[0]}\\right)^2' + }, + subtract: { + 2: "\\left(${args[0]}".concat(latexOperators.subtract, "${args[1]}\\right)") + }, + unaryMinus: { + 1: "".concat(latexOperators.unaryMinus, "\\left(${args[0]}\\right)") + }, + unaryPlus: { + 1: "".concat(latexOperators.unaryPlus, "\\left(${args[0]}\\right)") + }, + // bitwise + bitAnd: { + 2: "\\left(${args[0]}".concat(latexOperators.bitAnd, "${args[1]}\\right)") + }, + bitNot: { + 1: latexOperators.bitNot + '\\left(${args[0]}\\right)' + }, + bitOr: { + 2: "\\left(${args[0]}".concat(latexOperators.bitOr, "${args[1]}\\right)") + }, + bitXor: { + 2: "\\left(${args[0]}".concat(latexOperators.bitXor, "${args[1]}\\right)") + }, + leftShift: { + 2: "\\left(${args[0]}".concat(latexOperators.leftShift, "${args[1]}\\right)") + }, + rightArithShift: { + 2: "\\left(${args[0]}".concat(latexOperators.rightArithShift, "${args[1]}\\right)") + }, + rightLogShift: { + 2: "\\left(${args[0]}".concat(latexOperators.rightLogShift, "${args[1]}\\right)") + }, + // combinatorics + bellNumbers: { + 1: '\\mathrm{B}_{${args[0]}}' + }, + catalan: { + 1: '\\mathrm{C}_{${args[0]}}' + }, + stirlingS2: { + 2: '\\mathrm{S}\\left(${args}\\right)' + }, + // complex + arg: { + 1: '\\arg\\left(${args[0]}\\right)' + }, + conj: { + 1: '\\left(${args[0]}\\right)^*' + }, + im: { + 1: '\\Im\\left\\lbrace${args[0]}\\right\\rbrace' + }, + re: { + 1: '\\Re\\left\\lbrace${args[0]}\\right\\rbrace' + }, + // logical + and: { + 2: "\\left(${args[0]}".concat(latexOperators.and, "${args[1]}\\right)") + }, + not: { + 1: latexOperators.not + '\\left(${args[0]}\\right)' + }, + or: { + 2: "\\left(${args[0]}".concat(latexOperators.or, "${args[1]}\\right)") + }, + xor: { + 2: "\\left(${args[0]}".concat(latexOperators.xor, "${args[1]}\\right)") + }, + // matrix + cross: { + 2: '\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)' + }, + ctranspose: { + 1: "\\left(${args[0]}\\right)".concat(latexOperators.ctranspose) + }, + det: { + 1: '\\det\\left(${args[0]}\\right)' + }, + dot: { + 2: '\\left(${args[0]}\\cdot${args[1]}\\right)' + }, + expm: { + 1: '\\exp\\left(${args[0]}\\right)' + }, + inv: { + 1: '\\left(${args[0]}\\right)^{-1}' + }, + pinv: { + 1: '\\left(${args[0]}\\right)^{+}' + }, + sqrtm: { + 1: "{${args[0]}}".concat(latexOperators.pow, "{\\frac{1}{2}}") + }, + trace: { + 1: '\\mathrm{tr}\\left(${args[0]}\\right)' + }, + transpose: { + 1: "\\left(${args[0]}\\right)".concat(latexOperators.transpose) + }, + // probability + combinations: { + 2: '\\binom{${args[0]}}{${args[1]}}' + }, + combinationsWithRep: { + 2: '\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)' + }, + factorial: { + 1: "\\left(${args[0]}\\right)".concat(latexOperators.factorial) + }, + gamma: { + 1: '\\Gamma\\left(${args[0]}\\right)' + }, + lgamma: { + 1: '\\ln\\Gamma\\left(${args[0]}\\right)' + }, + // relational + equal: { + 2: "\\left(${args[0]}".concat(latexOperators.equal, "${args[1]}\\right)") + }, + larger: { + 2: "\\left(${args[0]}".concat(latexOperators.larger, "${args[1]}\\right)") + }, + largerEq: { + 2: "\\left(${args[0]}".concat(latexOperators.largerEq, "${args[1]}\\right)") + }, + smaller: { + 2: "\\left(${args[0]}".concat(latexOperators.smaller, "${args[1]}\\right)") + }, + smallerEq: { + 2: "\\left(${args[0]}".concat(latexOperators.smallerEq, "${args[1]}\\right)") + }, + unequal: { + 2: "\\left(${args[0]}".concat(latexOperators.unequal, "${args[1]}\\right)") + }, + // special + erf: { + 1: 'erf\\left(${args[0]}\\right)' + }, + // statistics + max: '\\max\\left(${args}\\right)', + min: '\\min\\left(${args}\\right)', + variance: '\\mathrm{Var}\\left(${args}\\right)', + // trigonometry + acos: { + 1: '\\cos^{-1}\\left(${args[0]}\\right)' + }, + acosh: { + 1: '\\cosh^{-1}\\left(${args[0]}\\right)' + }, + acot: { + 1: '\\cot^{-1}\\left(${args[0]}\\right)' + }, + acoth: { + 1: '\\coth^{-1}\\left(${args[0]}\\right)' + }, + acsc: { + 1: '\\csc^{-1}\\left(${args[0]}\\right)' + }, + acsch: { + 1: '\\mathrm{csch}^{-1}\\left(${args[0]}\\right)' + }, + asec: { + 1: '\\sec^{-1}\\left(${args[0]}\\right)' + }, + asech: { + 1: '\\mathrm{sech}^{-1}\\left(${args[0]}\\right)' + }, + asin: { + 1: '\\sin^{-1}\\left(${args[0]}\\right)' + }, + asinh: { + 1: '\\sinh^{-1}\\left(${args[0]}\\right)' + }, + atan: { + 1: '\\tan^{-1}\\left(${args[0]}\\right)' + }, + atan2: { + 2: '\\mathrm{atan2}\\left(${args}\\right)' + }, + atanh: { + 1: '\\tanh^{-1}\\left(${args[0]}\\right)' + }, + cos: { + 1: '\\cos\\left(${args[0]}\\right)' + }, + cosh: { + 1: '\\cosh\\left(${args[0]}\\right)' + }, + cot: { + 1: '\\cot\\left(${args[0]}\\right)' + }, + coth: { + 1: '\\coth\\left(${args[0]}\\right)' + }, + csc: { + 1: '\\csc\\left(${args[0]}\\right)' + }, + csch: { + 1: '\\mathrm{csch}\\left(${args[0]}\\right)' + }, + sec: { + 1: '\\sec\\left(${args[0]}\\right)' + }, + sech: { + 1: '\\mathrm{sech}\\left(${args[0]}\\right)' + }, + sin: { + 1: '\\sin\\left(${args[0]}\\right)' + }, + sinh: { + 1: '\\sinh\\left(${args[0]}\\right)' + }, + tan: { + 1: '\\tan\\left(${args[0]}\\right)' + }, + tanh: { + 1: '\\tanh\\left(${args[0]}\\right)' + }, + // unit + to: { + 2: "\\left(${args[0]}".concat(latexOperators.to, "${args[1]}\\right)") + }, + // utils + numeric: function numeric(node, options) { + // Not sure if this is strictly right but should work correctly for the vast majority of use cases. + return node.args[0].toTex(); + }, + // type + number: { + 0: '0', + 1: '\\left(${args[0]}\\right)', + 2: '\\left(\\left(${args[0]}\\right)${args[1]}\\right)' + }, + string: { + 0: '\\mathtt{""}', + 1: '\\mathrm{string}\\left(${args[0]}\\right)' + }, + bignumber: { + 0: '0', + 1: '\\left(${args[0]}\\right)' + }, + bigint: { + 0: '0', + 1: '\\left(${args[0]}\\right)' + }, + complex: { + 0: '0', + 1: '\\left(${args[0]}\\right)', + 2: "\\left(\\left(${args[0]}\\right)+".concat(latexSymbols.i, "\\cdot\\left(${args[1]}\\right)\\right)") + }, + matrix: { + 0: '\\begin{bmatrix}\\end{bmatrix}', + 1: '\\left(${args[0]}\\right)', + 2: '\\left(${args[0]}\\right)' + }, + sparse: { + 0: '\\begin{bsparse}\\end{bsparse}', + 1: '\\left(${args[0]}\\right)' + }, + unit: { + 1: '\\left(${args[0]}\\right)', + 2: '\\left(\\left(${args[0]}\\right)${args[1]}\\right)' + } +}; +export var defaultTemplate = '\\mathrm{${name}}\\left(${args}\\right)'; +var latexUnits = { + deg: '^\\circ' +}; +export function escapeLatex(string) { + return escapeLatexLib(string, { + preserveFormatting: true + }); +} + +// @param {string} name +// @param {boolean} isUnit +export function toSymbol(name, isUnit) { + isUnit = typeof isUnit === 'undefined' ? false : isUnit; + if (isUnit) { + if (hasOwnProperty(latexUnits, name)) { + return latexUnits[name]; + } + return '\\mathrm{' + escapeLatex(name) + '}'; + } + if (hasOwnProperty(latexSymbols, name)) { + return latexSymbols[name]; + } + return escapeLatex(name); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/log.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/log.js new file mode 100644 index 0000000..4d265f1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/log.js @@ -0,0 +1,16 @@ +/** + * Log a console.warn message only once + */ +export var warnOnce = (() => { + var messages = {}; + return function warnOnce() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var message = args.join(', '); + if (!messages[message]) { + messages[message] = true; + console.warn('Warning:', ...args); + } + }; +})(); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/lruQueue.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/lruQueue.js new file mode 100644 index 0000000..9498439 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/lruQueue.js @@ -0,0 +1,51 @@ +// (c) 2018, Mariusz Nowak +// SPDX-License-Identifier: ISC +// Derived from https://github.com/medikoo/lru-queue +export function lruQueue(limit) { + var size = 0; + var base = 1; + var queue = Object.create(null); + var map = Object.create(null); + var index = 0; + var del = function del(id) { + var oldIndex = map[id]; + if (!oldIndex) return; + delete queue[oldIndex]; + delete map[id]; + --size; + if (base !== oldIndex) return; + if (!size) { + index = 0; + base = 1; + return; + } + while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */} + }; + limit = Math.abs(limit); + return { + hit: function hit(id) { + var oldIndex = map[id]; + var nuIndex = ++index; + queue[nuIndex] = id; + map[id] = nuIndex; + if (!oldIndex) { + ++size; + if (size <= limit) return undefined; + id = queue[base]; + del(id); + return id; + } + delete queue[oldIndex]; + if (base !== oldIndex) return undefined; + while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */} + return undefined; + }, + delete: del, + clear: function clear() { + size = index = 0; + base = 1; + queue = Object.create(null); + map = Object.create(null); + } + }; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/map.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/map.js new file mode 100644 index 0000000..f44fbba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/map.js @@ -0,0 +1,203 @@ +import { getSafeProperty, isSafeProperty, setSafeProperty } from './customs.js'; +import { isMap, isObject } from './is.js'; + +/** + * A map facade on a bare object. + * + * The small number of methods needed to implement a scope, + * forwarding on to the SafeProperty functions. Over time, the codebase + * will stop using this method, as all objects will be Maps, rather than + * more security prone objects. + */ +export class ObjectWrappingMap { + constructor(object) { + this.wrappedObject = object; + this[Symbol.iterator] = this.entries; + } + keys() { + return Object.keys(this.wrappedObject).filter(key => this.has(key)).values(); + } + get(key) { + return getSafeProperty(this.wrappedObject, key); + } + set(key, value) { + setSafeProperty(this.wrappedObject, key, value); + return this; + } + has(key) { + return isSafeProperty(this.wrappedObject, key) && key in this.wrappedObject; + } + entries() { + return mapIterator(this.keys(), key => [key, this.get(key)]); + } + forEach(callback) { + for (var key of this.keys()) { + callback(this.get(key), key, this); + } + } + delete(key) { + if (isSafeProperty(this.wrappedObject, key)) { + delete this.wrappedObject[key]; + } + } + clear() { + for (var key of this.keys()) { + this.delete(key); + } + } + get size() { + return Object.keys(this.wrappedObject).length; + } +} + +/** + * Create a map with two partitions: a and b. + * The set with bKeys determines which keys/values are read/written to map b, + * all other values are read/written to map a + * + * For example: + * + * const a = new Map() + * const b = new Map() + * const p = new PartitionedMap(a, b, new Set(['x', 'y'])) + * + * In this case, values `x` and `y` are read/written to map `b`, + * all other values are read/written to map `a`. + */ +export class PartitionedMap { + /** + * @param {Map} a + * @param {Map} b + * @param {Set} bKeys + */ + constructor(a, b, bKeys) { + this.a = a; + this.b = b; + this.bKeys = bKeys; + this[Symbol.iterator] = this.entries; + } + get(key) { + return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key); + } + set(key, value) { + if (this.bKeys.has(key)) { + this.b.set(key, value); + } else { + this.a.set(key, value); + } + return this; + } + has(key) { + return this.b.has(key) || this.a.has(key); + } + keys() { + return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator](); + } + entries() { + return mapIterator(this.keys(), key => [key, this.get(key)]); + } + forEach(callback) { + for (var key of this.keys()) { + callback(this.get(key), key, this); + } + } + delete(key) { + return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key); + } + clear() { + this.a.clear(); + this.b.clear(); + } + get size() { + return [...this.keys()].length; + } +} + +/** + * Create a new iterator that maps over the provided iterator, applying a mapping function to each item + */ +function mapIterator(it, callback) { + return { + next: () => { + var n = it.next(); + return n.done ? n : { + value: callback(n.value), + done: false + }; + } + }; +} + +/** + * Creates an empty map, or whatever your platform's polyfill is. + * + * @returns an empty Map or Map like object. + */ +export function createEmptyMap() { + return new Map(); +} + +/** + * Creates a Map from the given object. + * + * @param { Map | { [key: string]: unknown } | undefined } mapOrObject + * @returns + */ +export function createMap(mapOrObject) { + if (!mapOrObject) { + return createEmptyMap(); + } + if (isMap(mapOrObject)) { + return mapOrObject; + } + if (isObject(mapOrObject)) { + return new ObjectWrappingMap(mapOrObject); + } + throw new Error('createMap can create maps from objects or Maps'); +} + +/** + * Unwraps a map into an object. + * + * @param {Map} map + * @returns { [key: string]: unknown } + */ +export function toObject(map) { + if (map instanceof ObjectWrappingMap) { + return map.wrappedObject; + } + var object = {}; + for (var key of map.keys()) { + var value = map.get(key); + setSafeProperty(object, key, value); + } + return object; +} + +/** + * Copies the contents of key-value pairs from each `objects` in to `map`. + * + * Object is `objects` can be a `Map` or object. + * + * This is the `Map` analog to `Object.assign`. + */ +export function assign(map) { + for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + objects[_key - 1] = arguments[_key]; + } + for (var args of objects) { + if (!args) { + continue; + } + if (isMap(args)) { + for (var key of args.keys()) { + map.set(key, args.get(key)); + } + } else if (isObject(args)) { + for (var _key2 of Object.keys(args)) { + map.set(_key2, args[_key2]); + } + } + } + return map; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/noop.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/noop.js new file mode 100644 index 0000000..dd6e5d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/noop.js @@ -0,0 +1,15 @@ +export function noBignumber() { + throw new Error('No "bignumber" implementation available'); +} +export function noFraction() { + throw new Error('No "fraction" implementation available'); +} +export function noMatrix() { + throw new Error('No "matrix" implementation available'); +} +export function noIndex() { + throw new Error('No "index" implementation available'); +} +export function noSubset() { + throw new Error('No "matrix" implementation available'); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/number.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/number.js new file mode 100644 index 0000000..3414cf6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/number.js @@ -0,0 +1,737 @@ +import { isBigNumber, isNumber, isObject } from './is.js'; + +/** + * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue + */ + +/** + * Check if a number is integer + * @param {number | boolean} value + * @return {boolean} isInteger + */ +export function isInteger(value) { + if (typeof value === 'boolean') { + return true; + } + return isFinite(value) ? value === Math.round(value) : false; +} + +/** + * Check if a string contains an integer + * @param {string} str + * @return {boolean} isInteger + */ +export function isIntegerStr(str) { + // regex matching strings like "123" and "-123" + return /^-?\d+$/.test(str); +} + +/** + * Ensure the number type is compatible with the provided value. + * If not, return 'number' instead. + * + * For example: + * + * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' }) + * + * will return 'number' and not 'bigint' because trying to create a bigint with + * value 2.3 would throw an exception. + * + * @param {string} numberStr + * @param {{ + * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction' + * numberFallback: 'number' | 'BigNumber' + * }} config + * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'} + */ +export function safeNumberType(numberStr, config) { + if (config.number === 'bigint' && !isIntegerStr(numberStr)) { + return config.numberFallback; + } + return config.number; +} + +/** + * Calculate the sign of a number + * @param {number} x + * @returns {number} + */ +export var sign = Math.sign || function (x) { + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}; + +/** + * Calculate the base-2 logarithm of a number + * @param {number} x + * @returns {number} + */ +export var log2 = Math.log2 || function log2(x) { + return Math.log(x) / Math.LN2; +}; + +/** + * Calculate the base-10 logarithm of a number + * @param {number} x + * @returns {number} + */ +export var log10 = Math.log10 || function log10(x) { + return Math.log(x) / Math.LN10; +}; + +/** + * Calculate the natural logarithm of a number + 1 + * @param {number} x + * @returns {number} + */ +export var log1p = Math.log1p || function (x) { + return Math.log(x + 1); +}; + +/** + * Calculate cubic root for a number + * + * Code from es6-shim.js: + * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577 + * + * @param {number} x + * @returns {number} Returns the cubic root of x + */ +export var cbrt = Math.cbrt || function cbrt(x) { + if (x === 0) { + return x; + } + var negate = x < 0; + var result; + if (negate) { + x = -x; + } + if (isFinite(x)) { + result = Math.exp(Math.log(x) / 3); + // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods + result = (x / (result * result) + 2 * result) / 3; + } else { + result = x; + } + return negate ? -result : result; +}; + +/** + * Calculates exponentiation minus 1 + * @param {number} x + * @return {number} res + */ +export var expm1 = Math.expm1 || function expm1(x) { + return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6; +}; + +/** + * Formats a number in a given base + * @param {number} n + * @param {number} base + * @param {number} size + * @returns {string} + */ +function formatNumberToBase(n, base, size) { + var prefixes = { + 2: '0b', + 8: '0o', + 16: '0x' + }; + var prefix = prefixes[base]; + var suffix = ''; + if (size) { + if (size < 1) { + throw new Error('size must be in greater than 0'); + } + if (!isInteger(size)) { + throw new Error('size must be an integer'); + } + if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) { + throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]")); + } + if (!isInteger(n)) { + throw new Error('Value must be an integer'); + } + if (n < 0) { + n = n + 2 ** size; + } + suffix = "i".concat(size); + } + var sign = ''; + if (n < 0) { + n = -n; + sign = '-'; + } + return "".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix); +} + +/** + * Convert a number to a formatted string representation. + * + * Syntax: + * + * format(value) + * format(value, options) + * format(value, precision) + * format(value, fn) + * + * Where: + * + * {number} value The value to be formatted + * {Object} options An object with formatting options. Available options: + * {string} notation + * Number notation. Choose from: + * 'fixed' Always use regular number notation. + * For example '123.40' and '14000000' + * 'exponential' Always use exponential notation. + * For example '1.234e+2' and '1.4e+7' + * 'engineering' Always use engineering notation. + * For example '123.4e+0' and '14.0e+6' + * 'auto' (default) Regular number notation for numbers + * having an absolute value between + * `lowerExp` and `upperExp` bounds, and + * uses exponential notation elsewhere. + * Lower bound is included, upper bound + * is excluded. + * For example '123.4' and '1.4e7'. + * 'bin', 'oct, or + * 'hex' Format the number using binary, octal, + * or hexadecimal notation. + * For example '0b1101' and '0x10fe'. + * {number} wordSize The word size in bits to use for formatting + * in binary, octal, or hexadecimal notation. + * To be used only with 'bin', 'oct', or 'hex' + * values for 'notation' option. When this option + * is defined the value is formatted as a signed + * twos complement integer of the given word size + * and the size suffix is appended to the output. + * For example + * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'. + * Default value is undefined. + * {number} precision A number between 0 and 16 to round + * the digits of the number. + * In case of notations 'exponential', + * 'engineering', and 'auto', + * `precision` defines the total + * number of significant digits returned. + * In case of notation 'fixed', + * `precision` defines the number of + * significant digits after the decimal + * point. + * `precision` is undefined by default, + * not rounding any digits. + * {number} lowerExp Exponent determining the lower boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `-3`. + * {number} upperExp Exponent determining the upper boundary + * for formatting a value with an exponent + * when `notation='auto`. + * Default value is `5`. + * {Function} fn A custom formatting function. Can be used to override the + * built-in notations. Function `fn` is called with `value` as + * parameter and must return a string. Is useful for example to + * format all values inside a matrix in a particular way. + * + * Examples: + * + * format(6.4) // '6.4' + * format(1240000) // '1.24e6' + * format(1/3) // '0.3333333333333333' + * format(1/3, 3) // '0.333' + * format(21385, 2) // '21000' + * format(12.071, {notation: 'fixed'}) // '12' + * format(2.3, {notation: 'fixed', precision: 2}) // '2.30' + * format(52.8, {notation: 'exponential'}) // '5.28e+1' + * format(12345678, {notation: 'engineering'}) // '12.345678e+6' + * + * @param {number} value + * @param {Object | Function | number} [options] + * @return {string} str The formatted value + */ +export function format(value, options) { + if (typeof options === 'function') { + // handle format(value, fn) + return options(value); + } + + // handle special cases + if (value === Infinity) { + return 'Infinity'; + } else if (value === -Infinity) { + return '-Infinity'; + } else if (isNaN(value)) { + return 'NaN'; + } + var { + notation, + precision, + wordSize + } = normalizeFormatOptions(options); + + // handle the various notations + switch (notation) { + case 'fixed': + return toFixed(value, precision); + case 'exponential': + return toExponential(value, precision); + case 'engineering': + return toEngineering(value, precision); + case 'bin': + return formatNumberToBase(value, 2, wordSize); + case 'oct': + return formatNumberToBase(value, 8, wordSize); + case 'hex': + return formatNumberToBase(value, 16, wordSize); + case 'auto': + // remove trailing zeros after the decimal point + return toPrecision(value, precision, options).replace(/((\.\d*?)(0+))($|e)/, function () { + var digits = arguments[2]; + var e = arguments[4]; + return digits !== '.' ? digits + e : e; + }); + default: + throw new Error('Unknown notation "' + notation + '". ' + 'Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.'); + } +} + +/** + * Normalize format options into an object: + * { + * notation: string, + * precision: number | undefined, + * wordSize: number | undefined + * } + */ +export function normalizeFormatOptions(options) { + // default values for options + var notation = 'auto'; + var precision; + var wordSize; + if (options !== undefined) { + if (isNumber(options)) { + precision = options; + } else if (isBigNumber(options)) { + precision = options.toNumber(); + } else if (isObject(options)) { + if (options.precision !== undefined) { + precision = _toNumberOrThrow(options.precision, () => { + throw new Error('Option "precision" must be a number or BigNumber'); + }); + } + if (options.wordSize !== undefined) { + wordSize = _toNumberOrThrow(options.wordSize, () => { + throw new Error('Option "wordSize" must be a number or BigNumber'); + }); + } + if (options.notation) { + notation = options.notation; + } + } else { + throw new Error('Unsupported type of options, number, BigNumber, or object expected'); + } + } + return { + notation, + precision, + wordSize + }; +} + +/** + * Split a number into sign, coefficients, and exponent + * @param {number | string} value + * @return {SplitValue} + * Returns an object containing sign, coefficients, and exponent + */ +export function splitNumber(value) { + // parse the input value + var match = String(value).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/); + if (!match) { + throw new SyntaxError('Invalid number ' + value); + } + var sign = match[1]; + var digits = match[2]; + var exponent = parseFloat(match[4] || '0'); + var dot = digits.indexOf('.'); + exponent += dot !== -1 ? dot - 1 : digits.length - 1; + var coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros) + .replace(/^0*/, function (zeros) { + // remove leading zeros, add their count to the exponent + exponent -= zeros.length; + return ''; + }).replace(/0*$/, '') // remove trailing zeros + .split('').map(function (d) { + return parseInt(d); + }); + if (coefficients.length === 0) { + coefficients.push(0); + exponent++; + } + return { + sign, + coefficients, + exponent + }; +} + +/** + * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3' + * @param {number | string} value + * @param {number} [precision] Optional number of significant figures to return. + */ +export function toEngineering(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + var split = splitNumber(value); + var rounded = roundDigits(split, precision); + var e = rounded.exponent; + var c = rounded.coefficients; + + // find nearest lower multiple of 3 for exponent + var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3; + if (isNumber(precision)) { + // add zeroes to give correct sig figs + while (precision > c.length || e - newExp + 1 > c.length) { + c.push(0); + } + } else { + // concatenate coefficients with necessary zeros + // add zeros if necessary (for example: 1e+8 -> 100e+6) + var missingZeros = Math.abs(e - newExp) - (c.length - 1); + for (var i = 0; i < missingZeros; i++) { + c.push(0); + } + } + + // find difference in exponents + var expDiff = Math.abs(e - newExp); + var decimalIdx = 1; + + // push decimal index over by expDiff times + while (expDiff > 0) { + decimalIdx++; + expDiff--; + } + + // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value. + // otherwise concat with the rest of the coefficients + var decimals = c.slice(decimalIdx).join(''); + var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : ''; + var str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString(); + return rounded.sign + str; +} + +/** + * Format a number with fixed notation. + * @param {number | string} value + * @param {number} [precision=undefined] Optional number of decimals after the + * decimal point. null by default. + */ +export function toFixed(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + var splitValue = splitNumber(value); + var rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue; + var c = rounded.coefficients; + var p = rounded.exponent + 1; // exponent may have changed + + // append zeros if needed + var pp = p + (precision || 0); + if (c.length < pp) { + c = c.concat(zeros(pp - c.length)); + } + + // prepend zeros if needed + if (p < 0) { + c = zeros(-p + 1).concat(c); + p = 1; + } + + // insert a dot if needed + if (p < c.length) { + c.splice(p, 0, p === 0 ? '0.' : '.'); + } + return rounded.sign + c.join(''); +} + +/** + * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3' + * @param {number | string} value + * @param {number} [precision] Number of digits in formatted output. + * If not provided, the maximum available digits + * is used. + */ +export function toExponential(value, precision) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + + // round if needed, else create a clone + var split = splitNumber(value); + var rounded = precision ? roundDigits(split, precision) : split; + var c = rounded.coefficients; + var e = rounded.exponent; + + // append zeros if needed + if (c.length < precision) { + c = c.concat(zeros(precision - c.length)); + } + + // format as `C.CCCe+EEE` or `C.CCCe-EEE` + var first = c.shift(); + return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e; +} + +/** + * Format a number with a certain precision + * @param {number | string} value + * @param {number} [precision=undefined] Optional number of digits. + * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options] + * By default: + * lowerExp = -3 (incl) + * upper = +5 (excl) + * @return {string} + */ +export function toPrecision(value, precision, options) { + if (isNaN(value) || !isFinite(value)) { + return String(value); + } + + // determine lower and upper bound for exponential notation. + var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3); + var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5); + var split = splitNumber(value); + var rounded = precision ? roundDigits(split, precision) : split; + if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) { + // exponential notation + return toExponential(value, precision); + } else { + var c = rounded.coefficients; + var e = rounded.exponent; + + // append trailing zeros + if (c.length < precision) { + c = c.concat(zeros(precision - c.length)); + } + + // append trailing zeros + // TODO: simplify the next statement + c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0))); + + // prepend zeros + c = zeros(-e).concat(c); + var dot = e > 0 ? e : 0; + if (dot < c.length - 1) { + c.splice(dot + 1, 0, '.'); + } + return rounded.sign + c.join(''); + } +} + +/** + * Round the number of digits of a number * + * @param {SplitValue} split A value split with .splitNumber(value) + * @param {number} precision A positive integer + * @return {SplitValue} + * Returns an object containing sign, coefficients, and exponent + * with rounded digits + */ +export function roundDigits(split, precision) { + // create a clone + var rounded = { + sign: split.sign, + coefficients: split.coefficients, + exponent: split.exponent + }; + var c = rounded.coefficients; + + // prepend zeros if needed + while (precision <= 0) { + c.unshift(0); + rounded.exponent++; + precision++; + } + if (c.length > precision) { + var removed = c.splice(precision, c.length - precision); + if (removed[0] >= 5) { + var i = precision - 1; + c[i]++; + while (c[i] === 10) { + c.pop(); + if (i === 0) { + c.unshift(0); + rounded.exponent++; + i++; + } + i--; + c[i]++; + } + } + } + return rounded; +} + +/** + * Create an array filled with zeros. + * @param {number} length + * @return {Array} + */ +function zeros(length) { + var arr = []; + for (var i = 0; i < length; i++) { + arr.push(0); + } + return arr; +} + +/** + * Count the number of significant digits of a number. + * + * For example: + * 2.34 returns 3 + * 0.0034 returns 2 + * 120.5e+30 returns 4 + * + * @param {number} value + * @return {number} digits Number of significant digits + */ +export function digits(value) { + return value.toExponential().replace(/e.*$/, '') // remove exponential notation + .replace(/^0\.?0*|\./, '') // remove decimal point and leading zeros + .length; +} + +/** + * Minimum number added to one that makes the result different than one + */ +export var DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16; + +/** + * Compares two floating point numbers. + * @param {number} a - First value to compare + * @param {number} b - Second value to compare + * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0. + * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0. + * @return {boolean} whether the two numbers are nearly equal + * + * @throws {Error} If `relTol` is less than or equal to 0. + * @throws {Error} If `absTol` is less than 0. + * + * @example + * nearlyEqual(1.000000001, 1.0, 1e-8); // true + * nearlyEqual(1.000000002, 1.0, 0); // false + * nearlyEqual(1.0, 1.009, undefined, 0.01); // true + * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true + */ +export function nearlyEqual(a, b) { + var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8; + var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (relTol <= 0) { + throw new Error('Relative tolerance must be greater than 0'); + } + if (absTol < 0) { + throw new Error('Absolute tolerance must be at least 0'); + } + + // NaN + if (isNaN(a) || isNaN(b)) { + return false; + } + if (!isFinite(a) || !isFinite(b)) { + return a === b; + } + if (a === b) { + return true; + } + + // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) + return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol); +} + +/** + * Calculate the hyperbolic arccos of a number + * @param {number} x + * @return {number} + */ +export var acosh = Math.acosh || function (x) { + return Math.log(Math.sqrt(x * x - 1) + x); +}; +export var asinh = Math.asinh || function (x) { + return Math.log(Math.sqrt(x * x + 1) + x); +}; + +/** + * Calculate the hyperbolic arctangent of a number + * @param {number} x + * @return {number} + */ +export var atanh = Math.atanh || function (x) { + return Math.log((1 + x) / (1 - x)) / 2; +}; + +/** + * Calculate the hyperbolic cosine of a number + * @param {number} x + * @returns {number} + */ +export var cosh = Math.cosh || function (x) { + return (Math.exp(x) + Math.exp(-x)) / 2; +}; + +/** + * Calculate the hyperbolic sine of a number + * @param {number} x + * @returns {number} + */ +export var sinh = Math.sinh || function (x) { + return (Math.exp(x) - Math.exp(-x)) / 2; +}; + +/** + * Calculate the hyperbolic tangent of a number + * @param {number} x + * @returns {number} + */ +export var tanh = Math.tanh || function (x) { + var e = Math.exp(2 * x); + return (e - 1) / (e + 1); +}; + +/** + * Returns a value with the magnitude of x and the sign of y. + * @param {number} x + * @param {number} y + * @returns {number} + */ +export function copysign(x, y) { + var signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity; + var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity; + return signx ^ signy ? -x : x; +} +function _toNumberOrThrow(value, onError) { + if (isNumber(value)) { + return value; + } else if (isBigNumber(value)) { + return value.toNumber(); + } else { + onError(); + } +} +function _toNumberOrDefault(value, defaultValue) { + if (isNumber(value)) { + return value; + } else if (isBigNumber(value)) { + return value.toNumber(); + } else { + return defaultValue; + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/object.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/object.js new file mode 100644 index 0000000..173229e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/object.js @@ -0,0 +1,372 @@ +import { isBigNumber, isObject } from './is.js'; + +/** + * Clone an object + * + * clone(x) + * + * Can clone any primitive type, array, and object. + * If x has a function clone, this function will be invoked to clone the object. + * + * @param {*} x + * @return {*} clone + */ +export function clone(x) { + var type = typeof x; + + // immutable primitive types + if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) { + return x; + } + + // use clone function of the object when available + if (typeof x.clone === 'function') { + return x.clone(); + } + + // array + if (Array.isArray(x)) { + return x.map(function (value) { + return clone(value); + }); + } + if (x instanceof Date) return new Date(x.valueOf()); + if (isBigNumber(x)) return x; // bignumbers are immutable + + // object + if (isObject(x)) { + return mapObject(x, clone); + } + throw new TypeError("Cannot clone: unknown type of value (value: ".concat(x, ")")); +} + +/** + * Apply map to all properties of an object + * @param {Object} object + * @param {function} callback + * @return {Object} Returns a copy of the object with mapped properties + */ +export function mapObject(object, callback) { + var clone = {}; + for (var key in object) { + if (hasOwnProperty(object, key)) { + clone[key] = callback(object[key]); + } + } + return clone; +} + +/** + * Extend object a with the properties of object b + * @param {Object} a + * @param {Object} b + * @return {Object} a + */ +export function extend(a, b) { + for (var prop in b) { + if (hasOwnProperty(b, prop)) { + a[prop] = b[prop]; + } + } + return a; +} + +/** + * Deep extend an object a with the properties of object b + * @param {Object} a + * @param {Object} b + * @returns {Object} + */ +export function deepExtend(a, b) { + // TODO: add support for Arrays to deepExtend + if (Array.isArray(b)) { + throw new TypeError('Arrays are not supported by deepExtend'); + } + for (var prop in b) { + // We check against prop not being in Object.prototype or Function.prototype + // to prevent polluting for example Object.__proto__. + if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) { + if (b[prop] && b[prop].constructor === Object) { + if (a[prop] === undefined) { + a[prop] = {}; + } + if (a[prop] && a[prop].constructor === Object) { + deepExtend(a[prop], b[prop]); + } else { + a[prop] = b[prop]; + } + } else if (Array.isArray(b[prop])) { + throw new TypeError('Arrays are not supported by deepExtend'); + } else { + a[prop] = b[prop]; + } + } + } + return a; +} + +/** + * Deep test equality of all fields in two pairs of arrays or objects. + * Compares values and functions strictly (ie. 2 is not the same as '2'). + * @param {Array | Object} a + * @param {Array | Object} b + * @returns {boolean} + */ +export function deepStrictEqual(a, b) { + var prop, i, len; + if (Array.isArray(a)) { + if (!Array.isArray(b)) { + return false; + } + if (a.length !== b.length) { + return false; + } + for (i = 0, len = a.length; i < len; i++) { + if (!deepStrictEqual(a[i], b[i])) { + return false; + } + } + return true; + } else if (typeof a === 'function') { + return a === b; + } else if (a instanceof Object) { + if (Array.isArray(b) || !(b instanceof Object)) { + return false; + } + for (prop in a) { + // noinspection JSUnfilteredForInLoop + if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) { + return false; + } + } + for (prop in b) { + // noinspection JSUnfilteredForInLoop + if (!(prop in a)) { + return false; + } + } + return true; + } else { + return a === b; + } +} + +/** + * Recursively flatten a nested object. + * @param {Object} nestedObject + * @return {Object} Returns the flattened object + */ +export function deepFlatten(nestedObject) { + var flattenedObject = {}; + _deepFlatten(nestedObject, flattenedObject); + return flattenedObject; +} + +// helper function used by deepFlatten +function _deepFlatten(nestedObject, flattenedObject) { + for (var prop in nestedObject) { + if (hasOwnProperty(nestedObject, prop)) { + var value = nestedObject[prop]; + if (typeof value === 'object' && value !== null) { + _deepFlatten(value, flattenedObject); + } else { + flattenedObject[prop] = value; + } + } + } +} + +/** + * Test whether the current JavaScript engine supports Object.defineProperty + * @returns {boolean} returns true if supported + */ +export function canDefineProperty() { + // test needed for broken IE8 implementation + try { + if (Object.defineProperty) { + Object.defineProperty({}, 'x', { + get: function get() { + return null; + } + }); + return true; + } + } catch (e) {} + return false; +} + +/** + * Attach a lazy loading property to a constant. + * The given function `fn` is called once when the property is first requested. + * + * @param {Object} object Object where to add the property + * @param {string} prop Property name + * @param {Function} valueResolver Function returning the property value. Called + * without arguments. + */ +export function lazy(object, prop, valueResolver) { + var _uninitialized = true; + var _value; + Object.defineProperty(object, prop, { + get: function get() { + if (_uninitialized) { + _value = valueResolver(); + _uninitialized = false; + } + return _value; + }, + set: function set(value) { + _value = value; + _uninitialized = false; + }, + configurable: true, + enumerable: true + }); +} + +/** + * Traverse a path into an object. + * When a namespace is missing, it will be created + * @param {Object} object + * @param {string | string[]} path A dot separated string like 'name.space' + * @return {Object} Returns the object at the end of the path + */ +export function traverse(object, path) { + if (path && typeof path === 'string') { + return traverse(object, path.split('.')); + } + var obj = object; + if (path) { + for (var i = 0; i < path.length; i++) { + var key = path[i]; + if (!(key in obj)) { + obj[key] = {}; + } + obj = obj[key]; + } + } + return obj; +} + +/** + * A safe hasOwnProperty + * @param {Object} object + * @param {string} property + */ +export function hasOwnProperty(object, property) { + return object && Object.hasOwnProperty.call(object, property); +} + +/** + * Test whether an object is a factory. a factory has fields: + * + * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required) + * - name: string (optional) + * - path: string A dot separated path (optional) + * - math: boolean If true (false by default), the math namespace is passed + * as fifth argument of the factory function + * + * @param {*} object + * @returns {boolean} + */ +export function isLegacyFactory(object) { + return object && typeof object.factory === 'function'; +} + +/** + * Get a nested property from an object + * @param {Object} object + * @param {string | string[]} path + * @returns {Object} + */ +export function get(object, path) { + if (typeof path === 'string') { + if (isPath(path)) { + return get(object, path.split('.')); + } else { + return object[path]; + } + } + var child = object; + for (var i = 0; i < path.length; i++) { + var key = path[i]; + child = child ? child[key] : undefined; + } + return child; +} + +/** + * Set a nested property in an object + * Mutates the object itself + * If the path doesn't exist, it will be created + * @param {Object} object + * @param {string | string[]} path + * @param {*} value + * @returns {Object} + */ +export function set(object, path, value) { + if (typeof path === 'string') { + if (isPath(path)) { + return set(object, path.split('.'), value); + } else { + object[path] = value; + return object; + } + } + var child = object; + for (var i = 0; i < path.length - 1; i++) { + var key = path[i]; + if (child[key] === undefined) { + child[key] = {}; + } + child = child[key]; + } + if (path.length > 0) { + var lastKey = path[path.length - 1]; + child[lastKey] = value; + } + return object; +} + +/** + * Create an object composed of the picked object properties + * @param {Object} object + * @param {string[]} properties + * @param {function} [transform] Optional value to transform a value when picking it + * @return {Object} + */ +export function pick(object, properties, transform) { + var copy = {}; + for (var i = 0; i < properties.length; i++) { + var key = properties[i]; + var value = get(object, key); + if (value !== undefined) { + set(copy, key, transform ? transform(value, key) : value); + } + } + return copy; +} + +/** + * Shallow version of pick, creating an object composed of the picked object properties + * but not for nested properties + * @param {Object} object + * @param {string[]} properties + * @return {Object} + */ +export function pickShallow(object, properties) { + var copy = {}; + for (var i = 0; i < properties.length; i++) { + var key = properties[i]; + var value = object[key]; + if (value !== undefined) { + copy[key] = value; + } + } + return copy; +} + +// helper function to test whether a string contains a path like 'user.name' +function isPath(str) { + return str.includes('.'); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/optimizeCallback.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/optimizeCallback.js new file mode 100644 index 0000000..888d4e5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/optimizeCallback.js @@ -0,0 +1,88 @@ +import typed from 'typed-function'; +import { get, arraySize } from './array.js'; +import { typeOf as _typeOf } from './is.js'; + +/** + * Simplifies a callback function by reducing its complexity and potentially improving its performance. + * + * @param {Function} callback The original callback function to simplify. + * @param {Array|Matrix} array The array that will be used with the callback function. + * @param {string} name The name of the function that is using the callback. + * @returns {Function} Returns a simplified version of the callback function. + */ +export function optimizeCallback(callback, array, name) { + if (typed.isTypedFunction(callback)) { + var firstIndex = (array.isMatrix ? array.size() : arraySize(array)).map(() => 0); + var firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex); + var hasSingleSignature = Object.keys(callback.signatures).length === 1; + var numberOfArguments = _findNumberOfArguments(callback, firstValue, firstIndex, array); + var fastCallback = hasSingleSignature ? Object.values(callback.signatures)[0] : callback; + if (numberOfArguments >= 1 && numberOfArguments <= 3) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name); + }; + } + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return _tryFunctionWithArgs(fastCallback, args, name, callback.name); + }; + } + return callback; +} +function _findNumberOfArguments(callback, value, index, array) { + var testArgs = [value, index, array]; + for (var i = 3; i > 0; i--) { + var args = testArgs.slice(0, i); + if (typed.resolve(callback, args) !== null) { + return i; + } + } +} + +/** + * @param {function} func The selected function taken from one of the signatures of the callback function + * @param {Array} args List with arguments to apply to the selected signature + * @param {string} mappingFnName the name of the function that is using the callback + * @param {string} callbackName the name of the callback function + * @returns {*} Returns the return value of the invoked signature + * @throws {TypeError} Throws an error when no matching signature was found + */ +function _tryFunctionWithArgs(func, args, mappingFnName, callbackName) { + try { + return func(...args); + } catch (err) { + _createCallbackError(err, args, mappingFnName, callbackName); + } +} + +/** + * Creates and throws a detailed TypeError when a callback function fails. + * + * @param {Error} err The original error thrown by the callback function. + * @param {Array} args The arguments that were passed to the callback function. + * @param {string} mappingFnName The name of the function that is using the callback. + * @param {string} callbackName The name of the callback function. + * @throws {TypeError} Throws a detailed TypeError with enriched error message. + */ +function _createCallbackError(err, args, mappingFnName, callbackName) { + var _err$data; + // Enrich the error message so the user understands that it took place inside the callback function + if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') { + var argsDesc = []; + argsDesc.push("value: ".concat(_typeOf(args[0]))); + if (args.length >= 2) { + argsDesc.push("index: ".concat(_typeOf(args[1]))); + } + if (args.length >= 3) { + argsDesc.push("array: ".concat(_typeOf(args[2]))); + } + throw new TypeError("Function ".concat(mappingFnName, " cannot apply callback arguments ") + "".concat(callbackName, "(").concat(argsDesc.join(', '), ") at index ").concat(JSON.stringify(args[1]))); + } else { + throw new TypeError("Function ".concat(mappingFnName, " cannot apply callback arguments ") + "to function ".concat(callbackName, ": ").concat(err.message)); + } +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/print.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/print.js new file mode 100644 index 0000000..05e9b8d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/print.js @@ -0,0 +1 @@ +export var printTemplate = /\$([\w.]+)/g; \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/product.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/product.js new file mode 100644 index 0000000..6986783 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/product.js @@ -0,0 +1,14 @@ +/** @param {number} i + * @param {number} n + * @returns {number} product of i to n + */ +export function product(i, n) { + if (n < i) { + return 1; + } + if (n === i) { + return n; + } + var half = n + i >> 1; // divide (n + i) by 2 and truncate to integer + return product(i, half) * product(half + 1, n); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/scope.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/scope.js new file mode 100644 index 0000000..5b306d9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/scope.js @@ -0,0 +1,18 @@ +import { ObjectWrappingMap, PartitionedMap } from './map.js'; + +/** + * Create a new scope which can access the parent scope, + * but does not affect it when written. This is suitable for variable definitions + * within a block node, or function definition. + * + * If parent scope has a createSubScope method, it delegates to that. Otherwise, + * creates an empty map, and copies the parent scope to it, adding in + * the remaining `args`. + * + * @param {Map} parentScope + * @param {Object} args + * @returns {PartitionedMap} + */ +export function createSubScope(parentScope, args) { + return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args))); +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/snapshot.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/snapshot.js new file mode 100644 index 0000000..41cd414 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/snapshot.js @@ -0,0 +1,227 @@ +import _extends from "@babel/runtime/helpers/extends"; +import _defineProperty from "@babel/runtime/helpers/defineProperty"; +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +/** + * This file contains helper methods to create expected snapshot structures + * of both instance and ES6 exports. + * + * The files are located here and not under /test or /tools so it's transpiled + * into ES5 code under /lib and can be used straight by node.js + */ +import assert from 'assert'; +import * as allIsFunctions from './is.js'; +import { create } from '../core/create.js'; +import { endsWith } from './string.js'; +export var validateTypeOf = allIsFunctions.typeOf; +export function validateBundle(expectedBundleStructure, bundle) { + var originalWarn = console.warn; + console.warn = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (args.join(' ').includes('is moved to') && args.join(' ').includes('Please use the new location instead')) { + // Ignore warnings like: + // Warning: math.type.isNumber is moved to math.isNumber in v6.0.0. Please use the new location instead. + return; + } + originalWarn.apply(console, args); + }; + try { + var issues = []; + + // see whether all expected functions and objects are there + traverse(expectedBundleStructure, (expectedType, path) => { + var actualValue = get(bundle, path); + var actualType = validateTypeOf(actualValue); + var message = actualType === 'undefined' ? 'Missing entry in bundle. ' + "Path: ".concat(JSON.stringify(path), ", expected type: ").concat(expectedType, ", actual type: ").concat(actualType) : 'Unexpected entry type in bundle. ' + "Path: ".concat(JSON.stringify(path), ", expected type: ").concat(expectedType, ", actual type: ").concat(actualType); + if (actualType !== expectedType) { + issues.push({ + actualType, + expectedType, + message + }); + console.warn(message); + } + }); + + // see whether there are any functions or objects that shouldn't be there + traverse(bundle, (actualValue, path) => { + var actualType = validateTypeOf(actualValue); + var expectedType = get(expectedBundleStructure, path) || 'undefined'; + + // FIXME: ugly to have these special cases + if (path.join('.').includes('docs.')) { + // ignore the contents of docs + return; + } + if (path.join('.').includes('all.')) { + // ignore the contents of all dependencies + return; + } + var message = expectedType === 'undefined' ? 'Unknown entry in bundle. ' + 'Is there a new function added which is missing in this snapshot test? ' + "Path: ".concat(JSON.stringify(path), ", expected type: ").concat(expectedType, ", actual type: ").concat(actualType) : 'Unexpected entry type in bundle. ' + "Path: ".concat(JSON.stringify(path), ", expected type: ").concat(expectedType, ", actual type: ").concat(actualType); + if (actualType !== expectedType) { + issues.push({ + actualType, + expectedType, + message + }); + console.warn(message); + } + }); + + // assert on the first issue (if any) + if (issues.length > 0) { + var { + actualType, + expectedType, + message + } = issues[0]; + console.warn("".concat(issues.length, " bundle issues found")); + assert.strictEqual(actualType, expectedType, message); + } + } finally { + console.warn = originalWarn; + } +} + +/** + * Based on an object with factory functions, create the expected + * structures for ES6 export and a mathjs instance. + * @param {Object} factories + * @return {{expectedInstanceStructure: Object, expectedES6Structure: Object}} + */ +export function createSnapshotFromFactories(factories) { + var math = create(factories); + var allFactoryFunctions = {}; + var allFunctionsConstantsClasses = {}; + var allFunctionsConstants = {}; + var allTransformFunctions = {}; + var allDependencyCollections = {}; + var allClasses = {}; + var allNodeClasses = {}; + Object.keys(factories).forEach(factoryName => { + var factory = factories[factoryName]; + var name = factory.fn; + var isTransformFunction = factory.meta && factory.meta.isTransformFunction; + var isClass = !isLowerCase(name[0]) && validateTypeOf(math[name]) === 'function'; + var dependenciesName = factory.fn + (isTransformFunction ? 'Transform' : '') + 'Dependencies'; + allFactoryFunctions[factoryName] = 'function'; + allFunctionsConstantsClasses[name] = validateTypeOf(math[name]); + allDependencyCollections[dependenciesName] = 'Object'; + if (isTransformFunction) { + allTransformFunctions[name] = 'function'; + } + if (isClass) { + if (endsWith(name, 'Node')) { + allNodeClasses[name] = 'function'; + } else { + allClasses[name] = 'function'; + } + } else { + allFunctionsConstants[name] = validateTypeOf(math[name]); + } + }); + var embeddedDocs = {}; + Object.keys(factories).forEach(factoryName => { + var factory = factories[factoryName]; + var name = factory.fn; + if (isLowerCase(factory.fn[0])) { + // ignore class names starting with upper case + embeddedDocs[name] = 'Object'; + } + }); + embeddedDocs = exclude(embeddedDocs, ['equalScalar', 'apply', 'addScalar', 'subtractScalar', 'multiplyScalar', 'print', 'divideScalar', 'parse', 'compile', 'parser', 'chain', 'reviver', 'replacer']); + var allTypeChecks = {}; + Object.keys(allIsFunctions).forEach(name => { + if (name.indexOf('is') === 0) { + allTypeChecks[name] = 'function'; + } + }); + var allErrorClasses = { + ArgumentsError: 'function', + DimensionError: 'function', + IndexError: 'function' + }; + var expectedInstanceStructure = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, allFunctionsConstantsClasses), {}, { + on: 'function', + off: 'function', + once: 'function', + emit: 'function', + import: 'function', + config: 'function', + create: 'function', + factory: 'function' + }, allTypeChecks), allErrorClasses), {}, { + expression: { + transform: _objectSpread({}, allTransformFunctions), + mathWithTransform: _objectSpread(_objectSpread({}, exclude(allFunctionsConstants, ['chain'])), {}, { + config: 'function' + }) + } + }); + var expectedES6Structure = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, exclude(allFunctionsConstantsClasses, ['E', 'false', 'Infinity', 'NaN', 'null', 'PI', 'true'])), {}, { + create: 'function', + config: 'function', + factory: 'function', + _true: 'boolean', + _false: 'boolean', + _null: 'null', + _Infinity: 'number', + _NaN: 'number' + }, allTypeChecks), allErrorClasses), allDependencyCollections), allFactoryFunctions), {}, { + docs: embeddedDocs + }); + return { + expectedInstanceStructure, + expectedES6Structure + }; +} +function traverse(obj) { + var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (value, path) => {}; + var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + // FIXME: ugly to have these special cases + if (path.length > 0 && path[0].includes('Dependencies')) { + // special case for objects holding a collection of dependencies + callback(obj, path); + } else if (validateTypeOf(obj) === 'Array') { + obj.map((item, index) => traverse(item, callback, path.concat(index))); + } else if (validateTypeOf(obj) === 'Object') { + Object.keys(obj).forEach(key => { + // FIXME: ugly to have these special cases + // ignore special case of deprecated docs + if (key === 'docs' && path.join('.') === 'expression') { + return; + } + traverse(obj[key], callback, path.concat(key)); + }); + } else { + callback(obj, path); + } +} +function get(object, path) { + var child = object; + for (var i = 0; i < path.length; i++) { + var key = path[i]; + child = child ? child[key] : undefined; + } + return child; +} + +/** + * Create a copy of the provided `object` and delete + * all properties listed in `excludedProperties` + * @param {Object} object + * @param {string[]} excludedProperties + * @return {Object} + */ +function exclude(object, excludedProperties) { + var strippedObject = _extends({}, object); + excludedProperties.forEach(excludedProperty => { + delete strippedObject[excludedProperty]; + }); + return strippedObject; +} +function isLowerCase(text) { + return typeof text === 'string' && text.toLowerCase() === text; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/string.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/string.js new file mode 100644 index 0000000..96c6334 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/string.js @@ -0,0 +1,194 @@ +import { isBigNumber, isString, typeOf } from './is.js'; +import { format as formatNumber } from './number.js'; +import { format as formatBigNumber } from './bignumber/formatter.js'; + +/** + * Check if a text ends with a certain string. + * @param {string} text + * @param {string} search + */ +export function endsWith(text, search) { + var start = text.length - search.length; + var end = text.length; + return text.substring(start, end) === search; +} + +/** + * Format a value of any type into a string. + * + * Usage: + * math.format(value) + * math.format(value, precision) + * math.format(value, options) + * + * When value is a function: + * + * - When the function has a property `syntax`, it returns this + * syntax description. + * - In other cases, a string `'function'` is returned. + * + * When `value` is an Object: + * + * - When the object contains a property `format` being a function, this + * function is invoked as `value.format(options)` and the result is returned. + * - When the object has its own `toString` method, this method is invoked + * and the result is returned. + * - In other cases the function will loop over all object properties and + * return JSON object notation like '{"a": 2, "b": 3}'. + * + * Example usage: + * math.format(2/7) // '0.2857142857142857' + * math.format(math.pi, 3) // '3.14' + * math.format(new Complex(2, 3)) // '2 + 3i' + * math.format('hello') // '"hello"' + * + * @param {*} value Value to be stringified + * @param {Object | number | Function} [options] + * Formatting options. See src/utils/number.js:format for a + * description of the available options controlling number output. + * This generic "format" also supports the option property `truncate: NN` + * giving the maximum number NN of characters to return (if there would + * have been more, they are deleted and replaced by an ellipsis). + * @return {string} str + */ +export function format(value, options) { + var result = _format(value, options); + if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) { + return result.substring(0, options.truncate - 3) + '...'; + } + return result; +} +function _format(value, options) { + if (typeof value === 'number') { + return formatNumber(value, options); + } + if (isBigNumber(value)) { + return formatBigNumber(value, options); + } + + // note: we use unsafe duck-typing here to check for Fractions, this is + // ok here since we're only invoking toString or concatenating its values + if (looksLikeFraction(value)) { + if (!options || options.fraction !== 'decimal') { + // output as ratio, like '1/3' + return value.s * value.n + '/' + value.d; + } else { + // output as decimal, like '0.(3)' + return value.toString(); + } + } + if (Array.isArray(value)) { + return formatArray(value, options); + } + if (isString(value)) { + return stringify(value); + } + if (typeof value === 'function') { + return value.syntax ? String(value.syntax) : 'function'; + } + if (value && typeof value === 'object') { + if (typeof value.format === 'function') { + return value.format(options); + } else if (value && value.toString(options) !== {}.toString()) { + // this object has a non-native toString method, use that one + return value.toString(options); + } else { + var entries = Object.keys(value).map(key => { + return stringify(key) + ': ' + format(value[key], options); + }); + return '{' + entries.join(', ') + '}'; + } + } + return String(value); +} + +/** + * Stringify a value into a string enclosed in double quotes. + * Unescaped double quotes and backslashes inside the value are escaped. + * @param {*} value + * @return {string} + */ +export function stringify(value) { + var text = String(value); + var escaped = ''; + var i = 0; + while (i < text.length) { + var c = text.charAt(i); + escaped += c in controlCharacters ? controlCharacters[c] : c; + i++; + } + return '"' + escaped + '"'; +} +var controlCharacters = { + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t' +}; + +/** + * Escape special HTML characters + * @param {*} value + * @return {string} + */ +export function escape(value) { + var text = String(value); + text = text.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>'); + return text; +} + +/** + * Recursively format an n-dimensional matrix + * Example output: "[[1, 2], [3, 4]]" + * @param {Array} array + * @param {Object | number | Function} [options] Formatting options. See + * lib/utils/number:format for a + * description of the available + * options. + * @returns {string} str + */ +function formatArray(array, options) { + if (Array.isArray(array)) { + var str = '['; + var len = array.length; + for (var i = 0; i < len; i++) { + if (i !== 0) { + str += ', '; + } + str += formatArray(array[i], options); + } + str += ']'; + return str; + } else { + return format(array, options); + } +} + +/** + * Check whether a value looks like a Fraction (unsafe duck-type check) + * @param {*} value + * @return {boolean} + */ +function looksLikeFraction(value) { + return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false; +} + +/** + * Compare two strings + * @param {string} x + * @param {string} y + * @returns {number} + */ +export function compareText(x, y) { + // we don't want to convert numbers to string, only accept string input + if (!isString(x)) { + throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)'); + } + if (!isString(y)) { + throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)'); + } + return x === y ? 0 : x > y ? 1 : -1; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/switch.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/switch.js new file mode 100644 index 0000000..3d70271 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/utils/switch.js @@ -0,0 +1,20 @@ +/** + * Transpose a matrix + * @param {Array} mat + * @returns {Array} ret + * @private + */ +export function _switch(mat) { + var I = mat.length; + var J = mat[0].length; + var i, j; + var ret = []; + for (j = 0; j < J; j++) { + var tmp = []; + for (i = 0; i < I; i++) { + tmp.push(mat[i][j]); + } + ret.push(tmp); + } + return ret; +} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/lib/esm/version.js b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/version.js new file mode 100644 index 0000000..abd1465 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/lib/esm/version.js @@ -0,0 +1,3 @@ +export var version = '13.2.0'; +// Note: This file is automatically generated when building math.js. +// Changes made in this file will be overwritten. \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/mathjs/package.json b/24_10_22_faktorialis/node_modules/mathjs/package.json new file mode 100644 index 0000000..7148bdb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/package.json @@ -0,0 +1,170 @@ +{ + "name": "mathjs", + "version": "13.2.0", + "description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.", + "author": "Jos de Jong (https://github.com/josdejong)", + "homepage": "https://mathjs.org", + "repository": { + "type": "git", + "url": "https://github.com/josdejong/mathjs.git" + }, + "license": "Apache-2.0", + "keywords": [ + "math", + "mathematics", + "functions", + "numeric", + "algebra", + "parser", + "expression", + "number", + "bignumber", + "complex", + "fraction", + "matrix", + "unit" + ], + "dependencies": { + "@babel/runtime": "^7.25.6", + "complex.js": "^2.1.1", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^4.3.7", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "devDependencies": { + "@babel/core": "7.25.2", + "@babel/plugin-transform-object-assign": "7.24.7", + "@babel/plugin-transform-optional-catch-binding": "7.24.7", + "@babel/plugin-transform-runtime": "7.25.4", + "@babel/preset-env": "7.25.4", + "@babel/register": "7.24.6", + "@types/assert": "1.5.10", + "@types/mocha": "10.0.8", + "@typescript-eslint/eslint-plugin": "7.16.1", + "@typescript-eslint/parser": "7.16.1", + "assert": "2.1.0", + "babel-loader": "9.2.1", + "benchmark": "2.1.4", + "c8": "10.1.2", + "codecov": "3.8.3", + "core-js": "3.38.1", + "del": "7.1.0", + "dtslint": "4.2.1", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-config-standard": "17.1.0", + "eslint-plugin-import": "2.30.0", + "eslint-plugin-mocha": "10.5.0", + "eslint-plugin-n": "16.6.2", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-promise": "6.6.0", + "expect-type": "0.20.0", + "expr-eval": "2.0.2", + "fancy-log": "2.0.0", + "glob": "11.0.0", + "gulp": "5.0.0", + "gulp-babel": "8.0.0", + "handlebars": "4.7.8", + "jsep": "1.3.9", + "karma": "6.4.4", + "karma-browserstack-launcher": "1.6.0", + "karma-firefox-launcher": "2.1.3", + "karma-mocha": "2.0.1", + "karma-mocha-reporter": "2.2.5", + "karma-webpack": "5.0.1", + "mkdirp": "3.0.1", + "mocha": "10.7.3", + "mocha-junit-reporter": "2.2.1", + "ndarray": "1.0.19", + "ndarray-determinant": "1.0.0", + "ndarray-gemm": "1.0.0", + "ndarray-ops": "1.2.2", + "ndarray-pack": "1.2.1", + "numericjs": "1.2.6", + "pad-right": "0.2.2", + "prettier": "3.3.3", + "process": "0.11.10", + "sinon": "19.0.2", + "sylvester": "0.0.21", + "ts-node": "10.9.2", + "typescript": "5.5.4", + "webpack": "5.95.0", + "zeros": "1.0.0" + }, + "type": "module", + "main": "./lib/cjs", + "types": "./types/index.d.ts", + "module": "./lib/esm", + "unpkg": "./lib/browser/math.js", + "jsdelivr": "./lib/browser/math.js", + "exports": { + ".": { + "types": "./types/index.d.ts", + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js" + }, + "./number": { + "types": "./types/index.d.ts", + "import": "./lib/esm/number.js", + "require": "./lib/cjs/number.js" + }, + "./lib/esm/number": { + "types": "./types/index.d.ts", + "import": "./lib/esm/number.js", + "require": "./lib/cjs/number.js" + }, + "./package.json": "./package.json", + "./lib/browser/math.js": "./lib/browser/math.js", + "./lib/browser/math.js.map": "./lib/browser/math.js.map" + }, + "files": [ + "bin", + "lib", + "types", + "LICENSE", + "NOTICE", + "README.md", + "HISTORY.md", + "CONTRIBUTING.md" + ], + "directories": { + "bin": "./bin", + "lib": "./lib" + }, + "scripts": { + "build": "gulp && npm run update-authors", + "build-and-test": "npm run build && npm run test:all && npm run lint", + "build:clean": "gulp clean", + "build:docs": "gulp docs", + "compile": "gulp compile", + "watch": "gulp watch", + "lint": "eslint --cache --max-warnings 0 src/ test/ types/", + "format": "npm run lint -- --fix", + "validate:ascii": "gulp validate:ascii", + "test": "npm run test:src && npm run lint", + "test:src": "mocha test/unit-tests", + "test:generated": "mocha test/generated-code-tests", + "test:node": "mocha test/node-tests/*.test.js test/node-tests/**/*.test.js", + "test:all": "npm run test:src && npm run test:generated && npm run test:node && npm run test:types", + "test:browser": "karma start test/browser-test-config/local-karma.js", + "test:browserstack": "karma start test/browser-test-config/browserstack-karma.js", + "test:types": " tsc -p ./tsconfig.json && node --loader ts-node/esm ./test/typescript-tests/testTypes.ts", + "coverage": "c8 --reporter=lcov --reporter=text-summary mocha test/unit-tests && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"", + "prepublishOnly": "npm run test:all && npm run lint", + "update-authors": "node ./tools/update-authors.js" + }, + "bin": { + "mathjs": "./bin/cli.js" + }, + "engines": { + "node": ">= 18" + }, + "bugs": { + "url": "https://github.com/josdejong/mathjs/issues" + }, + "sideEffects": false +} diff --git a/24_10_22_faktorialis/node_modules/mathjs/types/EXPLANATION.md b/24_10_22_faktorialis/node_modules/mathjs/types/EXPLANATION.md new file mode 100644 index 0000000..8f83778 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/types/EXPLANATION.md @@ -0,0 +1,66 @@ +# Mathjs TypeScript types + +The code base of Mathjs is written in JavaScript. The TypeScript definitions are maintained separately. + +## Library structure + +The over all structure is: + +- The library exports the core function `create` which creates a MathJS instance and returns `MathJsInstance`. +- Mathjs has a special function `chain`, which allows you to use the functions in a chained way, like `chain(2).add(3).done()`. The function `chain` returns an interface `MathJsChain`, which contains all mathjs functions and constants as a method. Unlike the static functions, these methods are defined with the chain instance `this` as first argument. +- The library exports collections with factory functions of all functions and their dependencies. To create an instance of the function `add`, one can do `create(addDependencies)` for example. To import all functions, one can do `create(all)`. +- The library also returns a static instance, which can directly be used like `import { add } from 'mathjs'`. + +## Defining the types of a new function + +Maintaining the TypeScript types is done manually. When adding a function, one has to create the following TypeScript definitions: + +1. Add a normal definition inside `interface MathJsInstance {...}` +2. Add a chained definition inside `interface MathJsChain {...}` +3. Add a static definition inside `export const {...} : MathJsInstance` +4. Add a dependencies definition inside `export const {...} : Record` + +For exampe for the function `add`, we can have the following definitions: + +```ts +// instance +export interface MathJsInstance extends MathJsFactory { + //... + add(x: T, y: T): T + //... +} + +// chain +export interface MathJsChain { + //... + add(this: MathJsChain, y: T): MathJsChain + //... +} + +// static +export const { + // ... + add, + // ... +} : MathJsInstance + + +// dependencies +export const { + // ... + addDependencies, + // ... +} : Record +``` + +## Testing the type definitions + +The types are defined in `types/index.d.ts`. + +The tests for the type definitions are located in `test/typescript-types/testTypes.ts`. + +To run the tests for the type definitions: + +``` +npm run test:types +``` diff --git a/24_10_22_faktorialis/node_modules/mathjs/types/index.d.ts b/24_10_22_faktorialis/node_modules/mathjs/types/index.d.ts new file mode 100644 index 0000000..16f4d16 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/types/index.d.ts @@ -0,0 +1,7260 @@ +import { Decimal } from 'decimal.js' + +export as namespace math + +export type NoLiteralType = T extends number + ? number + : T extends string + ? string + : T extends boolean + ? boolean + : T + +// TODO: introduce generics for MathCollection, MathMatrix, and MathArray +export type MathNumericType = number | BigNumber | bigint | Fraction | Complex +export type MathScalarType = MathNumericType | Unit +export type MathArray = MathNumericType[] | MathNumericType[][] // TODO: MathArray can also contain Unit +export type MathCollection = MathArray | Matrix +export type MathType = MathScalarType | MathCollection +export type MathExpression = string | string[] | MathCollection + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type FactoryFunction = (scope: any) => T + +// FactoryFunctionMap can be nested; all nested objects will be flattened +export interface FactoryFunctionMap { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: FactoryFunction | FactoryFunctionMap +} + +/** Available options for parse */ +export interface ParseOptions { + /** a set of custom nodes */ + nodes?: Record +} +/** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(). + * + * Note the evaluating arbitrary expressions may involve security risks, + * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. + * + * Syntax: + * + * math.parse(expr) + * math.parse(expr, options) + * math.parse([expr1, expr2, expr3, ...]) + * math.parse([expr1, expr2, expr3, ...], options) + * + * Example: + * + * const node1 = math.parse('sqrt(3^2 + 4^2)') + * node1.compile().evaluate() // 5 + * + * let scope = {a:3, b:4} + * const node2 = math.parse('a * b') // 12 + * const code2 = node2.compile() + * code2.evaluate(scope) // 12 + * scope.a = 5 + * code2.evaluate(scope) // 20 + * + * const nodes = math.parse(['a = 3', 'b = 4', 'a * b']) + * nodes[2].compile().evaluate() // 12 + * + * See also: + * + * evaluate, compile + */ +export interface ParseFunction { + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(); + * + * @param expr Expression to be parsed + * @param options Available options + * @returns A node + */ + (expr: MathExpression, options?: ParseOptions): MathNode + + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(); + * + * @param exprs Expressions to be parsed + * @param options Available options + * @returns An array of nodes + */ + (exprs: MathExpression[], options?: ParseOptions): MathNode[] + + /** + * Checks whether the current character `c` is a valid alpha character: + * + * - A latin letter (upper or lower case) Ascii: a-z, A-Z + * - An underscore Ascii: _ + * - A dollar sign Ascii: $ + * - A latin letter with accents Unicode: \u00C0 - \u02AF + * - A greek letter Unicode: \u0370 - \u03FF + * - A mathematical alphanumeric symbol Unicode: \u{1D400} - \u{1D7FF} excluding invalid code points + * + * The previous and next characters are needed to determine whether + * this character is part of a unicode surrogate pair. + * + * @param c Current character in the expression + * @param cPrev Previous character + * @param cNext Next character + */ + isAlpha(c: string, cPrev: string, cNext: string): boolean + /** + * Test whether a character is a valid latin, greek, or letter-like character + * + * @param c + */ + isValidLatinOrGreek(c: string): boolean + /** + * Test whether two given 16 bit characters form a surrogate pair of a + * unicode math symbol. + * + * https://unicode-table.com/en/ + * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode + * + * Note: In ES6 will be unicode aware: + * https://stackoverflow.com/questions/280712/javascript-unicode-regexes + * https://mathiasbynens.be/notes/es6-unicode-regex + * + * @param high + * @param low + */ + isValidMathSymbol(high: string, low: string): boolean + /** + * Check whether given character c is a white space character: space, tab, or enter + * + * @param c + * @param nestingLevel + */ + isWhitespace(c: string, nestingLevel: number): boolean + /** + * Test whether the character c is a decimal mark (dot). + * This is the case when it's not the start of a delimiter '.*', './', or '.^' + * + * @param c + * @param cNext + */ + isDecimalMark(c: string, cNext: string): boolean + /** + * checks if the given char c is a digit or dot + * + * @param c a string with one character + */ + isDigitDot(c: string): boolean + /** + * checks if the given char c is a digit + * + * @param c a string with one character + */ + isDigit(c: string): boolean + /** + * checks if the given char c is a hex digit + * + * @param c a string with one character + */ + isHexDigit(c: string): boolean +} + +export interface NodeCtor { + new (): MathNode +} + +export interface AccessorNode + extends MathNode { + type: 'AccessorNode' + isAccessorNode: true + object: TObject + index: IndexNode + name: string +} +export interface AccessorNodeCtor { + new ( + object: TObject, + index: IndexNode + ): AccessorNode +} + +export interface ArrayNode + extends MathNode { + type: 'ArrayNode' + isArrayNode: true + items: [...TItems] +} +export interface ArrayNodeCtor { + new ( + items: [...TItems] + ): ArrayNode +} + +export interface AssignmentNode + extends MathNode { + type: 'AssignmentNode' + isAssignmentNode: true + object: SymbolNode | AccessorNode + index: IndexNode | null + value: TValue + name: string +} +export interface AssignmentNodeCtor { + new ( + object: SymbolNode, + value: TValue + ): AssignmentNode + new ( + object: SymbolNode | AccessorNode, + index: IndexNode, + value: TValue + ): AssignmentNode +} + +export interface BlockNode extends MathNode { + type: 'BlockNode' + isBlockNode: true + blocks: Array<{ node: TNode; visible: boolean }> +} +export interface BlockNodeCtor { + new ( + arr: Array<{ node: TNode } | { node: TNode; visible: boolean }> + ): BlockNode +} + +export interface ConditionalNode< + TCond extends MathNode = MathNode, + TTrueNode extends MathNode = MathNode, + TFalseNode extends MathNode = MathNode +> extends MathNode { + type: 'ConditionalNode' + isConditionalNode: boolean + condition: TCond + trueExpr: TTrueNode + falseExpr: TFalseNode +} +export interface ConditionalNodeCtor { + new < + TCond extends MathNode = MathNode, + TTrueNode extends MathNode = MathNode, + TFalseNode extends MathNode = MathNode + >( + condition: TCond, + trueExpr: TTrueNode, + falseExpr: TFalseNode + ): ConditionalNode +} + +export interface ConstantNode< + TValue extends + | string + | number + | boolean + | null + | undefined + | bigint + | BigNumber + | Fraction = number +> extends MathNode { + type: 'ConstantNode' + isConstantNode: true + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: TValue +} + +export interface ConstantNodeCtor { + new < + TValue extends + | string + | number + | boolean + | null + | undefined + | bigint + | BigNumber + | Fraction = string + >( + value: TValue + ): ConstantNode +} + +export interface FunctionAssignmentNode + extends MathNode { + type: 'FunctionAssignmentNode' + isFunctionAssignmentNode: true + name: string + params: string[] + expr: TExpr +} +export interface FunctionAssignmentNodeCtor { + new ( + name: string, + params: string[], + expr: TExpr + ): FunctionAssignmentNode +} + +export interface FunctionNode< + TFn = SymbolNode, + TArgs extends MathNode[] = MathNode[] +> extends MathNode { + type: 'FunctionNode' + isFunctionNode: true + fn: TFn + args: [...TArgs] +} +export interface FunctionNodeCtor { + new ( + fn: TFn, + args: [...TArgs] + ): FunctionNode + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onUndefinedFunction: (name: string) => any +} + +export interface IndexNode + extends MathNode { + type: 'IndexNode' + isIndexNode: true + dimensions: [...TDims] + dotNotation: boolean +} +export interface IndexNodeCtor { + new (dimensions: [...TDims]): IndexNode + new ( + dimensions: [...TDims], + dotNotation: boolean + ): IndexNode +} + +export interface ObjectNode< + TProps extends Record = Record +> extends MathNode { + type: 'ObjectNode' + isObjectNode: true + properties: TProps +} +export interface ObjectNodeCtor { + new = Record>( + properties: TProps + ): ObjectNode +} + +export type OperatorNodeMap = { + xor: 'xor' + and: 'and' + or: 'or' + bitOr: '|' + bitXor: '^|' + bitAnd: '&' + equal: '==' + unequal: '!=' + smaller: '<' + larger: '>' + smallerEq: '<=' + largerEq: '>=' + leftShift: '<<' + rightArithShift: '>>' + rightLogShift: '>>>' + to: 'to' + add: '+' + subtract: '-' + multiply: '*' + divide: '/' + dotMultiply: '.*' + dotDivide: './' + mod: 'mod' + unaryPlus: '+' + unaryMinus: '-' + bitNot: '~' + not: 'not' + pow: '^' + dotPow: '.^' + factorial: '!' +} + +export type OperatorNodeOp = OperatorNodeMap[keyof OperatorNodeMap] +export type OperatorNodeFn = keyof OperatorNodeMap + +export interface OperatorNode< + TOp extends OperatorNodeMap[TFn] = never, + TFn extends OperatorNodeFn = never, + TArgs extends MathNode[] = MathNode[] +> extends MathNode { + type: 'OperatorNode' + isOperatorNode: true + op: TOp + fn: TFn + args: [...TArgs] + implicit: boolean + isUnary(): boolean + isBinary(): boolean +} + +export interface OperatorNodeCtor extends MathNode { + new < + TOp extends OperatorNodeMap[TFn], + TFn extends OperatorNodeFn, + TArgs extends MathNode[] + >( + op: TOp, + fn: TFn, + args: [...TArgs], + implicit?: boolean + ): OperatorNode +} +export interface ParenthesisNode + extends MathNode { + type: 'ParenthesisNode' + isParenthesisNode: true + content: TContent +} +export interface ParenthesisNodeCtor { + new (content: TContent): ParenthesisNode +} + +export interface RangeNode< + TStart extends MathNode = MathNode, + TEnd extends MathNode = MathNode, + TStep extends MathNode = MathNode +> extends MathNode { + type: 'RangeNode' + isRangeNode: true + start: TStart + end: TEnd + step: TStep | null +} +export interface RangeNodeCtor { + new < + TStart extends MathNode = MathNode, + TEnd extends MathNode = MathNode, + TStep extends MathNode = MathNode + >( + start: TStart, + end: TEnd, + step?: TStep + ): RangeNode +} + +export interface RelationalNode + extends MathNode { + type: 'RelationalNode' + isRelationalNode: true + conditionals: string[] + params: [...TParams] +} +export interface RelationalNodeCtor { + new ( + conditionals: string[], + params: [...TParams] + ): RelationalNode +} + +export interface SymbolNode extends MathNode { + type: 'SymbolNode' + isSymbolNode: true + name: string +} +export interface SymbolNodeCtor { + new (name: string): SymbolNode + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onUndefinedSymbol: (name: string) => any +} + +/** + * @deprecated since version 11.3. Prefer `MathNode` instead + */ +export type MathNodeCommon = MathNode + +export type MathJsFunctionName = keyof MathJsInstance + +export interface LUDecomposition { + L: MathCollection + U: MathCollection + p: number[] +} + +export interface SLUDecomposition extends LUDecomposition { + q: number[] +} + +export interface QRDecomposition { + Q: MathCollection + R: MathCollection +} + +export interface SchurDecomposition { + U: MathCollection + T: MathCollection +} + +export interface FractionDefinition { + a: number + b: number +} + +export interface MathJsInstance extends MathJsFactory { + e: number + pi: number + i: number + Infinity: number + LN2: number + LN10: number + LOG2E: number + LOG10E: number + NaN: number + phi: number + SQRT1_2: number + SQRT2: number + tau: number + + // Class-like constructors + Node: NodeCtor + AccessorNode: AccessorNodeCtor + ArrayNode: ArrayNodeCtor + AssignmentNode: AssignmentNodeCtor + BlockNode: BlockNodeCtor + ConditionalNode: ConditionalNodeCtor + ConstantNode: ConstantNodeCtor + FunctionAssignmentNode: FunctionAssignmentNodeCtor + FunctionNode: FunctionNodeCtor + IndexNode: IndexNodeCtor + ObjectNode: ObjectNodeCtor + OperatorNode: OperatorNodeCtor + ParenthesisNode: ParenthesisNodeCtor + RangeNode: RangeNodeCtor + RelationalNode: RelationalNodeCtor + SymbolNode: SymbolNodeCtor + + Unit: UnitCtor + Matrix: MatrixCtor + + /** + * If null were to be included in this interface, it would be + * auto-suggested as an import in VSCode. This causes issues because + * `null` is not a valid label. + * + * @see https://github.com/josdejong/mathjs/issues/2019 + */ + // null: number; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + uninitialized: any + version: string + + expression: MathNode + + /** + * Returns reviver function that can be used as reviver in JSON.parse function. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + reviver(): (key: any, value: any) => any + + /** + * Returns replacer function that can be used as replacer in JSON.stringify function. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer(): (key: any, value: any) => any + + /************************************************************************* + * Core functions + ************************************************************************/ + + /** + * Set configuration options for math.js, and get current options. Will + * emit a ‘config’ event, with arguments (curr, prev, changes). + * @param options Available options: {number} relTol Minimum relative + * difference between two compared values, used by all comparison + * functions. {number} absTol Minimum absolute + * 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. {string} parenthesis How to + * display parentheses in LaTeX and string output. {string} randomSeed + * Random seed for seeded pseudo random number generator. Set to null to + * randomly seed. + * @returns Returns the current configuration + */ + config: (options: ConfigOptions) => ConfigOptions + /** + * Create a typed-function which checks the types of the arguments and + * can match them against multiple provided signatures. The + * typed-function automatically converts inputs in order to find a + * matching signature. Typed functions throw informative errors in case + * of wrong input arguments. + * @param name Optional name for the typed-function + * @param signatures Object with one or multiple function signatures + * @returns The created typed-function. + */ + typed: ( + name: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + signatures: Record any> + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) => (...args: any[]) => any + + /************************************************************************* + * Construction functions + ************************************************************************/ + + /** + * Create a BigNumber, which can store numbers with arbitrary precision. + * When a matrix is provided, all elements will be converted to + * BigNumber. + * @param x Value for the big number, 0 by default. + * @returns The created bignumber + */ + bignumber( + x?: number | string | Fraction | BigNumber | bigint | Unit | boolean | null + ): BigNumber + bignumber(x: T): T + + /** + * Create a bigint, which can store integers with arbitrary precision. + * When a matrix is provided, all elements will be converted to + * bigint. + * @param x Value for the integer, 0 by default. + * @returns The created bigint + */ + bigint( + x?: number | string | Fraction | BigNumber | bigint | boolean | null + ): bigint + bigint(x: T): T + + /** + * Create a boolean or convert a string or number to a boolean. In case + * of a number, true is returned for non-zero numbers, and false in case + * of zero. Strings can be 'true' or 'false', or can contain a number. + * When value is a matrix, all elements will be converted to boolean. + * @param x A value of any type + * @returns The boolean value + */ + boolean(x: string | number | boolean | null): boolean + boolean(x: MathCollection): MathCollection + + /** + * Wrap any value in a chain, allowing to perform chained operations on + * the value. All methods available in the math.js library can be called + * upon the chain, and then will be evaluated with the value itself as + * first argument. The chain can be closed by executing chain.done(), + * which returns the final value. The chain has a number of special + * functions: done() Finalize the chain and return the chain's value. + * valueOf() The same as done() toString() Executes math.format() onto + * the chain's value, returning a string representation of the value. + * @param value A value of any type on which to start a chained + * operation. + * @returns The created chain + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + chain(value?: TValue): MathJsChain + + /** + * Create a complex value or convert a value to a complex value. + * @param args Arguments specifying the real and imaginary part of the + * complex number + * @returns Returns a complex value + */ + complex(arg?: MathNumericType | string | PolarCoordinates): Complex + complex(arg?: MathCollection): MathCollection + /** + * @param re Argument specifying the real part of the complex number + * @param im Argument specifying the imaginary part of the complex + * number + * @returns Returns a complex value + */ + complex(re: number, im: number): Complex + + /** + * Create a user-defined unit and register it with the Unit type. + * @param name The name of the new unit. Must be unique. Example: ‘knot’ + * @param definition Definition of the unit in terms of existing units. + * For example, ‘0.514444444 m / s’. + * @param options (optional) An object containing any of the following + * properties:
    - prefixes {string} “none”, “short”, “long”, + * “binary_short”, or “binary_long”. The default is “none”.
    - + * aliases {Array} Array of strings. Example: [‘knots’, ‘kt’, + * ‘kts’]
    - offset {Numeric} An offset to apply when converting from + * the unit. For example, the offset for celsius is 273.15. Default is + * 0. + * @returns The new unit + */ + createUnit( + name: string, + definition?: string | UnitDefinition | Unit, + options?: CreateUnitOptions + ): Unit + /** + * Create a user-defined unit and register it with the Unit type. + * @param units Definition of the unit + * @param options + * @returns The new unit + */ + createUnit( + units: Record, + options?: CreateUnitOptions + ): Unit + + /** + * Create a fraction convert a value to a fraction. + * @param value Arguments specifying the numerator and denominator of the + * fraction + * @returns Returns a fraction + */ + fraction( + value: + | number + | string + | BigNumber + | bigint + | Unit + | Fraction + | FractionDefinition + ): Fraction + fraction(values: MathCollection): MathCollection + /** + * @param numerator Argument specifying the numerator of the fraction + * @param denominator Argument specifying the denominator of the + * fraction + * @returns Returns a fraction + */ + fraction(numerator: number, denominator: number): Fraction + + /** + * Create an index. An Index can store ranges having start, step, and + * end for multiple dimensions. Matrix.get, Matrix.set, and math.subset + * accept an Index as input. + * @param ranges Zero or more ranges or numbers. + * @returns Returns the created index + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + index(...ranges: any[]): Index + + /** + * Create a Matrix. The function creates a new math.type.Matrix object + * from an Array. A Matrix has utility functions to manipulate the data + * in the matrix, like getting the size and getting or setting values in + * the matrix. Supported storage formats are 'dense' and 'sparse'. + * @param format The Matrix storage format + * @returns The created Matrix + */ + matrix(format?: 'sparse' | 'dense'): Matrix + /** + * @param data A multi dimensional array + * @param format The Matrix storage format + * @param dataType The Matrix data type + * @returns The created Matrix + */ + matrix( + data: MathCollection | string[], + format?: 'sparse' | 'dense', + dataType?: string + ): Matrix + + /** + * Create a number or convert a string, boolean, or unit to a number. + * When value is a matrix, all elements will be converted to number. + * @param value Value to be converted + * @returns The created number + */ + number( + value?: + | string + | number + | BigNumber + | bigint + | Fraction + | boolean + | Unit + | null + ): number + number(value?: MathCollection): number | MathCollection + /** + * @param value Value to be converted + * @param valuelessUnit A valueless unit, used to convert a unit to a + * number + * @returns The created number + */ + number(unit: Unit, valuelessUnit: Unit | string): number + + /** + * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction. + * @param value The value to be converted + * @param outputType The desired numeric output type + */ + numeric( + value: string | number | BigNumber | bigint | Fraction, + outputType: 'number' + ): number + numeric( + value: string | number | BigNumber | bigint | Fraction, + outputType: 'BigNumber' + ): BigNumber + numeric( + value: string | number | BigNumber | bigint | Fraction, + outputType: 'bigint' + ): bigint + numeric( + value: string | number | BigNumber | bigint | Fraction, + outputType: 'Fraction' + ): Fraction + + /** + * Create a Sparse Matrix. The function creates a new math.type.Matrix + * object from an Array. A Matrix has utility functions to manipulate + * the data in the matrix, like getting the size and getting or setting + * values in the matrix. + * @param data A two dimensional array + * @param dataType Sparse Matrix data type + * @returns The created matrix + */ + sparse(data?: MathCollection, dataType?: string): Matrix + + /** + * Split a unit in an array of units whose sum is equal to the original + * unit. + * @param unit A unit to be split + * @param parts An array of strings or valueless units + * @returns An array of units + */ + splitUnit(unit: Unit, parts: Unit[]): Unit[] + + /** + * Create a string or convert any object into a string. Elements of + * Arrays and Matrices are processed element wise. + * @param value A value to convert to a string + * @returns The created string + */ + string(value: MathNumericType | string | Unit | null): string + string(value: MathCollection): MathCollection + + /** + * Create a unit. Depending on the passed arguments, the function will + * create and return a new math.type.Unit object. When a matrix is + * provided, all elements will be converted to units. + * @param unit The unit to be created + * @returns The created unit + */ + unit(unit: string): Unit + /** + * @param unit The unit to be created + * @returns The created unit + */ + unit(unit: Unit): Unit + /** + * @param value The value of the unit to be created + * @param unit The unit to be created + * @returns The created unit + */ + unit(value: MathNumericType, unit: string): Unit + unit(value: MathCollection, unit: string): Unit[] + + /************************************************************************* + * Expression functions + ************************************************************************/ + + /** + * Parse and compile an expression. Returns a an object with a function + * evaluate([scope]) to evaluate the compiled expression. + * @param expr The expression to be compiled + * @returns An object with the compiled expression + */ + compile(expr: MathExpression): EvalFunction + /** + * @param exprs The expressions to be compiled + * @returns An array of objects with the compiled expressions + */ + compile(exprs: MathExpression[]): EvalFunction[] + + // TODO properly type this + /** + * Evaluate an expression. + * @param expr The expression to be evaluated + * @param scope Scope to read/write variables + * @returns The result of the expression + */ + evaluate( + expr: MathExpression | Matrix, + scope?: object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): any + evaluate( + expr: MathExpression[], + scope?: object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): any[] + + /** + * Retrieve help on a function or data type. Help files are retrieved + * from the documentation in math.expression.docs. + * @param search A function or function name for which to get help + * @returns A help object + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + help(search: () => any): Help + + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(); + */ + parse: ParseFunction + + /** + * Create a parser. The function creates a new math.expression.Parser + * object. + * @returns A Parser object + */ + parser(): Parser + + /************************************************************************* + * Algebra functions + ************************************************************************/ + /** + * @param expr The expression to differentiate + * @param variable The variable over which to differentiate + * @param options There is one option available, simplify, which is true + * by default. When false, output will not be simplified. + * @returns The derivative of expr + */ + derivative( + expr: MathNode | string, + variable: MathNode | string, + options?: { simplify: boolean } + ): MathNode + + /** + * Solves the linear equation system by forwards substitution. Matrix + * must be a lower triangular matrix. + * @param L A N x N matrix or array (L) + * @param b A column vector with the b values + * @returns A column vector with the linear system solution (x) + */ + lsolve(L: Matrix, b: MathCollection): Matrix + lsolve(L: MathArray, b: MathCollection): MathArray + + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A + * is decomposed in two matrices (L, U) and a row permutation vector p + * where A[p,:] = L * U + * @param A A two dimensional matrix or array for which to get the LUP + * decomposition. + * @returns The lower triangular matrix, the upper triangular matrix and + * the permutation matrix. + */ + lup(A?: MathCollection): LUDecomposition + + /** + * Solves the linear system A * x = b where A is an [n x n] matrix and b + * is a [n] column vector. + * @param A Invertible Matrix or the Matrix LU decomposition + * @param b Column Vector + * @param order The Symbolic Ordering and Analysis order, see slu for + * details. Matrix must be a SparseMatrix + * @param threshold Partial pivoting threshold (1 for partial pivoting), + * see slu for details. Matrix must be a SparseMatrix. + * @returns Column vector with the solution to the linear system A * x = + * b + */ + lusolve( + A: Matrix, + b: MathCollection, + order?: number, + threshold?: number + ): Matrix + + lusolve( + A: MathArray, + b: MathCollection, + order?: number, + threshold?: number + ): MathArray + + lusolve(A: LUDecomposition, b: MathCollection): Matrix + + /* Finds the roots of a polynomial of degree three or less. Coefficients are given constant first + * followed by linear and higher powers in order; coefficients beyond the degree of the polynomial + * need not be specified. + * @param {number|Complex} constantCoeff + * @param {number|Complex} linearCoeff + * @param {number|Complex} quadraticCoeff + * @param {number|Complex} cubicCoeff + * @returns {Array} array of roots of specified polynomial + */ + polynomialRoot( + constantCoeff: number | Complex, + linearCoeff: number | Complex, + quadraticCoeff?: number | Complex, + cubicCoeff?: number | Complex + ): (number | Complex)[] + + /** + * Calculate the Matrix QR decomposition. Matrix A is decomposed in two + * matrices (Q, R) where Q is an orthogonal matrix and R is an upper + * triangular matrix. + * @param A A two dimensional matrix or array for which to get the QR + * decomposition. + * @returns Q: the orthogonal matrix and R: the upper triangular matrix + */ + qr(A: MathCollection): QRDecomposition + + rationalize( + expr: MathNode | string, + optional?: object | boolean, + detailed?: false + ): MathNode + /** + * Transform a rationalizable expression in a rational fraction. If + * rational fraction is one variable polynomial then converts the + * numerator and denominator in canonical form, with decreasing + * exponents, returning the coefficients of numerator. + * @param expr The expression to check if is a polynomial expression + * @param optional scope of expression or true for already evaluated + * rational expression at input + * @param detailed optional True if return an object, false if return + * expression node (default) + * @returns The rational polynomial of expr + */ + rationalize( + expr: MathNode | string, + optional?: object | boolean, + detailed?: true + ): { + expression: MathNode | string + variables: string[] + coefficients: MathType[] + } + + /** + * Simplify an expression tree. + * @param expr The expression to be simplified + * @param [rules] (optional) A list of rules are applied to an expression, repeating + * over the list until no further changes are made. It’s possible to + * pass a custom set of rules to the function as second argument. A rule + * can be specified as an object, string, or function. + * @param [scope] (optional) Scope to variables + * @param [options] (optional) An object with simplify options + * @returns Returns the simplified form of expr + */ + simplify: Simplify + + simplifyConstant(expr: MathNode | string, options?: SimplifyOptions): MathNode + simplifyCore(expr: MathNode | string, options?: SimplifyOptions): MathNode + + /** + * Gives the number of “leaf nodes” in the parse tree of the given + * expression. A leaf node is one that has no subexpressions, essentially + * either a symbol or a constant. Note that `5!` has just one leaf, the `5`; + * the unary factorial operator does not add a leaf. On the other hand, + * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves. + */ + leafCount(expr: MathNode): number + + /** + * Replaces variable nodes with their scoped values + * @param node Tree to replace variable nodes in + * @param scope Scope to read/write variables + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + resolve(node: MathNode | string, scope?: Record): MathNode + resolve( + node: (MathNode | string)[], + // eslint-disable-next-line @typescript-eslint/no-explicit-any + scope?: Record + ): MathNode[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + resolve(node: Matrix, scope?: Record): Matrix + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. + * Sparse Matrix A is decomposed in two matrices (L, U) and two + * permutation vectors (pinv, q) where P * A * Q = L * U + * @param A A two dimensional sparse matrix for which to get the LU + * decomposition. + * @param order The Symbolic Ordering and Analysis order: 0 - Natural + * ordering, no permutation vector q is returned 1 - Matrix must be + * square, symbolic ordering and analisis is performed on M = A + A' 2 - + * Symbolic ordering and analysis is performed on M = A' * A. Dense + * columns from A' are dropped, A recreated from A'. This is appropriate + * for LU factorization of non-symmetric matrices. 3 - Symbolic ordering + * and analysis is performed on M = A' * A. This is best used for LU + * factorization is matrix M has no dense rows. A dense row is a row + * with more than 10*sqr(columns) entries. + * @param threshold Partial pivoting threshold (1 for partial pivoting) + * @returns The lower triangular matrix, the upper triangular matrix and + * the permutation vectors. + */ + slu(A: Matrix, order: number, threshold: number): SLUDecomposition + + /** + * Solves the linear equation system by backward substitution. Matrix + * must be an upper triangular matrix. U * x = b + * @param U A N x N matrix or array (U) + * @param b A column vector with the b values + * @returns A column vector with the linear system solution (x) + */ + usolve(U: Matrix, b: MathCollection): Matrix + usolve(U: MathArray, b: MathCollection): MathArray + + /************************************************************************* + * Arithmetic functions + ************************************************************************/ + + /** + * Calculate the absolute value of a number. For matrices, the function + * is evaluated element wise. + * @param x A number or matrix for which to get the absolute value + * @returns Absolute value of x + */ + abs(x: T): T + + /** + * Add two values, x + y. For matrices, the function is evaluated + * element wise. + * @param x First value to add + * @param y Second value to add + * @returns Sum of x and y + */ + add(x: T, y: T): T + add(...values: T[]): T + add(x: MathType, y: MathType): MathType + add(...values: MathType[]): MathType + + /** + * Calculate the cubic root of a value. + * @param x Value for which to calculate the cubic root. + * @param allRoots Optional, false by default. Only applicable when x is + * a number or complex number. If true, all complex roots are returned, + * if false (default) the principal root is returned. + * @returns Returns the cubic root of x + */ + cbrt(x: Complex, allRoots?: boolean): Complex + cbrt(x: T): T + + // Rounding functions, grouped for similarity, even though it breaks + // the alphabetic order among arithmetic functions. + + /** + * Round a value towards plus infinity If x is complex, both real and + * imaginary part are rounded towards plus infinity. For matrices, the + * function is evaluated element wise. + * @param x Number to be rounded + * @param n Number of decimals Default value: 0. + * @returns Rounded value + */ + ceil( + x: T, + n?: number | BigNumber + ): NoLiteralType + ceil(x: MathNumericType, n: U): U + + /** + * Round a value towards zero. For matrices, the function is evaluated + * element wise. + * @param x Number to be rounded + * @param n Number of decimals Default value: 0. + * @returns Rounded value + */ + fix( + x: T, + n?: number | BigNumber + ): NoLiteralType + fix(x: MathNumericType, n: U): U + + /** + * Round a value towards minus infinity. For matrices, the function is + * evaluated element wise. + * @param x Number to be rounded + * @param n Number of decimals Default value: 0. + * @returns Rounded value + */ + floor( + x: T, + n?: number | BigNumber + ): NoLiteralType + floor(x: MathNumericType, n: U): U + + /** + * Round a value towards the nearest integer. For matrices, the function + * is evaluated element wise. + * @param x Number to be rounded + * @param n Number of decimals Default value: 0. + * @returns Rounded value of x + */ + round( + x: T, + n?: number | BigNumber + ): NoLiteralType + round(x: MathNumericType, n: U): U + round(x: U, unit: Unit): U + round(x: Unit, unit: Unit): Unit + round(x: Unit, n: number | BigNumber, unit: Unit): Unit + round(x: U, n: number | BigNumber, unit: Unit): U + + // End of group of rounding functions + + /** + * Compute the cube of a value, x * x * x. For matrices, the function is + * evaluated element wise. + * @param x Number for which to calculate the cube + * @returns Cube of x + */ + cube(x: T): T + + /** + * Divide two values, x / y. To divide matrices, x is multiplied with + * the inverse of y: x * inv(y). + * @param x Numerator + * @param y Denominator + * @returns Quotient, x / y + */ + divide(x: Unit, y: Unit): Unit | number + divide(x: Unit, y: number): Unit + divide(x: number, y: number): number + divide(x: MathType, y: MathType): MathType + + /** + * Divide two matrices element wise. The function accepts both matrices + * and scalar values. + * @param x Numerator + * @param y Denominator + * @returns Quotient, x ./ y + */ + dotDivide(x: T, y: MathType): T + dotDivide(x: MathType, y: T): T + dotDivide(x: Unit, y: MathType): Unit + dotDivide(x: MathType, y: Unit): Unit + dotDivide(x: MathNumericType, y: MathNumericType): MathNumericType + + /** + * Multiply two matrices element wise. The function accepts both + * matrices and scalar values. + * @param x Left hand value + * @param y Right hand value + * @returns Multiplication of x and y + */ + dotMultiply(x: T, y: MathType): T + dotMultiply(x: MathType, y: T): T + dotMultiply(x: Unit, y: MathType): Unit + dotMultiply(x: MathType, y: Unit): Unit + dotMultiply(x: MathNumericType, y: MathNumericType): MathNumericType + + /** + * Calculates the power of x to y element wise. + * @param x The base + * @param y The exponent + * @returns The value of x to the power y + */ + dotPow(x: T, y: MathType): T + + /** + * Calculate the exponent of a value. For matrices, the function is + * evaluated element wise. + * @param x A number or matrix to exponentiate + * @returns Exponent of x + */ + exp(x: T): T + + /** + * Calculate the value of subtracting 1 from the exponential value. For + * matrices, the function is evaluated element wise. + * @param x A number or matrix to apply expm1 + * @returns Exponent of x + */ + expm1(x: T): T + + /** + * Calculate the greatest common divisor for two or more values or + * arrays. For matrices, the function is evaluated element wise. + * @param args Two or more integer numbers + * @returns The greatest common divisor + */ + gcd(...args: T[]): T + gcd(args: T[]): T + + /** + * Calculate the hypotenuse of a list with values. The hypotenuse is + * defined as: hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) For + * matrix input, the hypotenuse is calculated for all values in the + * matrix. + * @param args A list with numeric values or an Array or Matrix. Matrix + * and Array input is flattened and returns a single number for the + * whole matrix. + * @returns Returns the hypothenuse of the input values. + */ + hypot(...args: T[]): T + hypot(args: T[]): T + + /** + * Calculate the least common multiple for two or more values or arrays. + * lcm is defined as: lcm(a, b) = abs(a * b) / gcd(a, b) For matrices, + * the function is evaluated element wise. + * @param a An integer number + * @param b An integer number + * @returns The least common multiple + */ + lcm(a: T, b: T): T + + /** + * Calculate the logarithm of a value. + * @param x Value for which to calculate the logarithm. + * @param base Optional base for the logarithm. If not provided, the + * natural logarithm of x is calculated. Default value: e. + * @returns Returns the logarithm of x + */ + log( + x: T, + base?: number | BigNumber | Complex + ): NoLiteralType + + /** + * Calculate the 10-base of a value. This is the same as calculating + * log(x, 10). For matrices, the function is evaluated element wise. + * @param x Value for which to calculate the logarithm. + * @returns Returns the 10-base logarithm of x + */ + log10(x: T): T + + /** + * Calculate the logarithm of a value+1. For matrices, the function is + * evaluated element wise. + * @param x Value for which to calculate the logarithm. + * @returns Returns the logarithm of x+1 + */ + log1p( + x: T, + base?: number | BigNumber | Complex + ): T + + /** + * Calculate the 2-base of a value. This is the same as calculating + * log(x, 2). For matrices, the function is evaluated element wise. + * @param x Value for which to calculate the logarithm. + * @returns Returns the 2-base logarithm of x + */ + log2(x: T): T + + /** + * Calculates the modulus, the remainder of an integer division. For + * matrices, the function is evaluated element wise. The modulus is + * defined as: x - y * floor(x / y) + * @see http://en.wikipedia.org/wiki/Modulo_operation. + * @param x Dividend + * @param y Divisor + * @returns Returns the remainder of x divided by y + */ + mod( + x: T, + y: number | BigNumber | bigint | Fraction | MathCollection + ): NoLiteralType + + /** + * Multiply two values, x * y. The result is squeezed. For matrices, the + * matrix product is calculated. + * @param x The first value to multiply + * @param y The second value to multiply + * @returns Multiplication of x and y + */ + + multiply(x: T, y: MathType): Matrix + multiply(x: MathType, y: T): Matrix + + multiply(x: T, y: T[]): T + multiply(x: T[], y: T): T + multiply(x: T, y: T): T + multiply(x: Unit, y: Unit): Unit + multiply(x: number, y: number): number + multiply(x: MathType, y: MathType): MathType + multiply(...values: T[]): T + multiply(...values: MathType[]): MathType + + /** + * Calculate the norm of a number, vector or matrix. The second + * parameter p is optional. If not provided, it defaults to 2. + * @param x Value for which to calculate the norm + * @param p Vector space. Supported numbers include Infinity and + * -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The + * Frobenius norm) Default value: 2. + * @returns the p-norm + */ + norm( + x: number | BigNumber | Complex | MathCollection, + p?: number | BigNumber | string + ): number | BigNumber + + /** + * Calculate the nth root of a value. The principal nth root of a + * positive real number A, is the positive real solution of the equation + * x^root = A For matrices, the function is evaluated element wise. + * @param a Value for which to calculate the nth root + * @param root The root. Default value: 2. + * @return The nth root of a + */ + nthRoot( + a: number | BigNumber | MathCollection | Complex, + root?: number | BigNumber + ): number | Complex | MathCollection + + /** + * Calculates the power of x to y, x ^ y. Matrix exponentiation is + * supported for square matrices x, and positive integer exponents y. + * @param x The base + * @param y The exponent + * @returns x to the power y + */ + pow(x: MathType, y: number | BigNumber | bigint | Complex): MathType + + /** + * Compute the sign of a value. The sign of a value x is: 1 when x > 1 + * -1 when x < 0 0 when x == 0 For matrices, the function is evaluated + * element wise. + * @param x The number for which to determine the sign + * @returns The sign of x + */ + sign(x: T): T + + /** + * Calculate the square root of a value. For matrices, use either + * sqrtm for the matrix square root, or map(M, sqrt) to take the + * square root element wise. + * @param x Value for which to calculate the square root + * @returns Returns the square root of x + */ + sqrt(x: number): number | Complex + sqrt(x: T): T + + /** + * Compute the square of a value, x * x. + * @param x Number for which to calculate the square + * @returns Squared value + */ + square(x: T): T + + /** + * Subtract two values, x - y. For matrices, the function is evaluated + * element wise. + * @param x Initial value + * @param y Value to subtract from x + * @returns Subtraction of x and y + */ + subtract(x: T, y: T): T + subtract(x: MathType, y: MathType): MathType + + /** + * Inverse the sign of a value, apply a unary minus operation. For + * matrices, the function is evaluated element wise. Boolean values and + * strings will be converted to a number. For complex numbers, both real + * and complex value are inverted. + * @param x Number to be inverted + * @returns Retursn the value with inverted sign + */ + unaryMinus(x: T): T + + /** + * Unary plus operation. Boolean values and strings will be converted to + * a number, numeric values will be returned as is. For matrices, the + * function is evaluated element wise. + * @param x Input value + * @returns Returns the input value when numeric, converts to a number + * when input is non-numeric. + */ + unaryPlus(x: T): T + + /** + * Calculate the extended greatest common divisor for two values. See + * http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + * @param a An integer number + * @param b An integer number + * @returns Returns an array containing 3 integers [div, m, n] where div + * = gcd(a, b) and a*m + b*n = div + */ + xgcd(a: number | BigNumber, b: number | BigNumber): MathArray + + /************************************************************************* + * Bitwise functions + ************************************************************************/ + + /** + * Bitwise AND two values, x & y. For matrices, the function is + * evaluated element wise. + * @param x First value to and + * @param y Second value to and + * @returns AND of x and y + */ + bitAnd( + x: T, + y: number | BigNumber | bigint | MathCollection + ): NoLiteralType + + /** + * Bitwise NOT value, ~x. For matrices, the function is evaluated + * element wise. For units, the function is evaluated on the best prefix + * base. + * @param x Value to not + * @returns NOT of x + */ + bitNot(x: T): T + + /** + * Bitwise OR two values, x | y. For matrices, the function is evaluated + * element wise. For units, the function is evaluated on the lowest + * print base. + * @param x First value to or + * @param y Second value to or + * @returns OR of x and y + */ + bitOr(x: T, y: T): T + + /** + * Bitwise XOR two values, x ^ y. For matrices, the function is + * evaluated element wise. + * @param x First value to xor + * @param y Second value to xor + * @returns XOR of x and y + */ + bitXor( + x: T, + y: number | BigNumber | bigint | MathCollection + ): NoLiteralType + + /** + * Bitwise left logical shift of a value x by y number of bits, x << y. + * For matrices, the function is evaluated element wise. For units, the + * function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + * @returns x shifted left y times + */ + leftShift( + x: T, + y: number | BigNumber | bigint + ): NoLiteralType + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, x >> + * y. For matrices, the function is evaluated element wise. For units, + * the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + * @returns x sign-filled shifted right y times + */ + rightArithShift( + x: T, + y: number | BigNumber | bigint + ): NoLiteralType + + /** + * Bitwise right logical shift of value x by y number of bits, x >>> y. + * For matrices, the function is evaluated element wise. For units, the + * function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + * @returns x zero-filled shifted right y times + */ + rightLogShift( + x: T, + y: number + ): NoLiteralType + + /************************************************************************* + * Combinatorics functions + ************************************************************************/ + + /** + * The Bell Numbers count the number of partitions of a set. A partition + * is a pairwise disjoint subset of S whose union is S. bellNumbers only + * takes integer arguments. The following condition must be enforced: n + * >= 0 + * @param n Total number of objects in the set + * @returns B(n) + */ + bellNumbers(n: T): T + + /** + * The Catalan Numbers enumerate combinatorial structures of many + * different types. catalan only takes integer arguments. The following + * condition must be enforced: n >= 0 + * @param n nth Catalan number + * @returns Cn(n) + */ + catalan(n: T): T + + /** + * The composition counts of n into k parts. Composition only takes + * integer arguments. The following condition must be enforced: k <= n. + * @param n Total number of objects in the set + * @param k Number of objects in the subset + * @returns Returns the composition counts of n into k parts. + */ + composition( + n: T, + k: number | BigNumber + ): NoLiteralType + + /** + * The Stirling numbers of the second kind, counts the number of ways to + * partition a set of n labelled objects into k nonempty unlabelled + * subsets. stirlingS2 only takes integer arguments. The following + * condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = + * 1 + * @param n Total number of objects in the set + * @param k Number of objects in the subset + * @returns S(n,k) + */ + stirlingS2( + n: T, + k: number | BigNumber + ): NoLiteralType + + /************************************************************************* + * Complex functions + ************************************************************************/ + + /** + * Compute the argument of a complex value. For a complex number a + bi, + * the argument is computed as atan2(b, a). For matrices, the function + * is evaluated element wise. + * @param x A complex number or array with complex numbers + * @returns The argument of x + */ + arg(x: number | Complex): number + arg(x: BigNumber | Complex): BigNumber + arg(x: T): T + + /** + * Compute the complex conjugate of a complex value. If x = a+bi, the + * complex conjugate of x is a - bi. For matrices, the function is + * evaluated element wise. + * @param x A complex number or array with complex numbers + * @returns The complex conjugate of x + */ + conj( + x: T + ): NoLiteralType + + /** + * Get the imaginary part of a complex number. For a complex number a + + * bi, the function returns b. For matrices, the function is evaluated + * element wise. + * @param x A complex number or array with complex numbers + * @returns The imaginary part of x + */ + im(x: MathJsChain): MathJsChain + im(x: MathJsChain): MathJsChain + + /** + * Get the real part of a complex number. For a complex number a + bi, + * the function returns a. For matrices, the function is evaluated + * element wise. + * @param x A complex number or array of complex numbers + * @returns The real part of x + */ + re(x: MathJsChain): MathJsChain + re(x: MathJsChain): MathJsChain + + /************************************************************************* + * Geometry functions + ************************************************************************/ + + /** + * Calculates: The eucledian distance between two points in 2 and 3 + * dimensional spaces. Distance between point and a line in 2 and 3 + * dimensional spaces. Pairwise distance between a set of 2D or 3D + * points NOTE: When substituting coefficients of a line(a, b and c), + * use ax + by + c = 0 instead of ax + by = c For parametric equation of + * a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, + * c) + * @param x Coordinates of the first point + * @param y Coordinates of the second point OR coefficients of a line in 3D OR first end-point of a line if the calculation is for distance between point and a line in 2D + * @param z Coordinates of second end-point of a line if the calculation is for distance between point and a line in 2D + * @returns Returns the distance from two/three points + */ + distance( + x: MathCollection | object, + y: MathCollection | object, + z?: MathCollection | object + ): number | BigNumber + + /** + * Calculates the point of intersection of two lines in two or three + * dimensions and of a line and a plane in three dimensions. The inputs + * are in the form of arrays or 1 dimensional matrices. The line + * intersection functions return null if the lines do not meet. Note: + * Fill the plane coefficients as x + y + z = c and not as x + y + z + c + * = 0. + * @param w Co-ordinates of first end-point of first line + * @param x Co-ordinates of second end-point of first line + * @param y Co-ordinates of first end-point of second line OR + * Coefficients of the plane's equation + * @param z Co-ordinates of second end-point of second line OR null if + * the calculation is for line and plane + * @returns Returns the point of intersection of lines/lines-planes + */ + intersect( + w: MathCollection, + x: MathCollection, + y: MathCollection, + z?: MathCollection + ): MathArray + + /************************************************************************* + * Logical functions + ************************************************************************/ + + /** + * Logical and. Test whether two values are both defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param x First value to and + * @param y Second value to and + * @returns Returns true when both inputs are defined with a + * nonzero/nonempty value. + */ + and( + x: number | BigNumber | bigint | Complex | Unit | MathCollection, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): boolean | MathCollection + + /** + * Logical not. Flips boolean value of a given parameter. For matrices, + * the function is evaluated element wise. + * @param x First value to not + * @returns Returns true when input is a zero or empty value. + */ + not( + x: number | BigNumber | bigint | Complex | Unit | MathCollection + ): boolean | MathCollection + + /** + * Logical or. Test if at least one value is defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param x First value to or + * @param y Second value to or + * @returns Returns true when one of the inputs is defined with a + * nonzero/nonempty value. + */ + or( + x: number | BigNumber | bigint | Complex | Unit | MathCollection, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): boolean | MathCollection + + /** + * Logical xor. Test whether one and only one value is defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param x First value to xor + * @param y Second value to xor + * @returns Returns true when one and only one input is defined with a + * nonzero/nonempty value. + */ + xor( + x: number | BigNumber | bigint | Complex | Unit | MathCollection, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): boolean | MathCollection + + /************************************************************************* + * Matrix functions + ************************************************************************/ + + /** + * Apply a function that maps an array to a scalar along a given axis of a + * matrix or array. Returns a new matrix or array with one less dimension + * than the input. + * @param array The input Matrix + * @param dim The dimension along which the callback is applied + * @param callback The callback function that is applied. This Function should take an + * array or 1-d matrix as an input and return a number. + * @returns The residual matrix with the function applied over some dimension. + */ + apply( + array: T, + dim: number, + callback: (array: MathCollection) => number + ): T + + /** + * Concatenate two or more matrices. dim: number is a zero-based + * dimension over which to concatenate the matrices. By default the last + * dimension of the matrices. + * @param args Two or more matrices + * @returns Concatenated matrix + */ + concat(...args: Array): MathCollection + + /** + * Calculate the cross product for two vectors in three dimensional + * space. The cross product of A = [a1, a2, a3] and B =[b1, b2, b3] is + * defined as: cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 + * * b2 - a2 * b1 ] + * @param x First vector + * @param y Second vector + * @returns Returns the cross product of x and y + */ + cross(x: MathCollection, y: MathCollection): MathCollection + + /** + * Calculate the determinant of a matrix. + * @param x A Matrix + * @returns the determinant of x + */ + det(x: MathCollection): number + + /** + * Create a diagonal matrix or retrieve the diagonal of a matrix. When x + * is a vector, a matrix with vector x on the diagonal will be returned. + * When x is a two dimensional matrix, the matrixes kth diagonal will be + * returned as vector. When k is positive, the values are placed on the + * super diagonal. When k is negative, the values are placed on the sub + * diagonal. + * @param X A two dimensional matrix or a vector + * @param k The diagonal where the vector will be filled in or + * retrieved. Default value: 0. + * @param format The matrix storage format. Default value: 'dense'. + * @returns Diagonal matrix from input vector, or diagonal from input + * matrix + */ + diag(X: MathCollection, format?: string): Matrix + diag( + X: MathCollection, + k: number | BigNumber, + format?: string + ): MathCollection + + /** + * Calculate the dot product of two vectors. The dot product of A = [a1, + * a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as: dot(A, + * B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn + * @param x First vector + * @param y Second vector + * @returns Returns the dot product of x and y + */ + dot(x: MathCollection, y: MathCollection): number + + /** + * Compute eigenvalues and eigenvectors of a matrix. + * The eigenvalues are sorted by their absolute value, ascending. + * An eigenvalue with multiplicity k will be listed k times. + * The eigenvectors are returned as an array of objects, each with a + * `value` and a `vector`. If the algorithm fails to converge, + * it will throw an error – in that case, however, you may still find useful + * information in err.values and err.vectors + * @param x Matrix to be diagonalized + * @param prec Precision, default value: 1e-15 + * @returns Object containing an array of eigenvalues and a matrix with eigenvectors as columns. + */ + eigs( + x: MathCollection, + opts?: + | number + | BigNumber + | { precision?: number | BigNumber; eigenvectors?: true } + ): { + values: MathCollection + eigenvectors: { + value: number | BigNumber + vector: MathCollection + }[] + } + eigs( + x: MathCollection, + opts: { eigenvectors: false; precision?: number | BigNumber } + ): { values: MathCollection } + /** + * Compute the matrix exponential, expm(A) = e^A. The matrix must be + * square. Not to be confused with exp(a), which performs element-wise + * exponentiation. The exponential is calculated using the Padé + * approximant with scaling and squaring; see “Nineteen Dubious Ways to + * Compute the Exponential of a Matrix,” by Moler and Van Loan. + * @param x A square matrix + * @returns The exponential of x + */ + expm(x: Matrix): Matrix + + /** + * Solves the real-valued Sylvester equation AX-XB=C for X, where A, B and C are + * matrices of appropriate dimensions, being A and B squared. The method used is + * the Bartels-Stewart algorithm. + * https://en.wikipedia.org/wiki/Sylvester_equation + * @param A Matrix A + * @param B Matrix B + * @param C Matrix C + * @returns Matrix X, solving the Sylvester equation + */ + sylvester( + A: MathCollection, + B: MathCollection, + C: MathCollection + ): MathCollection + + /** + * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal + * and T is upper quasi-triangular. + * https://en.wikipedia.org/wiki/Schur_decomposition + * @param A Matrix A + * @returns Object containing both matrix U and T of the Schur Decomposition A=UTU' + */ + schur(A: MathCollection): SchurDecomposition + + /** + * Solves the Continuous-time Lyapunov equation AP+PA'=Q for P, where Q is a positive semidefinite + * matrix. + * https://en.wikipedia.org/wiki/Lyapunov_equation + * @param A Matrix A + * @param Q Matrix Q + * @returns Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q + */ + lyap(A: MathCollection, Q: MathCollection): MathCollection + + /** + * Create a 2-dimensional identity matrix with size m x n or n x n. The + * matrix has ones on the diagonal and zeros elsewhere. + * @param size The size for the matrix + * @param format The Matrix storage format + * @returns A matrix with ones on the diagonal + */ + identity( + size: number | number[] | MathCollection, + format?: string + ): MathCollection | number + /** + * @param m The x dimension for the matrix + * @param n The y dimension for the matrix + * @param format The Matrix storage format + * @returns A matrix with ones on the diagonal + */ + identity(m: number, n: number, format?: string): MathCollection | number + + /** + * Filter the items in an array or one dimensional matrix. + * @param x A one dimensional matrix or array to filter + * @param test A function or regular expression to test items. All + * entries for which test returns true are returned. When test is a + * function, it is invoked with three parameters: the value of the + * element, the index of the element, and the matrix/array being + * traversed. The function must return a boolean. + */ + filter( + x: MathCollection | string[], + test: + | (( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + index: any, + matrix: MathCollection | string[] + ) => boolean) + | RegExp + ): MathCollection + + /** + * Flatten a multi dimensional matrix into a single dimensional matrix. + * @param x Matrix to be flattened + * @returns Returns the flattened matrix + */ + flatten(x: T): T + + /** + * Iterate over all elements of a matrix/array, and executes the given + * callback function. + * @param x The matrix to iterate on. + * @param callback The callback function is invoked with three + * parameters: the value of the element, the index of the element, and + * the Matrix/array being traversed. + */ + forEach( + x: T, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (value: any, index: any, matrix: T) => void + ): void + + /** + * Calculate the inverse of a square matrix. + * @param x Matrix to be inversed + * @returns The inverse of x + */ + inv(x: T): NoLiteralType + + /** + * Calculate the Kronecker product of two matrices or vectors + * @param x First vector + * @param y Second vector + * @returns Returns the Kronecker product of x and y + */ + kron(x: MathCollection, y: MathCollection): Matrix + + /** + * Iterate over all elements of a matrix/array, and executes the given + * callback function. + * @param x The matrix to iterate on. + * @param callback The callback function is invoked with three + * parameters: the value of the element, the index of the element, and + * the Matrix/array being traversed. + * @returns Transformed map of x + */ + map( + x: T, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (value: any, index: number[], matrix: T) => MathType | string + ): T + + /** + * Iterate over all elements of multiple matrices/arrays, and executes the given + * callback function. + * @param x The first matrix to iterate on. + * @param args The rest of the matrices and at the end the callback function is invoked with multiple + * parameters: the values of the elements, the indices of the elements, and + * the matrices/arrays being traversed. + * @returns Transformed map of matrices + */ + map( + x: T, + ...args: Array< + | T + | (( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...args: Array + ) => MathType | string) + > + ): T + + /** + * Create a matrix filled with ones. The created matrix can have one or + * multiple dimensions. + * @param size The size of each dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with ones + */ + ones( + size?: number | number[] | BigNumber | BigNumber[], + format?: string + ): MathCollection + /** + * @param m The x dimension of the matrix + * @param n The y dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with ones + */ + ones( + m: number | BigNumber, + n: number | BigNumber, + format?: string + ): MathCollection + /** + * @param m The x dimension of the matrix + * @param n The y dimension of the matrix + * @param p The z dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with ones + */ + ones( + m: number | BigNumber, + n: number | BigNumber, + p: number | BigNumber, + format?: string + ): MathCollection + /** Actually ones can take an arbitrary number of dimensions before the + ** optional format, not sure how to write that in TypeScript + **/ + + /** + * Partition-based selection of an array or 1D matrix. Will find the kth + * smallest value, and mutates the input array. Uses Quickselect. + * @param x A one dimensional matrix or array to sort + * @param k The kth smallest value to be retrieved; zero-based index + * @param compare An optional comparator function. The function is + * called as compare(a, b), and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. Default value: 'asc'. + * @returns Returns the kth lowest value. + */ + partitionSelect( + x: MathCollection, + k: number, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compare?: 'asc' | 'desc' | ((a: any, b: any) => number) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): any + + /** + * Calculate the Moore–Penrose inverse of a matrix. + * @param x Matrix to be inversed + * @return The inverse of `x`. + */ + pinv(x: T): T + + /** + * Create an array from a range. By default, the range end is excluded. + * This can be customized by providing an extra parameter includeEnd. + * @param str A string 'start:end' or 'start:step:end' + * @param start Start of the range + * @param end End of the range, excluded by default, included when + * parameter includeEnd=true + * @param step Step size. Default value is 1. + * @param includeEnd: Option to specify whether to include the end or + * not. False by default + * @returns Parameters describing the ranges start, end, and optional + * step. + */ + range(str: string, includeEnd?: boolean): Matrix + range( + start: number | BigNumber, + end: number | BigNumber, + includeEnd?: boolean + ): Matrix + range( + start: number | BigNumber | Unit, + end: number | BigNumber | Unit, + step: number | BigNumber | Unit, + includeEnd?: boolean + ): Matrix + + /** + * Reshape a multi dimensional array to fit the specified dimensions + * @param x Matrix to be reshaped + * @param sizes One dimensional array with integral sizes for each + * dimension + * @returns A reshaped clone of matrix x + */ + reshape(x: T, sizes: number[]): T + + /** + * Resize a matrix + * @param x Matrix to be resized + * @param size One dimensional array with numbers + * @param defaultValue Zero by default, except in case of a string, in + * that case defaultValue = ' ' Default value: 0. + * @returns A resized clone of matrix x + */ + resize( + x: T, + size: MathCollection, + defaultValue?: number | string + ): T + + /** + * Return a Rotation Matrix for a given angle in radians + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @param {string} [format] Result Matrix storage format. Default value: 'dense'. + * @return {Matrix} Rotation Matrix + */ + rotationMatrix( + theta?: number | BigNumber | Complex | Unit, + axis?: T, + format?: 'sparse' | 'dense' + ): T + + /** + * Return a row from a Matrix. + * @param value An array or matrix + * @param row The index of the row + * @returns The retrieved row + */ + row(value: T, row: number): T + + /** + * Return a column from a Matrix. + * @param value An array or matrix + * @param column The index of the column + * @returns The retrieved column + */ + column(value: T, column: number): T + + /** + * Return a rotated matrix. + * @param {Array | Matrix} w Vector to rotate + * @param {number | BigNumber | Complex | Unit} theta Rotation angle + * @param {Array | Matrix} [v] Rotation axis + * @return {Array | Matrix} Multiplication of the rotation matrix and w + */ + rotate( + w: T, + theta: number | BigNumber | Complex | Unit, + v?: T + ): T + + /** + * Calculate the size of a matrix or scalar. + * @param A matrix + * @returns A vector with the size of x + */ + size( + x: boolean | number | Complex | Unit | string | MathCollection + ): MathCollection + + /** + * Sort the items in a matrix + * @param x A one dimensional matrix or array to sort + * @param compare An optional _comparator function or name. The function + * is called as compare(a, b), and must return 1 when a > b, -1 when a < + * b, and 0 when a == b. Default value: ‘asc’ + * @returns Returns the sorted matrix + */ + sort( + x: T, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compare: ((a: any, b: any) => number) | 'asc' | 'desc' | 'natural' + ): T + + /** + * Calculate the principal square root of a square matrix. The principal + * square root matrix X of another matrix A is such that X * X = A. + * @param A The square matrix A + * @returns The principal square root of matrix A + */ + sqrtm(A: T): T + + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a + * matrix. + * @param x Matrix to be squeezed + * @returns Squeezed matrix + */ + squeeze(x: T): T + + /** + * Get or set a subset of a matrix or string. + * @param value An array, matrix, or string + * @param index For each dimension, an index or list of indices to get or set. + * @param replacement An array, matrix, or scalar. If provided, the + * subset is replaced with replacement. If not provided, the subset is + * returned + * @param defaultValue Default value, filled in on new entries when the + * matrix is resized. If not provided, math.matrix elements will be left + * undefined. Default value: undefined. + * @returns Either the retrieved subset or the updated matrix + */ + subset( + value: T, + index: Index, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacement?: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + defaultValue?: any + ): T + + /** + * Calculate the trace of a matrix: the sum of the elements on the main + * diagonal of a square matrix. + * @param x A matrix + * @returns The trace of x + */ + trace(x: MathCollection): number + + /** + * Transpose a matrix. All values of the matrix are reflected over its + * main diagonal. Only two dimensional matrices are supported. + * @param x Matrix to be transposed + * @returns The transposed matrix + */ + transpose(x: T): T + + /** + * Create a matrix filled with zeros. The created matrix can have one or + * multiple dimensions. + * @param size The size of each dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with zeros + */ + zeros( + size?: number | number[] | BigNumber | BigNumber[], + format?: string + ): MathCollection + /** + * @param m The x dimension of the matrix + * @param n The y dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with zeros + */ + zeros( + m: number | BigNumber, + n: number | BigNumber, + format?: string + ): MathCollection + /** + * @param m The x dimension of the matrix + * @param n The y dimension of the matrix + * @param p The z dimension of the matrix + * @param format The matrix storage format + * @returns A matrix filled with zeros + */ + zeros( + m: number | BigNumber, + n: number | BigNumber, + p: number | BigNumber, + format?: string + ): MathCollection + /** Actually zeros can take any number of dimensions before the + ** optional format, not sure how to write that in TypeScript + **/ + + /** + * Calculate N-dimensional Fourier transform + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + fft(arr: T): T + + /** + * Calculate N-dimensional inverse Fourier transform + * @param {Array | Matrix} arr An array or matrix + * @return {Array | Matrix} N-dimensional Fourier transformation of the array + */ + ifft(arr: T): T + + /************************************************************************* + * Probability functions + ************************************************************************/ + + /** + * Compute the number of ways of picking k unordered outcomes from n + * possibilities. Combinations only takes integer arguments. The + * following condition must be enforced: k <= n. + * @param n Total number of objects in the set + * @param k Number of objects in the subset + * @returns Number of possible combinations + */ + combinations( + n: T, + k: number | BigNumber + ): NoLiteralType + + /** + * Compute the factorial of a value Factorial only supports an integer + * value as argument. For matrices, the function is evaluated element + * wise. + * @param n An integer number + * @returns The factorial of n + */ + factorial( + n: T + ): NoLiteralType + + /** + * Compute the gamma function of a value using Lanczos approximation for + * small values, and an extended Stirling approximation for large + * values. + * @param n A real or complex number + * @returns The gamma of n + */ + gamma(n: T): NoLiteralType + + /** + * Calculate the Kullback-Leibler (KL) divergence between two + * distributions + * @param q First vector + * @param p Second vector + * @returns Returns disance between q and p + */ + kldivergence(q: MathCollection, p: MathCollection): number + + /** + * Compute the log gamma function of a value, using Lanczos approximation for numbers and Stirling series for complex numbers. + * @param n A real or complex number + * @returns The log gamma of `n` + */ + lgamma(n: T): NoLiteralType + + /** + * Multinomial Coefficients compute the number of ways of picking a1, + * a2, ..., ai unordered outcomes from n possibilities. multinomial + * takes one array of integers as an argument. The following condition + * must be enforced: every ai <= 0 + * @param a Integer number of objects in the subset + * @returns multinomial coefficent + */ + multinomial(a: T[]): NoLiteralType + + /** + * Compute the number of ways of obtaining an ordered subset of k + * elements from a set of n elements. Permutations only takes integer + * arguments. The following condition must be enforced: k <= n. + * @param n The number of objects in total + * @param k The number of objects in the subset + * @returns The number of permutations + */ + permutations( + n: T, + k?: number | BigNumber + ): NoLiteralType + + /** + * Random pick a value from a one dimensional array. Array element is + * picked using a random function with uniform distribution. + * @param array A one dimensional array + * @param number An int or float + * @param weights An array of ints or floats + * @returns Returns a single random value from array when number is undefined. + * Returns an array with the configured number of elements when number is defined. + */ + pickRandom(array: T[]): T + pickRandom(array: T[], number: number): T[] + pickRandom(array: T[], number: number, weights: number[]): T[] + + /** + * Return a random number larger or equal to min and smaller than max + * using a uniform distribution. + * @param size If provided, an array or matrix with given size and + * filled with random values is returned + * @param min Minimum boundary for the random value, included + * @param max Maximum boundary for the random value, excluded + * @returns A random number + */ + random(min?: number, max?: number): number + random(size: T, min?: number, max?: number): T + + /** + * Return a random integer number larger or equal to min and smaller + * than max using a uniform distribution. + * @param size If provided, an array or matrix with given size and + * filled with random values is returned + * @param min Minimum boundary for the random value, included + * @param max Maximum boundary for the random value, excluded + * @returns A random number + */ + randomInt(min: number, max?: number): number + randomInt(size: T, min?: number, max?: number): T + + /************************************************************************* + * Relational functions + ************************************************************************/ + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x + * == y. x and y are considered equal when the relative difference + * between x and y is smaller than the configured relTol and absTol. The function + * cannot be used to compare values smaller than approximately 2.22e-16. + * For matrices, the function is evaluated element wise. + * @param x First value to compare + * @param y Second value to compare + * @returns Returns the result of the comparison: 1 when x > y, -1 when + * x < y, and 0 when x == y. + */ + compare( + x: MathType | string, + y: MathType | string + ): number | BigNumber | Fraction | MathCollection + + /** + * Compare two values of any type in a deterministic, natural way. For + * numeric values, the function works the same as math.compare. For + * types of values that can’t be compared mathematically, the function + * compares in a natural way. + * @param x First value to compare + * @param y Second value to compare + * @returns Returns the result of the comparison: 1 when x > y, -1 when + * x < y, and 0 when x == y. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compareNatural(x: any, y: any): number + + /** + * Compare two strings lexically. Comparison is case sensitive. Returns + * 1 when x > y, -1 when x < y, and 0 when x == y. For matrices, the + * function is evaluated element wise. + * @param x First string to compare + * @param y Second string to compare + * @returns Returns the result of the comparison: 1 when x > y, -1 when + * x < y, and 0 when x == y. + */ + compareText( + x: string | MathCollection, + y: string | MathCollection + ): number | MathCollection + + /** + * Test element wise whether two matrices are equal. The function + * accepts both matrices and scalar values. + * @param x First matrix to compare + * @param y Second amtrix to compare + * @returns Returns true when the input matrices have the same size and + * each of their elements is equal. + */ + deepEqual(x: MathType, y: MathType): MathType + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is + * smaller than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. For matrices, the + * function is evaluated element wise. In case of complex numbers, x.re + * must equal y.re, and x.im must equal y.im. Values null and undefined + * are compared strictly, thus null is only equal to null and nothing + * else, and undefined is only equal to undefined and nothing else. + * @param x First value to compare + * @param y Second value to compare + * @returns Returns true when the compared values are equal, else + * returns false + */ + equal(x: MathType | string, y: MathType | string): boolean | MathCollection + + /** + * Check equality of two strings. Comparison is case sensitive. For + * matrices, the function is evaluated element wise. + * @param x First string to compare + * @param y Second string to compare + * @returns Returns true if the values are equal, and false if not. + */ + equalText( + x: string | MathCollection, + y: string | MathCollection + ): number | MathCollection + + /** + * Test whether value x is larger than y. The function returns true when + * x is larger than y and the relative difference between x and y is + * larger than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. For matrices, the + * function is evaluated element wise. + * @param x First value to compare + * @param y Second value to vcompare + * @returns Returns true when x is larger than y, else returns false + */ + larger(x: MathType | string, y: MathType | string): boolean | MathCollection + + /** + * Test whether value x is larger or equal to y. The function returns + * true when x is larger than y or the relative difference between x and + * y is smaller than the configured relTol and absTol. The function cannot be used + * to compare values smaller than approximately 2.22e-16. For matrices, + * the function is evaluated element wise. + * @param x First value to compare + * @param y Second value to vcompare + * @returns Returns true when x is larger than or equal to y, else + * returns false + */ + largerEq(x: MathType | string, y: MathType | string): boolean | MathCollection + + /** + * Test whether value x is smaller than y. The function returns true + * when x is smaller than y and the relative difference between x and y + * is smaller than the configured relTol and absTol. The function cannot be used + * to compare values smaller than approximately 2.22e-16. For matrices, + * the function is evaluated element wise. + * @param x First value to compare + * @param y Second value to vcompare + * @returns Returns true when x is smaller than y, else returns false + */ + smaller(x: MathType | string, y: MathType | string): boolean | MathCollection + + /** + * Test whether value x is smaller or equal to y. The function returns + * true when x is smaller than y or the relative difference between x + * and y is smaller than the configured relTol and absTol. The function cannot be + * used to compare values smaller than approximately 2.22e-16. For + * matrices, the function is evaluated element wise. + * @param x First value to compare + * @param y Second value to vcompare + * @returns Returns true when x is smaller than or equal to y, else + * returns false + */ + smallerEq( + x: MathType | string, + y: MathType | string + ): boolean | MathCollection + + /** + * Determines if two expressions are symbolically equal, i.e. one is the + * result of valid algebraic manipulations on the other. + * @param {Node} expr1 The first expression to compare + * @param {Node} expr2 The second expression to compare + * @param {Object} [options] Optional option object, passed to simplify + * @returns {boolean} Returns true if a valid manipulation making the + * expressions equal is found. + */ + symbolicEqual( + expr1: MathNode, + expr2: MathNode, + options?: SimplifyOptions + ): boolean + + /** + * Test whether two values are unequal. The function tests whether the + * relative difference between x and y is larger than the configured + * relTol and absTol. The function cannot be used to compare values smaller than + * approximately 2.22e-16. For matrices, the function is evaluated + * element wise. In case of complex numbers, x.re must unequal y.re, or + * x.im must unequal y.im. Values null and undefined are compared + * strictly, thus null is unequal with everything except null, and + * undefined is unequal with everything except undefined. + * @param x First value to compare + * @param y Second value to vcompare + * @returns Returns true when the compared values are unequal, else + * returns false + */ + unequal(x: MathType | string, y: MathType | string): boolean | MathCollection + + /************************************************************************* + * Set functions + ************************************************************************/ + + /** + * Create the cartesian product of two (multi)sets. Multi-dimension + * arrays will be converted to single-dimension arrays and the values + * will be sorted in ascending order before the operation. + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns The cartesian product of two (multi)sets + */ + setCartesian(a1: T, a2: MathCollection): T + + /** + * Create the difference of two (multi)sets: every element of set1, that + * is not the element of set2. Multi-dimension arrays will be converted + * to single-dimension arrays before the operation + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns The difference of two (multi)sets + */ + setDifference(a1: T, a2: MathCollection): T + + /** + * Collect the distinct elements of a multiset. A multi-dimension array + * will be converted to a single-dimension array before the operation. + * @param a A multiset + * @returns A set containing the distinct elements of the multiset + */ + setDistinct(a: T): T + + /** + * Create the intersection of two (multi)sets. Multi-dimension arrays + * will be converted to single-dimension arrays before the operation. + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns The intersection of two (multi)sets + */ + setIntersect(a1: T, a2: MathCollection): T + + /** + * Check whether a (multi)set is a subset of another (multi)set. (Every + * element of set1 is the element of set2.) Multi-dimension arrays will + * be converted to single-dimension arrays before the operation. + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns True if a1 is subset of a2, else false + */ + setIsSubset(a1: MathCollection, a2: MathCollection): boolean + + /** + * Count the multiplicity of an element in a multiset. A multi-dimension + * array will be converted to a single-dimension array before the + * operation. + * @param e An element in the multiset + * @param a A multiset + * @returns The number of how many times the multiset contains the + * element + */ + setMultiplicity(e: MathNumericType, a: MathCollection): number + + /** + * Create the powerset of a (multi)set. (The powerset contains very + * possible subsets of a (multi)set.) A multi-dimension array will be + * converted to a single-dimension array before the operation. + * @param a A multiset + * @returns The powerset of the (multi)set + */ + setPowerset(a: T): T + + /** + * Count the number of elements of a (multi)set. When a second parameter + * is ‘true’, count only the unique values. A multi-dimension array will + * be converted to a single-dimension array before the operation. + * @param a A multiset + * @returns The number of elements of the (multi)set + */ + setSize(a: MathCollection): number + + /** + * Create the symmetric difference of two (multi)sets. Multi-dimension + * arrays will be converted to single-dimension arrays before the + * operation. + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns The symmetric difference of two (multi)sets + */ + setSymDifference(a1: T, a2: MathCollection): T + + /** + * Create the union of two (multi)sets. Multi-dimension arrays will be + * converted to single-dimension arrays before the operation. + * @param a1 A (multi)set + * @param a2 A (multi)set + * @returns The union of two (multi)sets + */ + setUnion(a1: T, a2: MathCollection): T + + /************************************************************************* + * Signal functions + ************************************************************************/ + /** + * Compute the transfer function of a zero-pole-gain model. + * @param z Zeroes of the model + * @param p Poles of the model + * @param k Gain of the model + * @returns The transfer function as array of numerator and denominator + */ + zpk2tf(z: T, p: T, k?: number): T + + /** + * Calculates the frequency response of a filter given its numerator and denominator coefficients. + * @param b The numerator polynomial of the filter + * @param a The denominator polynomial of the filter + * @param w The range of frequencies in which the response is to be calculated + * @returns The frequency response + * + */ + freqz(b: T, a: T, w?: number | T): { w: T; h: T } + + /************************************************************************* + * Special functions + ************************************************************************/ + + /** + * Compute the erf function of a value using a rational Chebyshev + * approximations for different intervals of x. + * @param x A real number + * @returns The erf of x + */ + erf(x: T): NoLiteralType + + /** + * Compute the Riemann Zeta function of a value using an infinite series + * and Riemann's Functional equation. + * @param s A real, complex or BigNumber + * @returns The Riemann Zeta of s + */ + zeta(s: T): T + + /************************************************************************* + * Statistics functions + ************************************************************************/ + + /** + * Compute the median absolute deviation of a matrix or a list with + * values. The median absolute deviation is defined as the median of the + * absolute deviations from the median. + * @param array A single matrix or multiple scalar values. + * @returns The median absolute deviation + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mad(array: MathCollection): any + + /** + * Compute the maximum value of a matrix or a list with values. In case + * of a multi dimensional array, the maximum of the flattened array will + * be calculated. When dim is provided, the maximum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param args Multiple scalar values + * @returns The maximum value + */ + max(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The maximum value + */ + max(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @param dimension The maximum over the selected dimension + * @returns The maximum value + */ + max( + A: T[] | T[][], + dimension?: number | BigNumber + ): T + /** + * @param A A single matrix + * @param dimension The maximum over the selected dimension + * @returns The maximum value + */ + max(A: MathCollection, dimension?: number | BigNumber): MathScalarType + + /** + * Compute the mean value of matrix or a list with values. In case of a + * multi dimensional array, the mean of the flattened array will be + * calculated. When dim is provided, the maximum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param args Multiple scalar values + * @returns The mean of all values + */ + mean(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The mean value + */ + mean(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @param dimension The mean over the selected dimension + * @returns The mean value + */ + mean( + A: T[] | T[][], + dimension?: number | BigNumber + ): T + /** + * @param A A single matrix + * @param dimension The mean over the selected dimension + * @returns The mean value + */ + mean(A: MathCollection, dimension?: number | BigNumber): MathScalarType + + /** + * Compute the median of a matrix or a list with values. The values are + * sorted and the middle value is returned. In case of an even number of + * values, the average of the two middle values is returned. Supported + * types of values are: Number, BigNumber, Unit In case of a (multi + * dimensional) array or matrix, the median of all elements will be + * calculated. + * @param args Multiple scalar values + * @returns The median value + */ + median(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The median value + */ + median(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @returns The median value + */ + median(A: T[] | T[][]): T + /** + * @param A A single matrix + * @returns The median value + */ + median(A: MathCollection): MathScalarType + + /** + * Compute the minimum value of a matrix or a list of values. In case of + * a multi dimensional array, the minimum of the flattened array will be + * calculated. When dim is provided, the minimum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param args multiple scalar values + * @returns The minimum value + */ + min(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The minimum value + */ + min(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @param dimension The minimum over the selected dimension + * @returns The minimum value + */ + min( + A: T[] | T[][], + dimension?: number | BigNumber + ): T + /** + * @param A A single matrix + * @param dimension The minimum over the selected dimension + * @returns The minimum value + */ + min(A: MathCollection, dimension?: number | BigNumber): MathScalarType + + /** + * Computes the mode of a set of numbers or a list with values(numbers + * or characters). If there are more than one modes, it returns a list + * of those values. + * @param args Multiple scalar values + * @returns The mode of all values + */ + mode(...args: T[]): T[] + /** + * @param args Multiple scalar values + * @returns The mode of all values + */ + mode(...args: MathScalarType[]): MathScalarType[] + /** + * @param A A single matrix + * @returns The mode value + */ + mode(A: T[] | T[][]): T[] + /** + * @param A A single matrix + * @returns The mode of all values + */ + mode(A: MathCollection): MathScalarType[] + + /** + * Compute the product of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the sum of all elements will be + * calculated. + * @param args Multiple scalar values + * @returns The product of all values + */ + prod(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The product of all values + */ + prod(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @returns The product of all values + */ + prod(A: T[] | T[][]): T + /** + * @param A A single matrix + * @returns The product of all values + */ + prod(A: MathCollection): MathScalarType + + /** + * @param A A single matrix + * @param probOrN prob is the order of the quantile, while N is the + * amount of evenly distributed steps of probabilities; only one of + * these options can be provided + * @param sorted =false is data sorted in ascending order + * @returns Quantile(s) + */ + quantileSeq( + A: T[] | T[][], + prob: number | BigNumber, + sorted?: boolean + ): T + /** + * Compute the prob order quantile of a matrix or a list with values. + * The sequence is sorted and the middle value is returned. Supported + * types of sequence values are: Number, BigNumber, Unit Supported types + * of probability are: Number, BigNumber In case of a (multi + * dimensional) array or matrix, the prob order quantile of all elements + * will be calculated. + * @param A A single matrix or array + * @param probOrN prob is the order of the quantile, while N is the + * amount of evenly distributed steps of probabilities; only one of + * these options can be provided + * @param sorted =false is data sorted in ascending order + * @returns Quantile(s) + */ + quantileSeq( + A: MathCollection, + prob: number | BigNumber | MathArray, + sorted?: boolean + ): MathScalarType | MathArray + + /** + * Compute the standard deviation of a matrix or a list with values. The + * standard deviations is defined as the square root of the variance: + * std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or + * matrix, the standard deviation over all elements will be calculated. + * Optionally, the type of normalization can be specified as second + * parameter. The parameter normalization can be one of the following + * values: 'unbiased' (default) The sum of squared errors is divided by + * (n - 1) 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * @param args variadic argument of number to calculate standard deviation + * @returns The standard deviation + */ + std(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The standard deviation + */ + std(...args: MathScalarType[]): MathScalarType + /** + * Compute the standard deviation of a matrix or a list with values. The + * standard deviations is defined as the square root of the variance: + * std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or + * matrix, the standard deviation over all elements will be calculated. + * Optionally, the type of normalization can be specified as second + * parameter. The parameter normalization can be one of the following + * values: 'unbiased' (default) The sum of squared errors is divided by + * (n - 1) 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * @param array A single matrix to compute standard deviation. + * @param dimension A dimension to calculate standard deviation + * @param normalization Determines how to normalize the variance. Choose + * ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: + * ‘unbiased’. + * @returns The standard deviation array + */ + std( + array: MathCollection, + dimension?: number, + normalization?: 'unbiased' | 'uncorrected' | 'biased' + ): MathNumericType[] + /** + * Compute the standard deviation of a matrix or a list with values. The + * standard deviations is defined as the square root of the variance: + * std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or + * matrix, the standard deviation over all elements will be calculated. + * Optionally, the type of normalization can be specified as second + * parameter. The parameter normalization can be one of the following + * values: 'unbiased' (default) The sum of squared errors is divided by + * (n - 1) 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * @param array A single matrix or multiple scalar values + * @param normalization Determines how to normalize the variance. Choose + * ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: + * ‘unbiased’. + * @returns The standard deviation + */ + std( + array: MathCollection, + normalization: 'unbiased' | 'uncorrected' | 'biased' + ): MathNumericType + + /** + * Compute the sum of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the sum of all elements will be + * calculated. + * @param args A single matrix or multiple scalar values + * @returns The sum of all values + */ + sum(...args: T[]): T + /** + * @param args Multiple scalar values + * @returns The sum of all values + */ + sum(...args: MathScalarType[]): MathScalarType + /** + * @param A A single matrix + * @param dimension The sum over the selected dimension + * @returns The sum of all values + */ + sum( + A: T[] | T[][], + dimension?: number | BigNumber + ): T + /** + * @param A A single matrix + * @param dimension The sum over the selected dimension + * @returns The sum of all values + */ + sum(A: MathCollection, dimension?: number | BigNumber): MathScalarType + + /** + * Count the number of elements of a matrix, array or string. + * @param x A matrix, array or string. + * @returns The number of members passed in parameters + */ + count(x: MathCollection | string): number + + /** + * Compute the cumulative sum of a matrix or a list with values. + * In case of a (multi dimensional) array or matrix, the cumulative sums + * along a specified dimension (defaulting to the first) will be calculated. + * @param args A single matrix or multiple scalar values + * @returns The cumulative sums of the the values. + */ + cumsum(...args: MathType[]): MathType[] + /** + * @param array A single matrix + * @param dim The dimension along which to sum (defaults to 0) + * @returns The cumulative sums along the given dimension + */ + cumsum(array: MathCollection, dim?: number): MathCollection + + /** + * Compute the variance of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the variance over all elements + * will be calculated. Optionally, the type of normalization can be + * specified as second parameter. The parameter normalization can be one + * of the following values: 'unbiased' (default) The sum of squared + * errors is divided by (n - 1) 'uncorrected' The sum of squared errors + * is divided by n 'biased' The sum of squared errors is divided by (n + + * 1) Note that older browser may not like the variable name var. In + * that case, the function can be called as math['var'](...) instead of + * math.variance(...). + * @param args A single matrix or multiple scalar values + * @returns The variance + */ + variance(...args: MathNumericType[]): MathNumericType + /** + * Compute the variance of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the variance over all elements + * will be calculated. Optionally, the type of normalization can be + * specified as second parameter. The parameter normalization can be one + * of the following values: 'unbiased' (default) The sum of squared + * errors is divided by (n - 1) 'uncorrected' The sum of squared errors + * is divided by n 'biased' The sum of squared errors is divided by (n + + * 1) Note that older browser may not like the variable name var. In + * that case, the function can be called as math['var'](...) instead of + * math.variance(...). + * @param array A matrix to compute variance. + * @param dimension A dimension to compute variance on + * @param normalization normalization Determines how to normalize the + * variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. + * Default value: ‘unbiased’. + * @returns variance matrix. + */ + variance( + array: MathCollection, + dimension?: number, + normalization?: 'unbiased' | 'uncorrected' | 'biased' + ): MathNumericType[] + /** + * @param array A single matrix + * @param normalization normalization Determines how to normalize the + * variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. + * Default value: ‘unbiased’. + * @returns The variance + */ + variance( + array: MathCollection, + normalization: 'unbiased' | 'uncorrected' | 'biased' + ): MathNumericType + + /** + * Calculate the correlation coefficient between two matrix. + * @param {Array | Matrix} x The first array or matrix to compute correlation coefficient + * @param {Array | Matrix} y The second array or matrix to compute correlation coefficient + * @returns correlation coefficient + */ + corr(x: MathCollection, y: MathCollection): MathType + + /************************************************************************* + * String functions + ************************************************************************/ + + /** + * Format a value of any type into a string. + * @param value The value to be formatted + * @param options An object with formatting options. + * @param callback A custom formatting function, invoked for all numeric + * elements in value, for example all elements of a matrix, or the real + * and imaginary parts of a complex number. This callback can be used to + * override the built-in numeric notation with any type of formatting. + * Function callback is called with value as parameter and must return a + * string. + * @see http://mathjs.org/docs/reference/functions/format.html + * @returns The formatted value + */ + format( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options?: FormatOptions | number | BigNumber | ((item: any) => string), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback?: (value: any) => string + ): string + + /** + * Interpolate values into a string template. + * @param template A string containing variable placeholders. + * @param values An object containing variables which will be filled in + * in the template. + * @param precision Number of digits to format numbers. If not provided, + * the value will not be rounded. + * @param options Formatting options, or the number of digits to format + * numbers. See function math.format for a description of all options. + * @returns Interpolated string + */ + print( + template: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + values: any, + precision?: number, + options?: number | object + ): void + + /************************************************************************* + * Trigonometry functions + ************************************************************************/ + + /** + * Calculate the inverse cosine of a value. + * @param x Function input + * @returns The arc cosine of x + */ + acos(x: number): number | Complex + acos(x: T): T + + /** + * Calculate the hyperbolic arccos of a value, defined as acosh(x) = + * ln(sqrt(x^2 - 1) + x). + * @param x Function input + * @returns The hyperbolic arccosine of x + */ + acosh(x: number): number | Complex + acosh(x: T): T + + /** + * Calculate the inverse cotangent of a value. + * @param x Function input + * @returns The arc cotangent of x + */ + acot(x: number): number + acot(x: T): T + + /** + * Calculate the inverse hyperbolic tangent of a value, defined as acoth(x) + * = (ln((x+1)/x) + ln(x/(x-1))) / 2. + * @param x Function input + * @returns The inverse hyperbolic tangent of x + */ + acoth(x: number): number + acoth(x: T): T + + /** + * Calculate the inverse cosecant of a value. + * @param x Function input + * @returns The arc cosecant of x + */ + acsc(x: number): number | Complex + acsc(x: T): T + + /** + * Calculate the inverse hyperbolic cosecant of a value, defined as acsch(x) + * = ln(1/x + sqrt(1/x^2 + 1)). + * @param x Function input + * @returns The inverse hyperbolic cosecant of x + */ + acsch(x: number): number + acsch(x: T): T + + /** + * Calculate the inverse secant of a value. + * @param x Function input + * @returns The arc secant of x + */ + asec(x: number): number | Complex + asec(x: T): T + + /** + * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = + * ln(sqrt(1/x^2 - 1) + 1/x). + * @param x Function input + * @returns The hyperbolic arcsecant of x + */ + asech(x: number): number | Complex + asech(x: T): T + + /** + * Calculate the inverse sine of a value. + * @param x Function input + * @returns The arc sine of x + */ + asin(x: number): number | Complex + asin(x: T): T + + /** + * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = + * ln(x + sqrt(x^2 + 1)). + * @param x Function input + * @returns The hyperbolic arcsine of x + */ + asinh(x: T): T + + /** + * Calculate the inverse tangent of a value. + * @param x Function input + * @returns The arc tangent of x + */ + atan(x: T): T + + /** + * Calculate the inverse tangent function with two arguments, y/x. By + * providing two arguments, the right quadrant of the computed angle can + * be determined. For matrices, the function is evaluated element wise. + * @param x Function input + * @returns Four quadrant inverse tangent + */ + atan2(y: T, x: T): T + + /** + * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = + * ln((1 + x)/(1 - x)) / 2. + * @param x Function input + * @returns The hyperbolic arctangent of x + */ + atanh(x: number): number | Complex + atanh(x: T): T + + /** + * Calculate the cosine of a value. + * @param x Function input + * @returns The cosine of x + */ + cos(x: number | Unit): number + cos(x: T): T + + /** + * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 + * * (exp(x) + exp(-x)). + * @param x Function input + * @returns The hyperbolic cosine of x + */ + cosh(x: number | Unit): number + cosh(x: T): T + + /** + * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). + * @param x Function input + * @returns The cotangent of x + */ + cot(x: number | Unit): number + cot(x: T): T + + /** + * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 + * / tanh(x). + * @param x Function input + * @returns The hyperbolic cotangent of x + */ + coth(x: number | Unit): number + coth(x: T): T + + /** + * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). + * @param x Function input + * @returns The cosecant hof x + */ + csc(x: number | Unit): number + csc(x: T): T + + /** + * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 + * / sinh(x). + * @param x Function input + * @returns The hyperbolic cosecant of x + */ + csch(x: number | Unit): number + csch(x: T): T + + /** + * Calculate the secant of a value, defined as sec(x) = 1/cos(x). + * @param x Function input + * @returns The secant of x + */ + sec(x: number | Unit): number + sec(x: T): T + + /** + * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / + * cosh(x). + * @param x Function input + * @returns The hyperbolic secant of x + */ + sech(x: number | Unit): number + sech(x: T): T + + /** + * Calculate the sine of a value. + * @param x Function input + * @returns The sine of x + */ + sin(x: number | Unit): number + sin(x: T): T + + /** + * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * + * (exp(x) - exp(-x)). + * @param x Function input + * @returns The hyperbolic sine of x + */ + sinh(x: number | Unit): number + sinh(x: T): T + + /** + * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). + * @param x Function input + * @returns The tangent of x + */ + tan(x: number | Unit): number + tan(x: T): T + + /** + * Calculate the hyperbolic tangent of a value, defined as tanh(x) = + * (exp(2 * x) - 1) / (exp(2 * x) + 1). + * @param x Function input + * @returns The hyperbolic tangent of x + */ + tanh(x: number | Unit): number + tanh(x: T): T + + /************************************************************************* + * Unit functions + ************************************************************************/ + + /** + * Change the unit of a value. For matrices, the function is evaluated + * element wise. + * @param x The unit to be converted. + * @param unit New unit. Can be a string like "cm" or a unit without + * value. + * @returns Value with changed, fixed unit + */ + to(x: Unit | MathCollection, unit: Unit | string): Unit | MathCollection + + /************************************************************************* + * Utils + ************************************************************************/ + isNumber(x: unknown): x is number + + isBigNumber(x: unknown): x is BigNumber + + isBigInt(x: unknown): x is bigint + + isComplex(x: unknown): x is Complex + + isFraction(x: unknown): x is Fraction + + isUnit(x: unknown): x is Unit + + isString(x: unknown): x is string + + isArray: ArrayConstructor['isArray'] + + isMatrix(x: unknown): x is Matrix + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + isCollection(x: unknown): x is Matrix | any[] + + isDenseMatrix(x: unknown): x is Matrix + + isSparseMatrix(x: unknown): x is Matrix + + isRange(x: unknown): boolean + + isIndex(x: unknown): x is Index + + isBoolean(x: unknown): x is boolean + + isResultSet(x: unknown): boolean + + isHelp(x: unknown): x is Help + + isFunction(x: unknown): boolean + + isDate(x: unknown): x is Date + + isRegExp(x: unknown): x is RegExp + + isObject(x: unknown): boolean + + isMap(x: unknown): x is Map + + isPartitionedMap(x: unknown): x is PartitionedMap + + isObjectWrappingMap( + x: unknown + ): x is ObjectWrappingMap + + isNull(x: unknown): x is null + + isUndefined(x: unknown): x is undefined + + isAccessorNode(x: unknown): x is AccessorNode + + isArrayNode(x: unknown): x is ArrayNode + + isAssignmentNode(x: unknown): x is AssignmentNode + + isBlockNode(x: unknown): x is BlockNode + + isConditionalNode(x: unknown): x is ConditionalNode + + isConstantNode(x: unknown): x is ConstantNode + + isFunctionAssignmentNode(x: unknown): x is FunctionAssignmentNode + + isFunctionNode(x: unknown): x is FunctionNode + + isIndexNode(x: unknown): x is IndexNode + + isNode(x: unknown): x is MathNode + + isObjectNode(x: unknown): x is ObjectNode + + isOperatorNode(x: unknown): x is OperatorNode + + isParenthesisNode(x: unknown): x is ParenthesisNode + + isRangeNode(x: unknown): x is RangeNode + + isRelationalNode(x: unknown): x is RelationalNode + + isSymbolNode(x: unknown): x is SymbolNode + + isChain(x: unknown): x is MathJsChain + + /************************************************************************* + * Functions -> Utils + ************************************************************************/ + + /** + * Clone an object. + * @param x Object to be cloned + * @returns A clone of object x + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + clone(x: TType): TType + + /** + * Test whether a value is an numeric value. In case of a string, + * true is returned if the string contains a numeric value. + * @param x Value to be tested + * @returns Returns true when x is a number, BigNumber, bigint, Fraction, Boolean, or a String containing number. + * Returns false for other types. + * Throws an error in case of unknown types. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + hasNumericValue(x: any): boolean | boolean[] + + /** + * Test whether a value is an integer number. The function supports + * number, BigNumber, and Fraction. The function is evaluated + * element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x contains a numeric, integer value. + * Throws an error in case of an unknown data type. + */ + isInteger(x: number | BigNumber | Fraction | MathCollection): boolean + + /** + * Test whether a value is NaN (not a number). The function supports + * types number, BigNumber, Fraction, Unit and Complex. The function is + * evaluated element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is NaN. Throws an error in case of an + * unknown data type. + */ + isNaN( + x: number | BigNumber | bigint | Fraction | MathCollection | Unit + ): boolean + + /** + * Test whether a value is negative: smaller than zero. The function + * supports types number, BigNumber, Fraction, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is larger than zero. Throws an error in + * case of an unknown data type. + */ + isNegative( + x: number | BigNumber | bigint | Fraction | MathCollection | Unit + ): boolean + + /** + * Test whether a value is an numeric value. The function is evaluated + * element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is a number, BigNumber, bigint, Fraction, or + * boolean. Returns false for other types. Throws an error in case of + * unknown types. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + isNumeric(x: any): x is number | BigNumber | bigint | Fraction | boolean + + /** + * Test whether a value is positive: larger than zero. The function + * supports types number, BigNumber, Fraction, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is larger than zero. Throws an error in + * case of an unknown data type. + */ + isPositive( + x: number | BigNumber | bigint | Fraction | MathCollection | Unit + ): boolean + + /** + * Test whether a value is prime: has no divisors other than itself and + * one. The function supports type number, bignumber. The function is + * evaluated element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is larger than zero. Throws an error in + * case of an unknown data type. + */ + isPrime(x: number | BigNumber | MathCollection): boolean + + /** + * Test whether a value is zero. The function can check for zero for + * types number, BigNumber, Fraction, Complex, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + * @param x Value to be tested + * @returns Returns true when x is zero. Throws an error in case of an + * unknown data type. + */ + isZero(x: MathType): boolean + + /** + * Determine the type of a variable. + * @param x The variable for which to test the type + * @returns Returns the name of the type. Primitive types are lower + * case, non-primitive types are upper-camel-case. For example ‘number’, + * ‘string’, ‘Array’, ‘Date’. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + typeOf(x: any): string + + /** + * Import functions from an object or a module + * To avoid errors when using one of the imported functions extend module like this: + * + * @example + * // imported_math_functions.ts + * declare module 'mathjs' { + * interface MathJsInterface { + * hello(a: number): number; + * } + * } + * + * @param object An object with functions to be imported. + * @param options An object with import options. + */ + import(object: ImportObject | ImportObject[], options?: ImportOptions): void +} + +/** + * @deprecated since v12.0.0. The interface MathJsStatic has been renamed to MathJsInstance + */ +export type MathJsStatic = MathJsInstance + +/** + * @deprecated since v12.0.0. Use MathJsFactory instead and import dependency maps directly from the library + */ +export type FactoryDependencies = void + +/************************************************************************* + * Factory and Dependencies + ************************************************************************/ +export interface MathJsFactory { + create: ( + factories: FactoryFunctionMap, + config?: ConfigOptions + ) => MathJsInstance + + factory: ( + name: string, + dependencies: TDeps, + create: ( + injected: Pick> + ) => T, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + meta?: any + ) => FactoryFunction +} + +export const { + all, + typedDependencies, + ResultSetDependencies, + BigNumberDependencies, + ComplexDependencies, + FractionDependencies, + RangeDependencies, + MatrixDependencies, + DenseMatrixDependencies, + cloneDependencies, + isIntegerDependencies, + isNegativeDependencies, + isNumericDependencies, + hasNumericValueDependencies, + isPositiveDependencies, + isZeroDependencies, + isNaNDependencies, + typeOfDependencies, + typeofDependencies, + equalScalarDependencies, + SparseMatrixDependencies, + numberDependencies, + stringDependencies, + booleanDependencies, + bignumberDependencies, + complexDependencies, + fractionDependencies, + matrixDependencies, + splitUnitDependencies, + unaryMinusDependencies, + unaryPlusDependencies, + absDependencies, + applyDependencies, + addScalarDependencies, + cbrtDependencies, + ceilDependencies, + cubeDependencies, + expDependencies, + expm1Dependencies, + fixDependencies, + floorDependencies, + gcdDependencies, + lcmDependencies, + log10Dependencies, + log2Dependencies, + modDependencies, + multiplyScalarDependencies, + multiplyDependencies, + nthRootDependencies, + signDependencies, + sqrtDependencies, + squareDependencies, + subtractDependencies, + xgcdDependencies, + dotMultiplyDependencies, + bitAndDependencies, + bitNotDependencies, + bitOrDependencies, + bitXorDependencies, + argDependencies, + conjDependencies, + imDependencies, + reDependencies, + notDependencies, + orDependencies, + xorDependencies, + concatDependencies, + columnDependencies, + crossDependencies, + diagDependencies, + eyeDependencies, + filterDependencies, + flattenDependencies, + forEachDependencies, + getMatrixDataTypeDependencies, + identityDependencies, + kronDependencies, + mapDependencies, + onesDependencies, + rangeDependencies, + reshapeDependencies, + resizeDependencies, + rowDependencies, + sizeDependencies, + squeezeDependencies, + subsetDependencies, + transposeDependencies, + ctransposeDependencies, + zerosDependencies, + erfDependencies, + modeDependencies, + prodDependencies, + formatDependencies, + printDependencies, + toDependencies, + isPrimeDependencies, + numericDependencies, + divideScalarDependencies, + powDependencies, + roundDependencies, + logDependencies, + log1pDependencies, + nthRootsDependencies, + dotPowDependencies, + dotDivideDependencies, + lsolveDependencies, + usolveDependencies, + leftShiftDependencies, + rightArithShiftDependencies, + rightLogShiftDependencies, + andDependencies, + compareDependencies, + compareNaturalDependencies, + compareTextDependencies, + equalDependencies, + equalTextDependencies, + smallerDependencies, + smallerEqDependencies, + largerDependencies, + largerEqDependencies, + deepEqualDependencies, + unequalDependencies, + partitionSelectDependencies, + sortDependencies, + maxDependencies, + minDependencies, + ImmutableDenseMatrixDependencies, + IndexDependencies, + FibonacciHeapDependencies, + SpaDependencies, + UnitDependencies, + unitDependencies, + sparseDependencies, + createUnitDependencies, + acosDependencies, + acoshDependencies, + acotDependencies, + acothDependencies, + acscDependencies, + acschDependencies, + asecDependencies, + asechDependencies, + asinDependencies, + asinhDependencies, + atanDependencies, + atan2Dependencies, + atanhDependencies, + cosDependencies, + coshDependencies, + cotDependencies, + cothDependencies, + cscDependencies, + cschDependencies, + secDependencies, + sechDependencies, + sinDependencies, + sinhDependencies, + tanDependencies, + tanhDependencies, + setCartesianDependencies, + setDifferenceDependencies, + setDistinctDependencies, + setIntersectDependencies, + setIsSubsetDependencies, + setMultiplicityDependencies, + setPowersetDependencies, + setSizeDependencies, + setSymDifferenceDependencies, + setUnionDependencies, + zpk2tfDependencies, + freqzDependencies, + addDependencies, + hypotDependencies, + normDependencies, + dotDependencies, + traceDependencies, + indexDependencies, + NodeDependencies, + AccessorNodeDependencies, + ArrayNodeDependencies, + AssignmentNodeDependencies, + BlockNodeDependencies, + ConditionalNodeDependencies, + ConstantNodeDependencies, + FunctionAssignmentNodeDependencies, + IndexNodeDependencies, + ObjectNodeDependencies, + OperatorNodeDependencies, + ParenthesisNodeDependencies, + RangeNodeDependencies, + RelationalNodeDependencies, + SymbolNodeDependencies, + FunctionNodeDependencies, + parseDependencies, + compileDependencies, + evaluateDependencies, + evalDependencies, + ParserDependencies, + parserDependencies, + lupDependencies, + qrDependencies, + sluDependencies, + lusolveDependencies, + HelpDependencies, + ChainDependencies, + helpDependencies, + chainDependencies, + detDependencies, + invDependencies, + expmDependencies, + sqrtmDependencies, + sylvesterDependencies, + schurDependencies, + lyapDependencies, + divideDependencies, + distanceDependencies, + intersectDependencies, + sumDependencies, + meanDependencies, + medianDependencies, + madDependencies, + varianceDependencies, + varDependencies, + quantileSeqDependencies, + stdDependencies, + combinationsDependencies, + gammaDependencies, + factorialDependencies, + kldivergenceDependencies, + multinomialDependencies, + permutationsDependencies, + pickRandomDependencies, + randomDependencies, + randomIntDependencies, + stirlingS2Dependencies, + bellNumbersDependencies, + catalanDependencies, + compositionDependencies, + simplifyDependencies, + derivativeDependencies, + rationalizeDependencies, + reviverDependencies, + eDependencies, + EDependencies, + falseDependencies, + iDependencies, + InfinityDependencies, + LN10Dependencies, + LN2Dependencies, + LOG10EDependencies, + LOG2EDependencies, + NaNDependencies, + nullDependencies, + phiDependencies, + piDependencies, + PIDependencies, + SQRT1_2Dependencies, + SQRT2Dependencies, + tauDependencies, + trueDependencies, + versionDependencies, + atomicMassDependencies, + avogadroDependencies, + bohrMagnetonDependencies, + bohrRadiusDependencies, + boltzmannDependencies, + classicalElectronRadiusDependencies, + conductanceQuantumDependencies, + coulombDependencies, + deuteronMassDependencies, + efimovFactorDependencies, + electricConstantDependencies, + electronMassDependencies, + elementaryChargeDependencies, + faradayDependencies, + fermiCouplingDependencies, + fineStructureDependencies, + firstRadiationDependencies, + gasConstantDependencies, + gravitationConstantDependencies, + gravityDependencies, + hartreeEnergyDependencies, + inverseConductanceQuantumDependencies, + klitzingDependencies, + loschmidtDependencies, + magneticConstantDependencies, + magneticFluxQuantumDependencies, + molarMassDependencies, + molarMassC12Dependencies, + molarPlanckConstantDependencies, + molarVolumeDependencies, + neutronMassDependencies, + nuclearMagnetonDependencies, + planckChargeDependencies, + planckConstantDependencies, + planckLengthDependencies, + planckMassDependencies, + planckTemperatureDependencies, + planckTimeDependencies, + protonMassDependencies, + quantumOfCirculationDependencies, + reducedPlanckConstantDependencies, + rydbergDependencies, + sackurTetrodeDependencies, + secondRadiationDependencies, + speedOfLightDependencies, + stefanBoltzmannDependencies, + thomsonCrossSectionDependencies, + vacuumImpedanceDependencies, + weakMixingAngleDependencies, + wienDisplacementDependencies, + applyTransformDependencies, + columnTransformDependencies, + filterTransformDependencies, + forEachTransformDependencies, + indexTransformDependencies, + mapTransformDependencies, + maxTransformDependencies, + meanTransformDependencies, + minTransformDependencies, + rangeTransformDependencies, + rowTransformDependencies, + subsetTransformDependencies, + concatTransformDependencies, + stdTransformDependencies, + sumTransformDependencies, + varianceTransformDependencies +}: Record + +export interface Matrix { + type: string + storage(): string + datatype(): string + create(data: MathArray, datatype?: string): void + density(): number + // eslint-disable-next-line @typescript-eslint/no-explicit-any + subset(index: Index, replacement?: any, defaultValue?: any): Matrix + apply( + dim: number, + callback: (array: MathCollection) => number + ): MathCollection + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get(index: number[]): any + // eslint-disable-next-line @typescript-eslint/no-explicit-any + set(index: number[], value: any, defaultValue?: number | string): Matrix + resize(size: MathCollection, defaultValue?: number | string): Matrix + clone(): Matrix + size(): number[] + map( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (a: any, b: number[], c: Matrix) => any, + skipZeros?: boolean + ): Matrix + forEach( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (a: any, b: number[], c: Matrix) => void, + skipZeros?: boolean + ): void + toArray(): MathArray + valueOf(): MathArray + format( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options?: FormatOptions | number | BigNumber | ((value: any) => string) + ): string + toString(): string + // eslint-disable-next-line @typescript-eslint/no-explicit-any + toJSON(): any + // eslint-disable-next-line @typescript-eslint/no-explicit-any + diagonal(k?: number | BigNumber): any[] + swapRows(i: number, j: number): Matrix +} + +export interface MatrixCtor { + new (): Matrix +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface BigNumber extends Decimal {} + +export interface Fraction { + s: number + n: number + d: number +} + +export interface Complex { + re: number + im: number + clone(): Complex + equals(other: Complex): boolean + format(precision?: number): string + fromJSON(json: object): Complex + fromPolar(polar: object): Complex + fromPolar(r: number, phi: number): Complex + toJSON(): object + toPolar(): PolarCoordinates + toString(): string + compare(a: Complex, b: Complex): number +} + +export interface PolarCoordinates { + r: number + phi: number +} + +export interface MathJSON { + mathjs?: string + value: number + unit: string + fixPrefix?: boolean +} + +export interface BaseUnit { + dimensions: number[] + key: string +} + +export interface UnitComponent { + power: number + prefix: string + unit: { + name: string + base: BaseUnit + prefixes: Record + value: number + offset: number + dimensions: number[] + } +} + +export interface UnitPrefix { + name: string + value: number + scientific: boolean +} + +export interface Unit { + valueOf(): string + clone(): Unit + hasBase(base: BaseUnit | string | undefined): boolean + equalBase(unit: Unit): boolean + equals(unit: Unit): boolean + multiply(unit: Unit): Unit + divide(unit: Unit): Unit | number + pow(unit: Unit): Unit + abs(unit: Unit): Unit + to(unit: string): Unit + toNumber(unit?: string): number + toNumeric(unit?: string): number | Fraction | BigNumber + toSI(): Unit + toString(): string + toJSON(): MathJSON + formatUnits(): string + format(options: FormatOptions): string + simplify(): Unit + splitUnit(parts: ReadonlyArray): Unit[] + + units: UnitComponent[] + dimensions: number[] + value: number + fixPrefix: boolean + skipAutomaticSimplification: true +} + +export type UnitSystemName = 'si' | 'cgs' | 'us' | 'auto' + +export interface UnitStatic { + PREFIXES: Record + BASE_DIMENSIONS: string[] + BASE_UNITS: Record + UNIT_SYSTEMS: Record< + UnitSystemName, + Record + > + UNITS: Record + parse(str: string): Unit + isValuelessUnit(name: string): boolean + fromJSON(json: MathJSON): Unit + isValidAlpha(c: string): boolean + createUnit( + obj: Record, + options?: { override: boolean } + ): Unit + createUnitSingle( + name: string, + definition: string | Unit | UnitDefinition + ): Unit + getUnitSystem(): UnitSystemName + setUnitSystem(name: UnitSystemName): void +} + +export interface UnitCtor extends UnitStatic { + new ( + value: number | BigNumber | Fraction | Complex | boolean, + name: string + ): Unit +} + +export interface CreateUnitOptions { + prefixes?: 'none' | 'short' | 'long' | 'binary_short' | 'binary_long' + aliases?: string[] + offset?: number + override?: boolean +} + +export type SimplifyContext = Partial< + Record< + OperatorNodeFn, + { + trivial: boolean + total: boolean + commutative: boolean + associative: boolean + } + > +> + +export interface SimplifyOptions { + /** A boolean which is `true` by default. */ + exactFractions?: boolean + /** + * When `exactFractions` is true, a fraction will be returned only + * when both numerator and denominator are smaller than `fractionsLimit`. + * Default value is 10000. + */ + fractionsLimit?: number + /** A boolean which is `false` by default. */ + consoleDebug?: boolean + /** + * gives properties of each operator, which determine what simplifications + * are allowed. Properties are commutative, associative, total (whether + * the operation is defined for all arguments), and trivial (whether + * the operation applied to a single argument leaves that argument + * unchanged). + */ + context?: SimplifyContext +} + +export type SimplifyRule = + | { + l: string + r: string + repeat?: boolean + assuming?: SimplifyContext + imposeContext?: SimplifyContext + } + | { + s: string + repeat?: boolean + assuming?: SimplifyContext + imposeContext?: SimplifyContext + } + | string + | ((node: MathNode) => MathNode) + +export interface Simplify { + (expr: MathNode | string): MathNode + ( + expr: MathNode | string, + rules: SimplifyRule[], + scope?: object, + options?: SimplifyOptions + ): MathNode + (expr: MathNode | string, scope: object, options?: SimplifyOptions): MathNode + + rules: SimplifyRule[] +} + +export interface UnitDefinition { + definition?: string | Unit + prefixes?: string + offset?: number + aliases?: string[] + baseName?: string +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface Index {} + +export interface PartitionedMap { + a: Map + b: Map +} + +export interface ObjectWrappingMap { + wrappedObject: Record +} + +export interface EvalFunction { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + evaluate(scope?: any): any +} + +export interface MathNode { + isNode: true + comment: string + type: string + + isUpdateNode?: boolean + + /** + * Create a shallow clone of the node. The node itself is cloned, its + * childs are not cloned. + */ + clone(): this + /** + * Create a deep clone of the node. Both the node as well as all its + * childs are cloned recursively. + */ + cloneDeep(): this + /** + * Compile an expression into optimized JavaScript code. compile returns + * an object with a function evaluate([scope]) to evaluate. Example: + */ + compile(): EvalFunction + /** + * Compile and eval an expression, this is the equivalent of doing + * node.compile().evaluate(scope). Example: + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + evaluate(expr?: any): any + /** + * Test whether this node equals an other node. Does a deep comparison + * of the values of both nodes. + */ + equals(other: MathNode): boolean + /** + * + * Filter nodes in an expression tree. The callback function is called + * as callback(node: MathNode, path: string, parent: MathNode) : boolean + * for every node in the tree, and must return a boolean. The function + * filter returns an array with nodes for which the test returned true. + * Parameter path is a string containing a relative JSON Path. + * + * Example: + * + * ``` + * var node = math.parse('x^2 + x/4 + 3*y'); + * var filtered = node.filter(function (node) { + * return node.isSymbolMathNode && node.name == 'x'; + * }); + * // returns an array with two entries: two SymbolMathNodes 'x' + * ``` + * + * The callback function is called as callback(node: MathNode, path: + * string, parent: MathNode) : boolean for every node in the tree, and + * must return a boolean. The function filter returns an array with + * nodes for which the test returned true. Parameter path is a string + * containing a relative JSON Path. + * @return Returns an array with nodes for which test returned true + */ + filter( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (node: MathNode, path: string, parent: MathNode) => any + ): MathNode[] + + /** + * [forEach description] + */ + forEach( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (node: MathNode, path: string, parent: MathNode) => void + ): void + + /** + * Transform a node. Creates a new MathNode having it’s child's be the + * results of calling the provided callback function for each of the + * child's of the original node. The callback function is called as + * `callback(child: MathNode, path: string, parent: MathNode)` and must + * return a MathNode. Parameter path is a string containing a relative + * JSON Path. + * + * + * See also transform, which is a recursive version of map. + */ + map( + callback: (node: MathNode, path: string, parent: MathNode) => MathNode + ): MathNode + + /** + * Get a HTML representation of the parsed expression. + */ + toHTML(options?: object): string + + /** + * Get a string representation of the parsed expression. This is not + * exactly the same as the original input. + */ + toString(options?: object): string + + /** + * Get a LaTeX representation of the expression. + */ + toTex(options?: object): string + + /** + * Recursively transform an expression tree via a transform function. + * Similar to Array.map, but recursively executed on all nodes in the + * expression tree. The callback function is a mapping function + * accepting a node, and returning a replacement for the node or the + * original node. Function callback is called as callback(node: + * MathNode, path: string, parent: MathNode) for every node in the tree, + * and must return a MathNode. Parameter path is a string containing a + * relative JSON Path. + * + * For example, to replace all nodes of type SymbolMathNode having name + * ‘x’ with a ConstantMathNode with value 3: + * ```js + * var node = math.parse('x^2 + 5*x'); + * var transformed = node.transform(function (node, path, parent) { + * if (node.SymbolMathNode && node.name == 'x') { + * return new math.expression.node.ConstantMathNode(3); + * } + * else { + * return node; + * } + * }); + * transformed.toString(); // returns '(3 ^ 2) + (5 * 3)' + * ``` + */ + transform( + callback: (node: this, path: string, parent: MathNode) => TResult + ): TResult + + /** + * `traverse(callback)` + * + * Recursively traverse all nodes in a node tree. Executes given + * callback for this node and each of its child nodes. Similar to + * Array.forEach, except recursive. The callback function is a mapping + * function accepting a node, and returning a replacement for the node + * or the original node. Function callback is called as callback(node: + * MathNode, path: string, parent: MathNode) for every node in the tree. + * Parameter path is a string containing a relative JSON Path. Example: + * + * ``` + * var node = math.parse('3 * x + 2'); + * node.traverse(function (node, path, parent) { + * switch (node.type) { + * case 'OperatorMathNode': console.log(node.type, node.op); break; + * case 'ConstantMathNode': console.log(node.type, node.value); break; + * case 'SymbolMathNode': console.log(node.type, node.name); break; + * default: console.log(node.type); + * } + * }); + * // outputs: + * // OperatorMathNode + + * // OperatorMathNode * + * // ConstantMathNode 3 + * // SymbolMathNode x + * // ConstantMathNode 2 + * ``` + */ + traverse( + callback: (node: MathNode, path: string, parent: MathNode) => void + ): void +} + +export interface Parser { + /** + * Evaluate an expression. Returns the result of the expression. + * @param expr The expression to evaluate + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + evaluate(expr: string | string[]): any + /** + * Retrieve a variable or function from the parser’s scope. + * @param name The name of the variable or function to be retrieved + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get(name: string): any + /** + * Retrieve an object with all defined variables in the parser’s scope. + * @returns An object with all defined variables + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + getAll(): { [key: string]: any } + /** + * Retrieve a map with all defined variables in the parser’s scope. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + getAllAsMap(): Map + /** + * Set a variable or function in the parser’s scope. + * @param name The name of the variable or function to be set + * @param value The value of the variable or function to be set + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + set: (name: string, value: any) => void + /** + * Remove a variable or function from the parser’s scope. + * @param name The name of the variable or function to be removed + */ + remove: (name: string) => void + /** + * Completely clear the parser’s scope. + */ + clear: () => void +} + +export interface Distribution { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + random(size: any, min?: any, max?: any): any + // eslint-disable-next-line @typescript-eslint/no-explicit-any + randomInt(min: any, max?: any): any + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pickRandom(array: any): any +} + +export interface FormatOptions { + /** + * Number notation. Choose from: 'fixed' Always use regular number + * notation. For example '123.40' and '14000000' 'exponential' Always + * use exponential notation. For example '1.234e+2' and '1.4e+7' 'auto' + * (default) Regular number notation for numbers having an absolute + * value between lower and upper bounds, and uses exponential notation + * elsewhere. Lower bound is included, upper bound is excluded. For + * example '123.4' and '1.4e7'. + */ + notation?: + | 'fixed' + | 'exponential' + | 'engineering' + | 'auto' + | 'hex' + | 'bin' + | 'oct' + + /** + * A number between 0 and 16 to round the digits of the number. In case + * of notations 'exponential' and 'auto', precision defines the total + * number of significant digits returned and is undefined by default. In + * case of notation 'fixed', precision defines the number of significant + * digits after the decimal point, and is 0 by default. + */ + precision?: number | BigNumber + + /** + * Exponent determining the lower boundary for formatting a value with + * an exponent when notation='auto. Default value is -3. + */ + lowerExp?: number | BigNumber + + /** + * Exponent determining the upper boundary for formatting a value with + * an exponent when notation='auto. Default value is 5. + */ + upperExp?: number | BigNumber + + /** + * Available values: 'ratio' (default) or 'decimal'. For example + * format(fraction(1, 3)) will output '1/3' when 'ratio' is configured, + * and will output 0.(3) when 'decimal' is configured. + */ + fraction?: string + + /** + * The word size in bits to use for formatting in binary, octal, or + * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'` + * values for `notation` option. When this option is defined the value + * is formatted as a signed twos complement integer of the given word + * size and the size suffix is appended to the output. + */ + wordSize?: number | BigNumber +} + +export interface Help { + toString(): string + toJSON(): string +} + +export interface ConfigOptions { + relTol?: number + absTol?: number + /** + * @deprecated Use `relTol` and `absTol` instead + */ + epsilon?: number + matrix?: 'Matrix' | 'Array' + number?: 'number' | 'BigNumber' | 'bigint' | 'Fraction' + numberFallback?: 'number' | 'BigNumber' + precision?: number + predictable?: boolean + randomSeed?: string | null +} + +export interface MathJsChain { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + done(): TValue + + /************************************************************************* + * Construction functions + ************************************************************************/ + + /** + * Create a BigNumber, which can store numbers with arbitrary precision. + * When a matrix is provided, all elements will be converted to + * BigNumber. + */ + bignumber( + this: MathJsChain< + number | string | Fraction | BigNumber | bigint | Unit | boolean | null + > + ): MathJsChain + bignumber(this: MathJsChain): MathJsChain + + /** + * Create a bigint, which can store integers with arbitrary precision. + * When a matrix is provided, all elements will be converted to bigint. + */ + bigint( + this: MathJsChain< + number | string | Fraction | BigNumber | bigint | boolean | null + > + ): MathJsChain + bigint(this: MathJsChain): MathJsChain + + /** + * Create a boolean or convert a string or number to a boolean. In case + * of a number, true is returned for non-zero numbers, and false in case + * of zero. Strings can be 'true' or 'false', or can contain a number. + * When value is a matrix, all elements will be converted to boolean. + */ + boolean( + this: MathJsChain + ): MathJsChain + boolean(this: MathJsChain): MathJsChain + + /** + * Create a complex value or convert a value to a complex value. + * @param im Argument specifying the imaginary part of the complex + * number + */ + complex( + this: MathJsChain, + im?: number + ): MathJsChain + complex(this: MathJsChain): MathJsChain + + /** + * Create a user-defined unit and register it with the Unit type. + * @param definition Definition of the unit in terms of existing units. + * For example, ‘0.514444444 m / s’. + * @param options (optional) An object containing any of the following + * properties:
    - prefixes {string} “none”, “short”, “long”, + * “binary_short”, or “binary_long”. The default is “none”.
    - + * aliases {Array} Array of strings. Example: [‘knots’, ‘kt’, + * ‘kts’]
    - offset {Numeric} An offset to apply when converting from + * the unit. For example, the offset for celsius is 273.15. Default is + * 0. + */ + createUnit( + this: MathJsChain, + definition?: string | UnitDefinition | Unit, + options?: CreateUnitOptions + ): MathJsChain + /** + * Create a user-defined unit and register it with the Unit type. + * @param options (optional) An object containing any of the following + * properties:
    - prefixes {string} “none”, “short”, “long”, + * “binary_short”, or “binary_long”. The default is “none”.
    - + * aliases {Array} Array of strings. Example: [‘knots’, ‘kt’, + * ‘kts’]
    - offset {Numeric} An offset to apply when converting from + * the unit. For example, the offset for celsius is 273.15. Default is + * 0. + */ + createUnit( + this: MathJsChain>, + options?: CreateUnitOptions + ): MathJsChain + + /** + * Create a fraction convert a value to a fraction. + * @param denominator Argument specifying the denominator of the + * fraction + */ + fraction( + this: MathJsChain< + | number + | string + | BigNumber + | bigint + | Unit + | Fraction + | FractionDefinition + >, + denominator?: number + ): MathJsChain + fraction(this: MathJsChain): MathJsChain + + /** + * Create an index. An Index can store ranges having start, step, and + * end for multiple dimensions. Matrix.get, Matrix.set, and math.subset + * accept an Index as input. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + index(this: MathJsChain): MathJsChain + + /** + * Create a Matrix. The function creates a new math.type.Matrix object + * from an Array. A Matrix has utility functions to manipulate the data + * in the matrix, like getting the size and getting or setting values in + * the matrix. Supported storage formats are 'dense' and 'sparse'. + */ + matrix( + this: MathJsChain, + format?: 'sparse' | 'dense', + dataType?: string + ): MathJsChain + + /** + * Create a number or convert a string, boolean, or unit to a number. + * When value is a matrix, all elements will be converted to number. + * @param valuelessUnit A valueless unit, used to convert a unit to a + * number + */ + number( + this: MathJsChain< + string | number | BigNumber | bigint | Fraction | boolean | Unit | null + >, + valuelessUnit?: Unit | string + ): MathJsChain + number( + this: MathJsChain, + valuelessUnit?: Unit | string + ): MathJsChain + + /** + * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction. + * @param outputType The desired numeric output type + */ + numeric( + this: MathJsChain, + outputType: 'number' + ): MathJsChain + numeric( + this: MathJsChain, + outputType: 'BigNumber' + ): MathJsChain + numeric( + this: MathJsChain, + outputType: 'bigint' + ): MathJsChain + numeric( + this: MathJsChain, + outputType: 'Fraction' + ): MathJsChain + + /** + * Create a Sparse Matrix. The function creates a new math.type.Matrix + * object from an Array. A Matrix has utility functions to manipulate + * the data in the matrix, like getting the size and getting or setting + * values in the matrix. + * @param dataType Sparse Matrix data type + */ + sparse( + this: MathJsChain, + dataType?: string + ): MathJsChain + + /** + * Split a unit in an array of units whose sum is equal to the original + * unit. + * @param parts An array of strings or valueless units + */ + splitUnit(this: MathJsChain, parts: Unit[]): MathJsChain + + /** + * Create a string or convert any object into a string. Elements of + * Arrays and Matrices are processed element wise. + */ + string( + this: MathJsChain + ): MathJsChain + string(this: MathJsChain): MathJsChain + + /** + * Create a unit. Depending on the passed arguments, the function will + * create and return a new math.type.Unit object. When a matrix is + * provided, all elements will be converted to units. + * @param unit The unit to be created + */ + unit(this: MathJsChain, unit?: string): MathJsChain + unit(this: MathJsChain, unit?: string): MathJsChain + unit(this: MathJsChain, unit?: string): MathJsChain + + /************************************************************************* + * Expression functions + ************************************************************************/ + + /** + * Parse and compile an expression. Returns a an object with a function + * evaluate([scope]) to evaluate the compiled expression. + */ + compile(this: MathJsChain): MathJsChain + + // TODO properly type this + /** + * Evaluate an expression. + * @param scope Scope to read/write variables + */ + evaluate( + this: MathJsChain, + scope?: object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): MathJsChain + evaluate( + this: MathJsChain, + scope?: object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): MathJsChain + + /** + * Retrieve help on a function or data type. Help files are retrieved + * from the documentation in math.expression.docs. + */ + help(this: MathJsChain): MathJsChain + + /** + * @param options Available options: nodes - a set of custome nodes + */ + parse( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options?: any + ): MathJsChain + + /** + * Parse an expression. Returns a node tree, which can be evaluated by + * invoking node.evaluate(); + * @param options Available options: nodes - a set of custome nodes + */ + parse( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options?: any + ): MathJsChain + + /** + * Replaces variable nodes with their scoped values + * @param scope Scope to read/write variables + */ + resolve( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + scope?: Record + ): MathJsChain + resolve( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + scope?: Record + ): MathJsChain + + /************************************************************************* + * Algebra functions + ************************************************************************/ + /** + * @param variable The variable over which to differentiate + * @param options There is one option available, simplify, which is true + * by default. When false, output will not be simplified. + */ + derivative( + this: MathJsChain, + variable: MathNode | string, + options?: { simplify: boolean } + ): MathJsChain + + /** + * Solves the linear equation system by forwards substitution. Matrix + * must be a lower triangular matrix. + * @param b A column vector with the b values + */ + lsolve(this: MathJsChain, b: MathCollection): MathJsChain + lsolve( + this: MathJsChain, + b: MathCollection + ): MathJsChain + + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A + * is decomposed in two matrices (L, U) and a row permutation vector p + * where A[p,:] = L * U + */ + lup(this: MathJsChain): MathJsChain + + /** + * Solves the linear system A * x = b where A is an [n x n] matrix and b + * is a [n] column vector. + * @param b Column Vector + * @param order The Symbolic Ordering and Analysis order, see slu for + * details. Matrix must be a SparseMatrix + * @param threshold Partial pivoting threshold (1 for partial pivoting), + * see slu for details. Matrix must be a SparseMatrix. + */ + lusolve( + this: MathJsChain, + b: MathCollection, + order?: number, + threshold?: number + ): MathJsChain + + lusolve( + this: MathJsChain, + b: MathCollection, + order?: number, + threshold?: number + ): MathJsChain + + lusolve( + this: MathJsChain, + b: MathCollection + ): MathJsChain + + /** + * Calculate the Matrix QR decomposition. Matrix A is decomposed in two + * matrices (Q, R) where Q is an orthogonal matrix and R is an upper + * triangular matrix. + */ + qr(this: MathJsChain): MathJsChain + + /** + * Transform a rationalizable expression in a rational fraction. If + * rational fraction is one variable polynomial then converts the + * numerator and denominator in canonical form, with decreasing + * exponents, returning the coefficients of numerator. + * @param optional scope of expression or true for already evaluated + * rational expression at input + * @param detailed optional True if return an object, false if return + * expression node (default) + */ + rationalize( + this: MathJsChain, + optional?: object | boolean, + detailed?: boolean + ): MathJsChain + + /** + * Simplify an expression tree. + * @param rules A list of rules are applied to an expression, repeating + * over the list until no further changes are made. It’s possible to + * pass a custom set of rules to the function as second argument. A rule + * can be specified as an object, string, or function. + * @param scope Scope to variables + * @param options Options to configure the behavior of simplify + */ + simplify( + this: MathJsChain, + rules?: SimplifyRule[], + scope?: Map | object, + options?: SimplifyOptions + ): MathJsChain + + simplifyConstant( + this: MathJsChain, + options?: SimplifyOptions + ): MathJsChain + simplifyCore( + this: MathJsChain, + options?: SimplifyOptions + ): MathJsChain + + /** + * Gives the number of “leaf nodes” in the parse tree of the given + * expression. A leaf node is one that has no subexpressions, essentially + * either a symbol or a constant. Note that `5!` has just one leaf, the `5`; + * the unary factorial operator does not add a leaf. On the other hand, + * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves. + */ + leafCount(this: MathJsChain): MathJsChain + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. + * Sparse Matrix A is decomposed in two matrices (L, U) and two + * permutation vectors (pinv, q) where P * A * Q = L * U + * @param order The Symbolic Ordering and Analysis order: 0 - Natural + * ordering, no permutation vector q is returned 1 - Matrix must be + * square, symbolic ordering and analisis is performed on M = A + A' 2 - + * Symbolic ordering and analysis is performed on M = A' * A. Dense + * columns from A' are dropped, A recreated from A'. This is appropriate + * for LU factorization of non-symmetric matrices. 3 - Symbolic ordering + * and analysis is performed on M = A' * A. This is best used for LU + * factorization is matrix M has no dense rows. A dense row is a row + * with more than 10*sqr(columns) entries. + * @param threshold Partial pivoting threshold (1 for partial pivoting) + */ + slu( + this: MathJsChain, + order: number, + threshold: number + ): MathJsChain + + /** + * Solves the linear equation system by backward substitution. Matrix + * must be an upper triangular matrix. U * x = b + * @param b A column vector with the b values + */ + usolve(this: MathJsChain, b: MathCollection): MathJsChain + usolve( + this: MathJsChain, + b: MathCollection + ): MathJsChain + + /************************************************************************* + * Arithmetic functions + ************************************************************************/ + + /** + * Calculate the absolute value of a number. For matrices, the function + * is evaluated element wise. + */ + abs(this: MathJsChain): MathJsChain + + /** + * Add two values, x + y. For matrices, the function is evaluated + * element wise. + * @param y Second value to add + */ + add(this: MathJsChain, y: T): MathJsChain + add(this: MathJsChain, y: MathType): MathJsChain + + /** + * Apply a function that maps an array to a scalar along a given axis of the + * matrix or array. Returns a new matrix or array with one less dimension + * than the input. + * @param dim The dimension along which the callback is applied + * @param callback The callback function that is applied. This Function should take an + * array or 1-d matrix as an input and return a number. + * @returns The residual matrix with the function applied over some dimension. + */ + apply( + this: MathJsChain, + dim: number, + callback: (array: Array | Matrix) => number + ): MathJsChain + + /** + * Calculate the cubic root of a value. For matrices, the function is + * evaluated element wise. + * @param allRoots Optional, false by default. Only applicable when x is + * a number or complex number. If true, all complex roots are returned, + * if false (default) the principal root is returned. + */ + cbrt( + this: MathJsChain, + allRoots?: boolean + ): MathJsChain + + // Rounding functions grouped for similarity + + /** + * Round a value towards plus infinity If x is complex, both real and + * imaginary part are rounded towards plus infinity. For matrices, the + * function is evaluated element wise. + * @param n Number of decimals Default value: 0. + */ + ceil( + this: MathJsChain, + n?: number | BigNumber | MathCollection + ): MathJsChain + + /** + * Round a value towards zero. For matrices, the function is evaluated + * element wise. + * @param n Number of decimals Default value: 0. + */ + fix( + this: MathJsChain, + n?: number | BigNumber | MathCollection + ): MathJsChain + + /** + * Round a value towards minus infinity. For matrices, the function is + * evaluated element wise. + * @param n Number of decimals Default value: 0. + */ + floor( + this: MathJsChain, + n?: number | BigNumber | MathCollection + ): MathJsChain + + /** + * Round a value towards the nearest integer. For matrices, the function + * is evaluated element wise. + * @param n Number of decimals Default value: 0. + */ + round( + this: MathJsChain, + n?: number | BigNumber | MathCollection + ): MathJsChain + round( + this: MathJsChain, + n: U + ): MathJsChain + round(this: MathJsChain, unit: Unit): MathJsChain + round( + this: MathJsChain, + unit: Unit + ): MathJsChain + round( + this: MathJsChain, + n: number | BigNumber, + unit: Unit + ): MathJsChain + round( + this: MathJsChain, + n: number | BigNumber, + unit: Unit + ): MathJsChain + + // End of rounding group + + /** + * Compute the cube of a value, x * x * x. For matrices, the function is + * evaluated element wise. + */ + cube(this: MathJsChain): MathJsChain + + /** + * Divide two values, x / y. To divide matrices, x is multiplied with + * the inverse of y: x * inv(y). + * @param y Denominator + */ + divide(this: MathJsChain, y: Unit): MathJsChain + divide(this: MathJsChain, y: number): MathJsChain + divide(this: MathJsChain, y: number): MathJsChain + divide(this: MathJsChain, y: MathType): MathJsChain + + /** + * Divide two matrices element wise. The function accepts both matrices + * and scalar values. + * @param y Denominator + */ + dotDivide( + this: MathJsChain, + y: MathType + ): MathJsChain + dotDivide( + this: MathJsChain, + y: T + ): MathJsChain + dotDivide(this: MathJsChain, y: MathType): MathJsChain + dotDivide(this: MathJsChain, y: Unit): MathJsChain + dotDivide( + this: MathJsChain, + y: MathNumericType + ): MathJsChain + + /** + * Multiply two matrices element wise. The function accepts both + * matrices and scalar values. + * @param y Right hand value + */ + dotMultiply( + this: MathJsChain, + y: MathType + ): MathJsChain + dotMultiply( + this: MathJsChain, + y: T + ): MathJsChain + dotMultiply(this: MathJsChain, y: MathType): MathJsChain + dotMultiply(this: MathJsChain, y: Unit): MathJsChain + dotMultiply( + this: MathJsChain, + y: MathNumericType + ): MathJsChain + + /** + * Calculates the power of x to y element wise. + * @param y The exponent + */ + dotPow(this: MathJsChain, y: MathType): MathJsChain + + /** + * Calculate the exponent of a value. For matrices, the function is + * evaluated element wise. + */ + exp( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the value of subtracting 1 from the exponential value. For + * matrices, the function is evaluated element wise. + */ + expm1( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the greatest common divisor for two or more values or + * arrays. For matrices, the function is evaluated element wise. + */ + gcd( + this: MathJsChain, + ...args: T[] + ): MathJsChain + + /** + * Calculate the hypotenuse of a list with values. The hypotenuse is + * defined as: hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) For + * matrix input, the hypotenuse is calculated for all values in the + * matrix. + */ + hypot(this: MathJsChain): MathJsChain + + /** + * Calculate the least common multiple for two or more values or arrays. + * lcm is defined as: lcm(a, b) = abs(a * b) / gcd(a, b) For matrices, + * the function is evaluated element wise. + * @param b An integer number + */ + lcm( + this: MathJsChain, + b: T + ): MathJsChain + + /** + * Calculate the logarithm of a value. For matrices, the function is + * evaluated element wise. + * @param base Optional base for the logarithm. If not provided, the + * natural logarithm of x is calculated. Default value: e. + */ + log( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain> + + /** + * Calculate the 10-base of a value. This is the same as calculating + * log(x, 10). For matrices, the function is evaluated element wise. + */ + + log10( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the logarithm of a value+1. For matrices, the function is + * evaluated element wise. + */ + log1p( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain + log1p( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain + log1p( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain + log1p( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain + log1p( + this: MathJsChain, + base?: number | BigNumber | Complex + ): MathJsChain + + /** + * Calculate the 2-base of a value. This is the same as calculating + * log(x, 2). For matrices, the function is evaluated element wise. + */ + + log2( + this: MathJsChain + ): MathJsChain + + /** + * Calculates the modulus, the remainder of an integer division. For + * matrices, the function is evaluated element wise. The modulus is + * defined as: x - y * floor(x / y) + * @see http://en.wikipedia.org/wiki/Modulo_operation. + * @param y Divisor + */ + mod( + this: MathJsChain, + y: number | BigNumber | bigint | Fraction | MathCollection + ): MathJsChain> + + /** + * Multiply two values, x * y. The result is squeezed. For matrices, the + * matrix product is calculated. + * @param y The second value to multiply + */ + multiply( + this: MathJsChain, + y: MathType + ): MathJsChain + multiply(this: MathJsChain, y: Unit): MathJsChain + multiply(this: MathJsChain, y: number): MathJsChain + multiply(this: MathJsChain, y: MathType): MathJsChain + + /** + * Calculate the norm of a number, vector or matrix. The second + * parameter p is optional. If not provided, it defaults to 2. + * @param p Vector space. Supported numbers include Infinity and + * -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The + * Frobenius norm) Default value: 2. + */ + norm( + this: MathJsChain, + p?: number | BigNumber | string + ): MathJsChain + + /** + * Calculate the nth root of a value. The principal nth root of a + * positive real number A, is the positive real solution of the equation + * x^root = A For matrices, the function is evaluated element wise. + * @param root The root. Default value: 2. + */ + nthRoot( + this: MathJsChain, + root?: number | BigNumber + ): MathJsChain + + /** + * Calculates the power of x to y, x ^ y. Matrix exponentiation is + * supported for square matrices x, and positive integer exponents y. + * @param y The exponent + */ + pow( + this: MathJsChain, + y: number | BigNumber | bigint | Complex + ): MathJsChain + + /** + * Compute the sign of a value. The sign of a value x is: 1 when x > 1 + * -1 when x < 0 0 when x == 0 For matrices, the function is evaluated + * element wise. + * @param x The number for which to determine the sign + * @returns The sign of x + */ + sign(this: MathJsChain): MathJsChain + + /** + * Calculate the square root of a value. For matrices, the function is + * evaluated element wise. + */ + + sqrt( + this: MathJsChain + ): MathJsChain + + /** + * Compute the square of a value, x * x. For matrices, the function is + * evaluated element wise. + */ + + square(this: MathJsChain): MathJsChain + + /** + * Subtract two values, x - y. For matrices, the function is evaluated + * element wise. + * @param y Value to subtract from x + */ + subtract(this: MathJsChain, y: T): MathJsChain + + /** + * Inverse the sign of a value, apply a unary minus operation. For + * matrices, the function is evaluated element wise. Boolean values and + * strings will be converted to a number. For complex numbers, both real + * and complex value are inverted. + */ + + unaryMinus(this: MathJsChain): MathJsChain + + /** + * Unary plus operation. Boolean values and strings will be converted to + * a number, numeric values will be returned as is. For matrices, the + * function is evaluated element wise. + */ + + unaryPlus(this: MathJsChain): MathJsChain + + /** + * Calculate the extended greatest common divisor for two values. See + * http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + * @param b An integer number + */ + xgcd( + this: MathJsChain, + b: number | BigNumber + ): MathJsChain + + /** + * Count the number of elements of a matrix, array or string. + */ + count(this: MathJsChain): MathJsChain + count(this: MathJsChain): MathJsChain + + /** + * Compute the sum of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the sum of all elements will be + * calculated. + */ + sum( + this: MathJsChain> + ): MathJsChain + sum(this: MathJsChain): MathJsChain + /************************************************************************* + * Bitwise functions + ************************************************************************/ + + /** + * Bitwise AND two values, x & y. For matrices, the function is + * evaluated element wise. + * @param y Second value to and + */ + bitAnd( + this: MathJsChain, + y: number | BigNumber | bigint | MathCollection + ): MathJsChain> + + /** + * Bitwise NOT value, ~x. For matrices, the function is evaluated + * element wise. For units, the function is evaluated on the best prefix + * base. + */ + + bitNot( + this: MathJsChain + ): MathJsChain + + /** + * Bitwise OR two values, x | y. For matrices, the function is evaluated + * element wise. For units, the function is evaluated on the lowest + * print base. + * @param y Second value to or + */ + bitOr( + this: MathJsChain, + y: T + ): MathJsChain + + /** + * Bitwise XOR two values, x ^ y. For matrices, the function is + * evaluated element wise. + * @param y Second value to xor + */ + bitXor( + this: MathJsChain, + y: number | BigNumber | bigint | MathCollection + ): MathJsChain> + + /** + * Bitwise left logical shift of a value x by y number of bits, x << y. + * For matrices, the function is evaluated element wise. For units, the + * function is evaluated on the best prefix base. + * @param y Amount of shifts + */ + leftShift( + this: MathJsChain, + y: number | BigNumber | bigint + ): MathJsChain> + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, x >> + * y. For matrices, the function is evaluated element wise. For units, + * the function is evaluated on the best prefix base. + * @param y Amount of shifts + */ + rightArithShift( + this: MathJsChain, + y: number | BigNumber | bigint + ): MathJsChain> + + /** + * Bitwise right logical shift of value x by y number of bits, x >>> y. + * For matrices, the function is evaluated element wise. For units, the + * function is evaluated on the best prefix base. + * @param y Amount of shifts + */ + rightLogShift( + this: MathJsChain, + y: number + ): MathJsChain> + + /************************************************************************* + * Combinatorics functions + ************************************************************************/ + + /** + * The Bell Numbers count the number of partitions of a set. A partition + * is a pairwise disjoint subset of S whose union is S. bellNumbers only + * takes integer arguments. The following condition must be enforced: n + * >= 0 + */ + + bellNumbers(this: MathJsChain): MathJsChain + bellNumbers(this: MathJsChain): MathJsChain + + /** + * The Catalan Numbers enumerate combinatorial structures of many + * different types. catalan only takes integer arguments. The following + * condition must be enforced: n >= 0 + */ + + catalan(this: MathJsChain): MathJsChain + catalan(this: MathJsChain): MathJsChain + + /** + * The composition counts of n into k parts. Composition only takes + * integer arguments. The following condition must be enforced: k <= n. + * @param k Number of objects in the subset + */ + composition( + this: MathJsChain, + k: number | BigNumber + ): MathJsChain> + + /** + * The Stirling numbers of the second kind, counts the number of ways to + * partition a set of n labelled objects into k nonempty unlabelled + * subsets. stirlingS2 only takes integer arguments. The following + * condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = + * 1 + * @param k Number of objects in the subset + */ + stirlingS2( + this: MathJsChain, + k: number | BigNumber + ): MathJsChain> + + /************************************************************************* + * Complex functions + ************************************************************************/ + + /** + * Compute the argument of a complex value. For a complex number a + bi, + * the argument is computed as atan2(b, a). For matrices, the function + * is evaluated element wise. + */ + + arg(this: MathJsChain): MathJsChain + arg(this: MathJsChain): MathJsChain + arg(this: MathJsChain): MathJsChain + arg(this: MathJsChain): MathJsChain + + /** + * Compute the complex conjugate of a complex value. If x = a+bi, the + * complex conjugate of x is a - bi. For matrices, the function is + * evaluated element wise. + */ + conj( + this: MathJsChain + ): MathJsChain> + + /** + * Get the imaginary part of a complex number. For a complex number a + + * bi, the function returns b. For matrices, the function is evaluated + * element wise. + */ + im(this: MathJsChain): MathJsChain + im(this: MathJsChain): MathJsChain + im(this: MathJsChain): MathJsChain + + /** + * Get the real part of a complex number. For a complex number a + bi, + * the function returns a. For matrices, the function is evaluated + * element wise. + */ + re(this: MathJsChain): MathJsChain + re(this: MathJsChain): MathJsChain + re(this: MathJsChain): MathJsChain + + /************************************************************************* + * Geometry functions + ************************************************************************/ + + /** + * Calculates: The eucledian distance between two points in 2 and 3 + * dimensional spaces. Distance between point and a line in 2 and 3 + * dimensional spaces. Pairwise distance between a set of 2D or 3D + * points NOTE: When substituting coefficients of a line(a, b and c), + * use ax + by + c = 0 instead of ax + by = c For parametric equation of + * a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, + * c) + * @param y Coordinates of the second point + */ + distance( + this: MathJsChain, + y: MathCollection | object + ): MathJsChain + + /** + * Calculates the point of intersection of two lines in two or three + * dimensions and of a line and a plane in three dimensions. The inputs + * are in the form of arrays or 1 dimensional matrices. The line + * intersection functions return null if the lines do not meet. Note: + * Fill the plane coefficients as x + y + z = c and not as x + y + z + c + * = 0. + * @param x Co-ordinates of second end-point of first line + * @param y Co-ordinates of first end-point of second line OR + * Coefficients of the plane's equation + * @param z Co-ordinates of second end-point of second line OR null if + * the calculation is for line and plane + */ + intersect( + this: MathJsChain, + x: MathCollection, + y: MathCollection, + z?: MathCollection + ): MathJsChain + + /************************************************************************* + * Logical functions + ************************************************************************/ + + /** + * Logical and. Test whether two values are both defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param y Second value to and + */ + and( + this: MathJsChain< + number | BigNumber | bigint | Complex | Unit | MathCollection + >, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): MathJsChain + + /** + * Logical not. Flips boolean value of a given parameter. For matrices, + * the function is evaluated element wise. + */ + not( + this: MathJsChain< + number | BigNumber | bigint | Complex | Unit | MathCollection + > + ): MathJsChain + + /** + * Logical or. Test if at least one value is defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param y Second value to or + */ + or( + this: MathJsChain< + number | BigNumber | bigint | Complex | Unit | MathCollection + >, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): MathJsChain + + /** + * Logical xor. Test whether one and only one value is defined with a + * nonzero/nonempty value. For matrices, the function is evaluated + * element wise. + * @param y Second value to xor + */ + xor( + this: MathJsChain< + number | BigNumber | bigint | Complex | Unit | MathCollection + >, + y: number | BigNumber | bigint | Complex | Unit | MathCollection + ): MathJsChain + + /************************************************************************* + * Matrix functions + ************************************************************************/ + + /** + * Concatenate two or more matrices. dim: number is a zero-based + * dimension over which to concatenate the matrices. By default the last + * dimension of the matrices. + */ + + concat( + this: MathJsChain> + ): MathJsChain + + /** + * Calculate the cross product for two vectors in three dimensional + * space. The cross product of A = [a1, a2, a3] and B =[b1, b2, b3] is + * defined as: cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 + * * b2 - a2 * b1 ] + * @param y Second vector + */ + cross( + this: MathJsChain, + y: MathCollection + ): MathJsChain + + /** + * Calculate the determinant of a matrix. + */ + + det(this: MathJsChain): MathJsChain + + /** + * Create a diagonal matrix or retrieve the diagonal of a matrix. When x + * is a vector, a matrix with vector x on the diagonal will be returned. + * When x is a two dimensional matrix, the matrixes kth diagonal will be + * returned as vector. When k is positive, the values are placed on the + * super diagonal. When k is negative, the values are placed on the sub + * diagonal. + * @param k The diagonal where the vector will be filled in or + * retrieved. Default value: 0. + * @param format The matrix storage format. Default value: 'dense'. + */ + diag(this: MathJsChain, format?: string): MathJsChain + diag( + this: MathJsChain, + k: number | BigNumber, + format?: string + ): MathJsChain + + /** + * Calculate the dot product of two vectors. The dot product of A = [a1, + * a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as: dot(A, + * B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn + * @param y Second vector + */ + dot(this: MathJsChain, y: MathCollection): MathJsChain + + /** + * Compute the matrix exponential, expm(A) = e^A. The matrix must be + * square. Not to be confused with exp(a), which performs element-wise + * exponentiation. The exponential is calculated using the Padé + * approximant with scaling and squaring; see “Nineteen Dubious Ways to + * Compute the Exponential of a Matrix,” by Moler and Van Loan. + */ + + expm(this: MathJsChain): MathJsChain + + /** + * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal + * and T is upper quasi-triangular. + * https://en.wikipedia.org/wiki/Schur_decomposition + * @returns Object containing both matrix U and T of the Schur Decomposition A=UTU' + */ + schur(this: MathJsChain): SchurDecomposition + + /** + * Solves the Continuous-time Lyapunov equation AP+PA'=Q for P, where Q is a positive semidefinite + * matrix. + * https://en.wikipedia.org/wiki/Lyapunov_equation + * @param Q Matrix Q + * @returns Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q + */ + lyap( + this: MathJsChain, + Q: MathCollection + ): MathJsChain + + /** + * Create a 2-dimensional identity matrix with size m x n or n x n. The + * matrix has ones on the diagonal and zeros elsewhere. + * @param format The Matrix storage format + */ + identity( + this: MathJsChain, + format?: string + ): MathJsChain + + /** + * @param n The y dimension for the matrix + * @param format The Matrix storage format + */ + identity( + this: MathJsChain, + n: number, + format?: string + ): MathJsChain + + /** + * Filter the items in an array or one dimensional matrix. + */ + filter( + this: MathJsChain, + test: + | (( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + index: any, + matrix: MathCollection | string[] + ) => boolean) + | RegExp + ): MathJsChain + + /** + * Flatten a multi dimensional matrix into a single dimensional matrix. + */ + + flatten(x: MathJsChain): MathJsChain + + /** + * Iterate over all elements of a matrix/array, and executes the given + * callback function. + */ + forEach( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (value: any, index: any, matrix: T) => void + ): void + + /** + * Calculate the inverse of a square matrix. + */ + + inv( + this: MathJsChain + ): MathJsChain> + + /** + * Calculate the Kronecker product of two matrices or vectors + * @param y Second vector + */ + kron( + this: MathJsChain, + y: MathCollection + ): MathJsChain + + /** + * Iterate over all elements of a matrix/array, and executes the given + * callback function. + * @param callback The callback function is invoked with three + * parameters: the value of the element, the index of the element, and + * the Matrix/array being traversed. + */ + map( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: (value: any, index: any, matrix: T) => MathType | string + ): MathJsChain + + /** + * Create a matrix filled with ones. The created matrix can have one or + * multiple dimensions. + * @param format The matrix storage format + */ + ones( + this: MathJsChain, + format?: string + ): MathJsChain + + /** + * Partition-based selection of an array or 1D matrix. Will find the kth + * smallest value, and mutates the input array. Uses Quickselect. + * @param k The kth smallest value to be retrieved; zero-based index + * @param compare An optional comparator function. The function is + * called as compare(a, b), and must return 1 when a > b, -1 when a < b, + * and 0 when a == b. Default value: 'asc'. + */ + partitionSelect( + this: MathJsChain, + k: number, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compare?: 'asc' | 'desc' | ((a: any, b: any) => number) + ): MathJsChain + + /** + * Create an array from a range. By default, the range end is excluded. + * This can be customized by providing an extra parameter includeEnd. + * @param end End of the range, excluded by default, included when + * parameter includeEnd=true + * @param step Step size. Default value is 1. + * @param includeEnd: Option to specify whether to include the end or + * not. False by default + */ + range(this: MathJsChain, includeEnd?: boolean): MathJsChain + range( + this: MathJsChain, + end: number | BigNumber, + includeEnd?: boolean + ): MathJsChain + range( + this: MathJsChain, + end: number | BigNumber | Unit, + step: number | BigNumber | Unit, + includeEnd?: boolean + ): MathJsChain + + /** + * Reshape a multi dimensional array to fit the specified dimensions + * @param sizes One dimensional array with integral sizes for each + * dimension + */ + reshape( + this: MathJsChain, + sizes: number[] + ): MathJsChain + + /** + * Resize a matrix + * @param size One dimensional array with numbers + * @param defaultValue Zero by default, except in case of a string, in + * that case defaultValue = ' ' Default value: 0. + */ + resize( + this: MathJsChain, + size: MathCollection, + defaultValue?: number | string + ): MathJsChain + + /** + * Calculate the size of a matrix or scalar. + */ + size( + this: MathJsChain< + boolean | number | Complex | Unit | string | MathCollection + > + ): MathJsChain + + /** + * Sort the items in a matrix + * @param compare An optional _comparator function or name. The function + * is called as compare(a, b), and must return 1 when a > b, -1 when a < + * b, and 0 when a == b. Default value: ‘asc’ + */ + sort( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compare: ((a: any, b: any) => number) | 'asc' | 'desc' | 'natural' + ): MathJsChain + + /** + * Calculate the principal square root of a square matrix. The principal + * square root matrix X of another matrix A is such that X * X = A. + */ + + sqrtm(A: MathJsChain): MathJsChain + + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a + * matrix. + */ + + squeeze(x: MathJsChain): MathJsChain + + /** + * Get or set a subset of a matrix or string. + * @param index For each dimension, an index or list of indices to get or set + * @param replacement An array, matrix, or scalar. If provided, the + * subset is replaced with replacement. If not provided, the subset is + * returned + * @param defaultValue Default value, filled in on new entries when the + * matrix is resized. If not provided, math.matrix elements will be left + * undefined. Default value: undefined. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + subset( + this: MathJsChain, + index: Index, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacement?: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + defaultValue?: any + ): MathJsChain + + /** + * Calculate the trace of a matrix: the sum of the elements on the main + * diagonal of a square matrix. + */ + + trace(this: MathJsChain): MathJsChain + + /** + * Transpose a matrix. All values of the matrix are reflected over its + * main diagonal. Only two dimensional matrices are supported. + */ + + transpose(x: MathJsChain): MathJsChain + + /** + * Create a matrix filled with zeros. The created matrix can have one or + * multiple dimensions. + * @param format The matrix storage format + * @returns A matrix filled with zeros + */ + zeros( + this: MathJsChain, + format?: string + ): MathJsChain + + /************************************************************************* + * Probability functions + ************************************************************************/ + + /** + * Compute the number of ways of picking k unordered outcomes from n + * possibilities. Combinations only takes integer arguments. The + * following condition must be enforced: k <= n. + * @param k Number of objects in the subset + */ + combinations( + n: MathJsChain, + k: number | BigNumber + ): MathJsChain> + + /** + * Compute the factorial of a value Factorial only supports an integer + * value as argument. For matrices, the function is evaluated element + * wise. + */ + + factorial( + n: MathJsChain + ): MathJsChain> + + /** + * Compute the gamma function of a value using Lanczos approximation for + * small values, and an extended Stirling approximation for large + * values. For matrices, the function is evaluated element wise. + */ + + gamma( + n: MathJsChain + ): MathJsChain> + + /** + * Calculate the Kullback-Leibler (KL) divergence between two + * distributions + * @param p Second vector + */ + kldivergence( + this: MathJsChain, + p: MathCollection + ): MathJsChain + + /** + * Multinomial Coefficients compute the number of ways of picking a1, + * a2, ..., ai unordered outcomes from n possibilities. multinomial + * takes one array of integers as an argument. The following condition + * must be enforced: every ai <= 0 + */ + + multinomial( + a: MathJsChain + ): MathJsChain> + + /** + * Compute the number of ways of obtaining an ordered subset of k + * elements from a set of n elements. Permutations only takes integer + * arguments. The following condition must be enforced: k <= n. + * @param k The number of objects in the subset + */ + permutations( + n: MathJsChain, + k?: number | BigNumber + ): MathJsChain> + + /** + * Random pick a value from a one dimensional array. Array element is + * picked using a random function with uniform distribution. + * @param number An int or float + * @param weights An array of ints or floats + */ + pickRandom(this: MathJsChain): MathJsChain + pickRandom(this: MathJsChain, number: number): MathJsChain + pickRandom( + this: MathJsChain, + number: number, + weights: number[] + ): MathJsChain + + /** + * Return a random number larger or equal to min and smaller than max + * using a uniform distribution. + * @param min Minimum boundary for the random value, included + * @param max Maximum boundary for the random value, excluded + */ + random(this: MathJsChain, max?: number): MathJsChain + + // tslint:disable-next-line unified-signatures + random( + this: MathJsChain, + min?: number, + max?: number + ): MathJsChain + + /** + * Return a random integer number larger or equal to min and smaller + * than max using a uniform distribution. + * @param min Minimum boundary for the random value, included + * @param max Maximum boundary for the random value, excluded + */ + randomInt( + this: MathJsChain, + max?: number + ): MathJsChain + randomInt( + this: MathJsChain, + max?: number + ): MathJsChain + // tslint:disable-next-line unified-signatures + randomInt( + this: MathJsChain, + min: number, + max: number + ): MathJsChain + + /************************************************************************* + * Relational functions + ************************************************************************/ + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x + * == y. x and y are considered equal when the relative difference + * between x and y is smaller than the configured relTol and absTol. The function + * cannot be used to compare values smaller than approximately 2.22e-16. + * For matrices, the function is evaluated element wise. + * @param y Second value to compare + */ + compare( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Compare two values of any type in a deterministic, natural way. For + * numeric values, the function works the same as math.compare. For + * types of values that can’t be compared mathematically, the function + * compares in a natural way. + * @param y Second value to compare + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + compareNatural(this: MathJsChain, y: any): MathJsChain + + /** + * Compare two strings lexically. Comparison is case sensitive. Returns + * 1 when x > y, -1 when x < y, and 0 when x == y. For matrices, the + * function is evaluated element wise. + * @param y Second string to compare + */ + compareText( + this: MathJsChain, + y: string | MathCollection + ): MathJsChain + + /** + * Test element wise whether two matrices are equal. The function + * accepts both matrices and scalar values. + * @param y Second amtrix to compare + */ + deepEqual(this: MathJsChain, y: MathType): MathJsChain + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is + * smaller than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. For matrices, the + * function is evaluated element wise. In case of complex numbers, x.re + * must equal y.re, and x.im must equal y.im. Values null and undefined + * are compared strictly, thus null is only equal to null and nothing + * else, and undefined is only equal to undefined and nothing else. + * @param y Second value to compare + */ + equal( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Check equality of two strings. Comparison is case sensitive. For + * matrices, the function is evaluated element wise. + * @param y Second string to compare + */ + equalText( + this: MathJsChain, + y: string | MathCollection + ): MathJsChain + + /** + * Test whether value x is larger than y. The function returns true when + * x is larger than y and the relative difference between x and y is + * larger than the configured relTol and absTol. The function cannot be used to + * compare values smaller than approximately 2.22e-16. For matrices, the + * function is evaluated element wise. + * @param y Second value to compare + */ + larger( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Test whether value x is larger or equal to y. The function returns + * true when x is larger than y or the relative difference between x and + * y is smaller than the configured relTol and absTol. The function cannot be used + * to compare values smaller than approximately 2.22e-16. For matrices, + * the function is evaluated element wise. + * @param y Second value to vcompare + */ + largerEq( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Test whether value x is smaller than y. The function returns true + * when x is smaller than y and the relative difference between x and y + * is smaller than the configured relTol and absTol. The function cannot be used + * to compare values smaller than approximately 2.22e-16. For matrices, + * the function is evaluated element wise. + * @param y Second value to vcompare + */ + smaller( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Test whether value x is smaller or equal to y. The function returns + * true when x is smaller than y or the relative difference between x + * and y is smaller than the configured relTol and absTol. The function cannot be + * used to compare values smaller than approximately 2.22e-16. For + * matrices, the function is evaluated element wise. + * @param y Second value to compare + */ + smallerEq( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /** + * Determines if two expressions are symbolically equal, i.e. one is the + * result of valid algebraic manipulations on the other. + * @param {Node} expr2 The second expression to compare + * @param {Object} [options] Optional option object, passed to simplify + * @returns {boolean} Returns true if a valid manipulation making the + * expressions equal is found. + */ + symbolicEqual( + this: MathJsChain, + expr2: MathNode, + options?: SimplifyOptions + ): MathJsChain + + /** + * Test whether two values are unequal. The function tests whether the + * relative difference between x and y is larger than the configured + * relTol and absTol. The function cannot be used to compare values smaller than + * approximately 2.22e-16. For matrices, the function is evaluated + * element wise. In case of complex numbers, x.re must unequal y.re, or + * x.im must unequal y.im. Values null and undefined are compared + * strictly, thus null is unequal with everything except null, and + * undefined is unequal with everything except undefined. + * @param y Second value to vcompare + */ + unequal( + this: MathJsChain, + y: MathType | string + ): MathJsChain + + /************************************************************************* + * Set functions + ************************************************************************/ + + /** + * Create the cartesian product of two (multi)sets. Multi-dimension + * arrays will be converted to single-dimension arrays and the values + * will be sorted in ascending order before the operation. + * @param a2 A (multi)set + */ + setCartesian( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /** + * Create the difference of two (multi)sets: every element of set1, that + * is not the element of set2. Multi-dimension arrays will be converted + * to single-dimension arrays before the operation + * @param a2 A (multi)set + */ + setDifference( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /** + * Collect the distinct elements of a multiset. A multi-dimension array + * will be converted to a single-dimension array before the operation. + */ + + setDistinct(a: MathJsChain): MathJsChain + + /** + * Create the intersection of two (multi)sets. Multi-dimension arrays + * will be converted to single-dimension arrays before the operation. + * @param a2 A (multi)set + */ + setIntersect( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /** + * Check whether a (multi)set is a subset of another (multi)set. (Every + * element of set1 is the element of set2.) Multi-dimension arrays will + * be converted to single-dimension arrays before the operation. + * @param a2 A (multi)set + */ + setIsSubset( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /** + * Count the multiplicity of an element in a multiset. A multi-dimension + * array will be converted to a single-dimension array before the + * operation. + * @param a A multiset + */ + setMultiplicity( + e: MathJsChain, + a: MathCollection + ): MathJsChain + + /** + * Create the powerset of a (multi)set. (The powerset contains very + * possible subsets of a (multi)set.) A multi-dimension array will be + * converted to a single-dimension array before the operation. + */ + + setPowerset(a: MathJsChain): MathJsChain + + /** + * Count the number of elements of a (multi)set. When a second parameter + * is ‘true’, count only the unique values. A multi-dimension array will + * be converted to a single-dimension array before the operation. + */ + + setSize(this: MathJsChain): MathJsChain + + /** + * Create the symmetric difference of two (multi)sets. Multi-dimension + * arrays will be converted to single-dimension arrays before the + * operation. + * @param a2 A (multi)set + */ + setSymDifference( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /** + * Create the union of two (multi)sets. Multi-dimension arrays will be + * converted to single-dimension arrays before the operation. + * @param a2 A (multi)set + */ + setUnion( + this: MathJsChain, + a2: MathCollection + ): MathJsChain + + /************************************************************************* + * Signal functions + ************************************************************************/ + /** + * Compute the transfer function of a zero-pole-gain model. + */ + zpk2tf( + this: MathJsChain, // chained variable will be used as z + p: T, + k?: number + ): MathJsChain + + /** + * Calculates the frequency response of a filter given its numerator and denominator coefficients. + */ + freqz( + this: MathJsChain, + a: T, + w?: T | number + ): MathJsChain<{ w: T; h: T }> + + /************************************************************************* + * Special functions + ************************************************************************/ + + /** + * Compute the erf function of a value using a rational Chebyshev + * approximations for different intervals of x. + */ + erf( + this: MathJsChain + ): MathJsChain> + + /** + * Compute the Riemann Zeta function of a value using an infinite series + * and Riemann's Functional equation. + */ + zeta( + this: MathJsChain + ): MathJsChain + + /************************************************************************* + * Statistics functions + ************************************************************************/ + + /** + * Compute the median absolute deviation of a matrix or a list with + * values. The median absolute deviation is defined as the median of the + * absolute deviations from the median. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mad(this: MathJsChain): MathJsChain + + /** + * Compute the maximum value of a matrix or a list with values. In case + * of a multi dimensional array, the maximum of the flattened array will + * be calculated. When dim is provided, the maximum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param dim The maximum over the selected dimension + */ + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + max(this: MathJsChain, dim?: number): MathJsChain + // eslint-disable-next-line @typescript-eslint/no-explicit-any + max(this: MathJsChain, dim?: number): MathJsChain + + /** + * Compute the mean value of matrix or a list with values. In case of a + * multi dimensional array, the mean of the flattened array will be + * calculated. When dim is provided, the maximum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param dim The mean over the selected dimension + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mean(this: MathJsChain, dim?: number): MathJsChain + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mean(this: MathJsChain, dim?: number): MathJsChain + + /** + * Compute the median of a matrix or a list with values. The values are + * sorted and the middle value is returned. In case of an even number of + * values, the average of the two middle values is returned. Supported + * types of values are: Number, BigNumber, Unit In case of a (multi + * dimensional) array or matrix, the median of all elements will be + * calculated. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + median(this: MathJsChain, dim?: number): MathJsChain + // eslint-disable-next-line @typescript-eslint/no-explicit-any + median(this: MathJsChain, dim?: number): MathJsChain + + /** + * Compute the minimum value of a matrix or a list of values. In case of + * a multi dimensional array, the minimum of the flattened array will be + * calculated. When dim is provided, the minimum over the selected + * dimension will be calculated. Parameter dim is zero-based. + * @param dim The minimum over the selected dimension + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + min(this: MathJsChain): MathJsChain + // eslint-disable-next-line @typescript-eslint/no-explicit-any + min(this: MathJsChain, dim?: number): MathJsChain + + /** + * Computes the mode of a set of numbers or a list with values(numbers + * or characters). If there are more than one modes, it returns a list + * of those values. + */ + + mode(this: MathJsChain): MathJsChain + + /** + * Compute the product of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the sum of all elements will be + * calculated. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + prod(this: MathJsChain): MathJsChain + + /** + * Compute the prob order quantile of a matrix or a list with values. + * The sequence is sorted and the middle value is returned. Supported + * types of sequence values are: Number, BigNumber, Unit Supported types + * of probability are: Number, BigNumber In case of a (multi + * dimensional) array or matrix, the prob order quantile of all elements + * will be calculated. + * @param probOrN prob is the order of the quantile, while N is the + * amount of evenly distributed steps of probabilities; only one of + * these options can be provided + * @param sorted =false is data sorted in ascending order + */ + quantileSeq( + A: MathJsChain, + prob: number | BigNumber | MathArray, + sorted?: boolean + ): MathJsChain + + /** + * Compute the standard deviation of a matrix or a list with values. The + * standard deviations is defined as the square root of the variance: + * std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or + * matrix, the standard deviation over all elements will be calculated. + * Optionally, the type of normalization can be specified as second + * parameter. The parameter normalization can be one of the following + * values: 'unbiased' (default) The sum of squared errors is divided by + * (n - 1) 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * @param dim A dimension to compute standard deviation. + * @param normalization Determines how to normalize the variance. Choose + * ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: + * ‘unbiased’. + * @returns The standard deviation + */ + std( + this: MathJsChain, + dim?: number, + normalization?: 'unbiased' | 'uncorrected' | 'biased' + ): MathJsChain + + /** + * Compute the standard deviation of a matrix or a list with values. The + * standard deviations is defined as the square root of the variance: + * std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or + * matrix, the standard deviation over all elements will be calculated. + * Optionally, the type of normalization can be specified as second + * parameter. The parameter normalization can be one of the following + * values: 'unbiased' (default) The sum of squared errors is divided by + * (n - 1) 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * @param normalization Determines how to normalize the variance. Choose + * ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: + * ‘unbiased’. + * @returns The standard deviation + */ + std( + this: MathJsChain, + dimension?: number, + normalization?: 'unbiased' | 'uncorrected' | 'biased' + ): MathJsChain + + /** + * Compute the sum of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the sum of all elements will be + * calculated. + */ + std( + this: MathJsChain, + normalization: 'unbiased' | 'uncorrected' | 'biased' + ): MathJsChain + + /** + * Compute the variance of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the variance over all elements + * will be calculated. Optionally, the type of normalization can be + * specified as second parameter. The parameter normalization can be one + * of the following values: 'unbiased' (default) The sum of squared + * errors is divided by (n - 1) 'uncorrected' The sum of squared errors + * is divided by n 'biased' The sum of squared errors is divided by (n + + * 1) Note that older browser may not like the variable name var. In + * that case, the function can be called as math['var'](...) instead of + * math.variance(...). + * @param dim a dimension to compute variance. + * @param normalization normalization Determines how to normalize the + * variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. + * Default value: ‘unbiased’. + * @returns The variance + */ + variance( + this: MathJsChain>> + ): MathJsChain + + /** + * Compute the variance of a matrix or a list with values. In case of a + * (multi dimensional) array or matrix, the variance over all elements + * will be calculated. Optionally, the type of normalization can be + * specified as second parameter. The parameter normalization can be one + * of the following values: 'unbiased' (default) The sum of squared + * errors is divided by (n - 1) 'uncorrected' The sum of squared errors + * is divided by n 'biased' The sum of squared errors is divided by (n + + * 1) Note that older browser may not like the variable name var. In + * that case, the function can be called as math['var'](...) instead of + * math.variance(...). + * @param normalization normalization Determines how to normalize the + * variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. + * Default value: ‘unbiased’. + * @returns The variance + */ + variance( + this: MathJsChain, + dimension?: number, + normalization?: 'unbiased' | 'uncorrected' | 'biased' + ): MathJsChain + + variance( + this: MathJsChain, + normalization: 'unbiased' | 'uncorrected' | 'biased' + ): MathJsChain + + /************************************************************************* + * String functions + ************************************************************************/ + + /** + * Format a value of any type into a string. + * @param options An object with formatting options. + * @param callback A custom formatting function, invoked for all numeric + * elements in value, for example all elements of a matrix, or the real + * and imaginary parts of a complex number. This callback can be used to + * override the built-in numeric notation with any type of formatting. + * Function callback is called with value as parameter and must return a + * string. + * @see http://mathjs.org/docs/reference/functions/format.html + */ + format( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options?: FormatOptions | number | ((item: any) => string), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback?: (value: any) => string + ): MathJsChain + + /** + * Interpolate values into a string template. + * @param values An object containing variables which will be filled in + * in the template. + * @param precision Number of digits to format numbers. If not provided, + * the value will not be rounded. + * @param options Formatting options, or the number of digits to format + * numbers. See function math.format for a description of all options. + */ + print( + this: MathJsChain, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + values: any, + precision?: number, + options?: number | object + ): MathJsChain + + /************************************************************************* + * Trigonometry functions + ************************************************************************/ + + /** + * Calculate the inverse cosine of a value. For matrices, the function + * is evaluated element wise. + */ + + acos( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic arccos of a value, defined as acosh(x) = + * ln(sqrt(x^2 - 1) + x). For matrices, the function is evaluated + * element wise. + */ + + acosh( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse cotangent of a value. For matrices, the + * function is evaluated element wise. + */ + + acot( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse hyperbolic tangent of a value, defined as acoth(x) + * = (ln((x+1)/x) + ln(x/(x-1))) / 2. For matrices, the function is + * evaluated element wise. + */ + + acoth( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse cosecant of a value. For matrices, the function + * is evaluated element wise. + */ + + acsc( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse hyperbolic cosecant of a value, defined as acsch(x) + * = ln(1/x + sqrt(1/x^2 + 1)). For matrices, the function is evaluated + * element wise. + */ + + acsch( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse secant of a value. For matrices, the function + * is evaluated element wise. + */ + + asec( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = + * ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated + * element wise. + */ + + asech( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse sine of a value. For matrices, the function is + * evaluated element wise. + */ + + asin( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = + * ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated + * element wise. + */ + + asinh( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse tangent of a value. For matrices, the function + * is evaluated element wise. + */ + + atan( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the inverse tangent function with two arguments, y/x. By + * providing two arguments, the right quadrant of the computed angle can + * be determined. For matrices, the function is evaluated element wise. + */ + + atan2( + this: MathJsChain, + x: number + ): MathJsChain + + /** + * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = + * ln((1 + x)/(1 - x)) / 2. For matrices, the function is evaluated + * element wise. + */ + + atanh( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the cosine of a value. For matrices, the function is + * evaluated element wise. + */ + + cos( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 + * * (exp(x) + exp(-x)). For matrices, the function is evaluated element + * wise. + */ + + cosh( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). + * For matrices, the function is evaluated element wise. + */ + + cot( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 + * / tanh(x). For matrices, the function is evaluated element wise. + */ + + coth( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For + * matrices, the function is evaluated element wise. + */ + + csc( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 + * / sinh(x). For matrices, the function is evaluated element wise. + */ + + csch( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For + * matrices, the function is evaluated element wise. + */ + + sec( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / + * cosh(x). For matrices, the function is evaluated element wise. + */ + + sech( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the sine of a value. For matrices, the function is + * evaluated element wise. + */ + + sin( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * + * (exp(x) - exp(-x)). For matrices, the function is evaluated element + * wise. + */ + + sinh( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). + * For matrices, the function is evaluated element wise. + */ + + tan( + this: MathJsChain + ): MathJsChain + + /** + * Calculate the hyperbolic tangent of a value, defined as tanh(x) = + * (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is + * evaluated element wise. + */ + + tanh( + this: MathJsChain + ): MathJsChain + + /************************************************************************* + * Unit functions + ************************************************************************/ + + /** + * Change the unit of a value. For matrices, the function is evaluated + * element wise. + * @param unit New unit. Can be a string like "cm" or a unit without + * value. + */ + to( + this: MathJsChain, + unit: Unit | string + ): MathJsChain + + /************************************************************************* + * Utils functions + ************************************************************************/ + + /** + * Clone an object. + */ + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + clone(this: MathJsChain): MathJsChain + + /** + * Test whether a value is an integer number. The function supports + * number, BigNumber, and Fraction. The function is evaluated + * element-wise in case of Array or Matrix input. + */ + + isInteger( + this: MathJsChain + ): MathJsChain + + /** + * Test whether a value is NaN (not a number). The function supports + * types number, BigNumber, Fraction, Unit and Complex. The function is + * evaluated element-wise in case of Array or Matrix input. + */ + + isNaN( + this: MathJsChain + ): MathJsChain + + /** + * Test whether a value is negative: smaller than zero. The function + * supports types number, BigNumber, Fraction, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + */ + + isNegative( + this: MathJsChain + ): MathJsChain + + /** + * Test whether a value is a numeric value. The function is evaluated + * element-wise in case of Array or Matrix input. + */ + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + isNumeric(this: MathJsChain): MathJsChain + + /** + * Test whether a value is positive: larger than zero. The function + * supports types number, BigNumber, Fraction, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + */ + + isPositive( + this: MathJsChain< + number | BigNumber | bigint | Fraction | MathCollection | Unit + > + ): MathJsChain + + /** + * Test whether a value is prime: has no divisors other than itself and + * one. The function supports type number, bignumber. The function is + * evaluated element-wise in case of Array or Matrix input. + */ + + isPrime( + this: MathJsChain + ): MathJsChain + + /** + * Test whether a value is zero. The function can check for zero for + * types number, BigNumber, Fraction, Complex, and Unit. The function is + * evaluated element-wise in case of Array or Matrix input. + */ + + isZero(this: MathJsChain): MathJsChain + + /** + * Determine the type of a variable. + */ + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + typeOf(this: MathJsChain): MathJsChain +} + +export interface ImportOptions { + override?: boolean + silent?: boolean + wrap?: boolean +} + +export interface ImportObject { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any +} + +export const { + // config // Don't export config: no config available in the static instance + + // core functions + create, + factory, + typed, + + // constants + e, + pi, + i, + // Infinity // not needed: is available as global variable too + LN2, + LN10, + LOG2E, + LOG10E, + // NaN, // not needed: is available as global variable too + phi, + SQRT1_2, + SQRT2, + tau, + + // Class-like constructors + Node, + AccessorNode, + ArrayNode, + AssignmentNode, + BlockNode, + ConditionalNode, + ConstantNode, + FunctionAssignmentNode, + FunctionNode, + IndexNode, + ObjectNode, + OperatorNode, + ParenthesisNode, + RangeNode, + RelationalNode, + SymbolNode, + Matrix, + Unit, + + uninitialized, + version, + expression, + reviver, + replacer, + + bignumber, + boolean, + chain, + complex, + createUnit, + fraction, + index, + matrix, + number, + sparse, + splitUnit, + string, + unit, + compile, + evaluate, + help, + parse, + parser, + + // algebra + derivative, + lsolve, + lup, + lusolve, + polynomialRoot, + qr, + rationalize, + simplify, + simplifyConstant, + simplifyCore, + symbolicEqual, + leafCount, + resolve, + slu, + usolve, + + // arithmetic functions + abs, + add, + cbrt, + ceil, + fix, + floor, + round, + cube, + divide, + dotDivide, + dotMultiply, + dotPow, + exp, + expm1, + gcd, + hypot, + lcm, + log, + log10, + log1p, + log2, + mod, + multiply, + norm, + nthRoot, + pow, + sign, + sqrt, + square, + subtract, + unaryMinus, + unaryPlus, + xgcd, + + // bitwise + bitAnd, + bitNot, + bitOr, + bitXor, + leftShift, + rightArithShift, + rightLogShift, + + // combinatorics + bellNumbers, + catalan, + composition, + stirlingS2, + + // complex + arg, + conj, + im, + re, + + // geometry + distance, + intersect, + + // logical + and, + not, + or, + xor, + + // matrix functions + apply, + concat, + cross, + det, + diag, + dot, + eigs, + expm, + sylvester, + schur, + lyap, + identity, + filter, + flatten, + forEach, + inv, + kron, + map, + ones, + partitionSelect, + pinv, + range, + reshape, + resize, + rotationMatrix, + row, + column, + rotate, + size, + sort, + sqrtm, + squeeze, + subset, + trace, + transpose, + zeros, + fft, + ifft, + + // probability + combinations, + factorial, + gamma, + kldivergence, + lgamma, + multinomial, + permutations, + pickRandom, + random, + randomInt, + + // relational functions + compare, + compareNatural, + compareText, + deepEqual, + equal, + equalText, + larger, + largerEq, + smaller, + smallerEq, + unequal, + + // set functions + setCartesian, + setDifference, + setDistinct, + setIntersect, + setIsSubset, + setMultiplicity, + setPowerset, + setSize, + setSymDifference, + setUnion, + + // special functions + zpk2tf, + freqz, + erf, + zeta, + + // Statistics functions + mad, + max, + mean, + median, + min, + mode, + prod, + quantileSeq, + std, + sum, + count, + cumsum, + variance, + corr, + + // String functions + format, + print, + + // Trigonometry functions + acos, + acosh, + acot, + acoth, + acsc, + acsch, + asec, + asech, + asin, + asinh, + atan, + atan2, + atanh, + cos, + cosh, + cot, + coth, + csc, + csch, + sec, + sech, + sin, + sinh, + tan, + tanh, + + // unit functions + to, + + // util functions + isNumber, + isBigNumber, + isComplex, + isFraction, + isUnit, + isString, + isArray, + isMatrix, + isCollection, + isDenseMatrix, + isSparseMatrix, + isRange, + isIndex, + isBoolean, + isResultSet, + isHelp, + isFunction, + isDate, + isRegExp, + isObject, + isNull, + isUndefined, + isAccessorNode, + isArrayNode, + isAssignmentNode, + isBlockNode, + isConditionalNode, + isConstantNode, + isFunctionAssignmentNode, + isFunctionNode, + isIndexNode, + isNode, + isObjectNode, + isOperatorNode, + isParenthesisNode, + isRangeNode, + isRelationalNode, + isSymbolNode, + isChain, + clone, + hasNumericValue, + isInteger, + isNaN, + isNegative, + isNumeric, + isPositive, + isPrime, + isZero, + typeOf +}: MathJsInstance diff --git a/24_10_22_faktorialis/node_modules/mathjs/types/tslint.json b/24_10_22_faktorialis/node_modules/mathjs/types/tslint.json new file mode 100644 index 0000000..422bfa8 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/mathjs/types/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "no-redundant-jsdoc": false + } +} diff --git a/24_10_22_faktorialis/node_modules/regenerator-runtime/LICENSE b/24_10_22_faktorialis/node_modules/regenerator-runtime/LICENSE new file mode 100644 index 0000000..cde61b6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/regenerator-runtime/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2014-present, Facebook, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/regenerator-runtime/README.md b/24_10_22_faktorialis/node_modules/regenerator-runtime/README.md new file mode 100644 index 0000000..e8702ba --- /dev/null +++ b/24_10_22_faktorialis/node_modules/regenerator-runtime/README.md @@ -0,0 +1,31 @@ +# regenerator-runtime + +Standalone runtime for +[Regenerator](https://github.com/facebook/regenerator)-compiled generator +and `async` functions. + +To import the runtime as a module (recommended), either of the following +import styles will work: +```js +// CommonJS +const regeneratorRuntime = require("regenerator-runtime"); + +// ECMAScript 2015 +import regeneratorRuntime from "regenerator-runtime"; +``` + +To ensure that `regeneratorRuntime` is defined globally, either of the +following styles will work: +```js +// CommonJS +require("regenerator-runtime/runtime"); + +// ECMAScript 2015 +import "regenerator-runtime/runtime.js"; +``` + +To get the absolute file system path of `runtime.js`, evaluate the +following expression: +```js +require("regenerator-runtime/path").path +``` diff --git a/24_10_22_faktorialis/node_modules/regenerator-runtime/package.json b/24_10_22_faktorialis/node_modules/regenerator-runtime/package.json new file mode 100644 index 0000000..503086f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/regenerator-runtime/package.json @@ -0,0 +1,19 @@ +{ + "name": "regenerator-runtime", + "author": "Ben Newman ", + "description": "Runtime for Regenerator-compiled generator and async functions.", + "version": "0.14.1", + "main": "runtime.js", + "keywords": [ + "regenerator", + "runtime", + "generator", + "async" + ], + "sideEffects": true, + "repository": { + "type": "git", + "url": "https://github.com/facebook/regenerator/tree/main/packages/runtime" + }, + "license": "MIT" +} diff --git a/24_10_22_faktorialis/node_modules/regenerator-runtime/path.js b/24_10_22_faktorialis/node_modules/regenerator-runtime/path.js new file mode 100644 index 0000000..ced878b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/regenerator-runtime/path.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +exports.path = require("path").join( + __dirname, + "runtime.js" +); diff --git a/24_10_22_faktorialis/node_modules/regenerator-runtime/runtime.js b/24_10_22_faktorialis/node_modules/regenerator-runtime/runtime.js new file mode 100644 index 0000000..5593ca5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/regenerator-runtime/runtime.js @@ -0,0 +1,761 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var runtime = (function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + try { + // IE 8 has a broken Object.defineProperty that only works on DOM objects. + define({}, ""); + } catch (err) { + define = function(obj, key, value) { + return obj[key] = value; + }; + } + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); + + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function () { + return this; + }); + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = GeneratorFunctionPrototype; + defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); + defineProperty( + GeneratorFunctionPrototype, + "constructor", + { value: GeneratorFunction, configurable: true } + ); + GeneratorFunction.displayName = define( + GeneratorFunctionPrototype, + toStringTagSymbol, + "GeneratorFunction" + ); + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + define(prototype, method, function(arg) { + return this._invoke(method, arg); + }); + }); + } + + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return PromiseImpl.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + defineProperty(this, "_invoke", { value: enqueue }); + } + + defineIteratorMethods(AsyncIterator.prototype); + define(AsyncIterator.prototype, asyncIteratorSymbol, function () { + return this; + }); + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList), + PromiseImpl + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per GeneratorResume behavior specified since ES2015: + // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume + // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var methodName = context.method; + var method = delegate.iterator[methodName]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method, or a missing .next method, always terminate the + // yield* loop. + context.delegate = null; + + // Note: ["return"] must be used for ES3 parsing compatibility. + if (methodName === "throw" && delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + if (methodName !== "return") { + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a '" + methodName + "' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + define(Gp, iteratorSymbol, function() { + return this; + }); + + define(Gp, "toString", function() { + return "[object Generator]"; + }); + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(val) { + var object = Object(val); + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable != null) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + throw new TypeError(typeof iterable + " is not iterable"); + } + exports.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {} +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, in modern engines + // we can explicitly access globalThis. In older engines we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.coveralls.yml b/24_10_22_faktorialis/node_modules/seedrandom/.coveralls.yml new file mode 100644 index 0000000..9160059 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis-ci diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.nvmrc b/24_10_22_faktorialis/node_modules/seedrandom/.nvmrc new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.nvmrc @@ -0,0 +1 @@ +6 diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json new file mode 100644 index 0000000..63d7513 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json @@ -0,0 +1 @@ +{"/home/davidbau/git/seedrandom/seedrandom.js":{"path":"/home/davidbau/git/seedrandom/seedrandom.js","statementMap":{"0":{"start":{"line":25,"column":0},"end":{"line":253,"column":2}},"1":{"start":{"line":30,"column":12},"end":{"line":30,"column":15}},"2":{"start":{"line":31,"column":13},"end":{"line":31,"column":14}},"3":{"start":{"line":32,"column":13},"end":{"line":32,"column":15}},"4":{"start":{"line":33,"column":14},"end":{"line":33,"column":22}},"5":{"start":{"line":34,"column":17},"end":{"line":34,"column":40}},"6":{"start":{"line":35,"column":19},"end":{"line":35,"column":38}},"7":{"start":{"line":36,"column":15},"end":{"line":36,"column":31}},"8":{"start":{"line":37,"column":11},"end":{"line":37,"column":20}},"9":{"start":{"line":45,"column":12},"end":{"line":45,"column":14}},"10":{"start":{"line":46,"column":2},"end":{"line":46,"column":68}},"11":{"start":{"line":49,"column":18},"end":{"line":51,"column":48}},"12":{"start":{"line":54,"column":13},"end":{"line":54,"column":26}},"13":{"start":{"line":58,"column":13},"end":{"line":73,"column":3}},"14":{"start":{"line":59,"column":12},"end":{"line":59,"column":26}},"15":{"start":{"line":60,"column":12},"end":{"line":60,"column":22}},"16":{"start":{"line":61,"column":12},"end":{"line":61,"column":13}},"17":{"start":{"line":62,"column":4},"end":{"line":66,"column":5}},"18":{"start":{"line":63,"column":6},"end":{"line":63,"column":26}},"19":{"start":{"line":64,"column":6},"end":{"line":64,"column":17}},"20":{"start":{"line":65,"column":6},"end":{"line":65,"column":20}},"21":{"start":{"line":67,"column":4},"end":{"line":71,"column":5}},"22":{"start":{"line":68,"column":6},"end":{"line":68,"column":13}},"23":{"start":{"line":69,"column":6},"end":{"line":69,"column":13}},"24":{"start":{"line":70,"column":6},"end":{"line":70,"column":15}},"25":{"start":{"line":72,"column":4},"end":{"line":72,"column":23}},"26":{"start":{"line":75,"column":2},"end":{"line":75,"column":51}},"27":{"start":{"line":75,"column":28},"end":{"line":75,"column":49}},"28":{"start":{"line":76,"column":2},"end":{"line":76,"column":61}},"29":{"start":{"line":76,"column":28},"end":{"line":76,"column":59}},"30":{"start":{"line":77,"column":2},"end":{"line":77,"column":21}},"31":{"start":{"line":80,"column":2},"end":{"line":80,"column":33}},"32":{"start":{"line":83,"column":2},"end":{"line":103,"column":17}},"33":{"start":{"line":85,"column":8},"end":{"line":90,"column":9}},"34":{"start":{"line":87,"column":10},"end":{"line":87,"column":45}},"35":{"start":{"line":87,"column":25},"end":{"line":87,"column":43}},"36":{"start":{"line":89,"column":10},"end":{"line":89,"column":60}},"37":{"start":{"line":89,"column":36},"end":{"line":89,"column":58}},"38":{"start":{"line":94,"column":8},"end":{"line":98,"column":25}},"39":{"start":{"line":94,"column":28},"end":{"line":94,"column":49}},"40":{"start":{"line":94,"column":50},"end":{"line":94,"column":62}},"41":{"start":{"line":98,"column":13},"end":{"line":98,"column":25}},"42":{"start":{"line":117,"column":18},"end":{"line":117,"column":28}},"43":{"start":{"line":118,"column":11},"end":{"line":118,"column":15}},"44":{"start":{"line":118,"column":21},"end":{"line":118,"column":22}},"45":{"start":{"line":118,"column":28},"end":{"line":118,"column":43}},"46":{"start":{"line":118,"column":49},"end":{"line":118,"column":58}},"47":{"start":{"line":121,"column":2},"end":{"line":121,"column":36}},"48":{"start":{"line":121,"column":17},"end":{"line":121,"column":34}},"49":{"start":{"line":124,"column":2},"end":{"line":126,"column":3}},"50":{"start":{"line":125,"column":4},"end":{"line":125,"column":15}},"51":{"start":{"line":127,"column":2},"end":{"line":130,"column":3}},"52":{"start":{"line":128,"column":4},"end":{"line":128,"column":60}},"53":{"start":{"line":129,"column":4},"end":{"line":129,"column":13}},"54":{"start":{"line":133,"column":2},"end":{"line":146,"column":12}},"55":{"start":{"line":135,"column":15},"end":{"line":135,"column":16}},"56":{"start":{"line":136,"column":12},"end":{"line":136,"column":16}},"57":{"start":{"line":136,"column":22},"end":{"line":136,"column":26}},"58":{"start":{"line":136,"column":32},"end":{"line":136,"column":36}},"59":{"start":{"line":137,"column":4},"end":{"line":140,"column":5}},"60":{"start":{"line":138,"column":6},"end":{"line":138,"column":32}},"61":{"start":{"line":139,"column":6},"end":{"line":139,"column":78}},"62":{"start":{"line":141,"column":4},"end":{"line":141,"column":13}},"63":{"start":{"line":141,"column":14},"end":{"line":141,"column":23}},"64":{"start":{"line":142,"column":4},"end":{"line":142,"column":13}},"65":{"start":{"line":154,"column":2},"end":{"line":154,"column":12}},"66":{"start":{"line":155,"column":2},"end":{"line":155,"column":12}},"67":{"start":{"line":156,"column":2},"end":{"line":156,"column":20}},"68":{"start":{"line":157,"column":2},"end":{"line":157,"column":11}},"69":{"start":{"line":165,"column":15},"end":{"line":165,"column":17}},"70":{"start":{"line":165,"column":26},"end":{"line":165,"column":36}},"71":{"start":{"line":166,"column":2},"end":{"line":170,"column":3}},"72":{"start":{"line":167,"column":4},"end":{"line":169,"column":5}},"73":{"start":{"line":168,"column":6},"end":{"line":168,"column":70}},"74":{"start":{"line":168,"column":12},"end":{"line":168,"column":55}},"75":{"start":{"line":171,"column":2},"end":{"line":171,"column":71}},"76":{"start":{"line":180,"column":19},"end":{"line":180,"column":28}},"77":{"start":{"line":180,"column":41},"end":{"line":180,"column":42}},"78":{"start":{"line":181,"column":2},"end":{"line":184,"column":3}},"79":{"start":{"line":182,"column":4},"end":{"line":183,"column":74}},"80":{"start":{"line":185,"column":2},"end":{"line":185,"column":23}},"81":{"start":{"line":194,"column":2},"end":{"line":208,"column":3}},"82":{"start":{"line":196,"column":4},"end":{"line":202,"column":5}},"83":{"start":{"line":198,"column":6},"end":{"line":198,"column":23}},"84":{"start":{"line":200,"column":6},"end":{"line":200,"column":34}},"85":{"start":{"line":201,"column":6},"end":{"line":201,"column":62}},"86":{"start":{"line":203,"column":4},"end":{"line":203,"column":25}},"87":{"start":{"line":205,"column":18},"end":{"line":205,"column":34}},"88":{"start":{"line":206,"column":18},"end":{"line":206,"column":44}},"89":{"start":{"line":207,"column":4},"end":{"line":207,"column":71}},"90":{"start":{"line":216,"column":2},"end":{"line":216,"column":41}},"91":{"start":{"line":226,"column":0},"end":{"line":226,"column":28}},"92":{"start":{"line":232,"column":0},"end":{"line":243,"column":1}},"93":{"start":{"line":233,"column":2},"end":{"line":233,"column":30}},"94":{"start":{"line":235,"column":2},"end":{"line":237,"column":17}},"95":{"start":{"line":236,"column":4},"end":{"line":236,"column":35}},"96":{"start":{"line":238,"column":7},"end":{"line":243,"column":1}},"97":{"start":{"line":239,"column":2},"end":{"line":239,"column":44}},"98":{"start":{"line":239,"column":22},"end":{"line":239,"column":40}},"99":{"start":{"line":242,"column":2},"end":{"line":242,"column":38}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":25,"column":1},"end":{"line":25,"column":2}},"loc":{"start":{"line":25,"column":31},"end":{"line":247,"column":1}},"line":25},"1":{"name":"seedrandom","decl":{"start":{"line":44,"column":9},"end":{"line":44,"column":19}},"loc":{"start":{"line":44,"column":45},"end":{"line":104,"column":1}},"line":44},"2":{"name":"(anonymous_2)","decl":{"start":{"line":58,"column":13},"end":{"line":58,"column":14}},"loc":{"start":{"line":58,"column":24},"end":{"line":73,"column":3}},"line":58},"3":{"name":"(anonymous_3)","decl":{"start":{"line":75,"column":15},"end":{"line":75,"column":16}},"loc":{"start":{"line":75,"column":26},"end":{"line":75,"column":51}},"line":75},"4":{"name":"(anonymous_4)","decl":{"start":{"line":76,"column":15},"end":{"line":76,"column":16}},"loc":{"start":{"line":76,"column":26},"end":{"line":76,"column":61}},"line":76},"5":{"name":"(anonymous_5)","decl":{"start":{"line":84,"column":6},"end":{"line":84,"column":7}},"loc":{"start":{"line":84,"column":48},"end":{"line":99,"column":7}},"line":84},"6":{"name":"(anonymous_6)","decl":{"start":{"line":89,"column":23},"end":{"line":89,"column":24}},"loc":{"start":{"line":89,"column":34},"end":{"line":89,"column":60}},"line":89},"7":{"name":"ARC4","decl":{"start":{"line":116,"column":9},"end":{"line":116,"column":13}},"loc":{"start":{"line":116,"column":19},"end":{"line":147,"column":1}},"line":116},"8":{"name":"(anonymous_8)","decl":{"start":{"line":133,"column":10},"end":{"line":133,"column":11}},"loc":{"start":{"line":133,"column":26},"end":{"line":146,"column":3}},"line":133},"9":{"name":"copy","decl":{"start":{"line":153,"column":9},"end":{"line":153,"column":13}},"loc":{"start":{"line":153,"column":20},"end":{"line":158,"column":1}},"line":153},"10":{"name":"flatten","decl":{"start":{"line":164,"column":9},"end":{"line":164,"column":16}},"loc":{"start":{"line":164,"column":29},"end":{"line":172,"column":1}},"line":164},"11":{"name":"mixkey","decl":{"start":{"line":179,"column":9},"end":{"line":179,"column":15}},"loc":{"start":{"line":179,"column":27},"end":{"line":186,"column":1}},"line":179},"12":{"name":"autoseed","decl":{"start":{"line":193,"column":9},"end":{"line":193,"column":17}},"loc":{"start":{"line":193,"column":20},"end":{"line":209,"column":1}},"line":193},"13":{"name":"tostring","decl":{"start":{"line":215,"column":9},"end":{"line":215,"column":17}},"loc":{"start":{"line":215,"column":21},"end":{"line":217,"column":1}},"line":215},"14":{"name":"(anonymous_14)","decl":{"start":{"line":239,"column":9},"end":{"line":239,"column":10}},"loc":{"start":{"line":239,"column":20},"end":{"line":239,"column":42}},"line":239}},"branchMap":{"0":{"loc":{"start":{"line":46,"column":12},"end":{"line":46,"column":67}},"type":"cond-expr","locations":[{"start":{"line":46,"column":32},"end":{"line":46,"column":49}},{"start":{"line":46,"column":53},"end":{"line":46,"column":66}}],"line":46},"1":{"loc":{"start":{"line":46,"column":53},"end":{"line":46,"column":66}},"type":"binary-expr","locations":[{"start":{"line":46,"column":53},"end":{"line":46,"column":60}},{"start":{"line":46,"column":64},"end":{"line":46,"column":66}}],"line":46},"2":{"loc":{"start":{"line":50,"column":4},"end":{"line":51,"column":38}},"type":"cond-expr","locations":[{"start":{"line":50,"column":22},"end":{"line":50,"column":44}},{"start":{"line":51,"column":4},"end":{"line":51,"column":38}}],"line":50},"3":{"loc":{"start":{"line":51,"column":4},"end":{"line":51,"column":38}},"type":"cond-expr","locations":[{"start":{"line":51,"column":21},"end":{"line":51,"column":31}},{"start":{"line":51,"column":34},"end":{"line":51,"column":38}}],"line":51},"4":{"loc":{"start":{"line":83,"column":10},"end":{"line":99,"column":7}},"type":"binary-expr","locations":[{"start":{"line":83,"column":10},"end":{"line":83,"column":22}},{"start":{"line":83,"column":26},"end":{"line":83,"column":34}},{"start":{"line":84,"column":6},"end":{"line":99,"column":7}}],"line":83},"5":{"loc":{"start":{"line":85,"column":8},"end":{"line":90,"column":9}},"type":"if","locations":[{"start":{"line":85,"column":8},"end":{"line":90,"column":9}},{"start":{"line":85,"column":8},"end":{"line":90,"column":9}}],"line":85},"6":{"loc":{"start":{"line":87,"column":10},"end":{"line":87,"column":45}},"type":"if","locations":[{"start":{"line":87,"column":10},"end":{"line":87,"column":45}},{"start":{"line":87,"column":10},"end":{"line":87,"column":45}}],"line":87},"7":{"loc":{"start":{"line":94,"column":8},"end":{"line":98,"column":25}},"type":"if","locations":[{"start":{"line":94,"column":8},"end":{"line":98,"column":25}},{"start":{"line":94,"column":8},"end":{"line":98,"column":25}}],"line":94},"8":{"loc":{"start":{"line":102,"column":2},"end":{"line":102,"column":55}},"type":"cond-expr","locations":[{"start":{"line":102,"column":24},"end":{"line":102,"column":38}},{"start":{"line":102,"column":42},"end":{"line":102,"column":54}}],"line":102},"9":{"loc":{"start":{"line":121,"column":2},"end":{"line":121,"column":36}},"type":"if","locations":[{"start":{"line":121,"column":2},"end":{"line":121,"column":36}},{"start":{"line":121,"column":2},"end":{"line":121,"column":36}}],"line":121},"10":{"loc":{"start":{"line":166,"column":2},"end":{"line":170,"column":3}},"type":"if","locations":[{"start":{"line":166,"column":2},"end":{"line":170,"column":3}},{"start":{"line":166,"column":2},"end":{"line":170,"column":3}}],"line":166},"11":{"loc":{"start":{"line":166,"column":6},"end":{"line":166,"column":30}},"type":"binary-expr","locations":[{"start":{"line":166,"column":6},"end":{"line":166,"column":11}},{"start":{"line":166,"column":15},"end":{"line":166,"column":30}}],"line":166},"12":{"loc":{"start":{"line":171,"column":10},"end":{"line":171,"column":69}},"type":"cond-expr","locations":[{"start":{"line":171,"column":26},"end":{"line":171,"column":32}},{"start":{"line":171,"column":35},"end":{"line":171,"column":69}}],"line":171},"13":{"loc":{"start":{"line":171,"column":35},"end":{"line":171,"column":69}},"type":"cond-expr","locations":[{"start":{"line":171,"column":53},"end":{"line":171,"column":56}},{"start":{"line":171,"column":59},"end":{"line":171,"column":69}}],"line":171},"14":{"loc":{"start":{"line":196,"column":4},"end":{"line":202,"column":5}},"type":"if","locations":[{"start":{"line":196,"column":4},"end":{"line":202,"column":5}},{"start":{"line":196,"column":4},"end":{"line":202,"column":5}}],"line":196},"15":{"loc":{"start":{"line":196,"column":8},"end":{"line":196,"column":52}},"type":"binary-expr","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":18}},{"start":{"line":196,"column":23},"end":{"line":196,"column":51}}],"line":196},"16":{"loc":{"start":{"line":201,"column":7},"end":{"line":201,"column":39}},"type":"binary-expr","locations":[{"start":{"line":201,"column":7},"end":{"line":201,"column":20}},{"start":{"line":201,"column":24},"end":{"line":201,"column":39}}],"line":201},"17":{"loc":{"start":{"line":206,"column":18},"end":{"line":206,"column":44}},"type":"binary-expr","locations":[{"start":{"line":206,"column":18},"end":{"line":206,"column":25}},{"start":{"line":206,"column":29},"end":{"line":206,"column":44}}],"line":206},"18":{"loc":{"start":{"line":232,"column":0},"end":{"line":243,"column":1}},"type":"if","locations":[{"start":{"line":232,"column":0},"end":{"line":243,"column":1}},{"start":{"line":232,"column":0},"end":{"line":243,"column":1}}],"line":232},"19":{"loc":{"start":{"line":232,"column":4},"end":{"line":232,"column":49}},"type":"binary-expr","locations":[{"start":{"line":232,"column":4},"end":{"line":232,"column":31}},{"start":{"line":232,"column":35},"end":{"line":232,"column":49}}],"line":232},"20":{"loc":{"start":{"line":238,"column":7},"end":{"line":243,"column":1}},"type":"if","locations":[{"start":{"line":238,"column":7},"end":{"line":243,"column":1}},{"start":{"line":238,"column":7},"end":{"line":243,"column":1}}],"line":238},"21":{"loc":{"start":{"line":238,"column":11},"end":{"line":238,"column":54}},"type":"binary-expr","locations":[{"start":{"line":238,"column":11},"end":{"line":238,"column":40}},{"start":{"line":238,"column":44},"end":{"line":238,"column":54}}],"line":238},"22":{"loc":{"start":{"line":250,"column":2},"end":{"line":250,"column":45}},"type":"cond-expr","locations":[{"start":{"line":250,"column":34},"end":{"line":250,"column":38}},{"start":{"line":250,"column":41},"end":{"line":250,"column":45}}],"line":250}},"s":{"0":6,"1":6,"2":6,"3":6,"4":6,"5":6,"6":6,"7":6,"8":6,"9":23,"10":23,"11":23,"12":23,"13":23,"14":3694,"15":3694,"16":3694,"17":3694,"18":3917,"19":3917,"20":3917,"21":3694,"22":9249,"23":9249,"24":9249,"25":3694,"26":23,"27":1025,"28":23,"29":4100001,"30":23,"31":23,"32":23,"33":20,"34":4,"35":2,"36":4,"37":2,"38":20,"39":1,"40":1,"41":19,"42":23,"43":23,"44":23,"45":23,"46":23,"47":23,"48":1,"49":23,"50":5888,"51":23,"52":5888,"53":5888,"54":23,"55":4108660,"56":4108660,"57":4108660,"58":4108660,"59":4108660,"60":16436073,"61":16436073,"62":4108660,"63":4108660,"64":4108660,"65":4,"66":4,"67":4,"68":4,"69":32,"70":32,"71":32,"72":4,"73":9,"74":9,"75":32,"76":52,"77":52,"78":52,"79":7735,"80":52,"81":4,"82":4,"83":3,"84":1,"85":1,"86":3,"87":1,"88":1,"89":1,"90":81,"91":6,"92":6,"93":6,"94":6,"95":6,"96":0,"97":0,"98":0,"99":0},"f":{"0":6,"1":23,"2":3694,"3":1025,"4":4100001,"5":20,"6":2,"7":23,"8":4108660,"9":4,"10":32,"11":52,"12":4,"13":81,"14":0},"b":{"0":[1,22],"1":[22,11],"2":[2,21],"3":[4,17],"4":[23,21,20],"5":[4,16],"6":[2,2],"7":[1,19],"8":[4,19],"9":[1,22],"10":[4,28],"11":[32,32],"12":[3,29],"13":[23,6],"14":[3,1],"15":[4,3],"16":[1,1],"17":[1,0],"18":[6,0],"19":[6,6],"20":[0,0],"21":[0,0],"22":[0,6]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"51713684804e6a2df630b16f82a817311168866e","contentHash":"8249b27b9573baed43d58f17ab1b4f20f9b703bbe06145f517fc6c05c6b6cfa4"},"/home/davidbau/git/seedrandom/lib/xor128.js":{"path":"/home/davidbau/git/seedrandom/lib/xor128.js","statementMap":{"0":{"start":{"line":4,"column":0},"end":{"line":79,"column":2}},"1":{"start":{"line":7,"column":11},"end":{"line":7,"column":15}},"2":{"start":{"line":7,"column":27},"end":{"line":7,"column":29}},"3":{"start":{"line":9,"column":2},"end":{"line":9,"column":11}},"4":{"start":{"line":10,"column":2},"end":{"line":10,"column":11}},"5":{"start":{"line":11,"column":2},"end":{"line":11,"column":11}},"6":{"start":{"line":12,"column":2},"end":{"line":12,"column":11}},"7":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"8":{"start":{"line":16,"column":12},"end":{"line":16,"column":31}},"9":{"start":{"line":17,"column":4},"end":{"line":17,"column":16}},"10":{"start":{"line":18,"column":4},"end":{"line":18,"column":16}},"11":{"start":{"line":19,"column":4},"end":{"line":19,"column":16}},"12":{"start":{"line":20,"column":4},"end":{"line":20,"column":49}},"13":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"14":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"15":{"start":{"line":28,"column":4},"end":{"line":28,"column":20}},"16":{"start":{"line":32,"column":2},"end":{"line":35,"column":3}},"17":{"start":{"line":32,"column":15},"end":{"line":32,"column":16}},"18":{"start":{"line":33,"column":4},"end":{"line":33,"column":38}},"19":{"start":{"line":34,"column":4},"end":{"line":34,"column":14}},"20":{"start":{"line":39,"column":2},"end":{"line":39,"column":12}},"21":{"start":{"line":40,"column":2},"end":{"line":40,"column":12}},"22":{"start":{"line":41,"column":2},"end":{"line":41,"column":12}},"23":{"start":{"line":42,"column":2},"end":{"line":42,"column":12}},"24":{"start":{"line":43,"column":2},"end":{"line":43,"column":11}},"25":{"start":{"line":47,"column":11},"end":{"line":47,"column":27}},"26":{"start":{"line":48,"column":14},"end":{"line":48,"column":32}},"27":{"start":{"line":49,"column":13},"end":{"line":49,"column":67}},"28":{"start":{"line":49,"column":26},"end":{"line":49,"column":65}},"29":{"start":{"line":50,"column":2},"end":{"line":57,"column":4}},"30":{"start":{"line":51,"column":4},"end":{"line":55,"column":27}},"31":{"start":{"line":52,"column":16},"end":{"line":52,"column":32}},"32":{"start":{"line":53,"column":16},"end":{"line":53,"column":47}},"33":{"start":{"line":54,"column":19},"end":{"line":54,"column":42}},"34":{"start":{"line":56,"column":4},"end":{"line":56,"column":18}},"35":{"start":{"line":58,"column":2},"end":{"line":58,"column":23}},"36":{"start":{"line":59,"column":2},"end":{"line":59,"column":20}},"37":{"start":{"line":60,"column":2},"end":{"line":63,"column":3}},"38":{"start":{"line":61,"column":4},"end":{"line":61,"column":51}},"39":{"start":{"line":61,"column":35},"end":{"line":61,"column":51}},"40":{"start":{"line":62,"column":4},"end":{"line":62,"column":52}},"41":{"start":{"line":62,"column":30},"end":{"line":62,"column":50}},"42":{"start":{"line":64,"column":2},"end":{"line":64,"column":14}},"43":{"start":{"line":67,"column":0},"end":{"line":73,"column":1}},"44":{"start":{"line":68,"column":2},"end":{"line":68,"column":24}},"45":{"start":{"line":69,"column":7},"end":{"line":73,"column":1}},"46":{"start":{"line":70,"column":2},"end":{"line":70,"column":38}},"47":{"start":{"line":70,"column":22},"end":{"line":70,"column":34}},"48":{"start":{"line":72,"column":2},"end":{"line":72,"column":21}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}},"loc":{"start":{"line":4,"column":34},"end":{"line":75,"column":1}},"line":4},"1":{"name":"XorGen","decl":{"start":{"line":6,"column":9},"end":{"line":6,"column":15}},"loc":{"start":{"line":6,"column":22},"end":{"line":36,"column":1}},"line":6},"2":{"name":"(anonymous_2)","decl":{"start":{"line":15,"column":12},"end":{"line":15,"column":13}},"loc":{"start":{"line":15,"column":23},"end":{"line":21,"column":3}},"line":15},"3":{"name":"copy","decl":{"start":{"line":38,"column":9},"end":{"line":38,"column":13}},"loc":{"start":{"line":38,"column":20},"end":{"line":44,"column":1}},"line":38},"4":{"name":"impl","decl":{"start":{"line":46,"column":9},"end":{"line":46,"column":13}},"loc":{"start":{"line":46,"column":26},"end":{"line":65,"column":1}},"line":46},"5":{"name":"(anonymous_5)","decl":{"start":{"line":49,"column":13},"end":{"line":49,"column":14}},"loc":{"start":{"line":49,"column":24},"end":{"line":49,"column":67}},"line":49},"6":{"name":"(anonymous_6)","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":17}},"loc":{"start":{"line":50,"column":27},"end":{"line":57,"column":3}},"line":50},"7":{"name":"(anonymous_7)","decl":{"start":{"line":62,"column":17},"end":{"line":62,"column":18}},"loc":{"start":{"line":62,"column":28},"end":{"line":62,"column":52}},"line":62},"8":{"name":"(anonymous_8)","decl":{"start":{"line":70,"column":9},"end":{"line":70,"column":10}},"loc":{"start":{"line":70,"column":20},"end":{"line":70,"column":36}},"line":70}},"branchMap":{"0":{"loc":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},{"start":{"line":23,"column":2},"end":{"line":29,"column":3}}],"line":23},"1":{"loc":{"start":{"line":48,"column":14},"end":{"line":48,"column":32}},"type":"binary-expr","locations":[{"start":{"line":48,"column":14},"end":{"line":48,"column":18}},{"start":{"line":48,"column":22},"end":{"line":48,"column":32}}],"line":48},"2":{"loc":{"start":{"line":60,"column":2},"end":{"line":63,"column":3}},"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":63,"column":3}},{"start":{"line":60,"column":2},"end":{"line":63,"column":3}}],"line":60},"3":{"loc":{"start":{"line":61,"column":4},"end":{"line":61,"column":51}},"type":"if","locations":[{"start":{"line":61,"column":4},"end":{"line":61,"column":51}},{"start":{"line":61,"column":4},"end":{"line":61,"column":51}}],"line":61},"4":{"loc":{"start":{"line":67,"column":0},"end":{"line":73,"column":1}},"type":"if","locations":[{"start":{"line":67,"column":0},"end":{"line":73,"column":1}},{"start":{"line":67,"column":0},"end":{"line":73,"column":1}}],"line":67},"5":{"loc":{"start":{"line":67,"column":4},"end":{"line":67,"column":28}},"type":"binary-expr","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":10}},{"start":{"line":67,"column":14},"end":{"line":67,"column":28}}],"line":67},"6":{"loc":{"start":{"line":69,"column":7},"end":{"line":73,"column":1}},"type":"if","locations":[{"start":{"line":69,"column":7},"end":{"line":73,"column":1}},{"start":{"line":69,"column":7},"end":{"line":73,"column":1}}],"line":69},"7":{"loc":{"start":{"line":69,"column":11},"end":{"line":69,"column":31}},"type":"binary-expr","locations":[{"start":{"line":69,"column":11},"end":{"line":69,"column":17}},{"start":{"line":69,"column":21},"end":{"line":69,"column":31}}],"line":69},"8":{"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":39}},"type":"binary-expr","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":29}},{"start":{"line":77,"column":33},"end":{"line":77,"column":39}}],"line":77},"9":{"loc":{"start":{"line":78,"column":2},"end":{"line":78,"column":41}},"type":"binary-expr","locations":[{"start":{"line":78,"column":2},"end":{"line":78,"column":31}},{"start":{"line":78,"column":35},"end":{"line":78,"column":41}}],"line":78}},"s":{"0":1,"1":3,"2":3,"3":3,"4":3,"5":3,"6":3,"7":3,"8":4105327,"9":4105327,"10":4105327,"11":4105327,"12":4105327,"13":3,"14":2,"15":1,"16":3,"17":3,"18":198,"19":198,"20":2,"21":2,"22":2,"23":2,"24":2,"25":3,"26":3,"27":3,"28":4102054,"29":3,"30":1025,"31":1025,"32":1025,"33":1025,"34":1025,"35":3,"36":3,"37":3,"38":2,"39":1,"40":2,"41":1,"42":3,"43":1,"44":1,"45":0,"46":0,"47":0,"48":0},"f":{"0":1,"1":3,"2":4105327,"3":2,"4":3,"5":4102054,"6":1025,"7":1,"8":0},"b":{"0":[2,1],"1":[3,2],"2":[2,1],"3":[1,1],"4":[1,0],"5":[1,1],"6":[0,0],"7":[0,0],"8":[1,1],"9":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"42c805c53b8a22e4d141f90ddecc8031ba21211b","contentHash":"2bd5b1ea82454991d6453cdd05e909475478ffed8cf6dd0ce02556ae981256d8"},"/home/davidbau/git/seedrandom/lib/xorwow.js":{"path":"/home/davidbau/git/seedrandom/lib/xorwow.js","statementMap":{"0":{"start":{"line":4,"column":0},"end":{"line":84,"column":2}},"1":{"start":{"line":7,"column":11},"end":{"line":7,"column":15}},"2":{"start":{"line":7,"column":27},"end":{"line":7,"column":29}},"3":{"start":{"line":10,"column":2},"end":{"line":15,"column":4}},"4":{"start":{"line":11,"column":13},"end":{"line":11,"column":32}},"5":{"start":{"line":12,"column":4},"end":{"line":12,"column":16}},"6":{"start":{"line":12,"column":17},"end":{"line":12,"column":29}},"7":{"start":{"line":12,"column":30},"end":{"line":12,"column":42}},"8":{"start":{"line":12,"column":43},"end":{"line":12,"column":55}},"9":{"start":{"line":13,"column":4},"end":{"line":14,"column":58}},"10":{"start":{"line":17,"column":2},"end":{"line":17,"column":11}},"11":{"start":{"line":18,"column":2},"end":{"line":18,"column":11}},"12":{"start":{"line":19,"column":2},"end":{"line":19,"column":11}},"13":{"start":{"line":20,"column":2},"end":{"line":20,"column":11}},"14":{"start":{"line":21,"column":2},"end":{"line":21,"column":11}},"15":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"16":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"17":{"start":{"line":28,"column":4},"end":{"line":28,"column":20}},"18":{"start":{"line":32,"column":2},"end":{"line":38,"column":3}},"19":{"start":{"line":32,"column":15},"end":{"line":32,"column":16}},"20":{"start":{"line":33,"column":4},"end":{"line":33,"column":38}},"21":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"22":{"start":{"line":35,"column":6},"end":{"line":35,"column":37}},"23":{"start":{"line":37,"column":4},"end":{"line":37,"column":14}},"24":{"start":{"line":42,"column":2},"end":{"line":42,"column":12}},"25":{"start":{"line":43,"column":2},"end":{"line":43,"column":12}},"26":{"start":{"line":44,"column":2},"end":{"line":44,"column":12}},"27":{"start":{"line":45,"column":2},"end":{"line":45,"column":12}},"28":{"start":{"line":46,"column":2},"end":{"line":46,"column":12}},"29":{"start":{"line":47,"column":2},"end":{"line":47,"column":12}},"30":{"start":{"line":48,"column":2},"end":{"line":48,"column":11}},"31":{"start":{"line":52,"column":11},"end":{"line":52,"column":27}},"32":{"start":{"line":53,"column":14},"end":{"line":53,"column":32}},"33":{"start":{"line":54,"column":13},"end":{"line":54,"column":67}},"34":{"start":{"line":54,"column":26},"end":{"line":54,"column":65}},"35":{"start":{"line":55,"column":2},"end":{"line":62,"column":4}},"36":{"start":{"line":56,"column":4},"end":{"line":60,"column":27}},"37":{"start":{"line":57,"column":16},"end":{"line":57,"column":32}},"38":{"start":{"line":58,"column":16},"end":{"line":58,"column":47}},"39":{"start":{"line":59,"column":19},"end":{"line":59,"column":42}},"40":{"start":{"line":61,"column":4},"end":{"line":61,"column":18}},"41":{"start":{"line":63,"column":2},"end":{"line":63,"column":23}},"42":{"start":{"line":64,"column":2},"end":{"line":64,"column":20}},"43":{"start":{"line":65,"column":2},"end":{"line":68,"column":3}},"44":{"start":{"line":66,"column":4},"end":{"line":66,"column":51}},"45":{"start":{"line":66,"column":35},"end":{"line":66,"column":51}},"46":{"start":{"line":67,"column":4},"end":{"line":67,"column":52}},"47":{"start":{"line":67,"column":30},"end":{"line":67,"column":50}},"48":{"start":{"line":69,"column":2},"end":{"line":69,"column":14}},"49":{"start":{"line":72,"column":0},"end":{"line":78,"column":1}},"50":{"start":{"line":73,"column":2},"end":{"line":73,"column":24}},"51":{"start":{"line":74,"column":7},"end":{"line":78,"column":1}},"52":{"start":{"line":75,"column":2},"end":{"line":75,"column":38}},"53":{"start":{"line":75,"column":22},"end":{"line":75,"column":34}},"54":{"start":{"line":77,"column":2},"end":{"line":77,"column":21}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}},"loc":{"start":{"line":4,"column":34},"end":{"line":80,"column":1}},"line":4},"1":{"name":"XorGen","decl":{"start":{"line":6,"column":9},"end":{"line":6,"column":15}},"loc":{"start":{"line":6,"column":22},"end":{"line":39,"column":1}},"line":6},"2":{"name":"(anonymous_2)","decl":{"start":{"line":10,"column":12},"end":{"line":10,"column":13}},"loc":{"start":{"line":10,"column":23},"end":{"line":15,"column":3}},"line":10},"3":{"name":"copy","decl":{"start":{"line":41,"column":9},"end":{"line":41,"column":13}},"loc":{"start":{"line":41,"column":20},"end":{"line":49,"column":1}},"line":41},"4":{"name":"impl","decl":{"start":{"line":51,"column":9},"end":{"line":51,"column":13}},"loc":{"start":{"line":51,"column":26},"end":{"line":70,"column":1}},"line":51},"5":{"name":"(anonymous_5)","decl":{"start":{"line":54,"column":13},"end":{"line":54,"column":14}},"loc":{"start":{"line":54,"column":24},"end":{"line":54,"column":67}},"line":54},"6":{"name":"(anonymous_6)","decl":{"start":{"line":55,"column":16},"end":{"line":55,"column":17}},"loc":{"start":{"line":55,"column":27},"end":{"line":62,"column":3}},"line":55},"7":{"name":"(anonymous_7)","decl":{"start":{"line":67,"column":17},"end":{"line":67,"column":18}},"loc":{"start":{"line":67,"column":28},"end":{"line":67,"column":52}},"line":67},"8":{"name":"(anonymous_8)","decl":{"start":{"line":75,"column":9},"end":{"line":75,"column":10}},"loc":{"start":{"line":75,"column":20},"end":{"line":75,"column":36}},"line":75}},"branchMap":{"0":{"loc":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},{"start":{"line":23,"column":2},"end":{"line":29,"column":3}}],"line":23},"1":{"loc":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},{"start":{"line":34,"column":4},"end":{"line":36,"column":5}}],"line":34},"2":{"loc":{"start":{"line":53,"column":14},"end":{"line":53,"column":32}},"type":"binary-expr","locations":[{"start":{"line":53,"column":14},"end":{"line":53,"column":18}},{"start":{"line":53,"column":22},"end":{"line":53,"column":32}}],"line":53},"3":{"loc":{"start":{"line":65,"column":2},"end":{"line":68,"column":3}},"type":"if","locations":[{"start":{"line":65,"column":2},"end":{"line":68,"column":3}},{"start":{"line":65,"column":2},"end":{"line":68,"column":3}}],"line":65},"4":{"loc":{"start":{"line":66,"column":4},"end":{"line":66,"column":51}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":51}},{"start":{"line":66,"column":4},"end":{"line":66,"column":51}}],"line":66},"5":{"loc":{"start":{"line":72,"column":0},"end":{"line":78,"column":1}},"type":"if","locations":[{"start":{"line":72,"column":0},"end":{"line":78,"column":1}},{"start":{"line":72,"column":0},"end":{"line":78,"column":1}}],"line":72},"6":{"loc":{"start":{"line":72,"column":4},"end":{"line":72,"column":28}},"type":"binary-expr","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":10}},{"start":{"line":72,"column":14},"end":{"line":72,"column":28}}],"line":72},"7":{"loc":{"start":{"line":74,"column":7},"end":{"line":78,"column":1}},"type":"if","locations":[{"start":{"line":74,"column":7},"end":{"line":78,"column":1}},{"start":{"line":74,"column":7},"end":{"line":78,"column":1}}],"line":74},"8":{"loc":{"start":{"line":74,"column":11},"end":{"line":74,"column":31}},"type":"binary-expr","locations":[{"start":{"line":74,"column":11},"end":{"line":74,"column":17}},{"start":{"line":74,"column":21},"end":{"line":74,"column":31}}],"line":74},"9":{"loc":{"start":{"line":82,"column":2},"end":{"line":82,"column":39}},"type":"binary-expr","locations":[{"start":{"line":82,"column":2},"end":{"line":82,"column":29}},{"start":{"line":82,"column":33},"end":{"line":82,"column":39}}],"line":82},"10":{"loc":{"start":{"line":83,"column":2},"end":{"line":83,"column":41}},"type":"binary-expr","locations":[{"start":{"line":83,"column":2},"end":{"line":83,"column":31}},{"start":{"line":83,"column":35},"end":{"line":83,"column":41}}],"line":83}},"s":{"0":1,"1":3,"2":3,"3":3,"4":4105327,"5":4105327,"6":4105327,"7":4105327,"8":4105327,"9":4105327,"10":3,"11":3,"12":3,"13":3,"14":3,"15":3,"16":2,"17":1,"18":3,"19":3,"20":198,"21":198,"22":3,"23":198,"24":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":3,"32":3,"33":3,"34":4102054,"35":3,"36":1025,"37":1025,"38":1025,"39":1025,"40":1025,"41":3,"42":3,"43":3,"44":2,"45":1,"46":2,"47":1,"48":3,"49":1,"50":1,"51":0,"52":0,"53":0,"54":0},"f":{"0":1,"1":3,"2":4105327,"3":2,"4":3,"5":4102054,"6":1025,"7":1,"8":0},"b":{"0":[2,1],"1":[3,195],"2":[3,2],"3":[2,1],"4":[1,1],"5":[1,0],"6":[1,1],"7":[0,0],"8":[0,0],"9":[1,1],"10":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"279728a54e5ce9face1abbf1b1093f69bd5e2cef","contentHash":"870bba719eee59f28e0160645190fa7eda491db1be3c64600c523d0b510d2000"},"/home/davidbau/git/seedrandom/lib/xorshift7.js":{"path":"/home/davidbau/git/seedrandom/lib/xorshift7.js","statementMap":{"0":{"start":{"line":6,"column":0},"end":{"line":96,"column":2}},"1":{"start":{"line":9,"column":11},"end":{"line":9,"column":15}},"2":{"start":{"line":12,"column":2},"end":{"line":23,"column":4}},"3":{"start":{"line":14,"column":12},"end":{"line":14,"column":16}},"4":{"start":{"line":14,"column":22},"end":{"line":14,"column":26}},"5":{"start":{"line":15,"column":4},"end":{"line":15,"column":13}},"6":{"start":{"line":15,"column":14},"end":{"line":15,"column":29}},"7":{"start":{"line":15,"column":30},"end":{"line":15,"column":48}},"8":{"start":{"line":16,"column":4},"end":{"line":16,"column":23}},"9":{"start":{"line":16,"column":24},"end":{"line":16,"column":44}},"10":{"start":{"line":17,"column":4},"end":{"line":17,"column":23}},"11":{"start":{"line":17,"column":24},"end":{"line":17,"column":43}},"12":{"start":{"line":18,"column":4},"end":{"line":18,"column":23}},"13":{"start":{"line":18,"column":24},"end":{"line":18,"column":42}},"14":{"start":{"line":19,"column":4},"end":{"line":19,"column":23}},"15":{"start":{"line":19,"column":24},"end":{"line":19,"column":42}},"16":{"start":{"line":19,"column":43},"end":{"line":19,"column":61}},"17":{"start":{"line":20,"column":4},"end":{"line":20,"column":13}},"18":{"start":{"line":21,"column":4},"end":{"line":21,"column":23}},"19":{"start":{"line":22,"column":4},"end":{"line":22,"column":13}},"20":{"start":{"line":26,"column":18},"end":{"line":26,"column":20}},"21":{"start":{"line":28,"column":4},"end":{"line":38,"column":5}},"22":{"start":{"line":30,"column":6},"end":{"line":30,"column":22}},"23":{"start":{"line":33,"column":6},"end":{"line":33,"column":23}},"24":{"start":{"line":34,"column":6},"end":{"line":37,"column":7}},"25":{"start":{"line":35,"column":8},"end":{"line":36,"column":56}},"26":{"start":{"line":40,"column":4},"end":{"line":40,"column":35}},"27":{"start":{"line":40,"column":25},"end":{"line":40,"column":35}},"28":{"start":{"line":41,"column":4},"end":{"line":41,"column":42}},"29":{"start":{"line":42,"column":4},"end":{"line":42,"column":45}},"30":{"start":{"line":42,"column":16},"end":{"line":42,"column":30}},"31":{"start":{"line":42,"column":36},"end":{"line":42,"column":45}},"32":{"start":{"line":44,"column":4},"end":{"line":44,"column":13}},"33":{"start":{"line":45,"column":4},"end":{"line":45,"column":13}},"34":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"35":{"start":{"line":49,"column":6},"end":{"line":49,"column":16}},"36":{"start":{"line":53,"column":2},"end":{"line":53,"column":17}},"37":{"start":{"line":57,"column":2},"end":{"line":57,"column":20}},"38":{"start":{"line":58,"column":2},"end":{"line":58,"column":12}},"39":{"start":{"line":59,"column":2},"end":{"line":59,"column":11}},"40":{"start":{"line":63,"column":2},"end":{"line":63,"column":39}},"41":{"start":{"line":63,"column":20},"end":{"line":63,"column":39}},"42":{"start":{"line":64,"column":11},"end":{"line":64,"column":27}},"43":{"start":{"line":65,"column":14},"end":{"line":65,"column":32}},"44":{"start":{"line":66,"column":13},"end":{"line":66,"column":67}},"45":{"start":{"line":66,"column":26},"end":{"line":66,"column":65}},"46":{"start":{"line":67,"column":2},"end":{"line":74,"column":4}},"47":{"start":{"line":68,"column":4},"end":{"line":72,"column":27}},"48":{"start":{"line":69,"column":16},"end":{"line":69,"column":32}},"49":{"start":{"line":70,"column":16},"end":{"line":70,"column":47}},"50":{"start":{"line":71,"column":19},"end":{"line":71,"column":42}},"51":{"start":{"line":73,"column":4},"end":{"line":73,"column":18}},"52":{"start":{"line":75,"column":2},"end":{"line":75,"column":23}},"53":{"start":{"line":76,"column":2},"end":{"line":76,"column":20}},"54":{"start":{"line":77,"column":2},"end":{"line":80,"column":3}},"55":{"start":{"line":78,"column":4},"end":{"line":78,"column":33}},"56":{"start":{"line":78,"column":17},"end":{"line":78,"column":33}},"57":{"start":{"line":79,"column":4},"end":{"line":79,"column":52}},"58":{"start":{"line":79,"column":30},"end":{"line":79,"column":50}},"59":{"start":{"line":81,"column":2},"end":{"line":81,"column":14}},"60":{"start":{"line":84,"column":0},"end":{"line":90,"column":1}},"61":{"start":{"line":85,"column":2},"end":{"line":85,"column":24}},"62":{"start":{"line":86,"column":7},"end":{"line":90,"column":1}},"63":{"start":{"line":87,"column":2},"end":{"line":87,"column":38}},"64":{"start":{"line":87,"column":22},"end":{"line":87,"column":34}},"65":{"start":{"line":89,"column":2},"end":{"line":89,"column":24}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":6,"column":1},"end":{"line":6,"column":2}},"loc":{"start":{"line":6,"column":34},"end":{"line":92,"column":1}},"line":6},"1":{"name":"XorGen","decl":{"start":{"line":8,"column":9},"end":{"line":8,"column":15}},"loc":{"start":{"line":8,"column":22},"end":{"line":54,"column":1}},"line":8},"2":{"name":"(anonymous_2)","decl":{"start":{"line":12,"column":12},"end":{"line":12,"column":13}},"loc":{"start":{"line":12,"column":23},"end":{"line":23,"column":3}},"line":12},"3":{"name":"init","decl":{"start":{"line":25,"column":11},"end":{"line":25,"column":15}},"loc":{"start":{"line":25,"column":26},"end":{"line":51,"column":3}},"line":25},"4":{"name":"copy","decl":{"start":{"line":56,"column":9},"end":{"line":56,"column":13}},"loc":{"start":{"line":56,"column":20},"end":{"line":60,"column":1}},"line":56},"5":{"name":"impl","decl":{"start":{"line":62,"column":9},"end":{"line":62,"column":13}},"loc":{"start":{"line":62,"column":26},"end":{"line":82,"column":1}},"line":62},"6":{"name":"(anonymous_6)","decl":{"start":{"line":66,"column":13},"end":{"line":66,"column":14}},"loc":{"start":{"line":66,"column":24},"end":{"line":66,"column":67}},"line":66},"7":{"name":"(anonymous_7)","decl":{"start":{"line":67,"column":16},"end":{"line":67,"column":17}},"loc":{"start":{"line":67,"column":27},"end":{"line":74,"column":3}},"line":67},"8":{"name":"(anonymous_8)","decl":{"start":{"line":79,"column":17},"end":{"line":79,"column":18}},"loc":{"start":{"line":79,"column":28},"end":{"line":79,"column":52}},"line":79},"9":{"name":"(anonymous_9)","decl":{"start":{"line":87,"column":9},"end":{"line":87,"column":10}},"loc":{"start":{"line":87,"column":20},"end":{"line":87,"column":36}},"line":87}},"branchMap":{"0":{"loc":{"start":{"line":28,"column":4},"end":{"line":38,"column":5}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":38,"column":5}},{"start":{"line":28,"column":4},"end":{"line":38,"column":5}}],"line":28},"1":{"loc":{"start":{"line":41,"column":16},"end":{"line":41,"column":35}},"type":"binary-expr","locations":[{"start":{"line":41,"column":16},"end":{"line":41,"column":21}},{"start":{"line":41,"column":25},"end":{"line":41,"column":35}}],"line":41},"2":{"loc":{"start":{"line":42,"column":4},"end":{"line":42,"column":45}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":45}},{"start":{"line":42,"column":4},"end":{"line":42,"column":45}}],"line":42},"3":{"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":39}},"type":"if","locations":[{"start":{"line":63,"column":2},"end":{"line":63,"column":39}},{"start":{"line":63,"column":2},"end":{"line":63,"column":39}}],"line":63},"4":{"loc":{"start":{"line":65,"column":14},"end":{"line":65,"column":32}},"type":"binary-expr","locations":[{"start":{"line":65,"column":14},"end":{"line":65,"column":18}},{"start":{"line":65,"column":22},"end":{"line":65,"column":32}}],"line":65},"5":{"loc":{"start":{"line":77,"column":2},"end":{"line":80,"column":3}},"type":"if","locations":[{"start":{"line":77,"column":2},"end":{"line":80,"column":3}},{"start":{"line":77,"column":2},"end":{"line":80,"column":3}}],"line":77},"6":{"loc":{"start":{"line":78,"column":4},"end":{"line":78,"column":33}},"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":78,"column":33}},{"start":{"line":78,"column":4},"end":{"line":78,"column":33}}],"line":78},"7":{"loc":{"start":{"line":84,"column":0},"end":{"line":90,"column":1}},"type":"if","locations":[{"start":{"line":84,"column":0},"end":{"line":90,"column":1}},{"start":{"line":84,"column":0},"end":{"line":90,"column":1}}],"line":84},"8":{"loc":{"start":{"line":84,"column":4},"end":{"line":84,"column":28}},"type":"binary-expr","locations":[{"start":{"line":84,"column":4},"end":{"line":84,"column":10}},{"start":{"line":84,"column":14},"end":{"line":84,"column":28}}],"line":84},"9":{"loc":{"start":{"line":86,"column":7},"end":{"line":90,"column":1}},"type":"if","locations":[{"start":{"line":86,"column":7},"end":{"line":90,"column":1}},{"start":{"line":86,"column":7},"end":{"line":90,"column":1}}],"line":86},"10":{"loc":{"start":{"line":86,"column":11},"end":{"line":86,"column":31}},"type":"binary-expr","locations":[{"start":{"line":86,"column":11},"end":{"line":86,"column":17}},{"start":{"line":86,"column":21},"end":{"line":86,"column":31}}],"line":86},"11":{"loc":{"start":{"line":94,"column":2},"end":{"line":94,"column":39}},"type":"binary-expr","locations":[{"start":{"line":94,"column":2},"end":{"line":94,"column":29}},{"start":{"line":94,"column":33},"end":{"line":94,"column":39}}],"line":94},"12":{"loc":{"start":{"line":95,"column":2},"end":{"line":95,"column":41}},"type":"binary-expr","locations":[{"start":{"line":95,"column":2},"end":{"line":95,"column":31}},{"start":{"line":95,"column":35},"end":{"line":95,"column":41}}],"line":95}},"s":{"0":1,"1":3,"2":3,"3":4105897,"4":4105897,"5":4105897,"6":4105897,"7":4105897,"8":4105897,"9":4105897,"10":4105897,"11":4105897,"12":4105897,"13":4105897,"14":4105897,"15":4105897,"16":4105897,"17":4105897,"18":4105897,"19":4105897,"20":3,"21":3,"22":2,"23":1,"24":1,"25":6,"26":3,"27":16,"28":3,"29":3,"30":2,"31":1,"32":3,"33":3,"34":3,"35":768,"36":3,"37":2,"38":2,"39":2,"40":3,"41":0,"42":3,"43":3,"44":3,"45":4102054,"46":3,"47":1025,"48":1025,"49":1025,"50":1025,"51":1025,"52":3,"53":3,"54":3,"55":2,"56":1,"57":2,"58":1,"59":3,"60":1,"61":1,"62":0,"63":0,"64":0,"65":0},"f":{"0":1,"1":3,"2":4105897,"3":3,"4":2,"5":3,"6":4102054,"7":1025,"8":1,"9":0},"b":{"0":[2,1],"1":[19,17],"2":[2,1],"3":[0,3],"4":[3,2],"5":[2,1],"6":[1,1],"7":[1,0],"8":[1,1],"9":[0,0],"10":[0,0],"11":[1,1],"12":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"131ac72069e0ca2a2df6aae06f4b2d31b91187b5","contentHash":"4aba94be2ce998b353804abdbf2962ed421abbc77501066348025b6fa45b856d"},"/home/davidbau/git/seedrandom/lib/xor4096.js":{"path":"/home/davidbau/git/seedrandom/lib/xor4096.js","statementMap":{"0":{"start":{"line":26,"column":0},"end":{"line":146,"column":2}},"1":{"start":{"line":29,"column":11},"end":{"line":29,"column":15}},"2":{"start":{"line":32,"column":2},"end":{"line":49,"column":4}},"3":{"start":{"line":33,"column":12},"end":{"line":33,"column":16}},"4":{"start":{"line":34,"column":12},"end":{"line":34,"column":16}},"5":{"start":{"line":34,"column":22},"end":{"line":34,"column":26}},"6":{"start":{"line":36,"column":4},"end":{"line":36,"column":36}},"7":{"start":{"line":38,"column":4},"end":{"line":38,"column":26}},"8":{"start":{"line":39,"column":4},"end":{"line":39,"column":31}},"9":{"start":{"line":40,"column":4},"end":{"line":40,"column":17}},"10":{"start":{"line":41,"column":4},"end":{"line":41,"column":17}},"11":{"start":{"line":42,"column":4},"end":{"line":42,"column":18}},"12":{"start":{"line":43,"column":4},"end":{"line":43,"column":18}},"13":{"start":{"line":45,"column":4},"end":{"line":45,"column":21}},"14":{"start":{"line":46,"column":4},"end":{"line":46,"column":13}},"15":{"start":{"line":48,"column":4},"end":{"line":48,"column":38}},"16":{"start":{"line":52,"column":27},"end":{"line":52,"column":29}},"17":{"start":{"line":52,"column":39},"end":{"line":52,"column":42}},"18":{"start":{"line":53,"column":4},"end":{"line":62,"column":5}},"19":{"start":{"line":55,"column":6},"end":{"line":55,"column":15}},"20":{"start":{"line":56,"column":6},"end":{"line":56,"column":18}},"21":{"start":{"line":59,"column":6},"end":{"line":59,"column":25}},"22":{"start":{"line":60,"column":6},"end":{"line":60,"column":12}},"23":{"start":{"line":61,"column":6},"end":{"line":61,"column":43}},"24":{"start":{"line":64,"column":4},"end":{"line":78,"column":5}},"25":{"start":{"line":66,"column":6},"end":{"line":66,"column":61}},"26":{"start":{"line":66,"column":16},"end":{"line":66,"column":61}},"27":{"start":{"line":68,"column":6},"end":{"line":68,"column":25}},"28":{"start":{"line":68,"column":19},"end":{"line":68,"column":25}},"29":{"start":{"line":69,"column":6},"end":{"line":69,"column":19}},"30":{"start":{"line":70,"column":6},"end":{"line":70,"column":20}},"31":{"start":{"line":71,"column":6},"end":{"line":71,"column":18}},"32":{"start":{"line":72,"column":6},"end":{"line":72,"column":20}},"33":{"start":{"line":73,"column":6},"end":{"line":77,"column":7}},"34":{"start":{"line":74,"column":8},"end":{"line":74,"column":33}},"35":{"start":{"line":75,"column":8},"end":{"line":75,"column":36}},"36":{"start":{"line":76,"column":8},"end":{"line":76,"column":33}},"37":{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},"38":{"start":{"line":81,"column":6},"end":{"line":81,"column":47}},"39":{"start":{"line":86,"column":4},"end":{"line":86,"column":12}},"40":{"start":{"line":87,"column":4},"end":{"line":95,"column":5}},"41":{"start":{"line":88,"column":6},"end":{"line":88,"column":28}},"42":{"start":{"line":89,"column":6},"end":{"line":89,"column":33}},"43":{"start":{"line":90,"column":6},"end":{"line":90,"column":19}},"44":{"start":{"line":91,"column":6},"end":{"line":91,"column":19}},"45":{"start":{"line":92,"column":6},"end":{"line":92,"column":20}},"46":{"start":{"line":93,"column":6},"end":{"line":93,"column":20}},"47":{"start":{"line":94,"column":6},"end":{"line":94,"column":19}},"48":{"start":{"line":97,"column":4},"end":{"line":97,"column":13}},"49":{"start":{"line":98,"column":4},"end":{"line":98,"column":13}},"50":{"start":{"line":99,"column":4},"end":{"line":99,"column":13}},"51":{"start":{"line":102,"column":2},"end":{"line":102,"column":17}},"52":{"start":{"line":106,"column":2},"end":{"line":106,"column":12}},"53":{"start":{"line":107,"column":2},"end":{"line":107,"column":12}},"54":{"start":{"line":108,"column":2},"end":{"line":108,"column":20}},"55":{"start":{"line":109,"column":2},"end":{"line":109,"column":11}},"56":{"start":{"line":113,"column":2},"end":{"line":113,"column":39}},"57":{"start":{"line":113,"column":20},"end":{"line":113,"column":39}},"58":{"start":{"line":114,"column":11},"end":{"line":114,"column":27}},"59":{"start":{"line":115,"column":14},"end":{"line":115,"column":32}},"60":{"start":{"line":116,"column":13},"end":{"line":116,"column":67}},"61":{"start":{"line":116,"column":26},"end":{"line":116,"column":65}},"62":{"start":{"line":117,"column":2},"end":{"line":124,"column":4}},"63":{"start":{"line":118,"column":4},"end":{"line":122,"column":27}},"64":{"start":{"line":119,"column":16},"end":{"line":119,"column":32}},"65":{"start":{"line":120,"column":16},"end":{"line":120,"column":47}},"66":{"start":{"line":121,"column":19},"end":{"line":121,"column":42}},"67":{"start":{"line":123,"column":4},"end":{"line":123,"column":18}},"68":{"start":{"line":125,"column":2},"end":{"line":125,"column":23}},"69":{"start":{"line":126,"column":2},"end":{"line":126,"column":20}},"70":{"start":{"line":127,"column":2},"end":{"line":130,"column":3}},"71":{"start":{"line":128,"column":4},"end":{"line":128,"column":33}},"72":{"start":{"line":128,"column":17},"end":{"line":128,"column":33}},"73":{"start":{"line":129,"column":4},"end":{"line":129,"column":52}},"74":{"start":{"line":129,"column":30},"end":{"line":129,"column":50}},"75":{"start":{"line":131,"column":2},"end":{"line":131,"column":14}},"76":{"start":{"line":134,"column":0},"end":{"line":140,"column":1}},"77":{"start":{"line":135,"column":2},"end":{"line":135,"column":24}},"78":{"start":{"line":136,"column":7},"end":{"line":140,"column":1}},"79":{"start":{"line":137,"column":2},"end":{"line":137,"column":38}},"80":{"start":{"line":137,"column":22},"end":{"line":137,"column":34}},"81":{"start":{"line":139,"column":2},"end":{"line":139,"column":22}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":26,"column":1},"end":{"line":26,"column":2}},"loc":{"start":{"line":26,"column":34},"end":{"line":142,"column":1}},"line":26},"1":{"name":"XorGen","decl":{"start":{"line":28,"column":9},"end":{"line":28,"column":15}},"loc":{"start":{"line":28,"column":22},"end":{"line":103,"column":1}},"line":28},"2":{"name":"(anonymous_2)","decl":{"start":{"line":32,"column":12},"end":{"line":32,"column":13}},"loc":{"start":{"line":32,"column":23},"end":{"line":49,"column":3}},"line":32},"3":{"name":"init","decl":{"start":{"line":51,"column":11},"end":{"line":51,"column":15}},"loc":{"start":{"line":51,"column":26},"end":{"line":100,"column":3}},"line":51},"4":{"name":"copy","decl":{"start":{"line":105,"column":9},"end":{"line":105,"column":13}},"loc":{"start":{"line":105,"column":20},"end":{"line":110,"column":1}},"line":105},"5":{"name":"impl","decl":{"start":{"line":112,"column":9},"end":{"line":112,"column":13}},"loc":{"start":{"line":112,"column":26},"end":{"line":132,"column":1}},"line":112},"6":{"name":"(anonymous_6)","decl":{"start":{"line":116,"column":13},"end":{"line":116,"column":14}},"loc":{"start":{"line":116,"column":24},"end":{"line":116,"column":67}},"line":116},"7":{"name":"(anonymous_7)","decl":{"start":{"line":117,"column":16},"end":{"line":117,"column":17}},"loc":{"start":{"line":117,"column":27},"end":{"line":124,"column":3}},"line":117},"8":{"name":"(anonymous_8)","decl":{"start":{"line":129,"column":17},"end":{"line":129,"column":18}},"loc":{"start":{"line":129,"column":28},"end":{"line":129,"column":52}},"line":129},"9":{"name":"(anonymous_9)","decl":{"start":{"line":137,"column":9},"end":{"line":137,"column":10}},"loc":{"start":{"line":137,"column":20},"end":{"line":137,"column":36}},"line":137}},"branchMap":{"0":{"loc":{"start":{"line":53,"column":4},"end":{"line":62,"column":5}},"type":"if","locations":[{"start":{"line":53,"column":4},"end":{"line":62,"column":5}},{"start":{"line":53,"column":4},"end":{"line":62,"column":5}}],"line":53},"1":{"loc":{"start":{"line":66,"column":6},"end":{"line":66,"column":61}},"type":"if","locations":[{"start":{"line":66,"column":6},"end":{"line":66,"column":61}},{"start":{"line":66,"column":6},"end":{"line":66,"column":61}}],"line":66},"2":{"loc":{"start":{"line":68,"column":6},"end":{"line":68,"column":25}},"type":"if","locations":[{"start":{"line":68,"column":6},"end":{"line":68,"column":25}},{"start":{"line":68,"column":6},"end":{"line":68,"column":25}}],"line":68},"3":{"loc":{"start":{"line":73,"column":6},"end":{"line":77,"column":7}},"type":"if","locations":[{"start":{"line":73,"column":6},"end":{"line":77,"column":7}},{"start":{"line":73,"column":6},"end":{"line":77,"column":7}}],"line":73},"4":{"loc":{"start":{"line":76,"column":12},"end":{"line":76,"column":32}},"type":"cond-expr","locations":[{"start":{"line":76,"column":23},"end":{"line":76,"column":28}},{"start":{"line":76,"column":31},"end":{"line":76,"column":32}}],"line":76},"5":{"loc":{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},{"start":{"line":80,"column":4},"end":{"line":82,"column":5}}],"line":80},"6":{"loc":{"start":{"line":81,"column":9},"end":{"line":81,"column":33}},"type":"binary-expr","locations":[{"start":{"line":81,"column":9},"end":{"line":81,"column":13}},{"start":{"line":81,"column":17},"end":{"line":81,"column":28}},{"start":{"line":81,"column":32},"end":{"line":81,"column":33}}],"line":81},"7":{"loc":{"start":{"line":113,"column":2},"end":{"line":113,"column":39}},"type":"if","locations":[{"start":{"line":113,"column":2},"end":{"line":113,"column":39}},{"start":{"line":113,"column":2},"end":{"line":113,"column":39}}],"line":113},"8":{"loc":{"start":{"line":115,"column":14},"end":{"line":115,"column":32}},"type":"binary-expr","locations":[{"start":{"line":115,"column":14},"end":{"line":115,"column":18}},{"start":{"line":115,"column":22},"end":{"line":115,"column":32}}],"line":115},"9":{"loc":{"start":{"line":127,"column":2},"end":{"line":130,"column":3}},"type":"if","locations":[{"start":{"line":127,"column":2},"end":{"line":130,"column":3}},{"start":{"line":127,"column":2},"end":{"line":130,"column":3}}],"line":127},"10":{"loc":{"start":{"line":128,"column":4},"end":{"line":128,"column":33}},"type":"if","locations":[{"start":{"line":128,"column":4},"end":{"line":128,"column":33}},{"start":{"line":128,"column":4},"end":{"line":128,"column":33}}],"line":128},"11":{"loc":{"start":{"line":134,"column":0},"end":{"line":140,"column":1}},"type":"if","locations":[{"start":{"line":134,"column":0},"end":{"line":140,"column":1}},{"start":{"line":134,"column":0},"end":{"line":140,"column":1}}],"line":134},"12":{"loc":{"start":{"line":134,"column":4},"end":{"line":134,"column":28}},"type":"binary-expr","locations":[{"start":{"line":134,"column":4},"end":{"line":134,"column":10}},{"start":{"line":134,"column":14},"end":{"line":134,"column":28}}],"line":134},"13":{"loc":{"start":{"line":136,"column":7},"end":{"line":140,"column":1}},"type":"if","locations":[{"start":{"line":136,"column":7},"end":{"line":140,"column":1}},{"start":{"line":136,"column":7},"end":{"line":140,"column":1}}],"line":136},"14":{"loc":{"start":{"line":136,"column":11},"end":{"line":136,"column":31}},"type":"binary-expr","locations":[{"start":{"line":136,"column":11},"end":{"line":136,"column":17}},{"start":{"line":136,"column":21},"end":{"line":136,"column":31}}],"line":136},"15":{"loc":{"start":{"line":144,"column":2},"end":{"line":144,"column":39}},"type":"binary-expr","locations":[{"start":{"line":144,"column":2},"end":{"line":144,"column":29}},{"start":{"line":144,"column":33},"end":{"line":144,"column":39}}],"line":144},"16":{"loc":{"start":{"line":145,"column":2},"end":{"line":145,"column":41}},"type":"binary-expr","locations":[{"start":{"line":145,"column":2},"end":{"line":145,"column":31}},{"start":{"line":145,"column":35},"end":{"line":145,"column":41}}],"line":145}},"s":{"0":1,"1":3,"2":3,"3":4105129,"4":4105129,"5":4105129,"6":4105129,"7":4105129,"8":4105129,"9":4105129,"10":4105129,"11":4105129,"12":4105129,"13":4105129,"14":4105129,"15":4105129,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":1,"23":1,"24":3,"25":480,"26":160,"27":480,"28":3,"29":480,"30":480,"31":480,"32":480,"33":480,"34":384,"35":384,"36":384,"37":3,"38":0,"39":3,"40":3,"41":1536,"42":1536,"43":1536,"44":1536,"45":1536,"46":1536,"47":1536,"48":3,"49":3,"50":3,"51":3,"52":2,"53":2,"54":2,"55":2,"56":3,"57":0,"58":3,"59":3,"60":3,"61":4102054,"62":3,"63":1025,"64":1025,"65":1025,"66":1025,"67":1025,"68":3,"69":3,"70":3,"71":2,"72":1,"73":2,"74":1,"75":3,"76":1,"77":1,"78":0,"79":0,"80":0,"81":0},"f":{"0":1,"1":3,"2":4105129,"3":3,"4":2,"5":3,"6":4102054,"7":1025,"8":1,"9":0},"b":{"0":[2,1],"1":[160,320],"2":[3,477],"3":[384,96],"4":[0,384],"5":[0,3],"6":[0,0,0],"7":[0,3],"8":[3,2],"9":[2,1],"10":[1,1],"11":[1,0],"12":[1,1],"13":[0,0],"14":[0,0],"15":[1,1],"16":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"5de096409f62b3565b1ce6d3136eb46f59ce3abe","contentHash":"2e41775c8739abfedd52237d6d32ba6c6ccbf9e10e6721c3a313ec1d67788df4"},"/home/davidbau/git/seedrandom/lib/tychei.js":{"path":"/home/davidbau/git/seedrandom/lib/tychei.js","statementMap":{"0":{"start":{"line":5,"column":0},"end":{"line":101,"column":2}},"1":{"start":{"line":8,"column":11},"end":{"line":8,"column":15}},"2":{"start":{"line":8,"column":27},"end":{"line":8,"column":29}},"3":{"start":{"line":11,"column":2},"end":{"line":21,"column":4}},"4":{"start":{"line":12,"column":12},"end":{"line":12,"column":16}},"5":{"start":{"line":12,"column":22},"end":{"line":12,"column":26}},"6":{"start":{"line":12,"column":32},"end":{"line":12,"column":36}},"7":{"start":{"line":12,"column":42},"end":{"line":12,"column":46}},"8":{"start":{"line":13,"column":4},"end":{"line":13,"column":34}},"9":{"start":{"line":14,"column":4},"end":{"line":14,"column":20}},"10":{"start":{"line":15,"column":4},"end":{"line":15,"column":34}},"11":{"start":{"line":16,"column":4},"end":{"line":16,"column":20}},"12":{"start":{"line":17,"column":4},"end":{"line":17,"column":42}},"13":{"start":{"line":18,"column":4},"end":{"line":18,"column":27}},"14":{"start":{"line":19,"column":4},"end":{"line":19,"column":38}},"15":{"start":{"line":20,"column":4},"end":{"line":20,"column":30}},"16":{"start":{"line":39,"column":2},"end":{"line":39,"column":11}},"17":{"start":{"line":40,"column":2},"end":{"line":40,"column":11}},"18":{"start":{"line":41,"column":2},"end":{"line":41,"column":24}},"19":{"start":{"line":42,"column":2},"end":{"line":42,"column":20}},"20":{"start":{"line":44,"column":2},"end":{"line":51,"column":3}},"21":{"start":{"line":46,"column":4},"end":{"line":46,"column":36}},"22":{"start":{"line":47,"column":4},"end":{"line":47,"column":20}},"23":{"start":{"line":50,"column":4},"end":{"line":50,"column":20}},"24":{"start":{"line":54,"column":2},"end":{"line":57,"column":3}},"25":{"start":{"line":54,"column":15},"end":{"line":54,"column":16}},"26":{"start":{"line":55,"column":4},"end":{"line":55,"column":38}},"27":{"start":{"line":56,"column":4},"end":{"line":56,"column":14}},"28":{"start":{"line":61,"column":2},"end":{"line":61,"column":12}},"29":{"start":{"line":62,"column":2},"end":{"line":62,"column":12}},"30":{"start":{"line":63,"column":2},"end":{"line":63,"column":12}},"31":{"start":{"line":64,"column":2},"end":{"line":64,"column":12}},"32":{"start":{"line":65,"column":2},"end":{"line":65,"column":11}},"33":{"start":{"line":69,"column":11},"end":{"line":69,"column":27}},"34":{"start":{"line":70,"column":14},"end":{"line":70,"column":32}},"35":{"start":{"line":71,"column":13},"end":{"line":71,"column":67}},"36":{"start":{"line":71,"column":26},"end":{"line":71,"column":65}},"37":{"start":{"line":72,"column":2},"end":{"line":79,"column":4}},"38":{"start":{"line":73,"column":4},"end":{"line":77,"column":27}},"39":{"start":{"line":74,"column":16},"end":{"line":74,"column":32}},"40":{"start":{"line":75,"column":16},"end":{"line":75,"column":47}},"41":{"start":{"line":76,"column":19},"end":{"line":76,"column":42}},"42":{"start":{"line":78,"column":4},"end":{"line":78,"column":18}},"43":{"start":{"line":80,"column":2},"end":{"line":80,"column":23}},"44":{"start":{"line":81,"column":2},"end":{"line":81,"column":20}},"45":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"46":{"start":{"line":83,"column":4},"end":{"line":83,"column":51}},"47":{"start":{"line":83,"column":35},"end":{"line":83,"column":51}},"48":{"start":{"line":84,"column":4},"end":{"line":84,"column":52}},"49":{"start":{"line":84,"column":30},"end":{"line":84,"column":50}},"50":{"start":{"line":86,"column":2},"end":{"line":86,"column":14}},"51":{"start":{"line":89,"column":0},"end":{"line":95,"column":1}},"52":{"start":{"line":90,"column":2},"end":{"line":90,"column":24}},"53":{"start":{"line":91,"column":7},"end":{"line":95,"column":1}},"54":{"start":{"line":92,"column":2},"end":{"line":92,"column":38}},"55":{"start":{"line":92,"column":22},"end":{"line":92,"column":34}},"56":{"start":{"line":94,"column":2},"end":{"line":94,"column":21}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":1},"end":{"line":5,"column":2}},"loc":{"start":{"line":5,"column":34},"end":{"line":97,"column":1}},"line":5},"1":{"name":"XorGen","decl":{"start":{"line":7,"column":9},"end":{"line":7,"column":15}},"loc":{"start":{"line":7,"column":22},"end":{"line":58,"column":1}},"line":7},"2":{"name":"(anonymous_2)","decl":{"start":{"line":11,"column":12},"end":{"line":11,"column":13}},"loc":{"start":{"line":11,"column":23},"end":{"line":21,"column":3}},"line":11},"3":{"name":"copy","decl":{"start":{"line":60,"column":9},"end":{"line":60,"column":13}},"loc":{"start":{"line":60,"column":20},"end":{"line":66,"column":1}},"line":60},"4":{"name":"impl","decl":{"start":{"line":68,"column":9},"end":{"line":68,"column":13}},"loc":{"start":{"line":68,"column":26},"end":{"line":87,"column":1}},"line":68},"5":{"name":"(anonymous_5)","decl":{"start":{"line":71,"column":13},"end":{"line":71,"column":14}},"loc":{"start":{"line":71,"column":24},"end":{"line":71,"column":67}},"line":71},"6":{"name":"(anonymous_6)","decl":{"start":{"line":72,"column":16},"end":{"line":72,"column":17}},"loc":{"start":{"line":72,"column":27},"end":{"line":79,"column":3}},"line":72},"7":{"name":"(anonymous_7)","decl":{"start":{"line":84,"column":17},"end":{"line":84,"column":18}},"loc":{"start":{"line":84,"column":28},"end":{"line":84,"column":52}},"line":84},"8":{"name":"(anonymous_8)","decl":{"start":{"line":92,"column":9},"end":{"line":92,"column":10}},"loc":{"start":{"line":92,"column":20},"end":{"line":92,"column":36}},"line":92}},"branchMap":{"0":{"loc":{"start":{"line":44,"column":2},"end":{"line":51,"column":3}},"type":"if","locations":[{"start":{"line":44,"column":2},"end":{"line":51,"column":3}},{"start":{"line":44,"column":2},"end":{"line":51,"column":3}}],"line":44},"1":{"loc":{"start":{"line":70,"column":14},"end":{"line":70,"column":32}},"type":"binary-expr","locations":[{"start":{"line":70,"column":14},"end":{"line":70,"column":18}},{"start":{"line":70,"column":22},"end":{"line":70,"column":32}}],"line":70},"2":{"loc":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"type":"if","locations":[{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},{"start":{"line":82,"column":2},"end":{"line":85,"column":3}}],"line":82},"3":{"loc":{"start":{"line":83,"column":4},"end":{"line":83,"column":51}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":83,"column":51}},{"start":{"line":83,"column":4},"end":{"line":83,"column":51}}],"line":83},"4":{"loc":{"start":{"line":89,"column":0},"end":{"line":95,"column":1}},"type":"if","locations":[{"start":{"line":89,"column":0},"end":{"line":95,"column":1}},{"start":{"line":89,"column":0},"end":{"line":95,"column":1}}],"line":89},"5":{"loc":{"start":{"line":89,"column":4},"end":{"line":89,"column":28}},"type":"binary-expr","locations":[{"start":{"line":89,"column":4},"end":{"line":89,"column":10}},{"start":{"line":89,"column":14},"end":{"line":89,"column":28}}],"line":89},"6":{"loc":{"start":{"line":91,"column":7},"end":{"line":95,"column":1}},"type":"if","locations":[{"start":{"line":91,"column":7},"end":{"line":95,"column":1}},{"start":{"line":91,"column":7},"end":{"line":95,"column":1}}],"line":91},"7":{"loc":{"start":{"line":91,"column":11},"end":{"line":91,"column":31}},"type":"binary-expr","locations":[{"start":{"line":91,"column":11},"end":{"line":91,"column":17}},{"start":{"line":91,"column":21},"end":{"line":91,"column":31}}],"line":91},"8":{"loc":{"start":{"line":99,"column":2},"end":{"line":99,"column":39}},"type":"binary-expr","locations":[{"start":{"line":99,"column":2},"end":{"line":99,"column":29}},{"start":{"line":99,"column":33},"end":{"line":99,"column":39}}],"line":99},"9":{"loc":{"start":{"line":100,"column":2},"end":{"line":100,"column":41}},"type":"binary-expr","locations":[{"start":{"line":100,"column":2},"end":{"line":100,"column":31}},{"start":{"line":100,"column":35},"end":{"line":100,"column":41}}],"line":100}},"s":{"0":1,"1":3,"2":3,"3":3,"4":4105195,"5":4105195,"6":4105195,"7":4105195,"8":4105195,"9":4105195,"10":4105195,"11":4105195,"12":4105195,"13":4105195,"14":4105195,"15":4105195,"16":3,"17":3,"18":3,"19":3,"20":3,"21":2,"22":2,"23":1,"24":3,"25":3,"26":66,"27":66,"28":2,"29":2,"30":2,"31":2,"32":2,"33":3,"34":3,"35":3,"36":4102054,"37":3,"38":1025,"39":1025,"40":1025,"41":1025,"42":1025,"43":3,"44":3,"45":3,"46":2,"47":1,"48":2,"49":1,"50":3,"51":1,"52":1,"53":0,"54":0,"55":0,"56":0},"f":{"0":1,"1":3,"2":4105195,"3":2,"4":3,"5":4102054,"6":1025,"7":1,"8":0},"b":{"0":[2,1],"1":[3,2],"2":[2,1],"3":[1,1],"4":[1,0],"5":[1,1],"6":[0,0],"7":[0,0],"8":[1,1],"9":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"3875c0e0fa564e9ae68114bde64afc883b7c9ca0","contentHash":"00c6380ad151ad19433a64fdc0b4051c1a7ee0af16dc43e971860cc64ce62b05"},"/home/davidbau/git/seedrandom/lib/alea.js":{"path":"/home/davidbau/git/seedrandom/lib/alea.js","statementMap":{"0":{"start":{"line":28,"column":0},"end":{"line":112,"column":2}},"1":{"start":{"line":31,"column":11},"end":{"line":31,"column":15}},"2":{"start":{"line":31,"column":24},"end":{"line":31,"column":30}},"3":{"start":{"line":33,"column":2},"end":{"line":38,"column":4}},"4":{"start":{"line":34,"column":12},"end":{"line":34,"column":59}},"5":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"6":{"start":{"line":36,"column":4},"end":{"line":36,"column":18}},"7":{"start":{"line":37,"column":4},"end":{"line":37,"column":38}},"8":{"start":{"line":41,"column":2},"end":{"line":41,"column":11}},"9":{"start":{"line":42,"column":2},"end":{"line":42,"column":20}},"10":{"start":{"line":43,"column":2},"end":{"line":43,"column":20}},"11":{"start":{"line":44,"column":2},"end":{"line":44,"column":20}},"12":{"start":{"line":45,"column":2},"end":{"line":45,"column":22}},"13":{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},"14":{"start":{"line":46,"column":19},"end":{"line":46,"column":30}},"15":{"start":{"line":47,"column":2},"end":{"line":47,"column":22}},"16":{"start":{"line":48,"column":2},"end":{"line":48,"column":32}},"17":{"start":{"line":48,"column":19},"end":{"line":48,"column":30}},"18":{"start":{"line":49,"column":2},"end":{"line":49,"column":22}},"19":{"start":{"line":50,"column":2},"end":{"line":50,"column":32}},"20":{"start":{"line":50,"column":19},"end":{"line":50,"column":30}},"21":{"start":{"line":51,"column":2},"end":{"line":51,"column":14}},"22":{"start":{"line":55,"column":2},"end":{"line":55,"column":12}},"23":{"start":{"line":56,"column":2},"end":{"line":56,"column":14}},"24":{"start":{"line":57,"column":2},"end":{"line":57,"column":14}},"25":{"start":{"line":58,"column":2},"end":{"line":58,"column":14}},"26":{"start":{"line":59,"column":2},"end":{"line":59,"column":11}},"27":{"start":{"line":63,"column":11},"end":{"line":63,"column":25}},"28":{"start":{"line":64,"column":14},"end":{"line":64,"column":32}},"29":{"start":{"line":65,"column":13},"end":{"line":65,"column":20}},"30":{"start":{"line":66,"column":2},"end":{"line":66,"column":67}},"31":{"start":{"line":66,"column":28},"end":{"line":66,"column":65}},"32":{"start":{"line":67,"column":2},"end":{"line":69,"column":4}},"33":{"start":{"line":68,"column":4},"end":{"line":68,"column":69}},"34":{"start":{"line":70,"column":2},"end":{"line":70,"column":20}},"35":{"start":{"line":71,"column":2},"end":{"line":74,"column":3}},"36":{"start":{"line":72,"column":4},"end":{"line":72,"column":51}},"37":{"start":{"line":72,"column":35},"end":{"line":72,"column":51}},"38":{"start":{"line":73,"column":4},"end":{"line":73,"column":52}},"39":{"start":{"line":73,"column":30},"end":{"line":73,"column":50}},"40":{"start":{"line":75,"column":2},"end":{"line":75,"column":14}},"41":{"start":{"line":79,"column":10},"end":{"line":79,"column":20}},"42":{"start":{"line":81,"column":13},"end":{"line":94,"column":3}},"43":{"start":{"line":82,"column":4},"end":{"line":82,"column":24}},"44":{"start":{"line":83,"column":4},"end":{"line":92,"column":5}},"45":{"start":{"line":83,"column":17},"end":{"line":83,"column":18}},"46":{"start":{"line":84,"column":6},"end":{"line":84,"column":30}},"47":{"start":{"line":85,"column":14},"end":{"line":85,"column":37}},"48":{"start":{"line":86,"column":6},"end":{"line":86,"column":18}},"49":{"start":{"line":87,"column":6},"end":{"line":87,"column":13}},"50":{"start":{"line":88,"column":6},"end":{"line":88,"column":13}},"51":{"start":{"line":89,"column":6},"end":{"line":89,"column":18}},"52":{"start":{"line":90,"column":6},"end":{"line":90,"column":13}},"53":{"start":{"line":91,"column":6},"end":{"line":91,"column":27}},"54":{"start":{"line":93,"column":4},"end":{"line":93,"column":46}},"55":{"start":{"line":96,"column":2},"end":{"line":96,"column":14}},"56":{"start":{"line":100,"column":0},"end":{"line":106,"column":1}},"57":{"start":{"line":101,"column":2},"end":{"line":101,"column":24}},"58":{"start":{"line":102,"column":7},"end":{"line":106,"column":1}},"59":{"start":{"line":103,"column":2},"end":{"line":103,"column":38}},"60":{"start":{"line":103,"column":22},"end":{"line":103,"column":34}},"61":{"start":{"line":105,"column":2},"end":{"line":105,"column":19}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":28,"column":1},"end":{"line":28,"column":2}},"loc":{"start":{"line":28,"column":34},"end":{"line":108,"column":1}},"line":28},"1":{"name":"Alea","decl":{"start":{"line":30,"column":9},"end":{"line":30,"column":13}},"loc":{"start":{"line":30,"column":20},"end":{"line":52,"column":1}},"line":30},"2":{"name":"(anonymous_2)","decl":{"start":{"line":33,"column":12},"end":{"line":33,"column":13}},"loc":{"start":{"line":33,"column":23},"end":{"line":38,"column":3}},"line":33},"3":{"name":"copy","decl":{"start":{"line":54,"column":9},"end":{"line":54,"column":13}},"loc":{"start":{"line":54,"column":20},"end":{"line":60,"column":1}},"line":54},"4":{"name":"impl","decl":{"start":{"line":62,"column":9},"end":{"line":62,"column":13}},"loc":{"start":{"line":62,"column":26},"end":{"line":76,"column":1}},"line":62},"5":{"name":"(anonymous_5)","decl":{"start":{"line":66,"column":15},"end":{"line":66,"column":16}},"loc":{"start":{"line":66,"column":26},"end":{"line":66,"column":67}},"line":66},"6":{"name":"(anonymous_6)","decl":{"start":{"line":67,"column":16},"end":{"line":67,"column":17}},"loc":{"start":{"line":67,"column":27},"end":{"line":69,"column":3}},"line":67},"7":{"name":"(anonymous_7)","decl":{"start":{"line":73,"column":17},"end":{"line":73,"column":18}},"loc":{"start":{"line":73,"column":28},"end":{"line":73,"column":52}},"line":73},"8":{"name":"Mash","decl":{"start":{"line":78,"column":9},"end":{"line":78,"column":13}},"loc":{"start":{"line":78,"column":16},"end":{"line":97,"column":1}},"line":78},"9":{"name":"(anonymous_9)","decl":{"start":{"line":81,"column":13},"end":{"line":81,"column":14}},"loc":{"start":{"line":81,"column":28},"end":{"line":94,"column":3}},"line":81},"10":{"name":"(anonymous_10)","decl":{"start":{"line":103,"column":9},"end":{"line":103,"column":10}},"loc":{"start":{"line":103,"column":20},"end":{"line":103,"column":36}},"line":103}},"branchMap":{"0":{"loc":{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},{"start":{"line":46,"column":2},"end":{"line":46,"column":32}}],"line":46},"1":{"loc":{"start":{"line":48,"column":2},"end":{"line":48,"column":32}},"type":"if","locations":[{"start":{"line":48,"column":2},"end":{"line":48,"column":32}},{"start":{"line":48,"column":2},"end":{"line":48,"column":32}}],"line":48},"2":{"loc":{"start":{"line":50,"column":2},"end":{"line":50,"column":32}},"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":50,"column":32}},{"start":{"line":50,"column":2},"end":{"line":50,"column":32}}],"line":50},"3":{"loc":{"start":{"line":64,"column":14},"end":{"line":64,"column":32}},"type":"binary-expr","locations":[{"start":{"line":64,"column":14},"end":{"line":64,"column":18}},{"start":{"line":64,"column":22},"end":{"line":64,"column":32}}],"line":64},"4":{"loc":{"start":{"line":71,"column":2},"end":{"line":74,"column":3}},"type":"if","locations":[{"start":{"line":71,"column":2},"end":{"line":74,"column":3}},{"start":{"line":71,"column":2},"end":{"line":74,"column":3}}],"line":71},"5":{"loc":{"start":{"line":72,"column":4},"end":{"line":72,"column":51}},"type":"if","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":51}},{"start":{"line":72,"column":4},"end":{"line":72,"column":51}}],"line":72},"6":{"loc":{"start":{"line":100,"column":0},"end":{"line":106,"column":1}},"type":"if","locations":[{"start":{"line":100,"column":0},"end":{"line":106,"column":1}},{"start":{"line":100,"column":0},"end":{"line":106,"column":1}}],"line":100},"7":{"loc":{"start":{"line":100,"column":4},"end":{"line":100,"column":28}},"type":"binary-expr","locations":[{"start":{"line":100,"column":4},"end":{"line":100,"column":10}},{"start":{"line":100,"column":14},"end":{"line":100,"column":28}}],"line":100},"8":{"loc":{"start":{"line":102,"column":7},"end":{"line":106,"column":1}},"type":"if","locations":[{"start":{"line":102,"column":7},"end":{"line":106,"column":1}},{"start":{"line":102,"column":7},"end":{"line":106,"column":1}}],"line":102},"9":{"loc":{"start":{"line":102,"column":11},"end":{"line":102,"column":31}},"type":"binary-expr","locations":[{"start":{"line":102,"column":11},"end":{"line":102,"column":17}},{"start":{"line":102,"column":21},"end":{"line":102,"column":31}}],"line":102},"10":{"loc":{"start":{"line":110,"column":2},"end":{"line":110,"column":39}},"type":"binary-expr","locations":[{"start":{"line":110,"column":2},"end":{"line":110,"column":29}},{"start":{"line":110,"column":33},"end":{"line":110,"column":39}}],"line":110},"11":{"loc":{"start":{"line":111,"column":2},"end":{"line":111,"column":41}},"type":"binary-expr","locations":[{"start":{"line":111,"column":2},"end":{"line":111,"column":31}},{"start":{"line":111,"column":35},"end":{"line":111,"column":41}}],"line":111}},"s":{"0":1,"1":3,"2":3,"3":3,"4":4105129,"5":4105129,"6":4105129,"7":4105129,"8":3,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":3,"16":3,"17":3,"18":3,"19":3,"20":0,"21":3,"22":2,"23":2,"24":2,"25":2,"26":2,"27":3,"28":3,"29":3,"30":3,"31":1025,"32":3,"33":1025,"34":3,"35":3,"36":2,"37":1,"38":2,"39":1,"40":3,"41":3,"42":3,"43":18,"44":18,"45":18,"46":33,"47":33,"48":33,"49":33,"50":33,"51":33,"52":33,"53":33,"54":18,"55":3,"56":1,"57":1,"58":0,"59":0,"60":0,"61":0},"f":{"0":1,"1":3,"2":4105129,"3":2,"4":3,"5":1025,"6":1025,"7":1,"8":3,"9":18,"10":0},"b":{"0":[1,2],"1":[3,0],"2":[0,3],"3":[3,2],"4":[2,1],"5":[1,1],"6":[1,0],"7":[1,1],"8":[0,0],"9":[0,0],"10":[1,1],"11":[1,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"b70bcb8438fd8d93267e4355bb97ec0e15c51502","contentHash":"026d994d4bc0afeb3f977bb09d4e6284476ab12f7a5be78bdde751602626af54"}} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json new file mode 100644 index 0000000..d596d96 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json @@ -0,0 +1 @@ +{"uuid":"f02e18a9-b1c7-4946-836e-c3dbfb9635a3","parent":null,"pid":8128,"argv":["/home/davidbau/.nvm/versions/node/v11.9.0/bin/node","/home/davidbau/git/seedrandom/node_modules/mocha/bin/_mocha","test/cryptotest.js","test/nodetest.js","test/prngtest.js"],"execArgv":[],"cwd":"/home/davidbau/git/seedrandom","time":1568716532937,"ppid":8121,"root":"23c2e786-6463-4b5a-9042-75ea3257640f","coverageFilename":"/home/davidbau/git/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json","files":["/home/davidbau/git/seedrandom/seedrandom.js","/home/davidbau/git/seedrandom/lib/xor128.js","/home/davidbau/git/seedrandom/lib/xorwow.js","/home/davidbau/git/seedrandom/lib/xorshift7.js","/home/davidbau/git/seedrandom/lib/xor4096.js","/home/davidbau/git/seedrandom/lib/tychei.js","/home/davidbau/git/seedrandom/lib/alea.js"]} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/index.json b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/index.json new file mode 100644 index 0000000..f67865c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.nyc_output/processinfo/index.json @@ -0,0 +1 @@ +{"processes":{"f02e18a9-b1c7-4946-836e-c3dbfb9635a3":{"parent":null,"children":[]}},"files":{"/home/davidbau/git/seedrandom/seedrandom.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor128.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorwow.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorshift7.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor4096.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/tychei.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/alea.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"]},"externalIds":{}} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/.travis.yml b/24_10_22_faktorialis/node_modules/seedrandom/.travis.yml new file mode 100644 index 0000000..6852ab1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +sudo: false +node_js: +- '7' +- '8' +- '9' +- '10' +- '11' diff --git a/24_10_22_faktorialis/node_modules/seedrandom/Gruntfile.js b/24_10_22_faktorialis/node_modules/seedrandom/Gruntfile.js new file mode 100644 index 0000000..41585ec --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/Gruntfile.js @@ -0,0 +1,97 @@ +module.exports = function(grunt) { + "use strict"; + + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + copy: { + browsertest: { + files: [ + { expand: true, cwd: 'node_modules/qunit/qunit', src: 'qunit.*' , + dest: 'test/lib'}, + { expand: true, cwd: 'node_modules/requirejs', src: 'require.js', + dest: 'test/lib'} + ], + } + }, + uglify: { + all: { + files: { + "<%= pkg.name %>.min.js": [ "<%= pkg.name %>.js" ], + "lib/alea.min.js": [ "lib/alea.js" ], + "lib/tychei.min.js": [ "lib/tychei.js" ], + "lib/xor4096.min.js": [ "lib/xor4096.js" ], + "lib/xorshift7.min.js": [ "lib/xorshift7.js" ], + "lib/xorwow.min.js": [ "lib/xorwow.js" ], + "lib/xor128.min.js": [ "lib/xor128.js" ] + }, + options: { + preserveComments: false, + report: "min", + output: { + ascii_only: true + } + } + } + }, + qunit: { + options: { + noGlobals: true, + httpBase: 'http://localhost:8192' + }, + all: ["test/*.html"] + }, + connect: { + server: { + options: { + port: 8192, + base: '.' + } + } + }, + browserify: { + test: { + files: { + 'test/browserified.js': ['test/nodetest.js'], + }, + options: { + ignore: ['requirejs', 'process'], + alias: { + 'assert': './test/qunitassert.js' + } + } + } + }, + mocha_nyc: { + coverage: { + src: 'test/*test.js' + }, + coveralls: { + src: 'test/*test.js', + options: { + coverage: true + } + } + }, + release: { + options: { + bump: false + } + } + }); + + grunt.event.on('coverage', require('coveralls').handleInput); + + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-mocha-nyc'); + grunt.loadNpmTasks('grunt-release'); + grunt.loadNpmTasks('grunt-browserify'); + + grunt.registerTask("test", ["copy:browsertest", "browserify", + "connect", "qunit", "mocha_nyc:coverage"]); + grunt.registerTask("default", ["uglify", "test"]); + grunt.registerTask("travis", ["default", "mocha_nyc:coveralls"]); +}; + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/README.md b/24_10_22_faktorialis/node_modules/seedrandom/README.md new file mode 100644 index 0000000..9518915 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/README.md @@ -0,0 +1,322 @@ +seedrandom.js +============= +[![Build Status](https://travis-ci.org/davidbau/seedrandom.svg?branch=master)](https://travis-ci.org/davidbau/seedrandom) +[![NPM version](https://badge.fury.io/js/seedrandom.svg)](http://badge.fury.io/js/seedrandom) +[![Bower version](https://badge.fury.io/bo/seedrandom.svg)](http://badge.fury.io/bo/seedrandom) + +Seeded random number generator for JavaScript. + +Version 3.0.5 + +Author: David Bau + +Date: 2019-09-14 + +Can be used as a plain script, a Node.js module or an AMD module. + + +Script tag usage +---------------- + +```html + +``` + +```js +// Make a predictable pseudorandom number generator. +var myrng = new Math.seedrandom('hello.'); +console.log(myrng()); // Always 0.9282578795792454 +console.log(myrng()); // Always 0.3752569768646784 + +// Use "quick" to get only 32 bits of randomness in a float. +console.log(myrng.quick()); // Always 0.7316977467853576 + +// Use "int32" to get a 32 bit (signed) integer +console.log(myrng.int32()); // Always 1966374204 + +// Calling seedrandom with no arguments creates an ARC4-based PRNG +// that is autoseeded using the current time, dom state, and other +// accumulated local entropy. +var prng = new Math.seedrandom(); +console.log(prng()); // Reasonably unpredictable. + +// Seeds using the given explicit seed mixed with accumulated entropy. +prng = new Math.seedrandom('added entropy.', { entropy: true }); +console.log(prng()); // As unpredictable as added entropy. + +// Warning: if you call Math.seedrandom without `new`, it replaces +// Math.random with the predictable new Math.seedrandom(...), as follows: +Math.seedrandom('hello.'); +console.log(Math.random()); // Always 0.9282578795792454 +console.log(Math.random()); // Always 0.3752569768646784 + +``` + +**Note**: calling `Math.seedrandom('constant')` without `new` will make +`Math.random()` predictable globally, which is intended to be useful for +derandomizing code for testing, but should not be done in a production library. +If you need a local seeded PRNG, use `myrng = new Math.seedrandom('seed')` +instead. For example, [cryptico](https://www.npmjs.com/package/cryptico), +an RSA encryption package, [uses the wrong form]( +https://github.com/wwwtyro/cryptico/blob/9291ece6/api.js#L264), +and thus secretly makes `Math.random()` perfectly predictable. +The cryptico library (and any other library that does this) +should not be trusted in a security-sensitive application. + + +Other Fast PRNG Algorithms +-------------------------- + +The package includes some other fast PRNGs. To use Johannes Baagøe's +extremely fast Alea PRNG: + + +```html + +``` + +```js +// Use alea for Johannes Baagøe's clever and fast floating-point RNG. +var arng = new alea('hello.'); + +// By default provides 32 bits of randomness in a float. +console.log(arng()); // Always 0.4783254903741181 + +// Use "double" to get 56 bits of randomness. +console.log(arng.double()); // Always 0.8297006866124559 + +// Use "int32" to get a 32 bit (signed) integer. +console.log(arng.int32()); // Always 1076136327 +``` + +Besides alea, there are several other faster PRNGs available. +Note that none of these fast PRNGs provide autoseeding: you +need to provide your own seed (or use the default autoseeded +seedrandom to make a seed). + +|PRNG name | Time vs native | Period | Author | +|-----------|----------------|-------------|----------------------| +|`alea` | 1.95 ns, 0.9x | ~2^116 | Baagøe | +|`xor128` | 2.04 ns, 0.9x | 2^128-1 | Marsaglia | +|`tychei` | 2.32 ns, 1.1x | ~2^127 | Neves/Araujo (ChaCha)| +|`xorwow` | 2.40 ns, 1.1x | 2^192-2^32 | Marsaglia | +|`xor4096` | 2.40 ns, 1.1x | 2^4096-2^32 | Brent (xorgens) | +|`xorshift7`| 2.64 ns, 1.3x | 2^256-1 | Panneton/L'ecuyer | +|`quick` | 3.80 ns, 1.8x | ~2^1600 | Bau (ARC4) | + +(Timings were done on node v0.12.2 on a single-core Google Compute Engine +instance. `quick` is just the 32-bit version of the RC4-based PRNG +originally packaged with seedrandom.) + + +CJS / Node.js usage +------------------- + +``` +npm install seedrandom +``` + +```js +// Local PRNG: does not affect Math.random. +var seedrandom = require('seedrandom'); +var rng = seedrandom('hello.'); +console.log(rng()); // Always 0.9282578795792454 + +// Global PRNG: set Math.random. +seedrandom('hello.', { global: true }); +console.log(Math.random()); // Always 0.9282578795792454 + +// Autoseeded ARC4-based PRNG. +rng = seedrandom(); +console.log(rng()); // Reasonably unpredictable. + +// Mixing accumulated entropy. +rng = seedrandom('added entropy.', { entropy: true }); +console.log(rng()); // As unpredictable as added entropy. + +// Using alternate algorithms, as listed above. +var rng2 = seedrandom.xor4096('hello.') +console.log(rng2()); +``` + +Starting in version 3, when using via require('seedrandom'), the global +`Math.seedrandom` is no longer available. + + +Require.js usage +---------------- + +Similar to Node.js usage: + +``` +bower install seedrandom +``` + +``` +require(['seedrandom'], function(seedrandom) { + var rng = seedrandom('hello.'); + console.log(rng()); // Always 0.9282578795792454 +}); +``` + + +Network seeding +--------------- + +```html + + + + + + +``` + +Reseeding using user input +-------------------------- + +```js +var seed = Math.seedrandom(); // Use prng with an automatic seed. +document.write(Math.random()); // Pretty much unpredictable x. + +var rng = new Math.seedrandom(seed); // A new prng with the same seed. +document.write(rng()); // Repeat the 'unpredictable' x. + +function reseed(event, count) { // Define a custom entropy collector. + var t = []; + function w(e) { + t.push([e.pageX, e.pageY, +new Date]); + if (t.length < count) { return; } + document.removeEventListener(event, w); + Math.seedrandom(t, { entropy: true }); + } + document.addEventListener(event, w); +} +reseed('mousemove', 100); // Reseed after 100 mouse moves. +``` + +The "pass" option can be used to get both the prng and the seed. +The following returns both an autoseeded prng and the seed as an object, +without mutating Math.random: + +```js +var obj = Math.seedrandom(null, { pass: function(prng, seed) { + return { random: prng, seed: seed }; +}}); +``` + + +Saving and Restoring PRNG state +------------------------------- + +```js +var seedrandom = Math.seedrandom; +var saveable = seedrandom("secret-seed", {state: true}); +for (var j = 0; j < 1e5; ++j) saveable(); +var saved = saveable.state(); +var replica = seedrandom("", {state: saved}); +assert(replica() == saveable()); +``` + +In normal use the prng is opaque and its internal state cannot be accessed. +However, if the "state" option is specified, the prng gets a state() method +that returns a plain object the can be used to reconstruct a prng later in +the same state (by passing that saved object back as the state option). + + +Version notes +------------- + +The random number sequence is the same as version 1.0 for string seeds. + +* Version 2.0 changed the sequence for non-string seeds. +* Version 2.1 speeds seeding and uses window.crypto to autoseed if present. +* Version 2.2 alters non-crypto autoseeding to sweep up entropy from plugins. +* Version 2.3 adds support for "new", module loading, and a null seed arg. +* Version 2.3.1 adds a build environment, module packaging, and tests. +* Version 2.3.4 fixes bugs on IE8, and switches to MIT license. +* Version 2.3.6 adds a readable options object argument. +* Version 2.3.10 adds support for node.js crypto (contributed by ctd1500). +* Version 2.3.11 adds an option to load and save internal state. +* Version 2.4.0 adds implementations of several other fast PRNGs. +* Version 2.4.2 adds an implementation of Baagoe's very fast Alea PRNG. +* Version 2.4.3 ignores nodejs crypto when under browserify. +* Version 2.4.4 avoids strict mode problem with global this reference. +* Version 3.0.1 removes Math.seedrandom for require('seedrandom') users. +* Version 3.0.3 updates package.json for CDN entrypoints. +* Version 3.0.5 removes eval to avoid triggering content-security policy. + +The standard ARC4 key scheduler cycles short keys, which means that +seedrandom('ab') is equivalent to seedrandom('abab') and 'ababab'. +Therefore it is a good idea to add a terminator to avoid trivial +equivalences on short string seeds, e.g., Math.seedrandom(str + '\0'). +Starting with version 2.0, a terminator is added automatically for +non-string seeds, so seeding with the number 111 is the same as seeding +with '111\0'. + +When seedrandom() is called with zero args or a null seed, it uses a +seed drawn from the browser crypto object if present. If there is no +crypto support, seedrandom() uses the current time, the native rng, +and a walk of several DOM objects to collect a few bits of entropy. + +Each time the one- or two-argument forms of seedrandom are called, +entropy from the passed seed is accumulated in a pool to help generate +future seeds for the zero- and two-argument forms of seedrandom. + +On speed - This javascript implementation of Math.random() is several +times slower than the built-in Math.random() because it is not native +code, but that is typically fast enough. Some details (timings on +Chrome 25 on a 2010 vintage macbook): + +* seeded Math.random() - avg less than 0.0002 milliseconds per call +* seedrandom('explicit.') - avg less than 0.2 milliseconds per call +* seedrandom('explicit.', true) - avg less than 0.2 milliseconds per call +* seedrandom() with crypto - avg less than 0.2 milliseconds per call + +Autoseeding without crypto is somewhat slow, about 20-30 milliseconds on +a 2012 windows 7 1.5ghz i5 laptop, as seen on Firefox 19, IE 10, and Opera. +Seeded rng calls themselves are fast across these browsers, with slowest +numbers on Opera at about 0.0005 ms per seeded Math.random(). + + +LICENSE (MIT) +------------- + +Copyright 2019 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/bower.json b/24_10_22_faktorialis/node_modules/seedrandom/bower.json new file mode 100644 index 0000000..8e62b3a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/bower.json @@ -0,0 +1,16 @@ +{ + "name": "seedrandom", + "description": "Seeded random number generator for Javascript.", + "main": "seedrandom.js", + "license": "MIT", + "keywords": [ + "random", + "seed", + "crypto" + ], + "ignore": [], + "devDependencies": { + "qunit": "latest", + "requirejs": "latest" + } +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/component.json b/24_10_22_faktorialis/node_modules/seedrandom/component.json new file mode 100644 index 0000000..43fea29 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/component.json @@ -0,0 +1,10 @@ +{ + "name": "seedrandom", + "version": "3.0.0", + "description": "Seeded random number generator for Javascript", + "repository": "davidbau/seedrandom", + "main": "seedrandom.js", + "scripts": [ "seedrandom.js" ], + "keywords": [ "random", "seed", "crypto" ], + "license": "MIT" +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/coverage.json b/24_10_22_faktorialis/node_modules/seedrandom/coverage/coverage.json new file mode 100644 index 0000000..9e9657b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/coverage.json @@ -0,0 +1 @@ +{"/home/davidbau/git/seedrandom/seedrandom.js":{"path":"/home/davidbau/git/seedrandom/seedrandom.js","s":{"1":6,"2":6,"3":1,"4":23,"5":23,"6":23,"7":23,"8":23,"9":3694,"10":3694,"11":3918,"12":3918,"13":3918,"14":3694,"15":9252,"16":9252,"17":9252,"18":3694,"19":23,"20":1025,"21":23,"22":4100001,"23":23,"24":23,"25":23,"26":20,"27":4,"28":2,"29":4,"30":2,"31":20,"32":1,"33":1,"34":19,"35":1,"36":23,"37":23,"38":1,"39":23,"40":5888,"41":23,"42":5888,"43":5888,"44":23,"45":4108661,"46":4108661,"47":16436074,"48":16436074,"49":4108661,"50":4108661,"51":4108661,"52":1,"53":4,"54":4,"55":4,"56":4,"57":1,"58":174,"59":174,"60":8,"61":151,"62":151,"63":174,"64":1,"65":52,"66":52,"67":46040,"68":52,"69":1,"70":4,"71":4,"72":4,"73":3,"74":1,"75":1,"76":3,"77":1,"78":1,"79":1,"80":81,"81":6,"82":6,"83":6,"84":6,"85":6,"86":0,"87":0,"88":0,"89":0},"b":{"1":[1,22],"2":[22,11],"3":[2,21],"4":[4,17],"5":[23,21,20],"6":[4,16],"7":[2,2],"8":[1,19],"9":[4,19],"10":[1,22],"11":[8,166],"12":[174,56],"13":[8,166],"14":[29,137],"15":[3,1],"16":[4,3],"17":[1,1],"18":[1,0],"19":[6,0],"20":[6,6],"21":[0,0],"22":[0,0]},"f":{"1":6,"2":23,"3":3694,"4":1025,"5":4100001,"6":20,"7":2,"8":23,"9":4108661,"10":4,"11":174,"12":52,"13":4,"14":81,"15":0},"fnMap":{"1":{"name":"(anonymous_1)","line":25,"loc":{"start":{"line":25,"column":1},"end":{"line":25,"column":23}}},"2":{"name":"seedrandom","line":47,"loc":{"start":{"line":47,"column":0},"end":{"line":47,"column":45}}},"3":{"name":"(anonymous_3)","line":61,"loc":{"start":{"line":61,"column":13},"end":{"line":61,"column":24}}},"4":{"name":"(anonymous_4)","line":78,"loc":{"start":{"line":78,"column":15},"end":{"line":78,"column":26}}},"5":{"name":"(anonymous_5)","line":79,"loc":{"start":{"line":79,"column":15},"end":{"line":79,"column":26}}},"6":{"name":"(anonymous_6)","line":87,"loc":{"start":{"line":87,"column":6},"end":{"line":87,"column":48}}},"7":{"name":"(anonymous_7)","line":92,"loc":{"start":{"line":92,"column":23},"end":{"line":92,"column":34}}},"8":{"name":"ARC4","line":119,"loc":{"start":{"line":119,"column":0},"end":{"line":119,"column":19}}},"9":{"name":"(anonymous_9)","line":136,"loc":{"start":{"line":136,"column":10},"end":{"line":136,"column":26}}},"10":{"name":"copy","line":156,"loc":{"start":{"line":156,"column":0},"end":{"line":156,"column":20}}},"11":{"name":"flatten","line":167,"loc":{"start":{"line":167,"column":0},"end":{"line":167,"column":29}}},"12":{"name":"mixkey","line":182,"loc":{"start":{"line":182,"column":0},"end":{"line":182,"column":27}}},"13":{"name":"autoseed","line":196,"loc":{"start":{"line":196,"column":0},"end":{"line":196,"column":20}}},"14":{"name":"tostring","line":218,"loc":{"start":{"line":218,"column":0},"end":{"line":218,"column":21}}},"15":{"name":"(anonymous_15)","line":242,"loc":{"start":{"line":242,"column":9},"end":{"line":242,"column":20}}}},"statementMap":{"1":{"start":{"line":25,"column":0},"end":{"line":253,"column":2}},"2":{"start":{"line":32,"column":0},"end":{"line":41,"column":15}},"3":{"start":{"line":47,"column":0},"end":{"line":107,"column":1}},"4":{"start":{"line":48,"column":2},"end":{"line":48,"column":15}},"5":{"start":{"line":49,"column":2},"end":{"line":49,"column":68}},"6":{"start":{"line":52,"column":2},"end":{"line":54,"column":49}},"7":{"start":{"line":57,"column":2},"end":{"line":57,"column":27}},"8":{"start":{"line":61,"column":2},"end":{"line":76,"column":4}},"9":{"start":{"line":62,"column":4},"end":{"line":64,"column":14}},"10":{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},"11":{"start":{"line":66,"column":6},"end":{"line":66,"column":26}},"12":{"start":{"line":67,"column":6},"end":{"line":67,"column":17}},"13":{"start":{"line":68,"column":6},"end":{"line":68,"column":20}},"14":{"start":{"line":70,"column":4},"end":{"line":74,"column":5}},"15":{"start":{"line":71,"column":6},"end":{"line":71,"column":13}},"16":{"start":{"line":72,"column":6},"end":{"line":72,"column":13}},"17":{"start":{"line":73,"column":6},"end":{"line":73,"column":15}},"18":{"start":{"line":75,"column":4},"end":{"line":75,"column":23}},"19":{"start":{"line":78,"column":2},"end":{"line":78,"column":51}},"20":{"start":{"line":78,"column":28},"end":{"line":78,"column":49}},"21":{"start":{"line":79,"column":2},"end":{"line":79,"column":61}},"22":{"start":{"line":79,"column":28},"end":{"line":79,"column":59}},"23":{"start":{"line":80,"column":2},"end":{"line":80,"column":21}},"24":{"start":{"line":83,"column":2},"end":{"line":83,"column":33}},"25":{"start":{"line":86,"column":2},"end":{"line":106,"column":17}},"26":{"start":{"line":88,"column":8},"end":{"line":93,"column":9}},"27":{"start":{"line":90,"column":10},"end":{"line":90,"column":45}},"28":{"start":{"line":90,"column":25},"end":{"line":90,"column":43}},"29":{"start":{"line":92,"column":10},"end":{"line":92,"column":60}},"30":{"start":{"line":92,"column":36},"end":{"line":92,"column":58}},"31":{"start":{"line":97,"column":8},"end":{"line":101,"column":25}},"32":{"start":{"line":97,"column":28},"end":{"line":97,"column":49}},"33":{"start":{"line":97,"column":50},"end":{"line":97,"column":62}},"34":{"start":{"line":101,"column":13},"end":{"line":101,"column":25}},"35":{"start":{"line":119,"column":0},"end":{"line":150,"column":1}},"36":{"start":{"line":120,"column":2},"end":{"line":121,"column":59}},"37":{"start":{"line":124,"column":2},"end":{"line":124,"column":36}},"38":{"start":{"line":124,"column":17},"end":{"line":124,"column":34}},"39":{"start":{"line":127,"column":2},"end":{"line":129,"column":3}},"40":{"start":{"line":128,"column":4},"end":{"line":128,"column":15}},"41":{"start":{"line":130,"column":2},"end":{"line":133,"column":3}},"42":{"start":{"line":131,"column":4},"end":{"line":131,"column":60}},"43":{"start":{"line":132,"column":4},"end":{"line":132,"column":13}},"44":{"start":{"line":136,"column":2},"end":{"line":149,"column":12}},"45":{"start":{"line":138,"column":4},"end":{"line":139,"column":37}},"46":{"start":{"line":140,"column":4},"end":{"line":143,"column":5}},"47":{"start":{"line":141,"column":6},"end":{"line":141,"column":32}},"48":{"start":{"line":142,"column":6},"end":{"line":142,"column":78}},"49":{"start":{"line":144,"column":4},"end":{"line":144,"column":13}},"50":{"start":{"line":144,"column":14},"end":{"line":144,"column":23}},"51":{"start":{"line":145,"column":4},"end":{"line":145,"column":13}},"52":{"start":{"line":156,"column":0},"end":{"line":161,"column":1}},"53":{"start":{"line":157,"column":2},"end":{"line":157,"column":12}},"54":{"start":{"line":158,"column":2},"end":{"line":158,"column":12}},"55":{"start":{"line":159,"column":2},"end":{"line":159,"column":20}},"56":{"start":{"line":160,"column":2},"end":{"line":160,"column":11}},"57":{"start":{"line":167,"column":0},"end":{"line":175,"column":1}},"58":{"start":{"line":168,"column":2},"end":{"line":168,"column":44}},"59":{"start":{"line":169,"column":2},"end":{"line":173,"column":3}},"60":{"start":{"line":170,"column":4},"end":{"line":172,"column":5}},"61":{"start":{"line":171,"column":6},"end":{"line":171,"column":70}},"62":{"start":{"line":171,"column":12},"end":{"line":171,"column":55}},"63":{"start":{"line":174,"column":2},"end":{"line":174,"column":71}},"64":{"start":{"line":182,"column":0},"end":{"line":189,"column":1}},"65":{"start":{"line":183,"column":2},"end":{"line":183,"column":43}},"66":{"start":{"line":184,"column":2},"end":{"line":187,"column":3}},"67":{"start":{"line":185,"column":4},"end":{"line":186,"column":74}},"68":{"start":{"line":188,"column":2},"end":{"line":188,"column":23}},"69":{"start":{"line":196,"column":0},"end":{"line":212,"column":1}},"70":{"start":{"line":197,"column":2},"end":{"line":211,"column":3}},"71":{"start":{"line":198,"column":4},"end":{"line":198,"column":12}},"72":{"start":{"line":199,"column":4},"end":{"line":205,"column":5}},"73":{"start":{"line":201,"column":6},"end":{"line":201,"column":23}},"74":{"start":{"line":203,"column":6},"end":{"line":203,"column":34}},"75":{"start":{"line":204,"column":6},"end":{"line":204,"column":62}},"76":{"start":{"line":206,"column":4},"end":{"line":206,"column":25}},"77":{"start":{"line":208,"column":4},"end":{"line":209,"column":45}},"78":{"start":{"line":210,"column":4},"end":{"line":210,"column":71}},"79":{"start":{"line":218,"column":0},"end":{"line":220,"column":1}},"80":{"start":{"line":219,"column":2},"end":{"line":219,"column":41}},"81":{"start":{"line":229,"column":0},"end":{"line":229,"column":28}},"82":{"start":{"line":235,"column":0},"end":{"line":246,"column":1}},"83":{"start":{"line":236,"column":2},"end":{"line":236,"column":30}},"84":{"start":{"line":238,"column":2},"end":{"line":240,"column":17}},"85":{"start":{"line":239,"column":4},"end":{"line":239,"column":35}},"86":{"start":{"line":241,"column":7},"end":{"line":246,"column":1}},"87":{"start":{"line":242,"column":2},"end":{"line":242,"column":44}},"88":{"start":{"line":242,"column":22},"end":{"line":242,"column":40}},"89":{"start":{"line":245,"column":2},"end":{"line":245,"column":38}}},"branchMap":{"1":{"line":49,"type":"cond-expr","locations":[{"start":{"line":49,"column":32},"end":{"line":49,"column":49}},{"start":{"line":49,"column":53},"end":{"line":49,"column":66}}]},"2":{"line":49,"type":"binary-expr","locations":[{"start":{"line":49,"column":53},"end":{"line":49,"column":60}},{"start":{"line":49,"column":64},"end":{"line":49,"column":66}}]},"3":{"line":53,"type":"cond-expr","locations":[{"start":{"line":53,"column":22},"end":{"line":53,"column":44}},{"start":{"line":54,"column":4},"end":{"line":54,"column":38}}]},"4":{"line":54,"type":"cond-expr","locations":[{"start":{"line":54,"column":21},"end":{"line":54,"column":31}},{"start":{"line":54,"column":34},"end":{"line":54,"column":38}}]},"5":{"line":86,"type":"binary-expr","locations":[{"start":{"line":86,"column":10},"end":{"line":86,"column":22}},{"start":{"line":86,"column":26},"end":{"line":86,"column":34}},{"start":{"line":87,"column":6},"end":{"line":102,"column":7}}]},"6":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]},"7":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":10},"end":{"line":90,"column":10}},{"start":{"line":90,"column":10},"end":{"line":90,"column":10}}]},"8":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":8},"end":{"line":97,"column":8}},{"start":{"line":97,"column":8},"end":{"line":97,"column":8}}]},"9":{"line":105,"type":"cond-expr","locations":[{"start":{"line":105,"column":24},"end":{"line":105,"column":38}},{"start":{"line":105,"column":42},"end":{"line":105,"column":54}}]},"10":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":2},"end":{"line":124,"column":2}},{"start":{"line":124,"column":2},"end":{"line":124,"column":2}}]},"11":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":2},"end":{"line":169,"column":2}},{"start":{"line":169,"column":2},"end":{"line":169,"column":2}}]},"12":{"line":169,"type":"binary-expr","locations":[{"start":{"line":169,"column":6},"end":{"line":169,"column":11}},{"start":{"line":169,"column":15},"end":{"line":169,"column":30}}]},"13":{"line":174,"type":"cond-expr","locations":[{"start":{"line":174,"column":26},"end":{"line":174,"column":32}},{"start":{"line":174,"column":35},"end":{"line":174,"column":69}}]},"14":{"line":174,"type":"cond-expr","locations":[{"start":{"line":174,"column":53},"end":{"line":174,"column":56}},{"start":{"line":174,"column":59},"end":{"line":174,"column":69}}]},"15":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":4},"end":{"line":199,"column":4}},{"start":{"line":199,"column":4},"end":{"line":199,"column":4}}]},"16":{"line":199,"type":"binary-expr","locations":[{"start":{"line":199,"column":8},"end":{"line":199,"column":18}},{"start":{"line":199,"column":23},"end":{"line":199,"column":51}}]},"17":{"line":204,"type":"binary-expr","locations":[{"start":{"line":204,"column":7},"end":{"line":204,"column":20}},{"start":{"line":204,"column":24},"end":{"line":204,"column":39}}]},"18":{"line":209,"type":"binary-expr","locations":[{"start":{"line":209,"column":18},"end":{"line":209,"column":25}},{"start":{"line":209,"column":29},"end":{"line":209,"column":44}}]},"19":{"line":235,"type":"if","locations":[{"start":{"line":235,"column":0},"end":{"line":235,"column":0}},{"start":{"line":235,"column":0},"end":{"line":235,"column":0}}]},"20":{"line":235,"type":"binary-expr","locations":[{"start":{"line":235,"column":4},"end":{"line":235,"column":31}},{"start":{"line":235,"column":35},"end":{"line":235,"column":49}}]},"21":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":7},"end":{"line":241,"column":7}},{"start":{"line":241,"column":7},"end":{"line":241,"column":7}}]},"22":{"line":241,"type":"binary-expr","locations":[{"start":{"line":241,"column":11},"end":{"line":241,"column":40}},{"start":{"line":241,"column":44},"end":{"line":241,"column":54}}]}}},"/home/davidbau/git/seedrandom/lib/xor128.js":{"path":"/home/davidbau/git/seedrandom/lib/xor128.js","s":{"1":1,"2":1,"3":3,"4":3,"5":3,"6":3,"7":3,"8":3,"9":4105327,"10":4105327,"11":4105327,"12":4105327,"13":4105327,"14":3,"15":2,"16":1,"17":3,"18":198,"19":198,"20":1,"21":2,"22":2,"23":2,"24":2,"25":2,"26":1,"27":3,"28":4102054,"29":3,"30":1025,"31":1025,"32":1025,"33":3,"34":3,"35":3,"36":2,"37":1,"38":2,"39":1,"40":3,"41":1,"42":1,"43":0,"44":0,"45":0,"46":0},"b":{"1":[2,1],"2":[3,2],"3":[2,1],"4":[1,1],"5":[1,0],"6":[1,1],"7":[0,0],"8":[0,0],"9":[1,1],"10":[1,0]},"f":{"1":1,"2":3,"3":4105327,"4":2,"5":3,"6":4102054,"7":1025,"8":1,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":34}}},"2":{"name":"XorGen","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":12},"end":{"line":15,"column":23}}},"4":{"name":"copy","line":38,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":20}}},"5":{"name":"impl","line":46,"loc":{"start":{"line":46,"column":0},"end":{"line":46,"column":26}}},"6":{"name":"(anonymous_6)","line":49,"loc":{"start":{"line":49,"column":13},"end":{"line":49,"column":24}}},"7":{"name":"(anonymous_7)","line":50,"loc":{"start":{"line":50,"column":16},"end":{"line":50,"column":27}}},"8":{"name":"(anonymous_8)","line":62,"loc":{"start":{"line":62,"column":17},"end":{"line":62,"column":28}}},"9":{"name":"(anonymous_9)","line":70,"loc":{"start":{"line":70,"column":9},"end":{"line":70,"column":20}}}},"statementMap":{"1":{"start":{"line":4,"column":0},"end":{"line":79,"column":2}},"2":{"start":{"line":6,"column":0},"end":{"line":36,"column":1}},"3":{"start":{"line":7,"column":2},"end":{"line":7,"column":30}},"4":{"start":{"line":9,"column":2},"end":{"line":9,"column":11}},"5":{"start":{"line":10,"column":2},"end":{"line":10,"column":11}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":11}},"7":{"start":{"line":12,"column":2},"end":{"line":12,"column":11}},"8":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"9":{"start":{"line":16,"column":4},"end":{"line":16,"column":32}},"10":{"start":{"line":17,"column":4},"end":{"line":17,"column":16}},"11":{"start":{"line":18,"column":4},"end":{"line":18,"column":16}},"12":{"start":{"line":19,"column":4},"end":{"line":19,"column":16}},"13":{"start":{"line":20,"column":4},"end":{"line":20,"column":49}},"14":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"15":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"16":{"start":{"line":28,"column":4},"end":{"line":28,"column":20}},"17":{"start":{"line":32,"column":2},"end":{"line":35,"column":3}},"18":{"start":{"line":33,"column":4},"end":{"line":33,"column":38}},"19":{"start":{"line":34,"column":4},"end":{"line":34,"column":14}},"20":{"start":{"line":38,"column":0},"end":{"line":44,"column":1}},"21":{"start":{"line":39,"column":2},"end":{"line":39,"column":12}},"22":{"start":{"line":40,"column":2},"end":{"line":40,"column":12}},"23":{"start":{"line":41,"column":2},"end":{"line":41,"column":12}},"24":{"start":{"line":42,"column":2},"end":{"line":42,"column":12}},"25":{"start":{"line":43,"column":2},"end":{"line":43,"column":11}},"26":{"start":{"line":46,"column":0},"end":{"line":65,"column":1}},"27":{"start":{"line":47,"column":2},"end":{"line":49,"column":68}},"28":{"start":{"line":49,"column":26},"end":{"line":49,"column":65}},"29":{"start":{"line":50,"column":2},"end":{"line":57,"column":4}},"30":{"start":{"line":51,"column":4},"end":{"line":55,"column":27}},"31":{"start":{"line":52,"column":6},"end":{"line":54,"column":43}},"32":{"start":{"line":56,"column":4},"end":{"line":56,"column":18}},"33":{"start":{"line":58,"column":2},"end":{"line":58,"column":23}},"34":{"start":{"line":59,"column":2},"end":{"line":59,"column":20}},"35":{"start":{"line":60,"column":2},"end":{"line":63,"column":3}},"36":{"start":{"line":61,"column":4},"end":{"line":61,"column":51}},"37":{"start":{"line":61,"column":35},"end":{"line":61,"column":51}},"38":{"start":{"line":62,"column":4},"end":{"line":62,"column":52}},"39":{"start":{"line":62,"column":30},"end":{"line":62,"column":50}},"40":{"start":{"line":64,"column":2},"end":{"line":64,"column":14}},"41":{"start":{"line":67,"column":0},"end":{"line":73,"column":1}},"42":{"start":{"line":68,"column":2},"end":{"line":68,"column":24}},"43":{"start":{"line":69,"column":7},"end":{"line":73,"column":1}},"44":{"start":{"line":70,"column":2},"end":{"line":70,"column":38}},"45":{"start":{"line":70,"column":22},"end":{"line":70,"column":34}},"46":{"start":{"line":72,"column":2},"end":{"line":72,"column":21}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":23,"column":2}},{"start":{"line":23,"column":2},"end":{"line":23,"column":2}}]},"2":{"line":48,"type":"binary-expr","locations":[{"start":{"line":48,"column":14},"end":{"line":48,"column":18}},{"start":{"line":48,"column":22},"end":{"line":48,"column":32}}]},"3":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":60,"column":2}},{"start":{"line":60,"column":2},"end":{"line":60,"column":2}}]},"4":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":4},"end":{"line":61,"column":4}},{"start":{"line":61,"column":4},"end":{"line":61,"column":4}}]},"5":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":0},"end":{"line":67,"column":0}},{"start":{"line":67,"column":0},"end":{"line":67,"column":0}}]},"6":{"line":67,"type":"binary-expr","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":10}},{"start":{"line":67,"column":14},"end":{"line":67,"column":28}}]},"7":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":7},"end":{"line":69,"column":7}},{"start":{"line":69,"column":7},"end":{"line":69,"column":7}}]},"8":{"line":69,"type":"binary-expr","locations":[{"start":{"line":69,"column":11},"end":{"line":69,"column":17}},{"start":{"line":69,"column":21},"end":{"line":69,"column":31}}]},"9":{"line":77,"type":"binary-expr","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":29}},{"start":{"line":77,"column":33},"end":{"line":77,"column":39}}]},"10":{"line":78,"type":"binary-expr","locations":[{"start":{"line":78,"column":2},"end":{"line":78,"column":31}},{"start":{"line":78,"column":35},"end":{"line":78,"column":41}}]}}},"/home/davidbau/git/seedrandom/lib/xorwow.js":{"path":"/home/davidbau/git/seedrandom/lib/xorwow.js","s":{"1":1,"2":1,"3":3,"4":3,"5":4105327,"6":4105327,"7":4105327,"8":4105327,"9":4105327,"10":4105327,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":2,"18":1,"19":3,"20":198,"21":198,"22":3,"23":198,"24":1,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":1,"33":3,"34":4102054,"35":3,"36":1025,"37":1025,"38":1025,"39":3,"40":3,"41":3,"42":2,"43":1,"44":2,"45":1,"46":3,"47":1,"48":1,"49":0,"50":0,"51":0,"52":0},"b":{"1":[2,1],"2":[3,195],"3":[3,2],"4":[2,1],"5":[1,1],"6":[1,0],"7":[1,1],"8":[0,0],"9":[0,0],"10":[1,1],"11":[1,0]},"f":{"1":1,"2":3,"3":4105327,"4":2,"5":3,"6":4102054,"7":1025,"8":1,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":34}}},"2":{"name":"XorGen","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":23}}},"4":{"name":"copy","line":41,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":20}}},"5":{"name":"impl","line":51,"loc":{"start":{"line":51,"column":0},"end":{"line":51,"column":26}}},"6":{"name":"(anonymous_6)","line":54,"loc":{"start":{"line":54,"column":13},"end":{"line":54,"column":24}}},"7":{"name":"(anonymous_7)","line":55,"loc":{"start":{"line":55,"column":16},"end":{"line":55,"column":27}}},"8":{"name":"(anonymous_8)","line":67,"loc":{"start":{"line":67,"column":17},"end":{"line":67,"column":28}}},"9":{"name":"(anonymous_9)","line":75,"loc":{"start":{"line":75,"column":9},"end":{"line":75,"column":20}}}},"statementMap":{"1":{"start":{"line":4,"column":0},"end":{"line":84,"column":2}},"2":{"start":{"line":6,"column":0},"end":{"line":39,"column":1}},"3":{"start":{"line":7,"column":2},"end":{"line":7,"column":30}},"4":{"start":{"line":10,"column":2},"end":{"line":15,"column":4}},"5":{"start":{"line":11,"column":4},"end":{"line":11,"column":34}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":16}},"7":{"start":{"line":12,"column":17},"end":{"line":12,"column":29}},"8":{"start":{"line":12,"column":30},"end":{"line":12,"column":42}},"9":{"start":{"line":12,"column":43},"end":{"line":12,"column":55}},"10":{"start":{"line":13,"column":4},"end":{"line":14,"column":58}},"11":{"start":{"line":17,"column":2},"end":{"line":17,"column":11}},"12":{"start":{"line":18,"column":2},"end":{"line":18,"column":11}},"13":{"start":{"line":19,"column":2},"end":{"line":19,"column":11}},"14":{"start":{"line":20,"column":2},"end":{"line":20,"column":11}},"15":{"start":{"line":21,"column":2},"end":{"line":21,"column":11}},"16":{"start":{"line":23,"column":2},"end":{"line":29,"column":3}},"17":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"18":{"start":{"line":28,"column":4},"end":{"line":28,"column":20}},"19":{"start":{"line":32,"column":2},"end":{"line":38,"column":3}},"20":{"start":{"line":33,"column":4},"end":{"line":33,"column":38}},"21":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"22":{"start":{"line":35,"column":6},"end":{"line":35,"column":37}},"23":{"start":{"line":37,"column":4},"end":{"line":37,"column":14}},"24":{"start":{"line":41,"column":0},"end":{"line":49,"column":1}},"25":{"start":{"line":42,"column":2},"end":{"line":42,"column":12}},"26":{"start":{"line":43,"column":2},"end":{"line":43,"column":12}},"27":{"start":{"line":44,"column":2},"end":{"line":44,"column":12}},"28":{"start":{"line":45,"column":2},"end":{"line":45,"column":12}},"29":{"start":{"line":46,"column":2},"end":{"line":46,"column":12}},"30":{"start":{"line":47,"column":2},"end":{"line":47,"column":12}},"31":{"start":{"line":48,"column":2},"end":{"line":48,"column":11}},"32":{"start":{"line":51,"column":0},"end":{"line":70,"column":1}},"33":{"start":{"line":52,"column":2},"end":{"line":54,"column":68}},"34":{"start":{"line":54,"column":26},"end":{"line":54,"column":65}},"35":{"start":{"line":55,"column":2},"end":{"line":62,"column":4}},"36":{"start":{"line":56,"column":4},"end":{"line":60,"column":27}},"37":{"start":{"line":57,"column":6},"end":{"line":59,"column":43}},"38":{"start":{"line":61,"column":4},"end":{"line":61,"column":18}},"39":{"start":{"line":63,"column":2},"end":{"line":63,"column":23}},"40":{"start":{"line":64,"column":2},"end":{"line":64,"column":20}},"41":{"start":{"line":65,"column":2},"end":{"line":68,"column":3}},"42":{"start":{"line":66,"column":4},"end":{"line":66,"column":51}},"43":{"start":{"line":66,"column":35},"end":{"line":66,"column":51}},"44":{"start":{"line":67,"column":4},"end":{"line":67,"column":52}},"45":{"start":{"line":67,"column":30},"end":{"line":67,"column":50}},"46":{"start":{"line":69,"column":2},"end":{"line":69,"column":14}},"47":{"start":{"line":72,"column":0},"end":{"line":78,"column":1}},"48":{"start":{"line":73,"column":2},"end":{"line":73,"column":24}},"49":{"start":{"line":74,"column":7},"end":{"line":78,"column":1}},"50":{"start":{"line":75,"column":2},"end":{"line":75,"column":38}},"51":{"start":{"line":75,"column":22},"end":{"line":75,"column":34}},"52":{"start":{"line":77,"column":2},"end":{"line":77,"column":21}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":23,"column":2}},{"start":{"line":23,"column":2},"end":{"line":23,"column":2}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"3":{"line":53,"type":"binary-expr","locations":[{"start":{"line":53,"column":14},"end":{"line":53,"column":18}},{"start":{"line":53,"column":22},"end":{"line":53,"column":32}}]},"4":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":2},"end":{"line":65,"column":2}},{"start":{"line":65,"column":2},"end":{"line":65,"column":2}}]},"5":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]},"6":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":0},"end":{"line":72,"column":0}},{"start":{"line":72,"column":0},"end":{"line":72,"column":0}}]},"7":{"line":72,"type":"binary-expr","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":10}},{"start":{"line":72,"column":14},"end":{"line":72,"column":28}}]},"8":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":7},"end":{"line":74,"column":7}},{"start":{"line":74,"column":7},"end":{"line":74,"column":7}}]},"9":{"line":74,"type":"binary-expr","locations":[{"start":{"line":74,"column":11},"end":{"line":74,"column":17}},{"start":{"line":74,"column":21},"end":{"line":74,"column":31}}]},"10":{"line":82,"type":"binary-expr","locations":[{"start":{"line":82,"column":2},"end":{"line":82,"column":29}},{"start":{"line":82,"column":33},"end":{"line":82,"column":39}}]},"11":{"line":83,"type":"binary-expr","locations":[{"start":{"line":83,"column":2},"end":{"line":83,"column":31}},{"start":{"line":83,"column":35},"end":{"line":83,"column":41}}]}}},"/home/davidbau/git/seedrandom/lib/xorshift7.js":{"path":"/home/davidbau/git/seedrandom/lib/xorshift7.js","s":{"1":1,"2":1,"3":3,"4":3,"5":4105897,"6":4105897,"7":4105897,"8":4105897,"9":4105897,"10":4105897,"11":4105897,"12":4105897,"13":4105897,"14":4105897,"15":4105897,"16":4105897,"17":4105897,"18":4105897,"19":4105897,"20":4105897,"21":1,"22":3,"23":3,"24":2,"25":1,"26":1,"27":6,"28":3,"29":16,"30":3,"31":3,"32":2,"33":1,"34":3,"35":3,"36":3,"37":768,"38":3,"39":1,"40":2,"41":2,"42":2,"43":1,"44":3,"45":0,"46":3,"47":4102054,"48":3,"49":1025,"50":1025,"51":1025,"52":3,"53":3,"54":3,"55":2,"56":1,"57":2,"58":1,"59":3,"60":1,"61":1,"62":0,"63":0,"64":0,"65":0},"b":{"1":[2,1],"2":[19,17],"3":[2,1],"4":[0,3],"5":[3,2],"6":[2,1],"7":[1,1],"8":[1,0],"9":[1,1],"10":[0,0],"11":[0,0],"12":[1,1],"13":[1,0]},"f":{"1":1,"2":3,"3":4105897,"4":3,"5":2,"6":3,"7":4102054,"8":1025,"9":1,"10":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":1},"end":{"line":6,"column":34}}},"2":{"name":"XorGen","line":8,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":22}}},"3":{"name":"(anonymous_3)","line":12,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":23}}},"4":{"name":"init","line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":26}}},"5":{"name":"copy","line":56,"loc":{"start":{"line":56,"column":0},"end":{"line":56,"column":20}}},"6":{"name":"impl","line":62,"loc":{"start":{"line":62,"column":0},"end":{"line":62,"column":26}}},"7":{"name":"(anonymous_7)","line":66,"loc":{"start":{"line":66,"column":13},"end":{"line":66,"column":24}}},"8":{"name":"(anonymous_8)","line":67,"loc":{"start":{"line":67,"column":16},"end":{"line":67,"column":27}}},"9":{"name":"(anonymous_9)","line":79,"loc":{"start":{"line":79,"column":17},"end":{"line":79,"column":28}}},"10":{"name":"(anonymous_10)","line":87,"loc":{"start":{"line":87,"column":9},"end":{"line":87,"column":20}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":96,"column":2}},"2":{"start":{"line":8,"column":0},"end":{"line":54,"column":1}},"3":{"start":{"line":9,"column":2},"end":{"line":9,"column":16}},"4":{"start":{"line":12,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":14,"column":4},"end":{"line":14,"column":36}},"6":{"start":{"line":15,"column":4},"end":{"line":15,"column":13}},"7":{"start":{"line":15,"column":14},"end":{"line":15,"column":29}},"8":{"start":{"line":15,"column":30},"end":{"line":15,"column":48}},"9":{"start":{"line":16,"column":4},"end":{"line":16,"column":23}},"10":{"start":{"line":16,"column":24},"end":{"line":16,"column":44}},"11":{"start":{"line":17,"column":4},"end":{"line":17,"column":23}},"12":{"start":{"line":17,"column":24},"end":{"line":17,"column":43}},"13":{"start":{"line":18,"column":4},"end":{"line":18,"column":23}},"14":{"start":{"line":18,"column":24},"end":{"line":18,"column":42}},"15":{"start":{"line":19,"column":4},"end":{"line":19,"column":23}},"16":{"start":{"line":19,"column":24},"end":{"line":19,"column":42}},"17":{"start":{"line":19,"column":43},"end":{"line":19,"column":61}},"18":{"start":{"line":20,"column":4},"end":{"line":20,"column":13}},"19":{"start":{"line":21,"column":4},"end":{"line":21,"column":23}},"20":{"start":{"line":22,"column":4},"end":{"line":22,"column":13}},"21":{"start":{"line":25,"column":2},"end":{"line":51,"column":3}},"22":{"start":{"line":26,"column":4},"end":{"line":26,"column":21}},"23":{"start":{"line":28,"column":4},"end":{"line":38,"column":5}},"24":{"start":{"line":30,"column":6},"end":{"line":30,"column":22}},"25":{"start":{"line":33,"column":6},"end":{"line":33,"column":23}},"26":{"start":{"line":34,"column":6},"end":{"line":37,"column":7}},"27":{"start":{"line":35,"column":8},"end":{"line":36,"column":56}},"28":{"start":{"line":40,"column":4},"end":{"line":40,"column":35}},"29":{"start":{"line":40,"column":25},"end":{"line":40,"column":35}},"30":{"start":{"line":41,"column":4},"end":{"line":41,"column":42}},"31":{"start":{"line":42,"column":4},"end":{"line":42,"column":45}},"32":{"start":{"line":42,"column":16},"end":{"line":42,"column":30}},"33":{"start":{"line":42,"column":36},"end":{"line":42,"column":45}},"34":{"start":{"line":44,"column":4},"end":{"line":44,"column":13}},"35":{"start":{"line":45,"column":4},"end":{"line":45,"column":13}},"36":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"37":{"start":{"line":49,"column":6},"end":{"line":49,"column":16}},"38":{"start":{"line":53,"column":2},"end":{"line":53,"column":17}},"39":{"start":{"line":56,"column":0},"end":{"line":60,"column":1}},"40":{"start":{"line":57,"column":2},"end":{"line":57,"column":20}},"41":{"start":{"line":58,"column":2},"end":{"line":58,"column":12}},"42":{"start":{"line":59,"column":2},"end":{"line":59,"column":11}},"43":{"start":{"line":62,"column":0},"end":{"line":82,"column":1}},"44":{"start":{"line":63,"column":2},"end":{"line":63,"column":39}},"45":{"start":{"line":63,"column":20},"end":{"line":63,"column":39}},"46":{"start":{"line":64,"column":2},"end":{"line":66,"column":68}},"47":{"start":{"line":66,"column":26},"end":{"line":66,"column":65}},"48":{"start":{"line":67,"column":2},"end":{"line":74,"column":4}},"49":{"start":{"line":68,"column":4},"end":{"line":72,"column":27}},"50":{"start":{"line":69,"column":6},"end":{"line":71,"column":43}},"51":{"start":{"line":73,"column":4},"end":{"line":73,"column":18}},"52":{"start":{"line":75,"column":2},"end":{"line":75,"column":23}},"53":{"start":{"line":76,"column":2},"end":{"line":76,"column":20}},"54":{"start":{"line":77,"column":2},"end":{"line":80,"column":3}},"55":{"start":{"line":78,"column":4},"end":{"line":78,"column":33}},"56":{"start":{"line":78,"column":17},"end":{"line":78,"column":33}},"57":{"start":{"line":79,"column":4},"end":{"line":79,"column":52}},"58":{"start":{"line":79,"column":30},"end":{"line":79,"column":50}},"59":{"start":{"line":81,"column":2},"end":{"line":81,"column":14}},"60":{"start":{"line":84,"column":0},"end":{"line":90,"column":1}},"61":{"start":{"line":85,"column":2},"end":{"line":85,"column":24}},"62":{"start":{"line":86,"column":7},"end":{"line":90,"column":1}},"63":{"start":{"line":87,"column":2},"end":{"line":87,"column":38}},"64":{"start":{"line":87,"column":22},"end":{"line":87,"column":34}},"65":{"start":{"line":89,"column":2},"end":{"line":89,"column":24}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":28,"column":4}},{"start":{"line":28,"column":4},"end":{"line":28,"column":4}}]},"2":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":16},"end":{"line":41,"column":21}},{"start":{"line":41,"column":25},"end":{"line":41,"column":35}}]},"3":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"4":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":2},"end":{"line":63,"column":2}},{"start":{"line":63,"column":2},"end":{"line":63,"column":2}}]},"5":{"line":65,"type":"binary-expr","locations":[{"start":{"line":65,"column":14},"end":{"line":65,"column":18}},{"start":{"line":65,"column":22},"end":{"line":65,"column":32}}]},"6":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":2},"end":{"line":77,"column":2}},{"start":{"line":77,"column":2},"end":{"line":77,"column":2}}]},"7":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":78,"column":4}},{"start":{"line":78,"column":4},"end":{"line":78,"column":4}}]},"8":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":0},"end":{"line":84,"column":0}},{"start":{"line":84,"column":0},"end":{"line":84,"column":0}}]},"9":{"line":84,"type":"binary-expr","locations":[{"start":{"line":84,"column":4},"end":{"line":84,"column":10}},{"start":{"line":84,"column":14},"end":{"line":84,"column":28}}]},"10":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":7},"end":{"line":86,"column":7}},{"start":{"line":86,"column":7},"end":{"line":86,"column":7}}]},"11":{"line":86,"type":"binary-expr","locations":[{"start":{"line":86,"column":11},"end":{"line":86,"column":17}},{"start":{"line":86,"column":21},"end":{"line":86,"column":31}}]},"12":{"line":94,"type":"binary-expr","locations":[{"start":{"line":94,"column":2},"end":{"line":94,"column":29}},{"start":{"line":94,"column":33},"end":{"line":94,"column":39}}]},"13":{"line":95,"type":"binary-expr","locations":[{"start":{"line":95,"column":2},"end":{"line":95,"column":31}},{"start":{"line":95,"column":35},"end":{"line":95,"column":41}}]}}},"/home/davidbau/git/seedrandom/lib/xor4096.js":{"path":"/home/davidbau/git/seedrandom/lib/xor4096.js","s":{"1":1,"2":1,"3":3,"4":3,"5":4105129,"6":4105129,"7":4105129,"8":4105129,"9":4105129,"10":4105129,"11":4105129,"12":4105129,"13":4105129,"14":4105129,"15":4105129,"16":1,"17":3,"18":3,"19":2,"20":2,"21":1,"22":1,"23":1,"24":3,"25":480,"26":160,"27":480,"28":3,"29":480,"30":480,"31":480,"32":480,"33":480,"34":384,"35":384,"36":384,"37":3,"38":0,"39":3,"40":3,"41":1536,"42":1536,"43":1536,"44":1536,"45":1536,"46":1536,"47":1536,"48":3,"49":3,"50":3,"51":3,"52":1,"53":2,"54":2,"55":2,"56":2,"57":1,"58":3,"59":0,"60":3,"61":4102054,"62":3,"63":1025,"64":1025,"65":1025,"66":3,"67":3,"68":3,"69":2,"70":1,"71":2,"72":1,"73":3,"74":1,"75":1,"76":0,"77":0,"78":0,"79":0},"b":{"1":[2,1],"2":[160,320],"3":[3,477],"4":[384,96],"5":[0,384],"6":[0,3],"7":[0,0,0],"8":[0,3],"9":[3,2],"10":[2,1],"11":[1,1],"12":[1,0],"13":[1,1],"14":[0,0],"15":[0,0],"16":[1,1],"17":[1,0]},"f":{"1":1,"2":3,"3":4105129,"4":3,"5":2,"6":3,"7":4102054,"8":1025,"9":1,"10":0},"fnMap":{"1":{"name":"(anonymous_1)","line":26,"loc":{"start":{"line":26,"column":1},"end":{"line":26,"column":34}}},"2":{"name":"XorGen","line":28,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":22}}},"3":{"name":"(anonymous_3)","line":32,"loc":{"start":{"line":32,"column":12},"end":{"line":32,"column":23}}},"4":{"name":"init","line":51,"loc":{"start":{"line":51,"column":2},"end":{"line":51,"column":26}}},"5":{"name":"copy","line":105,"loc":{"start":{"line":105,"column":0},"end":{"line":105,"column":20}}},"6":{"name":"impl","line":112,"loc":{"start":{"line":112,"column":0},"end":{"line":112,"column":26}}},"7":{"name":"(anonymous_7)","line":116,"loc":{"start":{"line":116,"column":13},"end":{"line":116,"column":24}}},"8":{"name":"(anonymous_8)","line":117,"loc":{"start":{"line":117,"column":16},"end":{"line":117,"column":27}}},"9":{"name":"(anonymous_9)","line":129,"loc":{"start":{"line":129,"column":17},"end":{"line":129,"column":28}}},"10":{"name":"(anonymous_10)","line":137,"loc":{"start":{"line":137,"column":9},"end":{"line":137,"column":20}}}},"statementMap":{"1":{"start":{"line":26,"column":0},"end":{"line":146,"column":2}},"2":{"start":{"line":28,"column":0},"end":{"line":103,"column":1}},"3":{"start":{"line":29,"column":2},"end":{"line":29,"column":16}},"4":{"start":{"line":32,"column":2},"end":{"line":49,"column":4}},"5":{"start":{"line":33,"column":4},"end":{"line":34,"column":33}},"6":{"start":{"line":36,"column":4},"end":{"line":36,"column":36}},"7":{"start":{"line":38,"column":4},"end":{"line":38,"column":26}},"8":{"start":{"line":39,"column":4},"end":{"line":39,"column":31}},"9":{"start":{"line":40,"column":4},"end":{"line":40,"column":17}},"10":{"start":{"line":41,"column":4},"end":{"line":41,"column":17}},"11":{"start":{"line":42,"column":4},"end":{"line":42,"column":18}},"12":{"start":{"line":43,"column":4},"end":{"line":43,"column":18}},"13":{"start":{"line":45,"column":4},"end":{"line":45,"column":21}},"14":{"start":{"line":46,"column":4},"end":{"line":46,"column":13}},"15":{"start":{"line":48,"column":4},"end":{"line":48,"column":38}},"16":{"start":{"line":51,"column":2},"end":{"line":100,"column":3}},"17":{"start":{"line":52,"column":4},"end":{"line":52,"column":43}},"18":{"start":{"line":53,"column":4},"end":{"line":62,"column":5}},"19":{"start":{"line":55,"column":6},"end":{"line":55,"column":15}},"20":{"start":{"line":56,"column":6},"end":{"line":56,"column":18}},"21":{"start":{"line":59,"column":6},"end":{"line":59,"column":25}},"22":{"start":{"line":60,"column":6},"end":{"line":60,"column":12}},"23":{"start":{"line":61,"column":6},"end":{"line":61,"column":43}},"24":{"start":{"line":64,"column":4},"end":{"line":78,"column":5}},"25":{"start":{"line":66,"column":6},"end":{"line":66,"column":61}},"26":{"start":{"line":66,"column":16},"end":{"line":66,"column":61}},"27":{"start":{"line":68,"column":6},"end":{"line":68,"column":25}},"28":{"start":{"line":68,"column":19},"end":{"line":68,"column":25}},"29":{"start":{"line":69,"column":6},"end":{"line":69,"column":19}},"30":{"start":{"line":70,"column":6},"end":{"line":70,"column":20}},"31":{"start":{"line":71,"column":6},"end":{"line":71,"column":18}},"32":{"start":{"line":72,"column":6},"end":{"line":72,"column":20}},"33":{"start":{"line":73,"column":6},"end":{"line":77,"column":7}},"34":{"start":{"line":74,"column":8},"end":{"line":74,"column":33}},"35":{"start":{"line":75,"column":8},"end":{"line":75,"column":36}},"36":{"start":{"line":76,"column":8},"end":{"line":76,"column":33}},"37":{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},"38":{"start":{"line":81,"column":6},"end":{"line":81,"column":47}},"39":{"start":{"line":86,"column":4},"end":{"line":86,"column":12}},"40":{"start":{"line":87,"column":4},"end":{"line":95,"column":5}},"41":{"start":{"line":88,"column":6},"end":{"line":88,"column":28}},"42":{"start":{"line":89,"column":6},"end":{"line":89,"column":33}},"43":{"start":{"line":90,"column":6},"end":{"line":90,"column":19}},"44":{"start":{"line":91,"column":6},"end":{"line":91,"column":19}},"45":{"start":{"line":92,"column":6},"end":{"line":92,"column":20}},"46":{"start":{"line":93,"column":6},"end":{"line":93,"column":20}},"47":{"start":{"line":94,"column":6},"end":{"line":94,"column":19}},"48":{"start":{"line":97,"column":4},"end":{"line":97,"column":13}},"49":{"start":{"line":98,"column":4},"end":{"line":98,"column":13}},"50":{"start":{"line":99,"column":4},"end":{"line":99,"column":13}},"51":{"start":{"line":102,"column":2},"end":{"line":102,"column":17}},"52":{"start":{"line":105,"column":0},"end":{"line":110,"column":1}},"53":{"start":{"line":106,"column":2},"end":{"line":106,"column":12}},"54":{"start":{"line":107,"column":2},"end":{"line":107,"column":12}},"55":{"start":{"line":108,"column":2},"end":{"line":108,"column":20}},"56":{"start":{"line":109,"column":2},"end":{"line":109,"column":11}},"57":{"start":{"line":112,"column":0},"end":{"line":132,"column":1}},"58":{"start":{"line":113,"column":2},"end":{"line":113,"column":39}},"59":{"start":{"line":113,"column":20},"end":{"line":113,"column":39}},"60":{"start":{"line":114,"column":2},"end":{"line":116,"column":68}},"61":{"start":{"line":116,"column":26},"end":{"line":116,"column":65}},"62":{"start":{"line":117,"column":2},"end":{"line":124,"column":4}},"63":{"start":{"line":118,"column":4},"end":{"line":122,"column":27}},"64":{"start":{"line":119,"column":6},"end":{"line":121,"column":43}},"65":{"start":{"line":123,"column":4},"end":{"line":123,"column":18}},"66":{"start":{"line":125,"column":2},"end":{"line":125,"column":23}},"67":{"start":{"line":126,"column":2},"end":{"line":126,"column":20}},"68":{"start":{"line":127,"column":2},"end":{"line":130,"column":3}},"69":{"start":{"line":128,"column":4},"end":{"line":128,"column":33}},"70":{"start":{"line":128,"column":17},"end":{"line":128,"column":33}},"71":{"start":{"line":129,"column":4},"end":{"line":129,"column":52}},"72":{"start":{"line":129,"column":30},"end":{"line":129,"column":50}},"73":{"start":{"line":131,"column":2},"end":{"line":131,"column":14}},"74":{"start":{"line":134,"column":0},"end":{"line":140,"column":1}},"75":{"start":{"line":135,"column":2},"end":{"line":135,"column":24}},"76":{"start":{"line":136,"column":7},"end":{"line":140,"column":1}},"77":{"start":{"line":137,"column":2},"end":{"line":137,"column":38}},"78":{"start":{"line":137,"column":22},"end":{"line":137,"column":34}},"79":{"start":{"line":139,"column":2},"end":{"line":139,"column":22}}},"branchMap":{"1":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":4},"end":{"line":53,"column":4}},{"start":{"line":53,"column":4},"end":{"line":53,"column":4}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":6},"end":{"line":66,"column":6}},{"start":{"line":66,"column":6},"end":{"line":66,"column":6}}]},"3":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":6},"end":{"line":68,"column":6}},{"start":{"line":68,"column":6},"end":{"line":68,"column":6}}]},"4":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":6},"end":{"line":73,"column":6}},{"start":{"line":73,"column":6},"end":{"line":73,"column":6}}]},"5":{"line":76,"type":"cond-expr","locations":[{"start":{"line":76,"column":23},"end":{"line":76,"column":28}},{"start":{"line":76,"column":31},"end":{"line":76,"column":32}}]},"6":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"7":{"line":81,"type":"binary-expr","locations":[{"start":{"line":81,"column":9},"end":{"line":81,"column":13}},{"start":{"line":81,"column":17},"end":{"line":81,"column":28}},{"start":{"line":81,"column":32},"end":{"line":81,"column":33}}]},"8":{"line":113,"type":"if","locations":[{"start":{"line":113,"column":2},"end":{"line":113,"column":2}},{"start":{"line":113,"column":2},"end":{"line":113,"column":2}}]},"9":{"line":115,"type":"binary-expr","locations":[{"start":{"line":115,"column":14},"end":{"line":115,"column":18}},{"start":{"line":115,"column":22},"end":{"line":115,"column":32}}]},"10":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":2},"end":{"line":127,"column":2}},{"start":{"line":127,"column":2},"end":{"line":127,"column":2}}]},"11":{"line":128,"type":"if","locations":[{"start":{"line":128,"column":4},"end":{"line":128,"column":4}},{"start":{"line":128,"column":4},"end":{"line":128,"column":4}}]},"12":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":0},"end":{"line":134,"column":0}},{"start":{"line":134,"column":0},"end":{"line":134,"column":0}}]},"13":{"line":134,"type":"binary-expr","locations":[{"start":{"line":134,"column":4},"end":{"line":134,"column":10}},{"start":{"line":134,"column":14},"end":{"line":134,"column":28}}]},"14":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":7},"end":{"line":136,"column":7}},{"start":{"line":136,"column":7},"end":{"line":136,"column":7}}]},"15":{"line":136,"type":"binary-expr","locations":[{"start":{"line":136,"column":11},"end":{"line":136,"column":17}},{"start":{"line":136,"column":21},"end":{"line":136,"column":31}}]},"16":{"line":144,"type":"binary-expr","locations":[{"start":{"line":144,"column":2},"end":{"line":144,"column":29}},{"start":{"line":144,"column":33},"end":{"line":144,"column":39}}]},"17":{"line":145,"type":"binary-expr","locations":[{"start":{"line":145,"column":2},"end":{"line":145,"column":31}},{"start":{"line":145,"column":35},"end":{"line":145,"column":41}}]}}},"/home/davidbau/git/seedrandom/lib/tychei.js":{"path":"/home/davidbau/git/seedrandom/lib/tychei.js","s":{"1":1,"2":1,"3":3,"4":3,"5":4105195,"6":4105195,"7":4105195,"8":4105195,"9":4105195,"10":4105195,"11":4105195,"12":4105195,"13":4105195,"14":3,"15":3,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":3,"23":66,"24":66,"25":1,"26":2,"27":2,"28":2,"29":2,"30":2,"31":1,"32":3,"33":4102054,"34":3,"35":1025,"36":1025,"37":1025,"38":3,"39":3,"40":3,"41":2,"42":1,"43":2,"44":1,"45":3,"46":1,"47":1,"48":0,"49":0,"50":0,"51":0},"b":{"1":[2,1],"2":[3,2],"3":[2,1],"4":[1,1],"5":[1,0],"6":[1,1],"7":[0,0],"8":[0,0],"9":[1,1],"10":[1,0]},"f":{"1":1,"2":3,"3":4105195,"4":2,"5":3,"6":4102054,"7":1025,"8":1,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":34}}},"2":{"name":"XorGen","line":7,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":22}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":12},"end":{"line":11,"column":23}}},"4":{"name":"copy","line":60,"loc":{"start":{"line":60,"column":0},"end":{"line":60,"column":20}}},"5":{"name":"impl","line":68,"loc":{"start":{"line":68,"column":0},"end":{"line":68,"column":26}}},"6":{"name":"(anonymous_6)","line":71,"loc":{"start":{"line":71,"column":13},"end":{"line":71,"column":24}}},"7":{"name":"(anonymous_7)","line":72,"loc":{"start":{"line":72,"column":16},"end":{"line":72,"column":27}}},"8":{"name":"(anonymous_8)","line":84,"loc":{"start":{"line":84,"column":17},"end":{"line":84,"column":28}}},"9":{"name":"(anonymous_9)","line":92,"loc":{"start":{"line":92,"column":9},"end":{"line":92,"column":20}}}},"statementMap":{"1":{"start":{"line":5,"column":0},"end":{"line":101,"column":2}},"2":{"start":{"line":7,"column":0},"end":{"line":58,"column":1}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":30}},"4":{"start":{"line":11,"column":2},"end":{"line":21,"column":4}},"5":{"start":{"line":12,"column":4},"end":{"line":12,"column":47}},"6":{"start":{"line":13,"column":4},"end":{"line":13,"column":34}},"7":{"start":{"line":14,"column":4},"end":{"line":14,"column":20}},"8":{"start":{"line":15,"column":4},"end":{"line":15,"column":34}},"9":{"start":{"line":16,"column":4},"end":{"line":16,"column":20}},"10":{"start":{"line":17,"column":4},"end":{"line":17,"column":42}},"11":{"start":{"line":18,"column":4},"end":{"line":18,"column":27}},"12":{"start":{"line":19,"column":4},"end":{"line":19,"column":38}},"13":{"start":{"line":20,"column":4},"end":{"line":20,"column":30}},"14":{"start":{"line":39,"column":2},"end":{"line":39,"column":11}},"15":{"start":{"line":40,"column":2},"end":{"line":40,"column":11}},"16":{"start":{"line":41,"column":2},"end":{"line":41,"column":24}},"17":{"start":{"line":42,"column":2},"end":{"line":42,"column":20}},"18":{"start":{"line":44,"column":2},"end":{"line":51,"column":3}},"19":{"start":{"line":46,"column":4},"end":{"line":46,"column":36}},"20":{"start":{"line":47,"column":4},"end":{"line":47,"column":20}},"21":{"start":{"line":50,"column":4},"end":{"line":50,"column":20}},"22":{"start":{"line":54,"column":2},"end":{"line":57,"column":3}},"23":{"start":{"line":55,"column":4},"end":{"line":55,"column":38}},"24":{"start":{"line":56,"column":4},"end":{"line":56,"column":14}},"25":{"start":{"line":60,"column":0},"end":{"line":66,"column":1}},"26":{"start":{"line":61,"column":2},"end":{"line":61,"column":12}},"27":{"start":{"line":62,"column":2},"end":{"line":62,"column":12}},"28":{"start":{"line":63,"column":2},"end":{"line":63,"column":12}},"29":{"start":{"line":64,"column":2},"end":{"line":64,"column":12}},"30":{"start":{"line":65,"column":2},"end":{"line":65,"column":11}},"31":{"start":{"line":68,"column":0},"end":{"line":87,"column":1}},"32":{"start":{"line":69,"column":2},"end":{"line":71,"column":68}},"33":{"start":{"line":71,"column":26},"end":{"line":71,"column":65}},"34":{"start":{"line":72,"column":2},"end":{"line":79,"column":4}},"35":{"start":{"line":73,"column":4},"end":{"line":77,"column":27}},"36":{"start":{"line":74,"column":6},"end":{"line":76,"column":43}},"37":{"start":{"line":78,"column":4},"end":{"line":78,"column":18}},"38":{"start":{"line":80,"column":2},"end":{"line":80,"column":23}},"39":{"start":{"line":81,"column":2},"end":{"line":81,"column":20}},"40":{"start":{"line":82,"column":2},"end":{"line":85,"column":3}},"41":{"start":{"line":83,"column":4},"end":{"line":83,"column":51}},"42":{"start":{"line":83,"column":35},"end":{"line":83,"column":51}},"43":{"start":{"line":84,"column":4},"end":{"line":84,"column":52}},"44":{"start":{"line":84,"column":30},"end":{"line":84,"column":50}},"45":{"start":{"line":86,"column":2},"end":{"line":86,"column":14}},"46":{"start":{"line":89,"column":0},"end":{"line":95,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":90,"column":24}},"48":{"start":{"line":91,"column":7},"end":{"line":95,"column":1}},"49":{"start":{"line":92,"column":2},"end":{"line":92,"column":38}},"50":{"start":{"line":92,"column":22},"end":{"line":92,"column":34}},"51":{"start":{"line":94,"column":2},"end":{"line":94,"column":21}}},"branchMap":{"1":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":2},"end":{"line":44,"column":2}},{"start":{"line":44,"column":2},"end":{"line":44,"column":2}}]},"2":{"line":70,"type":"binary-expr","locations":[{"start":{"line":70,"column":14},"end":{"line":70,"column":18}},{"start":{"line":70,"column":22},"end":{"line":70,"column":32}}]},"3":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":2},"end":{"line":82,"column":2}},{"start":{"line":82,"column":2},"end":{"line":82,"column":2}}]},"4":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":83,"column":4}},{"start":{"line":83,"column":4},"end":{"line":83,"column":4}}]},"5":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":0},"end":{"line":89,"column":0}},{"start":{"line":89,"column":0},"end":{"line":89,"column":0}}]},"6":{"line":89,"type":"binary-expr","locations":[{"start":{"line":89,"column":4},"end":{"line":89,"column":10}},{"start":{"line":89,"column":14},"end":{"line":89,"column":28}}]},"7":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":7},"end":{"line":91,"column":7}},{"start":{"line":91,"column":7},"end":{"line":91,"column":7}}]},"8":{"line":91,"type":"binary-expr","locations":[{"start":{"line":91,"column":11},"end":{"line":91,"column":17}},{"start":{"line":91,"column":21},"end":{"line":91,"column":31}}]},"9":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":2},"end":{"line":99,"column":29}},{"start":{"line":99,"column":33},"end":{"line":99,"column":39}}]},"10":{"line":100,"type":"binary-expr","locations":[{"start":{"line":100,"column":2},"end":{"line":100,"column":31}},{"start":{"line":100,"column":35},"end":{"line":100,"column":41}}]}}},"/home/davidbau/git/seedrandom/lib/alea.js":{"path":"/home/davidbau/git/seedrandom/lib/alea.js","s":{"1":1,"2":1,"3":3,"4":3,"5":4105129,"6":4105129,"7":4105129,"8":4105129,"9":3,"10":3,"11":3,"12":3,"13":3,"14":3,"15":1,"16":3,"17":3,"18":3,"19":3,"20":3,"21":0,"22":3,"23":1,"24":2,"25":2,"26":2,"27":2,"28":2,"29":1,"30":3,"31":3,"32":1025,"33":3,"34":1025,"35":3,"36":3,"37":2,"38":1,"39":2,"40":1,"41":3,"42":1,"43":3,"44":3,"45":18,"46":18,"47":33,"48":33,"49":33,"50":33,"51":33,"52":33,"53":33,"54":33,"55":18,"56":3,"57":1,"58":1,"59":0,"60":0,"61":0,"62":0},"b":{"1":[1,2],"2":[3,0],"3":[0,3],"4":[3,2],"5":[2,1],"6":[1,1],"7":[1,0],"8":[1,1],"9":[0,0],"10":[0,0],"11":[1,1],"12":[1,0]},"f":{"1":1,"2":3,"3":4105129,"4":2,"5":3,"6":1025,"7":1025,"8":1,"9":3,"10":18,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":28,"loc":{"start":{"line":28,"column":1},"end":{"line":28,"column":34}}},"2":{"name":"Alea","line":30,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":20}}},"3":{"name":"(anonymous_3)","line":33,"loc":{"start":{"line":33,"column":12},"end":{"line":33,"column":23}}},"4":{"name":"copy","line":54,"loc":{"start":{"line":54,"column":0},"end":{"line":54,"column":20}}},"5":{"name":"impl","line":62,"loc":{"start":{"line":62,"column":0},"end":{"line":62,"column":26}}},"6":{"name":"(anonymous_6)","line":66,"loc":{"start":{"line":66,"column":15},"end":{"line":66,"column":26}}},"7":{"name":"(anonymous_7)","line":67,"loc":{"start":{"line":67,"column":16},"end":{"line":67,"column":27}}},"8":{"name":"(anonymous_8)","line":73,"loc":{"start":{"line":73,"column":17},"end":{"line":73,"column":28}}},"9":{"name":"Mash","line":78,"loc":{"start":{"line":78,"column":0},"end":{"line":78,"column":16}}},"10":{"name":"(anonymous_10)","line":81,"loc":{"start":{"line":81,"column":13},"end":{"line":81,"column":28}}},"11":{"name":"(anonymous_11)","line":103,"loc":{"start":{"line":103,"column":9},"end":{"line":103,"column":20}}}},"statementMap":{"1":{"start":{"line":28,"column":0},"end":{"line":112,"column":2}},"2":{"start":{"line":30,"column":0},"end":{"line":52,"column":1}},"3":{"start":{"line":31,"column":2},"end":{"line":31,"column":31}},"4":{"start":{"line":33,"column":2},"end":{"line":38,"column":4}},"5":{"start":{"line":34,"column":4},"end":{"line":34,"column":60}},"6":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"7":{"start":{"line":36,"column":4},"end":{"line":36,"column":18}},"8":{"start":{"line":37,"column":4},"end":{"line":37,"column":38}},"9":{"start":{"line":41,"column":2},"end":{"line":41,"column":11}},"10":{"start":{"line":42,"column":2},"end":{"line":42,"column":20}},"11":{"start":{"line":43,"column":2},"end":{"line":43,"column":20}},"12":{"start":{"line":44,"column":2},"end":{"line":44,"column":20}},"13":{"start":{"line":45,"column":2},"end":{"line":45,"column":22}},"14":{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},"15":{"start":{"line":46,"column":19},"end":{"line":46,"column":30}},"16":{"start":{"line":47,"column":2},"end":{"line":47,"column":22}},"17":{"start":{"line":48,"column":2},"end":{"line":48,"column":32}},"18":{"start":{"line":48,"column":19},"end":{"line":48,"column":30}},"19":{"start":{"line":49,"column":2},"end":{"line":49,"column":22}},"20":{"start":{"line":50,"column":2},"end":{"line":50,"column":32}},"21":{"start":{"line":50,"column":19},"end":{"line":50,"column":30}},"22":{"start":{"line":51,"column":2},"end":{"line":51,"column":14}},"23":{"start":{"line":54,"column":0},"end":{"line":60,"column":1}},"24":{"start":{"line":55,"column":2},"end":{"line":55,"column":12}},"25":{"start":{"line":56,"column":2},"end":{"line":56,"column":14}},"26":{"start":{"line":57,"column":2},"end":{"line":57,"column":14}},"27":{"start":{"line":58,"column":2},"end":{"line":58,"column":14}},"28":{"start":{"line":59,"column":2},"end":{"line":59,"column":11}},"29":{"start":{"line":62,"column":0},"end":{"line":76,"column":1}},"30":{"start":{"line":63,"column":2},"end":{"line":65,"column":21}},"31":{"start":{"line":66,"column":2},"end":{"line":66,"column":67}},"32":{"start":{"line":66,"column":28},"end":{"line":66,"column":65}},"33":{"start":{"line":67,"column":2},"end":{"line":69,"column":4}},"34":{"start":{"line":68,"column":4},"end":{"line":68,"column":69}},"35":{"start":{"line":70,"column":2},"end":{"line":70,"column":20}},"36":{"start":{"line":71,"column":2},"end":{"line":74,"column":3}},"37":{"start":{"line":72,"column":4},"end":{"line":72,"column":51}},"38":{"start":{"line":72,"column":35},"end":{"line":72,"column":51}},"39":{"start":{"line":73,"column":4},"end":{"line":73,"column":52}},"40":{"start":{"line":73,"column":30},"end":{"line":73,"column":50}},"41":{"start":{"line":75,"column":2},"end":{"line":75,"column":14}},"42":{"start":{"line":78,"column":0},"end":{"line":97,"column":1}},"43":{"start":{"line":79,"column":2},"end":{"line":79,"column":21}},"44":{"start":{"line":81,"column":2},"end":{"line":94,"column":4}},"45":{"start":{"line":82,"column":4},"end":{"line":82,"column":24}},"46":{"start":{"line":83,"column":4},"end":{"line":92,"column":5}},"47":{"start":{"line":84,"column":6},"end":{"line":84,"column":30}},"48":{"start":{"line":85,"column":6},"end":{"line":85,"column":38}},"49":{"start":{"line":86,"column":6},"end":{"line":86,"column":18}},"50":{"start":{"line":87,"column":6},"end":{"line":87,"column":13}},"51":{"start":{"line":88,"column":6},"end":{"line":88,"column":13}},"52":{"start":{"line":89,"column":6},"end":{"line":89,"column":18}},"53":{"start":{"line":90,"column":6},"end":{"line":90,"column":13}},"54":{"start":{"line":91,"column":6},"end":{"line":91,"column":27}},"55":{"start":{"line":93,"column":4},"end":{"line":93,"column":46}},"56":{"start":{"line":96,"column":2},"end":{"line":96,"column":14}},"57":{"start":{"line":100,"column":0},"end":{"line":106,"column":1}},"58":{"start":{"line":101,"column":2},"end":{"line":101,"column":24}},"59":{"start":{"line":102,"column":7},"end":{"line":106,"column":1}},"60":{"start":{"line":103,"column":2},"end":{"line":103,"column":38}},"61":{"start":{"line":103,"column":22},"end":{"line":103,"column":34}},"62":{"start":{"line":105,"column":2},"end":{"line":105,"column":19}}},"branchMap":{"1":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":46,"column":2}},{"start":{"line":46,"column":2},"end":{"line":46,"column":2}}]},"2":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":2},"end":{"line":48,"column":2}},{"start":{"line":48,"column":2},"end":{"line":48,"column":2}}]},"3":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":50,"column":2}},{"start":{"line":50,"column":2},"end":{"line":50,"column":2}}]},"4":{"line":64,"type":"binary-expr","locations":[{"start":{"line":64,"column":14},"end":{"line":64,"column":18}},{"start":{"line":64,"column":22},"end":{"line":64,"column":32}}]},"5":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":2},"end":{"line":71,"column":2}},{"start":{"line":71,"column":2},"end":{"line":71,"column":2}}]},"6":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":4}},{"start":{"line":72,"column":4},"end":{"line":72,"column":4}}]},"7":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":0},"end":{"line":100,"column":0}},{"start":{"line":100,"column":0},"end":{"line":100,"column":0}}]},"8":{"line":100,"type":"binary-expr","locations":[{"start":{"line":100,"column":4},"end":{"line":100,"column":10}},{"start":{"line":100,"column":14},"end":{"line":100,"column":28}}]},"9":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":7},"end":{"line":102,"column":7}},{"start":{"line":102,"column":7},"end":{"line":102,"column":7}}]},"10":{"line":102,"type":"binary-expr","locations":[{"start":{"line":102,"column":11},"end":{"line":102,"column":17}},{"start":{"line":102,"column":21},"end":{"line":102,"column":31}}]},"11":{"line":110,"type":"binary-expr","locations":[{"start":{"line":110,"column":2},"end":{"line":110,"column":29}},{"start":{"line":110,"column":33},"end":{"line":110,"column":39}}]},"12":{"line":111,"type":"binary-expr","locations":[{"start":{"line":111,"column":2},"end":{"line":111,"column":31}},{"start":{"line":111,"column":35},"end":{"line":111,"column":41}}]}}}} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/base.css b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/base.css new file mode 100644 index 0000000..f418035 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/block-navigation.js b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/block-navigation.js new file mode 100644 index 0000000..c7ff5a5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/block-navigation.js @@ -0,0 +1,79 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/index.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/index.html new file mode 100644 index 0000000..6109d95 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/index.html @@ -0,0 +1,110 @@ + + + + Code coverage report for All files + + + + + + + +
    +
    +

    + All files +

    +
    +
    + 93.21% + Statements + 439/471 +
    +
    + 73.2% + Branches + 142/194 +
    +
    + 90.41% + Functions + 66/73 +
    +
    + 94.44% + Lines + 374/396 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FileStatementsBranchesFunctionsLines
    seedrandom
    96%96/10085.11%40/4793.33%14/1596.39%80/83
    seedrandom/lib
    92.45%343/37169.39%102/14789.66%52/5893.93%294/313
    +
    +
    +
    + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.css b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.js b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.js new file mode 100644 index 0000000..b322523 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html new file mode 100644 index 0000000..7c99c88 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html @@ -0,0 +1,97 @@ + + + + Code coverage report for seedrandom + + + + + + + +
    +
    +

    + All files seedrandom +

    +
    +
    + 96% + Statements + 96/100 +
    +
    + 85.11% + Branches + 40/47 +
    +
    + 93.33% + Functions + 14/15 +
    +
    + 96.39% + Lines + 80/83 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FileStatementsBranchesFunctionsLines
    seedrandom.js
    96%96/10085.11%40/4793.33%14/1596.39%80/83
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html new file mode 100644 index 0000000..584d7c2 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html @@ -0,0 +1,411 @@ + + + + Code coverage report for seedrandom/lib/alea.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib alea.js +

    +
    +
    + 91.94% + Statements + 57/62 +
    +
    + 66.67% + Branches + 16/24 +
    +
    + 90.91% + Functions + 10/11 +
    +
    + 94.34% + Lines + 50/53 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +3x +  +3x +4105129x +4105129x +4105129x +4105129x +  +  +  +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +  +  +  +2x +2x +2x +2x +2x +  +  +  +3x +3x +3x +1025x +3x +1025x +  +3x +3x +2x +2x +  +3x +  +  +  +3x +  +3x +18x +18x +33x +33x +33x +33x +33x +33x +33x +33x +  +18x +  +  +3x +  +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  + 
    // A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010
    +// http://baagoe.com/en/RandomMusings/javascript/
    +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror
    +// Original work is under MIT license -
    + 
    +// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>
    +//
    +// Permission is hereby granted, free of charge, to any person obtaining a copy
    +// of this software and associated documentation files (the "Software"), to deal
    +// in the Software without restriction, including without limitation the rights
    +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +// copies of the Software, and to permit persons to whom the Software is
    +// furnished to do so, subject to the following conditions:
    +//
    +// The above copyright notice and this permission notice shall be included in
    +// all copies or substantial portions of the Software.
    +//
    +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    +// THE SOFTWARE.
    + 
    + 
    + 
    +(function(global, module, define) {
    + 
    +function Alea(seed) {
    +  var me = this, mash = Mash();
    + 
    +  me.next = function() {
    +    var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32
    +    me.s0 = me.s1;
    +    me.s1 = me.s2;
    +    return me.s2 = t - (me.c = t | 0);
    +  };
    + 
    +  // Apply the seeding algorithm from Baagoe.
    +  me.c = 1;
    +  me.s0 = mash(' ');
    +  me.s1 = mash(' ');
    +  me.s2 = mash(' ');
    +  me.s0 -= mash(seed);
    +  if (me.s0 < 0) { me.s0 += 1; }
    +  me.s1 -= mash(seed);
    +  Eif (me.s1 < 0) { me.s1 += 1; }
    +  me.s2 -= mash(seed);
    +  Iif (me.s2 < 0) { me.s2 += 1; }
    +  mash = null;
    +}
    + 
    +function copy(f, t) {
    +  t.c = f.c;
    +  t.s0 = f.s0;
    +  t.s1 = f.s1;
    +  t.s2 = f.s2;
    +  return t;
    +}
    + 
    +function impl(seed, opts) {
    +  var xg = new Alea(seed),
    +      state = opts && opts.state,
    +      prng = xg.next;
    +  prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }
    +  prng.double = function() {
    +    return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53
    +  };
    +  prng.quick = prng;
    +  if (state) {
    +    if (typeof(state) == 'object') copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +function Mash() {
    +  var n = 0xefc8249d;
    + 
    +  var mash = function(data) {
    +    data = String(data);
    +    for (var i = 0; i < data.length; i++) {
    +      n += data.charCodeAt(i);
    +      var h = 0.02519603282416938 * n;
    +      n = h >>> 0;
    +      h -= n;
    +      h *= n;
    +      n = h >>> 0;
    +      h -= n;
    +      n += h * 0x100000000; // 2^32
    +    }
    +    return (n >>> 0) * 2.3283064365386963e-10; // 2^-32
    +  };
    + 
    +  return mash;
    +}
    + 
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.alea = impl;
    +}
    + 
    +})(
    +  this,
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    + 
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html new file mode 100644 index 0000000..4986a5b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html @@ -0,0 +1,162 @@ + + + + Code coverage report for seedrandom/lib + + + + + + + +
    +
    +

    + All files seedrandom/lib +

    +
    +
    + 92.45% + Statements + 343/371 +
    +
    + 69.39% + Branches + 102/147 +
    +
    + 89.66% + Functions + 52/58 +
    +
    + 93.93% + Lines + 294/313 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FileStatementsBranchesFunctionsLines
    alea.js
    91.94%57/6266.67%16/2490.91%10/1194.34%50/53
    tychei.js
    92.98%53/5770%14/2088.89%8/993.75%45/48
    xor128.js
    91.84%45/4970%14/2088.89%8/993.02%40/43
    xor4096.js
    92.68%76/8265.71%23/3590%9/1094.52%69/73
    xorshift7.js
    92.42%61/6673.08%19/2690%9/1094%47/50
    xorwow.js
    92.73%51/5572.73%16/2288.89%8/993.48%43/46
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html new file mode 100644 index 0000000..29c3483 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html @@ -0,0 +1,378 @@ + + + + Code coverage report for seedrandom/lib/tychei.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib tychei.js +

    +
    +
    + 92.98% + Statements + 53/57 +
    +
    + 70% + Branches + 14/20 +
    +
    + 88.89% + Functions + 8/9 +
    +
    + 93.75% + Lines + 45/48 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104  +  +  +  +1x +  +  +3x +  +  +3x +4105195x +4105195x +4105195x +4105195x +4105195x +4105195x +4105195x +4105195x +4105195x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3x +3x +3x +3x +  +3x +  +2x +2x +  +  +1x +  +  +  +3x +66x +66x +  +  +  +  +2x +2x +2x +2x +2x +  +  +  +3x +3x +4102054x +3x +1025x +1025x +1025x +1025x +  +1025x +  +3x +3x +3x +2x +2x +  +3x +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  + 
    // A Javascript implementaion of the "Tyche-i" prng algorithm by
    +// Samuel Neves and Filipe Araujo.
    +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
    + 
    +(function(global, module, define) {
    + 
    +function XorGen(seed) {
    +  var me = this, strseed = '';
    + 
    +  // Set up generator function.
    +  me.next = function() {
    +    var b = me.b, c = me.c, d = me.d, a = me.a;
    +    b = (b << 25) ^ (b >>> 7) ^ c;
    +    c = (c - d) | 0;
    +    d = (d << 24) ^ (d >>> 8) ^ a;
    +    a = (a - b) | 0;
    +    me.b = b = (b << 20) ^ (b >>> 12) ^ c;
    +    me.c = c = (c - d) | 0;
    +    me.d = (d << 16) ^ (c >>> 16) ^ a;
    +    return me.a = (a - b) | 0;
    +  };
    + 
    +  /* The following is non-inverted tyche, which has better internal
    +   * bit diffusion, but which is about 25% slower than tyche-i in JS.
    +  me.next = function() {
    +    var a = me.a, b = me.b, c = me.c, d = me.d;
    +    a = (me.a + me.b | 0) >>> 0;
    +    d = me.d ^ a; d = d << 16 ^ d >>> 16;
    +    c = me.c + d | 0;
    +    b = me.b ^ c; b = b << 12 ^ d >>> 20;
    +    me.a = a = a + b | 0;
    +    d = d ^ a; me.d = d = d << 8 ^ d >>> 24;
    +    me.c = c = c + d | 0;
    +    b = b ^ c;
    +    return me.b = (b << 7 ^ b >>> 25);
    +  }
    +  */
    + 
    +  me.a = 0;
    +  me.b = 0;
    +  me.c = 2654435769 | 0;
    +  me.d = 1367130551;
    + 
    +  if (seed === Math.floor(seed)) {
    +    // Integer seed.
    +    me.a = (seed / 0x100000000) | 0;
    +    me.b = seed | 0;
    +  } else {
    +    // String seed.
    +    strseed += seed;
    +  }
    + 
    +  // Mix in string seed, then discard an initial batch of 64 values.
    +  for (var k = 0; k < strseed.length + 20; k++) {
    +    me.b ^= strseed.charCodeAt(k) | 0;
    +    me.next();
    +  }
    +}
    + 
    +function copy(f, t) {
    +  t.a = f.a;
    +  t.b = f.b;
    +  t.c = f.c;
    +  t.d = f.d;
    +  return t;
    +};
    + 
    +function impl(seed, opts) {
    +  var xg = new XorGen(seed),
    +      state = opts && opts.state,
    +      prng = function() { return (xg.next() >>> 0) / 0x100000000; };
    +  prng.double = function() {
    +    do {
    +      var top = xg.next() >>> 11,
    +          bot = (xg.next() >>> 0) / 0x100000000,
    +          result = (top + bot) / (1 << 21);
    +    } while (result === 0);
    +    return result;
    +  };
    +  prng.int32 = xg.next;
    +  prng.quick = prng;
    +  if (state) {
    +    if (typeof(state) == 'object') copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.tychei = impl;
    +}
    + 
    +})(
    +  this,
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    + 
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html new file mode 100644 index 0000000..77ec76f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html @@ -0,0 +1,312 @@ + + + + Code coverage report for seedrandom/lib/xor128.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib xor128.js +

    +
    +
    + 91.84% + Statements + 45/49 +
    +
    + 70% + Branches + 14/20 +
    +
    + 88.89% + Functions + 8/9 +
    +
    + 93.02% + Lines + 40/43 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82  +  +  +1x +  +  +3x +  +3x +3x +3x +3x +  +  +3x +4105327x +4105327x +4105327x +4105327x +4105327x +  +  +3x +  +2x +  +  +1x +  +  +  +3x +198x +198x +  +  +  +  +2x +2x +2x +2x +2x +  +  +  +3x +3x +4102054x +3x +1025x +1025x +1025x +1025x +  +1025x +  +3x +3x +3x +2x +2x +  +3x +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  + 
    // A Javascript implementaion of the "xor128" prng algorithm by
    +// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper
    + 
    +(function(global, module, define) {
    + 
    +function XorGen(seed) {
    +  var me = this, strseed = '';
    + 
    +  me.x = 0;
    +  me.y = 0;
    +  me.z = 0;
    +  me.w = 0;
    + 
    +  // Set up generator function.
    +  me.next = function() {
    +    var t = me.x ^ (me.x << 11);
    +    me.x = me.y;
    +    me.y = me.z;
    +    me.z = me.w;
    +    return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);
    +  };
    + 
    +  if (seed === (seed | 0)) {
    +    // Integer seed.
    +    me.x = seed;
    +  } else {
    +    // String seed.
    +    strseed += seed;
    +  }
    + 
    +  // Mix in string seed, then discard an initial batch of 64 values.
    +  for (var k = 0; k < strseed.length + 64; k++) {
    +    me.x ^= strseed.charCodeAt(k) | 0;
    +    me.next();
    +  }
    +}
    + 
    +function copy(f, t) {
    +  t.x = f.x;
    +  t.y = f.y;
    +  t.z = f.z;
    +  t.w = f.w;
    +  return t;
    +}
    + 
    +function impl(seed, opts) {
    +  var xg = new XorGen(seed),
    +      state = opts && opts.state,
    +      prng = function() { return (xg.next() >>> 0) / 0x100000000; };
    +  prng.double = function() {
    +    do {
    +      var top = xg.next() >>> 11,
    +          bot = (xg.next() >>> 0) / 0x100000000,
    +          result = (top + bot) / (1 << 21);
    +    } while (result === 0);
    +    return result;
    +  };
    +  prng.int32 = xg.next;
    +  prng.quick = prng;
    +  if (state) {
    +    if (typeof(state) == 'object') copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.xor128 = impl;
    +}
    + 
    +})(
    +  this,
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    + 
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html new file mode 100644 index 0000000..a9b085b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html @@ -0,0 +1,507 @@ + + + + Code coverage report for seedrandom/lib/xor4096.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib xor4096.js +

    +
    +
    + 92.68% + Statements + 76/82 +
    +
    + 65.71% + Branches + 23/35 +
    +
    + 90% + Functions + 9/10 +
    +
    + 94.52% + Lines + 69/73 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +3x +  +  +3x +4105129x +4105129x +  +4105129x +  +4105129x +4105129x +4105129x +4105129x +4105129x +4105129x +  +4105129x +4105129x +  +4105129x +  +  +  +3x +3x +  +2x +2x +  +  +1x +1x +1x +  +  +3x +  +480x +  +480x +480x +480x +480x +480x +480x +384x +384x +384x +  +  +  +3x +  +  +  +  +  +3x +3x +1536x +1536x +1536x +1536x +1536x +1536x +1536x +  +  +3x +3x +3x +  +  +3x +  +  +  +2x +2x +2x +2x +  +  +  +3x +3x +3x +4102054x +3x +1025x +1025x +1025x +1025x +  +1025x +  +3x +3x +3x +2x +2x +  +3x +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  + 
    // A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.
    +//
    +// This fast non-cryptographic random number generator is designed for
    +// use in Monte-Carlo algorithms. It combines a long-period xorshift
    +// generator with a Weyl generator, and it passes all common batteries
    +// of stasticial tests for randomness while consuming only a few nanoseconds
    +// for each prng generated.  For background on the generator, see Brent's
    +// paper: "Some long-period random number generators using shifts and xors."
    +// http://arxiv.org/pdf/1004.3115v1.pdf
    +//
    +// Usage:
    +//
    +// var xor4096 = require('xor4096');
    +// random = xor4096(1);                        // Seed with int32 or string.
    +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.
    +// assert.equal(random.int32(), 1806534897);   // signed int32, 32 bits.
    +//
    +// For nonzero numeric keys, this impelementation provides a sequence
    +// identical to that by Brent's xorgens 3 implementaion in C.  This
    +// implementation also provides for initalizing the generator with
    +// string seeds, or for saving and restoring the state of the generator.
    +//
    +// On Chrome, this prng benchmarks about 2.1 times slower than
    +// Javascript's built-in Math.random().
    + 
    +(function(global, module, define) {
    + 
    +function XorGen(seed) {
    +  var me = this;
    + 
    +  // Set up generator function.
    +  me.next = function() {
    +    var w = me.w,
    +        X = me.X, i = me.i, t, v;
    +    // Update Weyl generator.
    +    me.w = w = (w + 0x61c88647) | 0;
    +    // Update xor generator.
    +    v = X[(i + 34) & 127];
    +    t = X[i = ((i + 1) & 127)];
    +    v ^= v << 13;
    +    t ^= t << 17;
    +    v ^= v >>> 15;
    +    t ^= t >>> 12;
    +    // Update Xor generator array state.
    +    v = X[i] = v ^ t;
    +    me.i = i;
    +    // Result is the combination.
    +    return (v + (w ^ (w >>> 16))) | 0;
    +  };
    + 
    +  function init(me, seed) {
    +    var t, v, i, j, w, X = [], limit = 128;
    +    if (seed === (seed | 0)) {
    +      // Numeric seeds initialize v, which is used to generates X.
    +      v = seed;
    +      seed = null;
    +    } else {
    +      // String seeds are mixed into v and X one character at a time.
    +      seed = seed + '\0';
    +      v = 0;
    +      limit = Math.max(limit, seed.length);
    +    }
    +    // Initialize circular array and weyl value.
    +    for (i = 0, j = -32; j < limit; ++j) {
    +      // Put the unicode characters into the array, and shuffle them.
    +      if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);
    +      // After 32 shuffles, take v as the starting w value.
    +      if (j === 0) w = v;
    +      v ^= v << 10;
    +      v ^= v >>> 15;
    +      v ^= v << 4;
    +      v ^= v >>> 13;
    +      if (j >= 0) {
    +        w = (w + 0x61c88647) | 0;     // Weyl.
    +        t = (X[j & 127] ^= (v + w));  // Combine xor and weyl to init array.
    +        i = (0 == t) ? i + 1 : 0;     // Count zeroes.
    +      }
    +    }
    +    // We have detected all zeroes; make the key nonzero.
    +    Iif (i >= 128) {
    +      X[(seed && seed.length || 0) & 127] = -1;
    +    }
    +    // Run the generator 512 times to further mix the state before using it.
    +    // Factoring this as a function slows the main generator, so it is just
    +    // unrolled here.  The weyl generator is not advanced while warming up.
    +    i = 127;
    +    for (j = 4 * 128; j > 0; --j) {
    +      v = X[(i + 34) & 127];
    +      t = X[i = ((i + 1) & 127)];
    +      v ^= v << 13;
    +      t ^= t << 17;
    +      v ^= v >>> 15;
    +      t ^= t >>> 12;
    +      X[i] = v ^ t;
    +    }
    +    // Storing state as object members is faster than using closure variables.
    +    me.w = w;
    +    me.X = X;
    +    me.i = i;
    +  }
    + 
    +  init(me, seed);
    +}
    + 
    +function copy(f, t) {
    +  t.i = f.i;
    +  t.w = f.w;
    +  t.X = f.X.slice();
    +  return t;
    +};
    + 
    +function impl(seed, opts) {
    +  Iif (seed == null) seed = +(new Date);
    +  var xg = new XorGen(seed),
    +      state = opts && opts.state,
    +      prng = function() { return (xg.next() >>> 0) / 0x100000000; };
    +  prng.double = function() {
    +    do {
    +      var top = xg.next() >>> 11,
    +          bot = (xg.next() >>> 0) / 0x100000000,
    +          result = (top + bot) / (1 << 21);
    +    } while (result === 0);
    +    return result;
    +  };
    +  prng.int32 = xg.next;
    +  prng.quick = prng;
    +  if (state) {
    +    if (state.X) copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.xor4096 = impl;
    +}
    + 
    +})(
    +  this,                                     // window object or global
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html new file mode 100644 index 0000000..e50230c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html @@ -0,0 +1,360 @@ + + + + Code coverage report for seedrandom/lib/xorshift7.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib xorshift7.js +

    +
    +
    + 92.42% + Statements + 61/66 +
    +
    + 73.08% + Branches + 19/26 +
    +
    + 90% + Functions + 9/10 +
    +
    + 94% + Lines + 47/50 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +1x +  +  +3x +  +  +3x +  +4105897x +4105897x +4105897x +4105897x +4105897x +4105897x +4105897x +4105897x +4105897x +  +  +  +3x +  +3x +  +2x +  +  +1x +1x +6x +  +  +  +  +16x +3x +3x +  +3x +3x +  +  +3x +768x +  +  +  +3x +  +  +  +2x +2x +2x +  +  +  +3x +3x +3x +4102054x +3x +1025x +1025x +1025x +1025x +  +1025x +  +3x +3x +3x +2x +2x +  +3x +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  + 
    // A Javascript implementaion of the "xorshift7" algorithm by
    +// François Panneton and Pierre L'ecuyer:
    +// "On the Xorgshift Random Number Generators"
    +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf
    + 
    +(function(global, module, define) {
    + 
    +function XorGen(seed) {
    +  var me = this;
    + 
    +  // Set up generator function.
    +  me.next = function() {
    +    // Update xor generator.
    +    var X = me.x, i = me.i, t, v, w;
    +    t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);
    +    t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);
    +    t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);
    +    t = X[(i + 4) & 7]; v ^= t ^ (t << 7);
    +    t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);
    +    X[i] = v;
    +    me.i = (i + 1) & 7;
    +    return v;
    +  };
    + 
    +  function init(me, seed) {
    +    var j, w, X = [];
    + 
    +    if (seed === (seed | 0)) {
    +      // Seed state array using a 32-bit integer.
    +      w = X[0] = seed;
    +    } else {
    +      // Seed state using a string.
    +      seed = '' + seed;
    +      for (j = 0; j < seed.length; ++j) {
    +        X[j & 7] = (X[j & 7] << 15) ^
    +            (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);
    +      }
    +    }
    +    // Enforce an array length of 8, not all zeroes.
    +    while (X.length < 8) X.push(0);
    +    for (j = 0; j < 8 && X[j] === 0; ++j);
    +    if (j == 8) w = X[7] = -1; else w = X[j];
    + 
    +    me.x = X;
    +    me.i = 0;
    + 
    +    // Discard an initial 256 values.
    +    for (j = 256; j > 0; --j) {
    +      me.next();
    +    }
    +  }
    + 
    +  init(me, seed);
    +}
    + 
    +function copy(f, t) {
    +  t.x = f.x.slice();
    +  t.i = f.i;
    +  return t;
    +}
    + 
    +function impl(seed, opts) {
    +  Iif (seed == null) seed = +(new Date);
    +  var xg = new XorGen(seed),
    +      state = opts && opts.state,
    +      prng = function() { return (xg.next() >>> 0) / 0x100000000; };
    +  prng.double = function() {
    +    do {
    +      var top = xg.next() >>> 11,
    +          bot = (xg.next() >>> 0) / 0x100000000,
    +          result = (top + bot) / (1 << 21);
    +    } while (result === 0);
    +    return result;
    +  };
    +  prng.int32 = xg.next;
    +  prng.quick = prng;
    +  if (state) {
    +    if (state.x) copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.xorshift7 = impl;
    +}
    + 
    +})(
    +  this,
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html new file mode 100644 index 0000000..3c8d5a7 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html @@ -0,0 +1,327 @@ + + + + Code coverage report for seedrandom/lib/xorwow.js + + + + + + + +
    +
    +

    + All files / seedrandom/lib xorwow.js +

    +
    +
    + 92.73% + Statements + 51/55 +
    +
    + 72.73% + Branches + 16/22 +
    +
    + 88.89% + Functions + 8/9 +
    +
    + 93.48% + Lines + 43/46 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87  +  +  +1x +  +  +3x +  +  +3x +4105327x +4105327x +4105327x +  +  +  +3x +3x +3x +3x +3x +  +3x +  +2x +  +  +1x +  +  +  +3x +198x +198x +3x +  +198x +  +  +  +  +2x +2x +2x +2x +2x +2x +2x +  +  +  +3x +3x +4102054x +3x +1025x +1025x +1025x +1025x +  +1025x +  +3x +3x +3x +2x +2x +  +3x +  +  +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  + 
    // A Javascript implementaion of the "xorwow" prng algorithm by
    +// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper
    + 
    +(function(global, module, define) {
    + 
    +function XorGen(seed) {
    +  var me = this, strseed = '';
    + 
    +  // Set up generator function.
    +  me.next = function() {
    +    var t = (me.x ^ (me.x >>> 2));
    +    me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;
    +    return (me.d = (me.d + 362437 | 0)) +
    +       (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;
    +  };
    + 
    +  me.x = 0;
    +  me.y = 0;
    +  me.z = 0;
    +  me.w = 0;
    +  me.v = 0;
    + 
    +  if (seed === (seed | 0)) {
    +    // Integer seed.
    +    me.x = seed;
    +  } else {
    +    // String seed.
    +    strseed += seed;
    +  }
    + 
    +  // Mix in string seed, then discard an initial batch of 64 values.
    +  for (var k = 0; k < strseed.length + 64; k++) {
    +    me.x ^= strseed.charCodeAt(k) | 0;
    +    if (k == strseed.length) {
    +      me.d = me.x << 10 ^ me.x >>> 4;
    +    }
    +    me.next();
    +  }
    +}
    + 
    +function copy(f, t) {
    +  t.x = f.x;
    +  t.y = f.y;
    +  t.z = f.z;
    +  t.w = f.w;
    +  t.v = f.v;
    +  t.d = f.d;
    +  return t;
    +}
    + 
    +function impl(seed, opts) {
    +  var xg = new XorGen(seed),
    +      state = opts && opts.state,
    +      prng = function() { return (xg.next() >>> 0) / 0x100000000; };
    +  prng.double = function() {
    +    do {
    +      var top = xg.next() >>> 11,
    +          bot = (xg.next() >>> 0) / 0x100000000,
    +          result = (top + bot) / (1 << 21);
    +    } while (result === 0);
    +    return result;
    +  };
    +  prng.int32 = xg.next;
    +  prng.quick = prng;
    +  if (state) {
    +    if (typeof(state) == 'object') copy(state, xg);
    +    prng.state = function() { return copy(xg, {}); }
    +  }
    +  return prng;
    +}
    + 
    +Eif (module && module.exports) {
    +  module.exports = impl;
    +} else if (define && define.amd) {
    +  define(function() { return impl; });
    +} else {
    +  this.xorwow = impl;
    +}
    + 
    +})(
    +  this,
    +  (typeof module) == 'object' && module,    // present in node.js
    +  (typeof define) == 'function' && define   // present with an AMD loader
    +);
    + 
    + 
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html new file mode 100644 index 0000000..ca72564 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html @@ -0,0 +1,828 @@ + + + + Code coverage report for seedrandom/seedrandom.js + + + + + + + +
    +
    +

    + All files / seedrandom seedrandom.js +

    +
    +
    + 96% + Statements + 96/100 +
    +
    + 85.11% + Branches + 40/47 +
    +
    + 93.33% + Functions + 14/15 +
    +
    + 96.39% + Lines + 80/83 +
    +
    +

    + Press n or j to go to the next uncovered block, b, p or k for the previous block. +

    +
    +
    +
    
    +
    +
    1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6x +  +  +  +  +6x +6x +6x +6x +6x +6x +6x +6x +  +  +  +  +  +  +  +23x +23x +  +  +23x +  +  +  +  +23x +  +  +  +23x +3694x +3694x +3694x +3694x +3917x +3917x +3917x +  +3694x +9249x +9249x +9249x +  +3694x +  +  +1025x +4100001x +23x +  +  +23x +  +  +23x +  +20x +  +4x +  +4x +  +  +  +  +20x +  +  +  +19x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23x +23x +  +  +23x +  +  +23x +5888x +  +23x +5888x +5888x +  +  +  +23x +  +4108660x +4108660x +4108660x +16436073x +16436073x +  +4108660x +4108660x +  +  +  +  +  +  +  +  +  +  +  +4x +4x +4x +4x +  +  +  +  +  +  +  +32x +32x +4x +9x +  +  +32x +  +  +  +  +  +  +  +  +52x +52x +7735x +  +  +52x +  +  +  +  +  +  +  +  +4x +  +4x +  +3x +  +1x +1x +  +3x +  +1x +1x +1x +  +  +  +  +  +  +  +  +81x +  +  +  +  +  +  +  +  +  +6x +  +  +  +  +  +6x +6x +  +6x +6x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
    /*
    +Copyright 2019 David Bau.
    + 
    +Permission is hereby granted, free of charge, to any person obtaining
    +a copy of this software and associated documentation files (the
    +"Software"), to deal in the Software without restriction, including
    +without limitation the rights to use, copy, modify, merge, publish,
    +distribute, sublicense, and/or sell copies of the Software, and to
    +permit persons to whom the Software is furnished to do so, subject to
    +the following conditions:
    + 
    +The above copyright notice and this permission notice shall be
    +included in all copies or substantial portions of the Software.
    + 
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    + 
    +*/
    + 
    +(function (global, pool, math) {
    +//
    +// The following constants are related to IEEE 754 limits.
    +//
    + 
    +var width = 256,        // each RC4 output is 0 <= x < 256
    +    chunks = 6,         // at least six RC4 outputs for each double
    +    digits = 52,        // there are 52 significant digits in a double
    +    rngname = 'random', // rngname: name for Math.random and Math.seedrandom
    +    startdenom = math.pow(width, chunks),
    +    significance = math.pow(2, digits),
    +    overflow = significance * 2,
    +    mask = width - 1,
    +    nodecrypto;         // node.js crypto module, initialized at the bottom.
    + 
    +//
    +// seedrandom()
    +// This is the seedrandom function described above.
    +//
    +function seedrandom(seed, options, callback) {
    +  var key = [];
    +  options = (options == true) ? { entropy: true } : (options || {});
    + 
    +  // Flatten the seed string or build one from local entropy if needed.
    +  var shortseed = mixkey(flatten(
    +    options.entropy ? [seed, tostring(pool)] :
    +    (seed == null) ? autoseed() : seed, 3), key);
    + 
    +  // Use the seed to initialize an ARC4 generator.
    +  var arc4 = new ARC4(key);
    + 
    +  // This function returns a random double in [0, 1) that contains
    +  // randomness in every bit of the mantissa of the IEEE 754 value.
    +  var prng = function() {
    +    var n = arc4.g(chunks),             // Start with a numerator n < 2 ^ 48
    +        d = startdenom,                 //   and denominator d = 2 ^ 48.
    +        x = 0;                          //   and no 'extra last byte'.
    +    while (n < significance) {          // Fill up all significant digits by
    +      n = (n + x) * width;              //   shifting numerator and
    +      d *= width;                       //   denominator and generating a
    +      x = arc4.g(1);                    //   new least-significant-byte.
    +    }
    +    while (n >= overflow) {             // To avoid rounding up, before adding
    +      n /= 2;                           //   last byte, shift everything
    +      d /= 2;                           //   right using integer math until
    +      x >>>= 1;                         //   we have exactly the desired bits.
    +    }
    +    return (n + x) / d;                 // Form the number within [0, 1).
    +  };
    + 
    +  prng.int32 = function() { return arc4.g(4) | 0; }
    +  prng.quick = function() { return arc4.g(4) / 0x100000000; }
    +  prng.double = prng;
    + 
    +  // Mix the randomness into accumulated entropy.
    +  mixkey(tostring(arc4.S), pool);
    + 
    +  // Calling convention: what to return as a function of prng, seed, is_math.
    +  return (options.pass || callback ||
    +      function(prng, seed, is_math_call, state) {
    +        if (state) {
    +          // Load the arc4 state from the given state if it has an S array.
    +          if (state.S) { copy(state, arc4); }
    +          // Only provide the .state method if requested via options.state.
    +          prng.state = function() { return copy(arc4, {}); }
    +        }
    + 
    +        // If called as a method of Math (Math.seedrandom()), mutate
    +        // Math.random because that is how seedrandom.js has worked since v1.0.
    +        if (is_math_call) { math[rngname] = prng; return seed; }
    + 
    +        // Otherwise, it is a newer calling convention, so return the
    +        // prng directly.
    +        else return prng;
    +      })(
    +  prng,
    +  shortseed,
    +  'global' in options ? options.global : (this == math),
    +  options.state);
    +}
    + 
    +//
    +// ARC4
    +//
    +// An ARC4 implementation.  The constructor takes a key in the form of
    +// an array of at most (width) integers that should be 0 <= x < (width).
    +//
    +// The g(count) method returns a pseudorandom integer that concatenates
    +// the next (count) outputs from ARC4.  Its return value is a number x
    +// that is in the range 0 <= x < (width ^ count).
    +//
    +function ARC4(key) {
    +  var t, keylen = key.length,
    +      me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
    + 
    +  // The empty key [] is treated as [0].
    +  if (!keylen) { key = [keylen++]; }
    + 
    +  // Set up S using the standard key scheduling algorithm.
    +  while (i < width) {
    +    s[i] = i++;
    +  }
    +  for (i = 0; i < width; i++) {
    +    s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
    +    s[j] = t;
    +  }
    + 
    +  // The "g" method returns the next (count) outputs as one number.
    +  (me.g = function(count) {
    +    // Using instance members instead of closure state nearly doubles speed.
    +    var t, r = 0,
    +        i = me.i, j = me.j, s = me.S;
    +    while (count--) {
    +      t = s[i = mask & (i + 1)];
    +      r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
    +    }
    +    me.i = i; me.j = j;
    +    return r;
    +    // For robust unpredictability, the function call below automatically
    +    // discards an initial batch of values.  This is called RC4-drop[256].
    +    // See http://google.com/search?q=rsa+fluhrer+response&btnI
    +  })(width);
    +}
    + 
    +//
    +// copy()
    +// Copies internal state of ARC4 to or from a plain object.
    +//
    +function copy(f, t) {
    +  t.i = f.i;
    +  t.j = f.j;
    +  t.S = f.S.slice();
    +  return t;
    +};
    + 
    +//
    +// flatten()
    +// Converts an object tree to nested arrays of strings.
    +//
    +function flatten(obj, depth) {
    +  var result = [], typ = (typeof obj), prop;
    +  if (depth && typ == 'object') {
    +    for (prop in obj) {
    +      try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
    +    }
    +  }
    +  return (result.length ? result : typ == 'string' ? obj : obj + '\0');
    +}
    + 
    +//
    +// mixkey()
    +// Mixes a string seed into a key that is an array of integers, and
    +// returns a shortened string seed that is equivalent to the result key.
    +//
    +function mixkey(seed, key) {
    +  var stringseed = seed + '', smear, j = 0;
    +  while (j < stringseed.length) {
    +    key[mask & j] =
    +      mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
    +  }
    +  return tostring(key);
    +}
    + 
    +//
    +// autoseed()
    +// Returns an object for autoseeding, using window.crypto and Node crypto
    +// module if available.
    +//
    +function autoseed() {
    +  try {
    +    var out;
    +    if (nodecrypto && (out = nodecrypto.randomBytes)) {
    +      // The use of 'out' to remember randomBytes makes tight minified code.
    +      out = out(width);
    +    } else {
    +      out = new Uint8Array(width);
    +      (global.crypto || global.msCrypto).getRandomValues(out);
    +    }
    +    return tostring(out);
    +  } catch (e) {
    +    var browser = global.navigator,
    +        plugins = browser && browser.plugins;
    +    return [+new Date, global, plugins, global.screen, tostring(pool)];
    +  }
    +}
    + 
    +//
    +// tostring()
    +// Converts an array of charcodes to a string
    +//
    +function tostring(a) {
    +  return String.fromCharCode.apply(0, a);
    +}
    + 
    +//
    +// When seedrandom.js is loaded, we immediately mix a few bits
    +// from the built-in RNG into the entropy pool.  Because we do
    +// not want to interfere with deterministic PRNG state later,
    +// seedrandom will not call math.random on its own again after
    +// initialization.
    +//
    +mixkey(math.random(), pool);
    + 
    +//
    +// Nodejs and AMD support: export the implementation as a module using
    +// either convention.
    +//
    +Eif ((typeof module) == 'object' && module.exports) {
    +  module.exports = seedrandom;
    +  // When in node.js, try using crypto package for autoseeding.
    +  try {
    +    nodecrypto = require('crypto');
    +  } catch (ex) {}
    +} else if ((typeof define) == 'function' && define.amd) {
    +  define(function() { return seedrandom; });
    +} else {
    +  // When included as a plain script, set up Math.seedrandom global.
    +  math['seed' + rngname] = seedrandom;
    +}
    + 
    + 
    +// End anonymous scope, and pass initial values.
    +})(
    +  // global: `self` in browsers (including strict mode and web workers),
    +  // otherwise `this` in Node and other environments
    +  (typeof self !== 'undefined') ? self : this,
    +  [],     // pool: entropy pool starts empty
    +  Math    // math: package containing random, pow, and seedrandom
    +);
    + 
    +
    +
    + + + + + + + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000..03f704a Binary files /dev/null and b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sorter.js b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sorter.js new file mode 100644 index 0000000..16de10c --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov-report/sorter.js @@ -0,0 +1,170 @@ +/* eslint-disable */ +var addSorting = (function() { + 'use strict'; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { + return document.querySelector('.coverage-summary'); + } + // returns the thead element of the summary table + function getTableHeader() { + return getTable().querySelector('thead tr'); + } + // returns the tbody element of the summary table + function getTableBody() { + return getTable().querySelector('tbody'); + } + // returns the th element for nth column + function getNthColumn(n) { + return getTableHeader().querySelectorAll('th')[n]; + } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = + colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov.info b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov.info new file mode 100644 index 0000000..bf8175d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/coverage/lcov.info @@ -0,0 +1,799 @@ +TN: +SF:/home/davidbau/git/seedrandom/seedrandom.js +FN:25,(anonymous_0) +FN:44,seedrandom +FN:58,(anonymous_2) +FN:75,(anonymous_3) +FN:76,(anonymous_4) +FN:84,(anonymous_5) +FN:89,(anonymous_6) +FN:116,ARC4 +FN:133,(anonymous_8) +FN:153,copy +FN:164,flatten +FN:179,mixkey +FN:193,autoseed +FN:215,tostring +FN:239,(anonymous_14) +FNF:15 +FNH:14 +FNDA:6,(anonymous_0) +FNDA:23,seedrandom +FNDA:3694,(anonymous_2) +FNDA:1025,(anonymous_3) +FNDA:4100001,(anonymous_4) +FNDA:20,(anonymous_5) +FNDA:2,(anonymous_6) +FNDA:23,ARC4 +FNDA:4108660,(anonymous_8) +FNDA:4,copy +FNDA:32,flatten +FNDA:52,mixkey +FNDA:4,autoseed +FNDA:81,tostring +FNDA:0,(anonymous_14) +DA:25,6 +DA:30,6 +DA:31,6 +DA:32,6 +DA:33,6 +DA:34,6 +DA:35,6 +DA:36,6 +DA:37,6 +DA:45,23 +DA:46,23 +DA:49,23 +DA:54,23 +DA:58,23 +DA:59,3694 +DA:60,3694 +DA:61,3694 +DA:62,3694 +DA:63,3917 +DA:64,3917 +DA:65,3917 +DA:67,3694 +DA:68,9249 +DA:69,9249 +DA:70,9249 +DA:72,3694 +DA:75,1025 +DA:76,4100001 +DA:77,23 +DA:80,23 +DA:83,23 +DA:85,20 +DA:87,4 +DA:89,4 +DA:94,20 +DA:98,19 +DA:117,23 +DA:118,23 +DA:121,23 +DA:124,23 +DA:125,5888 +DA:127,23 +DA:128,5888 +DA:129,5888 +DA:133,23 +DA:135,4108660 +DA:136,4108660 +DA:137,4108660 +DA:138,16436073 +DA:139,16436073 +DA:141,4108660 +DA:142,4108660 +DA:154,4 +DA:155,4 +DA:156,4 +DA:157,4 +DA:165,32 +DA:166,32 +DA:167,4 +DA:168,9 +DA:171,32 +DA:180,52 +DA:181,52 +DA:182,7735 +DA:185,52 +DA:194,4 +DA:196,4 +DA:198,3 +DA:200,1 +DA:201,1 +DA:203,3 +DA:205,1 +DA:206,1 +DA:207,1 +DA:216,81 +DA:226,6 +DA:232,6 +DA:233,6 +DA:235,6 +DA:236,6 +DA:238,0 +DA:239,0 +DA:242,0 +LF:83 +LH:80 +BRDA:46,0,0,1 +BRDA:46,0,1,22 +BRDA:46,1,0,22 +BRDA:46,1,1,11 +BRDA:50,2,0,2 +BRDA:50,2,1,21 +BRDA:51,3,0,4 +BRDA:51,3,1,17 +BRDA:83,4,0,23 +BRDA:83,4,1,21 +BRDA:83,4,2,20 +BRDA:85,5,0,4 +BRDA:85,5,1,16 +BRDA:87,6,0,2 +BRDA:87,6,1,2 +BRDA:94,7,0,1 +BRDA:94,7,1,19 +BRDA:102,8,0,4 +BRDA:102,8,1,19 +BRDA:121,9,0,1 +BRDA:121,9,1,22 +BRDA:166,10,0,4 +BRDA:166,10,1,28 +BRDA:166,11,0,32 +BRDA:166,11,1,32 +BRDA:171,12,0,3 +BRDA:171,12,1,29 +BRDA:171,13,0,23 +BRDA:171,13,1,6 +BRDA:196,14,0,3 +BRDA:196,14,1,1 +BRDA:196,15,0,4 +BRDA:196,15,1,3 +BRDA:201,16,0,1 +BRDA:201,16,1,1 +BRDA:206,17,0,1 +BRDA:206,17,1,0 +BRDA:232,18,0,6 +BRDA:232,18,1,0 +BRDA:232,19,0,6 +BRDA:232,19,1,6 +BRDA:238,20,0,0 +BRDA:238,20,1,0 +BRDA:238,21,0,0 +BRDA:238,21,1,0 +BRDA:250,22,0,0 +BRDA:250,22,1,6 +BRF:47 +BRH:40 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/alea.js +FN:28,(anonymous_0) +FN:30,Alea +FN:33,(anonymous_2) +FN:54,copy +FN:62,impl +FN:66,(anonymous_5) +FN:67,(anonymous_6) +FN:73,(anonymous_7) +FN:78,Mash +FN:81,(anonymous_9) +FN:103,(anonymous_10) +FNF:11 +FNH:10 +FNDA:1,(anonymous_0) +FNDA:3,Alea +FNDA:4105129,(anonymous_2) +FNDA:2,copy +FNDA:3,impl +FNDA:1025,(anonymous_5) +FNDA:1025,(anonymous_6) +FNDA:1,(anonymous_7) +FNDA:3,Mash +FNDA:18,(anonymous_9) +FNDA:0,(anonymous_10) +DA:28,1 +DA:31,3 +DA:33,3 +DA:34,4105129 +DA:35,4105129 +DA:36,4105129 +DA:37,4105129 +DA:41,3 +DA:42,3 +DA:43,3 +DA:44,3 +DA:45,3 +DA:46,3 +DA:47,3 +DA:48,3 +DA:49,3 +DA:50,3 +DA:51,3 +DA:55,2 +DA:56,2 +DA:57,2 +DA:58,2 +DA:59,2 +DA:63,3 +DA:64,3 +DA:65,3 +DA:66,1025 +DA:67,3 +DA:68,1025 +DA:70,3 +DA:71,3 +DA:72,2 +DA:73,2 +DA:75,3 +DA:79,3 +DA:81,3 +DA:82,18 +DA:83,18 +DA:84,33 +DA:85,33 +DA:86,33 +DA:87,33 +DA:88,33 +DA:89,33 +DA:90,33 +DA:91,33 +DA:93,18 +DA:96,3 +DA:100,1 +DA:101,1 +DA:102,0 +DA:103,0 +DA:105,0 +LF:53 +LH:50 +BRDA:46,0,0,1 +BRDA:46,0,1,2 +BRDA:48,1,0,3 +BRDA:48,1,1,0 +BRDA:50,2,0,0 +BRDA:50,2,1,3 +BRDA:64,3,0,3 +BRDA:64,3,1,2 +BRDA:71,4,0,2 +BRDA:71,4,1,1 +BRDA:72,5,0,1 +BRDA:72,5,1,1 +BRDA:100,6,0,1 +BRDA:100,6,1,0 +BRDA:100,7,0,1 +BRDA:100,7,1,1 +BRDA:102,8,0,0 +BRDA:102,8,1,0 +BRDA:102,9,0,0 +BRDA:102,9,1,0 +BRDA:110,10,0,1 +BRDA:110,10,1,1 +BRDA:111,11,0,1 +BRDA:111,11,1,0 +BRF:24 +BRH:16 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/tychei.js +FN:5,(anonymous_0) +FN:7,XorGen +FN:11,(anonymous_2) +FN:60,copy +FN:68,impl +FN:71,(anonymous_5) +FN:72,(anonymous_6) +FN:84,(anonymous_7) +FN:92,(anonymous_8) +FNF:9 +FNH:8 +FNDA:1,(anonymous_0) +FNDA:3,XorGen +FNDA:4105195,(anonymous_2) +FNDA:2,copy +FNDA:3,impl +FNDA:4102054,(anonymous_5) +FNDA:1025,(anonymous_6) +FNDA:1,(anonymous_7) +FNDA:0,(anonymous_8) +DA:5,1 +DA:8,3 +DA:11,3 +DA:12,4105195 +DA:13,4105195 +DA:14,4105195 +DA:15,4105195 +DA:16,4105195 +DA:17,4105195 +DA:18,4105195 +DA:19,4105195 +DA:20,4105195 +DA:39,3 +DA:40,3 +DA:41,3 +DA:42,3 +DA:44,3 +DA:46,2 +DA:47,2 +DA:50,1 +DA:54,3 +DA:55,66 +DA:56,66 +DA:61,2 +DA:62,2 +DA:63,2 +DA:64,2 +DA:65,2 +DA:69,3 +DA:70,3 +DA:71,4102054 +DA:72,3 +DA:73,1025 +DA:74,1025 +DA:75,1025 +DA:76,1025 +DA:78,1025 +DA:80,3 +DA:81,3 +DA:82,3 +DA:83,2 +DA:84,2 +DA:86,3 +DA:89,1 +DA:90,1 +DA:91,0 +DA:92,0 +DA:94,0 +LF:48 +LH:45 +BRDA:44,0,0,2 +BRDA:44,0,1,1 +BRDA:70,1,0,3 +BRDA:70,1,1,2 +BRDA:82,2,0,2 +BRDA:82,2,1,1 +BRDA:83,3,0,1 +BRDA:83,3,1,1 +BRDA:89,4,0,1 +BRDA:89,4,1,0 +BRDA:89,5,0,1 +BRDA:89,5,1,1 +BRDA:91,6,0,0 +BRDA:91,6,1,0 +BRDA:91,7,0,0 +BRDA:91,7,1,0 +BRDA:99,8,0,1 +BRDA:99,8,1,1 +BRDA:100,9,0,1 +BRDA:100,9,1,0 +BRF:20 +BRH:14 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/xor128.js +FN:4,(anonymous_0) +FN:6,XorGen +FN:15,(anonymous_2) +FN:38,copy +FN:46,impl +FN:49,(anonymous_5) +FN:50,(anonymous_6) +FN:62,(anonymous_7) +FN:70,(anonymous_8) +FNF:9 +FNH:8 +FNDA:1,(anonymous_0) +FNDA:3,XorGen +FNDA:4105327,(anonymous_2) +FNDA:2,copy +FNDA:3,impl +FNDA:4102054,(anonymous_5) +FNDA:1025,(anonymous_6) +FNDA:1,(anonymous_7) +FNDA:0,(anonymous_8) +DA:4,1 +DA:7,3 +DA:9,3 +DA:10,3 +DA:11,3 +DA:12,3 +DA:15,3 +DA:16,4105327 +DA:17,4105327 +DA:18,4105327 +DA:19,4105327 +DA:20,4105327 +DA:23,3 +DA:25,2 +DA:28,1 +DA:32,3 +DA:33,198 +DA:34,198 +DA:39,2 +DA:40,2 +DA:41,2 +DA:42,2 +DA:43,2 +DA:47,3 +DA:48,3 +DA:49,4102054 +DA:50,3 +DA:51,1025 +DA:52,1025 +DA:53,1025 +DA:54,1025 +DA:56,1025 +DA:58,3 +DA:59,3 +DA:60,3 +DA:61,2 +DA:62,2 +DA:64,3 +DA:67,1 +DA:68,1 +DA:69,0 +DA:70,0 +DA:72,0 +LF:43 +LH:40 +BRDA:23,0,0,2 +BRDA:23,0,1,1 +BRDA:48,1,0,3 +BRDA:48,1,1,2 +BRDA:60,2,0,2 +BRDA:60,2,1,1 +BRDA:61,3,0,1 +BRDA:61,3,1,1 +BRDA:67,4,0,1 +BRDA:67,4,1,0 +BRDA:67,5,0,1 +BRDA:67,5,1,1 +BRDA:69,6,0,0 +BRDA:69,6,1,0 +BRDA:69,7,0,0 +BRDA:69,7,1,0 +BRDA:77,8,0,1 +BRDA:77,8,1,1 +BRDA:78,9,0,1 +BRDA:78,9,1,0 +BRF:20 +BRH:14 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/xor4096.js +FN:26,(anonymous_0) +FN:28,XorGen +FN:32,(anonymous_2) +FN:51,init +FN:105,copy +FN:112,impl +FN:116,(anonymous_6) +FN:117,(anonymous_7) +FN:129,(anonymous_8) +FN:137,(anonymous_9) +FNF:10 +FNH:9 +FNDA:1,(anonymous_0) +FNDA:3,XorGen +FNDA:4105129,(anonymous_2) +FNDA:3,init +FNDA:2,copy +FNDA:3,impl +FNDA:4102054,(anonymous_6) +FNDA:1025,(anonymous_7) +FNDA:1,(anonymous_8) +FNDA:0,(anonymous_9) +DA:26,1 +DA:29,3 +DA:32,3 +DA:33,4105129 +DA:34,4105129 +DA:36,4105129 +DA:38,4105129 +DA:39,4105129 +DA:40,4105129 +DA:41,4105129 +DA:42,4105129 +DA:43,4105129 +DA:45,4105129 +DA:46,4105129 +DA:48,4105129 +DA:52,3 +DA:53,3 +DA:55,2 +DA:56,2 +DA:59,1 +DA:60,1 +DA:61,1 +DA:64,3 +DA:66,480 +DA:68,480 +DA:69,480 +DA:70,480 +DA:71,480 +DA:72,480 +DA:73,480 +DA:74,384 +DA:75,384 +DA:76,384 +DA:80,3 +DA:81,0 +DA:86,3 +DA:87,3 +DA:88,1536 +DA:89,1536 +DA:90,1536 +DA:91,1536 +DA:92,1536 +DA:93,1536 +DA:94,1536 +DA:97,3 +DA:98,3 +DA:99,3 +DA:102,3 +DA:106,2 +DA:107,2 +DA:108,2 +DA:109,2 +DA:113,3 +DA:114,3 +DA:115,3 +DA:116,4102054 +DA:117,3 +DA:118,1025 +DA:119,1025 +DA:120,1025 +DA:121,1025 +DA:123,1025 +DA:125,3 +DA:126,3 +DA:127,3 +DA:128,2 +DA:129,2 +DA:131,3 +DA:134,1 +DA:135,1 +DA:136,0 +DA:137,0 +DA:139,0 +LF:73 +LH:69 +BRDA:53,0,0,2 +BRDA:53,0,1,1 +BRDA:66,1,0,160 +BRDA:66,1,1,320 +BRDA:68,2,0,3 +BRDA:68,2,1,477 +BRDA:73,3,0,384 +BRDA:73,3,1,96 +BRDA:76,4,0,0 +BRDA:76,4,1,384 +BRDA:80,5,0,0 +BRDA:80,5,1,3 +BRDA:81,6,0,0 +BRDA:81,6,1,0 +BRDA:81,6,2,0 +BRDA:113,7,0,0 +BRDA:113,7,1,3 +BRDA:115,8,0,3 +BRDA:115,8,1,2 +BRDA:127,9,0,2 +BRDA:127,9,1,1 +BRDA:128,10,0,1 +BRDA:128,10,1,1 +BRDA:134,11,0,1 +BRDA:134,11,1,0 +BRDA:134,12,0,1 +BRDA:134,12,1,1 +BRDA:136,13,0,0 +BRDA:136,13,1,0 +BRDA:136,14,0,0 +BRDA:136,14,1,0 +BRDA:144,15,0,1 +BRDA:144,15,1,1 +BRDA:145,16,0,1 +BRDA:145,16,1,0 +BRF:35 +BRH:23 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/xorshift7.js +FN:6,(anonymous_0) +FN:8,XorGen +FN:12,(anonymous_2) +FN:25,init +FN:56,copy +FN:62,impl +FN:66,(anonymous_6) +FN:67,(anonymous_7) +FN:79,(anonymous_8) +FN:87,(anonymous_9) +FNF:10 +FNH:9 +FNDA:1,(anonymous_0) +FNDA:3,XorGen +FNDA:4105897,(anonymous_2) +FNDA:3,init +FNDA:2,copy +FNDA:3,impl +FNDA:4102054,(anonymous_6) +FNDA:1025,(anonymous_7) +FNDA:1,(anonymous_8) +FNDA:0,(anonymous_9) +DA:6,1 +DA:9,3 +DA:12,3 +DA:14,4105897 +DA:15,4105897 +DA:16,4105897 +DA:17,4105897 +DA:18,4105897 +DA:19,4105897 +DA:20,4105897 +DA:21,4105897 +DA:22,4105897 +DA:26,3 +DA:28,3 +DA:30,2 +DA:33,1 +DA:34,1 +DA:35,6 +DA:40,16 +DA:41,3 +DA:42,3 +DA:44,3 +DA:45,3 +DA:48,3 +DA:49,768 +DA:53,3 +DA:57,2 +DA:58,2 +DA:59,2 +DA:63,3 +DA:64,3 +DA:65,3 +DA:66,4102054 +DA:67,3 +DA:68,1025 +DA:69,1025 +DA:70,1025 +DA:71,1025 +DA:73,1025 +DA:75,3 +DA:76,3 +DA:77,3 +DA:78,2 +DA:79,2 +DA:81,3 +DA:84,1 +DA:85,1 +DA:86,0 +DA:87,0 +DA:89,0 +LF:50 +LH:47 +BRDA:28,0,0,2 +BRDA:28,0,1,1 +BRDA:41,1,0,19 +BRDA:41,1,1,17 +BRDA:42,2,0,2 +BRDA:42,2,1,1 +BRDA:63,3,0,0 +BRDA:63,3,1,3 +BRDA:65,4,0,3 +BRDA:65,4,1,2 +BRDA:77,5,0,2 +BRDA:77,5,1,1 +BRDA:78,6,0,1 +BRDA:78,6,1,1 +BRDA:84,7,0,1 +BRDA:84,7,1,0 +BRDA:84,8,0,1 +BRDA:84,8,1,1 +BRDA:86,9,0,0 +BRDA:86,9,1,0 +BRDA:86,10,0,0 +BRDA:86,10,1,0 +BRDA:94,11,0,1 +BRDA:94,11,1,1 +BRDA:95,12,0,1 +BRDA:95,12,1,0 +BRF:26 +BRH:19 +end_of_record +TN: +SF:/home/davidbau/git/seedrandom/lib/xorwow.js +FN:4,(anonymous_0) +FN:6,XorGen +FN:10,(anonymous_2) +FN:41,copy +FN:51,impl +FN:54,(anonymous_5) +FN:55,(anonymous_6) +FN:67,(anonymous_7) +FN:75,(anonymous_8) +FNF:9 +FNH:8 +FNDA:1,(anonymous_0) +FNDA:3,XorGen +FNDA:4105327,(anonymous_2) +FNDA:2,copy +FNDA:3,impl +FNDA:4102054,(anonymous_5) +FNDA:1025,(anonymous_6) +FNDA:1,(anonymous_7) +FNDA:0,(anonymous_8) +DA:4,1 +DA:7,3 +DA:10,3 +DA:11,4105327 +DA:12,4105327 +DA:13,4105327 +DA:17,3 +DA:18,3 +DA:19,3 +DA:20,3 +DA:21,3 +DA:23,3 +DA:25,2 +DA:28,1 +DA:32,3 +DA:33,198 +DA:34,198 +DA:35,3 +DA:37,198 +DA:42,2 +DA:43,2 +DA:44,2 +DA:45,2 +DA:46,2 +DA:47,2 +DA:48,2 +DA:52,3 +DA:53,3 +DA:54,4102054 +DA:55,3 +DA:56,1025 +DA:57,1025 +DA:58,1025 +DA:59,1025 +DA:61,1025 +DA:63,3 +DA:64,3 +DA:65,3 +DA:66,2 +DA:67,2 +DA:69,3 +DA:72,1 +DA:73,1 +DA:74,0 +DA:75,0 +DA:77,0 +LF:46 +LH:43 +BRDA:23,0,0,2 +BRDA:23,0,1,1 +BRDA:34,1,0,3 +BRDA:34,1,1,195 +BRDA:53,2,0,3 +BRDA:53,2,1,2 +BRDA:65,3,0,2 +BRDA:65,3,1,1 +BRDA:66,4,0,1 +BRDA:66,4,1,1 +BRDA:72,5,0,1 +BRDA:72,5,1,0 +BRDA:72,6,0,1 +BRDA:72,6,1,1 +BRDA:74,7,0,0 +BRDA:74,7,1,0 +BRDA:74,8,0,0 +BRDA:74,8,1,0 +BRDA:82,9,0,1 +BRDA:82,9,1,1 +BRDA:83,10,0,1 +BRDA:83,10,1,0 +BRF:22 +BRH:16 +end_of_record diff --git a/24_10_22_faktorialis/node_modules/seedrandom/index.js b/24_10_22_faktorialis/node_modules/seedrandom/index.js new file mode 100644 index 0000000..513669a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/index.js @@ -0,0 +1,60 @@ +// A library of seedable RNGs implemented in Javascript. +// +// Usage: +// +// var seedrandom = require('seedrandom'); +// var random = seedrandom(1); // or any seed. +// var x = random(); // 0 <= x < 1. Every bit is random. +// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + +// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. +// Period: ~2^116 +// Reported to pass all BigCrush tests. +var alea = require('./lib/alea'); + +// xor128, a pure xor-shift generator by George Marsaglia. +// Period: 2^128-1. +// Reported to fail: MatrixRank and LinearComp. +var xor128 = require('./lib/xor128'); + +// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. +// Period: 2^192-2^32 +// Reported to fail: CollisionOver, SimpPoker, and LinearComp. +var xorwow = require('./lib/xorwow'); + +// xorshift7, by François Panneton and Pierre L'ecuyer, takes +// a different approach: it adds robustness by allowing more shifts +// than Marsaglia's original three. It is a 7-shift generator +// with 256 bits, that passes BigCrush with no systmatic failures. +// Period 2^256-1. +// No systematic BigCrush failures reported. +var xorshift7 = require('./lib/xorshift7'); + +// xor4096, by Richard Brent, is a 4096-bit xor-shift with a +// very long period that also adds a Weyl generator. It also passes +// BigCrush with no systematic failures. Its long period may +// be useful if you have many generators and need to avoid +// collisions. +// Period: 2^4128-2^32. +// No systematic BigCrush failures reported. +var xor4096 = require('./lib/xor4096'); + +// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random +// number generator derived from ChaCha, a modern stream cipher. +// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf +// Period: ~2^127 +// No systematic BigCrush failures reported. +var tychei = require('./lib/tychei'); + +// The original ARC4-based prng included in this library. +// Period: ~2^1600 +var sr = require('./seedrandom'); + +sr.alea = alea; +sr.xor128 = xor128; +sr.xorwow = xorwow; +sr.xorshift7 = xorshift7; +sr.xor4096 = xor4096; +sr.tychei = tychei; + +module.exports = sr; diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.js new file mode 100644 index 0000000..478b956 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.js @@ -0,0 +1,114 @@ +// A port of an algorithm by Johannes Baagøe , 2010 +// http://baagoe.com/en/RandomMusings/javascript/ +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror +// Original work is under MIT license - + +// Copyright (C) 2010 by Johannes Baagøe +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + + +(function(global, module, define) { + +function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; +} + +function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; +} + +function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = String(data); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; +} + + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.alea = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.min.js new file mode 100644 index 0000000..be30a46 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/alea.min.js @@ -0,0 +1 @@ +!function(n,t,e){function u(n){var t=this,e=function(){var s=4022871197;return function(n){n=String(n);for(var t=0;t>>0,s=(e*=s)>>>0,s+=4294967296*(e-=s)}return 2.3283064365386963e-10*(s>>>0)}}();t.next=function(){var n=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=n-(t.c=0|n)},t.c=1,t.s0=e(" "),t.s1=e(" "),t.s2=e(" "),t.s0-=e(n),t.s0<0&&(t.s0+=1),t.s1-=e(n),t.s1<0&&(t.s1+=1),t.s2-=e(n),t.s2<0&&(t.s2+=1),e=null}function o(n,t){return t.c=n.c,t.s0=n.s0,t.s1=n.s1,t.s2=n.s2,t}function s(n,t){var e=new u(n),s=t&&t.state,r=e.next;return r.int32=function(){return 4294967296*e.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,e),r.state=function(){return o(e,{})}),r}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.alea=s}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/crypto.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/crypto.js new file mode 100644 index 0000000..18ee91f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/crypto.js @@ -0,0 +1,11 @@ +// mimic a subset of node's crypto API for the browser + +function randomBytes(width) { + var out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + return out; +} + +module.exports = { + randomBytes: randomBytes +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.js new file mode 100644 index 0000000..3d0ddd4 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.js @@ -0,0 +1,103 @@ +// A Javascript implementaion of the "Tyche-i" prng algorithm by +// Samuel Neves and Filipe Araujo. +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; +}; + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.tychei = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.min.js new file mode 100644 index 0000000..fa24abb --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/tychei.min.js @@ -0,0 +1 @@ +!function(t,n,e){function u(t){var r=this,n="";r.next=function(){var t=r.b,n=r.c,e=r.d,o=r.a;return t=t<<25^t>>>7^n,n=n-e|0,e=e<<24^e>>>8^o,o=o-t|0,r.b=t=t<<20^t>>>12^n,r.c=n=n-e|0,r.d=e<<16^n>>>16^o,r.a=o-t|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,t===Math.floor(t)?(r.a=t/4294967296|0,r.b=0|t):n+=t;for(var e=0;e>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&c(r,o),e.state=function(){return c(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.tychei=o}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.js new file mode 100644 index 0000000..c461934 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.js @@ -0,0 +1,81 @@ +// A Javascript implementaion of the "xor128" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor128 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.min.js new file mode 100644 index 0000000..bd60553 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor128.min.js @@ -0,0 +1 @@ +!function(t,n,e){function u(t){var n=this,e="";n.x=0,n.y=0,n.z=0,n.w=0,n.next=function(){var t=n.x^n.x<<11;return n.x=n.y,n.y=n.z,n.z=n.w,n.w^=n.w>>>19^t^t>>>8},t===(0|t)?n.x=t:e+=t;for(var o=0;o>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&i(r,o),e.state=function(){return i(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.xor128=o}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.js new file mode 100644 index 0000000..6adf19f --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.js @@ -0,0 +1,146 @@ +// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. +// +// This fast non-cryptographic random number generator is designed for +// use in Monte-Carlo algorithms. It combines a long-period xorshift +// generator with a Weyl generator, and it passes all common batteries +// of stasticial tests for randomness while consuming only a few nanoseconds +// for each prng generated. For background on the generator, see Brent's +// paper: "Some long-period random number generators using shifts and xors." +// http://arxiv.org/pdf/1004.3115v1.pdf +// +// Usage: +// +// var xor4096 = require('xor4096'); +// random = xor4096(1); // Seed with int32 or string. +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. +// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. +// +// For nonzero numeric keys, this impelementation provides a sequence +// identical to that by Brent's xorgens 3 implementaion in C. This +// implementation also provides for initalizing the generator with +// string seeds, or for saving and restoring the state of the generator. +// +// On Chrome, this prng benchmarks about 2.1 times slower than +// Javascript's built-in Math.random(). + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); +} + +function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; +}; + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor4096 = impl; +} + +})( + this, // window object or global + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.min.js new file mode 100644 index 0000000..fee9f8a --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xor4096.min.js @@ -0,0 +1 @@ +!function(n,t,e){function o(n){var o=this;o.next=function(){var n,t,e=o.w,r=o.X,i=o.i;return o.w=e=e+1640531527|0,t=r[i+34&127],n=r[i=i+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,t=r[i]=t^n,o.i=i,t+(e^e>>>16)|0},function(n,t){var e,r,i,o,u,f=[],c=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,c=Math.max(c,t.length)),i=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,0<=o&&(u=u+1640531527|0,i=0==(e=f[127&o]^=r+u)?i+1:0);for(128<=i&&(f[127&(t&&t.length||0)]=-1),i=127,o=512;0>>15,e^=e>>>12,f[i]=r^e;n.w=u,n.X=f,n.i=i}(o,n)}function u(n,t){return t.i=n.i,t.w=n.w,t.X=n.X.slice(),t}function r(n,t){null==n&&(n=+new Date);function e(){return(r.next()>>>0)/4294967296}var r=new o(n),i=t&&t.state;return e.double=function(){do{var n=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},e.int32=r.next,e.quick=e,i&&(i.X&&u(i,r),e.state=function(){return u(r,{})}),e}t&&t.exports?t.exports=r:e&&e.amd?e(function(){return r}):this.xor4096=r}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.js new file mode 100644 index 0000000..b7e5151 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.js @@ -0,0 +1,97 @@ +// A Javascript implementaion of the "xorshift7" algorithm by +// François Panneton and Pierre L'ecuyer: +// "On the Xorgshift Random Number Generators" +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v, w; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); +} + +function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; +} + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorshift7 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.min.js new file mode 100644 index 0000000..c6db5f6 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorshift7.min.js @@ -0,0 +1 @@ +!function(n,t,e){function o(n){var i=this;i.next=function(){var n,t,e=i.x,r=i.i;return n=e[r],t=(n^=n>>>7)^n<<24,t^=(n=e[r+1&7])^n>>>10,t^=(n=e[r+3&7])^n>>>3,t^=(n=e[r+4&7])^n<<7,n=e[r+7&7],t^=(n^=n<<13)^n<<9,e[r]=t,i.i=r+1&7,t},function(n,t){var e,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,e=0;e>>0)/4294967296}var r=new o(n),i=t&&t.state;return e.double=function(){do{var n=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},e.int32=r.next,e.quick=e,i&&(i.x&&u(i,r),e.state=function(){return u(r,{})}),e}t&&t.exports?t.exports=r:e&&e.amd?e(function(){return r}):this.xorshift7=r}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.js new file mode 100644 index 0000000..79d5e44 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.js @@ -0,0 +1,86 @@ +// A Javascript implementaion of the "xorwow" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorwow = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.min.js b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.min.js new file mode 100644 index 0000000..be1c626 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/lib/xorwow.min.js @@ -0,0 +1 @@ +!function(t,n,e){function u(t){var n=this,e="";n.next=function(){var t=n.x^n.x>>>2;return n.x=n.y,n.y=n.z,n.z=n.w,n.w=n.v,(n.d=n.d+362437|0)+(n.v=n.v^n.v<<4^t^t<<1)|0},n.x=0,n.y=0,n.z=0,n.w=0,t===((n.v=0)|t)?n.x=t:e+=t;for(var o=0;o>>4),n.next()}function x(t,n){return n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n.v=t.v,n.d=t.d,n}function o(t,n){function e(){return(o.next()>>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&x(r,o),e.state=function(){return x(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.xorwow=o}(0,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/seedrandom/package.json b/24_10_22_faktorialis/node_modules/seedrandom/package.json new file mode 100644 index 0000000..86aad13 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/package.json @@ -0,0 +1,60 @@ +{ + "name": "seedrandom", + "version": "3.0.5", + "description": "Seeded random number generator for Javascript.", + "main": "index.js", + "jsdelivr": "seedrandom.min.js", + "unpkg": "seedrandom.min.js", + "keywords": [ + "seed", + "random", + "crypto" + ], + "scripts": { + "test": "grunt travis" + }, + "repository": { + "type": "git", + "url": "git://github.com/davidbau/seedrandom.git" + }, + "author": "David Bau", + "license": "MIT", + "bugs": { + "url": "https://github.com/davidbau/seedrandom/issues" + }, + "homepage": "http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html", + "config": { + "blanket": { + "pattern": [ + "seedrandom.js", + "lib/alea.js", + "lib/xor128.js", + "lib/xorwow.js", + "lib/xorshift7.js", + "lib/tychei.js", + "lib/xor4096.js" + ] + } + }, + "browser": { + "crypto": false + }, + "devDependencies": { + "blanket": "latest", + "coveralls": "latest", + "grunt": "latest", + "grunt-browserify": "latest", + "grunt-release": "davidbau/grunt-release", + "grunt-cli": "latest", + "grunt-contrib-connect": "latest", + "grunt-contrib-copy": "latest", + "grunt-contrib-qunit": "latest", + "grunt-contrib-uglify": "latest", + "grunt-mocha-nyc": "latest", + "mocha": "latest", + "nyc": "latest", + "proxyquire": "latest", + "qunit": "latest", + "requirejs": "latest" + } +} diff --git a/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.js b/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.js new file mode 100644 index 0000000..12d7ee1 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.js @@ -0,0 +1,253 @@ +/* +Copyright 2019 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +(function (global, pool, math) { +// +// The following constants are related to IEEE 754 limits. +// + +var width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + +// +// seedrandom() +// This is the seedrandom function described above. +// +function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ((typeof module) == 'object' && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} +} else if ((typeof define) == 'function' && define.amd) { + define(function() { return seedrandom; }); +} else { + // When included as a plain script, set up Math.seedrandom global. + math['seed' + rngname] = seedrandom; +} + + +// End anonymous scope, and pass initial values. +})( + // global: `self` in browsers (including strict mode and web workers), + // otherwise `this` in Node and other environments + (typeof self !== 'undefined') ? self : this, + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); diff --git a/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.min.js b/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.min.js new file mode 100644 index 0000000..56e1afc --- /dev/null +++ b/24_10_22_faktorialis/node_modules/seedrandom/seedrandom.min.js @@ -0,0 +1 @@ +!function(f,a,c){var s,l=256,p="random",d=c.pow(l,6),g=c.pow(2,52),y=2*g,h=l-1;function n(n,t,r){function e(){for(var n=u.g(6),t=d,r=0;n>>=1;return(n+r)/t}var o=[],i=j(function n(t,r){var e,o=[],i=typeof t;if(r&&"object"==i)for(e in t)try{o.push(n(t[e],r-1))}catch(n){}return o.length?o:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[n,S(a)]:null==n?function(){try{var n;return s&&(n=s.randomBytes)?n=n(l):(n=new Uint8Array(l),(f.crypto||f.msCrypto).getRandomValues(n)),S(n)}catch(n){var t=f.navigator,r=t&&t.plugins;return[+new Date,f,r,f.screen,S(a)]}}():n,3),o),u=new m(o);return e.int32=function(){return 0|u.g(4)},e.quick=function(){return u.g(4)/4294967296},e.double=e,j(S(u.S),a),(t.pass||r||function(n,t,r,e){return e&&(e.S&&v(e,u),n.state=function(){return v(u,{})}),r?(c[p]=n,t):n})(e,i,"global"in t?t.global:this==c,t.state)}function m(n){var t,r=n.length,u=this,e=0,o=u.i=u.j=0,i=u.S=[];for(r||(n=[r++]);e dist/tinyemitter.js -s TinyEmitter && echo 'Bundled'", + "minify": "node_modules/.bin/uglifyjs dist/tinyemitter.js -o dist/tinyemitter.min.js -m && echo 'Minified'", + "build": "npm test && npm run bundle && npm run minify", + "size": "node_modules/.bin/uglifyjs index.js -o minified.js -m && ls -l && rm minified.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/scottcorgan/tiny-emitter.git" + }, + "keywords": [ + "event", + "emitter", + "pubsub", + "tiny", + "events", + "bind" + ], + "author": "Scott Corgan", + "license": "MIT", + "bugs": { + "url": "https://github.com/scottcorgan/tiny-emitter/issues" + }, + "devDependencies": { + "@tap-format/spec": "0.2.0", + "browserify": "11.2.0", + "tape": "4.2.1", + "testling": "1.7.1", + "uglify-js": "2.5.0" + }, + "testling": { + "files": [ + "test/index.js" + ], + "browsers": [ + "iexplore/10.0", + "iexplore/9.0", + "firefox/16..latest", + "chrome/22..latest", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/24_10_22_faktorialis/node_modules/tiny-emitter/test/index.js b/24_10_22_faktorialis/node_modules/tiny-emitter/test/index.js new file mode 100644 index 0000000..7f95f62 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/tiny-emitter/test/index.js @@ -0,0 +1,217 @@ +var Emitter = require('../index'); +var emitter = require('../instance'); +var test = require('tape'); + +test('subscribes to an event', function (t) { + var emitter = new Emitter(); + emitter.on('test', function () {}); + + t.equal(emitter.e.test.length, 1, 'subscribed to event'); + t.end(); +}); + +test('subscribes to an event with context', function (t) { + var emitter = new Emitter(); + var context = { + contextValue: true + }; + + emitter.on('test', function () { + t.ok(this.contextValue, 'is in context'); + t.end(); + }, context); + + emitter.emit('test'); +}); + +test('subscibes only once to an event', function (t) { + var emitter = new Emitter(); + + emitter.once('test', function () { + t.notOk(emitter.e.test, 'removed event from list'); + t.end(); + }); + + emitter.emit('test'); +}); + +test('keeps context when subscribed only once', function (t) { + var emitter = new Emitter(); + var context = { + contextValue: true + }; + + emitter.once('test', function () { + t.ok(this.contextValue, 'is in context'); + t.notOk(emitter.e.test, 'not subscribed anymore'); + t.end(); + }, context); + + emitter.emit('test'); +}); + +test('emits an event', function (t) { + var emitter = new Emitter(); + + emitter.on('test', function () { + t.ok(true, 'triggered event'); + t.end(); + }); + + emitter.emit('test'); +}); + +test('passes all arguments to event listener', function (t) { + var emitter = new Emitter(); + + emitter.on('test', function (arg1, arg2) { + t.equal(arg1, 'arg1', 'passed the first argument'); + t.equal(arg2, 'arg2', 'passed the second argument'); + t.end(); + }); + + emitter.emit('test', 'arg1', 'arg2'); +}); + +test('unsubscribes from all events with name', function (t) { + var emitter = new Emitter(); + emitter.on('test', function () { + t.fail('should not get called'); + }); + emitter.off('test'); + emitter.emit('test') + + process.nextTick(function () { + t.end(); + }); +}); + +test('unsubscribes single event with name and callback', function (t) { + var emitter = new Emitter(); + var fn = function () { + t.fail('should not get called'); + } + + emitter.on('test', fn); + emitter.off('test', fn); + emitter.emit('test') + + process.nextTick(function () { + t.end(); + }); +}); + +// Test added by https://github.com/lazd +// From PR: https://github.com/scottcorgan/tiny-emitter/pull/6 +test('unsubscribes single event with name and callback when subscribed twice', function (t) { + var emitter = new Emitter(); + var fn = function () { + t.fail('should not get called'); + }; + + emitter.on('test', fn); + emitter.on('test', fn); + + emitter.off('test', fn); + emitter.emit('test'); + + process.nextTick(function () { + t.notOk(emitter.e['test'], 'removes all events'); + t.end(); + }); +}); + +test('unsubscribes single event with name and callback when subscribed twice out of order', function (t) { + var emitter = new Emitter(); + var calls = 0; + var fn = function () { + t.fail('should not get called'); + }; + var fn2 = function () { + calls++; + }; + + emitter.on('test', fn); + emitter.on('test', fn2); + emitter.on('test', fn); + emitter.off('test', fn); + emitter.emit('test'); + + process.nextTick(function () { + t.equal(calls, 1, 'callback was called'); + t.end(); + }); +}); + +test('removes an event inside another event', function (t) { + var emitter = new Emitter(); + + emitter.on('test', function () { + t.equal(emitter.e.test.length, 1, 'event is still in list'); + + emitter.off('test'); + + t.notOk(emitter.e.test, 0, 'event is gone from list'); + t.end(); + }); + + emitter.emit('test'); +}); + +test('event is emitted even if unsubscribed in the event callback', function (t) { + var emitter = new Emitter(); + var calls = 0; + var fn = function () { + calls += 1; + emitter.off('test', fn); + }; + + emitter.on('test', fn); + + emitter.on('test', function () { + calls += 1; + }); + + emitter.on('test', function () { + calls += 1; + }); + + process.nextTick(function () { + t.equal(calls, 3, 'all callbacks were called'); + t.end(); + }); + + emitter.emit('test'); +}); + +test('calling off before any events added does nothing', function (t) { + var emitter = new Emitter(); + emitter.off('test', function () {}); + t.end(); +}); + +test('emitting event that has not been subscribed to yet', function (t) { + var emitter = new Emitter(); + + emitter.emit('some-event', 'some message'); + t.end(); +}); + +test('unsubscribes single event with name and callback which was subscribed once', function (t) { + var emitter = new Emitter(); + var fn = function () { + t.fail('event not unsubscribed'); + } + + emitter.once('test', fn); + emitter.off('test', fn); + emitter.emit('test'); + + t.end(); +}); + +test('exports an instance', function (t) { + t.ok(emitter, 'exports an instance') + t.ok(emitter instanceof Emitter, 'an instance of the Emitter class'); + t.end(); +}); diff --git a/24_10_22_faktorialis/node_modules/tiny-emitter/yarn.lock b/24_10_22_faktorialis/node_modules/tiny-emitter/yarn.lock new file mode 100644 index 0000000..730a024 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/tiny-emitter/yarn.lock @@ -0,0 +1,1857 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@tap-format/exit@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@tap-format/exit/-/exit-0.2.0.tgz#b58736bc55d30802c012c5adfca51b47040310cd" + dependencies: + ramda "^0.18.0" + rx "^4.0.7" + +"@tap-format/failures@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@tap-format/failures/-/failures-0.2.0.tgz#bb6f5edc3bc3c57c62885bc7c214cc7abdfc2a07" + dependencies: + chalk "^1.1.1" + diff "^2.2.1" + figures "^1.4.0" + ramda "^0.18.0" + rx "^4.0.7" + +"@tap-format/parser@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@tap-format/parser/-/parser-0.2.0.tgz#bdc1d95e694781157593283bb3c3fec132a3115d" + dependencies: + duplexer "^0.1.1" + js-yaml "^3.4.6" + ramda "^0.18.0" + readable-stream "^2.0.4" + rx "^4.0.7" + rx-node "^1.0.1" + split "^1.0.0" + +"@tap-format/results@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@tap-format/results/-/results-0.2.0.tgz#192d64ac41f146fa2722db1c0a22ed80478f54fd" + dependencies: + chalk "^1.1.1" + hirestime "^1.0.6" + pretty-ms "^2.1.0" + rx "^4.0.7" + +"@tap-format/spec@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@tap-format/spec/-/spec-0.2.0.tgz#93f7d2f0dcefe526b4776800b9bd7f80db5aaec7" + dependencies: + "@tap-format/exit" "0.2.0" + "@tap-format/failures" "0.2.0" + "@tap-format/parser" "0.2.0" + "@tap-format/results" "0.2.0" + chalk "^1.1.1" + figures "^1.4.0" + rx "^4.0.7" + +Base64@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/Base64/-/Base64-0.2.1.tgz#ba3a4230708e186705065e66babdd4c35cf60028" + +JSONStream@^1.0.3: + version "1.3.2" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +JSONStream@~0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-0.6.4.tgz#4b2c8063f8f512787b2375f7ee9db69208fa2dcb" + dependencies: + jsonparse "0.0.5" + through "~2.2.7" + +JSONStream@~0.7.1: + version "0.7.4" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-0.7.4.tgz#734290e41511eea7c2cfe151fbf9a563a97b9786" + dependencies: + jsonparse "0.0.5" + through ">=2.2.7 <3" + +acorn-node@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b" + dependencies: + acorn "^5.4.1" + xtend "^4.0.1" + +acorn@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" + +acorn@^4.0.3: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +acorn@^5.2.1, acorn@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +assert@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.1.2.tgz#adaa04c46bb58c6dd1f294da3eb26e6228eb6e44" + dependencies: + util "0.10.3" + +assert@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.3.0.tgz#03939a622582a812cc202320a0b9a56c9b815849" + dependencies: + util "0.10.3" + +astw@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" + dependencies: + acorn "^4.0.3" + +async@~0.2.6: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.2.tgz#024f0f72afa25b75f9c0ee73cd4f55ec1bed9784" + +base64-js@0.0.8, base64-js@~0.0.4: + version "0.0.8" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + +bops@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/bops/-/bops-0.0.6.tgz#082d1d55fa01e60dbdc2ebc2dba37f659554cf3a" + dependencies: + base64-js "0.0.2" + to-utf8 "0.0.1" + +bouncy@~3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/bouncy/-/bouncy-3.2.2.tgz#82ab4ad7beae05890eed54b9af3c45394b185dc7" + dependencies: + optimist "~0.3.5" + through "~2.3.4" + +brace-expansion@^1.0.0, brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-launcher@~0.3.2: + version "0.3.5" + resolved "https://registry.yarnpkg.com/browser-launcher/-/browser-launcher-0.3.5.tgz#d9a3663fa064d8155044991c00e61dbcb6730a16" + dependencies: + headless "~0.1.3" + merge "~1.0.0" + minimist "0.0.5" + mkdirp "~0.3.3" + plist "0.2.1" + xtend "^4.0.0" + +browser-pack@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-5.0.1.tgz#4197719b20c6e0aaa09451c5111e53efb6fbc18d" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.6.1" + defined "^1.0.0" + through2 "^1.0.0" + umd "^3.0.0" + +browser-pack@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-2.0.1.tgz#5d1c527f56c582677411c4db2a128648ff6bf150" + dependencies: + JSONStream "~0.6.4" + combine-source-map "~0.3.0" + through "~2.3.4" + +browser-resolve@^1.7.0, browser-resolve@^1.7.1: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-resolve@~1.2.1, browser-resolve@~1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.2.4.tgz#59ae7820a82955ecd32f5fb7c468ac21c4723806" + dependencies: + resolve "0.6.3" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + +browserify@11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-11.2.0.tgz#a11bb9dd209d79572b813f7eeeaf828a5f5c0e4e" + dependencies: + JSONStream "^1.0.3" + assert "~1.3.0" + browser-pack "^5.0.0" + browser-resolve "^1.7.1" + browserify-zlib "~0.1.2" + buffer "^3.0.0" + builtins "~0.0.3" + commondir "0.0.1" + concat-stream "~1.4.1" + console-browserify "^1.1.0" + constants-browserify "~0.0.1" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^1.3.7" + domain-browser "~1.1.0" + duplexer2 "~0.0.2" + events "~1.0.0" + glob "^4.0.5" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "~0.0.0" + inherits "~2.0.1" + insert-module-globals "^6.4.1" + isarray "0.0.1" + labeled-stream-splicer "^1.0.0" + module-deps "^3.7.11" + os-browserify "~0.1.1" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^1.1.1" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "~0.0.1" + stream-browserify "^2.0.0" + stream-http "^1.2.0" + string_decoder "~0.10.0" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^1.0.0" + timers-browserify "^1.0.1" + tty-browserify "~0.0.0" + url "~0.10.1" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^4.0.0" + +browserify@3.x.x: + version "3.46.1" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-3.46.1.tgz#2c2e4a7f2f408178e78c223b5b57b37c2185ad8e" + dependencies: + JSONStream "~0.7.1" + assert "~1.1.0" + browser-pack "~2.0.0" + browser-resolve "~1.2.1" + browserify-zlib "~0.1.2" + buffer "~2.1.4" + builtins "~0.0.3" + commondir "0.0.1" + concat-stream "~1.4.1" + console-browserify "~1.0.1" + constants-browserify "~0.0.1" + crypto-browserify "~1.0.9" + deep-equal "~0.1.0" + defined "~0.0.0" + deps-sort "~0.1.1" + derequire "~0.8.0" + domain-browser "~1.1.0" + duplexer "~0.1.1" + events "~1.0.0" + glob "~3.2.8" + http-browserify "~1.3.1" + https-browserify "~0.0.0" + inherits "~2.0.1" + insert-module-globals "~6.0.0" + module-deps "~2.0.0" + os-browserify "~0.1.1" + parents "~0.0.1" + path-browserify "~0.0.0" + process "^0.7.0" + punycode "~1.2.3" + querystring-es3 "0.2.0" + resolve "~0.6.1" + shallow-copy "0.0.1" + shell-quote "~0.0.1" + stream-browserify "~0.1.0" + stream-combiner "~0.0.2" + string_decoder "~0.0.0" + subarg "0.0.1" + syntax-error "~1.1.0" + through2 "~0.4.1" + timers-browserify "~1.0.1" + tty-browserify "~0.0.0" + umd "~2.0.0" + url "~0.10.1" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^3.0.0" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^3.0.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb" + dependencies: + base64-js "0.0.8" + ieee754 "^1.1.4" + isarray "^1.0.0" + +buffer@~2.1.4: + version "2.1.13" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-2.1.13.tgz#c88838ebf79f30b8b4a707788470bea8a62c2355" + dependencies: + base64-js "~0.0.4" + ieee754 "~1.1.1" + +builtin-status-codes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-1.0.0.tgz#30637ee262978ac07174e16d7f82f0ad06e085ad" + +builtins@~0.0.3: + version "0.0.7" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-0.0.7.tgz#355219cd6cf18dbe7c01cc7fd2dce765cfdc549a" + +callsite@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +chalk@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +combine-source-map@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.3.0.tgz#d9e74f593d9cd43807312cb5d846d451efaa9eb7" + dependencies: + convert-source-map "~0.3.0" + inline-source-map "~0.3.0" + source-map "~0.1.31" + +combine-source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.6.1.tgz#9b4a09c316033d768e0f11e029fa2730e079ad96" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.5.0" + lodash.memoize "~3.0.3" + source-map "~0.4.2" + +commondir@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-0.0.1.tgz#89f00fdcd51b519c578733fec563e6a6da7f5be2" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-0.1.1.tgz#d7f4e278b90cfc4f0f3ef77fe4c03b40eb3f7900" + +concat-stream@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.0.1.tgz#018b18bc1c7d073a2dc82aa48442341a2c4dd79f" + dependencies: + bops "0.0.6" + +concat-stream@~1.4.1, concat-stream@~1.4.5: + version "1.4.10" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.4.10.tgz#acc3bbf5602cb8cc980c6ac840fa7d8603e3ef36" + dependencies: + inherits "~2.0.1" + readable-stream "~1.1.9" + typedarray "~0.0.5" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-browserify@~1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.0.3.tgz#d3898d2c3a93102f364197f8874b4f92b5286a8e" + +constants-browserify@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-0.0.1.tgz#92577db527ba6c4cf0a4568d84bc031f441e21f2" + +convert-source-map@~0.3.0: + version "0.3.5" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-ecdh@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + ripemd160 "^2.0.0" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.6" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +crypto-browserify@^3.0.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +crypto-browserify@~1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-1.0.9.tgz#cc5449685dfb85eb11c9828acc7cb87ab5bbfcc0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +decamelize@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-equal@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.0.0.tgz#99679d3bbd047156fcd450d3d01eeb9068691e83" + +deep-equal@~0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.1.2.tgz#b246c2b80a570a47c11be1d9bd1070ec878b87ce" + +deep-equal@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +defined@^1.0.0, defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +defined@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e" + +deps-sort@^1.3.7: + version "1.3.9" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-1.3.9.tgz#29dfff53e17b36aecae7530adbbbf622c2ed1a71" + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^1.0.0" + +deps-sort@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-0.1.2.tgz#daa2fb614a17c9637d801e2f55339ae370f3611a" + dependencies: + JSONStream "~0.6.4" + minimist "~0.0.1" + through "~2.3.4" + +derequire@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/derequire/-/derequire-0.8.0.tgz#c1f7f1da2cede44adede047378f03f444e9c4c0d" + dependencies: + esprima-fb "^3001.1.0-dev-harmony-fb" + esrefactor "~0.1.0" + estraverse "~1.5.0" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detective@^4.0.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + +detective@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-3.1.0.tgz#77782444ab752b88ca1be2e9d0a0395f1da25eed" + dependencies: + escodegen "~1.1.0" + esprima-fb "3001.1.0-dev-harmony-fb" + +diff@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" + +diffie-hellman@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +domain-browser@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +duplexer2@0.0.2, duplexer2@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" + +duplexer@^0.1.1, duplexer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +ecstatic@~0.4.5: + version "0.4.13" + resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-0.4.13.tgz#9cb6eaffe211b9c84efb3f553cde2c3002717b29" + dependencies: + ent "0.0.x" + mime "1.2.x" + optimist "~0.3.5" + +elliptic@^6.0.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +ent@0.0.x, ent@~0.0.5: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ent/-/ent-0.0.7.tgz#835d4e7f9e7a8d4921c692e9010ec976da5e9949" + +es-abstract@^1.5.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.1.0.tgz#c663923f6e20aad48d0c0fa49f31c6d4f49360cf" + dependencies: + esprima "~1.0.4" + estraverse "~1.5.0" + esutils "~1.0.0" + optionalDependencies: + source-map "~0.1.30" + +escope@~0.0.13: + version "0.0.16" + resolved "https://registry.yarnpkg.com/escope/-/escope-0.0.16.tgz#418c7a0afca721dafe659193fd986283e746538f" + dependencies: + estraverse ">= 0.0.2" + +esprima-fb@3001.1.0-dev-harmony-fb, esprima-fb@^3001.1.0-dev-harmony-fb: + version "3001.1.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz#b77d37abcd38ea0b77426bb8bc2922ce6b426411" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esprima@~1.0.2, esprima@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" + +esrefactor@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/esrefactor/-/esrefactor-0.1.0.tgz#d142795a282339ab81e936b5b7a21b11bf197b13" + dependencies: + escope "~0.0.13" + esprima "~1.0.2" + estraverse "~0.0.4" + +"estraverse@>= 0.0.2": + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +estraverse@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-0.0.4.tgz#01a0932dfee574684a598af5a67c3bf9b6428db2" + +estraverse@~1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71" + +esutils@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570" + +events@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/events/-/events-1.0.2.tgz#75849dcfe93d10fb057c30055afdbd51d06a8e24" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +figures@^1.4.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +function-bind@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.0.2.tgz#c2873b69c5e6d7cefae47d2555172926c8c2e05e" + +glob@^4.0.5: + version "4.5.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "^2.0.1" + once "^1.3.0" + +glob@~3.2.1, glob@~3.2.8: + version "3.2.11" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d" + dependencies: + inherits "2" + minimatch "0.3" + +glob@~5.0.3: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has@^1.0.0, has@^1.0.1, has@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hash-base@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" + dependencies: + inherits "^2.0.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +headless@~0.1.3: + version "0.1.7" + resolved "https://registry.yarnpkg.com/headless/-/headless-0.1.7.tgz#6e62fae668947f88184d5c156ede7c5695a7e9c8" + +hirestime@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/hirestime/-/hirestime-1.0.7.tgz#2d5271ea84356cec3f25da8c56a9402f8fc0a700" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + +http-browserify@~1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/http-browserify/-/http-browserify-1.3.2.tgz#b562c34479349a690d7a6597df495aefa8c604f5" + dependencies: + Base64 "~0.2.0" + inherits "~2.0.1" + +https-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" + +ieee754@^1.1.4, ieee754@~1.1.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +inline-source-map@~0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.3.1.tgz#a528b514e689fce90db3089e870d92f527acb5eb" + dependencies: + source-map "~0.3.0" + +inline-source-map@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.5.0.tgz#4a4c5dd8e4fb5e9b3cda60c822dfadcaee66e0af" + dependencies: + source-map "~0.4.0" + +insert-module-globals@^6.4.1: + version "6.6.3" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-6.6.3.tgz#20638e29a30f9ed1ca2e3a825fbc2cba5246ddfc" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.6.1" + concat-stream "~1.4.1" + is-buffer "^1.1.0" + lexical-scope "^1.2.0" + process "~0.11.0" + through2 "^1.0.0" + xtend "^4.0.0" + +insert-module-globals@~6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-6.0.0.tgz#ee8aeb9dee16819e33aa14588a558824af0c15dc" + dependencies: + JSONStream "~0.7.1" + concat-stream "~1.4.1" + lexical-scope "~1.1.0" + process "~0.6.0" + through "~2.3.4" + xtend "^3.0.0" + +is-buffer@^1.1.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-finite@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +isarray@0.0.1, isarray@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +js-yaml@^3.4.6: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-stable-stringify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + dependencies: + jsonify "~0.0.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonparse@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-0.0.5.tgz#330542ad3f0a654665b778f3eb2d9a9fa507ac64" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + +labeled-stream-splicer@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-1.0.2.tgz#4615331537784981e8fd264e1f3a434c4e0ddd65" + dependencies: + inherits "^2.0.1" + isarray "~0.0.1" + stream-splicer "^1.1.0" + +lexical-scope@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" + dependencies: + astw "^2.0.0" + +lexical-scope@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.1.1.tgz#debac1067435f1359d90fcfd9e94bcb2ee47b2bf" + dependencies: + astw "^2.0.0" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +md5.js@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +merge@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.0.0.tgz#b443ab46d837c491e6222056ab0f7933ecb3568f" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime@1.2.x: + version "1.2.11" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.2.11.tgz#58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10" + +minimalistic-assert@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@0.3: + version "0.3.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +"minimatch@2 || 3": + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@^2.0.1: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" + dependencies: + brace-expansion "^1.0.0" + +minimist@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.5.tgz#d7aa327bcecf518f9106ac6b8f003fa3bcea8566" + +minimist@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1, minimist@~0.0.7, minimist@~0.0.9: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +mkdirp@~0.3.3: + version "0.3.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.5.tgz#de3e5f8961c88c787ee1368df849ac4413eca8d7" + +module-deps@^3.7.11: + version "3.9.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-3.9.1.tgz#ea75caf9199090d25b0d5512b5acacb96e7f87f3" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + concat-stream "~1.4.5" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "0.0.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^1.1.13" + resolve "^1.1.3" + stream-combiner2 "~1.0.0" + subarg "^1.0.0" + through2 "^1.0.0" + xtend "^4.0.0" + +module-deps@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-2.0.6.tgz#b999321c73ac33580f00712c0f3075fdca42563f" + dependencies: + JSONStream "~0.7.1" + browser-resolve "~1.2.4" + concat-stream "~1.4.5" + detective "~3.1.0" + duplexer2 "0.0.2" + inherits "~2.0.1" + minimist "~0.0.9" + parents "0.0.2" + readable-stream "^1.0.27-1" + resolve "~0.6.3" + stream-combiner "~0.1.0" + through2 "~0.4.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-inspect@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-0.1.3.tgz#d05a65c2e34fe8225d9fda2e484e4e47b7e2f490" + dependencies: + tape "~1.0.4" + +object-inspect@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.0.2.tgz#a97885b553e575eb4009ebc09bdda9b1cd21979a" + +object-keys@^1.0.4, object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@~0.3.5: + version "0.3.7" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" + dependencies: + wordwrap "~0.0.2" + +optimist@~0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.5.2.tgz#85c8c1454b3315e4a78947e857b1df033450bfbc" + dependencies: + wordwrap "~0.0.2" + +ordered-emitter@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ordered-emitter/-/ordered-emitter-0.1.1.tgz#aa20bdafbdcc1631834a350f68b4ef8eb34eed7b" + +os-browserify@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" + +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +parents@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/parents/-/parents-0.0.2.tgz#67147826e497d40759aaf5ba4c99659b6034d302" + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + dependencies: + path-platform "~0.11.15" + +parents@~0.0.1: + version "0.0.3" + resolved "https://registry.yarnpkg.com/parents/-/parents-0.0.3.tgz#fa212f024d9fa6318dbb6b4ce676c8be493b9c43" + dependencies: + path-platform "^0.0.1" + +parse-asn1@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +parse-ms@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-1.0.1.tgz#56346d4749d78f23430ca0c713850aef91aa361d" + +path-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-platform@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.0.1.tgz#b5585d7c3c463d89aa0060d86611cf1afd617e2a" + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + +pbkdf2@^3.0.3: + version "3.0.14" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +plist@0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/plist/-/plist-0.2.1.tgz#f3a3de07885d773e66d8a96782f1bec28cf2b2d0" + dependencies: + sax "0.1.x" + +plur@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/plur/-/plur-1.0.0.tgz#db85c6814f5e5e5a3b49efc28d604fec62975156" + +pretty-ms@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-2.1.0.tgz#4257c256df3fb0b451d6affaab021884126981dc" + dependencies: + is-finite "^1.0.1" + parse-ms "^1.0.0" + plur "^1.0.0" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +process@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/process/-/process-0.7.0.tgz#c52208161a34adf3812344ae85d3e6150469389d" + +process@~0.11.0: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +process@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + +process@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/process/-/process-0.6.0.tgz#7dd9be80ffaaedd4cb628f1827f1cbab6dc0918f" + +public-encrypt@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.3.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@~1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.2.4.tgz#54008ac972aec74175def9cba6df7fa9d3918740" + +querystring-es3@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.0.tgz#c365a08a69c443accfeb3a9deab35e3f0abaa476" + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +ramda@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.18.0.tgz#c6e3c5d4b9ab1f7906727fdeeb039152a85d4db3" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +read-only-stream@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-1.1.1.tgz#5da77c799ed1388d3ef88a18471bb5924f8a0ba1" + dependencies: + readable-stream "^1.0.31" + readable-wrap "^1.0.0" + +"readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0.27-1, readable-stream@^1.0.31, readable-stream@^1.1.13, readable-stream@^1.1.13-1, readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.2, readable-stream@^2.0.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readable-stream@~1.0.17: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-wrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/readable-wrap/-/readable-wrap-1.0.0.tgz#3b5a211c631e12303a54991c806c17e7ae206bff" + dependencies: + readable-stream "^1.1.13-1" + +resolve@0.6.3, resolve@~0.6.1, resolve@~0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.3, resolve@^1.1.4: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + +resolve@~0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.3.1.tgz#34c63447c664c70598d1c9b126fc43b2a24310a4" + +resolve@~0.4.0: + version "0.4.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.4.3.tgz#dcadad202e7cacc2467e3a38800211f42f9c13df" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +rfile@~1.0, rfile@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/rfile/-/rfile-1.0.0.tgz#59708cf90ca1e74c54c3cfc5c36fdb9810435261" + dependencies: + callsite "~1.0.0" + resolve "~0.3.0" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" + dependencies: + hash-base "^2.0.0" + inherits "^2.0.1" + +ruglify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ruglify/-/ruglify-1.0.0.tgz#dc8930e2a9544a274301cc9972574c0d0986b675" + dependencies: + rfile "~1.0" + uglify-js "~2.2" + +rx-node@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/rx-node/-/rx-node-1.0.2.tgz#151240725a79e857360ab06cc626799965e094de" + dependencies: + rx "*" + +rx@*, rx@^4.0.7: + version "4.1.0" + resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +sax@0.1.x: + version "0.1.5" + resolved "https://registry.yarnpkg.com/sax/-/sax-0.1.5.tgz#d1829a6120fa01665eb4dbff6c43f29fd6d61471" + +sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: + version "2.4.10" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shallow-copy@0.0.1, shallow-copy@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" + +shasum@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + dependencies: + json-stable-stringify "~0.0.0" + sha.js "~2.4.4" + +shell-quote@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-0.0.1.tgz#1a41196f3c0333c482323593d6886ecf153dd986" + +shell-quote@~1.3.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.3.3.tgz#07b8826f427c052511e8b5627639e172596e8e4b" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +source-map@0.1.34: + version "0.1.34" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.34.tgz#a7cfe89aec7b1682c3b198d0acfb47d7d090566b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.1.30, source-map@~0.1.31, source-map@~0.1.7: + version "0.1.43" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.3.0.tgz#8586fb9a5a005e5b501e21cd18b6f21b457ad1f9" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.4.0, source-map@~0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +split@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + dependencies: + through "2" + +split@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/split/-/split-0.1.2.tgz#f0710744c453d551fc7143ead983da6014e336cc" + dependencies: + through "1" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +stream-browserify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-browserify@~0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-0.1.3.tgz#95cf1b369772e27adaf46352265152689c6c4be9" + dependencies: + inherits "~2.0.1" + process "~0.5.1" + +stream-combiner2@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.0.2.tgz#ba72a6b50cbfabfa950fc8bc87604bd01eb60671" + dependencies: + duplexer2 "~0.0.2" + through2 "~0.5.1" + +stream-combiner@~0.0.2: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + dependencies: + duplexer "~0.1.1" + +stream-combiner@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.1.0.tgz#0dc389a3c203f8f4d56368f95dde52eb9269b5be" + dependencies: + duplexer "~0.1.1" + through "~2.3.4" + +stream-http@^1.2.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-1.7.1.tgz#d3d2a6e14c36a38b9dafb199aee7bbc570519978" + dependencies: + builtin-status-codes "^1.0.0" + foreach "^2.0.5" + indexof "0.0.1" + inherits "^2.0.1" + object-keys "^1.0.4" + xtend "^4.0.0" + +stream-splicer@^1.1.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-1.3.2.tgz#3c0441be15b9bf4e226275e6dc83964745546661" + dependencies: + indexof "0.0.1" + inherits "^2.0.1" + isarray "~0.0.1" + readable-stream "^1.1.13-1" + readable-wrap "^1.0.0" + through2 "^1.0.0" + +string.prototype.trim@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +string_decoder@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.0.1.tgz#f5472d0a8d1650ec823752d24e6fd627b39bf141" + +string_decoder@~0.10.0, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +subarg@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-0.0.1.tgz#3d56b07dacfbc45bbb63f7672b43b63e46368e3a" + dependencies: + minimist "~0.0.7" + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + dependencies: + minimist "^1.1.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +syntax-error@^1.1.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" + dependencies: + acorn-node "^1.2.0" + +syntax-error@~1.1.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.1.6.tgz#b4549706d386cc1c1dc7c2423f18579b6cade710" + dependencies: + acorn "^2.7.0" + +tap-finished@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tap-finished/-/tap-finished-0.0.1.tgz#08b5b543fdc04830290c6c561279552e71c4bd67" + dependencies: + tap-parser "~0.2.0" + through "~2.3.4" + +tap-parser@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-0.2.1.tgz#8e1e823f2114ee21d032e2f31e4fb642a296f50b" + dependencies: + split "~0.1.2" + +tape@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.2.1.tgz#1a0ed63cc86bfaa84ebb3bb311f09d8520416216" + dependencies: + deep-equal "~1.0.0" + defined "~1.0.0" + function-bind "~1.0.2" + glob "~5.0.3" + has "~1.0.1" + inherits "~2.0.1" + object-inspect "~1.0.0" + resumer "~0.0.0" + string.prototype.trim "^1.1.1" + through "~2.3.4" + +tape@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tape/-/tape-1.0.4.tgz#e2e8e5c6dd3f00fdc2a5e4514f62fc221e59f9c4" + dependencies: + deep-equal "~0.0.0" + defined "~0.0.0" + jsonify "~0.0.0" + through "~2.3.4" + +testling@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/testling/-/testling-1.7.1.tgz#bfcfa877c8b15dd28d920692c03d8d64ca47874e" + dependencies: + bouncy "~3.2.0" + browser-launcher "~0.3.2" + browserify "3.x.x" + concat-stream "~1.0.0" + ecstatic "~0.4.5" + ent "~0.0.5" + glob "~3.2.1" + jsonify "~0.0.0" + object-inspect "~0.1.3" + optimist "~0.5.2" + resolve "~0.4.0" + shallow-copy "~0.0.0" + shell-quote "~1.3.1" + tap-finished "~0.0.0" + win-spawn "~2.0.0" + xhr-write-stream "~0.1.2" + +through2@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-1.1.1.tgz#0847cbc4449f3405574dbdccd9bb841b83ac3545" + dependencies: + readable-stream ">=1.1.13-1 <1.2.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through2@~0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" + dependencies: + readable-stream "~1.0.17" + xtend "~2.1.1" + +through2@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7" + dependencies: + readable-stream "~1.0.17" + xtend "~3.0.0" + +through@1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/through/-/through-1.1.2.tgz#344a5425a3773314ca7e0eb6512fbafaf76c0bfe" + +through@2, "through@>=2.2.7 <3", through@~2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +through@~2.2.7: + version "2.2.7" + resolved "https://registry.yarnpkg.com/through/-/through-2.2.7.tgz#6e8e21200191d4eb6a99f6f010df46aa1c6eb2bd" + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +timers-browserify@~1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.0.3.tgz#ffba70c9c12eed916fd67318e629ac6f32295551" + dependencies: + process "~0.5.1" + +to-utf8@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/to-utf8/-/to-utf8-0.0.1.tgz#d17aea72ff2fba39b9e43601be7b3ff72e089852" + +tty-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + +typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.5.0.tgz#4ab5d65a4730ecb7a4fb62d3f499e2054d98fba1" + dependencies: + async "~0.2.6" + source-map "~0.5.1" + uglify-to-browserify "~1.0.0" + yargs "~3.5.4" + +uglify-js@~2.2: + version "2.2.5" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.2.5.tgz#a6e02a70d839792b9780488b7b8b184c095c99c7" + dependencies: + optimist "~0.3.5" + source-map "~0.1.7" + +uglify-js@~2.4.0: + version "2.4.24" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.4.24.tgz#fad5755c1e1577658bb06ff9ab6e548c95bebd6e" + dependencies: + async "~0.2.6" + source-map "0.1.34" + uglify-to-browserify "~1.0.0" + yargs "~3.5.4" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +umd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + +umd@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/umd/-/umd-2.0.0.tgz#749683b0d514728ae0e1b6195f5774afc0ad4f8f" + dependencies: + rfile "~1.0.0" + ruglify "~1.0.0" + through "~2.3.4" + uglify-js "~2.4.0" + +url@~0.10.1: + version "0.10.3" + resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3, util@~0.10.1: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +vm-browserify@~0.0.1: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +win-spawn@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/win-spawn/-/win-spawn-2.0.0.tgz#397a29130ec98d0aa0bc86baa4621393effd0b07" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xhr-write-stream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/xhr-write-stream/-/xhr-write-stream-0.1.2.tgz#e357848e0d039b411fdd5b3bf81be47ee5ce26aa" + dependencies: + concat-stream "~0.1.0" + ordered-emitter "~0.1.0" + +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +xtend@^3.0.0, xtend@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" + +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + dependencies: + object-keys "~0.4.0" + +yargs@~3.5.4: + version "3.5.4" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.5.4.tgz#d8aff8f665e94c34bd259bdebd1bfaf0ddd35361" + dependencies: + camelcase "^1.0.2" + decamelize "^1.0.0" + window-size "0.1.0" + wordwrap "0.0.2" diff --git a/24_10_22_faktorialis/node_modules/typed-function/LICENSE b/24_10_22_faktorialis/node_modules/typed-function/LICENSE new file mode 100644 index 0000000..ce81010 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Jos de Jong + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/24_10_22_faktorialis/node_modules/typed-function/README.md b/24_10_22_faktorialis/node_modules/typed-function/README.md new file mode 100644 index 0000000..d05204e --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/README.md @@ -0,0 +1,605 @@ +# typed-function + +[![Version](https://img.shields.io/npm/v/typed-function.svg)](https://www.npmjs.com/package/typed-function) +[![Downloads](https://img.shields.io/npm/dm/typed-function.svg)](https://www.npmjs.com/package/typed-function) +[![Build Status](https://github.com/josdejong/typed-function/workflows/Node.js%20CI/badge.svg)](https://github.com/josdejong/typed-function/actions) + +Move type checking logic and type conversions outside of your function in a +flexible, organized way. Automatically throw informative errors in case of +wrong input arguments. + + +## Features + +typed-function has the following features: + +- Runtime type-checking of input arguments. +- Automatic type conversion of arguments. +- Compose typed functions with multiple signatures. +- Supports union types, any type, and variable arguments. +- Detailed error messaging. + +Supported environments: node.js, Chrome, Firefox, Safari, Opera, IE11+. + + +## Why? + +In JavaScript, functions can be called with any number and any type of arguments. +When writing a function, the easiest way is to just assume that the function +will be called with the correct input. This leaves the function's behavior on +invalid input undefined. The function may throw some error, or worse, +it may silently fail or return wrong results. Typical errors are +*TypeError: undefined is not a function* or *TypeError: Cannot call method +'request' of undefined*. These error messages are not very helpful. It can be +hard to debug them, as they can be the result of a series of nested function +calls manipulating and propagating invalid or incomplete data. + +Often, JavaScript developers add some basic type checking where it is important, +using checks like `typeof fn === 'function'`, `date instanceof Date`, and +`Array.isArray(arr)`. For functions supporting multiple signatures, +the type checking logic can grow quite a bit, and distract from the actual +logic of the function. + +For functions dealing with a considerable amount of type checking and conversion +logic, or functions facing a public API, it can be very useful to use the +`typed-function` module to handle the type-checking logic. This way: + +- Users of the function get useful and consistent error messages when using + the function wrongly. +- The function cannot silently fail or silently give wrong results due to + invalid input. +- Correct type of input is assured inside the function. The function's code + becomes easier to understand as it only contains the actual function logic. + Lower level utility functions called by the type-checked function can + possibly be kept simpler as they don't need to do additional type checking. + +It's important however not to *overuse* type checking: + +- Locking down the type of input that a function accepts can unnecessarily + limit its flexibility. Keep functions as flexible and forgiving as possible, + follow the + [robustness principle](http://en.wikipedia.org/wiki/Robustness_principle) + here: "be liberal in what you accept and conservative in what you send" + (Postel's law). +- There is no need to apply type checking to *all* functions. It may be + enough to apply type checking to one tier of public facing functions. +- There is a performance penalty involved for all type checking, so applying + it everywhere can unnecessarily worsen the performance. + + +## Load + +Install via npm: + + npm install typed-function + + +## Usage + +Here are some usage examples. More examples are available in the +[/examples](/examples) folder. + +```js +import typed from 'typed-function' + +// create a typed function +var fn1 = typed({ + 'number, string': function (a, b) { + return 'a is a number, b is a string'; + } +}); + +// create a typed function with multiple types per argument (type union) +var fn2 = typed({ + 'string, number | boolean': function (a, b) { + return 'a is a string, b is a number or a boolean'; + } +}); + +// create a typed function with any type argument +var fn3 = typed({ + 'string, any': function (a, b) { + return 'a is a string, b can be anything'; + } +}); + +// create a typed function with multiple signatures +var fn4 = typed({ + 'number': function (a) { + return 'a is a number'; + }, + 'number, boolean': function (a, b) { + return 'a is a number, b is a boolean'; + }, + 'number, number': function (a, b) { + return 'a is a number, b is a number'; + } +}); + +// create a typed function from a plain function with signature +function fnPlain (a, b) { + return 'a is a number, b is a string'; +} + +fnPlain.signature = 'number, string'; +var fn5 = typed(fnPlain); + +// use the functions +console.log(fn1(2, 'foo')); // outputs 'a is a number, b is a string' +console.log(fn4(2)); // outputs 'a is a number' + +// calling the function with a non-supported type signature will throw an error +try { + fn2('hello', 'world'); +} catch (err) { + console.log(err.toString()); + // outputs: TypeError: Unexpected type of argument. + // Expected: number or boolean, actual: string, index: 1. +} +``` + + +## Types + +typed-function has the following built-in types: + +- `null` +- `boolean` +- `number` +- `string` +- `Function` +- `Array` +- `Date` +- `RegExp` +- `Object` + +The following type expressions are supported: + +- Multiple arguments: `string, number, Function` +- Union types: `number | string` +- Variable arguments: `...number` +- Any type: `any` + +### Dispatch + +When a typed function is called, an implementation with a matching signature +is called, where conversions may be applied to actual arguments in order to +find a match. + +Among all matching signatures, the one to execute is chosen by the following +preferences, in order of priority: + +* one that does not have an `...any` parameter +* one with the fewest `any` parameters +* one that does not use conversions to match a rest parameter +* one with the fewest conversions needed to match overall +* one with no rest parameter +* If there's a rest parameter, the one with the most non-rest parameters +* The one with the largest number of preferred parameters +* The one with the earliest preferred parameter + +When this process gets to the point of comparing individual parameters, +the preference between parameters is determined by the following, in +priority order: + +* All specific types are preferred to the 'any' type +* All directly matching types are preferred to conversions +* Types earlier in the list of known types are preferred +* Among conversions, ones earlier in the list are preferred + +If none of these aspects produces a preference, then in those contexts in +which Array.sort is stable, the order implementations were listed when +the typed-function was created breaks the tie. Otherwise the dispatch may +select any of the "tied" implementations. + +## API + +### Construction + +``` +typed([name: string], ...Object.|function) +``` +A typed function can be constructed from an optional name and any number of +(additional) arguments that supply the implementations for various +signatures. Each of these further arguments must be one of the following: + +- An object with one or multiple signatures, i.e. a plain object + with string keys, each of which names a signature, and functions as + the values of those keys. + +- A previously constructed typed function, in which case all of its + signatures and corresponding implementations are merged into the new + typed function. + +- A plain function with a `signature` property whose value is a string + giving that function's signature. + +The name, if specified, must be the first argument. If not specified, the new +typed-function's name is inherited from the arguments it is composed from, +as long as any that have names agree with one another. + +If the same signature is specified by the collection of arguments more than +once with different implementations, an error will be thrown. + +#### Properties and methods of a typed function `fn` + +- `fn.name : string` + + The name of the typed function, if one was assigned at creation; otherwise, + the value of this property is the empty string. + +- `fn.signatures : Object.` + + The value of this property is a plain object. Its keys are the string + signatures on which this typed function `fn` is directly defined + (without conversions). The value for each key is the function `fn` + will call when its arguments match that signature. This property may + differ from the similar object used to create the typed function, + in that the originally provided signatures are parsed into a canonical, + more usable form: union types are split into their constituents where + possible, whitespace in the signature strings is removed, etc. + +- `fn.toString() : string` + + Returns human-readable code showing exactly what the function does. + Mostly for debugging purposes. + +### Methods of the typed package + +- `typed.convert(value: *, type: string) : *` + + Convert a value to another type. Only applicable when conversions have + been added with `typed.addConversion()` and/or `typed.addConversions()` + (see below in the method list). + Example: + + ```js + typed.addConversion({ + from: 'number', + to: 'string', + convert: function (x) { + return +x; + } + }); + + var str = typed.convert(2.3, 'string'); // '2.3' + ``` + +- `typed.create() : function` + + Create a new, isolated instance of typed-function. Example: + + ```js + import typed from 'typed-function.mjs'; // default instance + const typed2 = typed.create(); // a second instance + ``` + + This would allow you, for example, to have two different type hierarchies + for different purposes. + +- `typed.resolve(fn: typed-function, argList: Array): signature-object` + + Find the specific signature and implementation that the typed function + `fn` will call if invoked on the argument list `argList`. Returns null if + there is no matching signature. The returned signature object has + properties `params`, `test`, `fn`, and `implementation`. The difference + between the last two properties is that `fn` is the original function + supplied at typed-function creation time, whereas `implementation` is + ready to be called on this specific argList, in that it will first + perform any necessary conversions and gather arguments up into "rest" + parameters as needed. + + Thus, in the case that arguments `a0`,`a1`,`a2` (say) do match one of + the signatures of this typed function `fn`, then `fn(a0, a1, a2)` + (in a context in which `this` will be, say, `t`) does exactly the same + thing as + + `typed.resolve(fn, [a0,a1,a2]).implementation.apply(t, [a0,a1,a2])`. + + But `resolve` is useful if you want to interpose any other operation + (such as bookkeeping or additional custom error checking) between + signature selection and execution dispatch. + +- `typed.findSignature(fn: typed-function, signature: string | Array, options: object) : signature-object` + + Find the signature object (as returned by `typed.resolve` above), but + based on the specification of a signature (given either as a + comma-separated string of parameter types, or an Array of strings giving + the parameter types), rather than based on an example argument list. + + The optional third argument, is a plain object giving options controlling + the search. Currently, the only implemented option is `exact`, which if + true (defaults to false), limits the search to exact type matches, + i.e. signatures for which no conversion functions need to be called in + order to apply the function. + + Throws an error if the signature is not found. + +- `typed.find(fn: typed-function, signature: string | Array, options: object) : function` + + Convenience method that returns just the implementation from the + signature object produced by `typed.findSignature(fn, signature, options)`. + + For example: + + ```js + var fn = typed(...); + var f = typed.find(fn, ['number', 'string']); + var f = typed.find(fn, 'number, string', 'exact'); + ``` + +- `typed.referTo(...string, callback: (resolvedFunctions: ...function) => function)` + + Within the definition of a typed-function, resolve references to one or + multiple signatures of the typed-function itself. This looks like: + + ``` + typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) { + // ... use the resolved signatures fn1, fn2, ... + }); + ``` + + Example usage: + + ```js + const fn = typed({ + 'number': function (value) { + return 'Input was a number: ' + value; + }, + 'boolean': function (value) { + return 'Input was a boolean: ' + value; + }, + 'string': typed.referTo('number', 'boolean', (fnNumber, fnBoolean) => { + return function fnString(value) { + // here we use the signatures of the typed-function directly: + if (value === 'true') { + return fnBoolean(true); + } + if (value === 'false') { + return fnBoolean(false); + } + return fnNumber(parseFloat(value)); + } + }) + }); + ``` + + See also `typed.referToSelf(callback)`. + +- `typed.referToSelf(callback: (self) => function)` + + Refer to the typed-function itself. This can be used for recursive calls. + Calls to self will incur the overhead of fully re-dispatching the + typed-function. If the signature that needs to be invoked is already known, + you can use `typed.referTo(...)` instead for better performance. + + > In `typed-function@2` it was possible to use `this(...)` to reference the typed-function itself. In `typed-function@v3`, such usage is replaced with the `typed.referTo(...)` and `typed.referToSelf(...)` methods. Typed-functions are unbound in `typed-function@v3` and can be bound to another context if needed. + +- `typed.isTypedFunction(entity: any): boolean` + + Return true if the given entity appears to be a typed function + (created by any instance of typed-function), and false otherwise. It + tests for the presence of a particular property on the entity, + and so could be deceived by another object with the same property, although + the property is chosen so that's unlikely to happen unintentionally. + +- `typed.addType(type: {name: string, test: function, [, beforeObjectTest=true]): void` + + Add a new type. A type object contains a name and a test function. + The order of the types determines in which order function arguments are + type-checked, so for performance it's important to put the most used types + first. Also, if one type is contained in another, it should likely precede + it in the type order so that it won't be masked in type testing. + + Example: + + ```js + function Person(...) { + ... + } + + Person.prototype.isPerson = true; + + typed.addType({ + name: 'Person', + test: function (x) { + return x && x.isPerson === true; + } + }); + ``` + + By default, the new type will be inserted before the `Object` test + because the `Object` test also matches arrays and classes and hence + `typed-function` would never reach the new type. When `beforeObjectTest` + is `false`, the new type will be added at the end of all tests. + +- `typed.addTypes(types: TypeDef[] [, before = 'any']): void` + + Adds an list of new types. Each entry of the `types` array is an object + like the `type` argument to `typed.addType`. The optional `before` argument + is similar to `typed.addType` as well, except it should be the name of an + arbitrary type that has already been added (rather than just a boolean flag) + +- `typed.clear(): void` + + Removes all types and conversions from the typed instance. Note that any + typed-functions created before a call to `clear` will still operate, but + they may prouce unintelligible messages in case of type mismatch errors. + +- `typed.addConversion(conversion: {from: string, to: string, convert: function}, options?: { override: boolean }) : void` + + Add a new conversion. + + ```js + typed.addConversion({ + from: 'boolean', + to: 'number', + convert: function (x) { + return +x; + }); + ``` + + Note that any typed functions created before this conversion is added will + not have their arguments undergo this new conversion automatically, so it is + best to add all of your desired automatic conversions before defining any + typed functions. + +- `typed.addConversions(conversions: ConversionDef[], options?: { override: boolean }): void` + + Convenience method that adds a list of conversions. Each element in the + `conversions` array should be an object like the `conversion` argument of + `typed.addConversion`. + +- `typed.removeConversion(conversion: ConversionDef): void` + + Removes a single existing conversion. An error is thrown if there is no + conversion from and to the given types with a strictly equal convert + function as supplied in this call. + +- `typed.clearConversions(): void` + + Removes all conversions from the typed instance (leaving the types alone). + +- `typed.createError(name: string, args: Array., signatures: Array.): TypeError` + + Generates a custom error object reporting the problem with calling + the typed function of the given `name` with the given `signatures` on the + actual arguments `args`. Note the error object has an extra property `data` + giving the details of the problem. This method is primarily useful in + writing your own handler for a type mismatch (see the `typed.onMismatch` + property below), in case you have tried to recover but end up deciding + you want to throw the error that the default handler would have. + +### Properties + +- `typed.onMismatch: function` + + The handler called when a typed-function call fails to match with any + of its signatures. The handler is called with three arguments: the name + of the typed function being called, the actual argument list, and an array + of the signatures for the typed function being called. (Each signature is + an object with property 'signature' giving the actual signature and\ + property 'fn' giving the raw function for that signature.) The default + value of `onMismatch` is `typed.throwMismatchError`. + + This can be useful if you have a collection of functions and have common + behavior for any invalid call. For example, you might just want to log + the problem and continue: + + ``` + const myErrorLog = []; + typed.onMismatch = (name, args, signatures) => { + myErrorLog.push(`Invalid call of ${name} with ${args.length} arguments.`); + return null; + }; + typed.sqrt(9); // assuming definition as above, will return 3 + typed.sqrt([]); // no error will be thrown; will return null. + console.log(`There have been ${myErrorLog.length} invalid calls.`) + ``` + + Note that there is only one `onMismatch` handler at a time; assigning a + new value discards the previous handler. To restore the default behavior, + just assign `typed.onMismatch = typed.throwMismatchError`. + + Finally note that this handler fires whenever _any_ typed function call + does not match any of its signatures. You can in effect define such a + "handler" for a _single_ typed function by simply specifying an + implementation for the `...` signature: + + ``` + const lenOrNothing = typed({ + string: s => s.length, + '...': () => 0 + }); + console.log(lenOrNothing('Hello, world!')) // Output: 13 + console.log(lenOrNothing(57, 'varieties')) // Output: 0 + ``` + +- `typed.warnAgainstDeprecatedThis: boolean` + + Since `typed-function` v3, self-referencing a typed function using + `this(...)` or `this.signatures` has been deprecated and replaced with + the functions `typed.referTo` and `typed.referToSelf`. By default, all + function bodies will be scanned against this deprecated usage pattern and + an error will be thrown when encountered. To disable this validation step, + change this option to `false`. + +### Recursion + +The `this` keyword can be used to self-reference the typed-function: + +```js +var sqrt = typed({ + 'number': function (value) { + return Math.sqrt(value); + }, + 'string': function (value) { + // on the following line we self reference the typed-function using "this" + return this(parseInt(value, 10)); + } +}); + +// use the typed function +console.log(sqrt('9')); // output: 3 +``` + + +## Roadmap + +### Version 4 + +- Extend function signatures: + - Optional arguments like `'[number], array'` or like `number=, array` + - Nullable arguments like `'?Object'` +- Allow conversions to fail (for example string to number is not always + possible). Call this `fallible` or `optional`? + +### Version 5 + +- Extend function signatures: + - Constants like `'"linear" | "cubic"'`, `'0..10'`, etc. + - Object definitions like `'{name: string, age: number}'` + - Object definitions like `'Object.'` + - Array definitions like `'Array.'` +- Improve performance of both generating a typed function as well as + the performance and memory footprint of a typed function. + + +## Test + +To test the library, run: + + npm test + + +## Code style and linting + +The library is using the [standardjs](https://standardjs.com/) coding style. + +To test the code style, run: + + npm run lint + +To automatically fix most of the styling issues, run: + + npm run format + + +## Publish + +1. Describe the changes in `HISTORY.md` +2. Increase the version number in `package.json` +3. Test and build: + ``` + npm install + npm run build-and-test + ``` +4. Verify whether the generated output works correctly by opening + `./test/browserEsmBuild.html` in your browser. +5. Commit the changes +6. Merge `develop` into `master`, and push `master` +7. Create a git tag, and push this +8. publish the library: + ``` + npm publish + ``` diff --git a/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs b/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs new file mode 100644 index 0000000..bc5bac5 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs @@ -0,0 +1,1907 @@ +function ok() { + return true; +} +function notOk() { + return false; +} +function undef() { + return undefined; +} +const NOT_TYPED_FUNCTION = 'Argument is not a typed-function.'; + +/** + * @typedef {{ + * params: Param[], + * fn: function, + * test: function, + * implementation: function + * }} Signature + * + * @typedef {{ + * types: Type[], + * hasAny: boolean, + * hasConversion: boolean, + * restParam: boolean + * }} Param + * + * @typedef {{ + * name: string, + * typeIndex: number, + * test: function, + * isAny: boolean, + * conversion?: ConversionDef, + * conversionIndex: number, + * }} Type + * + * @typedef {{ + * from: string, + * to: string, + * convert: function (*) : * + * }} ConversionDef + * + * @typedef {{ + * name: string, + * test: function(*) : boolean, + * isAny?: boolean + * }} TypeDef + */ + +/** + * @returns {() => function} + */ +function create() { + // data type tests + + /** + * Returns true if the argument is a non-null "plain" object + */ + function isPlainObject(x) { + return typeof x === 'object' && x !== null && x.constructor === Object; + } + const _types = [{ + name: 'number', + test: function (x) { + return typeof x === 'number'; + } + }, { + name: 'string', + test: function (x) { + return typeof x === 'string'; + } + }, { + name: 'boolean', + test: function (x) { + return typeof x === 'boolean'; + } + }, { + name: 'Function', + test: function (x) { + return typeof x === 'function'; + } + }, { + name: 'Array', + test: Array.isArray + }, { + name: 'Date', + test: function (x) { + return x instanceof Date; + } + }, { + name: 'RegExp', + test: function (x) { + return x instanceof RegExp; + } + }, { + name: 'Object', + test: isPlainObject + }, { + name: 'null', + test: function (x) { + return x === null; + } + }, { + name: 'undefined', + test: function (x) { + return x === undefined; + } + }]; + const anyType = { + name: 'any', + test: ok, + isAny: true + }; + + // Data structures to track the types. As these are local variables in + // create(), each typed universe will get its own copy, but the variables + // will only be accessible through the (closures of the) functions supplied + // as properties of the typed object, not directly. + // These will be initialized in clear() below + let typeMap; // primary store of all types + let typeList; // Array of just type names, for the sake of ordering + + // And similar data structures for the type conversions: + let nConversions = 0; + // the actual conversions are stored on a property of the destination types + + // This is a temporary object, will be replaced with a function at the end + let typed = { + createCount: 0 + }; + + /** + * Takes a type name and returns the corresponding official type object + * for that type. + * + * @param {string} typeName + * @returns {TypeDef} type + */ + function findType(typeName) { + const type = typeMap.get(typeName); + if (type) { + return type; + } + // Remainder is error handling + let message = 'Unknown type "' + typeName + '"'; + const name = typeName.toLowerCase(); + let otherName; + for (otherName of typeList) { + if (otherName.toLowerCase() === name) { + message += '. Did you mean "' + otherName + '" ?'; + break; + } + } + throw new TypeError(message); + } + + /** + * Adds an array `types` of type definitions to this typed instance. + * Each type definition should be an object with properties: + * 'name' - a string giving the name of the type; 'test' - function + * returning a boolean that tests membership in the type; and optionally + * 'isAny' - true only for the 'any' type. + * + * The second optional argument, `before`, gives the name of a type that + * these types should be added before. The new types are added in the + * order specified. + * @param {TypeDef[]} types + * @param {string | boolean} [beforeSpec='any'] before + */ + function addTypes(types) { + let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any'; + const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length; + const newTypes = []; + for (let i = 0; i < types.length; ++i) { + if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') { + throw new TypeError('Object with properties {name: string, test: function} expected'); + } + const typeName = types[i].name; + if (typeMap.has(typeName)) { + throw new TypeError('Duplicate type name "' + typeName + '"'); + } + newTypes.push(typeName); + typeMap.set(typeName, { + name: typeName, + test: types[i].test, + isAny: types[i].isAny, + index: beforeIndex + i, + conversionsTo: [] // Newly added type can't have any conversions to it + }); + } + // update the typeList + const affectedTypes = typeList.slice(beforeIndex); + typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes); + // Fix the indices + for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) { + typeMap.get(typeList[i]).index = i; + } + } + + /** + * Removes all types and conversions from this typed instance. + * May cause previously constructed typed-functions to throw + * strange errors when they are called with types that do not + * match any of their signatures. + */ + function clear() { + typeMap = new Map(); + typeList = []; + nConversions = 0; + addTypes([anyType], false); + } + + // initialize the types to the default list + clear(); + addTypes(_types); + + /** + * Removes all conversions, leaving the types alone. + */ + function clearConversions() { + let typeName; + for (typeName of typeList) { + typeMap.get(typeName).conversionsTo = []; + } + nConversions = 0; + } + + /** + * Find the type names that match a value. + * @param {*} value + * @return {string[]} Array of names of types for which + * the type test matches the value. + */ + function findTypeNames(value) { + const matches = typeList.filter(name => { + const type = typeMap.get(name); + return !type.isAny && type.test(value); + }); + if (matches.length) { + return matches; + } + return ['any']; + } + + /** + * Check if an entity is a typed function created by any instance + * @param {any} entity + * @returns {boolean} + */ + function isTypedFunction(entity) { + return entity && typeof entity === 'function' && '_typedFunctionData' in entity; + } + + /** + * Find a specific signature from a (composed) typed function, for example: + * + * typed.findSignature(fn, ['number', 'string']) + * typed.findSignature(fn, 'number, string') + * typed.findSignature(fn, 'number,string', {exact: true}) + * + * This function findSignature will by default return the best match to + * the given signature, possibly employing type conversions. + * + * The (optional) third argument is a plain object giving options + * controlling the signature search. Currently the only implemented + * option is `exact`: if specified as true (default is false), only + * exact matches will be returned (i.e. signatures for which `fn` was + * directly defined). Note that a (possibly different) type matching + * `any`, or one or more instances of TYPE matching `...TYPE` are + * considered exact matches in this regard, as no conversions are used. + * + * This function returns a "signature" object, as does `typed.resolve()`, + * which is a plain object with four keys: `params` (the array of parameters + * for this signature), `fn` (the originally supplied function for this + * signature), `test` (a generated function that determines if an argument + * list matches this signature, and `implementation` (the function to call + * on a matching argument list, that performs conversions if necessary and + * then calls the originally supplied function). + * + * @param {Function} fn A typed-function + * @param {string | string[]} signature + * Signature to be found, can be an array or a comma separated string. + * @param {object} options Controls the signature search as documented + * @return {{ params: Param[], fn: function, test: function, implementation: function }} + * Returns the matching signature, or throws an error when no signature + * is found. + */ + function findSignature(fn, signature, options) { + if (!isTypedFunction(fn)) { + throw new TypeError(NOT_TYPED_FUNCTION); + } + + // Canonicalize input + const exact = options && options.exact; + const stringSignature = Array.isArray(signature) ? signature.join(',') : signature; + const params = parseSignature(stringSignature); + const canonicalSignature = stringifyParams(params); + + // First hope we get lucky and exactly match a signature + if (!exact || canonicalSignature in fn.signatures) { + // OK, we can check the internal signatures + const match = fn._typedFunctionData.signatureMap.get(canonicalSignature); + if (match) { + return match; + } + } + + // Oh well, we did not; so we have to go back and check the parameters + // one by one, in order to catch things like `any` and rest params. + // Note here we can assume there is at least one parameter, because + // the empty signature would have matched successfully above. + const nParams = params.length; + let remainingSignatures; + if (exact) { + remainingSignatures = []; + let name; + for (name in fn.signatures) { + remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name)); + } + } else { + remainingSignatures = fn._typedFunctionData.signatures; + } + for (let i = 0; i < nParams; ++i) { + const want = params[i]; + const filteredSignatures = []; + let possibility; + for (possibility of remainingSignatures) { + const have = getParamAtIndex(possibility.params, i); + if (!have || want.restParam && !have.restParam) { + continue; + } + if (!have.hasAny) { + // have to check all of the wanted types are available + const haveTypes = paramTypeSet(have); + if (want.types.some(wtype => !haveTypes.has(wtype.name))) { + continue; + } + } + // OK, this looks good + filteredSignatures.push(possibility); + } + remainingSignatures = filteredSignatures; + if (remainingSignatures.length === 0) break; + } + // Return the first remaining signature that was totally matched: + let candidate; + for (candidate of remainingSignatures) { + if (candidate.params.length <= nParams) { + return candidate; + } + } + throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))'); + } + + /** + * Find the proper function to call for a specific signature from + * a (composed) typed function, for example: + * + * typed.find(fn, ['number', 'string']) + * typed.find(fn, 'number, string') + * typed.find(fn, 'number,string', {exact: true}) + * + * This function find will by default return the best match to + * the given signature, possibly employing type conversions (and returning + * a function that will perform those conversions as needed). The + * (optional) third argument is a plain object giving options contolling + * the signature search. Currently only the option `exact` is implemented, + * which defaults to "false". If `exact` is specified as true, then only + * exact matches will be returned (i.e. signatures for which `fn` was + * directly defined). Uses of `any` and `...TYPE` are considered exact if + * no conversions are necessary to apply the corresponding function. + * + * @param {Function} fn A typed-function + * @param {string | string[]} signature + * Signature to be found, can be an array or a comma separated string. + * @param {object} options Controls the signature match as documented + * @return {function} + * Returns the function to call for the given signature, or throws an + * error if no match is found. + */ + function find(fn, signature, options) { + return findSignature(fn, signature, options).implementation; + } + + /** + * Convert a given value to another data type, specified by type name. + * + * @param {*} value + * @param {string} typeName + */ + function convert(value, typeName) { + // check conversion is needed + const type = findType(typeName); + if (type.test(value)) { + return value; + } + const conversions = type.conversionsTo; + if (conversions.length === 0) { + throw new Error('There are no conversions to ' + typeName + ' defined.'); + } + for (let i = 0; i < conversions.length; i++) { + const fromType = findType(conversions[i].from); + if (fromType.test(value)) { + return conversions[i].convert(value); + } + } + throw new Error('Cannot convert ' + value + ' to ' + typeName); + } + + /** + * Stringify parameters in a normalized way + * @param {Param[]} params + * @param {string} [','] separator + * @return {string} + */ + function stringifyParams(params) { + let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ','; + return params.map(p => p.name).join(separator); + } + + /** + * Parse a parameter, like "...number | boolean" + * @param {string} param + * @return {Param} param + */ + function parseParam(param) { + const restParam = param.indexOf('...') === 0; + const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any'; + const typeDefs = types.split('|').map(s => findType(s.trim())); + let hasAny = false; + let paramName = restParam ? '...' : ''; + const exactTypes = typeDefs.map(function (type) { + hasAny = type.isAny || hasAny; + paramName += type.name + '|'; + return { + name: type.name, + typeIndex: type.index, + test: type.test, + isAny: type.isAny, + conversion: null, + conversionIndex: -1 + }; + }); + return { + types: exactTypes, + name: paramName.slice(0, -1), + // remove trailing '|' from above + hasAny, + hasConversion: false, + restParam + }; + } + + /** + * Expands a parsed parameter with the types available from currently + * defined conversions. + * @param {Param} param + * @return {Param} param + */ + function expandParam(param) { + const typeNames = param.types.map(t => t.name); + const matchingConversions = availableConversions(typeNames); + let hasAny = param.hasAny; + let newName = param.name; + const convertibleTypes = matchingConversions.map(function (conversion) { + const type = findType(conversion.from); + hasAny = type.isAny || hasAny; + newName += '|' + conversion.from; + return { + name: conversion.from, + typeIndex: type.index, + test: type.test, + isAny: type.isAny, + conversion, + conversionIndex: conversion.index + }; + }); + return { + types: param.types.concat(convertibleTypes), + name: newName, + hasAny, + hasConversion: convertibleTypes.length > 0, + restParam: param.restParam + }; + } + + /** + * Return the set of type names in a parameter. + * Caches the result for efficiency + * + * @param {Param} param + * @return {Set} typenames + */ + function paramTypeSet(param) { + if (!param.typeSet) { + param.typeSet = new Set(); + param.types.forEach(type => param.typeSet.add(type.name)); + } + return param.typeSet; + } + + /** + * Parse a signature with comma separated parameters, + * like "number | boolean, ...string" + * + * @param {string} signature + * @return {Param[]} params + */ + function parseSignature(rawSignature) { + const params = []; + if (typeof rawSignature !== 'string') { + throw new TypeError('Signatures must be strings'); + } + const signature = rawSignature.trim(); + if (signature === '') { + return params; + } + const rawParams = signature.split(','); + for (let i = 0; i < rawParams.length; ++i) { + const parsedParam = parseParam(rawParams[i].trim()); + if (parsedParam.restParam && i !== rawParams.length - 1) { + throw new SyntaxError('Unexpected rest parameter "' + rawParams[i] + '": ' + 'only allowed for the last parameter'); + } + // if invalid, short-circuit (all the types may have been filtered) + if (parsedParam.types.length === 0) { + return null; + } + params.push(parsedParam); + } + return params; + } + + /** + * Test whether a set of params contains a restParam + * @param {Param[]} params + * @return {boolean} Returns true when the last parameter is a restParam + */ + function hasRestParam(params) { + const param = last(params); + return param ? param.restParam : false; + } + + /** + * Create a type test for a single parameter, which can have one or multiple + * types. + * @param {Param} param + * @return {function(x: *) : boolean} Returns a test function + */ + function compileTest(param) { + if (!param || param.types.length === 0) { + // nothing to do + return ok; + } else if (param.types.length === 1) { + return findType(param.types[0].name).test; + } else if (param.types.length === 2) { + const test0 = findType(param.types[0].name).test; + const test1 = findType(param.types[1].name).test; + return function or(x) { + return test0(x) || test1(x); + }; + } else { + // param.types.length > 2 + const tests = param.types.map(function (type) { + return findType(type.name).test; + }); + return function or(x) { + for (let i = 0; i < tests.length; i++) { + if (tests[i](x)) { + return true; + } + } + return false; + }; + } + } + + /** + * Create a test for all parameters of a signature + * @param {Param[]} params + * @return {function(args: Array<*>) : boolean} + */ + function compileTests(params) { + let tests, test0, test1; + if (hasRestParam(params)) { + // variable arguments like '...number' + tests = initial(params).map(compileTest); + const varIndex = tests.length; + const lastTest = compileTest(last(params)); + const testRestParam = function (args) { + for (let i = varIndex; i < args.length; i++) { + if (!lastTest(args[i])) { + return false; + } + } + return true; + }; + return function testArgs(args) { + for (let i = 0; i < tests.length; i++) { + if (!tests[i](args[i])) { + return false; + } + } + return testRestParam(args) && args.length >= varIndex + 1; + }; + } else { + // no variable arguments + if (params.length === 0) { + return function testArgs(args) { + return args.length === 0; + }; + } else if (params.length === 1) { + test0 = compileTest(params[0]); + return function testArgs(args) { + return test0(args[0]) && args.length === 1; + }; + } else if (params.length === 2) { + test0 = compileTest(params[0]); + test1 = compileTest(params[1]); + return function testArgs(args) { + return test0(args[0]) && test1(args[1]) && args.length === 2; + }; + } else { + // arguments.length > 2 + tests = params.map(compileTest); + return function testArgs(args) { + for (let i = 0; i < tests.length; i++) { + if (!tests[i](args[i])) { + return false; + } + } + return args.length === tests.length; + }; + } + } + } + + /** + * Find the parameter at a specific index of a Params list. + * Handles rest parameters. + * @param {Param[]} params + * @param {number} index + * @return {Param | null} Returns the matching parameter when found, + * null otherwise. + */ + function getParamAtIndex(params, index) { + return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null; + } + + /** + * Get all type names of a parameter + * @param {Params[]} params + * @param {number} index + * @return {string[]} Returns an array with type names + */ + function getTypeSetAtIndex(params, index) { + const param = getParamAtIndex(params, index); + if (!param) { + return new Set(); + } + return paramTypeSet(param); + } + + /** + * Test whether a type is an exact type or conversion + * @param {Type} type + * @return {boolean} Returns true when + */ + function isExactType(type) { + return type.conversion === null || type.conversion === undefined; + } + + /** + * Helper function for creating error messages: create an array with + * all available types on a specific argument index. + * @param {Signature[]} signatures + * @param {number} index + * @return {string[]} Returns an array with available types + */ + function mergeExpectedParams(signatures, index) { + const typeSet = new Set(); + signatures.forEach(signature => { + const paramSet = getTypeSetAtIndex(signature.params, index); + let name; + for (name of paramSet) { + typeSet.add(name); + } + }); + return typeSet.has('any') ? ['any'] : Array.from(typeSet); + } + + /** + * Create + * @param {string} name The name of the function + * @param {array.<*>} args The actual arguments passed to the function + * @param {Signature[]} signatures A list with available signatures + * @return {TypeError} Returns a type error with additional data + * attached to it in the property `data` + */ + function createError(name, args, signatures) { + let err, expected; + const _name = name || 'unnamed'; + + // test for wrong type at some index + let matchingSignatures = signatures; + let index; + for (index = 0; index < args.length; index++) { + const nextMatchingDefs = []; + matchingSignatures.forEach(signature => { + const param = getParamAtIndex(signature.params, index); + const test = compileTest(param); + if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) { + nextMatchingDefs.push(signature); + } + }); + if (nextMatchingDefs.length === 0) { + // no matching signatures anymore, throw error "wrong type" + expected = mergeExpectedParams(matchingSignatures, index); + if (expected.length > 0) { + const actualTypes = findTypeNames(args[index]); + err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')'); + err.data = { + category: 'wrongType', + fn: _name, + index, + actual: actualTypes, + expected + }; + return err; + } + } else { + matchingSignatures = nextMatchingDefs; + } + } + + // test for too few arguments + const lengths = matchingSignatures.map(function (signature) { + return hasRestParam(signature.params) ? Infinity : signature.params.length; + }); + if (args.length < Math.min.apply(null, lengths)) { + expected = mergeExpectedParams(matchingSignatures, index); + err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')'); + err.data = { + category: 'tooFewArgs', + fn: _name, + index: args.length, + expected + }; + return err; + } + + // test for too many arguments + const maxLength = Math.max.apply(null, lengths); + if (args.length > maxLength) { + err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')'); + err.data = { + category: 'tooManyArgs', + fn: _name, + index: args.length, + expectedLength: maxLength + }; + return err; + } + + // Generic error + const argTypes = []; + for (let i = 0; i < args.length; ++i) { + argTypes.push(findTypeNames(args[i]).join('|')); + } + err = new TypeError('Arguments of type "' + argTypes.join(', ') + '" do not match any of the defined signatures of function ' + _name + '.'); + err.data = { + category: 'mismatch', + actual: argTypes + }; + return err; + } + + /** + * Find the lowest index of all exact types of a parameter (no conversions) + * @param {Param} param + * @return {number} Returns the index of the lowest type in typed.types + */ + function getLowestTypeIndex(param) { + let min = typeList.length + 1; + for (let i = 0; i < param.types.length; i++) { + if (isExactType(param.types[i])) { + min = Math.min(min, param.types[i].typeIndex); + } + } + return min; + } + + /** + * Find the lowest index of the conversion of all types of the parameter + * having a conversion + * @param {Param} param + * @return {number} Returns the lowest index of the conversions of this type + */ + function getLowestConversionIndex(param) { + let min = nConversions + 1; + for (let i = 0; i < param.types.length; i++) { + if (!isExactType(param.types[i])) { + min = Math.min(min, param.types[i].conversionIndex); + } + } + return min; + } + + /** + * Compare two params + * @param {Param} param1 + * @param {Param} param2 + * @return {number} returns -1 when param1 must get a lower + * index than param2, 1 when the opposite, + * or zero when both are equal + */ + function compareParams(param1, param2) { + // We compare a number of metrics on a param in turn: + // 1) 'any' parameters are the least preferred + if (param1.hasAny) { + if (!param2.hasAny) { + return 1; + } + } else if (param2.hasAny) { + return -1; + } + + // 2) Prefer non-rest to rest parameters + if (param1.restParam) { + if (!param2.restParam) { + return 1; + } + } else if (param2.restParam) { + return -1; + } + + // 3) Prefer exact type match to conversions + if (param1.hasConversion) { + if (!param2.hasConversion) { + return 1; + } + } else if (param2.hasConversion) { + return -1; + } + + // 4) Prefer lower type index: + const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2); + if (typeDiff < 0) { + return -1; + } + if (typeDiff > 0) { + return 1; + } + + // 5) Prefer lower conversion index + const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2); + if (convDiff < 0) { + return -1; + } + if (convDiff > 0) { + return 1; + } + + // Don't have a basis for preference + return 0; + } + + /** + * Compare two signatures + * @param {Signature} signature1 + * @param {Signature} signature2 + * @return {number} returns a negative number when param1 must get a lower + * index than param2, a positive number when the opposite, + * or zero when both are equal + */ + function compareSignatures(signature1, signature2) { + const pars1 = signature1.params; + const pars2 = signature2.params; + const last1 = last(pars1); + const last2 = last(pars2); + const hasRest1 = hasRestParam(pars1); + const hasRest2 = hasRestParam(pars2); + // We compare a number of metrics on signatures in turn: + // 1) An "any rest param" is least preferred + if (hasRest1 && last1.hasAny) { + if (!hasRest2 || !last2.hasAny) { + return 1; + } + } else if (hasRest2 && last2.hasAny) { + return -1; + } + + // 2) Minimize the number of 'any' parameters + let any1 = 0; + let conv1 = 0; + let par; + for (par of pars1) { + if (par.hasAny) ++any1; + if (par.hasConversion) ++conv1; + } + let any2 = 0; + let conv2 = 0; + for (par of pars2) { + if (par.hasAny) ++any2; + if (par.hasConversion) ++conv2; + } + if (any1 !== any2) { + return any1 - any2; + } + + // 3) A conversion rest param is less preferred + if (hasRest1 && last1.hasConversion) { + if (!hasRest2 || !last2.hasConversion) { + return 1; + } + } else if (hasRest2 && last2.hasConversion) { + return -1; + } + + // 4) Minimize the number of conversions + if (conv1 !== conv2) { + return conv1 - conv2; + } + + // 5) Prefer no rest param + if (hasRest1) { + if (!hasRest2) { + return 1; + } + } else if (hasRest2) { + return -1; + } + + // 6) Prefer shorter with rest param, longer without + const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1); + if (lengthCriterion !== 0) { + return lengthCriterion; + } + + // Signatures are identical in each of the above metrics. + // In particular, they are the same length. + // We can therefore compare the parameters one by one. + // First we count which signature has more preferred parameters. + const comparisons = []; + let tc = 0; + for (let i = 0; i < pars1.length; ++i) { + const thisComparison = compareParams(pars1[i], pars2[i]); + comparisons.push(thisComparison); + tc += thisComparison; + } + if (tc !== 0) { + return tc; + } + + // They have the same number of preferred parameters, so go by the + // earliest parameter in which we have a preference. + // In other words, dispatch is driven somewhat more by earlier + // parameters than later ones. + let c; + for (c of comparisons) { + if (c !== 0) { + return c; + } + } + + // It's a tossup: + return 0; + } + + /** + * Produce a list of all conversions from distinct types to one of + * the given types. + * + * @param {string[]} typeNames + * @return {ConversionDef[]} Returns the conversions that are available + * resulting in any given type (if any) + */ + function availableConversions(typeNames) { + if (typeNames.length === 0) { + return []; + } + const types = typeNames.map(findType); + if (typeNames.length > 1) { + types.sort((t1, t2) => t1.index - t2.index); + } + let matches = types[0].conversionsTo; + if (typeNames.length === 1) { + return matches; + } + matches = matches.concat([]); // shallow copy the matches + // Since the types are now in index order, we just want the first + // occurrence of any from type: + const knownTypes = new Set(typeNames); + for (let i = 1; i < types.length; ++i) { + let newMatch; + for (newMatch of types[i].conversionsTo) { + if (!knownTypes.has(newMatch.from)) { + matches.push(newMatch); + knownTypes.add(newMatch.from); + } + } + } + return matches; + } + + /** + * Preprocess arguments before calling the original function: + * - if needed convert the parameters + * - in case of rest parameters, move the rest parameters into an Array + * @param {Param[]} params + * @param {function} fn + * @return {function} Returns a wrapped function + */ + function compileArgsPreprocessing(params, fn) { + let fnConvert = fn; + + // TODO: can we make this wrapper function smarter/simpler? + + if (params.some(p => p.hasConversion)) { + const restParam = hasRestParam(params); + const compiledConversions = params.map(compileArgConversion); + fnConvert = function convertArgs() { + const args = []; + const last = restParam ? arguments.length - 1 : arguments.length; + for (let i = 0; i < last; i++) { + args[i] = compiledConversions[i](arguments[i]); + } + if (restParam) { + args[last] = arguments[last].map(compiledConversions[last]); + } + return fn.apply(this, args); + }; + } + let fnPreprocess = fnConvert; + if (hasRestParam(params)) { + const offset = params.length - 1; + fnPreprocess = function preprocessRestParams() { + return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)])); + }; + } + return fnPreprocess; + } + + /** + * Compile conversion for a parameter to the right type + * @param {Param} param + * @return {function} Returns the wrapped function that will convert arguments + * + */ + function compileArgConversion(param) { + let test0, test1, conversion0, conversion1; + const tests = []; + const conversions = []; + param.types.forEach(function (type) { + if (type.conversion) { + tests.push(findType(type.conversion.from).test); + conversions.push(type.conversion.convert); + } + }); + + // create optimized conversion functions depending on the number of conversions + switch (conversions.length) { + case 0: + return function convertArg(arg) { + return arg; + }; + case 1: + test0 = tests[0]; + conversion0 = conversions[0]; + return function convertArg(arg) { + if (test0(arg)) { + return conversion0(arg); + } + return arg; + }; + case 2: + test0 = tests[0]; + test1 = tests[1]; + conversion0 = conversions[0]; + conversion1 = conversions[1]; + return function convertArg(arg) { + if (test0(arg)) { + return conversion0(arg); + } + if (test1(arg)) { + return conversion1(arg); + } + return arg; + }; + default: + return function convertArg(arg) { + for (let i = 0; i < conversions.length; i++) { + if (tests[i](arg)) { + return conversions[i](arg); + } + } + return arg; + }; + } + } + + /** + * Split params with union types in to separate params. + * + * For example: + * + * splitParams([['Array', 'Object'], ['string', 'RegExp']) + * // returns: + * // [ + * // ['Array', 'string'], + * // ['Array', 'RegExp'], + * // ['Object', 'string'], + * // ['Object', 'RegExp'] + * // ] + * + * @param {Param[]} params + * @return {Param[]} + */ + function splitParams(params) { + function _splitParams(params, index, paramsSoFar) { + if (index < params.length) { + const param = params[index]; + let resultingParams = []; + if (param.restParam) { + // split the types of a rest parameter in two: + // one with only exact types, and one with exact types and conversions + const exactTypes = param.types.filter(isExactType); + if (exactTypes.length < param.types.length) { + resultingParams.push({ + types: exactTypes, + name: '...' + exactTypes.map(t => t.name).join('|'), + hasAny: exactTypes.some(t => t.isAny), + hasConversion: false, + restParam: true + }); + } + resultingParams.push(param); + } else { + // split all the types of a regular parameter into one type per param + resultingParams = param.types.map(function (type) { + return { + types: [type], + name: type.name, + hasAny: type.isAny, + hasConversion: type.conversion, + restParam: false + }; + }); + } + + // recurse over the groups with types + return flatMap(resultingParams, function (nextParam) { + return _splitParams(params, index + 1, paramsSoFar.concat([nextParam])); + }); + } else { + // we've reached the end of the parameters. + return [paramsSoFar]; + } + } + return _splitParams(params, 0, []); + } + + /** + * Test whether two param lists represent conflicting signatures + * @param {Param[]} params1 + * @param {Param[]} params2 + * @return {boolean} Returns true when the signatures conflict, false otherwise. + */ + function conflicting(params1, params2) { + const ii = Math.max(params1.length, params2.length); + for (let i = 0; i < ii; i++) { + const typeSet1 = getTypeSetAtIndex(params1, i); + const typeSet2 = getTypeSetAtIndex(params2, i); + let overlap = false; + let name; + for (name of typeSet2) { + if (typeSet1.has(name)) { + overlap = true; + break; + } + } + if (!overlap) { + return false; + } + } + const len1 = params1.length; + const len2 = params2.length; + const restParam1 = hasRestParam(params1); + const restParam2 = hasRestParam(params2); + return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2; + } + + /** + * Helper function for `resolveReferences` that returns a copy of + * functionList wihe any prior resolutions cleared out, in case we are + * recycling signatures from a prior typed function construction. + * + * @param {Array.} functionList + * @return {Array.} + */ + function clearResolutions(functionList) { + return functionList.map(fn => { + if (isReferToSelf(fn)) { + return referToSelf(fn.referToSelf.callback); + } + if (isReferTo(fn)) { + return makeReferTo(fn.referTo.references, fn.referTo.callback); + } + return fn; + }); + } + + /** + * Take a list of references, a list of functions functionList, and a + * signatureMap indexing signatures into functionList, and return + * the list of resolutions, or a false-y value if they don't all + * resolve in a valid way (yet). + * + * @param {string[]} references + * @param {Array} signatureMap + * @return {function[] | false} resolutions + */ + function collectResolutions(references, functionList, signatureMap) { + const resolvedReferences = []; + let reference; + for (reference of references) { + let resolution = signatureMap[reference]; + if (typeof resolution !== 'number') { + throw new TypeError('No definition for referenced signature "' + reference + '"'); + } + resolution = functionList[resolution]; + if (typeof resolution !== 'function') { + return false; + } + resolvedReferences.push(resolution); + } + return resolvedReferences; + } + + /** + * Resolve any references in the functionList for the typed function + * itself. The signatureMap tells which index in the functionList a + * given signature should be mapped to (for use in resolving typed.referTo) + * and self provides the destions of a typed.referToSelf. + * + * @param {Array} functionList + * @param {Object.} signatureMap + * @param {function} self The typed-function itself + * @return {Array} The list of resolved functions + */ + function resolveReferences(functionList, signatureMap, self) { + const resolvedFunctions = clearResolutions(functionList); + const isResolved = new Array(resolvedFunctions.length).fill(false); + let leftUnresolved = true; + while (leftUnresolved) { + leftUnresolved = false; + let nothingResolved = true; + for (let i = 0; i < resolvedFunctions.length; ++i) { + if (isResolved[i]) continue; + const fn = resolvedFunctions[i]; + if (isReferToSelf(fn)) { + resolvedFunctions[i] = fn.referToSelf.callback(self); + // Preserve reference in case signature is reused someday: + resolvedFunctions[i].referToSelf = fn.referToSelf; + isResolved[i] = true; + nothingResolved = false; + } else if (isReferTo(fn)) { + const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap); + if (resolvedReferences) { + resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences); + // Preserve reference in case signature is reused someday: + resolvedFunctions[i].referTo = fn.referTo; + isResolved[i] = true; + nothingResolved = false; + } else { + leftUnresolved = true; + } + } + } + if (nothingResolved && leftUnresolved) { + throw new SyntaxError('Circular reference detected in resolving typed.referTo'); + } + } + return resolvedFunctions; + } + + /** + * Validate whether any of the function bodies contains a self-reference + * usage like `this(...)` or `this.signatures`. This self-referencing is + * deprecated since typed-function v3. It has been replaced with + * the functions typed.referTo and typed.referToSelf. + * @param {Object.} signaturesMap + */ + function validateDeprecatedThis(signaturesMap) { + // TODO: remove this deprecation warning logic some day (it's introduced in v3) + + // match occurrences like 'this(' and 'this.signatures' + const deprecatedThisRegex = /\bthis(\(|\.signatures\b)/; + Object.keys(signaturesMap).forEach(signature => { + const fn = signaturesMap[signature]; + if (deprecatedThisRegex.test(fn.toString())) { + throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.'); + } + }); + } + + /** + * Create a typed function + * @param {String} name The name for the typed function + * @param {Object.} rawSignaturesMap + * An object with one or + * multiple signatures as key, and the + * function corresponding to the + * signature as value. + * @return {function} Returns the created typed function. + */ + function createTypedFunction(name, rawSignaturesMap) { + typed.createCount++; + if (Object.keys(rawSignaturesMap).length === 0) { + throw new SyntaxError('No signatures provided'); + } + if (typed.warnAgainstDeprecatedThis) { + validateDeprecatedThis(rawSignaturesMap); + } + + // Main processing loop for signatures + const parsedParams = []; + const originalFunctions = []; + const signaturesMap = {}; + const preliminarySignatures = []; // may have duplicates from conversions + let signature; + for (signature in rawSignaturesMap) { + // A) Protect against polluted Object prototype: + if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) { + continue; + } + // B) Parse the signature + const params = parseSignature(signature); + if (!params) continue; + // C) Check for conflicts + parsedParams.forEach(function (pp) { + if (conflicting(pp, params)) { + throw new TypeError('Conflicting signatures "' + stringifyParams(pp) + '" and "' + stringifyParams(params) + '".'); + } + }); + parsedParams.push(params); + // D) Store the provided function and add conversions + const functionIndex = originalFunctions.length; + originalFunctions.push(rawSignaturesMap[signature]); + const conversionParams = params.map(expandParam); + // E) Split the signatures and collect them up + let sp; + for (sp of splitParams(conversionParams)) { + const spName = stringifyParams(sp); + preliminarySignatures.push({ + params: sp, + name: spName, + fn: functionIndex + }); + if (sp.every(p => !p.hasConversion)) { + signaturesMap[spName] = functionIndex; + } + } + } + preliminarySignatures.sort(compareSignatures); + + // Note the forward reference to theTypedFn + const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn); + + // Fill in the proper function for each signature + let s; + for (s in signaturesMap) { + if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) { + signaturesMap[s] = resolvedFunctions[signaturesMap[s]]; + } + } + const signatures = []; + const internalSignatureMap = new Map(); // benchmarks faster than object + for (s of preliminarySignatures) { + // Note it's only safe to eliminate duplicates like this + // _after_ the signature sorting step above; otherwise we might + // remove the wrong one. + if (!internalSignatureMap.has(s.name)) { + s.fn = resolvedFunctions[s.fn]; + signatures.push(s); + internalSignatureMap.set(s.name, s); + } + } + + // we create a highly optimized checks for the first couple of signatures with max 2 arguments + const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params); + const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params); + const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params); + const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params); + const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params); + const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params); + const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5; + + // compile the tests + for (let i = 0; i < signatures.length; ++i) { + signatures[i].test = compileTests(signatures[i].params); + } + const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk; + const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk; + const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk; + const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk; + const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk; + const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk; + const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk; + const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk; + const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk; + const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk; + const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk; + const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk; + + // compile the functions + for (let i = 0; i < signatures.length; ++i) { + signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn); + } + const fn0 = ok0 ? signatures[0].implementation : undef; + const fn1 = ok1 ? signatures[1].implementation : undef; + const fn2 = ok2 ? signatures[2].implementation : undef; + const fn3 = ok3 ? signatures[3].implementation : undef; + const fn4 = ok4 ? signatures[4].implementation : undef; + const fn5 = ok5 ? signatures[5].implementation : undef; + const len0 = ok0 ? signatures[0].params.length : -1; + const len1 = ok1 ? signatures[1].params.length : -1; + const len2 = ok2 ? signatures[2].params.length : -1; + const len3 = ok3 ? signatures[3].params.length : -1; + const len4 = ok4 ? signatures[4].params.length : -1; + const len5 = ok5 ? signatures[5].params.length : -1; + + // simple and generic, but also slow + const iStart = allOk ? 6 : 0; + const iEnd = signatures.length; + // de-reference ahead for execution speed: + const tests = signatures.map(s => s.test); + const fns = signatures.map(s => s.implementation); + const generic = function generic() { + 'use strict'; + + for (let i = iStart; i < iEnd; i++) { + if (tests[i](arguments)) { + return fns[i].apply(this, arguments); + } + } + return typed.onMismatch(name, arguments, signatures); + }; + + // create the typed function + // fast, specialized version. Falls back to the slower, generic one if needed + function theTypedFn(arg0, arg1) { + 'use strict'; + + if (arguments.length === len0 && test00(arg0) && test01(arg1)) { + return fn0.apply(this, arguments); + } + if (arguments.length === len1 && test10(arg0) && test11(arg1)) { + return fn1.apply(this, arguments); + } + if (arguments.length === len2 && test20(arg0) && test21(arg1)) { + return fn2.apply(this, arguments); + } + if (arguments.length === len3 && test30(arg0) && test31(arg1)) { + return fn3.apply(this, arguments); + } + if (arguments.length === len4 && test40(arg0) && test41(arg1)) { + return fn4.apply(this, arguments); + } + if (arguments.length === len5 && test50(arg0) && test51(arg1)) { + return fn5.apply(this, arguments); + } + return generic.apply(this, arguments); + } + + // attach name the typed function + try { + Object.defineProperty(theTypedFn, 'name', { + value: name + }); + } catch (err) { + // old browsers do not support Object.defineProperty and some don't support setting the name property + // the function name is not essential for the functioning, it's mostly useful for debugging, + // so it's fine to have unnamed functions. + } + + // attach signatures to the function. + // This property is close to the original collection of signatures + // used to create the typed-function, just with unions split: + theTypedFn.signatures = signaturesMap; + + // Store internal data for functions like resolve, find, etc. + // Also serves as the flag that this is a typed-function + theTypedFn._typedFunctionData = { + signatures, + signatureMap: internalSignatureMap + }; + return theTypedFn; + } + + /** + * Action to take on mismatch + * @param {string} name Name of function that was attempted to be called + * @param {Array} args Actual arguments to the call + * @param {Array} signatures Known signatures of the named typed-function + */ + function _onMismatch(name, args, signatures) { + throw createError(name, args, signatures); + } + + /** + * Return all but the last items of an array or function Arguments + * @param {Array | Arguments} arr + * @return {Array} + */ + function initial(arr) { + return slice(arr, 0, arr.length - 1); + } + + /** + * return the last item of an array or function Arguments + * @param {Array | Arguments} arr + * @return {*} + */ + function last(arr) { + return arr[arr.length - 1]; + } + + /** + * Slice an array or function Arguments + * @param {Array | Arguments | IArguments} arr + * @param {number} start + * @param {number} [end] + * @return {Array} + */ + function slice(arr, start, end) { + return Array.prototype.slice.call(arr, start, end); + } + + /** + * Return the first item from an array for which test(arr[i]) returns true + * @param {Array} arr + * @param {function} test + * @return {* | undefined} Returns the first matching item + * or undefined when there is no match + */ + function findInArray(arr, test) { + for (let i = 0; i < arr.length; i++) { + if (test(arr[i])) { + return arr[i]; + } + } + return undefined; + } + + /** + * Flat map the result invoking a callback for every item in an array. + * https://gist.github.com/samgiles/762ee337dff48623e729 + * @param {Array} arr + * @param {function} callback + * @return {Array} + */ + function flatMap(arr, callback) { + return Array.prototype.concat.apply([], arr.map(callback)); + } + + /** + * Create a reference callback to one or multiple signatures + * + * Syntax: + * + * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) { + * // ... + * }) + * + * @returns {{referTo: {references: string[], callback}}} + */ + function referTo() { + const references = initial(arguments).map(s => stringifyParams(parseSignature(s))); + const callback = last(arguments); + if (typeof callback !== 'function') { + throw new TypeError('Callback function expected as last argument'); + } + return makeReferTo(references, callback); + } + function makeReferTo(references, callback) { + return { + referTo: { + references, + callback + } + }; + } + + /** + * Create a reference callback to the typed-function itself + * + * @param {(self: function) => function} callback + * @returns {{referToSelf: { callback: function }}} + */ + function referToSelf(callback) { + if (typeof callback !== 'function') { + throw new TypeError('Callback function expected as first argument'); + } + return { + referToSelf: { + callback + } + }; + } + + /** + * Test whether something is a referTo object, holding a list with reference + * signatures and a callback. + * + * @param {Object | function} objectOrFn + * @returns {boolean} + */ + function isReferTo(objectOrFn) { + return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function'; + } + + /** + * Test whether something is a referToSelf object, holding a callback where + * to pass `self`. + * + * @param {Object | function} objectOrFn + * @returns {boolean} + */ + function isReferToSelf(objectOrFn) { + return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function'; + } + + /** + * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw + * an error in case (C). + * + * @param { string | undefined } nameSoFar + * @param { string | undefined } newName + * @returns { string } updated name + */ + function checkName(nameSoFar, newName) { + if (!nameSoFar) { + return newName; + } + if (newName && newName !== nameSoFar) { + const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')'); + err.data = { + actual: newName, + expected: nameSoFar + }; + throw err; + } + return nameSoFar; + } + + /** + * Retrieve the implied name from an object with signature keys + * and function values, checking whether all value names match + * + * @param { {string: function} } obj + */ + function getObjectName(obj) { + let name; + for (const key in obj) { + // Only pay attention to own properties, and only if their values + // are typed functions or functions with a signature property + if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) { + name = checkName(name, obj[key].name); + } + } + return name; + } + + /** + * Copy all of the signatures from the second argument into the first, + * which is modified by side effect, checking for conflicts + * + * @param {Object.} dest + * @param {Object.} source + */ + function mergeSignatures(dest, source) { + let key; + for (key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + if (key in dest) { + if (source[key] !== dest[key]) { + const err = new Error('Signature "' + key + '" is defined twice'); + err.data = { + signature: key, + sourceFunction: source[key], + destFunction: dest[key] + }; + throw err; + } + // else: both signatures point to the same function, that's fine + } + dest[key] = source[key]; + } + } + } + const saveTyped = typed; + + /** + * Originally the main function was a typed function itself, but then + * it might not be able to generate error messages if the client + * replaced the type system with different names. + * + * Main entry: typed([name], functions/objects with signatures...) + * + * Assembles and returns a new typed-function from the given items + * that provide signatures and implementations, each of which may be + * * a plain object mapping (string) signatures to implementing functions, + * * a previously constructed typed function, or + * * any other single function with a string-valued property `signature`. + * The name of the resulting typed-function will be given by the + * string-valued name argument if present, or if not, by the name + * of any of the arguments that have one, as long as any that do are + * consistent with each other. If no name is specified, the name will be + * an empty string. + * + * @param {string} maybeName [optional] + * @param {(function|object)[]} signature providers + * @returns {typed-function} + */ + typed = function (maybeName) { + const named = typeof maybeName === 'string'; + const start = named ? 1 : 0; + let name = named ? maybeName : ''; + const allSignatures = {}; + for (let i = start; i < arguments.length; ++i) { + const item = arguments[i]; + let theseSignatures = {}; + let thisName; + if (typeof item === 'function') { + thisName = item.name; + if (typeof item.signature === 'string') { + // Case 1: Ordinary function with a string 'signature' property + theseSignatures[item.signature] = item; + } else if (isTypedFunction(item)) { + // Case 2: Existing typed function + theseSignatures = item.signatures; + } + } else if (isPlainObject(item)) { + // Case 3: Plain object, assume keys = signatures, values = functions + theseSignatures = item; + if (!named) { + thisName = getObjectName(item); + } + } + if (Object.keys(theseSignatures).length === 0) { + const err = new TypeError('Argument to \'typed\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.'); + err.data = { + index: i, + argument: item + }; + throw err; + } + if (!named) { + name = checkName(name, thisName); + } + mergeSignatures(allSignatures, theseSignatures); + } + return createTypedFunction(name || '', allSignatures); + }; + typed.create = create; + typed.createCount = saveTyped.createCount; + typed.onMismatch = _onMismatch; + typed.throwMismatchError = _onMismatch; + typed.createError = createError; + typed.clear = clear; + typed.clearConversions = clearConversions; + typed.addTypes = addTypes; + typed._findType = findType; // For unit testing only + typed.referTo = referTo; + typed.referToSelf = referToSelf; + typed.convert = convert; + typed.findSignature = findSignature; + typed.find = find; + typed.isTypedFunction = isTypedFunction; + typed.warnAgainstDeprecatedThis = true; + + /** + * add a type (convenience wrapper for typed.addTypes) + * @param {{name: string, test: function}} type + * @param {boolean} [beforeObjectTest=true] + * If true, the new test will be inserted before + * the test with name 'Object' (if any), since + * tests for Object match Array and classes too. + */ + typed.addType = function (type, beforeObjectTest) { + let before = 'any'; + if (beforeObjectTest !== false && typeMap.has('Object')) { + before = 'Object'; + } + typed.addTypes([type], before); + }; + + /** + * Verify that the ConversionDef conversion has a valid format. + * + * @param {conversionDef} conversion + * @return {void} + * @throws {TypeError|SyntaxError} + */ + function _validateConversion(conversion) { + if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') { + throw new TypeError('Object with properties {from: string, to: string, convert: function} expected'); + } + if (conversion.to === conversion.from) { + throw new SyntaxError('Illegal to define conversion from "' + conversion.from + '" to itself.'); + } + } + + /** + * Add a conversion + * + * @param {ConversionDef} conversion + * @param {{override: boolean}} [options] + * @returns {void} + * @throws {TypeError} + */ + typed.addConversion = function (conversion) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + override: false + }; + _validateConversion(conversion); + const to = findType(conversion.to); + const existing = to.conversionsTo.find(other => other.from === conversion.from); + if (existing) { + if (options && options.override) { + typed.removeConversion({ + from: existing.from, + to: conversion.to, + convert: existing.convert + }); + } else { + throw new Error('There is already a conversion from "' + conversion.from + '" to "' + to.name + '"'); + } + } + to.conversionsTo.push({ + from: conversion.from, + convert: conversion.convert, + index: nConversions++ + }); + }; + + /** + * Convenience wrapper to call addConversion on each conversion in a list. + * + * @param {ConversionDef[]} conversions + * @param {{override: boolean}} [options] + * @returns {void} + * @throws {TypeError} + */ + typed.addConversions = function (conversions, options) { + conversions.forEach(conversion => typed.addConversion(conversion, options)); + }; + + /** + * Remove the specified conversion. The format is the same as for + * addConversion, and the convert function must match or an error + * is thrown. + * + * @param {{from: string, to: string, convert: function}} conversion + * @returns {void} + * @throws {TypeError|SyntaxError|Error} + */ + typed.removeConversion = function (conversion) { + _validateConversion(conversion); + const to = findType(conversion.to); + const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from); + if (!existingConversion) { + throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to); + } + if (existingConversion.convert !== conversion.convert) { + throw new Error('Conversion to remove does not match existing conversion'); + } + const index = to.conversionsTo.indexOf(existingConversion); + to.conversionsTo.splice(index, 1); + }; + + /** + * Produce the specific signature that a typed function + * will execute on the given arguments. Here, a "signature" is an + * object with properties 'params', 'test', 'fn', and 'implementation'. + * This last property is a function that converts params as necessary + * and then calls 'fn'. Returns null if there is no matching signature. + * @param {typed-function} tf + * @param {any[]} argList + * @returns {{params: string, test: function, fn: function, implementation: function}} + */ + typed.resolve = function (tf, argList) { + if (!isTypedFunction(tf)) { + throw new TypeError(NOT_TYPED_FUNCTION); + } + const sigs = tf._typedFunctionData.signatures; + for (let i = 0; i < sigs.length; ++i) { + if (sigs[i].test(argList)) { + return sigs[i]; + } + } + return null; + }; + return typed; +} +export default create(); +//# sourceMappingURL=typed-function.mjs.map \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs.map b/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs.map new file mode 100644 index 0000000..5ba6e4d --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/lib/esm/typed-function.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"typed-function.mjs","names":["ok","notOk","undef","undefined","NOT_TYPED_FUNCTION","create","isPlainObject","x","constructor","Object","_types","name","test","Array","isArray","Date","RegExp","anyType","isAny","typeMap","typeList","nConversions","typed","createCount","findType","typeName","type","get","message","toLowerCase","otherName","TypeError","addTypes","types","beforeSpec","arguments","length","beforeIndex","index","newTypes","i","has","push","set","conversionsTo","affectedTypes","slice","concat","clear","Map","clearConversions","findTypeNames","value","matches","filter","isTypedFunction","entity","findSignature","fn","signature","options","exact","stringSignature","join","params","parseSignature","canonicalSignature","stringifyParams","signatures","match","_typedFunctionData","signatureMap","nParams","remainingSignatures","want","filteredSignatures","possibility","have","getParamAtIndex","restParam","hasAny","haveTypes","paramTypeSet","some","wtype","candidate","find","implementation","convert","conversions","Error","fromType","from","separator","map","p","parseParam","param","indexOf","typeDefs","split","s","trim","paramName","exactTypes","typeIndex","conversion","conversionIndex","hasConversion","expandParam","typeNames","t","matchingConversions","availableConversions","newName","convertibleTypes","typeSet","Set","forEach","add","rawSignature","rawParams","parsedParam","SyntaxError","hasRestParam","last","compileTest","test0","test1","or","tests","compileTests","initial","varIndex","lastTest","testRestParam","args","testArgs","getTypeSetAtIndex","isExactType","mergeExpectedParams","paramSet","createError","err","expected","_name","matchingSignatures","nextMatchingDefs","actualTypes","data","category","actual","lengths","Infinity","Math","min","apply","maxLength","max","expectedLength","argTypes","getLowestTypeIndex","getLowestConversionIndex","compareParams","param1","param2","typeDiff","convDiff","compareSignatures","signature1","signature2","pars1","pars2","last1","last2","hasRest1","hasRest2","any1","conv1","par","any2","conv2","lengthCriterion","comparisons","tc","thisComparison","c","sort","t1","t2","knownTypes","newMatch","compileArgsPreprocessing","fnConvert","compiledConversions","compileArgConversion","convertArgs","fnPreprocess","offset","preprocessRestParams","conversion0","conversion1","convertArg","arg","splitParams","_splitParams","paramsSoFar","resultingParams","flatMap","nextParam","conflicting","params1","params2","ii","typeSet1","typeSet2","overlap","len1","len2","restParam1","restParam2","clearResolutions","functionList","isReferToSelf","referToSelf","callback","isReferTo","makeReferTo","referTo","references","collectResolutions","resolvedReferences","reference","resolution","resolveReferences","self","resolvedFunctions","isResolved","fill","leftUnresolved","nothingResolved","validateDeprecatedThis","signaturesMap","deprecatedThisRegex","keys","toString","createTypedFunction","rawSignaturesMap","warnAgainstDeprecatedThis","parsedParams","originalFunctions","preliminarySignatures","prototype","hasOwnProperty","call","pp","functionIndex","conversionParams","sp","spName","every","theTypedFn","internalSignatureMap","ok0","ok1","ok2","ok3","ok4","ok5","allOk","test00","test10","test20","test30","test40","test50","test01","test11","test21","test31","test41","test51","fn0","fn1","fn2","fn3","fn4","fn5","len0","len3","len4","len5","iStart","iEnd","fns","generic","onMismatch","arg0","arg1","defineProperty","_onMismatch","arr","start","end","findInArray","objectOrFn","checkName","nameSoFar","getObjectName","obj","key","mergeSignatures","dest","source","sourceFunction","destFunction","saveTyped","maybeName","named","allSignatures","item","theseSignatures","thisName","argument","throwMismatchError","_findType","addType","beforeObjectTest","before","_validateConversion","to","addConversion","override","existing","other","removeConversion","addConversions","existingConversion","splice","resolve","tf","argList","sigs"],"sources":["../../src/typed-function.mjs"],"sourcesContent":["function ok () {\n return true\n}\n\nfunction notOk () {\n return false\n}\n\nfunction undef () {\n return undefined\n}\n\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.'\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create () {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject (x) {\n return typeof x === 'object' && x !== null && x.constructor === Object\n }\n\n const _types = [\n { name: 'number', test: function (x) { return typeof x === 'number' } },\n { name: 'string', test: function (x) { return typeof x === 'string' } },\n { name: 'boolean', test: function (x) { return typeof x === 'boolean' } },\n { name: 'Function', test: function (x) { return typeof x === 'function' } },\n { name: 'Array', test: Array.isArray },\n { name: 'Date', test: function (x) { return x instanceof Date } },\n { name: 'RegExp', test: function (x) { return x instanceof RegExp } },\n { name: 'Object', test: isPlainObject },\n { name: 'null', test: function (x) { return x === null } },\n { name: 'undefined', test: function (x) { return x === undefined } }\n ]\n\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n }\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap // primary store of all types\n let typeList // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = { createCount: 0 }\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType (typeName) {\n const type = typeMap.get(typeName)\n if (type) {\n return type\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"'\n const name = typeName.toLowerCase()\n let otherName\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?'\n break\n }\n }\n throw new TypeError(message)\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes (types, beforeSpec = 'any') {\n const beforeIndex = beforeSpec\n ? findType(beforeSpec).index\n : typeList.length\n const newTypes = []\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' ||\n typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected')\n }\n const typeName = types[i].name\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"')\n }\n newTypes.push(typeName)\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n })\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex)\n typeList =\n typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes)\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear () {\n typeMap = new Map()\n typeList = []\n nConversions = 0\n addTypes([anyType], false)\n }\n\n // initialize the types to the default list\n clear()\n addTypes(_types)\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions () {\n let typeName\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = []\n }\n nConversions = 0\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames (value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name)\n return !type.isAny && type.test(value)\n })\n if (matches.length) {\n return matches\n }\n return ['any']\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction (entity) {\n return entity && typeof entity === 'function' &&\n '_typedFunctionData' in entity\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature (fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION)\n }\n\n // Canonicalize input\n const exact = options && options.exact\n const stringSignature = Array.isArray(signature)\n ? signature.join(',')\n : signature\n const params = parseSignature(stringSignature)\n const canonicalSignature = stringifyParams(params)\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match =\n fn._typedFunctionData.signatureMap.get(canonicalSignature)\n if (match) {\n return match\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length\n let remainingSignatures\n if (exact) {\n remainingSignatures = []\n let name\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name))\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i]\n const filteredSignatures = []\n let possibility\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i)\n if (!have || (want.restParam && !have.restParam)) {\n continue\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have)\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility)\n }\n remainingSignatures = filteredSignatures\n if (remainingSignatures.length === 0) break\n }\n // Return the first remaining signature that was totally matched:\n let candidate\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate\n }\n }\n\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))')\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find (fn, signature, options) {\n return findSignature(fn, signature, options).implementation\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert (value, typeName) {\n // check conversion is needed\n const type = findType(typeName)\n if (type.test(value)) {\n return value\n }\n const conversions = type.conversionsTo\n if (conversions.length === 0) {\n throw new Error(\n 'There are no conversions to ' + typeName + ' defined.')\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from)\n if (fromType.test(value)) {\n return conversions[i].convert(value)\n }\n }\n\n throw new Error('Cannot convert ' + value + ' to ' + typeName)\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams (params, separator = ',') {\n return params.map(p => p.name).join(separator)\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam (param) {\n const restParam = param.indexOf('...') === 0\n const types = (!restParam)\n ? param\n : (param.length > 3)\n ? param.slice(3)\n : 'any'\n\n const typeDefs = types.split('|').map(s => findType(s.trim()))\n\n let hasAny = false\n let paramName = restParam ? '...' : ''\n\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny\n paramName += type.name + '|'\n\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n }\n })\n\n return {\n types: exactTypes,\n name: paramName.slice(0, -1), // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n }\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam (param) {\n const typeNames = param.types.map(t => t.name)\n const matchingConversions = availableConversions(typeNames)\n let hasAny = param.hasAny\n let newName = param.name\n\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from)\n hasAny = type.isAny || hasAny\n newName += '|' + conversion.from\n\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n }\n })\n\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n }\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet (param) {\n if (!param.typeSet) {\n param.typeSet = new Set()\n param.types.forEach(type => param.typeSet.add(type.name))\n }\n return param.typeSet\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature (rawSignature) {\n const params = []\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings')\n }\n const signature = rawSignature.trim()\n if (signature === '') {\n return params\n }\n\n const rawParams = signature.split(',')\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim())\n if (parsedParam.restParam && (i !== rawParams.length - 1)) {\n throw new SyntaxError(\n 'Unexpected rest parameter \"' + rawParams[i] + '\": ' +\n 'only allowed for the last parameter')\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null\n }\n params.push(parsedParam)\n }\n\n return params\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam (params) {\n const param = last(params)\n return param ? param.restParam : false\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest (param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test\n const test1 = findType(param.types[1].name).test\n return function or (x) {\n return test0(x) || test1(x)\n }\n } else { // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test\n })\n return function or (x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true\n }\n }\n return false\n }\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests (params) {\n let tests, test0, test1\n\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest)\n const varIndex = tests.length\n const lastTest = compileTest(last(params))\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false\n }\n }\n return true\n }\n\n return function testArgs (args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false\n }\n }\n return testRestParam(args) && (args.length >= varIndex + 1)\n }\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs (args) {\n return args.length === 0\n }\n } else if (params.length === 1) {\n test0 = compileTest(params[0])\n return function testArgs (args) {\n return test0(args[0]) && args.length === 1\n }\n } else if (params.length === 2) {\n test0 = compileTest(params[0])\n test1 = compileTest(params[1])\n return function testArgs (args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2\n }\n } else { // arguments.length > 2\n tests = params.map(compileTest)\n return function testArgs (args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false\n }\n }\n return args.length === tests.length\n }\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex (params, index) {\n return index < params.length\n ? params[index]\n : hasRestParam(params) ? last(params) : null\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex (params, index) {\n const param = getParamAtIndex(params, index)\n if (!param) {\n return new Set()\n }\n return paramTypeSet(param)\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType (type) {\n return type.conversion === null || type.conversion === undefined\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams (signatures, index) {\n const typeSet = new Set()\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index)\n let name\n for (name of paramSet) {\n typeSet.add(name)\n }\n })\n\n return typeSet.has('any') ? ['any'] : Array.from(typeSet)\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError (name, args, signatures) {\n let err, expected\n const _name = name || 'unnamed'\n\n // test for wrong type at some index\n let matchingSignatures = signatures\n let index\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = []\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index)\n const test = compileTest(param)\n if ((index < signature.params.length ||\n hasRestParam(signature.params)) &&\n test(args[index])) {\n nextMatchingDefs.push(signature)\n }\n })\n\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index)\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index])\n\n err = new TypeError('Unexpected type of argument in function ' + _name +\n ' (expected: ' + expected.join(' or ') +\n ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')')\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n }\n return err\n }\n } else {\n matchingSignatures = nextMatchingDefs\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params)\n ? Infinity\n : signature.params.length\n })\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index)\n err = new TypeError('Too few arguments in function ' + _name +\n ' (expected: ' + expected.join(' or ') +\n ', index: ' + args.length + ')')\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n }\n return err\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths)\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name +\n ' (expected: ' + maxLength + ', actual: ' + args.length + ')')\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n }\n return err\n }\n\n // Generic error\n const argTypes = []\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'))\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') +\n '\" do not match any of the defined signatures of function ' + _name + '.')\n err.data = {\n category: 'mismatch',\n actual: argTypes\n }\n return err\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex (param) {\n let min = typeList.length + 1\n\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex)\n }\n }\n\n return min\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex (param) {\n let min = nConversions + 1\n\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex)\n }\n }\n\n return min\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams (param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1\n }\n } else if (param2.hasAny) {\n return -1\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1\n }\n } else if (param2.restParam) {\n return -1\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1\n }\n } else if (param2.hasConversion) {\n return -1\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2)\n if (typeDiff < 0) {\n return -1\n }\n if (typeDiff > 0) {\n return 1\n }\n\n // 5) Prefer lower conversion index\n const convDiff =\n getLowestConversionIndex(param1) - getLowestConversionIndex(param2)\n if (convDiff < 0) {\n return -1\n }\n if (convDiff > 0) {\n return 1\n }\n\n // Don't have a basis for preference\n return 0\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures (signature1, signature2) {\n const pars1 = signature1.params\n const pars2 = signature2.params\n const last1 = last(pars1)\n const last2 = last(pars2)\n const hasRest1 = hasRestParam(pars1)\n const hasRest2 = hasRestParam(pars2)\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0\n let conv1 = 0\n let par\n for (par of pars1) {\n if (par.hasAny) ++any1\n if (par.hasConversion) ++conv1\n }\n let any2 = 0\n let conv2 = 0\n for (par of pars2) {\n if (par.hasAny) ++any2\n if (par.hasConversion) ++conv2\n }\n if (any1 !== any2) {\n return any1 - any2\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1\n }\n } else if (hasRest2) {\n return -1\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion =\n (pars1.length - pars2.length) * (hasRest1 ? -1 : 1)\n if (lengthCriterion !== 0) {\n return lengthCriterion\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = []\n let tc = 0\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i])\n comparisons.push(thisComparison)\n tc += thisComparison\n }\n if (tc !== 0) {\n return tc\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c\n for (c of comparisons) {\n if (c !== 0) {\n return c\n }\n }\n\n // It's a tossup:\n return 0\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions (typeNames) {\n if (typeNames.length === 0) {\n return []\n }\n const types = typeNames.map(findType)\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index)\n }\n let matches = types[0].conversionsTo\n if (typeNames.length === 1) {\n return matches\n }\n\n matches = matches.concat([]) // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames)\n for (let i = 1; i < types.length; ++i) {\n let newMatch\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch)\n knownTypes.add(newMatch.from)\n }\n }\n }\n\n return matches\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing (params, fn) {\n let fnConvert = fn\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params)\n const compiledConversions = params.map(compileArgConversion)\n\n fnConvert = function convertArgs () {\n const args = []\n const last = restParam ? arguments.length - 1 : arguments.length\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i])\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last])\n }\n\n return fn.apply(this, args)\n }\n }\n\n let fnPreprocess = fnConvert\n if (hasRestParam(params)) {\n const offset = params.length - 1\n\n fnPreprocess = function preprocessRestParams () {\n return fnConvert.apply(this,\n slice(arguments, 0, offset).concat([slice(arguments, offset)]))\n }\n }\n\n return fnPreprocess\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion (param) {\n let test0, test1, conversion0, conversion1\n const tests = []\n const conversions = []\n\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test)\n conversions.push(type.conversion.convert)\n }\n })\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg (arg) {\n return arg\n }\n\n case 1:\n test0 = tests[0]\n conversion0 = conversions[0]\n return function convertArg (arg) {\n if (test0(arg)) {\n return conversion0(arg)\n }\n return arg\n }\n\n case 2:\n test0 = tests[0]\n test1 = tests[1]\n conversion0 = conversions[0]\n conversion1 = conversions[1]\n return function convertArg (arg) {\n if (test0(arg)) {\n return conversion0(arg)\n }\n if (test1(arg)) {\n return conversion1(arg)\n }\n return arg\n }\n\n default:\n return function convertArg (arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg)\n }\n }\n return arg\n }\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams (params) {\n function _splitParams (params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index]\n let resultingParams = []\n\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType)\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n })\n }\n resultingParams.push(param)\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n }\n })\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]))\n })\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar]\n }\n }\n\n return _splitParams(params, 0, [])\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting (params1, params2) {\n const ii = Math.max(params1.length, params2.length)\n\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i)\n const typeSet2 = getTypeSetAtIndex(params2, i)\n let overlap = false\n let name\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true\n break\n }\n }\n if (!overlap) {\n return false\n }\n }\n\n const len1 = params1.length\n const len2 = params2.length\n const restParam1 = hasRestParam(params1)\n const restParam2 = hasRestParam(params2)\n\n return restParam1\n ? restParam2 ? (len1 === len2) : (len2 >= len1)\n : restParam2 ? (len1 >= len2) : (len1 === len2)\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions (functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback)\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback)\n }\n return fn\n })\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions (references, functionList, signatureMap) {\n const resolvedReferences = []\n let reference\n for (reference of references) {\n let resolution = signatureMap[reference]\n if (typeof resolution !== 'number') {\n throw new TypeError(\n 'No definition for referenced signature \"' + reference + '\"')\n }\n resolution = functionList[resolution]\n if (typeof resolution !== 'function') {\n return false\n }\n resolvedReferences.push(resolution)\n }\n return resolvedReferences\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences (functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList)\n const isResolved = new Array(resolvedFunctions.length).fill(false)\n let leftUnresolved = true\n while (leftUnresolved) {\n leftUnresolved = false\n let nothingResolved = true\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue\n const fn = resolvedFunctions[i]\n\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self)\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf\n isResolved[i] = true\n nothingResolved = false\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(\n fn.referTo.references, resolvedFunctions, signatureMap)\n if (resolvedReferences) {\n resolvedFunctions[i] =\n fn.referTo.callback.apply(this, resolvedReferences)\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo\n isResolved[i] = true\n nothingResolved = false\n } else {\n leftUnresolved = true\n }\n }\n }\n\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError(\n 'Circular reference detected in resolving typed.referTo')\n }\n }\n\n return resolvedFunctions\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis (signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/\n\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature]\n\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' +\n 'is deprecated since typed-function@3. ' +\n 'Use typed.referTo and typed.referToSelf instead.')\n }\n })\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction (name, rawSignaturesMap) {\n typed.createCount++\n\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided')\n }\n\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap)\n }\n\n // Main processing loop for signatures\n const parsedParams = []\n const originalFunctions = []\n const signaturesMap = {}\n const preliminarySignatures = [] // may have duplicates from conversions\n let signature\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue\n }\n // B) Parse the signature\n const params = parseSignature(signature)\n if (!params) continue\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' +\n stringifyParams(pp) + '\" and \"' +\n stringifyParams(params) + '\".')\n }\n })\n parsedParams.push(params)\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length\n originalFunctions.push(rawSignaturesMap[signature])\n const conversionParams = params.map(expandParam)\n // E) Split the signatures and collect them up\n let sp\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp)\n preliminarySignatures.push(\n { params: sp, name: spName, fn: functionIndex })\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex\n }\n }\n }\n\n preliminarySignatures.sort(compareSignatures)\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions =\n resolveReferences(originalFunctions, signaturesMap, theTypedFn)\n\n // Fill in the proper function for each signature\n let s\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]]\n }\n }\n const signatures = []\n const internalSignatureMap = new Map() // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn]\n signatures.push(s)\n internalSignatureMap.set(s.name, s)\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params)\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params)\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params)\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params)\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params)\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params)\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params)\n }\n\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk\n\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation =\n compileArgsPreprocessing(signatures[i].params, signatures[i].fn)\n }\n\n const fn0 = ok0 ? signatures[0].implementation : undef\n const fn1 = ok1 ? signatures[1].implementation : undef\n const fn2 = ok2 ? signatures[2].implementation : undef\n const fn3 = ok3 ? signatures[3].implementation : undef\n const fn4 = ok4 ? signatures[4].implementation : undef\n const fn5 = ok5 ? signatures[5].implementation : undef\n\n const len0 = ok0 ? signatures[0].params.length : -1\n const len1 = ok1 ? signatures[1].params.length : -1\n const len2 = ok2 ? signatures[2].params.length : -1\n const len3 = ok3 ? signatures[3].params.length : -1\n const len4 = ok4 ? signatures[4].params.length : -1\n const len5 = ok5 ? signatures[5].params.length : -1\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0\n const iEnd = signatures.length\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test)\n const fns = signatures.map(s => s.implementation)\n const generic = function generic () {\n 'use strict'\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments)\n }\n }\n\n return typed.onMismatch(name, arguments, signatures)\n }\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn (arg0, arg1) {\n 'use strict'\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) { return fn0.apply(this, arguments) }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) { return fn1.apply(this, arguments) }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) { return fn2.apply(this, arguments) }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) { return fn3.apply(this, arguments) }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) { return fn4.apply(this, arguments) }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) { return fn5.apply(this, arguments) }\n\n return generic.apply(this, arguments)\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', { value: name })\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n }\n\n return theTypedFn\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch (name, args, signatures) {\n throw createError(name, args, signatures)\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial (arr) {\n return slice(arr, 0, arr.length - 1)\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last (arr) {\n return arr[arr.length - 1]\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice (arr, start, end) {\n return Array.prototype.slice.call(arr, start, end)\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray (arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i]\n }\n }\n return undefined\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap (arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback))\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo () {\n const references =\n initial(arguments).map(s => stringifyParams(parseSignature(s)))\n const callback = last(arguments)\n\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument')\n }\n\n return makeReferTo(references, callback)\n }\n\n function makeReferTo (references, callback) {\n return { referTo: { references, callback } }\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument')\n }\n\n return { referToSelf: { callback } }\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo (objectOrFn) {\n return objectOrFn &&\n typeof objectOrFn.referTo === 'object' &&\n Array.isArray(objectOrFn.referTo.references) &&\n typeof objectOrFn.referTo.callback === 'function'\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf (objectOrFn) {\n return objectOrFn &&\n typeof objectOrFn.referToSelf === 'object' &&\n typeof objectOrFn.referToSelf.callback === 'function'\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName (nameSoFar, newName) {\n if (!nameSoFar) {\n return newName\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' +\n nameSoFar + ', actual: ' + newName + ')')\n err.data = { actual: newName, expected: nameSoFar }\n throw err\n }\n return nameSoFar\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName (obj) {\n let name\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) &&\n (isTypedFunction(obj[key]) ||\n typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name)\n }\n }\n return name\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures (dest, source) {\n let key\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice')\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n }\n throw err\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key]\n }\n }\n }\n\n const saveTyped = typed\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string'\n const start = named ? 1 : 0\n let name = named ? maybeName : ''\n const allSignatures = {}\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i]\n let theseSignatures = {}\n let thisName\n if (typeof item === 'function') {\n thisName = item.name\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item\n if (!named) {\n thisName = getObjectName(item)\n }\n }\n\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError(\n 'Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' +\n 'nor an object with signatures as keys and functions as values.')\n err.data = { index: i, argument: item }\n throw err\n }\n\n if (!named) {\n name = checkName(name, thisName)\n }\n mergeSignatures(allSignatures, theseSignatures)\n }\n\n return createTypedFunction(name || '', allSignatures)\n }\n\n typed.create = create\n typed.createCount = saveTyped.createCount\n typed.onMismatch = _onMismatch\n typed.throwMismatchError = _onMismatch\n typed.createError = createError\n typed.clear = clear\n typed.clearConversions = clearConversions\n typed.addTypes = addTypes\n typed._findType = findType // For unit testing only\n typed.referTo = referTo\n typed.referToSelf = referToSelf\n typed.convert = convert\n typed.findSignature = findSignature\n typed.find = find\n typed.isTypedFunction = isTypedFunction\n typed.warnAgainstDeprecatedThis = true\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any'\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object'\n }\n typed.addTypes([type], before)\n }\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion (conversion) {\n if (!conversion ||\n typeof conversion.from !== 'string' ||\n typeof conversion.to !== 'string' ||\n typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected')\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError(\n 'Illegal to define conversion from \"' + conversion.from +\n '\" to itself.')\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion, options = { override: false }) {\n _validateConversion(conversion)\n\n const to = findType(conversion.to)\n const existing = to.conversionsTo.find((other) => other.from === conversion.from)\n\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({ from: existing.from, to: conversion.to, convert: existing.convert })\n } else {\n throw new Error(\n 'There is already a conversion from \"' + conversion.from + '\" to \"' +\n to.name + '\"')\n }\n }\n\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n })\n }\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options))\n }\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion)\n const to = findType(conversion.to)\n const existingConversion =\n findInArray(to.conversionsTo, c => (c.from === conversion.from))\n if (!existingConversion) {\n throw new Error(\n 'Attempt to remove nonexistent conversion from ' + conversion.from +\n ' to ' + conversion.to)\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error(\n 'Conversion to remove does not match existing conversion')\n }\n const index = to.conversionsTo.indexOf(existingConversion)\n to.conversionsTo.splice(index, 1)\n }\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION)\n }\n const sigs = tf._typedFunctionData.signatures\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i]\n }\n }\n return null\n }\n\n return typed\n}\n\nexport default create()\n"],"mappings":"AAAA,SAASA,EAAEA,CAAA,EAAI;EACb,OAAO,IAAI;AACb;AAEA,SAASC,KAAKA,CAAA,EAAI;EAChB,OAAO,KAAK;AACd;AAEA,SAASC,KAAKA,CAAA,EAAI;EAChB,OAAOC,SAAS;AAClB;AAEA,MAAMC,kBAAkB,GAAG,mCAAmC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASC,MAAMA,CAAA,EAAI;EACjB;;EAEA;AACF;AACA;EACE,SAASC,aAAaA,CAAEC,CAAC,EAAE;IACzB,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,CAACC,WAAW,KAAKC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AAEC,OAAO,EAAE;IACrC,IAAI,CAAC9R,eAAe,CAAC6R,EAAE,CAAC,EAAE;MACxB,MAAM,IAAIrT,SAAS,CAAC3B,kBAAkB,CAAC;IACzC;IACA,MAAMkV,IAAI,GAAGF,EAAE,CAAC9Q,kBAAkB,CAACF,UAAU;IAC7C,KAAK,IAAI5B,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG8S,IAAI,CAAClT,MAAM,EAAE,EAAEI,CAAC,EAAE;MACpC,IAAI8S,IAAI,CAAC9S,CAAC,CAAC,CAAC5B,IAAI,CAACyU,OAAO,CAAC,EAAE;QACzB,OAAOC,IAAI,CAAC9S,CAAC,CAAC;MAChB;IACF;IACA,OAAO,IAAI;EACb,CAAC;EAED,OAAOlB,KAAK;AACd;AAEA,eAAejB,MAAM,CAAC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/typed-function/lib/umd/package.json b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js new file mode 100644 index 0000000..6f777a9 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js @@ -0,0 +1,1915 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["'typed'"] = factory()); +})(this, (function () { 'use strict'; + + function ok() { + return true; + } + function notOk() { + return false; + } + function undef() { + return undefined; + } + const NOT_TYPED_FUNCTION = 'Argument is not a typed-function.'; + + /** + * @typedef {{ + * params: Param[], + * fn: function, + * test: function, + * implementation: function + * }} Signature + * + * @typedef {{ + * types: Type[], + * hasAny: boolean, + * hasConversion: boolean, + * restParam: boolean + * }} Param + * + * @typedef {{ + * name: string, + * typeIndex: number, + * test: function, + * isAny: boolean, + * conversion?: ConversionDef, + * conversionIndex: number, + * }} Type + * + * @typedef {{ + * from: string, + * to: string, + * convert: function (*) : * + * }} ConversionDef + * + * @typedef {{ + * name: string, + * test: function(*) : boolean, + * isAny?: boolean + * }} TypeDef + */ + + /** + * @returns {() => function} + */ + function create() { + // data type tests + + /** + * Returns true if the argument is a non-null "plain" object + */ + function isPlainObject(x) { + return typeof x === 'object' && x !== null && x.constructor === Object; + } + const _types = [{ + name: 'number', + test: function (x) { + return typeof x === 'number'; + } + }, { + name: 'string', + test: function (x) { + return typeof x === 'string'; + } + }, { + name: 'boolean', + test: function (x) { + return typeof x === 'boolean'; + } + }, { + name: 'Function', + test: function (x) { + return typeof x === 'function'; + } + }, { + name: 'Array', + test: Array.isArray + }, { + name: 'Date', + test: function (x) { + return x instanceof Date; + } + }, { + name: 'RegExp', + test: function (x) { + return x instanceof RegExp; + } + }, { + name: 'Object', + test: isPlainObject + }, { + name: 'null', + test: function (x) { + return x === null; + } + }, { + name: 'undefined', + test: function (x) { + return x === undefined; + } + }]; + const anyType = { + name: 'any', + test: ok, + isAny: true + }; + + // Data structures to track the types. As these are local variables in + // create(), each typed universe will get its own copy, but the variables + // will only be accessible through the (closures of the) functions supplied + // as properties of the typed object, not directly. + // These will be initialized in clear() below + let typeMap; // primary store of all types + let typeList; // Array of just type names, for the sake of ordering + + // And similar data structures for the type conversions: + let nConversions = 0; + // the actual conversions are stored on a property of the destination types + + // This is a temporary object, will be replaced with a function at the end + let typed = { + createCount: 0 + }; + + /** + * Takes a type name and returns the corresponding official type object + * for that type. + * + * @param {string} typeName + * @returns {TypeDef} type + */ + function findType(typeName) { + const type = typeMap.get(typeName); + if (type) { + return type; + } + // Remainder is error handling + let message = 'Unknown type "' + typeName + '"'; + const name = typeName.toLowerCase(); + let otherName; + for (otherName of typeList) { + if (otherName.toLowerCase() === name) { + message += '. Did you mean "' + otherName + '" ?'; + break; + } + } + throw new TypeError(message); + } + + /** + * Adds an array `types` of type definitions to this typed instance. + * Each type definition should be an object with properties: + * 'name' - a string giving the name of the type; 'test' - function + * returning a boolean that tests membership in the type; and optionally + * 'isAny' - true only for the 'any' type. + * + * The second optional argument, `before`, gives the name of a type that + * these types should be added before. The new types are added in the + * order specified. + * @param {TypeDef[]} types + * @param {string | boolean} [beforeSpec='any'] before + */ + function addTypes(types) { + let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any'; + const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length; + const newTypes = []; + for (let i = 0; i < types.length; ++i) { + if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') { + throw new TypeError('Object with properties {name: string, test: function} expected'); + } + const typeName = types[i].name; + if (typeMap.has(typeName)) { + throw new TypeError('Duplicate type name "' + typeName + '"'); + } + newTypes.push(typeName); + typeMap.set(typeName, { + name: typeName, + test: types[i].test, + isAny: types[i].isAny, + index: beforeIndex + i, + conversionsTo: [] // Newly added type can't have any conversions to it + }); + } + // update the typeList + const affectedTypes = typeList.slice(beforeIndex); + typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes); + // Fix the indices + for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) { + typeMap.get(typeList[i]).index = i; + } + } + + /** + * Removes all types and conversions from this typed instance. + * May cause previously constructed typed-functions to throw + * strange errors when they are called with types that do not + * match any of their signatures. + */ + function clear() { + typeMap = new Map(); + typeList = []; + nConversions = 0; + addTypes([anyType], false); + } + + // initialize the types to the default list + clear(); + addTypes(_types); + + /** + * Removes all conversions, leaving the types alone. + */ + function clearConversions() { + let typeName; + for (typeName of typeList) { + typeMap.get(typeName).conversionsTo = []; + } + nConversions = 0; + } + + /** + * Find the type names that match a value. + * @param {*} value + * @return {string[]} Array of names of types for which + * the type test matches the value. + */ + function findTypeNames(value) { + const matches = typeList.filter(name => { + const type = typeMap.get(name); + return !type.isAny && type.test(value); + }); + if (matches.length) { + return matches; + } + return ['any']; + } + + /** + * Check if an entity is a typed function created by any instance + * @param {any} entity + * @returns {boolean} + */ + function isTypedFunction(entity) { + return entity && typeof entity === 'function' && '_typedFunctionData' in entity; + } + + /** + * Find a specific signature from a (composed) typed function, for example: + * + * typed.findSignature(fn, ['number', 'string']) + * typed.findSignature(fn, 'number, string') + * typed.findSignature(fn, 'number,string', {exact: true}) + * + * This function findSignature will by default return the best match to + * the given signature, possibly employing type conversions. + * + * The (optional) third argument is a plain object giving options + * controlling the signature search. Currently the only implemented + * option is `exact`: if specified as true (default is false), only + * exact matches will be returned (i.e. signatures for which `fn` was + * directly defined). Note that a (possibly different) type matching + * `any`, or one or more instances of TYPE matching `...TYPE` are + * considered exact matches in this regard, as no conversions are used. + * + * This function returns a "signature" object, as does `typed.resolve()`, + * which is a plain object with four keys: `params` (the array of parameters + * for this signature), `fn` (the originally supplied function for this + * signature), `test` (a generated function that determines if an argument + * list matches this signature, and `implementation` (the function to call + * on a matching argument list, that performs conversions if necessary and + * then calls the originally supplied function). + * + * @param {Function} fn A typed-function + * @param {string | string[]} signature + * Signature to be found, can be an array or a comma separated string. + * @param {object} options Controls the signature search as documented + * @return {{ params: Param[], fn: function, test: function, implementation: function }} + * Returns the matching signature, or throws an error when no signature + * is found. + */ + function findSignature(fn, signature, options) { + if (!isTypedFunction(fn)) { + throw new TypeError(NOT_TYPED_FUNCTION); + } + + // Canonicalize input + const exact = options && options.exact; + const stringSignature = Array.isArray(signature) ? signature.join(',') : signature; + const params = parseSignature(stringSignature); + const canonicalSignature = stringifyParams(params); + + // First hope we get lucky and exactly match a signature + if (!exact || canonicalSignature in fn.signatures) { + // OK, we can check the internal signatures + const match = fn._typedFunctionData.signatureMap.get(canonicalSignature); + if (match) { + return match; + } + } + + // Oh well, we did not; so we have to go back and check the parameters + // one by one, in order to catch things like `any` and rest params. + // Note here we can assume there is at least one parameter, because + // the empty signature would have matched successfully above. + const nParams = params.length; + let remainingSignatures; + if (exact) { + remainingSignatures = []; + let name; + for (name in fn.signatures) { + remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name)); + } + } else { + remainingSignatures = fn._typedFunctionData.signatures; + } + for (let i = 0; i < nParams; ++i) { + const want = params[i]; + const filteredSignatures = []; + let possibility; + for (possibility of remainingSignatures) { + const have = getParamAtIndex(possibility.params, i); + if (!have || want.restParam && !have.restParam) { + continue; + } + if (!have.hasAny) { + // have to check all of the wanted types are available + const haveTypes = paramTypeSet(have); + if (want.types.some(wtype => !haveTypes.has(wtype.name))) { + continue; + } + } + // OK, this looks good + filteredSignatures.push(possibility); + } + remainingSignatures = filteredSignatures; + if (remainingSignatures.length === 0) break; + } + // Return the first remaining signature that was totally matched: + let candidate; + for (candidate of remainingSignatures) { + if (candidate.params.length <= nParams) { + return candidate; + } + } + throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))'); + } + + /** + * Find the proper function to call for a specific signature from + * a (composed) typed function, for example: + * + * typed.find(fn, ['number', 'string']) + * typed.find(fn, 'number, string') + * typed.find(fn, 'number,string', {exact: true}) + * + * This function find will by default return the best match to + * the given signature, possibly employing type conversions (and returning + * a function that will perform those conversions as needed). The + * (optional) third argument is a plain object giving options contolling + * the signature search. Currently only the option `exact` is implemented, + * which defaults to "false". If `exact` is specified as true, then only + * exact matches will be returned (i.e. signatures for which `fn` was + * directly defined). Uses of `any` and `...TYPE` are considered exact if + * no conversions are necessary to apply the corresponding function. + * + * @param {Function} fn A typed-function + * @param {string | string[]} signature + * Signature to be found, can be an array or a comma separated string. + * @param {object} options Controls the signature match as documented + * @return {function} + * Returns the function to call for the given signature, or throws an + * error if no match is found. + */ + function find(fn, signature, options) { + return findSignature(fn, signature, options).implementation; + } + + /** + * Convert a given value to another data type, specified by type name. + * + * @param {*} value + * @param {string} typeName + */ + function convert(value, typeName) { + // check conversion is needed + const type = findType(typeName); + if (type.test(value)) { + return value; + } + const conversions = type.conversionsTo; + if (conversions.length === 0) { + throw new Error('There are no conversions to ' + typeName + ' defined.'); + } + for (let i = 0; i < conversions.length; i++) { + const fromType = findType(conversions[i].from); + if (fromType.test(value)) { + return conversions[i].convert(value); + } + } + throw new Error('Cannot convert ' + value + ' to ' + typeName); + } + + /** + * Stringify parameters in a normalized way + * @param {Param[]} params + * @param {string} [','] separator + * @return {string} + */ + function stringifyParams(params) { + let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ','; + return params.map(p => p.name).join(separator); + } + + /** + * Parse a parameter, like "...number | boolean" + * @param {string} param + * @return {Param} param + */ + function parseParam(param) { + const restParam = param.indexOf('...') === 0; + const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any'; + const typeDefs = types.split('|').map(s => findType(s.trim())); + let hasAny = false; + let paramName = restParam ? '...' : ''; + const exactTypes = typeDefs.map(function (type) { + hasAny = type.isAny || hasAny; + paramName += type.name + '|'; + return { + name: type.name, + typeIndex: type.index, + test: type.test, + isAny: type.isAny, + conversion: null, + conversionIndex: -1 + }; + }); + return { + types: exactTypes, + name: paramName.slice(0, -1), + // remove trailing '|' from above + hasAny, + hasConversion: false, + restParam + }; + } + + /** + * Expands a parsed parameter with the types available from currently + * defined conversions. + * @param {Param} param + * @return {Param} param + */ + function expandParam(param) { + const typeNames = param.types.map(t => t.name); + const matchingConversions = availableConversions(typeNames); + let hasAny = param.hasAny; + let newName = param.name; + const convertibleTypes = matchingConversions.map(function (conversion) { + const type = findType(conversion.from); + hasAny = type.isAny || hasAny; + newName += '|' + conversion.from; + return { + name: conversion.from, + typeIndex: type.index, + test: type.test, + isAny: type.isAny, + conversion, + conversionIndex: conversion.index + }; + }); + return { + types: param.types.concat(convertibleTypes), + name: newName, + hasAny, + hasConversion: convertibleTypes.length > 0, + restParam: param.restParam + }; + } + + /** + * Return the set of type names in a parameter. + * Caches the result for efficiency + * + * @param {Param} param + * @return {Set} typenames + */ + function paramTypeSet(param) { + if (!param.typeSet) { + param.typeSet = new Set(); + param.types.forEach(type => param.typeSet.add(type.name)); + } + return param.typeSet; + } + + /** + * Parse a signature with comma separated parameters, + * like "number | boolean, ...string" + * + * @param {string} signature + * @return {Param[]} params + */ + function parseSignature(rawSignature) { + const params = []; + if (typeof rawSignature !== 'string') { + throw new TypeError('Signatures must be strings'); + } + const signature = rawSignature.trim(); + if (signature === '') { + return params; + } + const rawParams = signature.split(','); + for (let i = 0; i < rawParams.length; ++i) { + const parsedParam = parseParam(rawParams[i].trim()); + if (parsedParam.restParam && i !== rawParams.length - 1) { + throw new SyntaxError('Unexpected rest parameter "' + rawParams[i] + '": ' + 'only allowed for the last parameter'); + } + // if invalid, short-circuit (all the types may have been filtered) + if (parsedParam.types.length === 0) { + return null; + } + params.push(parsedParam); + } + return params; + } + + /** + * Test whether a set of params contains a restParam + * @param {Param[]} params + * @return {boolean} Returns true when the last parameter is a restParam + */ + function hasRestParam(params) { + const param = last(params); + return param ? param.restParam : false; + } + + /** + * Create a type test for a single parameter, which can have one or multiple + * types. + * @param {Param} param + * @return {function(x: *) : boolean} Returns a test function + */ + function compileTest(param) { + if (!param || param.types.length === 0) { + // nothing to do + return ok; + } else if (param.types.length === 1) { + return findType(param.types[0].name).test; + } else if (param.types.length === 2) { + const test0 = findType(param.types[0].name).test; + const test1 = findType(param.types[1].name).test; + return function or(x) { + return test0(x) || test1(x); + }; + } else { + // param.types.length > 2 + const tests = param.types.map(function (type) { + return findType(type.name).test; + }); + return function or(x) { + for (let i = 0; i < tests.length; i++) { + if (tests[i](x)) { + return true; + } + } + return false; + }; + } + } + + /** + * Create a test for all parameters of a signature + * @param {Param[]} params + * @return {function(args: Array<*>) : boolean} + */ + function compileTests(params) { + let tests, test0, test1; + if (hasRestParam(params)) { + // variable arguments like '...number' + tests = initial(params).map(compileTest); + const varIndex = tests.length; + const lastTest = compileTest(last(params)); + const testRestParam = function (args) { + for (let i = varIndex; i < args.length; i++) { + if (!lastTest(args[i])) { + return false; + } + } + return true; + }; + return function testArgs(args) { + for (let i = 0; i < tests.length; i++) { + if (!tests[i](args[i])) { + return false; + } + } + return testRestParam(args) && args.length >= varIndex + 1; + }; + } else { + // no variable arguments + if (params.length === 0) { + return function testArgs(args) { + return args.length === 0; + }; + } else if (params.length === 1) { + test0 = compileTest(params[0]); + return function testArgs(args) { + return test0(args[0]) && args.length === 1; + }; + } else if (params.length === 2) { + test0 = compileTest(params[0]); + test1 = compileTest(params[1]); + return function testArgs(args) { + return test0(args[0]) && test1(args[1]) && args.length === 2; + }; + } else { + // arguments.length > 2 + tests = params.map(compileTest); + return function testArgs(args) { + for (let i = 0; i < tests.length; i++) { + if (!tests[i](args[i])) { + return false; + } + } + return args.length === tests.length; + }; + } + } + } + + /** + * Find the parameter at a specific index of a Params list. + * Handles rest parameters. + * @param {Param[]} params + * @param {number} index + * @return {Param | null} Returns the matching parameter when found, + * null otherwise. + */ + function getParamAtIndex(params, index) { + return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null; + } + + /** + * Get all type names of a parameter + * @param {Params[]} params + * @param {number} index + * @return {string[]} Returns an array with type names + */ + function getTypeSetAtIndex(params, index) { + const param = getParamAtIndex(params, index); + if (!param) { + return new Set(); + } + return paramTypeSet(param); + } + + /** + * Test whether a type is an exact type or conversion + * @param {Type} type + * @return {boolean} Returns true when + */ + function isExactType(type) { + return type.conversion === null || type.conversion === undefined; + } + + /** + * Helper function for creating error messages: create an array with + * all available types on a specific argument index. + * @param {Signature[]} signatures + * @param {number} index + * @return {string[]} Returns an array with available types + */ + function mergeExpectedParams(signatures, index) { + const typeSet = new Set(); + signatures.forEach(signature => { + const paramSet = getTypeSetAtIndex(signature.params, index); + let name; + for (name of paramSet) { + typeSet.add(name); + } + }); + return typeSet.has('any') ? ['any'] : Array.from(typeSet); + } + + /** + * Create + * @param {string} name The name of the function + * @param {array.<*>} args The actual arguments passed to the function + * @param {Signature[]} signatures A list with available signatures + * @return {TypeError} Returns a type error with additional data + * attached to it in the property `data` + */ + function createError(name, args, signatures) { + let err, expected; + const _name = name || 'unnamed'; + + // test for wrong type at some index + let matchingSignatures = signatures; + let index; + for (index = 0; index < args.length; index++) { + const nextMatchingDefs = []; + matchingSignatures.forEach(signature => { + const param = getParamAtIndex(signature.params, index); + const test = compileTest(param); + if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) { + nextMatchingDefs.push(signature); + } + }); + if (nextMatchingDefs.length === 0) { + // no matching signatures anymore, throw error "wrong type" + expected = mergeExpectedParams(matchingSignatures, index); + if (expected.length > 0) { + const actualTypes = findTypeNames(args[index]); + err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')'); + err.data = { + category: 'wrongType', + fn: _name, + index, + actual: actualTypes, + expected + }; + return err; + } + } else { + matchingSignatures = nextMatchingDefs; + } + } + + // test for too few arguments + const lengths = matchingSignatures.map(function (signature) { + return hasRestParam(signature.params) ? Infinity : signature.params.length; + }); + if (args.length < Math.min.apply(null, lengths)) { + expected = mergeExpectedParams(matchingSignatures, index); + err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')'); + err.data = { + category: 'tooFewArgs', + fn: _name, + index: args.length, + expected + }; + return err; + } + + // test for too many arguments + const maxLength = Math.max.apply(null, lengths); + if (args.length > maxLength) { + err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')'); + err.data = { + category: 'tooManyArgs', + fn: _name, + index: args.length, + expectedLength: maxLength + }; + return err; + } + + // Generic error + const argTypes = []; + for (let i = 0; i < args.length; ++i) { + argTypes.push(findTypeNames(args[i]).join('|')); + } + err = new TypeError('Arguments of type "' + argTypes.join(', ') + '" do not match any of the defined signatures of function ' + _name + '.'); + err.data = { + category: 'mismatch', + actual: argTypes + }; + return err; + } + + /** + * Find the lowest index of all exact types of a parameter (no conversions) + * @param {Param} param + * @return {number} Returns the index of the lowest type in typed.types + */ + function getLowestTypeIndex(param) { + let min = typeList.length + 1; + for (let i = 0; i < param.types.length; i++) { + if (isExactType(param.types[i])) { + min = Math.min(min, param.types[i].typeIndex); + } + } + return min; + } + + /** + * Find the lowest index of the conversion of all types of the parameter + * having a conversion + * @param {Param} param + * @return {number} Returns the lowest index of the conversions of this type + */ + function getLowestConversionIndex(param) { + let min = nConversions + 1; + for (let i = 0; i < param.types.length; i++) { + if (!isExactType(param.types[i])) { + min = Math.min(min, param.types[i].conversionIndex); + } + } + return min; + } + + /** + * Compare two params + * @param {Param} param1 + * @param {Param} param2 + * @return {number} returns -1 when param1 must get a lower + * index than param2, 1 when the opposite, + * or zero when both are equal + */ + function compareParams(param1, param2) { + // We compare a number of metrics on a param in turn: + // 1) 'any' parameters are the least preferred + if (param1.hasAny) { + if (!param2.hasAny) { + return 1; + } + } else if (param2.hasAny) { + return -1; + } + + // 2) Prefer non-rest to rest parameters + if (param1.restParam) { + if (!param2.restParam) { + return 1; + } + } else if (param2.restParam) { + return -1; + } + + // 3) Prefer exact type match to conversions + if (param1.hasConversion) { + if (!param2.hasConversion) { + return 1; + } + } else if (param2.hasConversion) { + return -1; + } + + // 4) Prefer lower type index: + const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2); + if (typeDiff < 0) { + return -1; + } + if (typeDiff > 0) { + return 1; + } + + // 5) Prefer lower conversion index + const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2); + if (convDiff < 0) { + return -1; + } + if (convDiff > 0) { + return 1; + } + + // Don't have a basis for preference + return 0; + } + + /** + * Compare two signatures + * @param {Signature} signature1 + * @param {Signature} signature2 + * @return {number} returns a negative number when param1 must get a lower + * index than param2, a positive number when the opposite, + * or zero when both are equal + */ + function compareSignatures(signature1, signature2) { + const pars1 = signature1.params; + const pars2 = signature2.params; + const last1 = last(pars1); + const last2 = last(pars2); + const hasRest1 = hasRestParam(pars1); + const hasRest2 = hasRestParam(pars2); + // We compare a number of metrics on signatures in turn: + // 1) An "any rest param" is least preferred + if (hasRest1 && last1.hasAny) { + if (!hasRest2 || !last2.hasAny) { + return 1; + } + } else if (hasRest2 && last2.hasAny) { + return -1; + } + + // 2) Minimize the number of 'any' parameters + let any1 = 0; + let conv1 = 0; + let par; + for (par of pars1) { + if (par.hasAny) ++any1; + if (par.hasConversion) ++conv1; + } + let any2 = 0; + let conv2 = 0; + for (par of pars2) { + if (par.hasAny) ++any2; + if (par.hasConversion) ++conv2; + } + if (any1 !== any2) { + return any1 - any2; + } + + // 3) A conversion rest param is less preferred + if (hasRest1 && last1.hasConversion) { + if (!hasRest2 || !last2.hasConversion) { + return 1; + } + } else if (hasRest2 && last2.hasConversion) { + return -1; + } + + // 4) Minimize the number of conversions + if (conv1 !== conv2) { + return conv1 - conv2; + } + + // 5) Prefer no rest param + if (hasRest1) { + if (!hasRest2) { + return 1; + } + } else if (hasRest2) { + return -1; + } + + // 6) Prefer shorter with rest param, longer without + const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1); + if (lengthCriterion !== 0) { + return lengthCriterion; + } + + // Signatures are identical in each of the above metrics. + // In particular, they are the same length. + // We can therefore compare the parameters one by one. + // First we count which signature has more preferred parameters. + const comparisons = []; + let tc = 0; + for (let i = 0; i < pars1.length; ++i) { + const thisComparison = compareParams(pars1[i], pars2[i]); + comparisons.push(thisComparison); + tc += thisComparison; + } + if (tc !== 0) { + return tc; + } + + // They have the same number of preferred parameters, so go by the + // earliest parameter in which we have a preference. + // In other words, dispatch is driven somewhat more by earlier + // parameters than later ones. + let c; + for (c of comparisons) { + if (c !== 0) { + return c; + } + } + + // It's a tossup: + return 0; + } + + /** + * Produce a list of all conversions from distinct types to one of + * the given types. + * + * @param {string[]} typeNames + * @return {ConversionDef[]} Returns the conversions that are available + * resulting in any given type (if any) + */ + function availableConversions(typeNames) { + if (typeNames.length === 0) { + return []; + } + const types = typeNames.map(findType); + if (typeNames.length > 1) { + types.sort((t1, t2) => t1.index - t2.index); + } + let matches = types[0].conversionsTo; + if (typeNames.length === 1) { + return matches; + } + matches = matches.concat([]); // shallow copy the matches + // Since the types are now in index order, we just want the first + // occurrence of any from type: + const knownTypes = new Set(typeNames); + for (let i = 1; i < types.length; ++i) { + let newMatch; + for (newMatch of types[i].conversionsTo) { + if (!knownTypes.has(newMatch.from)) { + matches.push(newMatch); + knownTypes.add(newMatch.from); + } + } + } + return matches; + } + + /** + * Preprocess arguments before calling the original function: + * - if needed convert the parameters + * - in case of rest parameters, move the rest parameters into an Array + * @param {Param[]} params + * @param {function} fn + * @return {function} Returns a wrapped function + */ + function compileArgsPreprocessing(params, fn) { + let fnConvert = fn; + + // TODO: can we make this wrapper function smarter/simpler? + + if (params.some(p => p.hasConversion)) { + const restParam = hasRestParam(params); + const compiledConversions = params.map(compileArgConversion); + fnConvert = function convertArgs() { + const args = []; + const last = restParam ? arguments.length - 1 : arguments.length; + for (let i = 0; i < last; i++) { + args[i] = compiledConversions[i](arguments[i]); + } + if (restParam) { + args[last] = arguments[last].map(compiledConversions[last]); + } + return fn.apply(this, args); + }; + } + let fnPreprocess = fnConvert; + if (hasRestParam(params)) { + const offset = params.length - 1; + fnPreprocess = function preprocessRestParams() { + return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)])); + }; + } + return fnPreprocess; + } + + /** + * Compile conversion for a parameter to the right type + * @param {Param} param + * @return {function} Returns the wrapped function that will convert arguments + * + */ + function compileArgConversion(param) { + let test0, test1, conversion0, conversion1; + const tests = []; + const conversions = []; + param.types.forEach(function (type) { + if (type.conversion) { + tests.push(findType(type.conversion.from).test); + conversions.push(type.conversion.convert); + } + }); + + // create optimized conversion functions depending on the number of conversions + switch (conversions.length) { + case 0: + return function convertArg(arg) { + return arg; + }; + case 1: + test0 = tests[0]; + conversion0 = conversions[0]; + return function convertArg(arg) { + if (test0(arg)) { + return conversion0(arg); + } + return arg; + }; + case 2: + test0 = tests[0]; + test1 = tests[1]; + conversion0 = conversions[0]; + conversion1 = conversions[1]; + return function convertArg(arg) { + if (test0(arg)) { + return conversion0(arg); + } + if (test1(arg)) { + return conversion1(arg); + } + return arg; + }; + default: + return function convertArg(arg) { + for (let i = 0; i < conversions.length; i++) { + if (tests[i](arg)) { + return conversions[i](arg); + } + } + return arg; + }; + } + } + + /** + * Split params with union types in to separate params. + * + * For example: + * + * splitParams([['Array', 'Object'], ['string', 'RegExp']) + * // returns: + * // [ + * // ['Array', 'string'], + * // ['Array', 'RegExp'], + * // ['Object', 'string'], + * // ['Object', 'RegExp'] + * // ] + * + * @param {Param[]} params + * @return {Param[]} + */ + function splitParams(params) { + function _splitParams(params, index, paramsSoFar) { + if (index < params.length) { + const param = params[index]; + let resultingParams = []; + if (param.restParam) { + // split the types of a rest parameter in two: + // one with only exact types, and one with exact types and conversions + const exactTypes = param.types.filter(isExactType); + if (exactTypes.length < param.types.length) { + resultingParams.push({ + types: exactTypes, + name: '...' + exactTypes.map(t => t.name).join('|'), + hasAny: exactTypes.some(t => t.isAny), + hasConversion: false, + restParam: true + }); + } + resultingParams.push(param); + } else { + // split all the types of a regular parameter into one type per param + resultingParams = param.types.map(function (type) { + return { + types: [type], + name: type.name, + hasAny: type.isAny, + hasConversion: type.conversion, + restParam: false + }; + }); + } + + // recurse over the groups with types + return flatMap(resultingParams, function (nextParam) { + return _splitParams(params, index + 1, paramsSoFar.concat([nextParam])); + }); + } else { + // we've reached the end of the parameters. + return [paramsSoFar]; + } + } + return _splitParams(params, 0, []); + } + + /** + * Test whether two param lists represent conflicting signatures + * @param {Param[]} params1 + * @param {Param[]} params2 + * @return {boolean} Returns true when the signatures conflict, false otherwise. + */ + function conflicting(params1, params2) { + const ii = Math.max(params1.length, params2.length); + for (let i = 0; i < ii; i++) { + const typeSet1 = getTypeSetAtIndex(params1, i); + const typeSet2 = getTypeSetAtIndex(params2, i); + let overlap = false; + let name; + for (name of typeSet2) { + if (typeSet1.has(name)) { + overlap = true; + break; + } + } + if (!overlap) { + return false; + } + } + const len1 = params1.length; + const len2 = params2.length; + const restParam1 = hasRestParam(params1); + const restParam2 = hasRestParam(params2); + return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2; + } + + /** + * Helper function for `resolveReferences` that returns a copy of + * functionList wihe any prior resolutions cleared out, in case we are + * recycling signatures from a prior typed function construction. + * + * @param {Array.} functionList + * @return {Array.} + */ + function clearResolutions(functionList) { + return functionList.map(fn => { + if (isReferToSelf(fn)) { + return referToSelf(fn.referToSelf.callback); + } + if (isReferTo(fn)) { + return makeReferTo(fn.referTo.references, fn.referTo.callback); + } + return fn; + }); + } + + /** + * Take a list of references, a list of functions functionList, and a + * signatureMap indexing signatures into functionList, and return + * the list of resolutions, or a false-y value if they don't all + * resolve in a valid way (yet). + * + * @param {string[]} references + * @param {Array} signatureMap + * @return {function[] | false} resolutions + */ + function collectResolutions(references, functionList, signatureMap) { + const resolvedReferences = []; + let reference; + for (reference of references) { + let resolution = signatureMap[reference]; + if (typeof resolution !== 'number') { + throw new TypeError('No definition for referenced signature "' + reference + '"'); + } + resolution = functionList[resolution]; + if (typeof resolution !== 'function') { + return false; + } + resolvedReferences.push(resolution); + } + return resolvedReferences; + } + + /** + * Resolve any references in the functionList for the typed function + * itself. The signatureMap tells which index in the functionList a + * given signature should be mapped to (for use in resolving typed.referTo) + * and self provides the destions of a typed.referToSelf. + * + * @param {Array} functionList + * @param {Object.} signatureMap + * @param {function} self The typed-function itself + * @return {Array} The list of resolved functions + */ + function resolveReferences(functionList, signatureMap, self) { + const resolvedFunctions = clearResolutions(functionList); + const isResolved = new Array(resolvedFunctions.length).fill(false); + let leftUnresolved = true; + while (leftUnresolved) { + leftUnresolved = false; + let nothingResolved = true; + for (let i = 0; i < resolvedFunctions.length; ++i) { + if (isResolved[i]) continue; + const fn = resolvedFunctions[i]; + if (isReferToSelf(fn)) { + resolvedFunctions[i] = fn.referToSelf.callback(self); + // Preserve reference in case signature is reused someday: + resolvedFunctions[i].referToSelf = fn.referToSelf; + isResolved[i] = true; + nothingResolved = false; + } else if (isReferTo(fn)) { + const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap); + if (resolvedReferences) { + resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences); + // Preserve reference in case signature is reused someday: + resolvedFunctions[i].referTo = fn.referTo; + isResolved[i] = true; + nothingResolved = false; + } else { + leftUnresolved = true; + } + } + } + if (nothingResolved && leftUnresolved) { + throw new SyntaxError('Circular reference detected in resolving typed.referTo'); + } + } + return resolvedFunctions; + } + + /** + * Validate whether any of the function bodies contains a self-reference + * usage like `this(...)` or `this.signatures`. This self-referencing is + * deprecated since typed-function v3. It has been replaced with + * the functions typed.referTo and typed.referToSelf. + * @param {Object.} signaturesMap + */ + function validateDeprecatedThis(signaturesMap) { + // TODO: remove this deprecation warning logic some day (it's introduced in v3) + + // match occurrences like 'this(' and 'this.signatures' + const deprecatedThisRegex = /\bthis(\(|\.signatures\b)/; + Object.keys(signaturesMap).forEach(signature => { + const fn = signaturesMap[signature]; + if (deprecatedThisRegex.test(fn.toString())) { + throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.'); + } + }); + } + + /** + * Create a typed function + * @param {String} name The name for the typed function + * @param {Object.} rawSignaturesMap + * An object with one or + * multiple signatures as key, and the + * function corresponding to the + * signature as value. + * @return {function} Returns the created typed function. + */ + function createTypedFunction(name, rawSignaturesMap) { + typed.createCount++; + if (Object.keys(rawSignaturesMap).length === 0) { + throw new SyntaxError('No signatures provided'); + } + if (typed.warnAgainstDeprecatedThis) { + validateDeprecatedThis(rawSignaturesMap); + } + + // Main processing loop for signatures + const parsedParams = []; + const originalFunctions = []; + const signaturesMap = {}; + const preliminarySignatures = []; // may have duplicates from conversions + let signature; + for (signature in rawSignaturesMap) { + // A) Protect against polluted Object prototype: + if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) { + continue; + } + // B) Parse the signature + const params = parseSignature(signature); + if (!params) continue; + // C) Check for conflicts + parsedParams.forEach(function (pp) { + if (conflicting(pp, params)) { + throw new TypeError('Conflicting signatures "' + stringifyParams(pp) + '" and "' + stringifyParams(params) + '".'); + } + }); + parsedParams.push(params); + // D) Store the provided function and add conversions + const functionIndex = originalFunctions.length; + originalFunctions.push(rawSignaturesMap[signature]); + const conversionParams = params.map(expandParam); + // E) Split the signatures and collect them up + let sp; + for (sp of splitParams(conversionParams)) { + const spName = stringifyParams(sp); + preliminarySignatures.push({ + params: sp, + name: spName, + fn: functionIndex + }); + if (sp.every(p => !p.hasConversion)) { + signaturesMap[spName] = functionIndex; + } + } + } + preliminarySignatures.sort(compareSignatures); + + // Note the forward reference to theTypedFn + const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn); + + // Fill in the proper function for each signature + let s; + for (s in signaturesMap) { + if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) { + signaturesMap[s] = resolvedFunctions[signaturesMap[s]]; + } + } + const signatures = []; + const internalSignatureMap = new Map(); // benchmarks faster than object + for (s of preliminarySignatures) { + // Note it's only safe to eliminate duplicates like this + // _after_ the signature sorting step above; otherwise we might + // remove the wrong one. + if (!internalSignatureMap.has(s.name)) { + s.fn = resolvedFunctions[s.fn]; + signatures.push(s); + internalSignatureMap.set(s.name, s); + } + } + + // we create a highly optimized checks for the first couple of signatures with max 2 arguments + const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params); + const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params); + const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params); + const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params); + const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params); + const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params); + const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5; + + // compile the tests + for (let i = 0; i < signatures.length; ++i) { + signatures[i].test = compileTests(signatures[i].params); + } + const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk; + const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk; + const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk; + const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk; + const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk; + const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk; + const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk; + const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk; + const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk; + const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk; + const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk; + const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk; + + // compile the functions + for (let i = 0; i < signatures.length; ++i) { + signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn); + } + const fn0 = ok0 ? signatures[0].implementation : undef; + const fn1 = ok1 ? signatures[1].implementation : undef; + const fn2 = ok2 ? signatures[2].implementation : undef; + const fn3 = ok3 ? signatures[3].implementation : undef; + const fn4 = ok4 ? signatures[4].implementation : undef; + const fn5 = ok5 ? signatures[5].implementation : undef; + const len0 = ok0 ? signatures[0].params.length : -1; + const len1 = ok1 ? signatures[1].params.length : -1; + const len2 = ok2 ? signatures[2].params.length : -1; + const len3 = ok3 ? signatures[3].params.length : -1; + const len4 = ok4 ? signatures[4].params.length : -1; + const len5 = ok5 ? signatures[5].params.length : -1; + + // simple and generic, but also slow + const iStart = allOk ? 6 : 0; + const iEnd = signatures.length; + // de-reference ahead for execution speed: + const tests = signatures.map(s => s.test); + const fns = signatures.map(s => s.implementation); + const generic = function generic() { + + for (let i = iStart; i < iEnd; i++) { + if (tests[i](arguments)) { + return fns[i].apply(this, arguments); + } + } + return typed.onMismatch(name, arguments, signatures); + }; + + // create the typed function + // fast, specialized version. Falls back to the slower, generic one if needed + function theTypedFn(arg0, arg1) { + + if (arguments.length === len0 && test00(arg0) && test01(arg1)) { + return fn0.apply(this, arguments); + } + if (arguments.length === len1 && test10(arg0) && test11(arg1)) { + return fn1.apply(this, arguments); + } + if (arguments.length === len2 && test20(arg0) && test21(arg1)) { + return fn2.apply(this, arguments); + } + if (arguments.length === len3 && test30(arg0) && test31(arg1)) { + return fn3.apply(this, arguments); + } + if (arguments.length === len4 && test40(arg0) && test41(arg1)) { + return fn4.apply(this, arguments); + } + if (arguments.length === len5 && test50(arg0) && test51(arg1)) { + return fn5.apply(this, arguments); + } + return generic.apply(this, arguments); + } + + // attach name the typed function + try { + Object.defineProperty(theTypedFn, 'name', { + value: name + }); + } catch (err) { + // old browsers do not support Object.defineProperty and some don't support setting the name property + // the function name is not essential for the functioning, it's mostly useful for debugging, + // so it's fine to have unnamed functions. + } + + // attach signatures to the function. + // This property is close to the original collection of signatures + // used to create the typed-function, just with unions split: + theTypedFn.signatures = signaturesMap; + + // Store internal data for functions like resolve, find, etc. + // Also serves as the flag that this is a typed-function + theTypedFn._typedFunctionData = { + signatures, + signatureMap: internalSignatureMap + }; + return theTypedFn; + } + + /** + * Action to take on mismatch + * @param {string} name Name of function that was attempted to be called + * @param {Array} args Actual arguments to the call + * @param {Array} signatures Known signatures of the named typed-function + */ + function _onMismatch(name, args, signatures) { + throw createError(name, args, signatures); + } + + /** + * Return all but the last items of an array or function Arguments + * @param {Array | Arguments} arr + * @return {Array} + */ + function initial(arr) { + return slice(arr, 0, arr.length - 1); + } + + /** + * return the last item of an array or function Arguments + * @param {Array | Arguments} arr + * @return {*} + */ + function last(arr) { + return arr[arr.length - 1]; + } + + /** + * Slice an array or function Arguments + * @param {Array | Arguments | IArguments} arr + * @param {number} start + * @param {number} [end] + * @return {Array} + */ + function slice(arr, start, end) { + return Array.prototype.slice.call(arr, start, end); + } + + /** + * Return the first item from an array for which test(arr[i]) returns true + * @param {Array} arr + * @param {function} test + * @return {* | undefined} Returns the first matching item + * or undefined when there is no match + */ + function findInArray(arr, test) { + for (let i = 0; i < arr.length; i++) { + if (test(arr[i])) { + return arr[i]; + } + } + return undefined; + } + + /** + * Flat map the result invoking a callback for every item in an array. + * https://gist.github.com/samgiles/762ee337dff48623e729 + * @param {Array} arr + * @param {function} callback + * @return {Array} + */ + function flatMap(arr, callback) { + return Array.prototype.concat.apply([], arr.map(callback)); + } + + /** + * Create a reference callback to one or multiple signatures + * + * Syntax: + * + * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) { + * // ... + * }) + * + * @returns {{referTo: {references: string[], callback}}} + */ + function referTo() { + const references = initial(arguments).map(s => stringifyParams(parseSignature(s))); + const callback = last(arguments); + if (typeof callback !== 'function') { + throw new TypeError('Callback function expected as last argument'); + } + return makeReferTo(references, callback); + } + function makeReferTo(references, callback) { + return { + referTo: { + references, + callback + } + }; + } + + /** + * Create a reference callback to the typed-function itself + * + * @param {(self: function) => function} callback + * @returns {{referToSelf: { callback: function }}} + */ + function referToSelf(callback) { + if (typeof callback !== 'function') { + throw new TypeError('Callback function expected as first argument'); + } + return { + referToSelf: { + callback + } + }; + } + + /** + * Test whether something is a referTo object, holding a list with reference + * signatures and a callback. + * + * @param {Object | function} objectOrFn + * @returns {boolean} + */ + function isReferTo(objectOrFn) { + return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function'; + } + + /** + * Test whether something is a referToSelf object, holding a callback where + * to pass `self`. + * + * @param {Object | function} objectOrFn + * @returns {boolean} + */ + function isReferToSelf(objectOrFn) { + return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function'; + } + + /** + * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw + * an error in case (C). + * + * @param { string | undefined } nameSoFar + * @param { string | undefined } newName + * @returns { string } updated name + */ + function checkName(nameSoFar, newName) { + if (!nameSoFar) { + return newName; + } + if (newName && newName !== nameSoFar) { + const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')'); + err.data = { + actual: newName, + expected: nameSoFar + }; + throw err; + } + return nameSoFar; + } + + /** + * Retrieve the implied name from an object with signature keys + * and function values, checking whether all value names match + * + * @param { {string: function} } obj + */ + function getObjectName(obj) { + let name; + for (const key in obj) { + // Only pay attention to own properties, and only if their values + // are typed functions or functions with a signature property + if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) { + name = checkName(name, obj[key].name); + } + } + return name; + } + + /** + * Copy all of the signatures from the second argument into the first, + * which is modified by side effect, checking for conflicts + * + * @param {Object.} dest + * @param {Object.} source + */ + function mergeSignatures(dest, source) { + let key; + for (key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + if (key in dest) { + if (source[key] !== dest[key]) { + const err = new Error('Signature "' + key + '" is defined twice'); + err.data = { + signature: key, + sourceFunction: source[key], + destFunction: dest[key] + }; + throw err; + } + // else: both signatures point to the same function, that's fine + } + dest[key] = source[key]; + } + } + } + const saveTyped = typed; + + /** + * Originally the main function was a typed function itself, but then + * it might not be able to generate error messages if the client + * replaced the type system with different names. + * + * Main entry: typed([name], functions/objects with signatures...) + * + * Assembles and returns a new typed-function from the given items + * that provide signatures and implementations, each of which may be + * * a plain object mapping (string) signatures to implementing functions, + * * a previously constructed typed function, or + * * any other single function with a string-valued property `signature`. + * The name of the resulting typed-function will be given by the + * string-valued name argument if present, or if not, by the name + * of any of the arguments that have one, as long as any that do are + * consistent with each other. If no name is specified, the name will be + * an empty string. + * + * @param {string} maybeName [optional] + * @param {(function|object)[]} signature providers + * @returns {typed-function} + */ + typed = function (maybeName) { + const named = typeof maybeName === 'string'; + const start = named ? 1 : 0; + let name = named ? maybeName : ''; + const allSignatures = {}; + for (let i = start; i < arguments.length; ++i) { + const item = arguments[i]; + let theseSignatures = {}; + let thisName; + if (typeof item === 'function') { + thisName = item.name; + if (typeof item.signature === 'string') { + // Case 1: Ordinary function with a string 'signature' property + theseSignatures[item.signature] = item; + } else if (isTypedFunction(item)) { + // Case 2: Existing typed function + theseSignatures = item.signatures; + } + } else if (isPlainObject(item)) { + // Case 3: Plain object, assume keys = signatures, values = functions + theseSignatures = item; + if (!named) { + thisName = getObjectName(item); + } + } + if (Object.keys(theseSignatures).length === 0) { + const err = new TypeError('Argument to \'typed\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.'); + err.data = { + index: i, + argument: item + }; + throw err; + } + if (!named) { + name = checkName(name, thisName); + } + mergeSignatures(allSignatures, theseSignatures); + } + return createTypedFunction(name || '', allSignatures); + }; + typed.create = create; + typed.createCount = saveTyped.createCount; + typed.onMismatch = _onMismatch; + typed.throwMismatchError = _onMismatch; + typed.createError = createError; + typed.clear = clear; + typed.clearConversions = clearConversions; + typed.addTypes = addTypes; + typed._findType = findType; // For unit testing only + typed.referTo = referTo; + typed.referToSelf = referToSelf; + typed.convert = convert; + typed.findSignature = findSignature; + typed.find = find; + typed.isTypedFunction = isTypedFunction; + typed.warnAgainstDeprecatedThis = true; + + /** + * add a type (convenience wrapper for typed.addTypes) + * @param {{name: string, test: function}} type + * @param {boolean} [beforeObjectTest=true] + * If true, the new test will be inserted before + * the test with name 'Object' (if any), since + * tests for Object match Array and classes too. + */ + typed.addType = function (type, beforeObjectTest) { + let before = 'any'; + if (beforeObjectTest !== false && typeMap.has('Object')) { + before = 'Object'; + } + typed.addTypes([type], before); + }; + + /** + * Verify that the ConversionDef conversion has a valid format. + * + * @param {conversionDef} conversion + * @return {void} + * @throws {TypeError|SyntaxError} + */ + function _validateConversion(conversion) { + if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') { + throw new TypeError('Object with properties {from: string, to: string, convert: function} expected'); + } + if (conversion.to === conversion.from) { + throw new SyntaxError('Illegal to define conversion from "' + conversion.from + '" to itself.'); + } + } + + /** + * Add a conversion + * + * @param {ConversionDef} conversion + * @param {{override: boolean}} [options] + * @returns {void} + * @throws {TypeError} + */ + typed.addConversion = function (conversion) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + override: false + }; + _validateConversion(conversion); + const to = findType(conversion.to); + const existing = to.conversionsTo.find(other => other.from === conversion.from); + if (existing) { + if (options && options.override) { + typed.removeConversion({ + from: existing.from, + to: conversion.to, + convert: existing.convert + }); + } else { + throw new Error('There is already a conversion from "' + conversion.from + '" to "' + to.name + '"'); + } + } + to.conversionsTo.push({ + from: conversion.from, + convert: conversion.convert, + index: nConversions++ + }); + }; + + /** + * Convenience wrapper to call addConversion on each conversion in a list. + * + * @param {ConversionDef[]} conversions + * @param {{override: boolean}} [options] + * @returns {void} + * @throws {TypeError} + */ + typed.addConversions = function (conversions, options) { + conversions.forEach(conversion => typed.addConversion(conversion, options)); + }; + + /** + * Remove the specified conversion. The format is the same as for + * addConversion, and the convert function must match or an error + * is thrown. + * + * @param {{from: string, to: string, convert: function}} conversion + * @returns {void} + * @throws {TypeError|SyntaxError|Error} + */ + typed.removeConversion = function (conversion) { + _validateConversion(conversion); + const to = findType(conversion.to); + const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from); + if (!existingConversion) { + throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to); + } + if (existingConversion.convert !== conversion.convert) { + throw new Error('Conversion to remove does not match existing conversion'); + } + const index = to.conversionsTo.indexOf(existingConversion); + to.conversionsTo.splice(index, 1); + }; + + /** + * Produce the specific signature that a typed function + * will execute on the given arguments. Here, a "signature" is an + * object with properties 'params', 'test', 'fn', and 'implementation'. + * This last property is a function that converts params as necessary + * and then calls 'fn'. Returns null if there is no matching signature. + * @param {typed-function} tf + * @param {any[]} argList + * @returns {{params: string, test: function, fn: function, implementation: function}} + */ + typed.resolve = function (tf, argList) { + if (!isTypedFunction(tf)) { + throw new TypeError(NOT_TYPED_FUNCTION); + } + const sigs = tf._typedFunctionData.signatures; + for (let i = 0; i < sigs.length; ++i) { + if (sigs[i].test(argList)) { + return sigs[i]; + } + } + return null; + }; + return typed; + } + var typedFunction = create(); + + return typedFunction; + +})); +//# sourceMappingURL=typed-function.js.map diff --git a/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js.map b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js.map new file mode 100644 index 0000000..6752d70 --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/lib/umd/typed-function.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typed-function.js","sources":["../esm/typed-function.mjs"],"sourcesContent":["function ok() {\n return true;\n}\nfunction notOk() {\n return false;\n}\nfunction undef() {\n return undefined;\n}\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n 'use strict';\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n 'use strict';\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n}\nexport default create();\n//# sourceMappingURL=typed-function.mjs.map"],"names":[],"mappings":";;;;;;EAAA,SAAS,EAAE,GAAG;EACd,EAAE,OAAO,IAAI,CAAC;EACd,CAAC;EACD,SAAS,KAAK,GAAG;EACjB,EAAE,OAAO,KAAK,CAAC;EACf,CAAC;EACD,SAAS,KAAK,GAAG;EACjB,EAAE,OAAO,SAAS,CAAC;EACnB,CAAC;EACD,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAC/D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EACA,SAAS,MAAM,GAAG;EAClB;AACA;EACA;EACA;EACA;EACA,EAAE,SAAS,aAAa,CAAC,CAAC,EAAE;EAC5B,IAAI,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC;EAC3E,GAAG;EACH,EAAE,MAAM,MAAM,GAAG,CAAC;EAClB,IAAI,IAAI,EAAE,QAAQ;EAClB,IAAI,IAAI,EAAE,UAAU,CAAC,EAAE;EACvB,MAAM,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;EACnC,KAAK;EACL,GAAG,EAAE;EACL,IAAI,IAAI,EAAE,QAAQ;EAClB,IAAI,IAAI,EAAE,UAAU,CAAC,EAAE;EACvB,MAAM,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;EACnC,KAAK;EACL,GAAG,EAAE;EACL,IAAI,IAAI,EAAE,SAAS;EACnB,IAAI,IAAI,EAAE,UAA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IAAI,OAAO,IAAI,CAAC;EAChB,GAAG,CAAC;EACJ,EAAE,OAAO,KAAK,CAAC;EACf,CAAC;AACD,sBAAe,MAAM,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/24_10_22_faktorialis/node_modules/typed-function/package.json b/24_10_22_faktorialis/node_modules/typed-function/package.json new file mode 100644 index 0000000..e168d7b --- /dev/null +++ b/24_10_22_faktorialis/node_modules/typed-function/package.json @@ -0,0 +1,65 @@ +{ + "name": "typed-function", + "version": "4.2.1", + "description": "Type checking for JavaScript functions", + "author": "Jos de Jong (https://github.com/josdejong)", + "contributors": [ + "Glen Whitney (https://github.com/gwhitney)", + "Luke Gumbley (https://github.com/luke-gumbley)" + ], + "homepage": "https://github.com/josdejong/typed-function", + "repository": { + "type": "git", + "url": "https://github.com/josdejong/typed-function.git" + }, + "keywords": [ + "typed", + "function", + "arguments", + "compose", + "types" + ], + "type": "module", + "main": "lib/umd/typed-function.js", + "module": "lib/esm/typed-function.mjs", + "browser": "lib/umd/typed-function.js", + "scripts": { + "test": "mocha test --recursive", + "test:lib": "mocha test test-lib --recursive", + "build": "npm-run-all build:**", + "build:clean": "del-cli lib", + "build:esm": "babel src --out-dir lib/esm --out-file-extension .mjs --source-maps --config-file ./babel.config.json", + "build:umd": "rollup lib/esm/typed-function.mjs --format umd --name 'typed' --sourcemap --output.file lib/umd/typed-function.js && cpy tools/cjs/package.json lib/umd --flat", + "build-and-test": "npm run lint && npm run build && npm run test:lib", + "lint": "eslint --cache src/**/*.mjs test/**/*.mjs test-lib/**/*.mjs", + "format": "npm run lint -- --fix", + "coverage": "c8 --reporter=lcov --reporter=text-summary mocha test --recursive && echo \"\nCoverage report is available at ./coverage/lcov-report/index.html\"", + "prepublishOnly": "npm run build-and-test" + }, + "engines": { + "node": ">= 18" + }, + "devDependencies": { + "@babel/cli": "7.24.6", + "@babel/preset-env": "7.24.6", + "benchmark": "2.1.4", + "c8": "9.1.0", + "cpy-cli": "5.0.0", + "del-cli": "5.1.0", + "eslint": "8.56.0", + "eslint-config-standard": "17.1.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-n": "16.6.2", + "eslint-plugin-promise": "6.2.0", + "mocha": "10.4.0", + "npm-run-all": "4.1.5", + "pad-right": "0.2.2", + "rollup": "4.18.0" + }, + "files": [ + "README.md", + "LICENSE.md", + "lib" + ], + "license": "MIT" +} \ No newline at end of file diff --git a/24_10_22_faktorialis/package-lock.json b/24_10_22_faktorialis/package-lock.json new file mode 100644 index 0000000..f1eda14 --- /dev/null +++ b/24_10_22_faktorialis/package-lock.json @@ -0,0 +1,122 @@ +{ + "name": "24_10_22_faktorialis", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "24_10_22_faktorialis", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "mathjs": "^13.2.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/complex.js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.3.0.tgz", + "integrity": "sha512-wWHzifVdUPbPBhh+ObvpVGIzrAQjTvmnnEJKBfLW5YbyAB6OXQ0r+Q92fByMIrSSlxUuCujqxriJSR6R/kVxPA==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "license": "MIT" + }, + "node_modules/escape-latex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", + "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", + "license": "MIT" + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "license": "MIT" + }, + "node_modules/mathjs": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-13.2.0.tgz", + "integrity": "sha512-P5PZoiUX2Tkghkv3tsSqlK0B9My/ErKapv1j6wdxd0MOrYQ30cnGE4LH/kzYB2gA5rN46Njqc4cFgJjaxgijoQ==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.25.6", + "complex.js": "^2.1.1", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "^4.3.7", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.2.1" + }, + "bin": { + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, + "node_modules/seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", + "license": "MIT" + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "license": "MIT" + }, + "node_modules/typed-function": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz", + "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + } + } +} diff --git a/24_10_22_faktorialis/package.json b/24_10_22_faktorialis/package.json new file mode 100644 index 0000000..bc58e58 --- /dev/null +++ b/24_10_22_faktorialis/package.json @@ -0,0 +1,15 @@ +{ + "name": "24_10_22_faktorialis", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "mathjs": "^13.2.0" + } +} diff --git a/24_10_22_faktorialis/script.mjs b/24_10_22_faktorialis/script.mjs new file mode 100644 index 0000000..f2d84e3 --- /dev/null +++ b/24_10_22_faktorialis/script.mjs @@ -0,0 +1,3 @@ +import * as factorial from "./factorial.mjs"; + +console.log(factorial.factorial(2)); \ No newline at end of file